/* DIT 2026 Assessment — Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Skip-to-content link (visible on focus for keyboard users) */

/* Screen-reader only (visually hidden, accessible to assistive tech + a11y tree) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Nav */
.top-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    flex-direction: column;
}
.nav-brand a {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}
.nav-brand-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.site-footer {
    text-align: center;
    padding: 0.5rem 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Container — fills remaining viewport below nav, no scroll */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 0.75rem;
}
.hero-compact { margin-bottom: 0.5rem; }
.hero-compact h1 { margin-bottom: 0.15rem; }
.hero h1 {
    font-size: 1.85rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}
.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 auto 0.2rem;
}
/* Alert */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.alert-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

/* Mode Cards */
.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}
.mode-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.mode-card:hover { box-shadow: var(--shadow-lg); }
.mode-card-primary { border-color: var(--primary); border-width: 2px; }
.mode-card.disabled { opacity: 0.6; }
.mode-icon { font-size: 1.5rem; margin-right: 0.4rem; vertical-align: middle; }
.mode-card h2 { margin-bottom: 0.4rem; font-size: 1.15rem; }
.mode-card p { color: var(--text-muted); margin-bottom: 0.6rem; font-size: 0.9rem; }
.features {
    list-style: none;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 0.75rem;
}
.features li {
    padding: 0.15rem 0;
    padding-left: 1.1rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Utility */
.btn-lg { padding: 0.65rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ===== Landing Page — Two-Column Split ===== */
.landing-split {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 1.5rem;
    align-items: start;
    padding: 6px 0 3.5rem;
    overflow-y: auto;
}

.landing-messaging {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    padding-top: 0;
    max-width: 400px;
}

.landing-headline {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.01em;
}

.landing-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

.landing-byline {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.landing-details {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.landing-details li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.landing-details li::before {
    content: "\2713";
    color: var(--success);
    font-weight: 700;
    font-size: 0.9em;
}

.btn-xl {
    padding: 0.9rem 2.5rem;
    font-size: 1.15rem;
    border-radius: var(--radius);
}

.landing-cta-btn {
    align-self: flex-start;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.landing-illustration {
    margin-top: 30px;
}
.landing-illustration img {
    max-width: 80%;
    height: auto;
    opacity: 0.7;
    filter: grayscale(100%);
}

/* Right column: The Map */
.landing-map {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0;
}

.map-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    position: relative;
}

/* Landing Heatmap Table */
.landing-heatmap {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.landing-heatmap th,
.landing-heatmap td {
    padding: 0.5rem 0.4rem;
    border: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
}

.hm-corner {
    width: 10rem;
    background: var(--bg);
}

.hm-stage-header {
    background: var(--bg);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.7rem 0.5rem;
    color: var(--text);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.hm-level-header {
    background: var(--bg);
    text-align: left;
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
    white-space: nowrap;
}
.hm-level-num {
    font-weight: 700;
    color: var(--text);
    margin-right: 0.3rem;
}
.hm-level-name {
    font-weight: 600;
    color: var(--text);
}
/* Clickable heatmap headers (use same popover as cells) */
.hm-stage-header[data-desc],
.hm-level-header[data-desc] {
    cursor: pointer;
    transition: outline 0.1s;
}
.hm-stage-header[data-desc]:hover,
.hm-level-header[data-desc]:hover {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.hm-cell {
    background: hsla(18, 85%, 52%, var(--cell-opacity, 0.04));
    height: 3.75rem;
    transition: background 0.2s;
    cursor: default;
}
.hm-cell-empty {
    background: var(--bg);
}

.hm-count {
    font-weight: 700;
    font-size: 1rem;
}
.hm-count-light { color: #ffffff; }
.hm-count-dark { color: var(--text); }


/* Cell popover */
.cell-popover {
    position: absolute;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 360px;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    animation: popoverIn 0.15s ease-out;
}
@keyframes popoverIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.cell-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
}
.cell-popover-header strong {
    font-size: 0.85rem;
    color: var(--primary);
}
.cell-popover-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.cell-popover p {
    margin: 0;
    color: var(--text-muted);
}

/* Empty overlay */
.map-empty-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.7);
    border-radius: var(--radius);
    pointer-events: none;
}
.map-empty-overlay p {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--surface);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Attribution under map */
.map-attribution {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.25rem;
    text-align: center;
}
.map-attribution a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.map-attribution a:hover {
    text-decoration: underline;
}
.map-axes-desc {
    text-align: left;
    margin-bottom: 0.5rem;
}
.mobile-br { display: none; }
.participant-count {
    font-size: 1.1rem;
    color: var(--text);
    margin: 0;
    text-align: center;
}
.participant-count strong {
    font-weight: 800;
}
.map-full-link {
    display: inline-block;
    margin-top: 0.25rem;
}

/* Framework Axes (used in overview tab) */
.framework-axes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}
.axis h3 { margin-bottom: 0.75rem; color: var(--primary); }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.mini-table td:first-child { font-weight: 600; width: 2.5rem; }

.key-insight {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text);
}
.key-insight cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: normal;
}
.hero-context {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.15rem auto 0.3rem;
    letter-spacing: 0.02em;
}
.hero-context a { color: var(--primary); text-decoration: none; }
.hero-context a:hover { text-decoration: underline; }
.quick-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
}
.quick-links a { color: var(--primary); text-decoration: none; }
.quick-links a:hover { text-decoration: underline; }
.quick-links-sep { color: var(--text-muted); }
.framework-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}
.evolving-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
}
.evolving-note a { color: var(--primary); }
.framework-preview > p:first-of-type {
    font-size: 1.05rem;
    color: var(--text);
    margin-top: 0.5rem;
}

