/* ==========================================================================
   NAISAR — National Authority for Intervention, Safety & Reform
   Revolutionary Government Design System
   Authority + Innovation. Precision + Vision.
   ========================================================================== */

:root {
    color-scheme: light dark;
    /* Core Brand — Deepened, Commanding */
    --navy: #0a1628;
    --navy-deep: #070f1d;
    --navy-light: #0f1d30;
    --navy-muted: #1a2d4a;
    --navy-800: #0a1628;
    --navy-900: #070f1d;
    --navy-700: #12233c;
    --navy-600: #16305a;
    --gold: #d4b44a;
    --gold-dim: #8a7020;
    --gold-bright: #e0c050;
    --gold-glow: rgba(212, 180, 74, 0.12);
    --gold-glow-light: rgba(212, 180, 74, 0.1);
    --gold-glow-soft: rgba(212, 180, 74, 0.05);
    --gold-grid: rgba(212, 180, 74, 0.02);
    --navy-wash: rgba(10, 22, 40, 0.08);
    --navy-70: rgba(10, 22, 40, 0.7);
    --navy-50: rgba(10, 22, 40, 0.5);
    
    /* Surface Colors — Refined */
    --bg-body: #faf9f6;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #f5f3ee;
    --bg-tertiary: #f5f3ee;
    --border: #d4d0c8;
    --border-light: #e8e5dc;
    --border-gold: rgba(201, 160, 58, 0.35);

    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #595959;
    --text-inverse: #ffffff;
    --text-muted-inverse: #c8d4e0;
    --text-heading: #0a1628;
    --gold-text: #7d6413;

    /* Diff highlighting (theme-aware) */
    --diff-add-bg: #dcfce7;
    --diff-add-text: #14532d;
    --diff-chg-bg: #fef9c3;
    --diff-chg-text: #713f12;
    --diff-sub-bg: #fee2e2;
    --diff-sub-text: #7f1d1d;
    
    /* Semantic */
    --danger: #7f1d1d;
    --danger-bg: #fef2f2;
    --success: #14532d;
    --success-bg: #f0fdf4;
    --warning: #92400e;
    --warning-bg: #fffbeb;
    --info: #1e3a5f;
    --info-bg: #eff6ff;
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    
    /* Spacing */
    --container-max: 1300px;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    --space-4xl: 8rem;
    --space-5xl: 10rem;

    /* Border Radius */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    
    /* Transitions */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: var(--gold);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 9999;
    transition: top 200ms ease;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
a { color: var(--text-heading); text-decoration: underline; text-underline-offset: 2px; transition: color var(--transition); }
a:hover { color: var(--text-heading); text-decoration: underline; }
.hero a, .page-header a, .footer a { color: var(--gold); text-decoration: none; }
.hero a:hover, .page-header a:hover, .footer a:hover { color: var(--gold); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes charReveal {
    from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes lineExpand {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

    to { transform: rotate(360deg); }
}

    100% { background-position: 50px 50px; }
}

    100% { background-position: 200% 0; }
}

    50% { text-shadow: 0 0 20px var(--gold-glow); }
}

    50% { border-color: var(--gold); }
}

/* Scroll-triggered animation classes */
.reveal {
    opacity: 1;
    transform: translateY(0);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* Noscript fallback — content visible without JS */
noscript .reveal,
noscript .reveal-left,
noscript .reveal-right,
noscript .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-title .line,
    .hero-subtitle,
    .hero-actions,
    .hero-meta,
    .hero-scroll {
        opacity: 1 !important;
        animation: none !important;
    }
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity var(--transition-slower), transform var(--transition-slower);
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity var(--transition-slower), transform var(--transition-slower);
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity var(--transition-slower), transform var(--transition-slower);
}
.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   GEOMETRIC VISUALS
   ========================================================================== */

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* ==========================================================================
   EMERGENCY BANNER
   ========================================================================== */
.emergency-banner {
    background: var(--danger);
    color: #fecaca;
    padding: 0.75rem var(--space-xl);
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #991b1b;
    position: relative;
    z-index: 1001;
}
.emergency-banner strong { color: #fff; font-weight: 700; }
.emergency-banner a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.emergency-banner a:hover { color: #fecaca; }
.emergency-hide-visit { margin-left: var(--space-sm); font-size: 0.8rem; }
.emergency-close {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fecaca;
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.emergency-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.emergency-close:focus-visible {
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    box-shadow: 0 0 0 2px #fecaca;
}
.emergency-text { display: inline; padding-right: 2.5rem; }

/* ==========================================================================
   QUICK EXIT BUTTON (survivor safety — site-wide)
   ========================================================================== */
.quick-exit {
    position: fixed;
    right: var(--space-lg);
    bottom: var(--space-lg);
    z-index: 2000;
    background: var(--navy);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.quick-exit:hover {
    background: var(--navy-600);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.quick-exit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--bg-body), 0 0 0 6px var(--gold);
}
@media (max-width: 640px) {
    .quick-exit {
        right: var(--space-md);
        bottom: var(--space-md);
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   FRAMEWORK DISCLAIMER BANNER (site-wide, dismissible)
   ========================================================================== */
.framework-banner {
    background: var(--navy-800, #16233a);
    color: var(--text-muted-inverse, #b8c4d8);
    padding: 0.625rem var(--space-xl);
    font-size: 0.8rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.1));
    position: relative;
    z-index: 1000;
}
.framework-banner strong { color: #fff; font-weight: 700; }
.framework-banner a { color: var(--gold, #c9a03a); }
.framework-text { display: inline; padding-right: 2.5rem; }
.framework-close {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted-inverse, #b8c4d8);
    font-size: 0.95rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition);
}
.framework-close:hover,
.framework-close:focus-visible {
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
}
.framework-close:focus-visible {
    box-shadow: 0 0 0 2px var(--gold, #c9a03a);
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.header {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}
.nav-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-dim);
}
.nav-logo:hover .nav-logo-img {
    border-color: var(--gold);
}
.nav-logo-text { display: flex; flex-direction: column; }
.nav-logo-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: 0.15em;
    line-height: 1.2;
}
.nav-logo-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted-inverse);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--transition-slow);
}
.nav-link:hover { color: var(--gold); text-decoration: none; }
.nav-link:hover::after { width: 100%; }
.dropdown-arrow { font-size: 0.6rem; opacity: 0.7; }
/* Pure-container dropdown triggers are <button>s — reset to match .nav-link */
button.nav-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}
.nav-item { position: relative; }
.nav-item.has-dropdown:hover .dropdown,
.nav-item.has-dropdown.dropdown--open .dropdown,
.nav-item.has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(15, 29, 48, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    padding: 0.5rem 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    z-index: 1001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.dropdown-link {
    display: block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    border-left: 2px solid transparent;
}
.dropdown-link:hover {
    background: rgba(212, 180, 74, 0.08);
    color: var(--gold);
    text-decoration: none;
    border-left-color: var(--gold);
    padding-left: 1.5rem;
}
.nav-cta {
    background: var(--gold);
    color: var(--navy);
    padding: 0.625rem 1.5rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}
.nav-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.nav-cta:hover {
    background: var(--gold-bright);
    color: var(--navy);
    text-decoration: none;
}
.nav-cta:hover::before { left: 100%; }
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
}
.nav-toggle span,
.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--gold);
    transition: transform 0.3s ease, background 0.3s ease;
    display: block;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main-content { flex: 1; }

/* ==========================================================================
   ALERTS / MESSAGES
   ========================================================================== */
.messages { margin-top: var(--space-lg); }
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: 2px;
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 2rem;
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    border: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: var(--gold);
    color: var(--navy);
}
.btn-primary:hover {
    background: var(--gold-bright);
    text-decoration: none;
    box-shadow: 0 4px 25px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}
