/*
 * Dark Atlas - Components
 * Reusable UI components: nav, footer, cards, badges, pills, meta panel.
 * Depends on: tokens.css, base.css
 */

/* =========================================================
   TICKER BAR  (frame vcvxB - 32px bar below top nav)
   ========================================================= */

.ticker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0 32px;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 52px; /* below the 52px top-nav */
    z-index: 99;
    overflow: hidden;
}

.ticker-left,
.ticker-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.ticker-left {
    font-size: var(--text-xs);
}

.ticker-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.12em;
    transition: color 0.15s;
}

.ticker-nav-link:hover {
    color: var(--text-primary);
}

.ticker-nav-link--active {
    color: var(--accent-amber);
}

.ticker-sep {
    color: var(--border-default);
}

.ticker-system {
    color: var(--accent-green);
    font-size: var(--text-xs);
}

.ticker-mode-btns {
    display: flex;
    gap: 1px;
}

.ticker-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 70px;
    min-height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.ticker-mode-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.ticker-mode-btn--active {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent-amber);
}

.filter-count {
    color: var(--text-muted);
    font-size: var(--text-2xs);
    margin-left: 4px;
}

@media (max-width: 768px) {
    .ticker {
        display: none; /* hide ticker on mobile - space is too tight */
    }
}

/* =========================================================
   TOP NAV  (desktop)
   ========================================================= */

.top-nav {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 32px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-bracket {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.nav-site-name {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.2em;
}

.nav-slash {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: normal;
    letter-spacing: 0.1em;
    margin: 0 4px;
}

.nav-sub-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: normal;
    letter-spacing: 0.1em;
}

.nav-spacer {
    flex: 1;
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    width: 240px;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    flex-shrink: 0;
}

.nav-search-icon {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.nav-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.05em;
    min-width: 0;
    outline: none;
}

.nav-search-input::placeholder {
    color: var(--text-muted);
}

/* Hide native browser clear button */
.nav-search-input--custom-clear::-webkit-search-cancel-button {
    display: none;
}

/* Custom Phosphor X clear button */
.nav-search-clear[hidden] {
    display: none;
}

.nav-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--accent-green);
    flex-shrink: 0;
    line-height: 1;
}

.nav-search-clear .ph-x {
    font-size: 15px;
    color: var(--accent-green);
}

.nav-search-clear:hover .ph-x {
    opacity: 0.75;
}

.nav-gap-sm {
    width: 12px;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
}

.nav-menu:hover {
    background: var(--bg-sunken);
    color: var(--text-primary);
}

.nav-online {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    flex-shrink: 0;
    cursor: pointer;
}

.nav-online:hover {
    background: var(--bg-sunken);
}

.nav-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
}

.nav-online-label {
    color: var(--accent-green);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.15em;
}

/* =========================================================
   MOBILE TOP NAV
   ========================================================= */

.mobile-top-nav {
    display: none; /* shown via media query in layout.css */
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-nav-logo {
    color: var(--accent-amber);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
}

.mobile-nav-hamburger {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-only hamburger (icon button, not the desktop [MENU] text button) */
.mobile-top-nav .mobile-nav-hamburger {
    color: var(--accent-amber);
    font-size: 20px;
    /* 44×44px minimum touch target */
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
}

/* =========================================================
   MOBILE MENU OVERLAY
   ========================================================= */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 100vw);
    background: var(--bg-base);
    z-index: 201;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-left: 1px solid var(--border-default);
}

.mobile-menu-overlay[hidden] {
    display: none;
}

/* Semi-transparent backdrop - shown when menu is open */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: none;
}

.mobile-menu-backdrop.is-visible {
    display: block;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
}

.mobile-menu-title {
    color: var(--accent-amber);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.mobile-menu-close {
    color: var(--text-secondary);
    font-size: 20px;
    /* 44×44px minimum touch target */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    border: none;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-links a {
    display: block;
    padding: 12px 0;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-default);
}

.mobile-menu-theme {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    justify-content: center;
}

.mobile-theme-btn {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.mobile-theme-btn:hover,
.mobile-theme-btn--active {
    border-color: var(--accent-copper);
    color: var(--accent-copper);
}

/* =========================================================
   DESKTOP FOOTER
   ========================================================= */

.site-footer {
    display: flex;
    flex-direction: column;
    padding: 0 var(--spacing-page-x);
    background: var(--bg-base);
    border-top: 1px solid var(--border-default);
}

.footer-top {
    display: flex;
    align-items: center;
    height: 48px;
    gap: 32px;
}

.footer-left,
.footer-right {
    color: var(--text-ghost);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: normal;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.footer-spacer {
    flex: 1;
}

.footer-legal {
    display: flex;
    align-items: center;
    height: 25px;
    border-top: 1px solid var(--border-subtle);
    gap: 0;
}

.footer-legal a {
    color: var(--text-ghost);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: normal;
    letter-spacing: 0.1em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.footer-legal a:hover {
    color: var(--text-secondary);
}

.footer-legal-sep {
    color: var(--text-ghost);
    font-size: var(--text-xs);
    padding: 0 10px;
    opacity: 0.5;
}

.footer-copyright {
    color: var(--text-ghost);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    white-space: nowrap;
    opacity: 0.6;
}

/* =========================================================
   MOBILE FOOTER
   ========================================================= */

.mobile-footer {
    display: none; /* shown via media query in layout.css */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 16px;
    background: var(--bg-sunken);
    border-top: 1px solid var(--border-default);
    text-align: center;
}

.footer-line1,
.footer-line2 {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-ui);
    font-weight: normal;
    letter-spacing: 0.05em;
}

.footer-line2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
}

.footer-line2 a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0 6px;
}

.footer-line2 a:hover {
    color: var(--text-primary);
}

.footer-line2 a:not(:last-child)::after {
    content: '·';
    margin-left: 6px;
    color: var(--text-muted);
    pointer-events: none;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.breadcrumb-sep {
    color: var(--text-muted);
}

/* Middle segment: visual code + hidden full name for SEO */
.bc-code {
    color: var(--text-secondary);
}

.bc-code:hover {
    color: var(--text-primary);
}

/* =========================================================
   DIFFICULTY BADGE
   ========================================================= */

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-family: var(--font-ui);
    font-size: var(--text-ui);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid;
}

.difficulty-badge--beginner {
    background: var(--badge-beginner-fill);
    border-color: var(--badge-beginner-stroke);
    color: var(--badge-beginner-text);
}

.difficulty-badge--intermediate {
    background: var(--badge-intermediate-fill);
    border-color: var(--badge-intermediate-stroke);
    color: var(--badge-intermediate-text);
}

.difficulty-badge--advanced {
    background: var(--badge-advanced-fill);
    border-color: var(--badge-advanced-stroke);
    color: var(--badge-advanced-text);
}

/* =========================================================
   COLLAPSIBLE SIDEBAR SECTIONS (mobile only)
   Applied generically via [data-collapsible] on any *-sidebar-head.
   ========================================================= */

[data-collapsible] {
    cursor: pointer;
    user-select: none;
}

.sidebar-chevron {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

[data-collapsible][aria-expanded="false"] .sidebar-chevron {
    transform: rotate(-90deg);
}

[data-collapsible] + .sidebar-body {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}

[data-collapsible][aria-expanded="false"] + .sidebar-body {
    max-height: 0;
    opacity: 0;
}

/* =========================================================
   TOPIC TAG PILL
   ========================================================= */

.topic-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--topic-tag-pill-fill);
    border: 1px solid var(--topic-tag-pill-stroke);
    color: var(--topic-tag-pill-text);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: normal;
    letter-spacing: 0.08em;
    text-decoration: none;
    white-space: nowrap;
}