/* Assessment */
.assessment-container {
    max-width: 960px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Stage — must be a flex container so question-viewport can fill it */
.stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/*
 * Question viewport — the outer chrome: progress, scrollable content, nav arrows.
 * It is a flex column that fills the stage. The arrows live outside the scroll area
 * so they are always pinned at the bottom regardless of option count.
 */
.question-viewport {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0.75rem 2rem 1rem;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    /* No overflow here — overflow is managed by the inner scroll zone */
}

/*
 * The scrollable middle zone: question card + options.
 * On desktop this is fully visible (no scroll needed for typical content).
 * On mobile, or if content overflows, it scrolls independently while
 * the progress text above and nav arrows below stay fixed.
 */
#saeQuestions, #epiasQuestions, #intakeQuestions {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;          /* hide scrollbar — content rarely overflows */
    -ms-overflow-style: none;
    /* Inner padding so focus rings aren't clipped by overflow: hidden ancestors */
    padding: 0.25rem 0.125rem;
    width: 100%;
}
#saeQuestions::-webkit-scrollbar,
#epiasQuestions::-webkit-scrollbar,
#intakeQuestions::-webkit-scrollbar { display: none; }

/* Integrated progress counter */
.question-progress {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
    text-align: center;
    flex-shrink: 0;
}

/* Transition screen (SAE result → EPIAS intro) */
.transition-result-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.transition-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.transition-part2 {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Question card — no border, clean type */
.q-card {
    width: 100%;
    text-align: left;
}

.q-context {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    font-style: italic;
}

.q-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    color: var(--text);
}

/* Options — tappable, clear affordance, compact on desktop */
.q-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.q-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.35;
    width: 100%;
    font-family: inherit;
    color: var(--text);
}

.q-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.q-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    border-left: 4px solid var(--primary);
}
/* Unselected options dim when a sibling is selected */
.q-options:has(.q-option.selected) .q-option:not(.selected) {
    opacity: 0.55;
}
.q-options:has(.q-option.selected) .q-option:not(.selected):hover {
    opacity: 1;
}

.q-option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 0 0.4rem;
    white-space: nowrap;
    /* Align with the first text line even when options use align-items: center */
    align-self: center;
}

.q-option.selected .q-option-key {
    background: var(--primary);
    color: transparent;
    border-color: var(--primary);
    position: relative;
    overflow: hidden;
}
/* Checkmark replaces letter/name in selected badge */
.q-option.selected .q-option-key::after {
    content: '\2713';
    color: white;
    position: absolute;
    font-size: 0.8rem;
}

.q-option-text {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Jargon tooltips */
.jargon {
    text-decoration: underline dotted var(--text-muted);
    text-underline-offset: 2px;
    cursor: help;
    position: relative;
}
.jargon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    font-size: 0.78rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.35;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}
.jargon:hover::after,
.jargon:focus::after {
    opacity: 1;
}

/* Confirmation message — hidden (auto-advance + button animation is sufficient) */
.q-confirmation {
    display: none;
}