.btn-secondary {
    background: transparent;
    color: var(--text-heading);
    border: 1.5px solid var(--border);
}
/* Always-navy contexts keep the inverse (light-on-navy) treatment */
.hero .btn-secondary,
.page-header .btn-secondary,
.section-dark .btn-secondary,
.gradient-cta .btn-secondary,
.cta-panel .btn-secondary,
.footer .btn-secondary,
.auth-screen .btn-secondary {
    color: var(--text-inverse);
    border-color: var(--border-gold);
}
.btn-secondary:hover {
    background: var(--gold-glow-light);
    border-color: var(--gold);
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #991b1b; text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--text-heading);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--bg-sidebar); text-decoration: none; }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.8rem; }
.btn-lg { padding: 1.125rem 2.5rem; font-size: 1rem; letter-spacing: 0.03em; }
.btn-disabled { opacity: 0.5; cursor: default; pointer-events: none; }

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group { margin-bottom: var(--space-lg); }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.01em;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1.5px solid var(--border-light);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-help {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}
.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: var(--space-xs);
}

/* ==========================================================================
   ARTICLE CONTENT
   ========================================================================== */
.article-page { padding: var(--space-3xl) 0; }
.article-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--space-xl);
    margin-bottom: var(--space-2xl);
}
.article-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: var(--space-md);
}
.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}
.article-meta a { color: var(--text-heading); }
.article-meta a:hover { color: var(--text-heading); }
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-3xl);
    align-items: start;
}
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.article-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}
.article-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
}
.article-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}
.article-content > p:first-child,
.article-content .lead {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.article-content p { margin-bottom: var(--space-lg); }
.article-content ul, .article-content ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: var(--space-sm); }
.article-content blockquote {
    border-left: 3px solid var(--gold);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
    color: var(--text-secondary);
    background: linear-gradient(90deg, var(--gold-glow), transparent);
    padding: var(--space-lg) var(--space-lg) var(--space-lg) var(--space-xl);
    border-radius: 0 4px 4px 0;
}
.article-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: var(--space-xl) 0;
    font-size: 0.95rem;
}
.article-content th, .article-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.article-content th {
    background: var(--bg-sidebar);
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.article-content tr:hover { background: var(--bg-sidebar); }
.article-content strong { color: var(--text-primary); font-weight: 600; }
.article-content a { color: var(--text-heading); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.article-content a:hover { color: var(--text-heading); }
.article-content pre {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}
.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-sidebar);
    padding: 0.15em 0.35em;
    border-radius: 3px;
}
.article-content pre code { background: none; padding: 0; }

/* ==========================================================================
   ARTICLE HERO IMAGE
   ========================================================================== */
.article-hero-image {
    width: 100%;
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}
.article-hero-image img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    display: block;
}

/* ==========================================================================
   ARTICLE SIDEBAR
   ========================================================================== */
.article-sidebar { position: sticky; top: 100px; }
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--gold);
}
.sidebar-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.sidebar-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
    transition: color var(--transition);
}
.sidebar-link:hover { color: var(--text-heading); text-decoration: none; }
.sidebar-link:last-child { border-bottom: none; }

/* Minimized sidebar */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.sidebar-btn {
    width: 100%;
    justify-content: center;
}
.sidebar-btn svg {
    margin-right: 6px;
}
.sidebar-meta {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}
.sidebar-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-meta-row:last-child { border-bottom: none; }
.sidebar-meta-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sidebar-meta-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.sidebar-related { margin-bottom: var(--space-xl); }
.sidebar-related-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}
.sidebar-related-list { list-style: none; padding: 0; }
.sidebar-related-list li {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-related-list li:last-child { border-bottom: none; }
.sidebar-related-list a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.sidebar-related-list a:hover { color: var(--text-heading); text-decoration: underline; }

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-pending { background: var(--navy-wash); color: var(--navy); }
.badge-approved { background: var(--navy); color: var(--text-inverse); }
.badge-rejected { background: var(--danger); color: var(--text-inverse); }
.badge-superseded { background: var(--bg-sidebar); color: var(--text-tertiary); }
.badge-core { background: var(--navy); color: var(--gold); }
.badge-open { background: var(--navy); color: var(--text-inverse); }
.badge-viewer { background: var(--bg-sidebar); color: var(--text-tertiary); }
.badge-contributor { background: var(--navy-wash); color: var(--navy); }
.badge-reviewer { background: var(--navy); color: var(--text-inverse); }
.badge-admin { background: var(--navy); color: var(--gold); }

/* ==========================================================================
   DIFF TABLE
   ========================================================================== */
.diff-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin: var(--space-xl) 0;
}
.diff-table td {
    padding: 0.5rem;
    vertical-align: top;
    border: 1px solid var(--border-light);
}
.diff-table .diff_header {
    background: var(--bg-sidebar);
    font-weight: 600;
    color: var(--text-heading);
}
.diff-table .diff_add { background: var(--diff-add-bg); color: var(--diff-add-text); }
.diff-table .diff_chg { background: var(--diff-chg-bg); color: var(--diff-chg-text); }
.diff-table .diff_sub { background: var(--diff-sub-bg); color: var(--diff-sub-text); text-decoration: line-through; }

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.dashboard { padding: var(--space-3xl) 0; }
.dashboard-header {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--border-light);
}
.dashboard-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
}

/* ==========================================================================
   STATS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform var(--transition-slow);
}
.stat-card:hover {
    border-color: var(--border-gold);
}
.stat-card:hover::before {
    transform: scaleX(1);
}
.stat-value {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: var(--space-sm);

}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.font-mono { font-family: var(--font-mono); }
.text-sm { font-size: 0.85rem; }

/* ==========================================================================
   TABLES
   ========================================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.data-table th {
    background: var(--navy);
    color: var(--gold);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--bg-sidebar); }
.table-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 2rem;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: var(--space-xl);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--gold);
    transition: height var(--transition-slow);
}
.card:hover {
    border-color: var(--border-gold);
}
.card:hover::before {
    height: 100%;
}
.card--overflow-hidden { overflow: hidden; }
.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--space-sm);
}
.card-text { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; }

/* Glass Card */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: var(--space-xl);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.glass-card:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--gold);
}

/* ==========================================================================
   HERO — RESTRAINED AUTHORITY
   ========================================================================== */
