/* STRATEGIOS — shared brand CSS
 * Source of truth: strategios-brand/css/strategios.css
 * Distributed via freeze.py (OUTREACH) or sync-css.sh (APP)
 * Design system: Inter, B&W, sentence case
 * See: strategios-brand/DESIGN-MANUAL.md
 *
 * Base extracted from STRATEGIANALYS and SIMULERA (most advanced APP sites).
 * App-layer components merged from SAMSYN (voting, sliders, session flows).
 * One monolith for all STRATEGIOS sites and apps.
 */

/* ══════════════════════════════════════
   FOUNDATIONS
   ══════════════════════════════════════ */

/* ── Self-hosted Inter ── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-700.woff2') format('woff2');
}

/* ── Design tokens ── */
:root {
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Brand colors — B&W only */
    --black: #000000;
    --white: #FFFFFF;
    --dark-grey: #1A1A1A;
    --medium-grey: #666666;
    --light-grey: #E5E5E5;
    --pale-grey: #F5F5F5;
    --text-grey-pale: #767676;
    --surface: #FFFFFF;

    /* Semantic aliases (apps use these) */
    --fg: var(--black);
    --bg: var(--white);
    --bg-alt: var(--pale-grey);
    --bg-elevated: var(--white);
    --border: var(--light-grey);
    --border-strong: #BDBDBD;
    --muted: var(--medium-grey);
    --subtle: #BDBDBD;

    /* Data visualization colors */
    --color-green: #16a34a;
    --color-green-light: #f0fdf4;
    --color-red: #dc2626;
    --color-red-light: #fef2f2;
    --color-yellow: #ca8a04;
    --color-yellow-light: #fefce8;
    --color-blue: #2563eb;
    --color-blue-light: #eff6ff;
    --color-cyan: #06b6d4;
    --color-orange: #f97316;
    --color-amber: #f59e0b;

    /* Spacing scale */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.25rem;
    --s-6: 1.5rem;
    --s-8: 2rem;
    --s-10: 2.5rem;
    --s-12: 3rem;
    --s-16: 4rem;
    --s-20: 5rem;
    --s-24: 6rem;

    /* Layout */
    --container: 64rem;
    --radius: 0.5rem;
    --radius-sm: 0.25rem;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --black: #F0F0F0;
        --white: #111111;
        --dark-grey: #E0E0E0;
        --medium-grey: #999999;
        --light-grey: #2A2A2A;
        --pale-grey: #1A1A1A;
        --text-grey-pale: #8A8A8A;
        --surface: #0A0A0A;

        --fg: #e8e8e8;
        --bg: #111111;
        --bg-alt: #1a1a1a;
        --bg-elevated: #1e1e1e;
        --border: #2e2e2e;
        --border-strong: #444444;
        --muted: #888888;
        --subtle: #555555;

        --color-green: #4ade80;
        --color-green-light: rgba(74, 222, 128, 0.1);
        --color-red: #f87171;
        --color-red-light: rgba(248, 113, 113, 0.1);
        --color-yellow: #facc15;
        --color-yellow-light: rgba(250, 204, 21, 0.1);
        --color-blue: #60a5fa;
        --color-blue-light: rgba(96, 165, 250, 0.1);
    }
}

:root[data-theme="dark"] {
    --black: #F0F0F0;
    --white: #111111;
    --dark-grey: #E0E0E0;
    --medium-grey: #999999;
    --light-grey: #2A2A2A;
    --pale-grey: #1A1A1A;
    --text-grey-pale: #8A8A8A;
    --surface: #0A0A0A;

    --fg: #e8e8e8;
    --bg: #111111;
    --bg-alt: #1a1a1a;
    --bg-elevated: #1e1e1e;
    --border: #2e2e2e;
    --border-strong: #444444;
    --muted: #888888;
    --subtle: #555555;

    --color-green: #4ade80;
    --color-green-light: rgba(74, 222, 128, 0.1);
    --color-red: #f87171;
    --color-red-light: rgba(248, 113, 113, 0.1);
    --color-yellow: #facc15;
    --color-yellow-light: rgba(250, 204, 21, 0.1);
    --color-blue: #60a5fa;
    --color-blue-light: rgba(96, 165, 250, 0.1);
}

:root[data-theme="light"] {
    --black: #000000;
    --white: #FFFFFF;
    --dark-grey: #1A1A1A;
    --medium-grey: #666666;
    --light-grey: #E5E5E5;
    --pale-grey: #F5F5F5;
    --text-grey-pale: #767676;
    --surface: #FFFFFF;

    --fg: #000000;
    --bg: #FFFFFF;
    --bg-alt: #F5F5F5;
    --bg-elevated: #FFFFFF;
    --border: #E5E5E5;
    --border-strong: #BDBDBD;
    --muted: #666666;
    --subtle: #BDBDBD;

    --color-green: #16a34a;
    --color-green-light: #f0fdf4;
    --color-red: #dc2626;
    --color-red-light: #fef2f2;
    --color-yellow: #ca8a04;
    --color-yellow-light: #fefce8;
    --color-blue: #2563eb;
    --color-blue-light: #eff6ff;
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--black);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--fg);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: opacity var(--transition);
}
a:hover { opacity: 0.6; }

ul, ol {
    list-style: none;
}

/* ── Accessibility ── */
.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;
}

:focus-visible {
    outline: 2px solid var(--black);
    outline-offset: 2px;
}

/* ══════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

h1 { font-size: 2.25rem; letter-spacing: -0.025em; margin-bottom: 0.5em; }
h2 {
    font-size: 0.75rem; font-weight: 500; margin-bottom: 0.5em;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.4; margin-bottom: 0.4em; }
h4 { font-size: 1rem; margin-bottom: 0.3em; }

p { line-height: 1.6; }

code {
    background: var(--bg-alt);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.text-xs { font-size: 0.75rem; line-height: 1.4; }
.text-sm { font-size: 0.875rem; line-height: 1.5; }
.text-lg { font-size: 1.125rem; line-height: 1.6; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.italic { font-style: italic; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-muted { color: var(--muted); }

/* ── Color utilities ── */
.text-black { color: var(--black); }
.text-white { color: var(--white); }
.text-grey { color: var(--medium-grey); }
.text-grey-pale { color: var(--text-grey-pale); }
.text-pass { color: var(--black); font-weight: 600; }
.text-fail { color: var(--medium-grey); }

/* ── Label (small caps small text) ── */
.label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* ── Detail text (key-value pairs) ── */
.detail-text { font-size: 0.875rem; }
.detail-label { font-size: 0.8125rem; font-weight: 500; }

/* ── Score large (numeric display) ── */
.score-large {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

/* ── Method list (ordered list with consistent typography) ── */
.method-list { padding-left: 1.5rem; }
.method-list li { font-size: 0.875rem; margin-bottom: 0.5rem; }

/* ── Info section (full-width section padding) ── */
.info-section { padding: 2rem 0; }

/* ── Card / form action rows (button groups inside cards or form footers) ── */
.card-actions {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-4);
}

