:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --accent: #1d4ed8;
    --accent-hover: #1e40af;
    --forest: #15803d;
    --forest-bg: #f0fdf4;
    --forest-border: #bbf7d0;
    --heat: #b91c1c;
    --heat-bg: #fef2f2;
    --heat-border: #fecaca;
    --border: #e2e8f0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

button {
    font-family: inherit;
    cursor: pointer;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.lab-nav {
    background-color: var(--text-primary);
    color: #ffffff;
    padding: 0.85rem 0;
    border-bottom: 1px solid #1e293b;
}

.lab-nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-link {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.back-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.nav-badge {
    font-size: 0.78rem;
    background-color: #1e293b;
    color: #cbd5e1;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #334155;
}

.tool-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3.5rem;
}

.tool-header {
    margin-bottom: 1.5rem;
}

.tool-header h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.tool-subtitle {
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 820px;
    margin: 0;
}

.framing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.framing-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    padding: 1rem 1.15rem;
    font-size: 0.9rem;
}

.framing-card h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin: 0 0 0.35rem;
}

.framing-card p {
    color: var(--text-muted);
    margin: 0;
}

.panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.35rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1.12rem;
    font-weight: 700;
    margin: 0;
}

.panel-subtext {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0;
}

/* Guide Panel */
.guide-panel {
    margin-bottom: 1.5rem;
    background: #fcfdff;
}

.guide-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1.5rem;
}

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

.guide-why p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0.6rem 0 0;
}

.guide-subhead {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin: 0 0 0.65rem;
}