.topic-tag-pill:hover {
    color: var(--topic-tag-pill-text);
    filter: brightness(1.15);
}

/* =========================================================
   FILTER PILLS
   ========================================================= */

.filter-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--filter-pill-unselected-fill);
    border: 1px solid var(--filter-pill-stroke);
    color: var(--filter-pill-text-unselected);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}

.filter-pill:hover,
.filter-pill--selected {
    background: var(--filter-pill-selected-fill);
    color: var(--filter-pill-text-selected);
}

/* =========================================================
   ARTICLE CARD
   ========================================================= */

.article-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-default);
}

.article-card:first-child {
    border-top: 1px solid var(--border-default);
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.article-card-date {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
}

.article-card-reading-time {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
}

.article-card-title {
    font-family: var(--font-ui);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}

.article-card-title a {
    color: inherit;
    text-decoration: none;
}

.article-card-title a:hover {
    color: var(--accent-amber);
}

.article-card-excerpt {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.5;
    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================================================
   META PANEL  (article sidebar)
   ========================================================= */

.meta-panel {
    border-left: none;
    border-right: none;
    border-top: none;
}

.meta-panel-head {
    display: flex;
    align-items: center;
    background: var(--meta-panel-head-fill);
    padding: 8px 12px;
    border-bottom: 1px solid var(--meta-panel-stroke);
}

.meta-panel-head-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.meta-panel-entry {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--meta-panel-entry-fill);
    padding: 8px 12px;
    border-bottom: 1px solid var(--meta-panel-stroke);
}

.meta-panel-entry:last-child {
    border-bottom: none;
}

.meta-panel-label {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-ui);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.meta-panel-value {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.4;
    text-align: right;
}

.meta-panel-entry .difficulty-badge {
    width: fit-content;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    gap: 8px;
}

.pagination-info {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    text-decoration: none;
}

.pagination-link:hover,
.pagination-link--current {
    background: var(--text-primary);
    color: var(--bg-base);
    border-color: var(--text-primary);
}

/* =========================================================
   THEME TOGGLE BUTTON
   ========================================================= */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

/* =========================================================
   SORT BAR
   ========================================================= */

.sort-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 16px;
}

.sort-bar-label {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sort-bar-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* =========================================================
   CATEGORY TILE
   ========================================================= */

.cat-tile {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    text-decoration: none;
    transition: border-color 0.15s ease;
    min-height: 113px;
}

.cat-tile:hover {
    border-color: var(--border-subtle);
}

.cat-tile-icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    padding: 20px 0 0 16px;
    color: var(--accent-amber);
    font-size: 28px;
    line-height: 1;
}

.cat-tile-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 12px 12px 10px;
    min-width: 0;
}

.cat-tile-code {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    font-weight: 700;
}

.cat-tile-name {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.3;
}

/* =========================================================
   TL;DR BOX
   ========================================================= */

.tldr-box,
.article-tldr {
    background: var(--bg-sunken);
    border: none;
    border-left: 3px solid var(--accent-amber);
    padding: 10px 16px;
}

.tldr-label {
    color: var(--accent-amber);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.tldr-text {
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    line-height: 1.6;
}

/* =========================================================
   SEARCH INPUT (full-width, search page)
   ========================================================= */

.search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    height: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    max-width: 800px;
    width: 100%;
}

.search-bar-icon {
    padding: 0 15px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.15em;
    flex-shrink: 0;
    white-space: nowrap;
}

.search-bar-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-3xl);
    letter-spacing: 0.05em;
    padding: 0;
    outline: none;
    min-width: 0;
}

.search-bar-input::placeholder {
    color: var(--text-muted);
}

/* Hide native browser search cancel button */
.search-bar-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.search-bar-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: var(--accent-green);
    text-decoration: none;
    flex-shrink: 0;
    font-size: 18px;
    transition: opacity 0.15s ease;
}

.search-bar-clear:hover {
    opacity: 0.7;
}

.search-bar-clear--hidden {
    visibility: hidden;
    pointer-events: none;
}

/* =========================================================
   ARTICLE PAGE - HEADER SECTION
   ========================================================= */

.article-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.article-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-topic-tag {
    display: flex;
}

.article-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
    max-width: 780px;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    letter-spacing: 0.08em;
}

.meta-sep {
    color: var(--text-ghost);
}

.article-meta-code,
.article-meta-reading-time,
.article-meta-word-count,
.article-meta-date {
    white-space: nowrap;
}

.article-divider {
    height: 1px;
    background: var(--border-default);
}

/* Unit toggle - inline in meta bar */
.od-unit-toggle-prefix {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.od-unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--border-default);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    transition: border-color 0.15s;
}

.od-unit-toggle:hover {
    border-color: var(--text-ghost);
}

.od-unit-label-imp,
.od-unit-label-si {
    color: var(--text-ghost);
    transition: color 0.15s;
}

.od-unit-sep {
    color: var(--border-default);
}

/* IMP active (default) */
.od-unit-toggle[data-mode="imp"] .od-unit-label-imp {
    color: var(--text-secondary);
}

/* SI active */
.od-unit-toggle[data-mode="si"] .od-unit-label-si {
    color: var(--text-secondary);
}

/* =========================================================
   ARTICLE PAGE - BODY
   ========================================================= */

.article-body {
    padding-top: 0;
}

.article-body .od-content-grid {
    align-items: start;
}

/* Sidebar panels */
.article-metadata,
.article-key-skills,
.article-tools {
    margin-bottom: 20px;
}

.article-skill-row,
.article-tool-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.skill-dot {
    width: 4px;
    height: 4px;
    background: var(--accent-amber);
    flex-shrink: 0;
}

.tool-dot {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    flex-shrink: 0;
}

.download-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background: var(--accent-green);
    border: none;
    color: var(--bg-base);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: not-allowed;
    opacity: 0.6;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .download-pdf-btn { display: none; }
}

/* =========================================================
   CATEGORY / ARCHIVE PAGE HEADER
   ========================================================= */

.category-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
}

.category-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    width: fit-content;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: normal;
    letter-spacing: 0.2em;
}

.category-tag-icon {
    color: var(--accent-amber);
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.category-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
    max-width: 900px;
}

.category-description {
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    line-height: 1.6;
    max-width: 720px;
    margin-bottom: 16px;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
}

/* =========================================================
   CATEGORY FILTER BAR
   ========================================================= */