.form-actions {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-6);
}

/* ── Guidance box (info callout with grid for tips) ── */
.guidance {
    margin-bottom: var(--s-8);
    padding: var(--s-5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
}
.guidance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-3);
    margin-top: var(--s-3);
}
.guidance-item {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}
@media (max-width: 640px) {
    .guidance-grid { grid-template-columns: 1fr; }
}

/* ── Icon button (small circular button for inline actions) ── */
.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    color: var(--muted);
    transition: all var(--transition);
}
.btn-icon:hover { color: var(--color-red); border-color: var(--color-red); }

/* ── Language switcher (inline lang links separator) ── */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}
.lang-link {
    color: var(--muted);
    text-decoration: none;
    padding: 0.125rem 0.25rem;
    transition: color var(--transition);
}
.lang-link:hover { color: var(--fg); opacity: 1; }
.lang-link.active { color: var(--fg); font-weight: 600; }
.lang-sep { color: var(--subtle); }

/* ── Result page primitives (header/section/content/list/actions) ── */
.result-header {
    margin-bottom: var(--s-6);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--border);
}
.result-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--s-2);
}
.result-section { margin-bottom: var(--s-6); }
.result-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--s-2);
}
.result-content {
    padding: var(--s-4);
    background: var(--bg-alt);
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-size: 0.875rem;
}
.result-list { padding-left: var(--s-6); }
.result-list li { margin-bottom: var(--s-2); }
.result-actions {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-8);
    padding-top: var(--s-4);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* ── Result two-column grid (sticky-aside + main) ── */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
    align-items: start;
}

/* ── Export section (post-result CTA block with top divider) ── */
.export-section {
    margin-top: var(--s-8);
    padding-top: var(--s-6);
    border-top: 1px solid var(--border);
}
.export-actions {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-3);
    margin-bottom: var(--s-2);
    flex-wrap: wrap;
}

/* ── Method/about page wrappers (narrow prose, headings + lists) ── */
.method-content,
.about-page {
    max-width: 42rem;
}
.method-content h2,
.about-page h2 { margin-top: var(--s-8); }
.method-content h3 { margin-top: var(--s-6); }
.method-content p,
.about-page p { margin-bottom: var(--s-4); }
.method-content ul,
.method-content ol,
.about-page ul,
.about-page ol {
    margin-bottom: var(--s-4);
    padding-left: var(--s-6);
}
.method-content li,
.about-page li {
    margin-bottom: var(--s-2);
    font-size: 0.875rem;
}
.method-content code {
    font-size: 0.8125rem;
    background: var(--bg-alt);
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
}
.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
    margin: var(--s-4) 0;
}
.ref-list { list-style: none; padding-left: 0; }
.ref-list li {
    margin-bottom: var(--s-3);
    font-size: 0.8125rem;
    color: var(--muted);
}

/* ── Info cards container (paired card grid intro section) ── */
.info-cards { padding: var(--s-8) 0; }

/* ── Subtitle (lead text variant under hero h1) ── */
.subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: var(--s-4);
}

/* ── Pipeline (linear step-arrow process visualization) ── */
.pipeline { margin-top: var(--s-8); }
.pipeline-steps {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
    margin-top: var(--s-4);
}
.pipeline-step {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s-2) var(--s-4);
    font-size: 0.9rem;
}
.pipeline-step__num {
    font-weight: 600;
    background: var(--fg);
    color: var(--bg);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.pipeline-step__label { font-size: 0.9rem; }
.pipeline-arrow {
    font-size: 1.25rem;
    color: var(--muted);
}

/* ── Stat block (numeric metric with label) ── */
.stat {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── Frequency bar (horizontal progress fill, score visualization) ── */
.frequency-bar,
.match-bar {
    height: 6px;
    background: var(--bg-alt, var(--surface));
    border-radius: 3px;
    margin-top: var(--s-2);
    position: relative;
}
.frequency-bar { height: 4px; }
.frequency-fill,
.match-fill {
    height: 100%;
    background: var(--fg);
    border-radius: 3px;
    transition: width 0.3s;
}
.match-label {
    font-size: 0.75rem;
    color: var(--muted);
    position: absolute;
    right: 0;
    top: -1.25rem;
}

/* ── Chart grid + wrapper (generic chart container primitives) ── */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap, var(--s-6));
    margin-top: var(--s-4);
}
.chart-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s-4);
    min-height: 350px;
}

/* ── Skip link (a11y, hidden until focused) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--fg);
    color: var(--bg);
    padding: var(--s-2) var(--s-4);
    z-index: 100;
    font-size: 0.9rem;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Process list (counter-based numbered list with circles) ── */
.process-list {
    list-style: none;
    padding: 0;
    counter-reset: process;
}
.process-list li {
    counter-increment: process;
    padding: var(--s-2) 0;
    padding-left: var(--s-8);
    position: relative;
    border-bottom: 1px solid var(--border);
}
.process-list li::before {
    content: counter(process);
    position: absolute;
    left: 0;
    top: var(--s-2);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--fg);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── References (bordered reference list) ── */
.references {
    list-style: none;
    padding: 0;
}
.references li {
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}

/* ── Tools / app-suite cards (grid of tool cards on landing pages) ── */
.tools-section { margin-top: var(--s-12); }
.tool-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
}
.tool-card {
    display: flex;
    flex-direction: column;
}
.tool-card .btn {
    margin-top: auto;
    align-self: flex-start;
}
@media (max-width: 640px) {
    .tool-cards { grid-template-columns: 1fr; }
}

/* ── Empty state (centered placeholder when list/grid is empty) ── */
.empty-state {
    text-align: center;
    padding: var(--s-16) 0;
    color: var(--muted);
    font-size: 0.875rem;
}

/* ── Upload actions (button row below dropzone) ── */
.upload-actions { margin-top: var(--s-4); }

/* ── Status badge base (modifiers live in app patterns) ── */
.status-badge {
    display: inline-block;
    padding: 0.125rem var(--s-2);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 2px;
    border: 1px solid var(--border);
}
.bg-white { background: var(--white); }
.bg-black { background: var(--black); }
.bg-pale { background: var(--pale-grey); }

/* ══════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════ */

.container {
    display: block;
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 2rem;
}

.container-narrow {
    display: block;
    width: 100%;
    max-width: 52rem;
    margin-inline: auto;
    padding-inline: 2rem;
}

/* App main content area */
.main-content {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--s-8) var(--s-4);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--s-6);
}

.inline-form { display: inline; }

/* ── Grid ── */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ── Flex ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.flex-baseline { align-items: baseline; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }
.gap-8 { gap: var(--s-8); }

.overflow-x-auto { overflow-x: auto; }