/* Navigation arrows — always visible, pinned below the scroll zone */
.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0.75rem;
    flex-shrink: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.nav-arrow {
    background: none;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius);
    padding: 0.5rem 1.25rem;
    cursor: default;
    color: #94a3b8;
    font-size: 1.1rem;
    transition: all 0.15s;
    font-family: inherit;
}
.nav-arrow:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    cursor: pointer;
}
.nav-arrow:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}
.nav-arrow:disabled {
    pointer-events: none;
}

/* Intake question card (kept from v2) */
.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}
.question-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 3rem 0;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-page-heading {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.results-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Scrollable pages — override the viewport-locked body/container */
body:has(.landing-split),
body:has(.results-scroll),
body:has(.cohort-page) { height: auto; overflow: auto; }
body:has(.landing-split) .container,
body:has(.results-scroll) .container,
body:has(.cohort-page) .container { overflow: visible; }

/* Assessment — pin nav buttons on mobile (body overflow handled by global 768px rule) */
@media (max-width: 768px) {
    .assessment-container, .stage, .question-viewport {
        flex: none;
        min-height: 0;
    }
    .question-nav {
        position: sticky;
        bottom: 0;
        background: var(--bg);
        padding-bottom: 0.75rem;
        z-index: 10;
    }
}
.results-scroll #resultsContent {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2rem;
}
.results-section {
    padding: 1.5rem 0;
}
.results-section + .results-section {
    border-top: 1px solid var(--border);
}
.share-prompt {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}
.share-prompt p { margin: 0 0 0.75rem; }
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.share-btn:hover { background: var(--bg); border-color: var(--text-muted); }
.share-btn-x:hover { color: #000; }
.share-btn-linkedin:hover { color: #0A66C2; }
.share-btn-bluesky:hover { color: #0085FF; }
.share-preview {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: left;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* Results heatmap */
.heatmap-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.heatmap-toggle {
    display: flex;
    gap: 0.5rem;
}
.heatmap-toggle-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.heatmap-toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.heatmap-toggle-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}
/* Results heatmap — position overlays on top of standard landing-heatmap */
.hm-cell-you {
    outline: 3px solid hsl(18, 85%, 42%);
    outline-offset: -2px;
    position: relative;
}
.hm-cell-next {
    outline: 2px dashed hsl(35, 80%, 45%);
    outline-offset: -2px;
    position: relative;
}
.hm-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    padding: 1px 4px;
    border-radius: 2px;
    white-space: nowrap;
}
.hm-marker-you {
    color: hsl(18, 85%, 30%);
    background: hsl(18, 80%, 92%);
    top: 2px;
}
.hm-marker-next {
    color: hsl(35, 80%, 30%);
    background: hsl(35, 80%, 90%);
    font-size: 0.6rem;
    bottom: 2px;
}
.heatmap-skeleton {
    height: 20rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.heatmap-skeleton::before,
.heatmap-skeleton::after,
.heatmap-skeleton span {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: hsla(18, 85%, 52%, 0.7);
    opacity: 0.2;
    animation: dotPulse 1.4s ease-in-out infinite;
}
.heatmap-skeleton::after { animation-delay: 0.2s; }
.heatmap-skeleton span { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%, 60%, 100% { opacity: 0.2; }
    30% { opacity: 1; }
}

.heatmap-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}
.legend-you {
    background: hsl(18, 80%, 92%);
    border: 2px solid hsl(18, 85%, 42%);
}
.legend-next {
    background: hsl(35, 80%, 90%);
    border: 2px dashed hsl(35, 80%, 45%);
}
.heatmap-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: right;
}

#noResults {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
}

/* Result hero header — position code + cell description (full-width above grid) */
.result-hero-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.position-code {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 0.35rem;
}
.result-description {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* 2-column placement + growth grid */
.placement-growth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.col-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 0 0 0.75rem;
}

/* Summary cards (used in both columns) */
.summary-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}
/* "Where You Are" cards — medium orange from heatmap palette */
.placement-col .summary-card {
    background: hsla(18, 85%, 52%, 0.10);
    border-color: hsla(18, 85%, 52%, 0.25);
}
/* "Recommended Direction" card — darker orange from heatmap palette */
.summary-card-next {
    border-color: hsla(18, 85%, 52%, 0.45);
    background: hsla(18, 85%, 52%, 0.22);
}
.summary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
}
.summary-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.summary-bullets {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}
.summary-bullets li {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.15rem;
}