.cat-filter-bar {
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
    padding: 12px 0;
    position: sticky;
    top: 72px;
    z-index: 10;
}

.cat-filter-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-filter-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cat-filter-spacer {
    flex: 1;
}

.cat-filter-count {
    color: var(--text-ghost);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* =========================================================
   ARCHIVE ARTICLE GRID  (3-column, full-width)
   ========================================================= */

.cat-article-grid {
    padding-top: 10px;
    padding-bottom: 60px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 20px;
    margin-bottom: 20px;
}

.archive-grid .article-card {
    background: var(--bg-base);
    border: none;
    border-right: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    padding: 24px;
}

/* Remove right border from last card in each row */
.archive-grid .article-card:nth-child(3n) {
    border-right: none;
}

/* Remove bottom border from last row.
   We don't know the exact count so use a broad selector:
   last 3 cards that are also in the last row. */
.archive-grid .article-card:nth-last-child(-n+3):nth-child(3n+1),
.archive-grid .article-card:nth-last-child(-n+3):nth-child(3n+1) ~ .article-card {
    border-bottom: none;
}

.archive-pagination {
    border-top: 1px solid var(--border-default);
}

@media (max-width: 768px) {
    .archive-grid {
        grid-template-columns: 1fr;
    }

    /* 1-column: no right border, no bottom border on last card */
    .archive-grid .article-card:nth-child(3n) {
        border-right: none;
    }
    .archive-grid .article-card:last-child {
        border-bottom: none;
    }

    .category-title {
        font-size: var(--text-hero);
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 2-column: remove right border from every 2nd card */
    .archive-grid .article-card:nth-child(3n) {
        border-right: 1px solid var(--border-default);
    }
    .archive-grid .article-card:nth-child(2n) {
        border-right: none;
    }
    /* Remove bottom border from last 2 cards in last row */
    .archive-grid .article-card:nth-last-child(-n+2):nth-child(2n+1),
    .archive-grid .article-card:nth-last-child(-n+2):nth-child(2n+1) ~ .article-card {
        border-bottom: none;
    }
}

/* =========================================================
   SEE ALSO SECTION
   ========================================================= */

.see-also {
    background: var(--bg-sunken);
    border-top: 1px solid var(--border-default);
    padding: 40px 0;
}

.see-also-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.see-also-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: 0.2em;
    white-space: nowrap;
    margin-top: 10px;
    margin-bottom: 10px;
}

.see-also-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.see-also-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.see-also-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: 12px;
    min-height: 85px;
}

.see-also-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.see-also-card-title {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
}

.see-also-card-title a {
    color: inherit;
    text-decoration: none;
}

.see-also-card-title a:hover {
    color: var(--accent-amber);
}

.see-also-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .see-also-grid {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: var(--text-hero); /* 32px on mobile */
    }

    .article-meta-bar {
        gap: 8px;
    }
}

/* =========================================================
   HOMEPAGE - HERO
   ========================================================= */

.hero {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 550px;
    padding: 30px var(--spacing-page-x) 72px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-default);
    justify-content: center;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    color: var(--accent-amber);
    font-size: var(--text-base);
    letter-spacing: 0.1em;
}

.hero-eyebrow-icon {
    color: var(--accent-amber);
    font-size: 25px;
    width: 25px;
    height: 25px;
    line-height: 1;
    flex-shrink: 0;
}

.hero-eyebrow-bracket {
    color: var(--accent-amber);
    font-weight: 700;
}

.hero-eyebrow-text {
    font-weight: normal;
}

.hero-eyebrow-sep {
    color: var(--text-muted);
    margin: 0 4px;
}

.hero-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
}

.hero-online-label {
    color: var(--accent-green);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.15em;
}

.hero-title {
    font-family: var(--font-ui);
    font-size: var(--text-display); /* 96px */
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
    max-width: 1100px;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 0;
    height: 44px;
    width: 640px;
    max-width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
}

.hero-search-label {
    padding: 0 15px 0 15px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.15em;
    flex-shrink: 0;
    white-space: nowrap;
}

.hero-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    letter-spacing: 0.05em;
    outline: none;
    min-width: 0;
}

.hero-search-input::placeholder {
    color: var(--text-muted);
}

/* Hero search custom clear button */
.hero-search-input--custom-clear::-webkit-search-cancel-button {
    display: none;
}

.hero-search-clear[hidden] {
    display: none;
}

.hero-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    padding: 0;
    margin-right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.hero-search-clear .ph-x {
    font-size: 15px;
    color: var(--accent-green);
    line-height: 1;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-value {
    color: var(--accent-online);
    font-family: var(--font-ui);
    font-size: var(--text-9xl); /* 24px */
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
}

.hero-stat-label {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
}

.hero-stat-sep {
    color: var(--text-ghost);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    align-self: center;
}

/* =========================================================
   HOMEPAGE - CATEGORY GRID
   ========================================================= */

.home-categories {
    background: var(--bg-base);
    border-top: 1px solid var(--border-default);
}

.home-categories-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px var(--spacing-page-x);
    border-bottom: 1px solid var(--border-default);
}

.home-categories-label {
    color: var(--accent-amber);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.15em;
    white-space: nowrap;
    margin-top: 10px;
    margin-bottom: 10px;
}

.home-categories-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.home-categories-link {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-decoration: none;
    white-space: nowrap;
}

.home-categories-link:hover {
    color: var(--text-primary);
}

/* 28-tile grid - 7 columns desktop */
.home-cat-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-default);
}

.home-cat-grid .cat-tile {
    background: var(--bg-base);
    border: none;
}

.home-cat-grid .cat-tile-icon {
    padding-top: 22px;
}

.cat-tile--empty {
    opacity: 0.3;
    pointer-events: none;
}

/* =========================================================
   HOMEPAGE - FEATURED ARTICLES
   ========================================================= */

.featured-articles {
    padding-top: 40px;
    padding-bottom: 60px;
    border-top: 1px solid var(--border-default);
}

.featured-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.featured-label {
    color: var(--accent-amber);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.2em;
    white-space: nowrap;
    margin-top: 10px;
    margin-bottom: 10px;
}

.featured-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.featured-link {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-decoration: none;
    white-space: nowrap;
}

.featured-link:hover {
    color: var(--text-primary);
}

.featured-article-list {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .hero {
        padding: 32px 16px 48px;
        min-height: auto;
    }
    .hero-title {
        font-size: var(--text-hero); /* 32px on mobile */
    }
    .home-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .home-categories-header {
        padding: 16px;
    }
    .hero-stats {
        gap: 16px;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
    .hero-stat {
        flex: 0 0 calc(50% - 8px);
        flex-wrap: nowrap;
        align-items: center;
        text-align: center;
    }
    .hero-stat-sep {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .home-cat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .hero-title {
        font-size: var(--text-display); /* keep at 96px on tablet */
    }
}

/* =========================================================
   404 PAGE
   ========================================================= */

.error-breadcrumb {
    padding: 12px var(--spacing-page-x);
    border-bottom: 1px solid var(--border-default);
}

.error-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 500px;
    padding: 80px;
    text-align: center;
    background: var(--bg-base);
}

.error-code {
    color: var(--accent-green);
    font-family: var(--font-ui);
    font-size: var(--text-display-lg); /* 120px */
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
}

.error-headline {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-hero); /* 32px */
    font-weight: 700;
    letter-spacing: 0.25em;
}