/* ── Spacing ──
   Hardcoded scale: deprecated, will be removed. Migrate to .mt-2..6 (token-based).
   See STRATEGIOS-DESIGN-SYSTEM.md section 5. */
.mt-xs { margin-top: 0.25rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }
.mt-2xl { margin-top: 3rem; }

.mb-xs { margin-bottom: 0.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }

.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.py-md { padding-block: 1rem; }
.py-xl { padding-block: 2rem; }
.py-hero { padding-block: 4rem; }
.pt-lg { padding-top: 1.5rem; }
.pt-xl { padding-top: 2rem; }

.mx-sm { margin-inline: 0.5rem; }

/* Spacing with spacing-scale tokens */
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-8 { margin-top: var(--s-8); }
.mt-12 { margin-top: var(--s-12); }
.mt-16 { margin-top: var(--s-16); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }
.mb-8 { margin-bottom: var(--s-8); }
.ml-3 { margin-left: var(--s-3); }

.py-1 { padding-block: var(--s-1); }
.py-2 { padding-block: var(--s-2); }
.py-3 { padding-block: var(--s-3); }
.pt-12 { padding-top: var(--s-12); }
.px-3 { padding-inline: var(--s-3); }
.px-4 { padding-inline: var(--s-4); }
.px-6 { padding-inline: var(--s-6); }

.text-red { color: var(--color-red); }
.text-green { color: var(--color-green); }
.list-decimal { list-style: decimal; }

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.stack-md > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: 1.5rem; }
.stack-xl > * + * { margin-top: 2rem; }

/* ══════════════════════════════════════
   COMPONENTS — NAVIGATION
   ══════════════════════════════════════ */

/* ── Site nav (OUTREACH sites) ──
 * Pattern: .site-nav > .site-nav__inner > .site-nav__brand + .site-nav__links
 * See also: .nav-public / .nav-admin below for Flask apps.
 */
.site-nav {
    border-bottom: 1px solid var(--light-grey);
}

.site-nav__inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 640px) {
    .site-nav__inner {
        padding: 1rem 1.5rem;
    }
}

.site-nav__brand {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    text-transform: uppercase;
    padding: 0.5rem 0;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .site-nav__links { gap: 1.5rem; }
}

.site-nav__link {
    color: var(--medium-grey);
    padding: 0.5rem 0.75rem;
    transition: color 0.15s;
}

.site-nav__link:hover { color: var(--black); }

.site-nav__cta {
    border: 1px solid var(--black);
    padding: 0.5rem 1rem;
    margin-left: 0.25rem;
    transition: background 0.15s, color 0.15s;
}

@media (min-width: 640px) {
    .site-nav__cta { margin-left: 0.5rem; }
}

.site-nav__cta:hover {
    background: var(--black);
    color: var(--white);
}

/* ── Public nav (apps) ──
 * Pattern: .nav-public > .nav-public-inner > .nav-brand + .nav-links
 * See also: .site-nav above for OUTREACH sites.
 */
header, .nav-public {
    border-bottom: 2px solid var(--fg);
    padding: var(--s-4) 0;
    margin-bottom: var(--s-8);
}

header nav, header nav.container, .nav-public-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--s-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: var(--fg);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: var(--s-2) 0;
}

.nav-brand:hover { opacity: 1; }

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--s-5);
}

.nav-link, .nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    transition: color var(--transition);
    padding: 0.625rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover, .nav-links a:hover { color: var(--fg); opacity: 1; }

/* ── Back link (inline nav back-to-previous) ── */
.back-link {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8125rem;
    margin-bottom: var(--s-4);
    transition: color var(--transition);
}
.back-link:hover { color: var(--fg); }
.back-link::before { content: '\2190\00a0'; }

/* ── Admin nav (apps) ──
 * Inverted (white on black) nav bar for authenticated admin views.
 */
.nav-admin {
    background: var(--fg);
    color: var(--bg);
    padding: var(--s-3) var(--s-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-admin-brand {
    font-weight: 600;
    color: var(--bg);
    text-decoration: none;
}

.nav-admin-brand:hover { opacity: 1; }

.nav-admin-links {
    display: flex;
    gap: var(--s-4);
}

.nav-admin-links a {
    color: var(--bg);
    text-decoration: none;
    font-size: 0.875rem;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.nav-admin-links a:hover { opacity: 1; text-decoration: underline; }

/* ── Theme toggle ── */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 0.75rem;
    min-height: 44px;
    color: var(--medium-grey);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: inherit;
    transition: color 0.15s;
}

.theme-toggle:hover { color: var(--black); }
.theme-text { font-weight: 400; }

.theme-icon-dark { display: none; }

:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-icon-light { display: none; }
    :root:not([data-theme="light"]) .theme-icon-dark { display: inline; }
}

/* ══════════════════════════════════════
   COMPONENTS — CARDS
   ══════════════════════════════════════ */

.card {
    border: 1px solid var(--light-grey);
    padding: 1.5rem;
    background: var(--white);
    transition: border-color 0.15s;
}
.card:hover { border-color: var(--medium-grey); }

/* Narrow variant – constrain width for compact forms (join code,
   login, quick actions). Centers itself via auto margins. */
.card--narrow {
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
}

.card-accent {
    border: 2px solid var(--black);
    padding: 2rem;
    background: var(--white);
}

.card-subtle {
    border: 1px solid var(--light-grey);
    padding: 1rem;
    background: var(--white);
    transition: border-color 0.15s;
}
.card-subtle:hover { border-color: var(--medium-grey); }

/* ── Card sub-elements and grid (promoted from ANTAGANDEN pilot) ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--s-4);
}
.card-grid .card { margin-bottom: 0; }

.card-header {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
    flex-wrap: wrap;
}

.card-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* ── Collapsible details/summary (generic, different from .accordion) ── */
.add-form-toggle { margin-top: var(--s-4); }
.add-form-toggle summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    list-style: none;
}
.add-form-toggle summary::before { content: '+ '; }
.add-form-toggle[open] summary::before { content: '- '; }
.add-form-toggle summary:hover { color: var(--fg); }
.add-form-toggle[open] summary { margin-bottom: var(--s-3); }

details > .details-content { padding: var(--s-3) 0; }

.card-link {
    display: block;
    text-decoration: none;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s-4);
    background: var(--bg-elevated);
    transition: all var(--transition);
}
.card-link:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    opacity: 1;
    border-color: var(--border-strong);
}

/* Perspective box */
.perspective-box {
    background: var(--bg-alt);
    border-left: 2px solid var(--fg);
    border-radius: var(--radius);
    padding: var(--s-4);
}

/* FCI card */
.fci-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: var(--s-4);
    width: 100%;
}

.border-top { border-top: 1px solid var(--light-grey); }
.border-bottom { border-bottom: 1px solid var(--light-grey); }