/* Signal label (used by growth column subheadings if present) */
.signal-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}
.growth-signal-inline blockquote {
    background: var(--primary-light, #dbeafe);
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text);
    margin: 0;
    line-height: 1.5;
}
.growth-actions-inline ul {
    padding-left: 1.5rem;
    margin: 0;
}
.growth-actions-inline li {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.2rem;
}

/* Matrix */
.matrix-section { margin-bottom: 2rem; }
#matrixContainer {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.matrix-table th, .matrix-table td {
    padding: 0.6rem;
    border: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
}
.matrix-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.75rem;
}
.matrix-table td { min-width: 100px; }
.matrix-cell {
    transition: all 0.2s;
    cursor: default;
    position: relative;
    min-height: 40px;
}
.matrix-cell:hover { background: #f1f5f9; }
.matrix-cell.current {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    font-weight: 600;
}
.matrix-cell.current::after {
    content: "\2605";
    position: absolute;
    top: 2px;
    right: 4px;
    color: var(--primary);
}
.matrix-cell.next-step {
    background: #d1fae5;
    border: 2px dashed var(--success);
}

/* (Growth Path styles are now inline with the placement grid above) */

/* Insight */
.insight-section { margin-bottom: 2rem; }

/* Related Chunks */
.related-section { margin-bottom: 2rem; }
.chunk-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.chunk-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.chunk-text { line-height: 1.5; }
.chunk-text p { margin: 0.25rem 0; }
.chunk-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}
.chunk-table th, .chunk-table td {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}
.chunk-table th {
    background: var(--bg);
    font-weight: 600;
}
.chunk-table td { vertical-align: top; }

/* Result Actions */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}
/* Framework Reader */
.framework-reader {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.author-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.author-attribution {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.author-attribution strong { font-size: 1.05rem; }
.author-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.author-detail a { color: var(--primary); }
.author-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

.reader-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}
.reader-tabs::-webkit-scrollbar { display: none; }
.reader-tab {
    padding: 0.7rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}
.reader-tab:hover { color: var(--text); background: var(--bg); }
.reader-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.reader-tab-attr {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    align-self: center;
    padding: 0.5rem 0;
}

.reader-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    line-height: 1.8;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 2.5rem 3rem;
}
.reader-content h1 { font-size: 1.8rem; margin: 0 0 1.25rem; line-height: 1.3; scroll-margin-top: 5rem; }
.reader-content h2 {
    font-size: 1.4rem;
    margin: 2.25rem 0 0.75rem;
    color: var(--primary);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    line-height: 1.35;
    scroll-margin-top: 5rem;
}
.reader-content h2:first-child { margin-top: 0; }
.reader-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; line-height: 1.4; }
.reader-content h4 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
.reader-content p { margin: 0.75rem 0; }
.reader-content ul, .reader-content ol { padding-left: 1.75rem; margin: 0.75rem 0; }
.reader-content li { margin-bottom: 0.4rem; line-height: 1.7; }
.reader-content li::marker { color: var(--primary); }
.reader-content blockquote {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    line-height: 1.7;
}
.reader-content blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: normal;
}
.reader-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}
.reader-content code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}
.reader-content a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.reader-content a:hover { text-decoration-thickness: 2px; }
.reader-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.25rem 0;
    display: block;
}
.reader-content .chunk-table {
    margin: 1.25rem 0;
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}
.reader-content .chunk-table th,
.reader-content .chunk-table td {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.6;
}
.reader-content .chunk-table th {
    background: var(--bg);
    font-weight: 600;
}
.reader-content .chunk-table thead,
.reader-content .chunk-table tbody,
.reader-content .chunk-table tr {
    display: revert;
}
.reader-content .chunk-table tr:nth-child(even) td {
    background: var(--bg);
}

/* Reader layout: outline sidebar + content */
.reader-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    align-items: start;
}
/* When outline is hidden (At a Glance tab), content fills full width */
.reader-layout:has(.reader-outline[style*="display:none"]) {
    grid-template-columns: 1fr;
}

.reader-outline {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}
.outline-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.outline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.outline-item {
    margin-bottom: 0.15rem;
}
.outline-item-sub {
    padding-left: 0.75rem;
}
.outline-link {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.outline-link:hover {
    color: var(--text);
    background: var(--bg);
}
.outline-link.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.reader-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    flex-shrink: 0;
}

