:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #191b20;
  color: #e7e9ed;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background: #191b20;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 54px;
  display: grid;
  grid-template-columns: 220px minmax(240px, 520px) 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  border-bottom: 1px solid #30343b;
  background: rgba(29, 31, 36, 0.96);
  backdrop-filter: blur(14px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #f1f3f6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 680;
}

.portal-brand img {
  width: 29px;
  height: 29px;
  border: 1px solid #3a3e46;
  border-radius: 5px;
}

.portal-brand small {
  padding: 2px 5px;
  border: 1px solid #444a54;
  border-radius: 4px;
  color: #8f97a3;
  font-size: 9px;
  font-weight: 600;
}

.portal-search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #373c45;
  border-radius: 6px;
  background: #24272d;
}

.portal-search:focus-within {
  border-color: #5b8fd9;
}

.portal-search svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #858e9a;
  stroke-width: 1.8;
}

.portal-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #e5e8ec;
  font-size: 12px;
}

.portal-search input::placeholder {
  color: #707884;
}

.portal-header-actions {
  display: flex;
  justify-content: flex-end;
}

.portal-header-actions a {
  height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #414751;
  border-radius: 5px;
  color: #cfd4dc;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.portal-header-actions a:hover {
  border-color: #5b8fd9;
  background: rgba(91, 143, 217, 0.1);
  color: #e8f1ff;
}

.portal-layout {
  width: min(1160px, 100%);
  min-height: calc(100vh - 54px);
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 38px;
  margin: 0 auto;
  padding: 26px 22px 80px;
}

.portal-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 106px);
  display: flex;
  flex-direction: column;
}

.portal-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portal-sidebar nav a {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border-radius: 5px;
  color: #9ca4af;
  text-decoration: none;
  font-size: 12px;
  font-weight: 580;
}

.portal-sidebar nav a:hover {
  background: #23262c;
  color: #e0e4e9;
}

.portal-sidebar nav a.is-active {
  background: #292d34;
  color: #f0f2f5;
}

.portal-sidebar nav svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin-top: auto;
  padding: 16px 11px 0;
  border-top: 1px solid #2d3037;
}

.portal-sidebar-footer a {
  color: #686f7a;
  text-decoration: none;
  font-size: 10px;
}

.portal-sidebar-footer a:hover {
  color: #b5bbc4;
}

.portal-main {
  min-width: 0;
}

.feed-header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 2px 2px 15px;
}

.feed-header h1 {
  margin: 0;
  color: #f0f2f5;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.feed-subtitle {
  margin: 4px 0 0;
  color: #777f8a;
  font-size: 11px;
}

.feed-count {
  margin: 5px 0 0 auto;
  color: #686f79;
  font-size: 10px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.publication-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #30343b;
  border-radius: 7px;
  background: #202329;
}

.publication-card:hover {
  border-color: #3d424b;
}

.publication-accent {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: #5b8fd9;
}

.publication-card.is-calc .publication-accent {
  background: #d59b3d;
}

.publication-card-header {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px 7px 18px;
  border-bottom: 1px solid #2d3138;
}

.creator {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cdd2d9;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.creator:hover {
  color: #f0f3f7;
}

.creator-avatar {
  width: 27px;
  height: 27px;
  display: block;
  overflow: hidden;
  border: 1px solid #40454e;
  border-radius: 50%;
}

.creator-avatar img,
.creator-initials {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
  color: white;
  font-size: 9px;
  font-weight: 700;
}

.publication-date {
  margin-left: auto;
  color: #69717c;
  font-size: 9px;
}

.publication-body {
  display: block;
  min-height: 126px;
  padding: 20px 26px 22px;
  color: inherit;
  text-decoration: none;
}

.publication-type {
  display: inline-block;
  margin-bottom: 9px;
  color: #74a7ea;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.is-calc .publication-type {
  color: #e2aa50;
}

.publication-body h2 {
  margin: 0;
  color: #f0f2f5;
  font-size: 19px;
  font-weight: 680;
  line-height: 1.28;
  letter-spacing: 0;
}

.publication-body p {
  margin: 10px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: #9ba3ae;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 12px;
  line-height: 1.55;
}

.is-calc .publication-body p {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: #b7b1a6;
}

.publication-card-footer {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 15px 0 18px;
  border-top: 1px solid #2d3138;
  color: #68717c;
  font-size: 9px;
}

.publication-card-footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: #9da6b2;
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
}

.publication-card-footer a:hover {
  color: #e4e8ed;
}

.publication-card-footer svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-skeleton {
  height: 220px;
  border: 1px solid #2d3138;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.025) 48%, transparent 100%),
    #202329;
  background-size: 220% 100%;
  animation: feed-shimmer 1.3s ease-in-out infinite;
}

@keyframes feed-shimmer {
  to {
    background-position: -120% 0;
  }
}

.feed-empty {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 40px;
  border: 1px dashed #343841;
  border-radius: 7px;
  color: #767e89;
  text-align: center;
  font-size: 11px;
}

.feed-empty-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border: 1px solid #40454e;
  border-radius: 6px;
  background: #25282e;
  color: #aab1bb;
  font-size: 14px;
  font-weight: 750;
}

.feed-empty strong {
  color: #cbd0d8;
  font-size: 13px;
}

.feed-empty a,
.feed-empty button {
  min-height: 30px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid #414751;
  border-radius: 5px;
  background: transparent;
  color: #c8ced7;
  text-decoration: none;
  font-size: 10px;
  line-height: 28px;
}

.feed-more {
  width: 100%;
  height: 34px;
  margin-top: 12px;
  border: 1px solid #343943;
  border-radius: 5px;
  background: #23262c;
  color: #a9b0ba;
  font-size: 11px;
}

.feed-more:hover {
  border-color: #454b56;
  color: #e1e5ea;
}

@media (max-width: 760px) {
  .portal-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }

  .portal-brand span,
  .portal-brand small,
  .portal-header-actions a {
    display: none;
  }

  .portal-brand img {
    width: 30px;
    height: 30px;
  }

  .portal-layout {
    display: block;
    padding: 18px 12px 76px;
  }

  .portal-sidebar {
    position: fixed;
    z-index: 18;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    height: 58px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid #30343b;
    background: rgba(29, 31, 36, 0.97);
    backdrop-filter: blur(14px);
  }

  .portal-sidebar nav {
    height: 100%;
    flex-direction: row;
    justify-content: space-around;
  }

  .portal-sidebar nav a {
    width: 31%;
    height: 46px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 0;
    font-size: 9px;
  }

  .portal-sidebar-footer {
    display: none;
  }

  .publication-body {
    min-height: 118px;
    padding: 18px 18px 20px;
  }

  .publication-body h2 {
    font-size: 17px;
  }

  .publication-card-header {
    padding-left: 14px;
  }

  .publication-card-footer {
    padding-left: 14px;
  }
}