/* ══════════════════════════════════════
   COMPONENTS — BUTTONS
   ══════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--black);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:hover {
    background: var(--medium-grey);
    border-color: var(--medium-grey);
}

.btn-outline {
    background: transparent;
    color: var(--black);
}

.btn-outline:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.btn-primary {
    background: var(--black);
    color: var(--white);
    border: 1px solid var(--black);
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--dark-grey); border-color: var(--dark-grey); }

.btn-ghost {
    color: var(--fg);
    background: transparent;
    border: 1px solid var(--border);
    padding: var(--s-2) var(--s-6);
    border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--bg-alt); border-color: var(--border-strong); opacity: 1; }

.btn-secondary {
    color: var(--fg);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.btn-secondary:hover { background: var(--border); opacity: 1; }

.btn-green { background: var(--color-green); border-color: var(--color-green); color: var(--white); }
.btn-green:hover { opacity: 0.85; }
.btn-red { background: var(--color-red); border-color: var(--color-red); color: var(--white); }
.btn-red:hover { opacity: 0.85; }

.btn-full { width: 100%; }
.btn-lg { padding: var(--s-3) var(--s-6); font-size: 1.125rem; }

.btn-sm {
    padding: 0.5rem 1rem;
    min-height: 44px;
    font-size: 0.8125rem;
}

.btn-active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
    pointer-events: none;
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Link-style buttons */
.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0.625rem 0;
    color: var(--fg);
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.btn-link:hover { opacity: 0.6; }
.btn-link-sm { font-size: 0.75rem; }
.btn-link-danger { color: var(--color-red); font-size: 0.75rem; }
.btn-link-danger:hover { opacity: 0.7; }
.btn-link-green { font-size: 0.875rem; color: var(--color-green); }
.btn-link-green:hover { opacity: 0.7; }
.btn-link-red { font-size: 0.875rem; color: var(--color-red); }
.btn-link-red:hover { opacity: 0.7; }

/* ── Button row (hero actions) ── */
.btn-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

@media (min-width: 640px) {
    .btn-row {
        flex-direction: row;
        gap: 1.5rem;
    }
}

/* ══════════════════════════════════════
   COMPONENTS — FORMS
   ══════════════════════════════════════ */

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--s-1);
}

.form-group { margin-bottom: var(--s-4); }
.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: var(--s-1);
    letter-spacing: 0.01em;
}

.form-row {
    display: flex;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 10rem; }
.form-row textarea { min-height: auto; }

.input,
.textarea,
select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--light-grey);
    border-radius: 0;
    transition: border-color 0.15s;
}

.input:focus,
.textarea:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--black);
    outline-offset: 1px;
    border-color: transparent;
}

textarea {
    resize: vertical;
    width: 100%;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--light-grey);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"] {
    width: 100%;
    padding: var(--s-2) var(--s-3);
    font-family: inherit;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    transition: border-color var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: 0 0 0 1px var(--fg);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--black);
    flex-shrink: 0;
    position: relative;
    top: 0.1rem;
}

/* Session code input */
.input-code {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    text-align: center;
    font-size: 1.125rem;
    border-width: 2px;
    border-color: var(--fg);
    padding: var(--s-3);
}

.input-code-lg { font-size: 1.5rem; }

/* Join form (inline) */
.join-form {
    display: flex;
    gap: var(--s-2);
}

.join-form input { flex: 1; }

/* ══════════════════════════════════════
   COMPONENTS — FLASH & BANNERS
   ══════════════════════════════════════ */

.flash-messages {
    margin-bottom: var(--s-4);
}
.flash {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--s-2);
    font-size: 0.875rem;
}
.flash-error { background: var(--color-red-light); color: var(--color-red); }
.flash-success { background: var(--color-green-light); color: var(--color-green); }
.flash-warning { background: var(--color-yellow-light); color: var(--color-yellow); }

.maintenance-banner {
    padding: var(--s-3);
    border-radius: var(--radius-sm);
    background: var(--color-yellow-light);
    color: var(--color-yellow);
    font-size: 0.875rem;
}

/* ══════════════════════════════════════
   COMPONENTS — TABLES
   ══════════════════════════════════════ */

.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 600;
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--light-grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    color: var(--medium-grey);
}

td {
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--pale-grey);
}

th:first-child,
td:first-child {
    padding-left: 0;
}

.table-compact { font-size: 0.75rem; }
.table-compact th,
.table-compact td { padding: 0.375rem 0.5rem; }

/* ══════════════════════════════════════
   COMPONENTS — BADGES
   ══════════════════════════════════════ */

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: var(--s-1) var(--s-2);
    border-radius: var(--radius-sm);
}

.badge-beta,
.badge-prototype {
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--medium-grey);
    color: var(--medium-grey);
    text-transform: uppercase;
    vertical-align: super;
}

/* Status badges – use data-state for semantic states.
   See STRATEGIOS-DESIGN-SYSTEM.md section 2. */
.badge[data-state="draft"]     { background: var(--bg-alt); color: var(--muted); }
.badge[data-state="open"],
.badge[data-state="during"]    { background: var(--color-green-light); color: var(--color-green); }
.badge[data-state="closed"]    { background: var(--color-red-light); color: var(--color-red); }
.badge[data-state="before"],
.badge[data-state="after"]     { background: var(--color-blue-light); color: var(--color-blue); }
.badge[data-state="pending"]   { background: var(--color-yellow-light); color: var(--color-yellow); }

/* ══════════════════════════════════════
   COMPONENTS — VOTING & INTERACTION
   ══════════════════════════════════════ */

/* ── Radio cards ── */
.radio-card-group { display: flex; gap: var(--s-2); }
.radio-card-group-tight { display: flex; gap: var(--s-1); }

.radio-card-label {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.radio-card-label input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.radio-card {
    text-align: center;
    padding: var(--s-3);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}
.radio-card:hover { background: var(--bg-alt); }

input[type="radio"]:checked + .radio-card {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--bg);
}

/* Stance-specific radio cards */
input[type="radio"]:checked + .radio-card-ja {
    border-color: var(--color-green);
    background: var(--color-green-light);
    color: var(--color-green);
}

input[type="radio"]:checked + .radio-card-neutral {
    border-color: var(--muted);
    background: var(--bg-alt);
    color: var(--fg);
}

input[type="radio"]:checked + .radio-card-nej {
    border-color: var(--color-red);
    background: var(--color-red-light);
    color: var(--color-red);
}