/* Settings */
.settings-container { max-width: 700px; margin: 0 auto; flex: 1; min-height: 0; overflow-y: auto; }
.settings-container h1 { margin-bottom: 0.25rem; }
.settings-container > .subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }

.key-cards { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
fieldset.key-card { margin: 0; min-width: 0; }
.key-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}
.key-header h3 { font-size: 1.05rem; }
.key-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: var(--border);
    color: var(--text-muted);
    font-weight: 600;
}
.key-badge.active {
    background: #d1fae5;
    color: #065f46;
}
.key-model {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.key-card input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.9rem;
}
.key-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.key-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}
.key-hint a { color: var(--primary); }

.settings-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}
.settings-note {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    font-size: 0.9rem;
}
.settings-note h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.settings-note code {
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid var(--success);
    color: #065f46;
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.5rem 0;
}
.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.role-btn:hover {
    border-color: var(--primary);
    background: hsla(18, 85%, 52%, 0.04);
}
.role-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.role-btn.selected {
    border-color: var(--primary);
    background: hsla(18, 85%, 52%, 0.08);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.role-btn-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.role-btn-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.role-btn.selected .role-btn-desc {
    color: var(--text);
}
@media (max-width: 480px) {
    .role-selector {
        grid-template-columns: 1fr;
    }
}

/* Intake Form */
.intake-field {
    margin-bottom: 1rem;
}
.intake-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}
.intake-field input,
.intake-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
}
.intake-field input:focus,
.intake-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.optional-label {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.field-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    line-height: 1.4;
}
.intake-skip-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}
.intake-skip-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.intake-privacy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
    line-height: 1.4;
}

/* Heatmap page container */
.results-container .result-header { flex-shrink: 0; }

/* Cohort Split Layout (mirrors landing-split) */
.cohort-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}
/* Sidebar + main layout when heatmap is active */
.cohort-page--has-map {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem 2rem;
    align-items: start;
}
.cohort-header {
    text-align: center;
    margin-bottom: 2rem;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.cohort-page--has-map .cohort-header {
    text-align: left;
    margin-bottom: 0;
    grid-row: 1 / -1;
}
.cohort-heading {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 0.4rem;
    transition: font-size 0.3s ease;
}
.cohort-page--has-map .cohort-heading {
    font-size: 1.3rem;
}
.cohort-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}
.cohort-page--has-map .cohort-desc {
    font-size: 0.85rem;
}
.cohort-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.cohort-page--has-map .cohort-body {
    align-items: stretch;
    grid-column: 2;
}
.cohort-map-titlebar {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.cohort-map-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 0.35ch;
    margin: 0;
}
.cohort-code-highlight {
    color: #94a3b8;
    font-weight: 700;
}
.cohort-map-status {
    font-size: 0.95rem;
    color: var(--text-muted);
    white-space: nowrap;
}
/* Side-by-side: small QR left, large heatmap right */
.cohort-split {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    width: 100%;
    margin-top: 0.75rem;
}
.cohort-map-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.cohort-map-area .map-card {
    width: 100%;
}
.cohort-join-card {
    flex-shrink: 0;
    width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.cohort-page--has-map .cohort-header .cohort-join-card {
    width: auto;
    margin-top: 1.25rem;
}
.cohort-join-card h3 {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.cohort-join-card #qrCode {
    margin: 0 auto 0.5rem;
}
.cohort-join-card #qrCode svg {
    display: block;
    margin: 0 auto;
    width: 120px;
    height: 120px;
}
.cohort-join-url {
    font-size: 0.65rem;
    color: var(--text-muted);
    word-break: break-all;
    margin: 0;
    line-height: 1.3;
}

/* Live Dot (pulsing indicator for cohort heatmaps) */
.heatmap-live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Heatmap */
.heatmap-cell {
    transition: all 0.2s;
    cursor: default;
    min-height: 50px;
    font-weight: 600;
    font-size: 1.1rem;
}
.heatmap-cell:hover {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}
.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.heatmap-legend-bar {
    width: 200px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, #fef3e2, #c2410c);
    border: 1px solid var(--border);
}