.error-divider {
    width: 48px;
    height: 1px;
    background: var(--border-subtle);
}

.error-subtext {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-xl);
    max-width: 480px;
}

.error-home-link {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    letter-spacing: 0.08em;
    text-decoration: none;
}

.error-home-link:hover {
    background: var(--bg-sunken);
    color: var(--text-primary);
}

.error-search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    height: 44px;
    width: 600px;
    max-width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
}

.error-search-icon {
    padding: 0 15px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.15em;
    flex-shrink: 0;
    white-space: nowrap;
}

.error-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    letter-spacing: 0.05em;
    outline: none;
    min-width: 0;
}

.error-search-input::placeholder {
    color: var(--text-muted);
}

.error-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.error-suggestions {
    padding: 40px 0 60px;
    border-top: 1px solid var(--border-default);
}

.error-suggestions-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.error-suggestions-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.2em;
    white-space: nowrap;
}

.error-suggestions-divider {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.error-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-default);
    border: 1px solid var(--border-default);
}

.error-suggestions-grid .article-card {
    background: var(--bg-base);
    border: none;
    padding: 24px;
}

.error-suggestions-grid .article-card:first-child {
    border-top: none;
}

@media (max-width: 768px) {
    .error-hero {
        padding: 40px 20px;
    }
    .error-code {
        font-size: var(--text-display); /* 96px on mobile */
    }
    .error-suggestions-grid {
        grid-template-columns: 1fr;
    }
    .error-breadcrumb {
        padding: 12px 16px;
    }
}

/* =========================================================
   SEARCH PAGE
   ========================================================= */

.search-header-section {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.search-header-section .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.2em;
}

.search-eyebrow-label {
    color: var(--accent-amber);
    font-weight: 700;
}

.search-eyebrow-spacer {
    flex: 1;
}

.search-eyebrow-count {
    color: var(--text-secondary);
    font-weight: normal;
}

.search-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
}

.search-body {
    padding-top: 0;
    padding-bottom: 60px;
}

/* Sidebar */
.search-sidebar {
    border-right: 1px solid var(--border-default);
    padding-top: 0;
    min-width: 0;
}

.search-sidebar-head {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
}

.search-sidebar-head-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.2em;
}

.search-filter-group {
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 0;
}

.search-filter-group-head {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 20px;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.15em;
}

.search-filter-row {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 20px 0 17px; /* 17px left to offset the 3px active border */
    background: var(--bg-base);
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.search-filter-row:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-left-color: var(--border-default);
}

.search-filter-row--active {
    background: var(--bg-surface);
    color: var(--accent-amber);
    border-left-color: var(--accent-amber);
    font-weight: 400;
}

.search-filter-row--indented {
    padding-left: 40px;
    font-size: var(--text-ui);
}

/* Sort bar + results */
.search-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
}

.search-sort-label {
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    margin-right: 4px;
}

.search-result-list {
    padding: 0 24px;
}

.search-result-list .article-card {
    padding: 20px 0;
}

.search-result-list .article-card:first-child {
    border-top: none;
}

@media (max-width: 768px) {
    .search-title {
        font-size: var(--text-hero);
    }
    .search-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-default);
    }
    .search-result-list {
        padding: 0;
    }
}

/* =========================================================
   GLOSSARY PAGE  (frame: zAFD4)
   ========================================================= */

.glossary-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.glossary-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.glossary-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 12px 0 8px;
}

.glossary-description {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 700px;
}

/* Search bar */
.glossary-search-bar {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    height: 48px;
    max-width: 680px;
    margin-bottom: 16px;
}

.glossary-search-label {
    padding: 0 15px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    letter-spacing: 0.15em;
    white-space: nowrap;
    flex-shrink: 0;
}

.glossary-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    letter-spacing: 0.05em;
    padding: 0;
    min-width: 0;
}

.glossary-search-input::placeholder {
    color: var(--text-muted);
}

.glossary-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: var(--accent-green);
    text-decoration: none;
    flex-shrink: 0;
    font-size: 15px;
    transition: opacity 0.15s ease;
}

.glossary-search-clear:hover {
    opacity: 0.7;
}

.glossary-search-clear--hidden {
    visibility: hidden;
    pointer-events: none;
}

.glossary-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

/* Alpha bar */
.glossary-alpha-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 12px 0 0;
}

.glossary-alpha-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}

.glossary-alpha-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-default);
}

.glossary-alpha-btn--active {
    color: var(--accent-amber);
    border-color: var(--accent-amber);
}

/* When any letter is active, make all non-empty letters show a subtle border on hover */
.glossary-alpha-bar:has(.glossary-alpha-btn--active) .glossary-alpha-btn:not(.glossary-alpha-btn--empty):not(.glossary-alpha-btn--active) {
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.glossary-alpha-bar:has(.glossary-alpha-btn--active) .glossary-alpha-btn:not(.glossary-alpha-btn--empty):not(.glossary-alpha-btn--active):hover {
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.glossary-alpha-btn--empty {
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.4;
}

.glossary-alpha-sep {
    flex: 1;
    height: 1px;
    background: var(--border-default);
    margin: 0 12px;
}

.glossary-alpha-all {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    padding: 0 8px;
}

.glossary-alpha-all:hover {
    color: var(--text-primary);
}

.glossary-alpha-all.glossary-alpha-btn--active {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.5;
}

/* Body grid */
.glossary-body {
    padding-top: 0;
}

.glossary-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0 60px;
    align-items: start;
    padding: 15px 0 60px;
}

/* Letter groups */
.glossary-letter-group {
    margin-bottom: 0;
}

.glossary-letter-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-default);
}

.glossary-letter {
    font-family: var(--font-ui);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent-amber);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.glossary-letter-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.glossary-letter-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

/* Individual entry */
.glossary-entry {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-default);
}

.glossary-term {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.glossary-definition {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

.glossary-definition p {
    margin: 0;
}

/* Footer bar */
.glossary-footer-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-default);
}

.glossary-footer-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.glossary-footer-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.glossary-footer-back {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-decoration: none;
    flex-shrink: 0;
}

.glossary-footer-back:hover {
    color: var(--accent-amber);
}

/* Sidebar */
.glossary-sidebar {
    position: sticky;
    top: 96px;
}

.glossary-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 32px;
    background: var(--bg-sunken);
    margin: 0 -8px;
}

.glossary-sidebar-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    white-space: nowrap;
    flex-shrink: 0;
}

.glossary-sidebar-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.glossary-sidebar-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-ghost);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.glossary-sidebar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    transition: color 0.15s;
}

.glossary-sidebar-row:hover {
    color: var(--text-primary);
}

.glossary-sidebar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-default);
    flex-shrink: 0;
    transition: background 0.15s;
}