/* ── Range slider ── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    background: var(--fg);
    transition: transform var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

input[type="range"]::-moz-range-thumb {
    width: 1.75rem;
    height: 1.75rem;
    background: var(--fg);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--white);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: var(--s-1);
}

.slider-value {
    display: block;
    text-align: center;
    font-size: 1.5rem;
    font-family: ui-monospace, monospace;
    margin-top: var(--s-2);
}

/* Resistance color coding (0 = low resistance, 10 = high) */
.resistance-0, .resistance-1, .resistance-2 { background: #06b6d4; }
.resistance-3, .resistance-4 { background: #22c55e; }
.resistance-5, .resistance-6 { background: #f59e0b; }
.resistance-7, .resistance-8 { background: #f97316; }
.resistance-9, .resistance-10 { background: #ef4444; }

/* ── Phase border ── */
.phase-border {
    border-left: 2px solid var(--fg);
    padding-left: var(--s-4);
    padding-top: var(--s-2);
    padding-bottom: var(--s-2);
}

/* ── Step numbers ── */
.step-number {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--border);
    margin-bottom: var(--s-4);
}

/* ── Point block (agenda items) ── */
.point-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s-4);
    margin-bottom: var(--s-6);
}

.add-proposal-btn,
.add-proposal {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--muted);
    padding: 0;
    margin-top: var(--s-2);
    transition: color var(--transition);
}
.add-proposal-btn:hover,
.add-proposal:hover { color: var(--fg); }

/* Proposal cards (simple bordered surface for vote/proposal items) */
.proposal-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s-4);
    margin-bottom: var(--s-3);
}

/* Generic stack container for proposal/option lists */
.proposals-container {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.add-point-btn {
    width: 100%;
    border: 2px dashed var(--border-strong);
    background: transparent;
    padding: var(--s-3);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: var(--s-8);
}
.add-point-btn:hover { border-color: var(--fg); color: var(--fg); }

.zero-alt { font-size: 0.75rem; color: var(--muted); }

/* ══════════════════════════════════════
   COMPONENTS — SECTIONS & HERO
   ══════════════════════════════════════ */

.section {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1rem;
    padding-block: 3rem;
}

@media (min-width: 640px) {
    .section {
        padding-inline: 1.5rem;
        padding-block: 5rem;
    }
}

.section--sm { padding-block: 2rem; }
.section--lg { padding-block: 4rem; }

@media (min-width: 640px) {
    .section--sm { padding-block: 3rem; }
    .section--lg { padding-block: 6rem; }
}

.section--pale {
    background: var(--pale-grey);
    border-top: 1px solid var(--light-grey);
    max-width: none;
    padding-inline: 0;
}

.section--pale > * {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 640px) {
    .section--pale > * {
        padding-inline: 1.5rem;
    }
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--medium-grey);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light-grey);
}

.section-label {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--medium-grey);
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .section-label {
        font-size: 1.125rem;
        margin-bottom: 2.5rem;
    }
}

/* ── Hero (app-level) ──
 * Used by Flask apps: .hero container with semantic h1/p inside.
 * Pattern: <section class="hero"><h1>…</h1><p class="hero-lead">…</p></section>
 * See also: hero (site-level) below — different pattern, both are needed.
 */
.hero {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-10) var(--s-4) var(--s-4);
}

.hero-content { max-width: 40rem; }

.hero h1 {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: var(--s-4);
}

.hero-lead {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: var(--s-8);
    line-height: 1.6;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: var(--s-6);
}

.hero-counter {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: var(--s-4);
}

/* ── Hero (site-level) ──
 * Used by OUTREACH sites: standalone classes on elements, no container.
 * Pattern: <h1 class="hero-title hero-title--xl mb-md">…</h1><p class="hero-deck">…</p>
 * See also: hero (app-level) above — different pattern, both are needed.
 */
.hero-title {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1.5rem;
    }
}

.hero-title--xl { font-size: 1.875rem; }

@media (min-width: 640px) {
    .hero-title--xl { font-size: 3rem; }
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--medium-grey);
    line-height: 1.3;
}

@media (min-width: 640px) {
    .hero-subtitle { font-size: 1.875rem; }
}

.hero-deck {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--medium-grey);
    max-width: 42rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .hero-deck {
        font-size: 1.25rem;
        margin-bottom: 2.5rem;
    }
}

/* ── CTA section ── */
.cta-center {
    background: var(--pale-grey);
    border-top: 1px solid var(--light-grey);
    padding: 3rem 1rem;
    text-align: center;
}

@media (min-width: 640px) {
    .cta-center { padding: 4rem 1.5rem; }
}

.cta-center__inner {
    max-width: var(--container);
    margin-inline: auto;
}

.cta-center h2 {
    margin-bottom: 0.5rem;
}

.cta-center__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .cta-center__actions { flex-direction: row; }
}

/* ══════════════════════════════════════
   COMPONENTS — SPECIAL LAYOUTS
   ══════════════════════════════════════ */

/* ── Book hero ── */
.book-hero {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: flex-start;
}

.book-hero__content {
    flex: 1;
    max-width: 42rem;
}

.book-hero__cover {
    width: 12rem;
    flex-shrink: 0;
    margin-inline: auto;
}

@media (min-width: 640px) {
    .book-hero__cover { width: 14rem; }
}

@media (min-width: 768px) {
    .book-hero {
        flex-direction: row;
        gap: 4rem;
    }
    .book-hero__cover {
        width: 16rem;
        margin-inline: 0;
    }
}

.book-hero__cover img {
    width: 100%;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* ── Two-column layout ── */
.layout-aside {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: flex-start;
}

.layout-aside__aside {
    width: 100%;
    max-width: 11rem;
    margin-inline: auto;
    flex-shrink: 0;
}

.layout-aside__main {
    flex: 1;
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .layout-aside {
        flex-direction: row;
        gap: 4rem;
    }
    .layout-aside__aside {
        margin-inline: 0;
    }
}

/* ── Info box ── */
.info-accent {
    border: 2px solid var(--black);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
}

.info-box {
    border: 1px solid var(--light-grey);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* ══════════════════════════════════════
   COMPONENTS — GRIDS (responsive)
   ══════════════════════════════════════ */

.grid-stack-2 {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-stack-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.grid-stack-3 {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-stack-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

.grid-stack-4 {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-stack-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-stack-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .stat-grid { gap: 2rem; }
}

.stat-grid__number {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
}

@media (min-width: 640px) {
    .stat-grid__number { font-size: 2.25rem; }
}

.stat-grid__label {
    font-size: 0.875rem;
    color: var(--medium-grey);
    margin-top: 0.25rem;
}

/* Figure grid */
.figure-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .figure-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .figure-grid { grid-template-columns: repeat(3, 1fr); }
}

.figure-card {
    display: block;
    border: 1px solid var(--light-grey);
    padding: 1rem;
    transition: border-color 0.15s;
}

.figure-card:hover { border-color: var(--black); }

.figure-card img {
    width: 100%;
    height: 12rem;
    object-fit: contain;
}

.figure-card__caption {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.75rem;
}

/* Responsive grid helpers */
.md-grid-2 { display: block; }
.md-grid-3 { display: block; }

@media (min-width: 768px) {
    .md-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
    .md-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
}

.md-flex-row { flex-direction: column; }

@media (min-width: 768px) {
    .md-flex-row { flex-direction: row; }
}

/* ══════════════════════════════════════
   COMPONENTS — DETAILS & DISCLOSURE
   ══════════════════════════════════════ */

details {
    border-bottom: 1px solid var(--light-grey);
    padding: 0.5rem 0;
}

details:last-of-type {
    border-bottom: none;
}

details summary {
    padding: 0.25rem 0;
    list-style: none;
    cursor: pointer;
}

details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; }

details summary::before {
    content: '\25B8 ';
    color: var(--medium-grey);
    font-size: 1.125rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

details[open] summary::before {
    content: '\25BE ';
}

details summary:focus-visible {
    outline: 2px solid var(--black);
    outline-offset: 2px;
}

/* ══════════════════════════════════════
   COMPONENTS — NAVIGATION (chapter, breadcrumb)
   ══════════════════════════════════════ */

.chapter-nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .chapter-nav {
        flex-direction: row;
        align-items: center;
    }
}

.chapter-nav .nav-link {
    padding: 0;
}

.breadcrumb {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--medium-grey);
    margin-bottom: 0.75rem;
}

.breadcrumb a { text-decoration: underline; }
.breadcrumb a:hover { text-decoration: none; }
.breadcrumb__sep { margin-inline: 0.5rem; }

/* ══════════════════════════════════════
   COMPONENTS — QUESTION CARDS
   ══════════════════════════════════════ */

.question-list {
    border: 1px solid var(--light-grey);
}

.question-card {
    display: flex;
    border-bottom: 1px solid var(--light-grey);
}

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

.question-card__num {
    width: 3rem;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1.25rem;
    border-right: 1px solid var(--light-grey);
    background: var(--pale-grey);
    color: var(--medium-grey);
    font-size: 0.875rem;
    font-weight: 500;
}

.question-card__content {
    padding: 1rem 1.25rem;
}

@media (min-width: 640px) {
    .question-card__content {
        padding: 1.25rem 1.5rem;
    }
}

/* ══════════════════════════════════════
   COMPONENTS — RETAILER ROWS
   ══════════════════════════════════════ */

.retailer-list {
    border-top: 1px solid var(--light-grey);
}

.retailer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-grey);
}