/* Cohort lookup */
.cohort-lookup {
    margin: 0;
}
.cohort-lookup-row {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}
.cohort-lookup-row .btn {
    flex-shrink: 0;
}
.cohort-page--has-map .cohort-lookup-row {
    max-width: none;
    margin: 0;
}
.cohort-lookup-row input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}
.cohort-lookup-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Footer */

/* ===== Slide System ===== */
[data-slideshow] {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

[data-slideshow] > .slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 2.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

[data-slideshow] > .slide.active {
    opacity: 1;
    visibility: visible;
}

.slide-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 10;
}

.slide-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.2rem 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.15s;
    line-height: 1;
}
.slide-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.slide-dots {
    display: flex;
    gap: 0.4rem;
}
.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}
.slide-dot.active { background: var(--primary); }

.slide-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 2.5rem;
    text-align: center;
}

/* ===== Scroll-Frame Mode ===== */
[data-slideshow="scroll"] {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
[data-slideshow="scroll"]::-webkit-scrollbar { display: none; }

.scroll-frame-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2.5rem;
    align-content: start;
    padding: 2.5rem 3rem;
    min-height: calc(100% - 2.5rem);
}

/* Full-width spanning elements */
.scroll-frame-body > h1,
.scroll-frame-body > h2,
.scroll-frame-body > h3,
.scroll-frame-body > h4,
.scroll-frame-body > hr,
.scroll-frame-body > table,
.scroll-frame-body > .chunk-table,
.scroll-frame-body > pre,
.scroll-frame-body > div,
.scroll-frame-body > img {
    grid-column: 1 / -1;
}