.glossary-sidebar-row:hover .glossary-sidebar-dot {
    background: var(--accent-amber);
}

.glossary-sidebar-name {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glossary-sidebar-row:hover .glossary-sidebar-name {
    color: var(--text-primary);
}

.glossary-sidebar-num {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .glossary-grid {
        grid-template-columns: 1fr;
        gap: 40px 0;
    }
    .glossary-sidebar {
        position: static;
        border-top: 1px solid var(--border-default);
        padding-top: 24px;
    }
    .glossary-alpha-bar {
        gap: 4px;
    }
    .glossary-alpha-btn {
        width: 44px;
        height: 44px;
    }
}

/* =========================================================
   INDEX / BROWSE ALL ARTICLES PAGE  (frame: YWpyd)
   ========================================================= */

.index-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.index-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.index-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 12px 0 8px;
}

.index-description {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Sort bar */
.index-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.index-sort-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.12em;
    margin-right: 4px;
}

.index-sort-spacer {
    flex: 1;
}

.index-sort-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* A–Z jump bar */
.index-alpha-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 12px 0 0;
}

.index-alpha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    text-decoration: none;
    letter-spacing: 0.08em;
    transition: color 0.15s, border-color 0.15s;
}

.index-alpha-btn:hover:not(.index-alpha-btn--empty) {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.index-alpha-btn--active {
    color: var(--accent-amber) !important;
    border-color: var(--accent-amber) !important;
}

.index-alpha-btn--empty {
    color: var(--text-ghost);
    border-color: var(--border-subtle);
    cursor: default;
    pointer-events: none;
}

/* Contextual: when a letter is active, non-active letters stay accessible */
.index-alpha-bar:has(.index-alpha-btn--active) .index-alpha-btn:not(.index-alpha-btn--empty):not(.index-alpha-btn--active) {
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.index-alpha-sep {
    width: 1px;
    height: 20px;
    background: var(--border-default);
    margin: 0 4px;
}

.index-alpha-reset {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.1em;
    padding: 0 4px;
    transition: color 0.15s;
}

.index-alpha-reset:hover {
    color: var(--text-primary);
}

.index-alpha-reset.index-alpha-btn--active {
    color: var(--text-ghost);
    text-decoration: line-through;
}

/* ---- Body grid ---- */
.index-body {
    padding: 40px 0 80px;
}

.index-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0 48px;
    align-items: start;
}

/* ---- Sidebar ---- */
.index-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    border-right: 1px solid var(--border-default);
    padding-right: 24px;
}

.index-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 32px;
    background: var(--bg-sunken);
    margin: 0 -8px;
}

.index-sidebar-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    white-space: nowrap;
    flex-shrink: 0;
}

.index-sidebar-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.index-sidebar-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-ghost);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.index-sidebar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    border-bottom: 1px solid transparent;
    transition: color 0.15s;
}

.index-sidebar-row:hover {
    color: var(--text-primary);
}

.index-sidebar-row--active {
    color: var(--accent-amber);
}

.index-sidebar-icon {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s;
    width: 16px;
    text-align: center;
}

.index-sidebar-row--active .index-sidebar-icon,
.index-sidebar-row:hover .index-sidebar-icon {
    color: var(--accent-amber);
}

.index-sidebar-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.index-sidebar-flex {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
    margin: 0 4px;
}

.index-sidebar-num {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* Tooltip on sidebar rows */
.index-sidebar-row[data-tooltip] {
    position: relative;
}

.index-sidebar-row[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    white-space: normal;
    padding: 5px 10px;
    border: 1px solid var(--border-default);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
}

.index-sidebar-row[data-tooltip]:hover::after {
    opacity: 1;
}

.index-sidebar-divider {
    height: 1px;
    background: var(--border-default);
    margin: 12px 0;
}

/* ---- Main article list ---- */
.index-main {
    min-width: 0;
}

.index-article-list .article-card {
    padding: 20px 0;
}

.index-article-list .article-card:first-child {
    border-top: none;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .index-title {
        font-size: var(--text-hero);
    }
    .index-grid {
        grid-template-columns: 1fr;
        gap: 40px 0;
    }
    .index-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-default);
        padding-right: 0;
        padding-bottom: 24px;
        max-height: none;
        overflow: visible;
    }
    .index-alpha-bar {
        gap: 4px;
    }
    .index-alpha-btn {
        width: 44px;
        height: 44px;
    }
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
}

.empty-state-title {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: var(--text-6xl);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.empty-state-desc {
    color: var(--text-ghost);
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    max-width: 400px;
}

/* =========================================================
   SITEMAP PAGE  (frame: dTAGm)
   ========================================================= */

/* ---- Page header ---- */
.sitemap-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.sitemap-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sitemap-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 0;
}

.sitemap-description {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Section jump nav */
.sitemap-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sitemap-nav-link {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-decoration: none;
    transition: color 0.15s;
}

.sitemap-nav-link:hover {
    color: var(--accent-amber);
}

.sitemap-nav-sep {
    color: var(--border-default);
    font-size: var(--text-xs);
}

/* ---- Shared section layout ---- */
.sitemap-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-default);
    margin-top: 20px;
}

.sitemap-section:last-child {
    border-bottom: none;
    padding-bottom: 20px;
}

.sitemap-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.sitemap-section-title {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.18em;
    margin: 0;
    flex-shrink: 0;
}

.sitemap-section-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.sitemap-section-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-ghost);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.sitemap-section-link {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--accent-amber);
    letter-spacing: 0.1em;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.sitemap-section-link:hover {
    opacity: 0.75;
}

/* ---- Categories grid ---- */
.sitemap-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding-bottom: 20px;
}

.sitemap-cat-block {
    padding: 20px 24px 20px 20px;
    border-right: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
}

.sitemap-cat-block:nth-child(3n) {
    border-right: none;
    padding-right: 0;
}

/* Remove bottom border from last row */
.sitemap-cat-block:nth-last-child(-n+3):nth-child(3n+1),
.sitemap-cat-block:nth-last-child(-n+3):nth-child(3n+1) ~ .sitemap-cat-block {
    border-bottom: none;
}

/* Category heading link */
.sitemap-cat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.15s;
}

.sitemap-cat-head:hover {
    color: var(--accent-amber);
}

.sitemap-cat-icon {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s;
}

.sitemap-cat-head:hover .sitemap-cat-icon {
    color: var(--accent-amber);
}

.sitemap-cat-name {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    flex: 1;
    min-width: 0;
}

.sitemap-cat-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-ghost);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* Topic list */
.sitemap-topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 16px;
}

.sitemap-topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sitemap-topic-link {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.06em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}

.sitemap-topic-link:hover {
    color: var(--accent-amber);
}

.sitemap-topic-count {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--text-ghost);
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.sitemap-topic-more a {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--accent-amber);
    text-decoration: none;
    letter-spacing: 0.06em;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.sitemap-topic-more a:hover {
    opacity: 1;
}

/* ---- Pages grid ---- */
.sitemap-pages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 20px;
}