.hero {
    background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
    padding: calc(80px + var(--space-3xl)) 0 var(--space-3xl);
    color: var(--text-inverse);
    text-align: center;
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero .container {
    position: relative;
    z-index: 2;
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: var(--space-xl);
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-align: center;
}
.hero-title .line {
    display: block;
}
.hero-title .accent {
    color: var(--gold);
}
.hero-title .accent-gold {
    color: var(--gold);
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted-inverse);
    max-width: 520px;
    margin: 0 auto var(--space-3xl);
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.01em;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}
.hero-actions {
    display: flex;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--gold);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color var(--transition);
}
.hero-cta:hover {
    color: var(--gold-bright);
    text-decoration: none;
}
.hero-cta svg {
    transition: transform var(--transition);
}
.hero-cta:hover svg {
    transform: translateX(4px);
}
.hero-help {
    margin: var(--space-2xl) auto 0;
    max-width: 560px;
    padding: var(--space-lg) var(--space-xl);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    background: var(--gold-glow-soft);
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1.8s forwards;
}
.hero-help-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-inverse);
    font-size: 1.05rem;
    font-weight: 500;
    text-decoration: none;
}
.hero-help-link:hover {
    color: var(--gold-bright);
    text-decoration: none;
}
.hero-help-link:hover .hero-help-arrow {
    transform: translateX(4px);
}
.hero-help-arrow {
    color: var(--gold);
    transition: transform var(--transition);
}
.hero-help-note {
    display: block;
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted-inverse);
}
@media (max-width: 640px) {
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ==========================================================================
   TIMELINE / PATHWAY
   ========================================================================== */
.pathway {
    position: relative;
    padding: var(--space-3xl) 0;
}
.pathway-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    transform: translateY(-50%);
}
.pathway-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    position: relative;
    z-index: 1;
}
.pathway-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.pathway-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}
.pathway-card:hover {
    border-color: var(--border-gold);
}
.pathway-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: var(--space-md);
    opacity: 0.25;
}
.pathway-icon {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
    display: block;
}
.pathway-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--space-sm);
}
.pathway-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   GRID LAYOUTS
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xl); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: var(--navy);
    color: var(--text-muted-inverse);
    padding: var(--space-4xl) 0 var(--space-xl);
    margin-top: auto;
    position: relative;
    border-top: 1px solid var(--border-gold);
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}
.footer-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
}
.footer-desc { font-size: 0.9rem; line-height: 1.7; max-width: 320px; color: var(--text-muted-inverse); }
.footer-heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}
.footer-links li { margin-bottom: var(--space-sm); }
.footer-links a {
    font-size: 0.9rem;
    color: var(--text-muted-inverse);
    text-decoration: none;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    display: inline-block;
    position: relative;
}
.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}
.footer-links a:hover { color: var(--gold); }
.footer-links a:hover::after { width: 100%; }
.footer-bottom {
    border-top: 1px solid var(--gold-glow);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: var(--space-md);
}
.footer-mission { color: var(--gold); font-style: italic; letter-spacing: 0.02em; }

/* ==========================================================================
   PAGE HEADER
   ========================================================================== */
.page-header {
    background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
    padding: calc(80px + var(--space-3xl)) 0 var(--space-3xl);
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--gold-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--gold-grid) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}
.page-header-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}
.page-header-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted-inverse);
    max-width: 600px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}
.page-header-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-md);
    display: block;
}

/* Compact variant for work/tool pages — no decorative grid, minimal height */
.page-header--compact {
    padding: var(--space-lg) 0;
}
.page-header--compact::before {
    display: none;
}
.page-header--compact .page-header-eyebrow {
    font-size: 0.65rem;
    margin-bottom: var(--space-xs);
}
.page-header--compact .page-header-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}
.page-header--compact .page-header-subtitle {
    font-size: 0.9rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-2xl);
}
.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 500;
}
.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}
.pagination a:hover { background: var(--bg-sidebar); border-color: var(--gold); }
.pagination .current {
    background: var(--navy);
    color: var(--gold);
    border: 1px solid var(--navy);
}

/* ==========================================================================
   SECTION UTILITIES
   ========================================================================== */
.section-header {
    margin-bottom: var(--space-3xl);
    text-align: center;
}
.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--navy-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-md);
    display: block;
}
.hero .section-label,
.page-header .section-label,
.section-dark .section-label {
    color: var(--gold);
}
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}
.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-tertiary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
/* The desktop bar (6 items + auth) fits comfortably at ≥1201px after the R2
   IA restructure, but the logo subtitle (~200px) still does not — measured
   slack is ~40px at both 1280px and 1440px. Keep the subtitle hidden
   whenever the full desktop menu is shown; it reappears with the hamburger
   layout. */
@media (min-width: 1201px) {
    .nav-logo-subtitle { display: none; }
}
@media (max-width: 1200px) {
    /* backdrop-filter on .header would trap position:fixed descendants —
       drop it on mobile so the menu panel is viewport-anchored */
    .header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--navy);
    }
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--navy-light);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-xl);
        gap: var(--space-lg);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1002;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-menu.active { transform: translateX(0); }
    .nav-toggle { display: flex; }
    .nav-item.has-dropdown .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding-left: var(--space-lg);
        display: none;
    }
    .nav-item.has-dropdown.dropdown--open .dropdown,
    .nav-item.has-dropdown:focus-within .dropdown {
        display: block;
    }
}
@media (max-width: 480px) {
    .nav-logo-subtitle { display: none; }
}
@media (max-width: 1024px) {
    .article-layout { grid-template-columns: 1fr; }
    .article-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .pathway-grid { grid-template-columns: repeat(2, 1fr); }
    .pathway-track { display: none; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-meta { gap: var(--space-xl); }
    .article-title { font-size: 1.75rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .pathway-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .tier-preview-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .section-title {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }
    .crisis-stat-number {
        font-size: 2rem;
    }
    .two-futures {
        gap: var(--space-lg);
    }
    .future-card {
        padding: var(--space-lg);
    }
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
}


/* ==========================================================================
   DARK THEME FORMS (Auth pages)
   ========================================================================== */
.dark-form .form-input,
.dark-form .form-textarea,
.dark-form .form-select {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-inverse);
}
.dark-form .form-input:focus,
.dark-form .form-textarea:focus,
.dark-form .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.dark-form .form-label {
    color: var(--text-inverse);
}
.dark-form .form-help {
    color: var(--text-muted-inverse);
}

/* ==========================================================================
   HOMEPAGE — THE LIVING FRAMEWORK
   ========================================================================== */

/* Footer brand */
.footer-brand { max-width: 320px; }

/* Hero Search Bar */
.hero-search {
    max-width: 600px;
    margin: var(--space-xl) auto 0;
    position: relative;
    z-index: 2;
}
.hero-search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem var(--space-lg);
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.hero-search-form:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-glow), 0 4px 20px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.12);
}
.hero-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-inverse);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.5rem var(--space-md);
    outline: none;
}
.hero-search-input::placeholder {
    color: var(--text-muted-inverse);
    opacity: 0.7;
}
.hero-search-btn {
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    flex-shrink: 0;
}
.hero-search-btn:hover {
    background: var(--gold-bright);
    transform: scale(1.05);
}