/* Section headings get a subtle top divider */
.scroll-frame-body > h2 {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.scroll-frame-body > h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Images inside paragraphs still get full width */
.scroll-frame-body > p > img {
    max-width: 100%;
    display: block;
}
.scroll-frame-body > p:has(> img) {
    grid-column: 1 / -1;
}

/* Tables need horizontal scroll at narrow widths */
.scroll-frame-body > table,
.scroll-frame-body > .chunk-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scroll-frame-nav {
    position: sticky;
    bottom: 0;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 10;
    flex-shrink: 0;
    padding: 0 1rem;
}

.scroll-frame-track {
    flex: 1;
    max-width: 200px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.scroll-frame-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0;
}

/* Responsive — Tablet */
@media (max-width: 768px) {
    /* Global — unlock scroll on ALL pages (was only assessment) */
    body { height: auto; overflow: auto; }
    .container { padding: 0.75rem 1rem; overflow: visible; }
    .top-nav { padding: 0.75rem 1rem; }

    /* Nav — wrap on mobile */
    .nav-links { flex-wrap: wrap; gap: 0.5rem 1rem; }
    .nav-links a { font-size: 0.85rem; }

    /* Cohort page */
    .cohort-page { padding: 1rem 0 2rem; }
    .cohort-page--has-map { grid-template-columns: 1fr; }
    .cohort-page--has-map .cohort-header { grid-row: auto; text-align: center; }
    .cohort-page--has-map .cohort-body { grid-column: 1; }
    .cohort-heading { font-size: 1.5rem; }
    .cohort-split { flex-direction: column; align-items: center; }
    .cohort-map-area { order: -1; }
    .cohort-join-card { width: auto; max-width: 200px; }

    /* Framework */
    .framework-axes { grid-template-columns: 1fr; }
    .reader-layout { grid-template-columns: 1fr; }
    .reader-outline { display: none; }
    .reader-content { padding: 1.5rem; }

    /* Hero */
    .hero h1 { font-size: 1.7rem; }
    .subtitle { white-space: normal; }

    /* Matrix */
    .matrix-table td { min-width: 75px; }
    .matrix-table th, .matrix-table td { padding: 0.4rem; font-size: 0.75rem; }

    /* Results — single column earlier */
    .placement-growth-grid { grid-template-columns: 1fr; gap: 1rem; }
    .position-code { font-size: 2.5rem; }
    .result-actions { flex-wrap: wrap; justify-content: center; }

    /* Assessment — scroll zone grows freely, arrows stay pinned */
    .question-viewport { padding: 0.75rem 1rem 1rem; }
    .q-card h2 { font-size: 1.1rem; }
    .q-option { padding: 0.65rem 0.75rem; font-size: 0.88rem; align-items: flex-start; }
    .q-option-key { align-self: flex-start; margin-top: 0.1rem; }
    .question-nav { margin-top: 0.625rem; }

    /* Landing page — stack to single column */
    .landing-split { grid-template-columns: 1fr; gap: 2rem; padding: 1rem 0; }
    .landing-messaging { position: static; text-align: center; max-width: 100%; }
    .landing-cta-btn { align-self: center; }
    .landing-headline { font-size: 1.7rem; }
    .landing-details { justify-content: center; }
    .landing-illustration { margin-top: 1rem; }
    .landing-illustration img { max-width: 110px; }

    /* Heatmap — reduce corner, no-wrap headers */
    .hm-corner { width: 3.5rem; }
    .hm-stage-header { font-size: 0.72rem; white-space: nowrap; }
    .hm-level-header { font-size: 0.72rem; white-space: normal; }
    .hm-cell { height: 3rem; }
    .hm-count { font-size: 0.85rem; }
    .mobile-br { display: inline; }
}

/* Responsive — Mobile */
@media (max-width: 480px) {
    /* Global */
    .container { padding: 0.5rem 0.75rem; }
    .top-nav { padding: 0.5rem 0.75rem; }
    .nav-brand a { font-size: 0.8rem; }
    .btn { padding: 0.6rem 1.25rem; font-size: 0.9rem; }

    /* Landing + Cohort pages — compact mobile */
    .landing-split { gap: 1.5rem; padding: 0.5rem 0; }
    .cohort-heading { font-size: 1.3rem; }
    .landing-headline { font-size: 1.3rem; }
    .landing-byline { font-size: 0.88rem; }
    .btn-xl { padding: 0.75rem 2rem; font-size: 1rem; width: 100%; text-align: center; }
    .landing-cta-btn { align-self: stretch; }
    .landing-illustration img { max-width: 80px; }
    .hm-level-name { display: none; }
    .hm-level-num { font-size: 0.7rem; }
    .hm-corner { width: 2rem; }
    .hm-level-header { padding: 0.25rem 0.2rem; }
    .hm-stage-header { font-size: 0.6rem; padding: 0.4rem 0.1rem; letter-spacing: -0.02em; white-space: nowrap; }
    .hm-cell { height: 2.25rem; }
    .hm-count { font-size: 0.75rem; }
    .map-card { padding: 0.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Framework Overview (inside reader) */
    .framework-axes { gap: 1rem; margin: 1rem 0; grid-template-columns: 1fr; }
    .mini-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .mini-table td { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
    .key-insight { padding: 0.75rem 1rem; font-size: 0.9rem; }

    /* Assessment */
    .q-card h2 { font-size: 1rem; }
    .q-option { padding: 0.6rem 0.65rem; font-size: 0.85rem; align-items: flex-start; }
    .q-option-key { min-width: 1.35rem; height: 1.35rem; font-size: 0.68rem; align-self: flex-start; margin-top: 0.1rem; }
    .jargon::after { max-width: 180px; font-size: 0.72rem; }
    .question-card { padding: 1rem; }
    .question-viewport { padding: 0.5rem 0.75rem 0.75rem; }
    .question-nav { margin-top: 0.5rem; justify-content: flex-start; gap: 0.75rem; }

    /* Results */
    .result-hero-header { margin-bottom: 1rem; }
    .position-code { font-size: 2.25rem; }
    .result-description { font-size: 0.88rem; }
    .placement-growth-grid { grid-template-columns: 1fr; gap: 1rem; }
    .summary-card { padding: 0.75rem; }
    .growth-signal-inline blockquote { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
    .growth-actions-inline li { font-size: 0.85rem; }
    .result-actions { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .result-actions .btn { text-align: center; font-size: 0.88rem; }

    /* Framework Reader */
    .reader-content { padding: 1rem; font-size: 0.9rem; }
    .reader-content h1 { font-size: 1.2rem; }
    .reader-content h2 { font-size: 1.05rem; }
    .reader-content h3 { font-size: 0.9rem; }
    .reader-content .chunk-table th,
    .reader-content .chunk-table td { padding: 0.3rem 0.4rem; font-size: 0.75rem; }
    .reader-tab { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    .reader-tab-attr { display: none; }
    .reader-content .chunk-table th,
    .reader-content .chunk-table td { white-space: nowrap; font-size: 0.72rem; padding: 0.25rem 0.4rem; }
    .author-banner { padding: 0.6rem 0.75rem; }
    .author-attribution strong { font-size: 0.9rem; }
    .author-detail { font-size: 0.7rem; }
    .author-note { font-size: 0.75rem; }

    /* Slides */
    .slide-nav { height: 2rem; gap: 0.5rem; }
    .slide-btn { padding: 0.15rem 0.5rem; font-size: 0.85rem; }
    .slide-count { font-size: 0.7rem; }
    [data-slideshow] > .slide { bottom: 2.25rem; }

    /* Scroll frame */
    .scroll-frame-body { padding: 1rem 0.75rem; gap: 0.5rem; }
    .scroll-frame-nav { height: 2rem; gap: 0.5rem; }
}

/* ===== Feedback Widget ===== */
.fb-trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 90;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: background 0.15s, box-shadow 0.15s;
}
.fb-trigger:hover { background: var(--bg); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.fb-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--surface);
}
.fb-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.4);
}
.fb-modal {
    position: fixed;
    z-index: 201;
    bottom: 5rem;
    right: 1.5rem;
    width: 400px;
    max-width: 90vw;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: popoverIn 0.15s ease-out;
}
.fb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fb-modal-header strong { font-size: 1rem; }
.fb-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 0.25rem;
}
.fb-close:hover { color: var(--text); }
.fb-cats {
    display: flex;
    gap: 0.4rem;
}
.fb-cat {
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}
.fb-cat:hover { border-color: var(--primary); color: var(--primary); }
.fb-cat.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.fb-text {
    width: 100%;
    min-height: 80px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    resize: vertical;
}
.fb-text:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.fb-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.fb-submit { font-size: 0.85rem; padding: 0.5rem 1rem; }
.fb-status { font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 480px) {
    .fb-modal { right: 0.5rem; left: 0.5rem; bottom: 4rem; width: auto; }
    .fb-trigger { bottom: 1rem; right: 1rem; }
}

/* ===== Admin Pages ===== */
.admin-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}
.admin-login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 320px;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.admin-login-card h2 { font-size: 1.25rem; }
.admin-login-card input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}
.admin-login-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.admin-error { color: var(--danger); font-size: 0.9rem; }