.retailer-name { font-weight: 600; }

.retailer-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   COMPONENTS — PROSE & DIVIDERS
   ══════════════════════════════════════ */

/* Underlined link (for inline prose) */
.link {
    color: var(--black);
    text-decoration: underline;
}
.link:hover { text-decoration: none; }

.prose { color: var(--muted); line-height: 1.65; }
.prose p + p { margin-top: var(--s-6); }
.prose a { color: var(--fg); text-decoration: underline; }
.prose a:hover { text-decoration: none; opacity: 1; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose em { font-style: italic; }
.prose ul { list-style: disc; padding-left: var(--s-5); }
.prose ul li + li { margin-top: var(--s-2); }

.prose-narrow { max-width: 42rem; }

.prose-narrow p,
.prose p {
    line-height: 1.7;
}

.prose-list {
    list-style: disc;
    padding-left: 1.25rem;
    color: var(--medium-grey);
    line-height: 1.6;
}

.prose-list > li + li {
    margin-top: 0.5rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    color: var(--medium-grey);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--light-grey);
}

.quote-border {
    border-left: 3px solid var(--medium-grey);
    padding-left: 1rem;
}

.quote-border-sm {
    border-left: 2px solid var(--light-grey);
    padding-left: 0.5rem;
}

/* ══════════════════════════════════════
   COMPONENTS — FOOTER
   ══════════════════════════════════════ */

footer, .site-footer {
    border-top: 1px solid var(--border);
    padding: var(--s-6) 0;
    margin-top: var(--s-16);
    font-size: 0.75rem;
    color: var(--muted);
}

@media (min-width: 640px) {
    .site-footer { margin-top: 6rem; }
}

.site-footer__inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-between;
}

@media (min-width: 640px) {
    .site-footer__inner {
        padding: 3rem 1.5rem;
        gap: 2rem;
    }
}

@media (min-width: 768px) {
    .site-footer__inner {
        flex-direction: row;
    }
}

.site-footer__meta {
    font-size: 0.875rem;
    color: var(--medium-grey);
}

.site-footer__meta a { text-decoration: underline; }
.site-footer__meta a:hover { text-decoration: none; color: var(--black); }

/* App footer (simpler) */
.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-8) var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
}

.footer-brand { font-weight: 600; margin-bottom: var(--s-1); }
.footer-text { font-size: 0.875rem; color: var(--muted); }
.footer-text a { color: var(--fg); text-decoration: underline; }
.footer-text a:hover { text-decoration: none; opacity: 1; }

/* Multi-column public footer (used by OUTREACH-style sites) */
.footer-col {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    min-width: 0;
}

/* ── Warning boxes (severity-tinted callouts for analysis findings) ── */
.warning {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.warning-high { border: 2px solid var(--fg); }
.warning-medium { border: 1px solid var(--muted); }
.warning-title { font-weight: 600; margin-bottom: 0.25rem; }
.warning-message {
    font-size: 0.875rem;
    color: var(--dark-grey);
}

/* ── Monospace text utilities ── */
.font-mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.875rem;
}
.font-mono-lg {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    line-height: 2;
}

/* ── Inline tooltip trigger (cursor-help with underline-on-hover) ── */
.info-tip {
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    color: var(--muted);
}
.info-tip:hover { color: var(--fg); }

/* ══════════════════════════════════════
   COMPONENTS — UPLOAD & CONSENT
   ══════════════════════════════════════ */

/* ── Lead text ── */
.lead {
    font-size: 1.1rem;
    color: var(--dark-grey);
    line-height: 1.7;
}

.lead-note {
    font-size: 0.85rem;
    color: var(--medium-grey);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ── Upload area ── */
.upload-section {
    max-width: 480px;
    margin-bottom: 3rem;
}

.upload-area {
    border: 2px dashed var(--light-grey);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--black);
}

.upload-area.has-file {
    border-style: solid;
    border-color: var(--black);
}

.upload-icon { margin-bottom: 1rem; color: var(--medium-grey); }
.upload-text { font-weight: 500; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.85rem; color: var(--medium-grey); }

/* ── Upload loading ── */
.upload-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px solid var(--light-grey);
}

.upload-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--light-grey);
    border-top-color: var(--black);
    border-radius: 50%;
    animation: upload-spin 0.9s linear infinite;
    margin-bottom: 1rem;
}

@keyframes upload-spin {
    to { transform: rotate(360deg); }
}

.upload-loading-title {
    font-weight: 500;
    margin: 0 0 0.25rem 0;
}

.upload-loading-hint {
    font-size: 0.875rem;
    color: var(--medium-grey);
    margin: 0;
}

/* ── Consent card ── */
.consent-card {
    border-left: 3px solid var(--medium-grey);
    padding: 0.75rem 0 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.consent-intro {
    font-size: 0.875rem;
    color: var(--medium-grey);
    margin: 0 0 0.5rem 0;
}

.consent-warning {
    font-size: 0.875rem;
    color: var(--black);
    font-weight: 500;
    margin: 0.5rem 0;
}

.consent-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--medium-grey);
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    accent-color: var(--black);
    flex-shrink: 0;
    position: relative;
    top: 0.1rem;
}