/* Hero Stats Bar */
.hero-stats-bar {
    display: flex;
    justify-content: center;
    gap: var(--space-3xl);
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--gold-glow-light);
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.hero-stats-bar .stat-item {
    text-align: center;
}
.hero-stats-bar .stat-number {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gold);
    font-weight: 700;
    line-height: 1;
}
.hero-stats-bar .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted-inverse);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: var(--space-xs);
}

/* Tier Preview */
.tier-preview {
    padding: var(--space-4xl) 0;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-body) 100%);
}
.tier-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
}
.tier-badge {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    transition: background var(--transition-slow), border-color var(--transition-slow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.tier-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height var(--transition-slow);
}
.tier-badge:hover {
    border-color: var(--border-gold);
}
.tier-badge:hover::before {
    height: 100%;
    opacity: 0.06;
}
.tier-badge .tier-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto var(--space-md);
    position: relative;
    z-index: 1;
}
.tier-badge .tier-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    position: relative;
    z-index: 1;
}
.tier-badge .tier-range {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}
.tier-badge .tier-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}
.tier-badge.n0::before { background: var(--navy); opacity: 0.06; }
.tier-badge.n1::before { background: var(--navy); opacity: 0.04; }
.tier-badge.n2::before { background: var(--navy); opacity: 0.03; }
.tier-badge.n3::before { background: var(--gold); opacity: 0.08; }
.tier-badge.n4::before { background: var(--danger); opacity: 0.06; }
.tier-badge.n0 .tier-icon { background: var(--navy); color: var(--text-inverse); }
.tier-badge.n1 .tier-icon { background: var(--navy-70); color: var(--text-inverse); }
.tier-badge.n2 .tier-icon { background: var(--navy-50); color: var(--text-inverse); }
.tier-badge.n3 .tier-icon { background: var(--gold); color: var(--navy); }
.tier-badge.n4 .tier-icon { background: var(--danger); color: var(--text-inverse); }

/* Wiki Cards */
.wiki-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
}
.wiki-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--gold), var(--gold-dim));
    transition: height var(--transition-slow);
}
.wiki-card:hover {
    border-color: var(--gold);
}
.wiki-card:hover::before {
    height: 100%;
}
.wiki-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.wiki-card-number {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--navy-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.wiki-card-category {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--bg-sidebar);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.wiki-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}
.wiki-card-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}
.wiki-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}
.wiki-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.wiki-card-edit {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-sidebar);
    border: 1px solid var(--border-light);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    cursor: pointer;
    text-decoration: none;
    z-index: 2;
}
.wiki-card:hover .wiki-card-edit {
    opacity: 1;
}
.wiki-card-edit:hover {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

/* Activity Feed */
.activity-section {
    padding: var(--space-4xl) 0;
    background: var(--bg-body);
}
.activity-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-3xl);
}
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.activity-item:hover {
    border-color: var(--border-gold);
}
.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-muted), var(--navy-light));
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}
.activity-body {
    flex: 1;
    min-width: 0;
}
.activity-editor {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.activity-action {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}
.activity-action a {
    color: var(--text-heading);
    font-weight: 500;
}
.activity-action a:hover {
    color: var(--text-heading);
}
.activity-summary {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Contributor Leaderboard */
.contributor-leaderboard {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
}
.contributor-leaderboard h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}
.contributor-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}
.contributor-item:last-child {
    border-bottom: none;
}
.contributor-rank {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-heading);
    font-weight: 600;
    width: 24px;
    text-align: center;
}
.contributor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-muted), var(--navy-light));
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}
.contributor-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}
.contributor-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* CTA Section */
.cta-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}
.section-label.gold {
    color: var(--gold);
}
.activity-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}
.pathway-card .btn {
    margin-top: var(--space-md);
}
/* Responsive for homepage additions */
@media (max-width: 1024px) {
    .tier-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .activity-layout {
        grid-template-columns: 1fr;
    }
    .hero-stats-bar {
        gap: var(--space-xl);
    }
}
@media (max-width: 768px) {
    .tier-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-stats-bar {
        gap: var(--space-lg);
    }
    .hero-search-form {
        border-radius: var(--radius-lg);
    }
    .wiki-card-edit {
        opacity: 1;
    }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

/* ============================================
   DISCUSSION SECTION — Article Talk Pages
   ============================================ */

.discussion-section {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-light);
}

.discussion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.discussion-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin: 0;
}

.discussion-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted-inverse);
    background: var(--navy-800);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--border-light);
}

.discussion-form-card {
    background: var(--navy-800);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    color: var(--text-inverse);
}

.discussion-form-card .form-label {
    color: var(--text-inverse);
}

.discussion-login-prompt {
    background: var(--navy-800);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: center;
    color: var(--text-muted-inverse);
    font-size: 0.95rem;
}

.discussion-login-prompt a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
}

.discussion-login-prompt a:hover {
    text-decoration: underline;
}

.comment-textarea {
    width: 100%;
    background: var(--navy-900) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--text-inverse);
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.comment-textarea::placeholder {
    color: var(--text-muted-inverse);
}

/* Thread */
.discussion-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.discussion-comment {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--navy-800);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-inverse);
    transition: border-color 0.2s ease;
}

.discussion-comment:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.discussion-comment--reply {
    background: transparent;
    border: none;
    border-left: 2px solid var(--border-light);
    border-radius: 0;
    padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
    margin-top: var(--space-sm);
}

.comment-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--navy-700);
    border: 1px solid var(--border-light);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-inverse);
}

.comment-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted-inverse);
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted-inverse);
    overflow-wrap: anywhere;
}

.comment-text a {
    color: var(--gold);
    text-decoration: none;
}

.comment-text a:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

.comment-reply-btn {
    background: none;
    border: none;
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0;
    margin-top: var(--space-xs);
    transition: opacity 0.2s ease;
}

.comment-reply-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.reply-form {
    animation: fadeIn 0.2s ease;
}
.reply-form--hidden { display: none; }
.reply-form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.comment-replies {
    margin-top: var(--space-md);
    padding-left: var(--space-sm);
}

.discussion-empty {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-tertiary);
    font-size: 0.95rem;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
}

/* Badge variant for verified */
.badge-verified {
    background: rgba(201, 160, 58, 0.12);
    color: var(--gold-text);
    border: 1px solid rgba(201, 160, 58, 0.25);
}
.badge-verified--small { font-size: 0.65rem; }

/* Badge variant for trusted contributors (auto-publish on open articles) */
.badge-trusted {
    background: rgba(31, 122, 77, 0.12);
    color: #1f7a4d;
    border: 1px solid rgba(31, 122, 77, 0.3);
}
@media (prefers-color-scheme: dark) {
    .badge-trusted { color: #4ade80; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

/* Nav bell */
.nav-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--navy-900);
}