.sitemap-page-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border-default);
    text-decoration: none;
    background: var(--bg-sunken);
    transition: border-color 0.15s, background 0.15s;
}

.sitemap-page-card:hover {
    border-color: var(--accent-amber);
    background: var(--bg-base);
}

.sitemap-page-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.12em;
}

.sitemap-page-desc {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Featured / recently added grid ---- */
.sitemap-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding-bottom: 20px;
}

.sitemap-article-card {
    padding: 10px;
    border-right: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sitemap-article-card:nth-child(3n) {
    border-right: none;
}

.sitemap-article-card:nth-last-child(-n+3):nth-child(3n+1),
.sitemap-article-card:nth-last-child(-n+3):nth-child(3n+1) ~ .sitemap-article-card {
    border-bottom: none;
}

.sitemap-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sitemap-article-date {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--text-ghost);
    letter-spacing: 0.08em;
}

.sitemap-article-title {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1.4;
}

.sitemap-article-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.sitemap-article-title a:hover {
    color: var(--accent-amber);
}

.sitemap-article-tldr {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .sitemap-title {
        font-size: var(--text-hero);
    }

    .sitemap-categories-grid {
        grid-template-columns: 1fr;
    }

    .sitemap-cat-block {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-default);
    }

    .sitemap-cat-block:nth-last-child(-n+3):nth-child(3n+1),
    .sitemap-cat-block:nth-last-child(-n+3):nth-child(3n+1) ~ .sitemap-cat-block {
        border-bottom: 1px solid var(--border-default);
    }

    .sitemap-cat-block:last-child {
        border-bottom: none;
    }

    .sitemap-pages-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sitemap-articles-grid {
        grid-template-columns: 1fr;
    }

    .sitemap-article-card {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-default);
    }

    .sitemap-article-card:nth-last-child(-n+3):nth-child(3n+1),
    .sitemap-article-card:nth-last-child(-n+3):nth-child(3n+1) ~ .sitemap-article-card {
        border-bottom: 1px solid var(--border-default);
    }

    .sitemap-article-card:last-child {
        border-bottom: none;
    }
}

/* =========================================================
   CONTACT / CONTRIBUTE PAGE  (frame: yp94y)
   ========================================================= */

/* ---- Page header ---- */
.contact-header {
    background: var(--bg-base);
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--border-default);
}

.contact-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin: 0;
}

.contact-description {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 720px;
    margin: 0;
}

/* ---- Body grid ---- */
.contact-body {
    padding: 40px 0 20px;
    margin-top: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0 48px;
    align-items: start;
}

/* ---- Form column ---- */
.contact-main {
    min-width: 0;
}

.contact-form-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.contact-form-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.18em;
    white-space: nowrap;
    flex-shrink: 0;
}

.contact-form-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-label {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
}

.contact-input,
.contact-textarea {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-sunken);
    border: 1px solid var(--border-default);
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    letter-spacing: 0.04em;
}

.contact-input:focus,
.contact-textarea:focus {
    border-color: var(--accent-amber);
}

.contact-textarea {
    min-height: 120px;
    line-height: 1.6;
}

.contact-form-footer {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.contact-submit {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--bg-base);
    background: var(--accent-amber);
    border: none;
    padding: 10px 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.contact-submit:hover {
    opacity: 0.85;
}

.contact-disclaimer {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-ghost);
    line-height: 1.5;
    margin: 0;
}

.contact-disclaimer a {
    color: var(--text-muted);
    text-decoration: underline;
}

/* Success / error states */
.contact-success {
    padding: 24px;
    border: 1px solid var(--accent-amber);
    background: var(--bg-sunken);
}

.contact-success-title {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent-amber);
    letter-spacing: 0.14em;
    margin: 0 0 8px;
}

.contact-success-desc {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    margin: 0;
}

.contact-error {
    padding: 12px 16px;
    border-left: 3px solid var(--accent-copper);
    background: var(--bg-sunken);
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ---- Sidebar ---- */
.contact-sidebar {
    position: sticky;
    top: 80px;
    border-left: 1px solid var(--border-default);
    padding-left: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-sidebar-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.18em;
    white-space: nowrap;
    flex-shrink: 0;
}

.contact-sidebar-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.contact-sidebar-body {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.contact-contribute-tag {
    padding: 16px;
    border: 1px solid var(--border-default);
    background: var(--bg-sunken);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-contribute-tag-label {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    font-weight: 700;
    color: var(--accent-amber);
    letter-spacing: 0.14em;
}

.contact-contribute-tag-desc {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ---- Contribute section ---- */
.contribute-section {
    border-top: 1px solid var(--border-default);
    padding: 20px 0;
    margin-top: 20px;
}

.contribute-head {
    margin-bottom: 32px;
}

.contribute-title {
    font-family: var(--font-ui);
    font-size: var(--text-h2);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 0 0 12px;
}

.contribute-desc {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 640px;
    margin: 0;
}

.contribute-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding-bottom: 20px;
}

.contribute-card {
    padding: 10px;
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contribute-card:last-child {
    border-right: none;
}

.contribute-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contribute-card-icon {
    font-size: 18px;
    color: var(--accent-amber);
    flex-shrink: 0;
}

.contribute-card-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

.contribute-card-desc {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ---- Guidelines bar ---- */
.contribute-guidelines {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid var(--border-default);
}

.contribute-guidelines-label {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    flex-shrink: 0;
}

.contribute-guidelines-line {
    width: 24px;
    height: 1px;
    background: var(--border-default);
    flex-shrink: 0;
}

.contribute-guidelines-link {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.06em;
    transition: color 0.15s;
}

.contribute-guidelines-link:hover {
    color: var(--accent-amber);
}

.contribute-guidelines-sep {
    color: var(--border-default);
    font-size: var(--text-2xs);
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .contact-title {
        font-size: var(--text-hero);
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px 0;
    }

    .contact-sidebar {
        position: static;
        border-left: none;
        border-top: 1px solid var(--border-default);
        padding-left: 0;
        padding-top: 32px;
    }

    .contribute-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contribute-card {
        padding: 16px 16px 16px 0;
        border-right: 1px solid var(--border-default);
        border-bottom: 1px solid var(--border-default);
    }

    /* Right-column cards: left padding, flush right, no right border */
    .contribute-card:nth-child(2n) {
        padding: 16px 0 16px 16px;
        border-right: none;
    }

    .contribute-card:nth-last-child(-n+2):nth-child(2n+1),
    .contribute-card:nth-last-child(-n+2):nth-child(2n+1) ~ .contribute-card {
        border-bottom: none;
    }
}

/* ============================================================
   TOPIC PAGE  (frame: vuRD2)
   ============================================================ */

.topic-header {
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-default);
}

.topic-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 32px;
    padding-bottom: 24px;
}

.topic-header-top {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.topic-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    flex-shrink: 0;
}

.topic-cat-badge-icon {
    font-size: 10px;
    color: var(--accent-amber);
    line-height: 1;
}

.topic-cat-badge-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent-amber);
    letter-spacing: 1px;
}

.topic-header-sep {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.topic-header-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.topic-header-spacer {
    flex: 1;
}

.topic-header-url {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.topic-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin: 0;
}

.topic-desc {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 700px;
    margin: 0;
}

.topic-body {
    padding: 40px 0 80px;
}

.topic-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0 48px;
    align-items: start;
}

/* Sidebar */
.topic-sidebar {
    position: sticky;
    top: 96px;
    border-right: 1px solid var(--border-default);
    padding-right: 24px;
}

.topic-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 32px;
    background: var(--bg-sunken);
    margin: 0 -8px;
}