/* Consent group (SORTERA pattern) */
.consent-group {
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--black);
    flex-shrink: 0;
    position: relative;
    top: 0.1rem;
}

.help-text {
    font-size: 0.8rem;
    color: var(--medium-grey);
    margin-top: 0.4rem;
    line-height: 1.5;
}

/* ══════════════════════════════════════
   COMPONENTS — PAGE CONTENT
   ══════════════════════════════════════ */

.page-content {
    max-width: 680px;
    margin: 0 auto;
}

.page-content section { margin-bottom: 2.5rem; }
.page-content h2 { margin-top: 2rem; }
.page-content p, .page-content li { line-height: 1.7; }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-content li { margin-bottom: 0.5rem; }

.model-list dt { font-weight: 600; margin-top: 0.75rem; }
.model-list dd { margin-left: 0; margin-bottom: 0.5rem; color: var(--dark-grey); }

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.info-table th, .info-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--light-grey);
    text-align: left;
}

.info-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--medium-grey);
}

.reference-list { list-style: none; padding: 0; }
.reference-list li {
    padding-left: 1.5rem;
    text-indent: -1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.method-section { max-width: 640px; margin-bottom: 3rem; }
.method-steps { list-style: decimal; padding-left: 1.5rem; }
.method-steps li { margin-bottom: 1rem; line-height: 1.6; }

.hint { font-size: 0.8rem; color: var(--medium-grey); }

/* ══════════════════════════════════════
   COMPONENTS — HEADER (wide layout apps)
   ══════════════════════════════════════ */

/* ── Site header ──
 * Used by wide-layout apps (e.g. SIMULERA) with full-width content.
 * Pattern: .site-header > .nav-bar > .wordmark + .nav-link + .theme-toggle
 * See also: .site-nav (OUTREACH), .nav-public (standard apps).
 */
.site-header {
    border-bottom: 2px solid var(--black);
    padding: 1rem 2rem;
}

.nav-bar {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Push nav links to the right edge of the nav bar */
.nav-bar .nav-links { margin-left: auto; }

.wordmark {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-decoration: none;
    text-transform: uppercase;
}


/* ══════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════ */

/* Respect HTML hidden attribute even when components set display */
[hidden] { display: none !important; }

.hidden { display: none; }
.w-full { width: 100%; }

/* Display primitives */
.d-block { display: block; }
.d-inline-flex { display: inline-flex; }

/* Flex alignment (extends the existing .flex-* scheme) */
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Text flow */
.nowrap { white-space: nowrap; }
.strikethrough { text-decoration: line-through; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.cursor-default { cursor: default; }

/* State: element is dimmed to indicate processed/dismissed/inactive */
.is-dimmed { opacity: 0.5; }

/* State: element is visible but non-interactive */
.is-disabled {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Left accent border (callout/blockquote style) */
.border-l-accent {
    border-left: 3px solid var(--medium-grey);
    padding-left: 0.75rem;
}
.border-l-accent--strong {
    border-left: 3px solid var(--fg);
    padding-left: 0.75rem;
}

/* ── Samsyn content column ──────────────────────────────────────
   Constrained prose width used on tillganglighet and similar
   single-column content pages in Samsyn.app. */
.samsyn-content {
    max-width: 40rem;
    margin: 0 auto;
}

/* ── Error page ─────────────────────────────────────────────────
   Layout for the standalone error template in
   src/strategios/flask/templates/error.html. The error page does
   NOT extend base.html, so these classes are the page's only
   structural styling (typography/colors come from canon). */
.error-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-8);
    min-height: 70vh;
}
.error-page__content {
    max-width: 30rem;
    text-align: center;
}
.error-page__code {
    font-size: 4rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--s-2);
}
.error-page__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--s-6);
}
.error-page__detail {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: var(--s-8);
}
.error-page__prototype-notice {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: var(--s-4) var(--s-5);
    margin-bottom: var(--s-6);
    text-align: left;
    font-size: 0.8125rem;
    color: var(--muted);
}
.error-page__prototype-notice strong { color: var(--fg); }
.error-page__actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    align-items: center;
}
.error-page__footer {
    border-top: 1px solid var(--border);
    padding: var(--s-6) var(--s-8);
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}
.error-page__footer a { color: var(--muted); }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (min-width: 640px) {
    .hero { padding-top: var(--s-24); padding-bottom: var(--s-16); }
    .hero h1 { font-size: 3rem; }
    .hero-lead { font-size: 1.25rem; }
    .nav-public-inner { padding: var(--s-4) var(--s-6); }
    .nav-links { gap: var(--s-6); }
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        padding: var(--s-12) var(--s-6);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }

    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
    .container, .container-narrow { padding-inline: 1rem; }
    .py-hero { padding-block: 2.5rem; }

    nav .flex { flex-wrap: wrap; }
}

@media (max-width: 639px) {
    .sm-stack { flex-direction: column; }
    .form-row { display: block; }
    .form-row > * + * { margin-top: var(--s-4); }
    .result-grid { grid-template-columns: 1fr; }
    .method-grid { grid-template-columns: 1fr; }
    .export-actions { flex-direction: column; }
    .pipeline-steps { flex-direction: column; align-items: flex-start; }
    .pipeline-arrow { transform: rotate(90deg); }
    .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .py-hero { padding-block: 1.5rem; }

    .retailer-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ══════════════════════════════════════
   PRINT
   ══════════════════════════════════════ */

@media print {
    nav, footer, .theme-toggle, .nav-admin, .nav-public, .site-footer,
    .btn, .btn-outline, .no-print, form {
        display: none !important;
    }

    :root, [data-theme="dark"] {
        --black: #000 !important;
        --white: #fff !important;
        --medium-grey: #555 !important;
        --pale-grey: #eee !important;
        --light-grey: #ccc !important;
        --surface: #fff !important;
        --fg: #000 !important;
        --bg: #fff !important;
        --bg-alt: #f8f8f8 !important;
        --border: #ddd !important;
        --muted: #666 !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt;
        line-height: 1.5;
    }

    h1, h2, h3, h4 { color: #000 !important; }
    a { color: #000 !important; text-decoration: none !important; }

    .container, .container-narrow { max-width: 100%; padding-inline: 1cm; }
    .grid-2, .grid-3, .grid-4, .grid-5 { display: block !important; }
    .grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-5 > * { margin-bottom: 0.3cm; }

    .card, .card-accent, .card-subtle {
        border: 1px solid #ccc !important;
        background: #fff !important;
        break-inside: avoid;
        padding: 0.4cm !important;
    }
}


/* ══════════════════════════════════════════════════════════════
   COMPONENTS v2 — Design System primitives
   See STRATEGIOS-DESIGN-SYSTEM.md §4
   BEM-light, JS-free where possible, data-state for >3 states.
   ══════════════════════════════════════════════════════════════ */

/* ── Stepper ────────────────────────────────────────────────── */
.stepper {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-6);
    display: flex;
    gap: var(--s-4);
}

.stepper__item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--s-2);
    color: var(--muted);
    font-size: 0.875rem;
}