/* Dropdown notifications */
.dropdown--notifications {
    min-width: 280px;
    max-width: 320px;
}

.dropdown-notification {
    border-bottom: 1px solid var(--border-light);
}

.dropdown-notification:last-of-type {
    border-bottom: none;
}

.dropdown-notification--unread {
    background: var(--gold-glow-soft);
}

.dropdown-notification--unread .dropdown-link {
    border-left: 2px solid var(--gold);
}

.dropdown-notification-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-inverse);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-notification-time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted-inverse);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* Notification list page */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--navy-800);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-inverse);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.notification-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.notification-item--unread {
    background: var(--gold-glow-soft);
    border-left: 3px solid var(--gold);
}

.notification-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-light);
    flex-shrink: 0;
    margin-top: 6px;
}

.notification-item--unread .notification-status {
    background: var(--gold);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-inverse);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}

.notification-title:hover {
    color: var(--gold);
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-muted-inverse);
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.notification-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted-inverse);
}

.notification-action {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notification-item:hover .notification-action {
    opacity: 1;
}

/* ============================================
   CITATIONS & REFERENCES
   ============================================ */

/* Inline citation markers */
sup.citation {
    font-family: var(--font-mono);
    font-size: 0.7em;
    font-weight: 500;
    color: var(--text-heading);
    line-height: 1;
    margin: 0 1px;
}

sup.citation a {
    color: var(--text-heading);
    text-decoration: none;
    border-bottom: 1px dotted rgba(10, 22, 40, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

sup.citation a:hover {
    color: var(--text-heading);
    border-bottom-color: var(--text-heading);
}

sup.citation--missing {
    color: var(--danger);
    cursor: help;
}

/* Reference sidebar items */
.reference-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.reference-item:last-child {
    border-bottom: none;
}

.reference-key {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--navy-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reference-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.reference-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.reference-link {
    font-size: 0.75rem;
    color: var(--text-heading);
    text-decoration: none;
    margin-top: 2px;
}

.reference-link:hover {
    text-decoration: underline;
}

/* ============================================
   PRINT / PDF EXPORT
   ============================================ */



/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumb {
    padding: var(--space-sm) 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-lg);
}
.breadcrumb a {
    color: var(--text-tertiary);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--text-heading);
    text-decoration: underline;
}
.breadcrumb-sep {
    margin: 0 var(--space-sm);
    color: var(--border);
}

/* ==========================================================================
   CRISIS NARRATIVE
   ========================================================================== */
.crisis-section {
    background: var(--bg-body);
    padding: var(--space-4xl) 0;
    border-top: 1px solid var(--border-light);
}
.crisis-content-note {
    max-width: 800px;
    margin: 0 auto var(--space-lg);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}
.crisis-narrative {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.crisis-lead {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-3xl);
}
.crisis-stat-solo {
    padding-top: var(--space-3xl);
    border-top: 1px solid var(--border-light);
}
.crisis-stat-solo .crisis-stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: var(--space-sm);
}
.crisis-stat-solo .crisis-stat-caption {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}
@media (max-width: 640px) {
    .crisis-stat-solo .crisis-stat-number { font-size: 2.25rem; }
    .crisis-lead { font-size: 1.1rem; }
}

/* ==========================================================================
   OUR APPROACH
   ========================================================================== */
.approach-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-top: var(--space-xl);
}
@media (max-width: 768px) {
    .approach-grid { grid-template-columns: 1fr; }
}
.approach-item {
    text-align: center;
    padding: var(--space-xl) 0;
}
.approach-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
}
.approach-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--space-sm);
}
.approach-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 280px;
    margin: 0 auto;
}

/* ==========================================================================
   SECTION SPACING UTILITIES
   ========================================================================== */
.section-light { background: #ffffff; padding: var(--space-3xl) 0; }
.section-muted { background: var(--bg-sidebar); padding: var(--space-3xl) 0; }
.section-dark { background: var(--navy); color: var(--text-inverse); padding: var(--space-3xl) 0; }
.section-dark--bordered { border-top: 1px solid rgba(255,255,255,0.08); }
.section-title--inverse { color: var(--text-inverse); }
.section-subtitle--inverse { color: var(--text-muted-inverse); max-width: 640px; margin: var(--space-md) auto 0; }
.section-cta { text-align: center; margin-top: var(--space-2xl); }
.section-cta .btn + .btn { margin-left: var(--space-md); }
.section-cta--left { text-align: left; }

/* ==========================================================================
   PUBLICATION LIST
   ========================================================================== */
.publication-list { max-width: 900px; margin: 0 auto; }
.publication-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--space-lg);
    align-items: start;
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--border-light);
}
.publication-item:first-child { padding-top: 0; }
.publication-item:last-child { border-bottom: none; }
@media (max-width: 640px) {
    .publication-item { grid-template-columns: 1fr; gap: var(--space-sm); }
}
.publication-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.publication-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}
.publication-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold-dim);
}
.publication-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}
.publication-title a {
    color: var(--text-heading);
    text-decoration: none;
}
.publication-title a:hover { color: var(--text-heading); text-decoration: underline; }
.publication-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.publication-stats {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    padding-top: var(--space-xs);
}

/* ==========================================================================
   FRAMEWORK AT A GLANCE
   ========================================================================== */
.glance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    max-width: 800px;
    margin: 0 auto var(--space-2xl);
    text-align: center;
}
@media (max-width: 768px) {
    .glance-grid { grid-template-columns: repeat(2, 1fr); }
}
.glance-item { padding: var(--space-lg) 0; }
.glance-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: var(--space-sm);
}
.glance-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   PARTNERSHIPS
   ========================================================================== */
.partnership-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}
@media (max-width: 768px) {
    .partnership-grid { grid-template-columns: 1fr; }
}
.partnership-item {
    text-align: center;
    padding: var(--space-xl);
}
.partnership-item svg {
    margin: 0 auto var(--space-sm);
    display: block;
}
.partnership-item h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-inverse);
}
.partnership-item p {
    font-size: 0.875rem;
    color: var(--text-muted-inverse);
    line-height: 1.6;
}

/* ==========================================================================
   CTA SECONDARY
   ========================================================================== */
.cta-secondary {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--text-muted-inverse);
    font-size: 0.9rem;
}
.cta-secondary a {
    color: var(--gold);
    text-decoration: none;
}
.cta-secondary a:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

.form-group--flush { margin-bottom: 0; }
.form-group--compact { margin-bottom: var(--space-xs); }

/* ==========================================================================
   FORM LOADING STATES
   ========================================================================== */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}
.btn-primary.is-loading::after {
    border-color: rgba(5, 13, 26, 0.2);
    border-top-color: var(--navy);
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}
.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    outline: none;
}
.form-group {
    transition: opacity 200ms ease;
}
.form-group.is-validated .form-input:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}
.form-group.is-validated .form-input:invalid:not(:placeholder-shown) + .form-error {
    display: block;
}


/* ==========================================================================
   EDITOR
   ========================================================================== */