.walkthrough-steps {
    margin: 0;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.walkthrough-steps strong {
    color: var(--text-primary);
}

/* Mode Deck */
.mode-deck {
    margin-bottom: 1.5rem;
}

.mode-deck-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.control-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.mode-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    background: #f1f5f9;
    padding: 0.3rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.mode-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.48rem 0.9rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

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

.mode-btn[aria-pressed="true"] {
    background: #ffffff;
    color: var(--accent);
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-ghost {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-ghost:hover {
    background: #f1f5f9;
}

.comparison-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

@media (max-width: 780px) {
    .comparison-strip {
        grid-template-columns: 1fr;
    }
}

.comp-pill {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
}

.comp-old {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.comp-new {
    background: var(--forest-bg);
    border: 1px solid var(--forest-border);
    color: #14532d;
}

.comp-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.comp-old .comp-tag {
    background: #e2e8f0;
    color: #334155;
}

.comp-new .comp-tag {
    background: #dcfce7;
    color: #166534;
}

/* Workspace Modes */
.briefing-workspace {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.briefing-workspace.mode-split {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.briefing-workspace.mode-pdf,
.briefing-workspace.mode-story {
    grid-template-columns: 1fr;
}

.briefing-workspace.mode-pdf #storyColumn,
.briefing-workspace.mode-story #pdfColumn {
    display: none;
}

@media (max-width: 980px) {
    .briefing-workspace.mode-split {
        grid-template-columns: 1fr;
    }
}

.format-badge {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.badge-old {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-new {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Simulated Static PDF Viewer */
.pdf-viewer-frame {
    border: 1px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    background: #525659;
}

.pdf-toolbar {
    background: #323639;
    color: #e2e8f0;
    padding: 0.55rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.pdf-filename {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.pdf-page-controls {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pdf-page-btn {
    background: #475569;
    color: #f8fafc;
    border: 1px solid #64748b;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.pdf-page-btn[aria-pressed="true"] {
    background: #f8fafc;
    color: #0f172a;
    border-color: #ffffff;
}

.pdf-canvas-scroll {
    padding: 1.15rem;
    max-height: 760px;
    overflow-y: auto;
}

.pdf-sheet {
    background: #ffffff;
    color: #1f2937;
    padding: 1.5rem 1.45rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 0.8rem;
    line-height: 1.42;
}

.pdf-running-head {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #9ca3af;
    padding-bottom: 0.35rem;
    margin-bottom: 0.85rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.pdf-doc-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #111827;
}

.pdf-doc-meta {
    font-size: 0.72rem;
    font-style: italic;
    color: #4b5563;
    margin: 0 0 0.9rem;
}

.pdf-columns {
    column-count: 2;
    column-gap: 1.15rem;
    text-align: justify;
}

@media (max-width: 560px) {
    .pdf-columns {
        column-count: 1;
    }
}

.pdf-columns p {
    margin: 0 0 0.65rem;
    text-indent: 0.85rem;
}

.pdf-columns p:first-child {
    text-indent: 0;
}

.pdf-section-label {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0.8rem 0 0.35rem;
    color: #111827;
}

.pdf-cramped-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.69rem;
}

.pdf-cramped-table th,
.pdf-cramped-table td {
    border: 1px solid #9ca3af;
    padding: 0.25rem 0.35rem;
    text-align: right;
}

.pdf-cramped-table th:first-child,
.pdf-cramped-table td:first-child {
    text-align: left;
}

.pdf-cramped-table th {
    background: #e5e7eb;
    font-weight: 700;
}

.pdf-footnote {
    margin-top: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid #d1d5db;
    font-size: 0.66rem;
    color: #6b7280;
    line-height: 1.3;
}

.pdf-friction-callout {
    margin-top: 0.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    font-size: 0.82rem;
    color: #9a3412;
}

/* Interactive Story Briefing View */
.story-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #ffffff;
    border-radius: 8px;
    padding: 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
}

.story-kicker {
    display: inline-block;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #93c5fd;
    margin-bottom: 0.35rem;
}

.story-hero h3 {
    font-size: 1.35rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

.story-hero p {
    margin: 0;
    font-size: 0.92rem;
    color: #e2e8f0;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 620px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}

.kpi-tile {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    padding: 0.65rem 0.8rem;
}

.kpi-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
}

.kpi-label {
    font-size: 0.76rem;
    color: #cbd5e1;
}

/* Scrollytelling Chapter Cards */
.section-subhead {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

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

.chapter-card {
    text-align: left;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.chapter-card:hover {
    border-color: #94a3b8;
    background: #ffffff;
}

.chapter-card[aria-pressed="true"] {
    background: #eff6ff;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.chapter-step {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.chapter-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chapter-spotlight {
    background: #f8fafc;
    border-left: 4px solid var(--forest);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.95rem 1.1rem;
    margin-bottom: 1.25rem;
}

.chapter-spotlight h4 {
    margin: 0 0 0.3rem;
    font-size: 0.98rem;
    color: var(--text-primary);
}

.chapter-spotlight p {
    margin: 0;
    font-size: 0.89rem;
    color: var(--text-muted);
}

/* Interactive Chart Box */
.chart-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    background: #ffffff;
    margin-bottom: 1.25rem;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip-btn {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.34rem 0.68rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.chip-btn:hover {
    background: #e2e8f0;
}

.chip-btn[aria-pressed="true"] {
    background: #dbeafe;
    border-color: var(--accent);
    color: #1e3a8a;
}

.chart-canvas-wrap {
    position: relative;
    height: 290px;
    width: 100%;
}

.chart-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.wcag-table-wrap {
    margin-top: 0.85rem;
    overflow-x: auto;
}

.wcag-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

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

.wcag-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: var(--text-primary);
}

.status-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

.status-gap {
    background: var(--heat-bg);
    color: var(--heat);
    border: 1px solid var(--heat-border);
}

.status-met {
    background: var(--forest-bg);
    color: var(--forest);
    border: 1px solid var(--forest-border);
}

/* Plain-Language Takeaways */
.takeaway-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
}

.takeaway-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    font-size: 0.85rem;
}

.takeaway-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.takeaway-item span {
    color: var(--text-muted);
}

/* Tailored CTA Module */
.cta-box {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 8px;
    padding: 1.05rem 1.15rem;
}

.cta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.cta-header h4 {
    margin: 0;
    font-size: 0.96rem;
    color: #1e3a8a;
}

.cta-body h5 {
    margin: 0 0 0.3rem;
    font-size: 0.98rem;
    color: var(--text-primary);
}

.cta-body p {
    margin: 0 0 0.85rem;
    font-size: 0.87rem;
    color: var(--text-muted);
}

.cta-action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cta-primary-btn {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1rem;
    font-size: 0.86rem;
    font-weight: 600;
}

.cta-primary-btn:hover {
    background: var(--accent-hover);
}

.cta-meta {
    font-size: 0.8rem;
    color: #1e40af;
    font-weight: 600;
}

/* Embed Mode (?embed=true) */
.embed-mode .lab-nav,
.embed-mode .tool-header,
.embed-mode .framing-grid,
.embed-mode .guide-panel,
.embed-mode footer {
    display: none;
}

.embed-mode .tool-container {
    padding: 1rem;
}