/* Narrow-header overrides are kept separate so development and minified production builds stay aligned. */
.mobile-sections-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mobile-sections-scroll > .mobile-cat-tabs {
  flex: 1 1 auto;
  min-width: 0;
}
.mobile-sections-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--accent-color);
  border-radius: 12px;
  background: var(--surface-color, #fff);
  color: var(--accent-color);
  cursor: pointer;
}
.mobile-sections-next[hidden] { display: none; }
.mobile-sections-next.is-back svg { transform: rotate(180deg); }
.mobile-sections-next:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
@media (max-width: 380px) {
  .header .container {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .header .logo {
    min-width: 0;
    flex: 0 1 auto;
  }

  .header .logo .sitename {
    font-size: 15px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 4px;
    min-width: 0;
    margin-left: 0;
  }

  .header-social {
    gap: 4px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .header-auth {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .header-social .social-link {
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 8px;
    flex: 0 0 24px;
  }

  .header-social .social-link svg {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 768px) {
  .scroll-top {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(15px + env(safe-area-inset-bottom));
  }

  .mobile-header-search {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    flex-direction: row;
    bottom: calc(15px + env(safe-area-inset-bottom));
    z-index: 990;
    gap: 0;
    padding: 4px;
    max-width: calc(100vw - 79px - env(safe-area-inset-right));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  }

  .mobile-header-search__toggle {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border: 0;
    line-height: 1;
  }

  .mobile-header-search__toggle svg {
    display: block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
  }

  .mobile-header-search__toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -3px;
  }

  .mobile-header-search__input {
    flex: 1 1 0;
    width: 0;
    font-size: 16px;
  }

  .mobile-header-search__submit {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    color: #fff;
  }

  .mobile-header-search__submit svg {
    display: block;
    width: 22px;
    height: 22px;
  }

  .mobile-header-search__form {
    visibility: hidden;
  }

  .mobile-header-search.is-open .mobile-header-search__form {
    visibility: visible;
    width: min(180px, calc(100vw - 131px - env(safe-area-inset-right)));
  }
}

.mobile-section-toggle {
  white-space: nowrap;
  min-height: 44px;
  touch-action: manipulation;
}
.mobile-section-toggle[aria-expanded="true"] {
  background: var(--accent-color);
  color: var(--contrast-color);
}
.mobile-section-panel[hidden] { display: none; }
.mobile-section-panel {
  display: grid;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--accent-color);
  border-radius: 12px;
  background: var(--surface-color, #fff);
}
.mobile-section-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.mobile-section-panel a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
  border-radius: 6px;
}
.mobile-sections-menu > a { min-height: 44px; align-content: center; }

.mobile-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mobile-section-chevron {
  flex: 0 0 12px;
  opacity: .75;
  transition: transform 160ms ease;
}
.mobile-section-toggle[aria-expanded="true"] .mobile-section-chevron {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .mobile-section-chevron { transition: none; }
}

.mobile-sections-menu > .btn {
  white-space: nowrap;
  margin-right: 0;
  padding: 6px 10px;
}

@media (max-width: 767.98px) {
  .page-title .breadcrumbs {
    display: none;
  }
  .page-title {
    padding: 12px 0;
  }
  .page-title:not(.article-page-title) > .container > h1 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 0 !important;
  }
}