.editor-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}
.preview-section {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-light);
}
.preview-title {
    font-family: var(--font-heading);
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}
.preview-content {
    background: var(--bg-sidebar);
    padding: 2rem;
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}
.category-chips {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-2xl);
    align-items: center;
}
.category-chips-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.category-chip {
    background: var(--navy-light);
    color: var(--text-inverse);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: 1px solid var(--border-gold);
    font-family: var(--font-mono);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.card-title--large {
    font-size: 1.35rem;
    margin: 0;
}
.watchlist-preview { display: grid; gap: var(--space-sm); }
.watchlist-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}
.watchlist-preview-item:last-child { border-bottom: none; }
.watchlist-preview-item a {
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}
.watchlist-preview-item a:hover { text-decoration: underline; }
.watchlist-preview-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}
.filter-bar-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-right: 0.5rem;
}
.filter-bar--inline { margin-bottom: 0; }

/* Reviewer context strip on queue cards */
.reviewer-strip {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}
.reviewer-strip-name { font-weight: 600; color: var(--text-primary); }
.reviewer-strip-stat { color: var(--text-tertiary); font-family: var(--font-mono); }

/* Review cards */
.review-card { margin-bottom: 1.5rem; }
.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.review-card-id {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--navy-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
    display: block;
}
.review-card-title {
    font-family: var(--font-heading);
    color: var(--text-heading);
    margin-bottom: 0.25rem;
    font-size: 1.15rem;
}
.review-card-title a { color: var(--text-heading); text-decoration: none; }
.review-card-title a:hover { text-decoration: underline; }
.review-card-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}
.review-card-summary {
    background: var(--bg-sidebar);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.review-card-diff { margin-bottom: 1rem; }
.review-card-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.review-form { flex: 1; }
.review-form .form-textarea { min-height: 60px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
}
.empty-state svg {
    margin: 0 auto 1rem;
    display: block;
}
.empty-state-title {
    font-family: var(--font-heading);
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Chart container */
.chart-container {
    margin-bottom: 1.5rem;
    height: 320px;
}

/* Data table compact */
.data-table--compact { font-size: 0.85rem; }

/* Badge urgent */
.badge-urgent {
    background: var(--danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-left: 6px;
    vertical-align: middle;
}

/* Button block */
.btn-block { width: 100%; }

/* ==========================================================================
   TIER CALCULATOR
   ========================================================================== */
.calculator-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 2rem 0;
}
.calculator-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
    text-align: center;
}
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}
@media (max-width: 768px) {
    .calculator-grid { grid-template-columns: 1fr; }
}
.criteria-category {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.criteria-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.category-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--navy);
    font-weight: 700;
}
.category-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
}
.criteria-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}
.criteria-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.score-buttons {
    display: flex;
    gap: 0.25rem;
}
.score-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 200ms ease;
}
.score-btn:hover {
    border-color: var(--navy);
    color: var(--text-heading);
}
.score-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
}
.result-panel {
    position: sticky;
    top: 100px;
}
.result-card {
    background: var(--bg-sidebar);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
}
.score-display {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--border-light);
    transition: all 200ms ease;
}
.score-display.t1 { border-color: var(--navy); background: var(--navy-wash); }
.score-display.t2 { border-color: var(--navy-70); background: rgba(10, 22, 40, 0.06); }
.score-display.t3 { border-color: var(--navy-50); background: rgba(10, 22, 40, 0.04); }
.score-display.t4 { border-color: var(--gold); background: rgba(212, 180, 74, 0.1); }
.score-display.t5 { border-color: var(--danger); background: rgba(127, 29, 29, 0.06); }
.score-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1;
}
.score-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}
.tier-badge-calc {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}
.tier-badge-calc.t1 { background: var(--navy); color: white; }
.tier-badge-calc.t2 { background: var(--navy-70); color: white; }
.tier-badge-calc.t3 { background: var(--navy-50); color: white; }
.tier-badge-calc.t4 { background: var(--gold); color: var(--navy); }
.tier-badge-calc.t5 { background: var(--danger); color: white; }
.tier-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.tier-range-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}
.calc-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ==========================================================================
   DIFF VIEW
   ========================================================================== */
.diff-header { margin-bottom: var(--space-xl); }
.diff-revisions {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}
.diff-revision {
    flex: 1;
    min-width: 200px;
}
.diff-revision-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 4px;
}
.diff-revision-id {
    font-weight: 600;
    color: var(--text-heading);
}
.diff-revision-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}
.diff-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}
.diff-content { overflow-x: auto; }
.diff-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
}
.diff-content td {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-light);
    vertical-align: top;
}
.diff-content .diff_add {
    background: rgba(201, 160, 58, 0.08);
    color: var(--text-heading);
}
.diff-content .diff_chg {
    background: rgba(201, 160, 58, 0.04);
}
.diff-content .diff_sub {
    background: rgba(127, 29, 29, 0.06);
    color: var(--danger);
}
.diff-content td:first-child {
    width: 40px;
    text-align: right;
    color: var(--text-tertiary);
    background: var(--bg-sidebar);
}

/* R3 — rendered side-by-side diff preview */
.diff-panes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    align-items: start;
}
.diff-pane { padding: var(--space-lg); min-width: 0; }
.diff-pane-heading {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-heading);
    margin: 0 0 var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.diff-pane-content {
    max-height: 70vh;
    overflow-y: auto;
    overflow-wrap: break-word;
}
.diff-raw { margin-bottom: var(--space-lg); }
.diff-raw summary {
    cursor: pointer;
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    color: var(--text-heading);
}
.review-on-diff { margin-bottom: var(--space-lg); }
.review-on-diff .card-title { margin-bottom: var(--space-xs); }
@media (max-width: 900px) {
    .diff-panes { grid-template-columns: 1fr; }
}

/* ==========================================================================
   API DOCS
   ========================================================================== */
.api-docs-notice {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    padding: var(--space-md) var(--space-lg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: var(--space-2xl);
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.api-docs-notice a {
    color: var(--text-heading);
    text-decoration: underline;
}
.api-docs-notice a:hover {
    color: var(--text-heading);
}
.api-docs-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}
.api-docs-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.api-docs-card:hover {
    border-color: var(--gold);
}
.api-docs-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}
.api-docs-method {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.api-docs-method--get {
    background: var(--success-bg);
    color: var(--success);
}
.api-docs-method--post {
    background: var(--info-bg);
    color: var(--info);
}
.api-docs-path {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-sidebar);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}
.api-docs-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}
.api-docs-meta {
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
}
.api-docs-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: var(--space-xs);
}
.api-docs-value {
    color: var(--text-secondary);
}
.api-docs-params ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
    list-style: none;
    padding-left: 0;
}
.api-docs-params li code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-sidebar);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}
.api-docs-response pre {
    margin-top: var(--space-xs);
    background: var(--navy);
    color: var(--text-inverse);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
}

