.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.9);
  border-bottom: 1px solid rgba(219, 228, 231, 0.8);
  backdrop-filter: blur(18px);
}

.nav {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  min-width: 58px;
  height: 44px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 0.9rem;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(18, 63, 73, 0.18);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.nav-links a {
  white-space: nowrap;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
  color: var(--muted);
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "⌄";
  margin-left: 6px;
  font-size: 0.78rem;
}

.nav-dropdown[open] summary {
  color: var(--ink);
}

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  min-width: 190px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  z-index: 20;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  background: rgba(23, 79, 93, 0.08);
}

.nav-right,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-right {
  margin-left: auto;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.language-switch button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 8px 10px;
}

.language-switch button.active {
  background: var(--brand);
  color: #fff;
}

.nav-icon-text-btn {
  min-height: 40px;
  padding-inline: 14px;
}

.nav-inbox-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-inbox-wrap {
  position: relative;
  flex: 0 0 auto;
}

.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-soft);
}

.nav-icon-btn:hover,
.nav-icon-btn:focus-visible {
  border-color: rgba(23, 79, 93, 0.46);
  background: rgba(23, 79, 93, 0.06);
}

.nav-control-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-unread-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
}

.nav-preview {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 65;
  width: min(350px, calc(100vw - 24px));
  max-height: min(440px, calc(100svh - 90px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.nav-preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.nav-preview-header strong {
  color: var(--ink);
}

.nav-preview-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.nav-preview-list > .meta {
  margin: 10px 8px;
}

.nav-preview-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  color: var(--ink);
}

.nav-preview-item:hover,
.nav-preview-item:focus-visible,
.nav-preview-item.is-unread {
  background: rgba(23, 79, 93, 0.08);
}

.nav-preview-item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 79, 93, 0.12);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 900;
}

.nav-preview-notification-icon {
  background: rgba(217, 183, 95, 0.2);
  color: #8a6a1d;
}

.nav-preview-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.nav-preview-item-copy strong,
.nav-preview-item-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-preview-item-copy strong {
  font-size: 0.86rem;
}

.nav-preview-item-copy small {
  color: var(--muted);
  font-size: 0.76rem;
}