.admin-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}
.admin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.admin-counts { display: flex; gap: 0.5rem; align-items: center; }
.admin-count { font-size: 0.85rem; color: var(--text-muted); }
.admin-logout {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}
.admin-logout:hover { color: var(--text); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.admin-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.admin-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.admin-table tbody tr:nth-child(even) { background: var(--bg); }
.admin-cell-time { white-space: nowrap; font-size: 0.8rem; color: var(--text-muted); }
.admin-cell-page { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.admin-cell-msg { max-width: 400px; }
.admin-cell-msg details summary { cursor: pointer; }
.admin-full-msg { margin-top: 0.5rem; white-space: pre-wrap; font-size: 0.85rem; color: var(--text); }
.admin-ua { margin-top: 0.25rem; font-size: 0.7rem; color: var(--text-muted); word-break: break-all; }

.admin-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-transform: capitalize;
}
.admin-badge-new { background: var(--primary-light); color: var(--primary); }
.admin-badge-reviewed { background: #fef3c7; color: #92400e; }
.admin-badge-resolved { background: #d1fae5; color: #065f46; }

.admin-cat {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.admin-cat-bug { background: #fee2e2; color: #991b1b; }
.admin-cat-suggestion { background: #e0e7ff; color: #3730a3; }
.admin-cat-general { background: var(--bg); color: var(--text-muted); }

.admin-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    font-size: 1rem;
}

/* Print styles for PDF export */
@media print {
    .top-nav, .site-footer, .result-actions, .question-nav, .fb-trigger, .fb-backdrop, .fb-modal { display: none !important; }
    body { background: white; color: black; }
    .container { max-width: 100%; padding: 0; }
    .results-container { max-width: 100%; }

    .result-hero-header { break-inside: avoid; margin-bottom: 0.75rem; }
    .placement-growth-grid { gap: 1rem; }
    .summary-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    .placement-col .summary-card { background: #fde8d8; border-color: #e8a070; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .summary-card-next { border-color: #d4743a; background: #f5c9a8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .growth-signal-inline blockquote { background: #f0f7ff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .key-insight { background: #f0f7ff; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }

    .chunk-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }

    /* Print header */
    .results-container::before {
        content: "DIT 2026 Assessment Results";
        display: block;
        text-align: center;
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        color: #333;
    }
}