.topic-sidebar-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    white-space: nowrap;
    flex-shrink: 0;
}

.topic-sidebar-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.topic-sidebar-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-ghost);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.topic-sidebar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    transition: color 0.15s;
}

.topic-sidebar-row:hover {
    color: var(--text-primary);
}

.topic-sidebar-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-default);
    flex-shrink: 0;
    transition: background 0.15s;
}

.topic-sidebar-row:hover .topic-sidebar-dot {
    background: var(--accent-amber);
}

.topic-sidebar-name {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-sidebar-row:hover .topic-sidebar-name {
    color: var(--text-primary);
}

.topic-sidebar-num {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* Sort bar */
.topic-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 10px 0;
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
}

.topic-sort-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.12em;
    margin-right: 4px;
    flex-shrink: 0;
}

.topic-sort-spacer {
    flex: 1;
}

.topic-sort-count {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Article list - reuses .article-card from shared components */
.topic-article-list {
    width: 100%;
}

.topic-article-list .article-card:first-child {
    border-top: none;
}

/* Pagination */
.topic-pagination {
    background: var(--bg-base);
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .topic-grid {
        grid-template-columns: 1fr;
        gap: 40px 0;
    }

    .topic-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-default);
        padding-right: 0;
        padding-bottom: 24px;
        max-height: none;
        overflow: visible;
    }

    .topic-header-url {
        display: none;
    }
}

/* ==========================================================================
   ABOUT PAGE  (frame MlWv2 desktop / ogvd7 mobile)
   ========================================================================== */

/* ── Header ── */
.about-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.about-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
    margin: 16px 0 24px;
}

.about-mission-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    margin: 0 0 8px;
}

.about-mission-text {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 720px;
    margin: 0;
}

/* ── Stat strip ── */
.about-stats {
    background: var(--bg-sunken);
    padding: 32px 0;
    border-bottom: 1px solid var(--border-default);
}

.about-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.about-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 24px;
    border-right: 1px solid var(--border-default);
}

.about-stat:first-child {
    padding-left: 0;
}

.about-stat:last-child {
    border-right: none;
}

.about-stat-number {
    font-family: var(--font-ui);
    font-size: var(--text-h2);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.about-stat-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

/* ── Editorial principles ── */
.about-principles {
    padding: 48px 0;
    border-bottom: 1px solid var(--border-default);
}

.about-section-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    margin: 0 0 24px;
}

.about-principles-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.about-principle {
    display: flex;
    gap: 16px;
    padding: 20px 24px 20px 20px;
    border-right: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
}

.about-principle:nth-child(3n) {
    border-right: none;
    padding-right: 0;
}

.about-principle:nth-last-child(-n+3) {
    border-bottom: none;
}

.about-principle-num {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--accent-amber);
    letter-spacing: 0.08em;
    flex-shrink: 0;
    padding-top: 2px;
}

.about-principle-title {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--text-primary);
    letter-spacing: 0.1em;
    margin: 0 0 6px;
}

.about-principle-text {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── E-E-A-T ── */
.about-eeat {
    padding: 48px 0;
    border-bottom: 1px solid var(--border-default);
}

.about-eeat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.about-eeat-card {
    padding: 20px 24px 20px 20px;
    border-right: 1px solid var(--border-default);
}

.about-eeat-card:last-child {
    border-right: none;
}

.about-eeat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-amber);
    margin-bottom: 12px;
    font-size: 20px;
}

.about-eeat-title {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--text-primary);
    letter-spacing: 0.06em;
    margin: 0 0 6px;
}

.about-eeat-text {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── Origin story ── */
.about-origin {
    padding: 48px 0;
    border-bottom: 1px solid var(--border-default);
}

.about-origin-body {
    max-width: 680px;
}

.about-origin-text {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 16px;
}

.about-origin-byline {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--accent-amber);
    letter-spacing: 0.06em;
    margin: 24px 0 0;
}

/* ── E-E-A-T intro + attribution ── */
.about-eeat-intro {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 24px;
}

.about-editorial-note {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.6;
    margin: 24px 0 0;
}

.about-editorial-note a {
    color: var(--accent-amber);
    text-decoration: none;
}

.about-editorial-note a:hover {
    text-decoration: underline;
}

/* ── Offline CTA ── */
.about-offline-cta {
    padding: 48px 0 80px;
}

.about-offline-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 32px;
    background: var(--bg-sunken);
    border: 1px solid var(--border-default);
}

.about-offline-cta-title {
    font-family: var(--font-ui);
    font-size: var(--text-lg);
    color: var(--text-primary);
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}

.about-offline-cta-desc {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.about-offline-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-amber);
    color: var(--bg-base);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.about-offline-btn:hover {
    opacity: 0.85;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .about-title {
        font-size: var(--text-h2);
    }

    .about-mission-text {
        font-size: var(--text-base);
    }

    .about-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        position: relative;
    }

    /* Draw the cross with two pseudo-elements on the grid container.
       Cell borders are unreliable in a 2×2 grid because they don't meet cleanly
       at the intersection point - pseudo-elements on the parent span the full grid. */
    .about-stats-grid::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 1px;
        background: var(--border-default);
    }

    .about-stats-grid::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        height: 1px;
        background: var(--border-default);
    }

    .about-stat {
        padding: 24px 16px;
        border-right: none;
        border-top: none;
    }

    /* Left-column cells: flush to container edge */
    .about-stat:nth-child(2n+1) {
        padding-left: 0;
    }

    /* Right-column cells: flush to container edge on the right */
    .about-stat:nth-child(2n) {
        padding-right: 0;
    }

    .about-principles-list {
        grid-template-columns: 1fr;
    }

    .about-principle {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-default);
    }

    .about-principle:last-child {
        border-bottom: none;
    }

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

    .about-eeat-card {
        padding: 16px;
        border-bottom: 1px solid var(--border-default);
    }

    .about-eeat-card:nth-child(2n) {
        border-right: none;
        padding-right: 16px;
    }

    .about-eeat-card:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .about-offline-cta-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
}

/* ==========================================================================
   LEGAL PAGES  (disclaimer / privacy-policy / terms / medical-disclaimer)
   ========================================================================== */

.legal-header {
    background: var(--bg-base);
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border-default);
}

.legal-header .od-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legal-doc-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--accent-amber);
    letter-spacing: 0.14em;
    margin: 0 0 8px;
}

.legal-title {
    font-family: var(--font-ui);
    font-size: var(--text-h2);
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.1;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.legal-effective {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin: 0;
}

/* ── Body ── */
.legal-body {
    padding: 48px 0 80px;
}

.legal-content {
    max-width: 720px;
}

.legal-content h2 {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--text-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 40px 0 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-default);
}