/* ==========================================================================
   DARK MODE (prefers-color-scheme: dark)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f172a;
        --bg-card: rgba(30, 41, 59, 0.92);
        --bg-sidebar: #1e293b;
        --bg-tertiary: #1e293b;
        --bg-glass: rgba(15, 23, 42, 0.85);
        --border: #334155;
        --border-light: #475569;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #cbd5e1;
        --text-heading: #f1f5f9;
        --gold-text: #e0c050;
        --danger: #f87171;
        --danger-bg: rgba(248, 113, 113, 0.12);
        --success: #4ade80;
        --success-bg: rgba(74, 222, 128, 0.12);
        --warning: #fbbf24;
        --warning-bg: rgba(251, 191, 36, 0.12);
        --info: #93c5fd;
        --info-bg: rgba(147, 197, 253, 0.12);
        --diff-add-bg: rgba(74, 222, 128, 0.14);
        --diff-add-text: #86efac;
        --diff-chg-bg: rgba(251, 191, 36, 0.12);
        --diff-chg-text: #fcd34d;
        --diff-sub-bg: rgba(248, 113, 113, 0.14);
        --diff-sub-text: #fca5a5;
    }
    body {
        color: var(--text-primary);
        background: var(--bg-body);
    }
    .card, .wiki-card, .activity-item, .contributor-leaderboard, .pathway-card, .tier-badge {
        background: var(--bg-card);
        border-color: var(--border);
    }
    .glass-card {
        background: var(--bg-card);
        border-color: var(--border);
    }
    .section-muted {
        background: var(--bg-sidebar);
    }
    .crisis-section, .section-light {
        background: #1e293b;
    }
    .future-card {
        background: var(--bg-card);
        border-color: var(--border);
    }
    .data-table {
        background: var(--bg-card);
    }
    .form-input, .form-textarea, .form-select {
        background: #1e293b;
        border-color: var(--border);
        color: var(--text-primary);
    }
    .article-hero-image img {
        filter: brightness(0.85);
    }
    .article-hero-image::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(10, 22, 40, 0.25) 0%, rgba(10, 22, 40, 0.55) 100%);
        border-radius: var(--radius-lg);
        pointer-events: none;
    }
    .api-docs-card {
        background: var(--bg-card);
        border-color: var(--border);
    }
    .api-docs-card:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    }
    .api-docs-notice {
        background: rgba(30, 58, 95, 0.3);
        border-left-color: var(--gold);
    }
    .api-docs-response pre {
        background: #0a1525;
        color: var(--text-primary);
    }
    .api-docs-path {
        background: var(--bg-sidebar);
        color: var(--text-primary);
    }

    /* Navy-muted kickers are unreadable on dark surfaces */
    .section-label,
    .wiki-card-number,
    .reference-key,
    .review-card-id {
        color: var(--text-tertiary);
    }

    /* Citation markers: dotted underline invisible on dark */
    sup.citation a {
        border-bottom-color: rgba(241, 245, 249, 0.4);
    }
    sup.citation a:hover {
        border-bottom-color: var(--text-heading);
    }

    /* Verified badge on dark cards */
    .badge-verified {
        background: rgba(212, 180, 74, 0.15);
        color: var(--gold-bright);
        border-color: rgba(212, 180, 74, 0.4);
    }

    /* Tier calculator washes (navy alpha washes vanish on dark cards) */
    .score-display.t1 { border-color: #94a3b8; background: rgba(148, 163, 184, 0.14); }
    .score-display.t2 { border-color: #64748b; background: rgba(148, 163, 184, 0.1); }
    .score-display.t3 { border-color: #475569; background: rgba(148, 163, 184, 0.07); }
    .tier-badge-calc.t2 { background: #475569; }
    .tier-badge-calc.t3 { background: #334155; }
    .tier-badge.n1 .tier-icon,
    .tier-badge.n2 .tier-icon { background: #334155; }
    .score-btn {
        background: var(--bg-sidebar);
        border-color: var(--border);
        color: var(--text-secondary);
    }

    /* Fix button outlines */
    .btn-outline {
        color: var(--text-primary);
    }

    /* Fix SVG icons */
    .approach-icon svg,
    .pathway-icon svg {
        stroke: var(--text-primary) !important;
    }

    /* Badges with navy wash backgrounds are unreadable on dark surfaces */
    .badge-pending,
    .badge-contributor {
        background: rgba(148, 163, 184, 0.15);
        color: var(--text-secondary);
    }

    /* Discussion comments */
    .discussion-comment {
        background: var(--bg-card);
        border-color: var(--border);
    }
    .discussion-comment:hover {
        border-color: var(--border-light);
    }
    .discussion-comment--reply {
        border-left-color: var(--border);
    }
    .comment-text a {
        color: var(--gold-bright);
    }
    .comment-text a:hover {
        color: var(--gold);
    }
}

/* ==========================================================================
   TEMPLATE COMPONENT CLASSES (extracted from inline styles — Phase 5)
   ========================================================================== */
/* Spacing & layout utilities (extend mt-/mb- scale) */
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-2xl); }
.mt-6 { margin-top: var(--space-3xl); }
.mb-5 { margin-bottom: var(--space-2xl); }
.mb-6 { margin-bottom: var(--space-3xl); }
.m-0 { margin: 0; }
.pb-3xl { padding-bottom: var(--space-3xl); }
.p-4 { padding: var(--space-xl); }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-xs { gap: 0.25rem; }
.gap-1 { gap: 0.5rem; }
.gap-4 { gap: 2rem; }
.grid { display: grid; }
.w-full { width: 100%; }
.maxw-150 { max-width: 150px; }
.maxw-300 { max-width: 300px; }
.overflow-hidden { overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.no-underline { text-decoration: none; }

/* Text utilities */
.text-gold { color: var(--gold); }
.text-tertiary { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-inverse { color: var(--text-inverse); }
.text-muted-inverse { color: var(--text-muted-inverse); }
.text-navy { color: var(--text-heading); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-danger-light { color: #fecaca; }
.fw-600 { font-weight: 600; }
.fs-60 { font-size: 0.6rem; }
.fs-75 { font-size: 0.75rem; }
.fs-80 { font-size: 0.8rem; }
.fs-85 { font-size: 0.85rem; }
.fs-90 { font-size: 0.9rem; }
.fs-110 { font-size: 1.1rem; }

/* Section eyebrow (repeated kicker pattern) */
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gold-text);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-md);
    display: block;
}
.page-header .section-eyebrow,
.section-dark .section-eyebrow,
.hero .section-eyebrow {
    color: var(--gold);
}
.card-kicker {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gold-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}
.card-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gold-text);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
    display: block;
}
.meta-mono { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-tertiary); }
.meta-mono--gold { color: var(--gold-text); }

/* Auth screens (login, register, password reset) */
.auth-screen {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    background: linear-gradient(165deg, var(--navy-deep) 0%, var(--navy) 40%, var(--navy-light) 100%);
}
.auth-panel { width: 100%; max-width: 440px; }
.auth-panel--wide { max-width: 560px; }
.auth-header { text-align: center; margin-bottom: 2.5rem; }
.auth-logo-ring {
    width: 64px;
    height: 64px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-inverse);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}