.stepper__indicator {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    transition: all var(--transition);
}

.stepper__label { font-weight: 500; }

.stepper__item[data-state="active"] { color: var(--fg); }
.stepper__item[data-state="active"] .stepper__indicator {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.stepper__item[data-state="done"] { color: var(--fg); }
.stepper__item[data-state="done"] .stepper__indicator {
    background: var(--bg-alt);
    color: var(--fg);
    border-color: var(--fg);
}

/* Vertical variant */
.stepper--vertical {
    flex-direction: column;
    gap: var(--s-2);
}
.stepper--vertical .stepper__item { flex: 0 0 auto; }

/* ── Accordion ──────────────────────────────────────────────── */
.accordion { display: flex; flex-direction: column; gap: var(--s-2); }

.accordion__item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    overflow: hidden;
}

.accordion__item > input[type="checkbox"],
.accordion__item > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.accordion__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.accordion__trigger:hover { background: var(--bg-alt); }

.accordion__chevron {
    transition: transform var(--transition);
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
}

.accordion__content {
    display: none;
    padding: 0 var(--s-4) var(--s-4);
    border-top: 1px solid var(--border);
}

.accordion__item:has(input:checked) .accordion__content { display: block; }
.accordion__item:has(input:checked) .accordion__chevron { transform: rotate(90deg); }
.accordion__item:has(input:focus-visible) .accordion__trigger {
    outline: 2px solid var(--fg);
    outline-offset: -2px;
}

/* ── Tabs (v2 BEM) ──────────────────────────────────────────── */
/* Replaces .tab-btn/.tab-panel (deprecated – kept in SORTERA section) */
.tabs__list {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s-4);
}

.tabs__button {
    padding: var(--s-2) var(--s-5);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
}

.tabs__button:hover { color: var(--fg); }
.tabs__button[data-state="active"] { color: var(--fg); border-bottom-color: var(--fg); }

.tabs__panel[hidden],
.tabs__panel:not([data-state="active"]) { display: none; }
.tabs__panel[data-state="active"] { display: block; }

/* ── Card option (selectable radio/checkbox card) ───────────── */
/* Replaces .radio-card (deprecated) with :has()-based BEM. */
.card-option {
    display: block;
    padding: var(--s-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.card-option:hover { background: var(--bg-alt); border-color: var(--border-strong); }

.card-option > input[type="radio"],
.card-option > input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.card-option__label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: var(--s-1);
}

.card-option__description {
    display: block;
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.5;
}

.card-option:has(input:checked) {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}
.card-option:has(input:checked) .card-option__description { color: var(--bg-alt); }
.card-option:has(input:focus-visible) {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

/* Compact variant: single-line label, no description */
.card-option--compact {
    padding: var(--s-3) var(--s-4);
    text-align: center;
}
.card-option--compact .card-option__label { margin-bottom: 0; }

/* ── Progress ───────────────────────────────────────────────── */
/* Replaces .bar-track/.bar-fill and .progress-bar/.progress-fill. */
.progress {
    display: block;
    width: 100%;
    height: 0.5rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress__fill {
    display: block;
    height: 100%;
    background: var(--fg);
    transition: width var(--transition);
}

.progress--compact { height: 0.25rem; }
.progress--large { height: 0.75rem; }

.progress--labeled {
    height: 1.25rem;
}
.progress--labeled .progress__fill {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--s-2);
    color: var(--bg);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Chip (read-only tag) ───────────────────────────────────── */
/* For selected-option summaries, metadata tags. Distinct from .badge
   (which is for status assignment via data-state). */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: var(--s-1) var(--s-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.chip[data-variant="muted"] {
    background: var(--bg-alt);
    color: var(--muted);
}

.chip[data-variant="solid"] {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* ── Dropzone (v2 sub-elements + data-state) ────────────────── */
/* The base .dropzone lives in SORTERA section (deprecated location
   – will be promoted in follow-up PR). These sub-elements and states
   extend it without breaking existing markup. */
.dropzone__icon {
    display: block;
    font-size: 1.5rem;
    color: var(--muted);
    margin-bottom: var(--s-2);
    line-height: 1;
}

.dropzone__text {
    display: block;
    font-size: 0.9375rem;
    color: var(--fg);
    margin-bottom: var(--s-1);
}

.dropzone__hint {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
}

.dropzone[data-state="hover"],
.dropzone[data-state="active"] {
    border-color: var(--fg);
    border-style: solid;
    background: var(--bg);
}

.dropzone[data-state="file-selected"] {
    border-style: solid;
    border-color: var(--color-green);
    background: var(--color-green-light);
}

.dropzone[data-state="error"] {
    border-style: solid;
    border-color: var(--color-red);
    background: var(--color-red-light);
}



/* ══════════════════════════════════════════════════════════════
   SHARED PRIMITIVES (promoted from embedded SORTERA section)
   Text utilities, legacy tabs, and dropzone base that belong in
   the canonical file. Extracted 2026-04-11 during design system
   consolidation.
   ══════════════════════════════════════════════════════════════ */

/* ── Text utilities ── */
.meta { font-size: 0.8125rem; color: var(--muted); margin-bottom: var(--s-2); }
.ref { font-size: 0.75rem; color: var(--muted); font-style: italic; }
.warning-text { font-size: 0.8125rem; color: var(--color-red); font-weight: 500; }
.counter { font-size: 0.875rem; color: var(--muted); margin-top: var(--s-2); }

/* ── Tabs (legacy – see .tabs__ in COMPONENTS v2 for canonical BEM) ── */
.input-tabs {
    display: flex;
    gap: 0;
    margin-bottom: var(--s-4);
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    padding: var(--s-2) var(--s-5);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
}
.tab-btn--active { color: var(--fg); border-bottom-color: var(--fg); }
.tab-btn:hover { color: var(--fg); }
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── Dropzone base – sub-elements and data-state in COMPONENTS v2 ── */
.dropzone {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: var(--s-10) var(--s-6);
    text-align: center;
    transition: all var(--transition);
    background: var(--bg-alt);
}
.dropzone:hover { border-color: var(--fg); }
.dropzone--active { border-color: var(--fg); border-style: solid; background: var(--bg); }
.dropzone p { margin-bottom: var(--s-2); font-size: 0.875rem; }
.dropzone-btn { margin: var(--s-2) 0; cursor: pointer; }
.file-name { font-size: 0.8125rem; font-weight: 600; color: var(--fg); margin-top: var(--s-2); }