.legal-content h2:first-of-type {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.legal-content h3 {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 28px 0 10px;
}

.legal-content p {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 0 0 16px;
}

.legal-content p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-content a {
    color: var(--accent-amber);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content ul,
.legal-content ol {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.75;
    padding-left: 24px;
    margin: 0 0 16px;
}

.legal-content li {
    margin-bottom: 6px;
}

/* ── Warning box ── */
.legal-warning-box {
    background: var(--bg-sunken);
    border-left: 3px solid var(--accent-amber);
    padding: 16px 20px;
    margin: 0 0 24px;
}

.legal-warning-label {
    font-family: var(--font-ui);
    font-size: var(--text-2xs);
    color: var(--accent-amber);
    letter-spacing: 0.14em;
    margin: 0 0 8px !important;
}

.legal-warning-box p:last-child {
    margin-bottom: 0;
}

/* ── Note box (plain highlight) ── */
.legal-note-box {
    background: var(--bg-sunken);
    border: 1px solid var(--border-default);
    padding: 16px 20px;
    margin: 0 0 32px;
}

.legal-note-box p {
    margin-bottom: 0;
}

/* ── Related documents footer ── */
.legal-related {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-default);
}

.legal-related-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.14em;
    margin: 0 0 12px !important;
}

.legal-related-links {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.legal-related-link {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-decoration: none;
    padding: 6px 16px 6px 0;
    margin-right: 16px;
    border-right: 1px solid var(--border-default);
    transition: color 0.15s;
}

.legal-related-link:last-child {
    border-right: none;
    margin-right: 0;
}

.legal-related-link:hover {
    color: var(--accent-amber);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .legal-title {
        font-size: var(--text-xl);
    }

    .legal-content {
        max-width: 100%;
    }

    .legal-related-links {
        flex-direction: column;
        gap: 8px;
    }

    .legal-related-link {
        border-right: none;
        padding: 4px 0;
        margin-right: 0;
    }
}

/* ── Legal Hub ── */
.legal-hub-title {
    font-family: var(--font-ui);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin: 0;
}

.legal-hub-description {
    font-family: var(--font-body);
    font-size: var(--text-2xl);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.legal-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 48px 0 80px;
}

.legal-hub-card-title {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--text-primary);
    letter-spacing: 0.03em;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .legal-hub-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   COOKIE CONSENT BANNER
   ========================================================= */

#od-cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 320px;
    background: var(--bg-sunken);
    border: 1px solid var(--border-default);
    transform: translateY(calc(100% + 32px));
    transition: transform 0.3s ease;
}

#od-cookie-banner.od-cookie-banner--visible {
    transform: translateY(0);
}

.od-cookie-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.od-cookie-text {
    color: var(--text-ghost);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    margin: 0;
    line-height: 1.6;
}

.od-cookie-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.od-cookie-link:hover {
    color: var(--text-primary);
}

.od-cookie-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.od-cookie-btn {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    padding: 5px 14px;
    border: 1px solid var(--border-default);
    background: transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.od-cookie-btn--decline {
    color: var(--text-ghost);
}

.od-cookie-btn--decline:hover {
    color: var(--text-secondary);
    border-color: var(--text-ghost);
}

.od-cookie-btn--accept {
    color: var(--accent-amber);
    border-color: var(--accent-amber);
}

.od-cookie-btn--accept:hover {
    background: var(--accent-amber);
    color: var(--bg-base);
}

@media (max-width: 767px) {
    #od-cookie-banner {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-left: none;
        border-right: none;
        border-bottom: none;
        transform: translateY(100%);
    }

    .od-cookie-inner {
        padding: 16px 20px;
    }
}

/* =========================================================
   LAUNCH SIGNUP MODAL
   ========================================================= */

.launch-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.launch-modal[hidden] {
    display: none;
}

.launch-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.launch-modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: 40px 36px 36px;
    box-sizing: border-box;
}

.launch-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.launch-modal-close:hover {
    color: var(--text-primary);
}

.launch-modal-title {
    font-family: var(--font-ui);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    margin: 0 0 8px;
}

.launch-modal-desc {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 24px;
}

.launch-modal-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.launch-modal-input {
    display: block;
    width: 100%;
    background: var(--bg-sunken);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 10px 12px;
    margin-bottom: 16px;
    outline: none;
    box-sizing: border-box;
}

.launch-modal-input:focus {
    border-color: var(--accent-amber);
}

.launch-modal-submit {
    display: block;
    width: 100%;
    background: var(--accent-amber);
    color: var(--bg-base);
    border: none;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 12px;
    cursor: pointer;
}

.launch-modal-submit:hover:not(:disabled) {
    opacity: 0.88;
}

.launch-modal-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.launch-modal-success-title {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-amber);
    letter-spacing: 0.08em;
    margin: 0 0 8px;
}

.launch-modal-success-desc {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.launch-modal-error {
    margin-top: 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--badge-advanced-text);
}

@media (max-width: 480px) {
    .launch-modal-box {
        padding: 32px 20px 24px;
    }
}


/* ================================================================
   KNOWLEDGE GRAPH  (single.php ego-graph panel)
   ================================================================ */

.od-kg-section {
    margin-top: 48px;
}

.od-kg-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.od-kg-label {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
}

.od-kg-head-line {
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.od-kg-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
}

/* ── Canvas ──────────────────────────────────────────────────── */

.od-kg-canvas {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
}

#od-graph-svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; /* let D3 handle all touch events (pan, pinch-zoom) */
}

/* ── Zoom controls ───────────────────────────────────────────── */

.od-kg-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.od-kg-zoom-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s, border-color 0.15s;
}

.od-kg-zoom-btn:hover {
    color: var(--accent-amber);
    border-color: var(--accent-amber);
}

/* ── Tooltip ─────────────────────────────────────────────────── */

.od-kg-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: 6px 10px;
    max-width: 240px;
    z-index: 10;
}

.od-kg-tooltip span {
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* ── Closest connections list ────────────────────────────────── */

.od-kg-connections {
    padding: 16px 20px;
}

.od-kg-connections-label {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-ghost);
    display: block;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.od-kg-connections-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.od-kg-connections-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.od-kg-connections-link {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.od-kg-connections-link:hover {
    color: var(--accent-green);
}

.od-kg-connections-weight {
    font-family: var(--font-ui);
    font-size: 10px;
    color: var(--text-ghost);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* ── Tap label (mobile first-tap preview) ────────────────────── */

.od-kg-tap-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    z-index: 5;
}

.od-kg-tap-label[hidden] {
    display: none;
}

.od-kg-tap-label-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.od-kg-tap-hint {
    font-family: var(--font-ui);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--accent-green);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Mobile adjustments ──────────────────────────────────────── */

@media (max-width: 768px) {
    .od-kg-canvas {
        height: 320px;
    }

    .od-kg-zoom-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .od-kg-connections {
        padding: 14px 16px;
    }
}