.auth-subtitle { color: var(--text-muted-inverse); font-size: 0.95rem; font-weight: 300; }
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted-inverse);
}
.glass-card--bordered { border: 1px solid rgba(255,255,255,0.1); }
.alert-error--dark {
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    border-color: rgba(127, 29, 29, 0.5);
}
.icon-inline { margin-right: 6px; }
.icon-block { margin: 0 auto 1rem; }
.muted-label { font-weight: 400; color: var(--text-muted-inverse); }
.form-group--inset {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; }

/* Error pages */
.page-header--tall { padding: var(--space-4xl) 0; }
.page-header--roomy { padding: var(--space-3xl) 0; }
.page-header-title--fluid { font-size: clamp(2rem, 5vw, 3.5rem); }
.page-header-subtitle--centered { max-width: 600px; margin: var(--space-md) auto 0; }
.page-header-subtitle--wide { max-width: 700px; }
.error-code { font-family: var(--font-display); font-size: 6rem; color: var(--gold); line-height: 1; }

/* Content layout */
.content-narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.action-row {
    margin-top: var(--space-xl);
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Headings & copy */
.section-heading {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}
.sub-heading {
    font-family: var(--font-heading);
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}
.sub-heading--spaced { margin-bottom: 1.5rem; }
.card-heading { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: var(--space-sm); }
.card-heading--flush { margin-bottom: 4px; }
.card-copy { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }
.card-copy--compact { line-height: 1.6; }
.item-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.item-meta { font-size: 0.85rem; color: var(--text-tertiary); margin: 4px 0 0 0; }
.meta-note { margin-top: 1rem; font-size: 0.85rem; color: var(--text-tertiary); }
.card-meta { margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-tertiary); }
.stat-value--lg { font-size: 2.5rem; margin-bottom: 1rem; }
.section-lead { color: var(--text-secondary); max-width: 600px; margin: 0 auto var(--space-xl); }

/* Steps */
.step-row { display: flex; gap: var(--space-md); align-items: flex-start; }
.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-700);
    border: 1px solid var(--border-light);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    flex-shrink: 0;
}
.step-number--gold { background: var(--gold); color: var(--navy-900); border: none; }

/* Panels & callouts */
.info-panel {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}
.danger-panel {
    background: var(--danger-bg);
    border-radius: 8px;
    padding: var(--space-xl);
    border-left: 4px solid var(--danger);
}
.callout-box {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--navy-800);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
    color: var(--text-muted-inverse);
}
.callout-box a { color: var(--gold); }
.callout-box a:hover { color: var(--gold-bright); }
.callout-box h2, .callout-box h3, .callout-box h4, .callout-box strong { color: var(--text-inverse); }
.callout-box--gold { background: rgba(201, 160, 58, 0.06); border-radius: var(--radius-md); }
.quote-text { margin: 0; font-style: italic; color: var(--text-secondary); }
.gradient-cta {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--text-inverse);
    padding: var(--space-2xl);
    border-radius: 4px;
    margin-top: var(--space-3xl);
    text-align: center;
}
.cta-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: var(--space-md);
    color: var(--gold);
}
.cta-text {
    color: var(--text-muted-inverse);
    margin-bottom: var(--space-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.cta-actions--compact { gap: var(--space-md); }
.cta-panel {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    background: var(--navy-800);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    color: var(--text-muted-inverse);
}
.cta-panel a:not(.btn) { color: var(--gold); }
.cta-panel .section-lead { color: var(--text-muted-inverse); }
.cta-panel-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-inverse);
    margin-bottom: var(--space-md);
}
.cta-note { color: var(--text-muted-inverse); font-size: 0.8rem; margin-top: var(--space-md); }
.btn--cta { font-size: 1rem; padding: 0.75rem 2rem; }

/* Matrix tables (governance pages) */
.matrix-table { width: 100%; border-collapse: collapse; margin: var(--space-md) 0; font-size: 0.9rem; }
.matrix-table th, .matrix-table td { text-align: left; padding: 0.5rem; border: 1px solid var(--border-light); }
.matrix-table .matrix-head { background: var(--navy-800); color: var(--gold); }
.matrix-table .matrix-head th, .matrix-table .matrix-head td { color: var(--gold); }

/* Sidebar */
.sidebar-link--lined { border-bottom: 1px solid var(--border-light); padding-bottom: 0.5rem; }
.sidebar-meta-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
}
.sidebar-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.sidebar-narrow { max-width: 320px; }

/* Forms */
.form-narrow { max-width: 640px; }
.form-actions-row { display: flex; gap: var(--space-md); align-items: center; margin-top: var(--space-lg); }
.form-note { font-size: 0.8rem; color: var(--text-tertiary); margin-top: var(--space-md); }
.form-select--sm { font-size: 0.8rem; padding: 0.25rem; }
.inline-form { display: inline; }
.filter-bar { margin-bottom: var(--space-xl); display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Empty states & pagination */
.empty-state { text-align: center; padding: var(--space-3xl); }
.empty-state-compact { text-align: center; padding: 3rem; }
.empty-state-title { color: var(--text-tertiary); font-size: 1.1rem; }
.empty-state-sub { color: var(--text-tertiary); font-size: 0.9rem; margin-top: var(--space-sm); }
.pagination--compact { margin-top: var(--space-xl); }
.pagination-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--text-tertiary);
}
.card-row { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg); }
.table-empty-cell { text-align: center; color: var(--text-tertiary); padding: 2rem; }

/* Search */
.search-bar { display: flex; gap: 0.5rem; max-width: 700px; }
.search-input { flex: 1; font-size: 1.1rem; padding: 1rem 1.25rem; }
.search-submit { padding: 0 2rem; }
.results-summary { color: var(--text-tertiary); margin-bottom: var(--space-xl); font-size: 0.95rem; }
.result-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}
.meta-item { display: flex; gap: 0.35rem; align-items: center; }
.tag-chip {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: capitalize;
}

/* Badges & wiki cards */
.badge--tiny { font-size: 0.6rem; }
.badge--inline { margin-left: 0.5rem; }
.wiki-card-number--navy { background: var(--navy-700); }

/* ==========================================================================
   CONTENT WARNING NOTICE (article-level, calm and dismissible per view)
   ========================================================================== */
.content-warning {
    position: relative;
    margin: 0 0 var(--space-xl);
    padding: var(--space-md) 3rem var(--space-md) var(--space-lg);
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    background: var(--warning-bg);
}
.content-warning-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--warning);
    margin-bottom: var(--space-xs);
}
.content-warning-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.content-warning-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition);
}
.content-warning-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}
.content-warning-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--gold);
}

/* ==========================================================================
   PLAIN-LANGUAGE SUMMARY ("In short" callout at top of article)
   ========================================================================== */
.article-summary {
    margin: 0 0 var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    background: var(--bg-sidebar);
}
.article-summary-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-text);
    margin-bottom: var(--space-xs);
}
.article-summary-text {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Loop-staggered reveal delay (set via --reveal-delay custom property) */
.reveal-delay { transition-delay: var(--reveal-delay, 0ms); }