.nav-preview-count {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.nav-preview-seen {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.nav-preview-footer {
  display: block;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 900;
}

.nav-menu-icon {
  position: relative;
  width: 18px;
  height: 12px;
  display: inline-block;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-menu-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px solid currentColor;
  transform: translateY(-50%);
}

.profile-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.profile-icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 26px rgba(18, 63, 73, 0.16);
  font-weight: 900;
  line-height: 1;
}

.staff-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 30;
  width: min(310px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.staff-popover-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(23, 79, 93, 0.08);
}

.staff-popover-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.staff-popover-card strong,
.staff-popover-card small {
  display: block;
  overflow-wrap: anywhere;
}

.staff-popover-card small {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8rem;
}

.main {
  min-height: 70vh;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}

.section-tight {
  padding-top: 42px;
  padding-bottom: 42px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-label {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.grid {
  display: grid;
  gap: 22px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer {
  background: var(--brand-dark);
  color: #fff;
  padding: 48px 24px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 34px;
  align-items: start;
}

.footer-brand {
  width: min(720px, 100%);
  margin: 0 auto 10px;
  text-align: center;
}

.footer-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.footer-brand h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 12px;
}

.footer-brand p {
  margin-left: auto;
  margin-right: auto;
  max-width: 68ch;
}

.footer-columns {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 48px;
  align-items: start;
}

.footer-left {
  display: grid;
  gap: 22px;
  justify-items: start;
}

.footer-right {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.footer h2,
.footer h3,
.footer p {
  margin-top: 0;
}

.footer-sitemap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.footer-sitemap h3 {
  width: 100%;
  margin-bottom: 0;
}

.footer-sitemap a,
.footer-contact-lines a {
  color: rgba(255, 255, 255, 0.86);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
}

.footer-sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 4px;
  align-items: start;
}

.footer-sponsor-grid.sponsor-count-few {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.footer-sponsor-grid.sponsor-count-many {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}

.footer-sponsor-card {
  min-height: 0;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.footer-sponsor-logo-frame {
  width: 86px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.footer-sponsor-logo-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.footer-sponsor-name {
  display: block;
  max-width: 100%;
  font-size: 0.84rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sponsor-count-few .footer-sponsor-card {
  min-height: 0;
}

.sponsor-count-few .footer-sponsor-logo-frame {
  width: 112px;
  height: 52px;
}

.sponsor-count-many .footer-sponsor-card {
  min-height: 0;
  padding: 1px;
  font-size: 0.82rem;
}

.sponsor-count-many .footer-sponsor-logo-frame {
  width: 62px;
  height: 30px;
}

.sponsor-count-many .footer-sponsor-name {
  font-size: 0.76rem;
}

.scroll-top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.public-scroll-top {
  bottom: 92px;
}

.terms-announcement {
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: rgba(18, 63, 73, 0.96);
  color: #fff;
  box-shadow: var(--shadow);
}

.terms-announcement p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 860px) {
  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    padding: 10px 14px;
    gap: 8px;
  }

  .nav:has(.profile-menu-wrap) {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .brand {
    grid-column: 1;
    min-width: 0;
    max-width: min(52vw, 210px);
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand span {
    min-width: 0;
    max-width: 152px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-right {
    display: contents;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 0.86rem;
  }

  .nav-dropdown summary {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 0.86rem;
  }

  .nav-dropdown-menu {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 104px;
    min-width: 0;
    margin-top: 0;
    box-shadow: 0 10px 24px rgba(18, 63, 73, 0.12);
  }

  .nav-dropdown-menu a {
    border: 0;
    border-radius: 12px;
    background: transparent;
    padding: 8px 10px;
  }

  .admin-menu-btn {
    grid-column: 3;
    justify-self: end;
    flex: 0 0 auto;
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.86rem;
  }

  .language-switch {
    grid-column: 2;
    justify-self: end;
    flex: 0 0 auto;
    padding: 3px;
    max-width: 68px;
    overflow: hidden;
  }

  .language-switch button {
    min-width: 28px;
    padding: 7px 5px;
    font-size: 0.62rem;
  }

  .nav-icon-text-btn {
    min-height: 38px;
    padding-inline: 10px;
  }

  .nav:has(.profile-menu-wrap) {
    grid-template-columns: minmax(0, 1fr) repeat(4, auto) auto;
  }

  .nav-inbox-controls {
    grid-column: 4 / span 2;
    justify-self: end;
    gap: 5px;
  }

  .nav-icon-btn {
    width: 38px;
    height: 38px;
  }

  .nav-icon-text-btn span:not(.nav-menu-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .profile-icon-btn {
    width: 38px;
    height: 38px;
  }

  .staff-dashboard-btn {
    grid-column: 3;
    justify-self: end;
  }

  .profile-menu-wrap {
    grid-column: 6;
    justify-self: end;
  }

  .nav-preview {
    position: fixed;
    top: 62px;
    right: 10px;
    width: min(350px, calc(100vw - 20px));
  }

  .grid-3,
  .grid-2,
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }

  .public-scroll-top,
  .scroll-top-btn {
    right: 14px;
  }

  .terms-announcement {
    left: 14px;
    right: 14px;
    bottom: 72px;
    grid-template-columns: 1fr;
    max-height: 42svh;
    overflow: auto;
    padding: 14px;
    gap: 12px;
  }

  .terms-announcement .btn {
    min-height: 38px;
    padding-inline: 14px;
  }
}

@media (max-width: 420px) {
  .brand {
    gap: 9px;
    max-width: 150px;
  }

  .brand span {
    max-width: 102px;
    font-size: 0.9rem;
  }

  .nav-links a,
  .nav-dropdown summary {
    padding: 7px 9px;
    font-size: 0.82rem;
  }

  .language-switch button {
    font-size: 0;
  }

  .language-switch button[data-lang-switch="en"]::after {
    content: "EN";
    font-size: 0.62rem;
  }

  .language-switch button[data-lang-switch="ru"]::after {
    content: "RU";
    font-size: 0.62rem;
  }

  .admin-menu-btn {
    min-width: 38px;
    padding-inline: 9px;
    font-size: 0.8rem;
  }

  .nav:has(.profile-menu-wrap) .language-switch {
    grid-column: 2;
  }

  .nav:has(.profile-menu-wrap) .staff-dashboard-btn {
    grid-column: 3;
  }
}
