/* W56: fonts vendored — served from the one origin, no network dependency */
@import url("/vendor/fonts/fonts.css");
:root {
    color-scheme: dark;
    --bg: #050b14;
    --bg-elevated: #091221;
    --bg-panel: rgba(10, 18, 32, 0.9);
    --bg-panel-2: rgba(12, 23, 40, 0.96);
    --line: rgba(168, 186, 214, 0.12);
    --line-strong: rgba(168, 186, 214, 0.24);
    --text: #f3f6fb;
    --text-soft: #d4dde9;
    --muted: #98a6ba;
    --accent: #e4bf83;
    --accent-strong: #caa24f;
    --accent-warm: #e4bf83;
    --success: #a99e5e;
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.34);
    --shadow: var(--shadow-lg);
    --radius-1: 16px;
    --radius-2: 24px;
    --radius-md: var(--radius-1);
    --radius-lg: 20px;
    --radius-xl: var(--radius-2);
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --blue: var(--accent);
    --blue-2: var(--accent-strong);
    --gold: var(--accent-warm);
    --green: var(--success);
}

* {
    box-sizing: border-box;
}

*::selection {
    background: rgba(228, 191, 131, 0.24);
    color: var(--text);
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    line-height: 1.6;
    background: radial-gradient(circle at top left, rgba(228, 191, 131, 0.14), transparent 26%), radial-gradient(circle at top right, rgba(228, 191, 131, 0.12), transparent 18%), linear-gradient(180deg, #07111e 0%, #050c16 42%, #040910 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
select,
input,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

:focus-visible {
    outline: 2px solid rgba(228, 191, 131, 0.52);
    outline-offset: 2px;
}

.workspace-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: var(--space-4);
    width: min(1520px, calc(100% - 48px));
    margin: 0 auto;
    padding: var(--space-3) 0 var(--space-5);
}

.workspace-sidebar,
.workspace-card,
.chart-card,
.stat-card,
.subgenre-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-2);
    background: linear-gradient(180deg, rgba(14, 23, 39, 0.96), rgba(8, 14, 24, 0.96)), var(--bg-panel);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}

.workspace-sidebar {
    position: sticky;
    top: var(--space-3);
    height: calc(100vh - 48px);
    overflow: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: linear-gradient(180deg, rgba(12, 21, 36, 0.98), rgba(8, 14, 25, 0.98)), var(--bg-panel-2);
}

.workspace-shell.week-focus-mode {
    grid-template-columns: minmax(0, 1fr);
    width: min(1480px, calc(100% - 40px));
}

.workspace-sidebar.week-focus-mode {
    display: none;
}

.workspace-shell.week-focus-mode .week-page {
    padding: 18px;
}

.workspace-shell.week-focus-mode .detail-hero {
    padding: 22px 28px;
    border-radius: var(--radius-lg);
}

.workspace-shell.week-focus-mode .detail-hero h2 {
    font-size: clamp(2rem, 3vw, 2.6rem);
}

.sidebar-kicker,
.eyebrow,
.panel-label {
    margin: 0 0 var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
}

.sidebar-brand h1,
.workspace-hero h2,
.detail-hero h2,
.section-title h3,
.roadmap-detail h3,
.subgenre-title h4 {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    letter-spacing: -0.03em;
}

.sidebar-brand h1 {
    font-size: 2rem;
    margin-bottom: var(--space-1);
    color: var(--text);
}

.sidebar-brand p:last-child,
.hero-copy,
.workspace-card p,
.stat-card p,
.assignment-list span,
.resource-links span,
.chart-copy {
    color: var(--muted);
    line-height: 1.6;
}

.assignment-list span,
.resource-links span {
    display: block;
    margin-top: var(--space-1);
}

.site-mode-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: var(--space-2);
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(8, 14, 24, 0.7);
}

.site-mode-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 10px;
    border-radius: calc(var(--radius-1) - 3px);
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    line-height: 1.2;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
    cursor: pointer;
}

.site-mode-switch a:hover {
    background: rgba(228, 191, 131, 0.07);
    color: var(--text);
}

.site-mode-switch a.active {
    background: linear-gradient(180deg, rgba(228, 191, 131, 0.16), rgba(228, 191, 131, 0.08));
    border-color: rgba(228, 191, 131, 0.28);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.site-mode-switch a[data-mode-switch="tracker"].active {
    background: linear-gradient(180deg, rgba(170, 158, 96, 0.16), rgba(170, 158, 96, 0.08));
    border-color: rgba(170, 158, 96, 0.3);
    color: var(--success);
}

/* Generated week titles: first track segment carries the display line; the
   remaining segments set as a quiet smallcaps run so long weeks read as
   hierarchy instead of a three-line wall. Em-based so it scales from the
   hero h1 down to card h2s. */
.week-title .week-title-main {
    display: block;
}
.week-title .week-title-tracks {
    display: block;
    margin-top: 0.45em;
    font-size: 0.34em;
    font-family: var(--font-body, inherit);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(228, 191, 131, 0.78);
    line-height: 1.7;
    max-width: 62ch;
}
.week-title .week-title-tracks i {
    font-style: normal;
    margin: 0 0.55em;
    color: rgba(228, 191, 131, 0.38);
}

/* Craft floor: one consistent keyboard-focus treatment everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(228, 191, 131, 0.85);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Micro-interaction: gate rows acknowledge the pointer without theatrics. */
details.roadmap-gate > summary {
    transition: background 150ms ease, border-color 150ms ease;
}
details.roadmap-gate > summary:hover {
    background: rgba(228, 191, 131, 0.05);
}

/* Tool-route context bar: the four resume cards fold into one quiet line so
   each tool page leads with its actual tool instead of shared boilerplate. */
.workspace-context-more > summary {
    cursor: pointer;
    list-style: none;
    margin-top: 10px;
    padding: 7px 10px;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #97a4b4;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    transition: color 150ms ease, border-color 150ms ease;
}
.workspace-context-more > summary::-webkit-details-marker { display: none; }
.workspace-context-more > summary::before { content: "▸ "; color: var(--gold, #e4bf83); }
.workspace-context-more[open] > summary::before { content: "▾ "; }
.workspace-context-more > summary:hover { color: var(--text, #f3f6fb); border-color: rgba(228, 191, 131, 0.4); }
.workspace-context-more[open] .resume-strip-grid { margin-top: 10px; }

/* Heatmap folio — 28 weeks as an illuminated calendar. */
.folio-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}
.folio-week {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 3 / 4;
    padding: 8px 9px 9px;
    border-radius: 4px;
    border: 1px solid rgba(228, 191, 131, 0.22);
    background:
        radial-gradient(ellipse at 30% 20%, rgba(228, 191, 131, 0.07), transparent 60%),
        linear-gradient(165deg, rgba(24, 30, 46, 0.95), rgba(12, 18, 30, 0.98));
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.folio-week:hover {
    transform: translateY(-2px);
    border-color: rgba(228, 191, 131, 0.55);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.folio-week.intensity-medium {
    border-color: rgba(228, 191, 131, 0.38);
    background:
        radial-gradient(ellipse at 30% 20%, rgba(228, 191, 131, 0.12), transparent 60%),
        linear-gradient(165deg, rgba(30, 32, 44, 0.96), rgba(16, 18, 28, 0.98));
}
.folio-week.intensity-high {
    border-color: rgba(110, 43, 43, 0.85);
    background:
        radial-gradient(ellipse at 30% 20%, rgba(110, 43, 43, 0.28), transparent 65%),
        linear-gradient(165deg, rgba(34, 22, 26, 0.97), rgba(16, 12, 16, 0.99));
    box-shadow: inset 0 0 18px rgba(110, 43, 43, 0.25);
}
.folio-num {
    font-family: var(--font-display, serif);
    font-size: clamp(0.95rem, 1.6vw, 1.35rem);
    color: #f6ecd9;
    letter-spacing: 0.04em;
    line-height: 1;
}
.folio-inks {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 42%;
}
.folio-ink {
    flex: 1;
    display: block;
    height: calc(12% + var(--v, 0) * 88%);
    min-height: 3px;
    border-radius: 1px;
}
.folio-ink.earned { background: linear-gradient(180deg, #e4bf83, rgba(228, 191, 131, 0.55)); }
.folio-ink.owed { background: linear-gradient(180deg, #8a3a3a, rgba(110, 43, 43, 0.6)); }
.folio-phase-tick {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 4px 4px 0 0;
}
.folio-week.phase-0 .folio-phase-tick { background: rgba(228, 191, 131, 0.5); }
.folio-week.phase-1 .folio-phase-tick { background: rgba(123, 198, 170, 0.55); }
.folio-week.phase-2 .folio-phase-tick { background: rgba(125, 178, 255, 0.5); }
.folio-week.phase-3 .folio-phase-tick { background: rgba(110, 43, 43, 0.9); }
.folio-week.phase-4 .folio-phase-tick { background: rgba(244, 236, 216, 0.6); }
.folio-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-size: 12px;
    color: #97a4b4;
    align-items: center;
}
.folio-legend .folio-ink { display: inline-block; width: 9px; height: 12px; flex: none; vertical-align: -2px; margin-right: 5px; }
.folio-phase-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.folio-phase-dot.phase-0 { background: rgba(228, 191, 131, 0.7); }
.folio-phase-dot.phase-1 { background: rgba(123, 198, 170, 0.75); }
.folio-phase-dot.phase-2 { background: rgba(125, 178, 255, 0.7); }
.folio-phase-dot.phase-3 { background: rgba(110, 43, 43, 1); }
.folio-phase-dot.phase-4 { background: rgba(244, 236, 216, 0.8); }
.heatmap-ledger { margin-top: 14px; }
@media (max-width: 860px) { .folio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .folio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .folio-week, .folio-week:hover { transition: none; transform: none; } }

/* Hero-art parity: each personal workspace gets its own plate, keyed to its
   subject — Holbein's Ambassadors (career/statecraft), the Alchemist
   (compounding), Vermeer's Geographer (mapping knowledge), Rembrandt's
   Philosopher (breadth in meditation). Same tint pipeline as the Putnam heroes. */
.career-page .career-hero,
.finance-page .workspace-hero,
.brain-page .workspace-hero,
.polymath-vault-page .vault-hero {
    position: relative;
    overflow: hidden;
}
.career-page .career-hero::before,
.finance-page .workspace-hero::before,
.brain-page .workspace-hero::before,
.polymath-vault-page .vault-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    filter: var(--plate-filter);
    opacity: 0.34;
    z-index: 0;
    pointer-events: none;
}
.career-page .career-hero::before { background: url("assets/plates/tnbr-ambassadors.webp") right 20%/cover no-repeat; }
.finance-page .workspace-hero::before, .brain-page .workspace-hero::before, .polymath-vault-page .vault-hero::before, .workspace-shell.week-focus-mode .roadmap-v2-shell.current::before { --plate-filter: var(--scene-filter); }
.tracker-page:not(.finance-page):not(.brain-page) > .workspace-hero { position: relative; overflow: hidden; }
.tracker-page:not(.finance-page):not(.brain-page) > .workspace-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("assets/plates/tnbr-jerome.webp") right 30%/cover no-repeat;
    filter: var(--plate-filter);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}
.tracker-page:not(.finance-page):not(.brain-page) > .workspace-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 13, 22, 0.95) 30%, rgba(7, 13, 22, 0.45) 70%, rgba(7, 13, 22, 0.7) 100%);
    z-index: 0;
    pointer-events: none;
}
.tracker-page:not(.finance-page):not(.brain-page) > .workspace-hero > * { position: relative; z-index: 1; }
.vault-lane-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.vault-lane-controls select { padding: 6px 8px; border-radius: 6px; border: 1px solid #243049; background: #07101e; color: #f3f6fb; font-size: 12px; }
.vault-lane-card.vault-status-active { border-left: 3px solid var(--gold, #e4bf83); }
.vault-lane-card.vault-status-output-produced { border-left: 3px solid #7bc6aa; }
.vault-lane-output { margin-top: 8px; font-size: 12px; }
.finance-page .workspace-hero::before { background: url("assets/plates/scene-finance.webp") center 62%/cover no-repeat; filter: var(--scene-filter); opacity: 0.42; }
.brain-page .workspace-hero::before { background: url("assets/plates/scene-brain.webp") center 40%/cover no-repeat; filter: var(--scene-filter); opacity: 0.42; }
.polymath-vault-page .vault-hero::before { background: url("assets/plates/scene-vault.webp") center 55%/cover no-repeat; filter: var(--scene-filter); opacity: 0.42; }

/* Putnam roadmap: the current-week shell wears the study scene — the
   kenburns/candle-flicker hook for this selector already exists (motion
   block); this supplies the missing plate itself. */
.workspace-shell.week-focus-mode .roadmap-v2-shell.current { position: relative; overflow: hidden; }
.workspace-shell.week-focus-mode .roadmap-v2-shell.current::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("assets/plates/scene-study.webp") center 30%/cover no-repeat;
    filter: var(--scene-filter);
    opacity: 0.30;
    z-index: 0;
    pointer-events: none;
}
.workspace-shell.week-focus-mode .roadmap-v2-shell.current::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(6, 11, 21, 0.94) 34%, rgba(6, 11, 21, 0.55) 72%, rgba(6, 11, 21, 0.8) 100%);
    z-index: 0;
    pointer-events: none;
}
.workspace-shell.week-focus-mode .roadmap-v2-shell.current > * { position: relative; z-index: 1; }
.career-page .career-hero::after,
.finance-page .workspace-hero::after,
.brain-page .workspace-hero::after,
.polymath-vault-page .vault-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 13, 22, 0.95) 30%, rgba(7, 13, 22, 0.45) 70%, rgba(7, 13, 22, 0.7) 100%),
                radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(4, 8, 18, 0.65) 100%);
    z-index: 0;
    pointer-events: none;
}
.career-page .career-hero > *,
.finance-page .workspace-hero > *,
.brain-page .workspace-hero > *,
.polymath-vault-page .vault-hero > * {
    position: relative;
    z-index: 1;
}

.site-mode-switch a[data-mode-switch="career"].active {
    background: linear-gradient(180deg, rgba(246, 196, 83, 0.18), rgba(246, 196, 83, 0.08));
    border-color: rgba(246, 196, 83, 0.34);
    color: #f6c453;
}

.sidebar-nav {
    display: grid;
    gap: var(--space-1);
}

.sidebar-nav a,
.toggle-row button,
.week-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(16, 27, 42, 0.84);
    color: var(--muted);
    cursor: pointer;
}

.sidebar-nav a {
    text-align: left;
    padding: 14px var(--space-2);
    font-weight: 600;
}

.sidebar-nav a:hover,
.toggle-row button:hover,
.week-item:hover {
    border-color: var(--line-strong);
    color: var(--text);
    background: rgba(20, 33, 54, 0.96);
}

.sidebar-nav a.active,
.toggle-row .active,
.week-item.active {
    background: linear-gradient(180deg, rgba(228, 191, 131, 0.18), rgba(228, 191, 131, 0.16));
    border-color: rgba(228, 191, 131, 0.34);
    color: var(--text);
}

.sidebar-panel {
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(11, 19, 31, 0.68);
}

.sidebar-panel strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.sidebar-actions {
    display: flex;
    gap: 5px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.sidebar-status-panel {
    display: grid;
    gap: 10px;
}

.sidebar-status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
}

.sidebar-status-grid>div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.sidebar-status-grid>div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-status-grid>div:first-child {
    padding-top: 0;
}

.sidebar-status-grid>div strong {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-status-grid>div span {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: right;
    line-height: 1.3;
}

.sidebar-panel span {
    color: var(--muted);
    font-size: 0.95rem;
}

.compact-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.compact-list li {
    font-size: 0.82rem;
    color: var(--muted);
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}

.compact-list li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--muted);
}

.workspace-main {
    min-width: 0;
}

.view-stack,
.shelf-grid,
.stat-grid,
.chart-grid,
.subgenre-grid {
    display: grid;
    gap: var(--space-3);
    min-width: 0;
}

.view-stack>*,
.shelf-grid>*,
.stat-grid>*,
.chart-grid>*,
.subgenre-grid>* {
    min-width: 0;
}

.workspace-hero,
.detail-hero,
.section-title,
.control-row,
.subgenre-head,
.subgenre-title {
    display: flex;
}

.workspace-hero,
.detail-hero {
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: radial-gradient(circle at top right, rgba(228, 191, 131, 0.12), transparent 22%), linear-gradient(180deg, rgba(13, 22, 38, 0.96), rgba(8, 15, 27, 0.94)), var(--bg-panel-2);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.workspace-hero::after,
.detail-hero::after {
    content: "";
    position: absolute;
    inset: auto calc(var(--space-5) * -1) calc(var(--space-6) * -1) auto;
    width: 224px;
    height: 224px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(228, 191, 131, 0.14), transparent 66%);
    pointer-events: none;
}

.workspace-hero h2,
.detail-hero h2 {
    font-size: clamp(2rem, 2.8vw, 3rem);
    line-height: 1.08;
}

.hero-chip {
    display: flex;
    align-items: start;
    gap: var(--space-1);
    flex-wrap: wrap;
}

.hero-chip span,
.detail-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.12);
    border: 1px solid rgba(228, 191, 131, 0.22);
    color: var(--text);
    font-weight: 600;
}

.workspace-card,
.assignment-card,
.practice-card,
.sidebar-panel,
.progression-card,
.lesson-board,
.recall-card {
    animation: fade-up 280ms ease;
}

.progression-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-2);
}

.progression-card {
    min-width: 0;
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: linear-gradient(180deg, rgba(17, 28, 47, 0.96), rgba(11, 18, 31, 0.96)), var(--bg-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    overflow-wrap: anywhere;
}

.progression-card strong {
    display: block;
    margin-bottom: var(--space-1);
}

.progression-card p {
    margin: 0;
    color: var(--muted);
}

.progression-step {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: var(--space-2);
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.1);
    border: 1px solid rgba(228, 191, 131, 0.22);
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: var(--space-2) 0;
}

.mini-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(228, 191, 131, 0.2);
    background: rgba(228, 191, 131, 0.08);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
}

.ordered-list {
    padding-left: 20px;
}

.practice-input {
    width: 100%;
    margin-top: var(--space-1);
    padding: 12px 16px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line-strong);
    background: rgba(7, 14, 24, 0.9);
    color: var(--text);
}

.practice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.ghost-button {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-1);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-soft);
    padding: 10px 14px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

.ghost-button:hover {
    color: var(--text);
    border-color: rgba(228, 191, 131, 0.32);
    background: rgba(228, 191, 131, 0.08);
}

.ghost-button:active {
    transform: translateY(1px);
}

.hint-stack {
    margin-top: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-1);
    border: 1px solid rgba(228, 191, 131, 0.2);
    background: rgba(228, 191, 131, 0.08);
}

.detail-badge-stack {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.detail-mini {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.workspace-card,
.chart-card {
    padding: var(--space-3);
}

.workspace-card p,
.assignment-card p,
.practice-card p,
.figure-card p,
.lesson-board p {
    margin-top: 0;
    margin-bottom: 8px;
}

.workspace-card p:last-child,
.assignment-card p:last-child,
.practice-card p:last-child,
.figure-card p:last-child,
.lesson-board p:last-child {
    margin-bottom: 0;
}

.stat-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 2rem;
}

.detail-list,
.assignment-list {
    margin: 0;
    padding-left: 18px;
}

.detail-list li,
.assignment-list li {
    margin-bottom: 4px;
}

.detail-list.tight li {
    margin-bottom: 6px;
}

.list-note {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.5;
}

.assignment-list strong,
.resource-links strong {
    display: block;
    color: var(--text);
}

.assignment-list small.book-companion {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    border-left: 3px solid rgba(228, 191, 131, 0.55);
    background: rgba(228, 191, 131, 0.08);
    border-radius: 6px;
    color: var(--text-soft, #d4dde9);
    line-height: 1.5;
}

.assignment-list small.book-companion strong {
    display: inline;
    color: rgba(228, 191, 131, 1);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.7rem;
    margin-right: 4px;
}

.assignment-list small.book-companion a {
    color: rgba(228, 191, 131, 1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.assignment-list small.book-companion a:hover {
    color: rgba(228, 191, 131, 1);
}

.adaptive-card,
.nested-card {
    padding: 20px;
}

.compact-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.alert-card {
    border: 1px solid rgba(228, 191, 131, 0.18);
    background: linear-gradient(180deg, rgba(16, 23, 36, 0.94), rgba(10, 15, 25, 0.9));
}

.alert-card.high {
    border-color: rgba(143, 58, 54, 0.32);
    box-shadow: inset 0 0 0 1px rgba(143, 58, 54, 0.08);
}

.support-text {
    color: var(--muted);
}

.action-button {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(228, 191, 131, 0.28);
    background: rgba(228, 191, 131, 0.14);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    touch-action: manipulation;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

.action-button:hover {
    border-color: rgba(228, 191, 131, 0.42);
    background: rgba(228, 191, 131, 0.2);
}

.action-button:active {
    transform: translateY(1px);
}

.button-pending {
    box-shadow: 0 0 0 3px rgba(228, 191, 131, 0.12);
}

button:disabled,
.ghost-button:disabled,
.action-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.action-button.done {
    border-color: rgba(170, 158, 96, 0.3);
    background: rgba(170, 158, 96, 0.14);
}

.notes-box,
.number-input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(13, 21, 33, 0.94);
    color: var(--text);
}

.notes-box {
    min-height: 140px;
    padding: 14px;
    resize: vertical;
}

.number-input {
    min-height: 46px;
    padding: 0 14px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.metric-grid .field {
    min-width: 0;
}

.roadmap-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
}

.week-page {
    padding: 24px;
}

.week-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.back-link,
.week-nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(13, 21, 33, 0.72);
    color: var(--text);
}

.week-nav-links {
    display: flex;
    gap: 10px;
}

.roadmap-rail,
.roadmap-detail {
    min-width: 0;
}

.section-title {
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title.compact {
    margin-bottom: 8px;
}

.week-list {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 130px);
    overflow: auto;
    padding-right: 4px;
}

.week-item {
    padding: 14px;
    text-align: left;
    display: grid;
    gap: 4px;
}

.week-item span,
.week-item small {
    color: inherit;
}

.week-item strong {
    color: var(--text);
    font-size: 0.98rem;
}

.detail-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    align-items: start;
    margin-top: var(--space-2);
}

.first-attempt-panel {
    margin-top: var(--space-2);
}

.phase-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(170, 158, 96, 0.28);
    background: rgba(170, 158, 96, 0.1);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.first-attempt-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
    gap: 12px;
    margin-top: 14px;
}

.first-attempt-brief,
.topic-readiness-card,
.maturity-check-card {
    padding: 16px;
    border: 1px solid rgba(92, 120, 150, 0.26);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.72);
}

.maturity-check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.topic-readiness-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.operating-protocol-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.operating-protocol-card {
    padding: 14px;
    border: 1px solid rgba(170, 158, 96, 0.2);
    border-radius: var(--radius-md);
    background: rgba(170, 158, 96, 0.07);
}

.operating-protocol-card strong {
    display: block;
    color: var(--text);
    line-height: 1.35;
}

.operating-protocol-card p:last-child {
    margin-top: 8px;
    font-size: 0.9rem;
}

.slot-ramp-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(228, 191, 131, 0.2);
    border-radius: var(--radius-md);
    background: rgba(228, 191, 131, 0.06);
}

.slot-ramp-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.slot-ramp-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(92, 120, 150, 0.26);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.72);
}

.slot-ramp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.slot-ramp-head span,
.slot-ramp-row span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.slot-ramp-head strong {
    color: var(--accent-warm);
    font-size: 0.9rem;
    white-space: nowrap;
}

.slot-ramp-row {
    display: grid;
    gap: 4px;
}

.slot-ramp-row p {
    margin: 0;
    color: var(--text);
    font-size: 0.84rem;
    line-height: 1.35;
}

.slot-ramp-rule {
    border-top: 1px solid var(--line);
    padding-top: 8px;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.problem-supply-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.problem-supply-card {
    padding: 10px 12px;
    border: 1px solid rgba(170, 158, 96, 0.18);
    border-radius: var(--radius-md);
    background: rgba(170, 158, 96, 0.07);
}

.problem-supply-card strong {
    display: block;
    color: var(--text);
    font-size: 0.82rem;
}

.problem-supply-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.topic-readiness-card {
    display: grid;
    gap: 10px;
}

.topic-readiness-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
}

.topic-readiness-head strong {
    color: var(--text);
}

.topic-readiness-head>span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.topic-meter {
    height: 8px;
    border-radius: 999px;
    background: rgba(38, 54, 79, 0.88);
    overflow: hidden;
}

.topic-meter span {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #a99e5e, #e4bf83);
}

.readiness-status-stable .topic-meter span,
.topic-meter span.readiness-status-stable {
    background: linear-gradient(90deg, #a99e5e, #a99e5e);
}

.readiness-status-building .topic-meter span,
.topic-meter span.readiness-status-building {
    background: linear-gradient(90deg, #e4bf83, #e4bf83);
}

.readiness-status-exposed .topic-meter span,
.topic-meter span.readiness-status-exposed {
    background: linear-gradient(90deg, #f2ae1c, #f7d56f);
}

.readiness-status-gap .topic-meter span,
.topic-meter span.readiness-status-gap {
    background: linear-gradient(90deg, #e05a2b, #ff8d63);
}

.maturity-check-card {
    display: grid;
    gap: 8px;
}

.maturity-check-card p {
    font-size: 0.9rem;
}

.benchmark-banner {
    margin-top: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(170, 158, 96, 0.24);
    background: rgba(170, 158, 96, 0.08);
}

.benchmark-banner span {
    display: block;
    margin-bottom: 6px;
    color: var(--green);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pacing-banner.high {
    border-color: rgba(143, 58, 54, 0.28);
    background: rgba(143, 58, 54, 0.09);
}

.pacing-banner.high span {
    color: #ff8d63;
}

.pacing-banner.medium {
    border-color: rgba(242, 174, 28, 0.28);
    background: rgba(242, 174, 28, 0.08);
}

.pacing-banner.medium span {
    color: var(--gold);
}

.pacing-banner.good {
    border-color: rgba(170, 158, 96, 0.24);
    background: rgba(170, 158, 96, 0.08);
}

.assignment-panel {
    margin-top: var(--space-2);
}

.assignment-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.assignment-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.75);
    overflow-wrap: anywhere;
}

.assignment-card .panel-label {
    margin-bottom: 6px;
}

.assignment-card>*+* {
    margin-top: 8px;
}

.repair-depth-bench {
    margin-top: 16px;
    border: 1px solid rgba(228, 191, 131, 0.26);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.04);
}

.repair-depth-bench summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 15px 17px;
    cursor: pointer;
    color: var(--text);
}

.repair-depth-bench summary small {
    color: var(--muted);
    text-align: right;
}

.repair-depth-rule {
    margin: 0 17px 14px;
    padding: 11px 13px;
    border-left: 3px solid rgba(228, 191, 131, 0.7);
    background: rgba(228, 191, 131, 0.07);
    color: var(--text-soft);
}

.repair-depth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 17px 17px;
}

.repair-depth-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 8px;
    background: rgba(8, 14, 24, 0.82);
    overflow-wrap: anywhere;
}

.repair-depth-card>* {
    margin: 0;
}

.repair-depth-card>*+* {
    margin-top: 8px;
}

@media (max-width: 720px) {
    .repair-depth-bench summary {
        flex-direction: column;
        align-items: flex-start;
    }
    .repair-depth-bench summary small {
        text-align: left;
    }
    .repair-depth-grid {
        grid-template-columns: 1fr;
    }
}

.week-workbench-panel {
    padding: 18px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(17, 27, 42, 0.92), rgba(8, 14, 24, 0.88)), var(--bg-panel);
}

.exact-week-prescription {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(170, 158, 96, 0.3);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(16, 32, 38, 0.82), rgba(8, 14, 24, 0.9));
}

.exact-tracker-link,
.exact-boundary {
    margin: 0;
    padding: 11px 13px;
    border-left: 3px solid rgba(170, 158, 96, 0.62);
    background: rgba(170, 158, 96, 0.08);
    color: var(--text-soft);
}

.weapon-ladder-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(242, 184, 75, 0.28);
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(39, 30, 12, 0.76), rgba(8, 14, 24, 0.82)),
        var(--bg-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.weapon-goal {
    margin: 0;
    color: var(--text-soft);
}

.next-gate-cta {
    position: sticky;
    top: 10px;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    margin: 2px 0;
    padding: 12px;
    border: 1px solid rgba(228, 191, 131, 0.3);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(7, 15, 27, 0.96), rgba(10, 18, 31, 0.94));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.next-gate-cta.complete {
    border-color: rgba(170, 158, 96, 0.36);
    background: linear-gradient(180deg, rgba(13, 35, 24, 0.96), rgba(9, 20, 20, 0.94));
}

.next-gate-cta strong,
.next-gate-cta small,
.next-gate-cta span {
    display: block;
}

.next-gate-cta strong {
    color: var(--text);
}

.next-gate-cta small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.38;
}

.next-gate-cta span {
    margin-top: 6px;
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 850;
}

.next-gate-cta .action-button {
    white-space: nowrap;
}

.weapon-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weapon-source-evidence {
    border: 1px solid rgba(120, 143, 171, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.42);
}

.weapon-source-evidence summary {
    cursor: pointer;
    padding: 10px 12px;
    color: var(--text);
    font-weight: 850;
}

.weapon-source-evidence ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0 14px 12px 30px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.toolkit-phase-line {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.toolkit-phase-line>div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(120, 143, 171, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.5);
}

.toolkit-phase-line>div.active {
    border-color: rgba(170, 158, 96, 0.34);
    background: rgba(170, 158, 96, 0.08);
}

.toolkit-phase-line span {
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.toolkit-phase-line strong {
    color: var(--text);
    font-size: 0.9rem;
}

.toolkit-phase-line small {
    color: var(--muted);
    line-height: 1.35;
}

.support-runway-card {
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid rgba(228, 191, 131, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(228, 191, 131, 0.07);
}

.depth-spine-card {
    display: grid;
    gap: 11px;
    padding: 13px;
    border: 1px solid rgba(245, 196, 94, 0.24);
    border-radius: var(--radius-sm);
    background: rgba(245, 196, 94, 0.07);
}

.depth-spine-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.depth-spine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 9px;
}

.depth-spine-grid>div {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(245, 196, 94, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.36);
}

.depth-spine-grid strong {
    color: var(--text);
    font-size: 0.88rem;
}

.depth-spine-grid span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.38;
}

.support-runway-card h4,
.support-runway-card p {
    margin: 0;
}

.support-runway-card h4 {
    color: var(--text);
    font-size: 1rem;
}

.support-runway-card p {
    color: var(--text-soft);
}

.support-runway-locks {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.technique-radar-card,
.trick-quota-card,
.media-prescription-card,
.accelerate-mode-card {
    display: grid;
    gap: 10px;
    padding: 13px;
    border: 1px solid rgba(120, 143, 171, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.48);
}

.technique-radar-card h4,
.trick-quota-card h4,
.media-prescription-card h4,
.accelerate-mode-card h4,
.accelerate-mode-card p {
    margin: 0;
}

.technique-radar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.technique-radar-grid span {
    padding: 6px 8px;
    border: 1px solid rgba(228, 191, 131, 0.22);
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.07);
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 750;
}

.trick-quota-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.trick-quota-card dl>div {
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border-left: 3px solid rgba(170, 158, 96, 0.45);
    background: rgba(170, 158, 96, 0.06);
}

.trick-quota-card dt {
    color: var(--mint);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.trick-quota-card dd {
    margin: 0;
    color: var(--text-soft);
}

.media-prescription-card ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 20px;
    color: var(--text-soft);
}

.accelerate-mode-card {
    border-color: rgba(242, 184, 75, 0.24);
    background: rgba(242, 184, 75, 0.07);
}

.accelerate-mode-card p {
    color: var(--text-soft);
    line-height: 1.45;
}

.scout-volume-card,
.collaboration-nudge-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(170, 158, 96, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(170, 158, 96, 0.07);
}

.scout-unlock-banner {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(242, 184, 75, 0.28);
    border-radius: var(--radius-sm);
    background: rgba(242, 184, 75, 0.09);
    color: var(--gold);
    font-weight: 800;
}

.scout-stage-list .weapon-gate {
    border-color: rgba(170, 158, 96, 0.2);
}

.collaboration-nudge-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.45;
}

.weapon-chip-row span {
    padding: 6px 9px;
    border: 1px solid rgba(242, 184, 75, 0.24);
    border-radius: 999px;
    background: rgba(242, 184, 75, 0.08);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
}

.weapon-stage-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: weapon-stage;
}

.weapon-stage-list li {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 12px 12px 12px 48px;
    border: 1px solid rgba(120, 143, 171, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.58);
    counter-increment: weapon-stage;
}

.weapon-stage-list li.locked-stretch-stage {
    border-color: rgba(242, 184, 75, 0.26);
    background: linear-gradient(180deg, rgba(242, 184, 75, 0.08), rgba(7, 12, 21, 0.58));
}

.weapon-lock-label {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(242, 184, 75, 0.12);
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* Interactive gated ladder: progress bar + pace toggle + gate states. */
.weapon-ladder-progress { margin: 4px 0 12px; }
.weapon-ladder-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(120, 143, 171, 0.18);
    overflow: hidden;
}
.weapon-ladder-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #a99e5e, #e4bf83);
    transition: width 0.35s ease;
}
.weapon-ladder-progress-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.82rem;
}
.ladder-pace-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--gold);
    font-weight: 700;
}
.gate-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.gate-row input { width: 16px; height: 16px; cursor: pointer; }
.weapon-gate.gate-done { border-color: rgba(170, 158, 96, 0.4); background: rgba(170, 158, 96, 0.06); }
.weapon-gate.gate-done .weapon-stage-label { color: #a99e5e; }
.weapon-gate.gate-current { border-color: rgba(228, 191, 131, 0.5); box-shadow: 0 0 0 1px rgba(228, 191, 131, 0.25) inset; }
.weapon-gate.gate-locked { opacity: 0.55; filter: grayscale(0.4); }
.weapon-gate.gate-locked .weapon-stage-label { color: #8aa0b8; }
.weapon-gate.gate-bonus { border-color: rgba(242, 184, 75, 0.32); }
.weapon-gate.gate-bonus.gate-locked { background: linear-gradient(180deg, rgba(242, 184, 75, 0.06), rgba(7, 12, 21, 0.58)); }
.gate-lock { font-size: 0.9rem; }
.gate-locked-note { color: var(--gold); font-weight: 700; }
.gate-unlocked-cue { color: #a99e5e; font-weight: 700; }
.weapon-ladder-next, .weapon-ladder-complete {
    margin: 12px 0 0;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.weapon-ladder-next { background: rgba(228, 191, 131, 0.08); border: 1px solid rgba(228, 191, 131, 0.25); }
.weapon-ladder-complete { background: rgba(170, 158, 96, 0.1); border: 1px solid rgba(170, 158, 96, 0.35); color: #a99e5e; font-weight: 700; }

.weapon-stage-list li::before {
    content: counter(weapon-stage);
    position: absolute;
    left: 12px;
    top: 12px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(242, 184, 75, 0.18);
    color: var(--gold);
    font-weight: 900;
    font-size: 0.76rem;
}

.weapon-stage-label {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(170, 158, 96, 0.11);
    color: var(--mint);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.weapon-stage-list strong {
    color: var(--text);
    line-height: 1.4;
}

.weapon-stage-list small {
    color: var(--muted);
    line-height: 1.35;
}

.weapon-stage-list a {
    color: var(--gold);
    font-weight: 800;
}

@media (max-width: 920px) {
    .toolkit-phase-line {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .toolkit-phase-line {
        grid-template-columns: 1fr;
    }
}

.exact-prescription-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 0.9fr);
    gap: 14px;
}

.exact-prescription-main,
.exact-prescription-side {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.17);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.58);
}

.exact-prescription-side {
    display: grid;
    gap: 14px;
}

.assigned-lecture-list {
    display: grid;
    gap: 12px;
    margin: 12px 0 0;
    padding-left: 22px;
}

.assigned-lecture-list li {
    padding-left: 4px;
}

.assigned-lecture-list span,
.assigned-lecture-list small {
    display: block;
    color: var(--muted);
}

.assigned-lecture-list span {
    margin-bottom: 4px;
    color: var(--gold);
    font-size: 0.79rem;
    font-weight: 700;
    text-transform: uppercase;
}

.assigned-lecture-list a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(228, 191, 131, 0.48);
    text-underline-offset: 3px;
}

.assigned-lecture-list small {
    margin-top: 5px;
}

.no-lecture-rule {
    margin: 10px 0 0;
    color: var(--text-soft);
}

.exact-day-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.exact-day-strip span {
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid rgba(120, 143, 171, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(13, 21, 33, 0.62);
    color: var(--text-soft);
    font-size: 0.9rem;
}

.week-secondary-fold {
    margin-top: 14px;
    border: 1px solid rgba(120, 143, 171, 0.17);
    border-radius: var(--radius-md);
    background: rgba(7, 12, 21, 0.42);
}

.week-secondary-fold>summary {
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text-soft);
    font-weight: 700;
}

.week-secondary-fold[open]>summary {
    border-bottom: 1px solid rgba(120, 143, 171, 0.16);
}

.week-secondary-fold .week-workbench-panel {
    margin: 14px;
}

.weapon-ladder-howto {
    margin: 10px 0 14px;
    padding: 10px 13px;
    border-left: 3px solid var(--accent, #e4bf83);
    background: rgba(228, 191, 131, 0.08);
    border-radius: 0 8px 8px 0;
    font-size: 0.86rem;
}

.weapon-ladder-complete {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(170, 158, 96, 0.4);
    border-radius: 12px;
    background: rgba(170, 158, 96, 0.1);
}

.weapon-ladder-complete .action-button {
    margin-top: 8px;
    display: inline-block;
}

/* Fix: closed <details> must actually collapse. Author display rules on inner
   cards (depth-spine, technique-radar, etc.) were overriding the browser's
   native collapse, so every fold on the site showed its content even when
   closed. This restores real folding sitewide. */
details:not([open]) > *:not(summary) {
    display: none !important;
}

.progress-fold .week-progress-board,
.week-audit-fold .week-workbench-panel {
    margin: 14px;
}

.action-home {
    max-width: 1120px;
    gap: 16px;
}

.action-home-hero,
.home-deadline-desk,
.shared-deadline-board,
.home-library-rule {
    padding: 22px;
}

.action-home-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
}

.action-home-heading h2 {
    margin: 0 0 8px;
    font: 700 1.7rem/1.2 "Manrope", "Segoe UI", sans-serif;
}

.action-home-heading p:last-child {
    max-width: 650px;
    margin: 0;
}

.action-deadline {
    display: grid;
    gap: 3px;
    flex: 0 0 138px;
    padding: 12px 14px;
    border: 1px solid rgba(170, 158, 96, 0.28);
    border-radius: 8px;
    background: rgba(170, 158, 96, 0.08);
}

.action-deadline span,
.action-deadline small {
    color: var(--muted);
    font-size: 0.8rem;
}

.action-deadline strong {
    color: var(--success);
    font-size: 1.24rem;
}

.home-primary-actions,
.focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-primary-actions {
    margin-top: 18px;
}

.momentum-strip {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr) 120px minmax(200px, 1.25fr);
    gap: 12px;
    align-items: center;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid rgba(228, 191, 131, 0.26);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.06);
}

.momentum-level strong {
    display: block;
    color: var(--accent-warm);
    font: 700 1.08rem/1.3 "Manrope", "Segoe UI", sans-serif;
}

.momentum-level small,
.momentum-meter-block p,
.momentum-streak span {
    display: block;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.momentum-meter {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.14);
}

.momentum-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-warm);
}

.momentum-streak {
    text-align: center;
}

.momentum-streak strong {
    display: block;
    color: var(--success);
    font-size: 1.22rem;
}

.momentum-streak em {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(170, 158, 96, 0.14);
    color: var(--success);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 700;
}

.momentum-mission {
    padding-left: 12px;
    border-left: 1px solid rgba(228, 191, 131, 0.2);
}

.momentum-mission strong {
    font-size: 0.92rem;
    line-height: 1.35;
}

/* Mastery Receipts (competence feedback — auto-derived from real attempts) */
.momentum-receipts {
    padding-left: 12px;
    border-left: 1px solid rgba(228, 191, 131, 0.2);
}
.momentum-receipts strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.35;
    color: var(--gold, #e4bf83);
}
.momentum-receipts small {
    color: var(--text-soft);
}

.focus-starter {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    padding: 18px;
    border: 1px solid rgba(228, 191, 131, 0.28);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.07);
}

.focus-starter.compact {
    margin-top: 14px;
}

.focus-starter.focus-running {
    border-color: rgba(170, 158, 96, 0.36);
    background: rgba(170, 158, 96, 0.08);
}

.focus-starter.complete {
    border-color: rgba(228, 191, 131, 0.4);
    background: rgba(228, 191, 131, 0.08);
}

.focus-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.focus-header h3 {
    margin: 0;
    font: 700 1.16rem/1.35 "Manrope", "Segoe UI", sans-serif;
}

.focus-clock {
    min-width: 102px;
    padding: 9px 12px;
    border: 1px solid rgba(170, 158, 96, 0.34);
    border-radius: 8px;
    color: var(--success);
    font: 700 1.4rem/1 "Manrope", "Segoe UI", sans-serif;
    text-align: center;
}

.focus-streak {
    padding: 7px 10px;
    border: 1px solid rgba(170, 158, 96, 0.25);
    border-radius: 8px;
    color: var(--success);
    font-size: 0.86rem;
    font-weight: 700;
}

.focus-intention,
.focus-commitment,
.focus-nudge {
    margin: 0;
}

.focus-intention {
    padding: 11px 13px;
    border-left: 3px solid var(--accent);
    background: rgba(7, 12, 21, 0.46);
    color: var(--text-soft);
}

.focus-pledge {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--text-soft);
    font-weight: 600;
    cursor: pointer;
}

/* Sealed Docket (engagement: implementation-intention pre-load) */
.focus-docket-sealed {
    color: var(--gold, #e4bf83);
    font-weight: 700;
}
.focus-docket-seal {
    display: block;
    margin: 8px 0 4px;
}
.focus-docket-seal .panel-label {
    margin-bottom: 4px;
}
.focus-docket-seal input {
    width: 100%;
}

/* Proof Relic Cabinet (durable collection — read-only) */
.relic-cabinet {
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 10px;
    background: rgba(228, 191, 131, 0.04);
}
.relic-cabinet summary {
    cursor: pointer;
    color: var(--text-soft);
}
.relic-cabinet summary strong {
    color: var(--gold, #e4bf83);
}
.relic-shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 10px;
}
.relic-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: #1c130a;
    background: var(--gold, #e4bf83);
}

/* Reps per-problem tracking + Full-Set Consecration (engagement #3) */
.reps-meter {
    height: 6px;
    border-radius: 4px;
    background: rgba(228, 191, 131, 0.16);
    overflow: hidden;
    margin: 4px 0 10px;
}
.reps-meter span {
    display: block;
    height: 100%;
    background: var(--gold, #e4bf83);
    transition: width 0.3s ease;
}
.reps-list .reps-item {
    list-style: none;
}
.reps-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
}
.reps-check input {
    margin-top: 3px;
    accent-color: var(--gold, #e4bf83);
}
.reps-item.done {
    opacity: 0.62;
}
.reps-writeup {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    cursor: pointer;
    font-weight: 600;
}
.reps-progress.consecrated {
    border-left: 2px solid var(--gold, #e4bf83);
    padding-left: 12px;
}
.reps-consecration {
    margin-top: 8px;
    color: var(--gold, #e4bf83);
    font-weight: 700;
}

/* Stuckness Ledger + Autopsy (Zeigarnik open-loop / error->prestige) */
.stuck-ledger {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline, rgba(228, 191, 131, 0.18));
}
.stuck-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.stuck-thread {
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(110, 43, 43, 0.10);
}
.stuck-thread .stuck-note {
    margin: 0;
}
.stuck-thread input {
    width: 100%;
}

.focus-pledge input {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
}

.focus-nudge,
.focus-commitment {
    color: var(--muted);
    font-size: 0.92rem;
}

.home-next-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.home-action-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 21, 33, 0.75);
}

.home-action-card strong {
    display: block;
    color: var(--text);
    line-height: 1.38;
}

.home-action-card p:last-child {
    margin: 9px 0 0;
    color: var(--muted);
}

.home-deadline-desk .section-title {
    align-items: center;
}

.shared-deadline-board .section-title {
    align-items: center;
}

.shared-deadline-list {
    display: grid;
    gap: 8px;
    margin-top: 15px;
}

.shared-deadline-row {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 21, 33, 0.65);
    color: var(--text-soft);
}

.shared-deadline-row.current {
    display: grid;
    grid-template-columns: 102px minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
    border-color: rgba(228, 191, 131, 0.3);
    background: rgba(228, 191, 131, 0.07);
}

.shared-deadline-row.bridge,
.shared-deadline-row.tracker-event {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    cursor: pointer;
}

.shared-deadline-row input {
    width: 17px;
    height: 17px;
    margin-top: 4px;
    accent-color: var(--success);
}

.shared-deadline-row span strong,
.shared-deadline-row.current strong {
    display: block;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.35;
}

.shared-deadline-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.shared-deadline-row.done {
    border-color: rgba(170, 158, 96, 0.25);
    background: rgba(170, 158, 96, 0.06);
}

.shared-deadline-row.done strong {
    text-decoration: line-through;
    opacity: 0.7;
}

.shared-deadline-tag {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
}

.shared-deadline-row.current .shared-deadline-tag {
    margin: 0;
}

.shared-week-queue {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.shared-week-queue a {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-soft);
}

.shared-week-queue a.current {
    border-color: rgba(228, 191, 131, 0.3);
}

.shared-week-queue span,
.shared-week-queue small {
    color: var(--muted);
    font-size: 0.8rem;
}

.self-study-alignment {
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(228, 191, 131, 0.24);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.06);
}

.self-study-alignment p,
.self-study-alignment strong {
    margin: 0 0 5px;
    display: block;
}

.home-deadline-list {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.home-deadline-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 78px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-soft);
}

.home-deadline-row.current {
    border-color: rgba(228, 191, 131, 0.3);
    background: rgba(228, 191, 131, 0.07);
}

.home-deadline-row span,
.home-deadline-row small {
    color: var(--muted);
}

.home-library-rule p {
    margin: 0;
}

.roadmap-index {
    max-width: 1120px;
    gap: 16px;
}

.roadmap-index-hero,
.roadmap-week-directory {
    padding: 22px;
}

.roadmap-index-hero h2 {
    margin: 0 0 8px;
    font: 700 1.7rem/1.2 "Manrope", "Segoe UI", sans-serif;
}

.roadmap-index-hero>p:not(.eyebrow) {
    max-width: 720px;
    margin: 0;
}

.roadmap-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid rgba(170, 158, 96, 0.25);
    border-radius: 8px;
    background: rgba(170, 158, 96, 0.07);
}

.roadmap-current strong {
    display: block;
    margin-bottom: 5px;
}

.roadmap-current p {
    margin: 0;
}

.roadmap-week-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.roadmap-week-card {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-soft);
    background: rgba(13, 21, 33, 0.62);
}

.roadmap-week-card span,
.roadmap-week-card small {
    color: var(--muted);
    font-size: 0.84rem;
}

.roadmap-week-card.current {
    border-color: rgba(228, 191, 131, 0.32);
    background: rgba(228, 191, 131, 0.08);
}

.roadmap-week-card.done {
    border-color: rgba(170, 158, 96, 0.26);
}

.compact-week-panel {
    display: grid;
    gap: 14px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 8px;
    background: rgba(7, 12, 21, 0.46);
}

.battle-launch-panel {
    gap: 16px;
    border-color: rgba(228, 191, 131, 0.3);
    background: linear-gradient(135deg, rgba(228, 191, 131, 0.09), rgba(7, 12, 21, 0.6) 46%);
}

.battle-launch-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
}

.battle-launch-head h3 {
    margin: 0 0 6px;
    font: 700 1.28rem/1.28 "Manrope", "Segoe UI", sans-serif;
}

.battle-launch-head p:last-child {
    max-width: 640px;
    margin: 0;
    color: var(--text-soft);
}

.battle-reward {
    display: grid;
    gap: 3px;
    flex: 0 0 124px;
    padding: 10px 12px;
    border: 1px solid rgba(228, 191, 131, 0.3);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.08);
    text-align: right;
}

.battle-reward span,
.battle-reward small {
    color: var(--muted);
    font-size: 0.76rem;
}

.battle-reward strong {
    color: var(--accent-warm);
    font: 700 1.3rem/1.1 "Manrope", "Segoe UI", sans-serif;
}

.week-task-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.week-task-chips span {
    display: flex;
    gap: 7px;
    align-items: baseline;
    padding: 6px 10px;
    border: 1px solid rgba(120, 143, 171, 0.22);
    border-radius: 5px;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.week-task-chips strong {
    color: var(--accent-warm);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.battle-route {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.battle-route article {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(120, 143, 171, 0.18);
    border-radius: 8px;
    background: rgba(13, 21, 33, 0.72);
}

.battle-route article>span {
    color: var(--accent-warm);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.battle-route strong,
.battle-target-link {
    color: var(--text);
    font-weight: 700;
    line-height: 1.4;
}

.battle-target-link {
    text-decoration: underline;
    text-decoration-color: rgba(228, 191, 131, 0.5);
    text-underline-offset: 3px;
}

.battle-route small {
    color: var(--muted);
    line-height: 1.38;
}

.battle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.battle-pledge {
    margin-top: 2px;
}

.battle-rule {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid var(--accent-warm);
    background: rgba(7, 12, 21, 0.42);
    color: var(--text-soft);
}

.assigned-schedule-fold>.exact-week-prescription {
    margin: 14px;
}

.post-attempt-watch span {
    color: var(--accent-warm);
}

.compact-week-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.compact-week-grid article {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 21, 33, 0.7);
}

.compact-week-grid article strong,
.compact-week-grid article p {
    margin: 0;
    display: block;
}

.compact-task-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 22px;
    color: var(--text-soft);
}

.compact-task-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.inline-problem-link {
    display: inline;
    color: var(--accent);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.inline-problem-link:hover,
.inline-problem-link:focus-visible {
    color: var(--accent-warm);
}

.inline-bank-link {
    margin-left: 6px;
    padding: 2px 7px;
    border: 1px solid rgba(228, 191, 131, 0.28);
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.inline-bank-link:hover,
.inline-bank-link:focus-visible {
    border-color: rgba(255, 203, 120, 0.42);
    color: var(--accent-warm);
}

.inline-solve-link {
    margin-left: 6px;
    padding: 2px 8px;
    border: 1px solid rgba(170, 158, 96, 0.34);
    border-radius: 999px;
    background: rgba(170, 158, 96, 0.1);
    color: var(--success, #7cf0b2);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.inline-solve-link:hover,
.inline-solve-link:focus-visible {
    border-color: rgba(170, 158, 96, 0.6);
    background: rgba(170, 158, 96, 0.18);
}

.roadmap-problem-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.roadmap-problem-refs .inline-solve-link {
    margin-left: 0;
    text-transform: none;
}

.weapon-seminar-ref {
    margin: 4px 0 10px;
    font-size: 0.84rem;
    padding: 6px 10px;
    border-left: 3px solid rgba(228, 191, 131, 0.5);
    background: rgba(228, 191, 131, 0.07);
    border-radius: 0 8px 8px 0;
}

.weapon-enrichment {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(170, 158, 96, 0.28);
    border-radius: 12px;
    background: rgba(170, 158, 96, 0.06);
}

.weapon-enrichment.is-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.75;
}

.weapon-enrichment.is-locked p {
    margin: 0;
    font-size: 0.85rem;
}

.weapon-enrichment-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.weapon-enrichment-head span {
    font-size: 0.8rem;
    opacity: 0.78;
}

.weapon-enrichment-list {
    margin: 0 0 10px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weapon-enrichment-list small {
    margin-left: 6px;
    opacity: 0.6;
    font-size: 0.72rem;
}

.weapon-enrichment-more {
    padding: 6px 12px;
    border: 1px solid rgba(170, 158, 96, 0.4);
    border-radius: 999px;
    background: rgba(170, 158, 96, 0.12);
    color: var(--success, #7cf0b2);
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
}

.weapon-enrichment-more:hover,
.weapon-enrichment-more:focus-visible {
    background: rgba(170, 158, 96, 0.2);
}

.archive-handoff-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.compact-guidance {
    margin: 0;
    color: var(--muted);
}

.week-close-row {
    display: grid;
    grid-template-columns: max-content minmax(260px, 1fr);
    align-items: start;
    gap: 10px;
}

.verification-mini-gate {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 203, 120, 0.26);
    border-radius: 8px;
    background: rgba(255, 203, 120, 0.07);
}

.verification-mini-gate.complete {
    border-color: rgba(170, 158, 96, 0.34);
    background: rgba(170, 158, 96, 0.07);
}

.verification-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.verification-field textarea {
    min-height: 82px;
    resize: vertical;
}

.weekly-unlock-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 12px 0;
}

.unlock-step {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 21, 33, 0.72);
}

.unlock-step span,
.unlock-step small {
    display: block;
    color: var(--muted);
}

.unlock-step strong {
    display: block;
    margin: 4px 0;
    color: var(--text);
}

.unlock-step.unlocked {
    border-color: rgba(170, 158, 96, 0.32);
}

.unlock-step.locked {
    opacity: 0.72;
}

.week-progress-board {
    display: grid;
    gap: 13px;
}

.week-progress-heading {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: start;
}

.week-progress-heading h3,
.week-progress-heading p {
    margin: 0;
}

.week-progress-heading>strong {
    color: var(--success);
    font: 700 1.3rem/1 "Manrope", "Segoe UI", sans-serif;
}

.week-progress-meter {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(170, 158, 96, 0.13);
}

.week-progress-meter span {
    display: block;
    height: 100%;
    background: var(--success);
}

.week-progress-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.week-progress-phase {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 21, 33, 0.62);
}

.week-progress-item {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0;
    color: var(--text-soft);
    cursor: pointer;
}

.week-progress-item+.week-progress-item {
    border-top: 1px solid rgba(120, 143, 171, 0.14);
}

.week-progress-item input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: var(--success);
}

.week-progress-item strong,
.week-progress-item small {
    display: block;
    line-height: 1.35;
}

.week-progress-item strong {
    font-size: 0.86rem;
}

.week-progress-item small {
    margin-top: 3px;
    color: var(--muted);
}

.week-progress-item.done strong {
    color: var(--success);
}

.assigned-watch-sequence {
    border-left: 3px solid var(--success);
}

.assigned-watch-sequence p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.week-detail-vault {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 12, 21, 0.35);
}

.week-detail-vault>summary {
    padding: 13px 15px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.week-detail-vault[open]>summary {
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
}

.week-detail-vault-body {
    padding: 14px;
}

.week-workbench-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.week-summary-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.66);
}

.week-summary-card p {
    margin: 0;
}

.week-summary-card p+p {
    margin-top: 7px;
}

.week-adaptive-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.9fr);
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(170, 158, 96, 0.24);
    border-radius: var(--radius-md);
    background: rgba(170, 158, 96, 0.08);
}

.week-adaptive-strip.medium {
    border-color: rgba(242, 174, 28, 0.28);
    background: rgba(242, 174, 28, 0.08);
}

.week-adaptive-strip.high {
    border-color: rgba(143, 58, 54, 0.28);
    background: rgba(143, 58, 54, 0.09);
}

.week-adaptive-strip p {
    margin: 0;
}

.week-snapshot-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.week-snapshot-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.54);
}

.week-snapshot-card.benchmark {
    border-color: rgba(170, 158, 96, 0.24);
    background: rgba(170, 158, 96, 0.08);
}

.week-snapshot-card p {
    margin: 0;
}

.week-snapshot-card ul {
    margin: 0;
}

.week-execution-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 14px;
    align-items: start;
    margin-top: 14px;
}

.week-step-panel {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.16);
    border-radius: var(--radius-md);
    background: rgba(7, 12, 21, 0.46);
}

.week-step-panel .week-step-list {
    max-height: min(70vh, 680px);
}

.week-step-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    max-height: min(62vh, 560px);
    overflow: auto;
    padding-right: 6px;
}

.week-step-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.2);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.74);
}

.week-step-card.done {
    border-color: rgba(170, 158, 96, 0.34);
    background: rgba(170, 158, 96, 0.08);
}

.week-step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(228, 191, 131, 0.28);
    background: rgba(228, 191, 131, 0.12);
    color: var(--text);
    font-weight: 800;
}

.week-step-body {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.week-step-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.week-step-kind,
.week-step-jump {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.week-step-kind {
    border: 1px solid rgba(255, 201, 106, 0.26);
    background: rgba(255, 201, 106, 0.1);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.week-step-jump {
    border: 1px solid rgba(120, 143, 171, 0.22);
    background: rgba(7, 12, 21, 0.7);
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.week-step-card h4,
.week-step-card p {
    margin: 0;
}

.week-step-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(120, 143, 171, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.5);
}

.compact-check {
    margin-top: 0;
    padding: 10px;
}

.week-depth-grid {
    margin-top: 12px;
}

.week-assigned-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.16);
    border-radius: var(--radius-md);
    background: rgba(7, 12, 21, 0.46);
}

.week-execution-grid .week-assigned-panel {
    margin-top: 0;
    max-height: min(70vh, 680px);
    overflow: auto;
}

.week-execution-grid .week-assigned-grid {
    grid-template-columns: 1fr;
}

.week-assigned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.week-assigned-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(120, 143, 171, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(13, 21, 33, 0.72);
}

.week-assigned-card p {
    margin: 0;
}

.week-assigned-card.depth-card {
    border-color: rgba(170, 158, 96, 0.24);
    background: rgba(170, 158, 96, 0.08);
}

.week-assigned-card.volume-card {
    border-color: rgba(245, 181, 89, 0.34);
    background: linear-gradient(180deg, rgba(245, 181, 89, 0.13), rgba(13, 21, 33, 0.76));
}

.week-alignment-block+.week-alignment-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(120, 143, 171, 0.16);
}

.compact-scroll-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.stage-card {
    border-color: rgba(120, 143, 171, 0.24);
    background: linear-gradient(180deg, rgba(16, 24, 37, 0.94), rgba(10, 15, 24, 0.92));
}

.stage-foundation {
    border-color: rgba(228, 191, 131, 0.28);
}

.stage-bridge {
    border-color: rgba(170, 158, 96, 0.28);
}

.stage-putnam-core {
    border-color: rgba(255, 201, 106, 0.28);
}

.stage-stretch,
.stage-mock {
    border-color: rgba(143, 58, 54, 0.22);
}

.stage-card-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    align-items: start;
}

.stage-chip {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-2);
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(120, 143, 171, 0.24);
    background: rgba(8, 16, 28, 0.88);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stage-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(120, 143, 171, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.72);
}

.stage-meta-grid p {
    margin: 0;
}

.assignment-meta-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.homework-grid {
    display: grid;
    gap: 12px;
}

.homework-card {
    display: grid;
    gap: 10px;
}

.bank-card {
    border-color: rgba(228, 191, 131, 0.18);
    background: linear-gradient(180deg, rgba(17, 27, 42, 0.94), rgba(10, 15, 24, 0.92));
}

.bank-meta-grid,
.repair-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(120, 143, 171, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(7, 12, 21, 0.7);
}

.bank-meta-grid p,
.repair-meta-grid p {
    margin: 0;
}

.problem-set-shell {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.problem-set-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(228, 191, 131, 0.22);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(19, 34, 54, 0.95), rgba(8, 16, 28, 0.92));
}

.problem-set-summary strong {
    display: block;
    margin-top: 4px;
    font-size: 1.1rem;
}

.problem-summary-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(228, 191, 131, 0.16);
    background: linear-gradient(180deg, rgba(16, 24, 37, 0.9), rgba(10, 15, 24, 0.88));
}

.problem-summary-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.2rem;
}

.toggle-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.problem-set-summary-meta,
.problem-card,
.problem-card-tags,
.practice-choice-stack {
    display: grid;
}

.problem-set-summary-meta {
    gap: 8px;
    justify-items: end;
}

.problem-card {
    gap: 12px;
}

.problem-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.problem-card-tags {
    gap: 8px;
    justify-items: end;
}

.problem-card-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(120, 143, 171, 0.22);
    border-radius: 14px;
    background: rgba(9, 15, 24, 0.88);
    color: var(--muted);
    font-size: 0.84rem;
}

.practice-choice-stack {
    gap: 10px;
}

.homework-box {
    min-height: 150px;
}

.recall-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.recall-card {
    padding: 16px;
    border: 1px solid rgba(228, 191, 131, 0.22);
    border-radius: var(--radius-md);
    background: rgba(15, 30, 50, 0.74);
    display: grid;
    gap: 8px;
}

.recall-day {
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checklist-grid,
.playbook-grid,
.task-queue {
    display: grid;
    gap: 14px;
}

.task-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.72);
}

.task-card strong {
    display: block;
    margin-bottom: 6px;
}

.mastery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mastery-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mastery-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.72);
}

.mastery-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.mastery-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.16);
    border: 1px solid rgba(228, 191, 131, 0.28);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
}

.mastery-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(38, 54, 79, 0.9);
    overflow: hidden;
    margin-bottom: 10px;
}

.mastery-bar.large {
    height: 16px;
}

.mastery-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #a99e5e, #e4bf83);
}

.mastery-focus {
    margin: 20px 0 0;
}

.practice-stack {
    display: grid;
    gap: 18px;
}

.ramp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ramp-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(92, 120, 150, 0.28);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(19, 29, 43, 0.94), rgba(10, 18, 29, 0.88)), radial-gradient(circle at top right, rgba(228, 191, 131, 0.12), transparent 42%);
}

.ramp-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.track-group-stack,
.track-group {
    display: grid;
    gap: 10px;
}

.track-group-label {
    margin: 8px 0 0;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.practice-section {
    display: grid;
    gap: 12px;
}

.practice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.lesson-board-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.figure-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.lesson-board {
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: radial-gradient(circle at top right, rgba(228, 191, 131, 0.08), transparent 24%), linear-gradient(180deg, rgba(16, 27, 44, 0.96), rgba(10, 18, 31, 0.96)), var(--bg-panel);
}

.lesson-board>p {
    margin-top: 0;
}

.lesson-board-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: var(--space-2);
    align-items: start;
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    border-top: 1px solid rgba(168, 186, 214, 0.08);
}

.lesson-board-row p {
    margin: 0;
    color: var(--text-soft);
}

.lesson-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lesson-token.cue {
    background: rgba(228, 191, 131, 0.14);
    color: #b9d3ff;
}

.lesson-token.move {
    background: rgba(170, 158, 96, 0.14);
    color: #b9e8d7;
}

.lesson-token.trap {
    background: rgba(228, 191, 131, 0.14);
    color: #f1d8ab;
}

.lesson-token.repair {
    background: rgba(152, 166, 186, 0.14);
    color: #d9e1ee;
}

.figure-card {
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: radial-gradient(circle at top right, rgba(228, 191, 131, 0.08), transparent 20%), linear-gradient(180deg, rgba(15, 24, 39, 0.96), rgba(9, 15, 26, 0.96)), var(--bg-panel);
}

.concept-figure {
    margin: var(--space-2) 0;
    padding: var(--space-1);
    border-radius: var(--radius-1);
    border: 1px solid rgba(168, 186, 214, 0.1);
    background: rgba(6, 11, 19, 0.72);
}

.concept-figure-svg {
    display: block;
    width: 100%;
    height: auto;
}

.practice-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.75);
    overflow-wrap: anywhere;
}

.practice-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.practice-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: end;
}

.practice-tier,
.practice-difficulty {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(13, 21, 33, 0.9);
    border: 1px solid var(--line);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 700;
}

.practice-tier {
    color: var(--blue);
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.status-chip {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(8, 16, 26, 0.92);
    color: var(--muted);
}

.status-chip.active {
    background: linear-gradient(135deg, rgba(228, 191, 131, 0.18), rgba(228, 191, 131, 0.26));
    border-color: rgba(228, 191, 131, 0.32);
    color: var(--text);
}

.practice-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.section-count {
    color: var(--muted);
    font-size: 0.82rem;
}

.hint-panel {
    display: grid;
    gap: 8px;
}

.hint-copy {
    padding: 12px;
    border-radius: 12px;
    background: rgba(228, 191, 131, 0.08);
    border: 1px solid rgba(228, 191, 131, 0.2);
    color: var(--text);
}

.resource-inline-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}

.resource-inline-link:hover {
    text-decoration: underline;
}

.check-quiz {
    display: grid;
    gap: 14px;
}

.quiz-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.78);
}

.quiz-prompt {
    margin-top: 0;
    color: var(--text);
}

.quiz-options {
    display: grid;
    gap: 10px;
}

.quiz-option {
    display: flex;
    gap: 10px;
    align-items: start;
    color: var(--muted);
}

.quiz-feedback {
    margin-bottom: 0;
    margin-top: 12px;
}

.quiz-feedback.correct {
    color: var(--green);
}

.quiz-feedback.wrong {
    color: var(--gold);
}

.check-item,
.triage-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(13, 21, 33, 0.72);
}

.check-item {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    cursor: pointer;
}

.check-item input {
    margin-top: 3px;
}

.check-item span,
.triage-card p {
    display: grid;
    gap: 6px;
}

.check-item small,
.triage-card code,
.inline-label {
    color: var(--muted);
}

.check-item.done {
    border-color: rgba(170, 158, 96, 0.3);
    background: rgba(170, 158, 96, 0.08);
}

.triage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.triage-column,
.triage-stack {
    display: grid;
    gap: 12px;
}

.triage-card code {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(8, 16, 26, 0.92);
    overflow-wrap: anywhere;
}

.shelf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shelf-copy {
    margin-top: 0;
    margin-bottom: 16px;
}

.resource-links {
    display: grid;
    gap: 12px;
}

.resource-links a {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.resource-links a:first-child {
    padding-top: 0;
    border-top: 0;
}

.resource-links a:hover strong {
    color: var(--blue);
}

.control-row {
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.field {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.field span {
    color: var(--muted);
    font-size: 0.84rem;
}

select {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(13, 21, 33, 0.94);
    color: var(--text);
}

.toggle-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle-row button {
    min-height: 44px;
    padding: 0 14px;
}

.chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card svg {
    width: 100%;
    height: 320px;
}

.donut-wrap {
    display: grid;
    place-items: center;
    padding: 8px 0 20px;
}

.donut-chart {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    position: relative;
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 58px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line);
}

.legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.bar-chart {
    display: grid;
    gap: 12px;
}

.bar-row {
    display: grid;
    gap: 6px;
}

.bar-label {
    color: var(--muted);
    font-size: 0.94rem;
}

.bar-track {
    position: relative;
    height: 24px;
    border-radius: 999px;
    background: rgba(38, 54, 79, 0.9);
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.bar-value {
    color: var(--muted);
    font-size: 0.88rem;
    text-align: right;
}

.subgenre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subgenre-card {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.subgenre-head {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.subgenre-title {
    align-items: center;
    gap: 10px;
}

.subgenre-list {
    display: grid;
    gap: 12px;
}

.subgenre-row {
    display: grid;
    grid-template-columns: 180px 1fr 28px;
    gap: 12px;
    align-items: center;
}

.track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(38, 54, 79, 0.9);
    overflow: hidden;
}

.fill {
    height: 100%;
    border-radius: inherit;
}

.hero-product {
    position: relative;
    overflow: hidden;
}

.hero-product::after {
    content: "";
    position: absolute;
    inset: auto -80px -80px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(228, 191, 131, 0.18), transparent 68%);
    pointer-events: none;
}

.proof-box {
    min-height: 180px;
}

.proof-box.compact {
    min-height: 110px;
}

.locked-card {
    opacity: 0.62;
}

.proof-steps-grid {
    display: grid;
    gap: 12px;
    margin: 14px 0;
}

.proof-step-card {
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 16px;
    padding: 14px;
    background: rgba(10, 16, 27, 0.62);
}

.repair-panel {
    border: 1px solid rgba(255, 201, 106, 0.22);
    background: linear-gradient(180deg, rgba(36, 28, 14, 0.45), rgba(17, 17, 18, 0.62));
}

.proof-focus-banner {
    padding: var(--space-2);
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(13, 22, 35, 0.72);
}

.proof-focus-banner p {
    margin: 0;
}

.mock-card {
    border: 1px solid rgba(228, 191, 131, 0.16);
}

.rubric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.rubric-item {
    display: grid;
    gap: 6px;
}

.rubric-item span {
    color: var(--muted);
    text-transform: capitalize;
    font-size: 0.9rem;
}

.media-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.media-tier-section {
    display: grid;
    gap: var(--space-2);
    min-width: 0;
}

.exact-media-rule {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(170, 158, 96, 0.3);
    border-radius: var(--radius-md);
    background: rgba(170, 158, 96, 0.08);
}

.exact-media-rule h3,
.exact-media-rule p {
    margin: 0;
}

.exact-media-rule .eyebrow {
    margin-bottom: 4px;
}

.exact-media-rule .action-button {
    flex: 0 0 auto;
}

.media-tier-heading {
    margin-top: var(--space-2);
}

.media-card,
.proof-card {
    background: linear-gradient(180deg, rgba(19, 25, 38, 0.9), rgba(10, 14, 23, 0.9));
}

.hidden {
    display: none;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1180px) {
    .workspace-shell,
    .roadmap-layout,
    .stat-grid,
    .shelf-grid,
    .mastery-grid,
    .triage-grid,
    .chart-grid,
    .subgenre-grid,
    .detail-columns,
    .first-attempt-grid,
    .maturity-check-grid,
    .topic-readiness-grid,
    .operating-protocol-grid,
    .slot-ramp-grid,
    .problem-supply-grid,
    .assignment-cards,
    .playbook-grid,
    .ramp-grid,
    .practice-grid,
    .lesson-board-grid,
    .figure-grid,
    .problem-card-meta,
    .problem-set-summary,
    .exact-prescription-grid,
    .exact-day-strip,
    .home-next-actions,
    .momentum-strip,
    .shared-week-queue,
    .roadmap-week-grid,
    .compact-week-grid,
    .verification-grid,
    .weekly-unlock-panel,
    .battle-route,
    .week-progress-groups,
    .week-workbench-summary,
    .week-adaptive-strip,
    .week-snapshot-strip,
    .week-execution-grid,
    .week-assigned-grid,
    .week-step-actions,
    .stage-meta-grid,
    .bank-meta-grid,
    .repair-meta-grid {
        grid-template-columns: 1fr;
    }
    .exact-media-rule {
        align-items: flex-start;
        flex-direction: column;
    }
    .task-card {
        flex-direction: column;
    }
    .workspace-shell {
        grid-template-columns: 1fr;
    }
    .workspace-sidebar {
        position: static;
        height: auto;
    }
    .progression-strip {
        grid-template-columns: 1fr;
    }
    .week-list {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .next-gate-cta {
        position: static;
        grid-template-columns: 1fr;
    }

    .next-gate-cta .action-button {
        width: 100%;
    }

    .workspace-shell {
        width: min(100% - 16px, 1440px);
        padding: 12px 0 20px;
    }
    .workspace-shell.week-focus-mode {
        width: min(100% - 16px, 1440px);
        padding: 8px 0 16px;
    }
    .workspace-sidebar,
    .workspace-card,
    .chart-card,
    .stat-card,
    .subgenre-card,
    .workspace-hero,
    .detail-hero {
        padding: 18px;
    }
    .workspace-sidebar {
        gap: 12px;
        padding: 14px;
    }
    .workspace-sidebar .sidebar-brand h1 {
        margin-bottom: 0;
        font-size: 1.35rem;
    }
    .workspace-sidebar #sidebar-description,
    .workspace-sidebar .sidebar-priority-panel,
    .workspace-sidebar .sidebar-status-panel,
    .workspace-sidebar .sidebar-safety-panel,
    .workspace-sidebar .sidebar-routine-panel {
        display: none;
    }
    .sidebar-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .sidebar-nav a {
        min-width: 0;
        padding: 9px 6px;
        font-size: 0.84rem;
        text-align: center;
    }
    .action-home-hero,
    .home-deadline-desk,
    .shared-deadline-board,
    .home-library-rule {
        padding: 16px;
    }
    .action-home-heading,
    .focus-header,
    .battle-launch-head {
        display: grid;
        gap: 12px;
    }
    .action-deadline {
        width: 100%;
    }
    .battle-reward {
        width: 100%;
        text-align: left;
    }
    .home-deadline-row {
        grid-template-columns: 64px minmax(0, 1fr);
    }
    .home-deadline-row small {
        grid-column: 2;
    }
    .shared-deadline-row.current {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .momentum-mission {
        padding-left: 0;
        padding-top: 10px;
        border-left: 0;
        border-top: 1px solid rgba(228, 191, 131, 0.2);
    }
    .week-close-row {
        grid-template-columns: 1fr;
    }
    .roadmap-index-hero,
    .roadmap-week-directory {
        padding: 16px;
    }
    .roadmap-current {
        display: grid;
    }
    .workspace-shell.week-focus-mode .week-page {
        padding: 12px;
    }
    .workspace-shell.week-focus-mode .detail-hero {
        padding: 16px;
        gap: 12px;
    }
    .workspace-shell.week-focus-mode .detail-hero h2 {
        font-size: 2.2rem;
        line-height: 1.08;
    }
    .workspace-shell.week-focus-mode .detail-hero p {
        line-height: 1.42;
    }
    .workspace-shell.week-focus-mode .detail-badge-stack {
        justify-items: start;
        gap: 6px;
    }
    .workspace-shell.week-focus-mode .detail-badge {
        padding: 6px 13px;
    }
    .workspace-shell.week-focus-mode .week-topbar {
        margin-bottom: 10px;
    }
    .workspace-shell.week-focus-mode .back-link,
    .workspace-shell.week-focus-mode .week-nav-links a {
        min-height: 36px;
        padding: 0 11px;
        border-radius: 12px;
    }
    .week-view-panel .section-title h3 {
        font-size: 1.05rem;
    }
    .week-view-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
        gap: 8px;
    }
    .week-view-row button {
        width: 100%;
        min-height: 38px;
        padding: 0 12px;
        white-space: normal;
    }
    .week-view-note {
        display: none;
    }
    .week-workbench-panel {
        padding: 14px;
    }
    .week-workbench-summary,
    .week-adaptive-strip {
        display: none;
    }
    .week-workbench-summary,
    .week-adaptive-strip,
    .week-execution-grid {
        margin-top: 10px;
    }
    .workspace-hero,
    .detail-hero,
    .section-title,
    .control-row,
    .subgenre-head {
        flex-direction: column;
        align-items: start;
    }
    .subgenre-row {
        grid-template-columns: 1fr;
    }
    .field,
    .toggle-row,
    .toggle-row button,
    .lesson-board-row,
    select {
        width: 100%;
    }
    .lesson-board-row {
        grid-template-columns: 1fr;
    }
}


/* Tracker mode */

.workspace-shell.tracker-mode,
.workspace-shell.career-mode {
    grid-template-columns: 1fr;
    width: min(1780px, calc(100% - 40px));
}

.workspace-sidebar.tracker-mode,
.workspace-sidebar.career-mode {
    position: static;
    height: auto;
    overflow: visible;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
    flex-direction: row;
    align-items: center;
    background: linear-gradient(180deg, rgba(10, 18, 31, 0.99), rgba(7, 13, 22, 0.99)), var(--bg-panel-2);
    border-radius: var(--radius-2);
}

.workspace-sidebar.tracker-mode .sidebar-brand,
.workspace-sidebar.career-mode .sidebar-brand {
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
    align-items: center;
    padding: 0;
    border-bottom: none;
    margin-bottom: 0;
    flex: 1;
}

.workspace-sidebar.tracker-mode .sidebar-brand h1,
.workspace-sidebar.career-mode .sidebar-brand h1 {
    font-size: 1.6rem;
    margin-bottom: 0;
}

.workspace-sidebar.tracker-mode .sidebar-brand p:not(.sidebar-kicker),
.workspace-sidebar.career-mode .sidebar-brand p:not(.sidebar-kicker) {
    display: none;
}

.workspace-sidebar.tracker-mode .site-mode-switch,
.workspace-sidebar.career-mode .site-mode-switch {
    margin-top: 0;
    flex-shrink: 0;
}

.workspace-sidebar.tracker-mode .sidebar-nav,
.workspace-sidebar.tracker-mode .sidebar-priority-panel,
.workspace-sidebar.tracker-mode .sidebar-status-panel,
.workspace-sidebar.tracker-mode .sidebar-safety-panel,
.workspace-sidebar.tracker-mode .sidebar-routine-panel,
.workspace-sidebar.career-mode .sidebar-nav,
.workspace-sidebar.career-mode .sidebar-priority-panel,
.workspace-sidebar.career-mode .sidebar-status-panel,
.workspace-sidebar.career-mode .sidebar-safety-panel,
.workspace-sidebar.career-mode .sidebar-routine-panel {
    display: none;
}

.tracker-page {
    width: 100%;
    isolation: isolate;
}

/* Finance workspace */
.finance-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.finance-field { display: flex; flex-direction: column; gap: 5px; }
.finance-field span { font-size: 12px; color: #97a4b4; }
.finance-field input { padding: 9px 11px; border-radius: 7px; border: 1px solid #243049; background: #07101e; color: #f3f6fb; font-size: 0.95rem; }
.finance-field input:focus { outline: none; border-color: var(--gold, #e4bf83); }
.finance-progress { margin-top: 16px; }
.finance-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.finance-progress-head span { font-size: 12px; color: #97a4b4; text-transform: uppercase; letter-spacing: 0.05em; }
.finance-progress-head strong { color: #7bc6aa; }
.finance-progress-bar { height: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.finance-progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #7bc6aa, #e4bf83); transition: width 0.2s ease-out; }
.finance-check-list { list-style: none; padding: 0; }
.finance-waterfall { padding-left: 1.2rem; }
.finance-waterfall li { margin: 4px 0; }
.finance-key-numbers { width: 100%; border-collapse: collapse; }
.finance-key-numbers td { padding: 7px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.9rem; }
.finance-key-numbers td:last-child { text-align: right; color: var(--gold, #e4bf83); }

.career-grad-tier { margin-top: 16px; }
.career-grad-tier:first-of-type { margin-top: 4px; }
.career-grad-tier .panel-label { color: var(--gold, #e4bf83); }

/* Finance income streams */
.finance-income-table { display: flex; flex-direction: column; gap: 10px; }
.finance-income-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; background: rgba(0, 0, 0, 0.22); border-left: 3px solid var(--gold, #e4bf83); border-radius: 6px; }
.finance-income-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.finance-income-head span { font-size: 12px; color: #97a4b4; }
.finance-income-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
.finance-income-fields label { display: flex; flex-direction: column; gap: 3px; }
.finance-income-fields label span { font-size: 11px; color: #97a4b4; }
.finance-income-fields input { width: 78px; padding: 6px 8px; border-radius: 6px; border: 1px solid #243049; background: #07101e; color: #f3f6fb; }
.finance-income-annual { font-style: normal; color: #7bc6aa; font-weight: 700; min-width: 96px; text-align: right; }
.finance-income-summary { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border: 1px dashed rgba(228, 191, 131, 0.4); border-radius: 6px; color: var(--gold, #e4bf83); font-weight: 700; }
@media (max-width: 720px) { .finance-income-row { grid-template-columns: 1fr; } .finance-income-fields { justify-content: flex-start; } }

.tracker-page .workspace-hero {
    background: radial-gradient(ellipse at top left, rgba(170, 158, 96, 0.14) 0%, transparent 55%), radial-gradient(ellipse at top right, rgba(228, 191, 131, 0.08) 0%, transparent 40%), linear-gradient(180deg, rgba(10, 20, 34, 0.99) 0%, rgba(7, 14, 24, 0.99) 100%);
    border-color: rgba(170, 158, 96, 0.15);
}

.tracker-page .workspace-hero h2 {
    color: var(--text);
}

.tracker-page .eyebrow {
    color: var(--success);
}

.career-page {
    width: 100%;
}

.career-page .eyebrow {
    color: #f6c453;
}

.career-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-4);
    background: radial-gradient(ellipse at top left, rgba(246, 196, 83, 0.12) 0%, transparent 52%), radial-gradient(ellipse at top right, rgba(170, 158, 96, 0.09) 0%, transparent 42%), linear-gradient(180deg, rgba(14, 18, 25, 0.99) 0%, rgba(8, 13, 20, 0.99) 100%);
    border-color: rgba(246, 196, 83, 0.18);
}

.career-hero-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.career-stat-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.career-stat-strip article {
    min-height: 116px;
    padding: var(--space-3);
    border: 1px solid rgba(246, 196, 83, 0.16);
    border-radius: var(--radius-1);
    background: linear-gradient(180deg, rgba(16, 25, 31, 0.96), rgba(10, 17, 25, 0.96));
}

.career-stat-strip span,
.career-stat-strip em {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.career-stat-strip strong {
    display: block;
    margin: 7px 0;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.25;
}

.career-nav-card {
    position: sticky;
    top: 12px;
    z-index: 50;
    padding: 6px;
    margin-bottom: var(--space-3);
    border: 1px solid rgba(246, 196, 83, 0.16);
    border-radius: var(--radius-1);
    background: rgba(8, 13, 20, 0.94);
    backdrop-filter: blur(12px);
}

.career-nav-scroll {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.career-nav-scroll button {
    min-width: 112px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-1) - 3px);
    background: rgba(16, 27, 42, 0.76);
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.career-nav-scroll button.active,
.career-nav-scroll button:hover {
    border-color: rgba(246, 196, 83, 0.32);
    background: rgba(246, 196, 83, 0.12);
    color: #f6c453;
}

.career-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: var(--space-3);
}

.career-focus-panel {
    grid-row: span 2;
}

.career-panel {
    border-color: rgba(246, 196, 83, 0.14);
    background: linear-gradient(180deg, rgba(12, 20, 28, 0.98), rgba(8, 14, 22, 0.98));
}

.career-deadline-list {
    display: grid;
    gap: 8px;
    max-height: 620px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.career-deadline-row {
    display: grid;
    grid-template-columns: 24px minmax(240px, 1fr) minmax(98px, auto) minmax(150px, auto) minmax(72px, auto) minmax(48px, auto) minmax(88px, auto);
    gap: var(--space-2);
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(14, 24, 34, 0.82);
}

.career-deadline-row input {
    width: 18px;
    height: 18px;
    accent-color: #f6c453;
}

.career-deadline-main strong,
.career-deadline-main small,
.career-deadline-main em {
    display: block;
}

.career-deadline-main strong {
    color: var(--text);
    line-height: 1.25;
}

.career-deadline-main small,
.career-deadline-main em {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.career-done {
    opacity: 0.62;
}

.career-done .career-deadline-main strong {
    text-decoration: line-through;
}

.career-lane,
.priority-pill,
.deadline-pill,
.career-type-pill,
.career-score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.career-type-hard {
    color: #ff9c9c;
    border-color: rgba(255, 156, 156, 0.28);
    background: rgba(255, 156, 156, 0.08);
}

.career-type-watch {
    color: #f6c453;
    border-color: rgba(246, 196, 83, 0.28);
    background: rgba(246, 196, 83, 0.08);
}

.career-type-soft {
    color: #a99e5e;
    border-color: rgba(170, 158, 96, 0.26);
    background: rgba(170, 158, 96, 0.08);
}

.career-score-pill {
    min-width: 42px;
    color: var(--text);
    border-color: rgba(246, 196, 83, 0.26);
    background: rgba(246, 196, 83, 0.1);
}

.priority-pill.critical {
    color: #ff9c9c;
    border-color: rgba(255, 156, 156, 0.24);
    background: rgba(255, 156, 156, 0.08);
}

.priority-pill.high {
    color: #f6c453;
    border-color: rgba(246, 196, 83, 0.26);
    background: rgba(246, 196, 83, 0.08);
}

.priority-pill.medium {
    color: #e4bf83;
    border-color: rgba(228, 191, 131, 0.24);
    background: rgba(228, 191, 131, 0.08);
}

.career-signal-stack {
    display: grid;
    gap: 8px;
    max-height: 410px;
    overflow: auto;
    padding-right: 4px;
}

.career-signal-mini,
.career-app-row,
.career-signal-card,
.career-school-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(14, 24, 34, 0.82);
}

.career-signal-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 10px 12px;
}

.career-signal-mini strong,
.career-signal-mini span,
.career-app-row strong,
.career-app-row span {
    display: block;
}

.career-signal-mini span,
.career-app-row span,
.career-school-card span,
.career-signal-card p,
.career-rule-list p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.career-rule-list {
    display: grid;
    gap: 9px;
}

.career-coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.career-coverage-card {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(14, 24, 34, 0.82);
}

.career-coverage-card div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.career-coverage-card strong,
.career-coverage-card span,
.career-coverage-card em {
    display: block;
}

.career-coverage-card strong {
    color: var(--text);
}

.career-coverage-card p,
.career-coverage-card em {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.career-coverage-card span {
    align-self: start;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 0.72rem;
    font-weight: 900;
}

.coverage-ok {
    border-color: rgba(170, 158, 96, 0.24);
    background: rgba(170, 158, 96, 0.08);
}

.coverage-ok span {
    color: #a99e5e;
}

.coverage-miss {
    border-color: rgba(255, 156, 156, 0.3);
    background: rgba(255, 156, 156, 0.08);
}

.coverage-miss span {
    color: #ff9c9c;
}

.career-next-actions {
    display: grid;
    gap: 10px;
}

.career-next-action {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: center;
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(14, 24, 34, 0.88);
}

.career-next-hard {
    border-left: 3px solid #ff9c9c;
}

.career-next-watch {
    border-left: 3px solid #f6c453;
}

.career-next-soft {
    border-left: 3px solid #a99e5e;
}

.career-next-rank {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(246, 196, 83, 0.28);
    background: rgba(246, 196, 83, 0.1);
    color: #f6c453;
    font-weight: 900;
}

.career-next-title {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.career-next-title strong {
    color: var(--text);
    line-height: 1.25;
}

.career-next-body p {
    margin: 5px 0 7px;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.45;
}

.career-next-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.career-next-meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(8, 14, 24, 0.58);
}

.career-ranked-queue {
    margin-top: var(--space-3);
}

.career-app-table,
.career-signal-grid,
.career-school-grid {
    display: grid;
    gap: 9px;
}

.career-app-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px auto;
    gap: var(--space-2);
    align-items: center;
    padding: 12px;
}

.career-app-row select {
    min-height: 38px;
    border: 1px solid rgba(246, 196, 83, 0.18);
    border-radius: var(--radius-1);
    background: rgba(5, 10, 18, 0.9);
    color: var(--text);
}

.career-signal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.career-signal-card,
.career-school-card {
    padding: var(--space-3);
}

.career-signal-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    align-items: start;
    margin-bottom: 8px;
}

.career-school-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.career-school-card strong {
    display: block;
    color: var(--text);
}

.career-school-card p {
    min-height: 42px;
    margin: 8px 0 10px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.career-note-pad {
    margin-top: var(--space-3);
}

@media (max-width: 1100px) {
    .career-stat-strip,
    .career-dashboard-grid,
    .career-signal-grid,
    .career-school-grid {
        grid-template-columns: 1fr 1fr;
    }
    .career-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .career-deadline-row {
        grid-template-columns: 24px minmax(220px, 1fr) minmax(98px, auto);
    }
    .career-deadline-row .deadline-pill,
    .career-deadline-row .career-type-pill,
    .career-deadline-row .career-score-pill,
    .career-deadline-row .priority-pill {
        grid-column: 2 / -1;
        justify-self: start;
    }
}

.tracker-module-nav-card {
    border-color: rgba(170, 158, 96, 0.18);
    background: linear-gradient(180deg, rgba(11, 22, 35, 0.98), rgba(8, 16, 26, 0.98));
}

.tracker-module-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-1);
}

.tracker-module-grid .action-button {
    background: linear-gradient(135deg, rgba(170, 158, 96, 0.18), rgba(170, 158, 96, 0.12));
    border-color: rgba(170, 158, 96, 0.28);
    color: var(--success);
}

.tracker-notes-box {
    min-height: 100px;
    margin-top: var(--space-1);
    border-color: rgba(170, 158, 96, 0.15);
    background: rgba(7, 14, 24, 0.7);
}

.tracker-notes-box:focus {
    border-color: rgba(170, 158, 96, 0.35);
    outline: none;
}

.tracker-step-card,
.tracker-layer-card,
.tracker-side-lane-card {
    border-color: rgba(170, 158, 96, 0.14);
    background: linear-gradient(180deg, rgba(9, 18, 30, 0.97), rgba(6, 13, 22, 0.97));
}

.tracker-validation-card,
.tracker-overlay-card {
    border-color: rgba(170, 158, 96, 0.1);
    background: linear-gradient(180deg, rgba(10, 20, 33, 0.96), rgba(7, 14, 23, 0.96));
}

.tracker-step-card strong,
.tracker-layer-card strong,
.tracker-validation-card strong,
.tracker-overlay-card strong,
.tracker-side-lane-card strong {
    color: var(--text);
}

.tracker-layer-card p:last-child,
.tracker-validation-card p:last-child,
.tracker-overlay-card p:last-child,
.tracker-side-lane-card ul:last-child {
    margin-bottom: 0;
}

.tracker-side-lane-card .detail-list {
    margin-top: var(--space-1);
}

.tracker-jump-row {
    margin-top: 3px;
}

.tracker-jump-row .ghost-button {
    min-height: 30px;
}


/* Study planner */

.planner-nav-card {
    padding: 14px 18px;
    position: relative;
    z-index: 60;
    overflow: visible;
}

.planner-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.planner-filter-row>.ghost-button,
.planner-filter-row>.action-button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.tracker-more-menu {
    position: relative;
    margin-left: auto;
    z-index: 70;
}

.tracker-more-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)), var(--surface);
    cursor: pointer;
    list-style: none;
    touch-action: manipulation;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.tracker-more-menu summary::-webkit-details-marker {
    display: none;
}

.tracker-more-menu summary strong {
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}

.tracker-more-menu summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    margin-left: 4px;
}

.tracker-more-menu[open] summary {
    border-color: rgba(228, 191, 131, 0.35);
    box-shadow: 0 0 0 3px rgba(228, 191, 131, 0.08);
}

.tracker-more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1000;
    min-width: 210px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-2) 96%, black);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 4px;
}

.tracker-more-option {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-soft);
    text-align: left;
    padding: 0 10px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 120ms ease, color 120ms ease, transform 80ms ease;
}

.tracker-more-option:active {
    transform: translateY(1px);
}

.tracker-more-option:hover,
.tracker-more-option.tm-active {
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--text);
}

.planner-track-desc {
    margin: 10px 0 0;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
}

.planner-list {
    display: grid;
    gap: var(--space-4);
}

.planner-phase-group {
    display: grid;
    gap: var(--space-2);
}

.planner-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-2);
    padding: 2px 4px 8px;
    border-bottom: 1px solid var(--line);
}

.planner-phase-name {
    margin: 2px 0 0;
    font-family: "Manrope", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.planner-phase-window {
    font-size: 0.76rem;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    padding-bottom: 2px;
}

.planner-items {
    display: grid;
    gap: 10px;
}

.planner-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: linear-gradient(180deg, rgba(13, 21, 35, 0.97), rgba(8, 14, 24, 0.97));
    padding: 16px 18px;
    display: grid;
    gap: 12px;
    transition: border-color 180ms ease, opacity 180ms ease;
}

.planner-item.status-in-progress {
    border-color: rgba(170, 158, 96, 0.26);
    background: linear-gradient(180deg, rgba(9, 19, 32, 0.98), rgba(6, 14, 24, 0.98));
}

.planner-item.status-done {
    border-color: rgba(228, 191, 131, 0.1);
    opacity: 0.55;
}

.planner-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.planner-item-title-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.planner-item-title {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.planner-item-author {
    font-size: 0.77rem;
    color: var(--muted);
}

.planner-item-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1 1 220px;
    max-width: 100%;
    min-width: 0;
}

.deadline-chip,
.priority-badge,
.deadline-source-badge,
.hours-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid;
}

.deadline-source-badge {
    background: rgba(168, 186, 214, 0.06);
    border-color: rgba(168, 186, 214, 0.14);
    color: var(--muted);
}

.deadline-source-badge.source-checkpoint {
    background: rgba(228, 191, 131, 0.09);
    border-color: rgba(228, 191, 131, 0.24);
    color: var(--accent-warm);
}

.deadline-source-badge.source-adaptive {
    background: rgba(170, 158, 96, 0.1);
    border-color: rgba(170, 158, 96, 0.24);
    color: var(--success);
}

.deadline-source-badge.source-catalog {
    background: rgba(228, 191, 131, 0.08);
    border-color: rgba(228, 191, 131, 0.2);
    color: var(--accent);
}

.deadline-overdue {
    background: rgba(143, 58, 54, 0.1);
    border-color: rgba(143, 58, 54, 0.3);
    color: #d98a8a;
}

.deadline-soon {
    background: rgba(228, 191, 131, 0.1);
    border-color: rgba(228, 191, 131, 0.28);
    color: var(--accent-warm);
}

.deadline-upcoming {
    background: rgba(228, 191, 131, 0.08);
    border-color: rgba(228, 191, 131, 0.2);
    color: var(--accent);
}

.deadline-far {
    background: rgba(168, 186, 214, 0.05);
    border-color: rgba(168, 186, 214, 0.13);
    color: var(--muted);
}

.priority-critical {
    background: rgba(143, 58, 54, 0.08);
    border-color: rgba(143, 58, 54, 0.2);
    color: #d98a8a;
}

.priority-high {
    background: rgba(228, 191, 131, 0.07);
    border-color: rgba(228, 191, 131, 0.18);
    color: var(--accent-warm);
}

.priority-medium {
    background: rgba(228, 191, 131, 0.06);
    border-color: rgba(228, 191, 131, 0.14);
    color: var(--accent);
}

.priority-low {
    background: rgba(168, 186, 214, 0.04);
    border-color: rgba(168, 186, 214, 0.1);
    color: var(--muted);
}

.hours-chip {
    background: rgba(168, 186, 214, 0.04);
    border-color: rgba(168, 186, 214, 0.1);
    color: var(--muted);
}

.planner-item-desc {
    margin: 0;
    font-size: 0.87rem;
    color: var(--text-soft);
    line-height: 1.5;
}

.planner-focus {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
}

.planner-focus li {
    font-size: 0.81rem;
    color: var(--muted);
    padding-left: 16px;
    position: relative;
    line-height: 1.4;
}

.planner-focus li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--success);
    font-size: 0.7rem;
    top: 2px;
}

.book-lectures {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--surface-3);
    border-radius: var(--radius-1);
    border-left: 2px solid var(--accent);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-lectures-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2px;
}

.book-lecture-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 1px;
    align-items: baseline;
}

.lecture-platform {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.lecture-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.lecture-instructor {
    grid-column: 3;
    grid-row: 1;
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.lecture-note {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.75rem;
    color: var(--muted);
    padding-left: 2px;
    line-height: 1.45;
}

.planner-status-row {
    display: flex;
    gap: 6px;
}

.planner-status-btn {
    flex: 1;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.77rem;
    font-weight: 600;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
}

.planner-status-btn:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.planner-status-btn:active {
    transform: translateY(1px);
}

.planner-status-btn.s-active {
    background: linear-gradient(180deg, rgba(170, 158, 96, 0.14), rgba(170, 158, 96, 0.08));
    border-color: rgba(170, 158, 96, 0.26);
    color: var(--success);
}

.planner-status-btn.s-done {
    background: linear-gradient(180deg, rgba(228, 191, 131, 0.11), rgba(228, 191, 131, 0.07));
    border-color: rgba(228, 191, 131, 0.2);
    color: var(--accent);
}

.planner-status-row.compact-status {
    min-width: 150px;
}

.planner-status-select {
    width: 100%;
    min-height: 32px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: rgba(8, 15, 25, 0.92);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 9px;
    cursor: pointer;
}

.compact-planner-item {
    padding: 12px 14px;
}

.compact-planner-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
    align-items: center;
}

.compact-planner-focus {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.planner-note-box {
    min-height: 64px;
    margin-top: 0;
    font-size: 0.84rem;
}


/* Lane dashboard */

.lane-dashboard {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.lane-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: linear-gradient(180deg, rgba(13, 21, 35, 0.97), rgba(8, 14, 24, 0.97));
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.lane-tile:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.lane-tile-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lane-icon {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: "Manrope", sans-serif;
    flex-shrink: 0;
}

.lane-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    line-height: 1.2;
}

.lane-count {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.lane-bar-track {
    height: 4px;
    border-radius: 99px;
    background: rgba(168, 186, 214, 0.1);
    overflow: hidden;
}

.lane-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 400ms ease;
    opacity: 0.85;
}

.lane-active {
    font-size: 0.71rem;
    color: var(--muted);
}


/* Putnam topic grid */

.putnam-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: var(--space-2);
}

.putnam-topic-card {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: linear-gradient(180deg, rgba(13, 21, 35, 0.97), rgba(8, 14, 24, 0.97));
    display: grid;
    gap: 8px;
}

.putnam-topic-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.putnam-topic-head strong {
    font-size: 0.9rem;
    color: var(--text);
    font-family: "Manrope", sans-serif;
}

.mastery-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.mastery-btn {
    padding: 2px 8px;
    min-height: 22px;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.mastery-btn:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.mastery-active.mastery-basic {
    background: rgba(228, 191, 131, 0.14);
    border-color: rgba(228, 191, 131, 0.3);
    color: var(--accent-warm);
}

.mastery-active.mastery-strong {
    background: rgba(228, 191, 131, 0.12);
    border-color: rgba(228, 191, 131, 0.28);
    color: var(--accent);
}

.mastery-active.mastery-elite {
    background: rgba(170, 158, 96, 0.14);
    border-color: rgba(170, 158, 96, 0.3);
    color: var(--success);
}

.putnam-topic-note {
    margin: 0;
    font-size: 0.79rem;
    color: var(--muted);
    line-height: 1.4;
}

.putnam-topic-feed {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
    opacity: 0.7;
    line-height: 1.3;
}


/* Chapter input */

.planner-item-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.chapter-input {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-soft);
    font-size: 0.78rem;
    min-width: 0;
    transition: border-color 140ms ease;
}

.chapter-input:focus {
    outline: none;
    border-color: rgba(228, 191, 131, 0.3);
}

@media (max-width: 900px) {
    .lane-dashboard {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .putnam-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .planner-item-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .lane-dashboard {
        grid-template-columns: 1fr 1fr;
    }
    .putnam-topic-grid {
        grid-template-columns: 1fr;
    }
}


/* Book list filter bar */

.book-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: var(--space-1) 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--space-1);
    align-items: center;
}

.book-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.book-filter-group-right {
    margin-left: auto;
    align-items: center;
}

.book-filter-btn {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: var(--radius-1);
}

.book-filter-count {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    padding: 0 4px;
    white-space: nowrap;
}

.list-trim-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: var(--radius-1);
    background: rgba(228, 191, 131, 0.06);
    color: var(--muted);
    font-size: 0.82rem;
}

.list-trim-note .ghost-button {
    min-height: 30px;
    padding: 0 10px;
}

@media (max-width: 900px) {
    .book-filter-group-right {
        margin-left: 0;
    }
    .list-trim-note {
        align-items: stretch;
        flex-direction: column;
    }
    .compact-planner-main {
        grid-template-columns: 1fr;
    }
}


/* Problem log */

.log-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.log-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.log-form-lower {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.log-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-field-notes textarea {
    resize: vertical;
    min-height: 72px;
}

.log-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.log-input {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.84rem;
    font-family: inherit;
    transition: border-color 140ms ease;
    min-width: 0;
}

.log-input:focus {
    outline: none;
    border-color: rgba(228, 191, 131, 0.4);
}

.log-select {
    cursor: pointer;
}

.log-textarea {
    resize: vertical;
    min-height: 72px;
}

.log-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
}

.log-result-btns {
    display: flex;
    gap: 6px;
}

.log-result-btn {
    padding: 5px 14px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.log-result-btn:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.log-result-btn.log-result-active.log-result-solved {
    background: rgba(170, 158, 96, 0.15);
    border-color: rgba(170, 158, 96, 0.5);
    color: var(--success);
}

.log-result-btn.log-result-active.log-result-partial {
    background: rgba(228, 191, 131, 0.15);
    border-color: rgba(228, 191, 131, 0.5);
    color: var(--accent-warm);
}

.log-result-btn.log-result-active.log-result-stuck {
    background: rgba(143, 58, 54, 0.12);
    border-color: rgba(143, 58, 54, 0.4);
    color: #d98a8a;
}

.log-submit-btn {
    align-self: flex-start;
    margin-top: 4px;
}


/* Stats row */

.log-stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: var(--space-1);
}

.log-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 52px;
}

.log-stat strong {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.log-stat span {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.log-stat-solved strong {
    color: var(--success);
}

.log-stat-partial strong {
    color: var(--accent-warm);
}

.log-stat-stuck strong {
    color: #d98a8a;
}


/* Technique breakdown */

.log-tech-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-1);
    padding-top: var(--space-1);
    border-top: 1px solid var(--line);
}

.log-tech-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 2px;
}

.log-tech-row {
    display: grid;
    grid-template-columns: 200px 1fr 28px;
    align-items: center;
    gap: 10px;
}

.log-tech-name {
    font-size: 0.8rem;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-tech-bar-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    overflow: hidden;
}

.log-tech-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 300ms ease;
}

.log-tech-count {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: right;
}


/* Filter row */

.log-filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: var(--space-1);
}


/* Entries list */

.log-entries {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-entry {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 120ms ease;
}

.log-entry:hover {
    border-color: var(--line-strong);
}

.log-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.log-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.log-entry-date {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.log-entry-source {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.log-entry-ref {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(228, 191, 131, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

.log-entry-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.log-entry-time {
    font-size: 0.75rem;
    color: var(--muted);
}

.log-result-chip {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.log-chip-solved {
    background: rgba(170, 158, 96, 0.15);
    color: var(--success);
}

.log-chip-partial {
    background: rgba(228, 191, 131, 0.15);
    color: var(--accent-warm);
}

.log-chip-stuck {
    background: rgba(143, 58, 54, 0.12);
    color: #d98a8a;
}

.log-entry-technique {
    font-size: 0.8rem;
    color: var(--text-soft);
    margin: 0 0 4px;
}

.log-entry-technique strong {
    color: var(--text);
}

.log-entry-notes {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin: 4px 0 0;
    line-height: 1.55;
}

.log-delete-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 120ms ease, color 120ms ease;
}

.log-delete-btn:hover {
    opacity: 1;
    color: #d98a8a;
}

.empty-state-note {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 16px 0 4px;
    margin: 0;
}

@media (max-width: 900px) {
    .log-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .log-form-lower {
        grid-template-columns: 1fr;
    }
    .log-tech-row {
        grid-template-columns: 140px 1fr 24px;
    }
}

@media (max-width: 600px) {
    .log-form-grid {
        grid-template-columns: 1fr;
    }
    .log-stats-row {
        gap: 14px;
    }
    .log-tech-row {
        grid-template-columns: 120px 1fr 20px;
    }
}


/* Timeline section */

.tl-period-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--space-1);
}

.tl-period-card {
    flex: 1 1 180px;
    max-width: 100%;
    min-width: 120px;
    padding: 8px 12px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    overflow-wrap: anywhere;
}

.tl-period-card:hover {
    border-color: var(--accent);
    background: var(--surface-3);
}

.tl-period-active {
    border-color: var(--accent) !important;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)) !important;
}

.tl-period-past {
    opacity: 0.55;
}

.tl-period-label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.tl-period-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.tl-period-milestone {
    font-size: 0.72rem;
    color: var(--accent);
    margin-top: 4px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.tl-priority-note,
.tl-milestone-note {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 6px 0 12px;
}

.tl-tracks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1);
    margin-top: var(--space-1);
}

.tl-track {
    background: var(--surface-2);
    border-radius: var(--radius-1);
    padding: 12px 14px;
}

.tl-track-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.tl-track-list {
    list-style: disc;
    padding-left: 18px;
    margin: 0;
}

.tl-track-list li {
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 4px;
}


/* Big moves */

.big-moves-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-1);
}

.big-move-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
    transition: background 0.12s;
}

.big-move-item:hover {
    background: var(--surface-3);
}

.big-move-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.big-move-body {
    flex: 1;
}

.big-move-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.big-move-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-3);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.big-move-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.big-move-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
}

.big-move-done .big-move-text {
    text-decoration: line-through;
    color: var(--muted);
}

.big-move-done {
    opacity: 0.65;
}


/* Cut priority */

.cut-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: var(--space-1);
}

.cut-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.cut-row-never {
    border-color: color-mix(in srgb, var(--success, #4caf96) 40%, transparent);
    background: color-mix(in srgb, var(--success, #4caf96) 6%, var(--surface-2));
}

.cut-rank {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.cut-label {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.cut-note {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.cut-row-never .cut-note {
    color: var(--success, #4caf96);
}


/* Coverage ratings */

.cov-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-1);
}

.cov-row {
    display: grid;
    grid-template-columns: 220px 1fr 50px;
    align-items: center;
    gap: 12px;
}

.cov-label {
    font-size: 0.83rem;
    color: var(--text);
    font-weight: 500;
}

.cov-bar-track {
    height: 8px;
    background: var(--surface-3);
    border-radius: 4px;
    overflow: hidden;
}

.cov-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cov-bar-perfect {
    background: var(--accent);
}

.cov-bar-great {
    background: color-mix(in srgb, var(--accent) 80%, var(--accent-warm, #e8a838));
}

.cov-bar-good {
    background: color-mix(in srgb, var(--accent) 60%, var(--accent-warm, #e8a838));
}

.cov-bar-solid {
    background: var(--accent-warm, #e8a838);
}

.cov-score {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
}


/* Weekly review */

.wr-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1);
    margin-top: var(--space-1);
}

.wr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wr-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wr-input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px 10px;
    resize: vertical;
    min-height: 64px;
    transition: border-color 0.15s;
}

.wr-input:focus {
    outline: none;
    border-color: var(--accent);
}

@media (max-width: 900px) {
    .tl-tracks-grid {
        grid-template-columns: 1fr;
    }
    .cov-row {
        grid-template-columns: 160px 1fr 44px;
    }
    .wr-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .tl-period-strip {
        gap: 6px;
    }
    .tl-period-card {
        flex-basis: 100%;
        min-width: 0;
    }
    .cut-row {
        grid-template-columns: 24px 1fr;
    }
    .cut-note {
        display: none;
    }
    .cov-row {
        grid-template-columns: 130px 1fr 40px;
    }
}


/* PhD path section */


/* Milestone snapshots */

.ms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-top: var(--space-1);
}

.ms-card {
    padding: 14px 16px;
    border-radius: var(--radius-1);
    border: 1px solid var(--line);
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ms-date {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.ms-tier-chip {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ms-tier-milestone .ms-tier-chip {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}

.ms-tier-major .ms-tier-chip {
    background: color-mix(in srgb, var(--accent-warm, #e8a838) 20%, transparent);
    color: var(--accent-warm, #e8a838);
}

.ms-tier-peak .ms-tier-chip {
    background: color-mix(in srgb, #8f3a36 18%, transparent);
    color: #d98a8a;
}

.ms-tier-peak {
    border-color: color-mix(in srgb, #8f3a36 35%, transparent);
}

.ms-tier-major {
    border-color: color-mix(in srgb, var(--accent-warm, #e8a838) 35%, transparent);
}

.ms-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.ms-stack {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}

.ms-target {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 600;
    margin: 0;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}


/* Connection map */

.cmap-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: var(--space-1);
}

.cmap-panel {
    background: var(--surface-2);
    border-radius: var(--radius-1);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmap-panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    /* de-commoditized (goal 4): smallcap eyebrow + gold hairline is the memed
       claude-design tic — tracking and spacing carry the hierarchy alone */
    padding-bottom: 2px;
    margin-bottom: 10px;
}

.cmap-row {
    display: grid;
    grid-template-columns: auto 16px 1fr;
    align-items: baseline;
    gap: 6px;
    font-size: 0.82rem;
}

.cmap-book {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.cmap-arrow {
    color: var(--muted);
    font-size: 0.75rem;
}

.cmap-feeds {
    color: var(--muted);
    line-height: 1.4;
}


/* PhD targets */

.phd-targets {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: var(--space-1);
}

.phd-tier {
    background: var(--surface-2);
    border-radius: var(--radius-1);
    padding: 14px 16px;
}

.phd-tier-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    /* de-commoditized (goal 4): eyebrow hairlines retired, see .cmap-panel-title */
    padding-bottom: 2px;
    margin-bottom: 12px;
}

.phd-tier-reach {
    color: #d98a8a;
}

.phd-tier-strong {
    color: var(--accent-warm, #e8a838);
}

.phd-tier-solid {
    color: var(--accent);
}

.phd-tier-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.phd-tier-list li {
    font-size: 0.83rem;
    color: var(--text);
    padding: 5px 8px;
    border-radius: var(--radius-1);
    background: var(--surface-3);
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .ms-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cmap-panels {
        grid-template-columns: 1fr;
    }
    .phd-targets {
        grid-template-columns: 1fr 1fr;
    }
    .path-signal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .output-add-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .output-wide-field {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .ms-grid {
        grid-template-columns: 1fr;
    }
    .phd-targets {
        grid-template-columns: 1fr;
    }
    .cmap-row {
        grid-template-columns: 1fr;
    }
    .cmap-arrow {
        display: none;
    }
    .cmap-feeds {
        padding-left: 8px;
        border-left: 2px solid var(--line);
    }
}


/* Today widget */

.today-widget {
    border-left: 3px solid var(--accent);
}

.today-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.today-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s;
}

.today-check-row:hover {
    background: var(--surface-hover);
}

.today-check-row.today-done {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.today-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.today-zetamac-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.today-zetamac-input {
    width: 90px;
}

.today-zetamac-status {
    margin: -2px 0 10px;
    color: var(--muted);
    font-size: 0.82rem;
}


/* Self-study launch panel */

.self-study-launch-card {
    border-left: 3px solid var(--success);
}

.self-study-health-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(170, 158, 96, 0.24);
    background: rgba(170, 158, 96, 0.1);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.self-study-health-grid,
.self-study-protocol-grid,
.content-audit-grid,
.weekly-review-strip,
.today-command-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.self-study-health-card,
.self-study-protocol-card,
.self-study-next-card,
.content-audit-item,
.weekly-review-card,
.today-command-block {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.self-study-health-card {
    display: grid;
    gap: 6px;
}

.self-study-health-card strong,
.self-study-protocol-card strong,
.self-study-next-card strong,
.content-audit-item strong,
.weekly-review-card strong,
.today-command-card strong,
.today-command-block strong {
    color: var(--text);
    line-height: 1.35;
}

.self-study-health-card span,
.self-study-protocol-card p,
.self-study-next-card p,
.content-audit-item p,
.weekly-review-card p,
.today-command-block p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.self-study-health-card.health-hot {
    border-color: rgba(143, 58, 54, 0.28);
    background: rgba(143, 58, 54, 0.07);
}

.self-study-health-card.health-warm {
    border-color: rgba(228, 191, 131, 0.28);
    background: rgba(228, 191, 131, 0.07);
}

.self-study-health-card.health-calm {
    border-color: rgba(170, 158, 96, 0.2);
    background: rgba(170, 158, 96, 0.06);
}

.self-study-next-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.self-study-next-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.self-study-protocol-card {
    display: grid;
    gap: 6px;
}

.today-command-card {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.06);
}

.today-command-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.today-command-block {
    display: grid;
    gap: 5px;
}

.today-command-block span {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
}

.recommendation-reason {
    margin-top: 4px;
    color: var(--text-soft) !important;
}

.active-load-warning {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(143, 58, 54, 0.24);
    border-radius: 8px;
    background: rgba(143, 58, 54, 0.07);
}

.survival-mode-card {
    margin-top: 12px;
    border-left: 3px solid var(--accent-warm);
}

.survival-mode-card.survival-on {
    border-left-color: var(--success);
    background: color-mix(in srgb, var(--success) 5%, var(--surface-2));
}

.survival-grid,
.output-evidence-grid,
.path-signal-grid,
.monthly-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.survival-item,
.output-type-card,
.path-signal-card,
.monthly-stat-grid article,
.weekly-budget-card,
.stale-warning-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
}

.survival-item {
    display: grid;
    gap: 5px;
}

.survival-item span,
.output-type-card span,
.monthly-stat-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.survival-item strong,
.output-type-card strong,
.monthly-stat-grid strong,
.weekly-budget-card strong,
.stale-warning-card strong {
    color: var(--text);
    line-height: 1.35;
}

.survival-item p,
.weekly-budget-card span,
.stale-warning-card li {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

.survival-inline-note {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(170, 158, 96, 0.22);
    border-radius: 8px;
    background: rgba(170, 158, 96, 0.07);
    color: var(--text-soft);
    font-size: 0.82rem;
}

.survival-inline-note strong {
    color: var(--success);
}

.weekly-budget-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
    align-items: end;
    margin-top: 12px;
    border-left: 3px solid var(--accent);
}

.weekly-budget-card.budget-overloaded {
    border-left-color: #d98a8a;
    background: rgba(143, 58, 54, 0.07);
}

.weekly-hours-field {
    display: grid;
    gap: 5px;
}

.weekly-hours-field span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stale-warning-card {
    margin-top: 12px;
    border-left: 3px solid #8f3a36;
    background: rgba(143, 58, 54, 0.07);
}

.prereq-warning {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed rgba(228, 191, 131, 0.45);
    border-radius: 8px;
    background: rgba(228, 191, 131, 0.07);
}

.prereq-warning strong {
    color: var(--accent-warm);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prereq-warning p,
.prereq-warning span {
    color: var(--text-soft);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

.weekly-review-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.weekly-review-card {
    display: grid;
    gap: 5px;
}

.content-audit-card {
    border-left: 3px solid var(--accent);
}

.content-audit-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-audit-item {
    display: grid;
    gap: 6px;
}

.output-evidence-card {
    border-left: 3px solid var(--accent);
}

.output-type-card {
    display: grid;
    gap: 5px;
    text-align: left;
}

.output-type-card strong {
    font-size: 1.45rem;
}

.output-add-form {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 1.4fr 150px;
    gap: 10px;
    align-items: end;
}

.output-wide-field {
    grid-column: span 3;
}

.output-list {
    display: grid;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.output-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.output-row-title {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.output-row-title strong {
    color: var(--text);
}

.output-row-title span {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.output-row p {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 4px 0;
}

.path-ladder-card {
    border-left: 3px solid var(--success);
}

.path-signal-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.path-signal-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
}

.path-signal-rank {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 16%, transparent);
    color: var(--success);
    font-weight: 900;
    font-size: 0.78rem;
}

.path-signal-card strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.path-signal-card p {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
    margin: 4px 0 0;
}

.path-signal-card p span {
    color: var(--text-soft);
    font-weight: 800;
}

.monthly-recalibration-card {
    border-left: 3px solid var(--accent-warm);
}

.monthly-stat-grid article {
    display: grid;
    gap: 5px;
}

.monthly-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.monthly-field {
    display: grid;
    gap: 6px;
}

.monthly-field span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.acceleration-card {
    border-left: 3px solid var(--accent-warm);
}

.acceleration-card.acceleration-on {
    border-left-color: var(--success);
    background: color-mix(in srgb, var(--success) 5%, var(--surface-2));
}

.acceleration-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.acceleration-summary-grid article,
.acceleration-target {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
}

.acceleration-summary-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.acceleration-summary-grid strong {
    display: block;
    color: var(--text);
    margin-top: 3px;
}

.acceleration-summary-grid p,
.acceleration-target p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.42;
    margin: 5px 0 0;
}

.acceleration-target-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.acceleration-target {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border-left: 3px solid var(--line-strong);
}

.acceleration-target.acc-ready {
    border-left-color: var(--success);
}

.acceleration-target.acc-hold {
    opacity: 0.78;
}

.acceleration-target.acc-applied {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-left-color: var(--accent);
}

.acc-target-actions {
    display: flex;
    justify-content: flex-end;
}

.first-putnam-audit-card {
    border-left: 3px solid var(--accent);
}

.first-putnam-audit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.first-putnam-gate {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
}

.first-putnam-gate span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.first-putnam-gate strong {
    color: var(--text);
}

.first-putnam-gate p,
.first-putnam-gate small {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

.first-putnam-gate.gate-hot {
    border-color: rgba(143, 58, 54, 0.28);
    background: rgba(143, 58, 54, 0.07);
}

.first-putnam-gate.gate-done {
    border-color: rgba(170, 158, 96, 0.25);
    background: rgba(170, 158, 96, 0.07);
}

.putnam-maturity-card {
    border-left: 3px solid var(--accent-warm);
}

.putnam-maturity-intro {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.45;
}

.putnam-maturity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.putnam-maturity-block {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
}

.putnam-maturity-head {
    display: grid;
    gap: 4px;
}

.putnam-maturity-head span,
.putnam-maturity-section span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.putnam-maturity-head strong {
    color: var(--text);
    font-size: 0.96rem;
}

.putnam-maturity-head small {
    width: fit-content;
}

.putnam-maturity-section {
    display: grid;
    gap: 6px;
}

.putnam-maturity-section ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.putnam-maturity-tricks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.putnam-maturity-tricks em {
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 999px;
    background: rgba(228, 191, 131, 0.08);
    color: var(--text-soft);
    font-size: 0.7rem;
    font-style: normal;
    padding: 3px 8px;
}

.putnam-maturity-sheet,
.putnam-maturity-output {
    display: grid;
    gap: 3px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.putnam-maturity-sheet strong,
.putnam-maturity-output strong {
    color: var(--text);
    font-size: 0.78rem;
}

.putnam-maturity-sheet p,
.putnam-maturity-output p {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}


/* Quarter hours chart */

.quarter-chart {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    min-height: 140px;
    padding: 12px 0 0;
    overflow-x: auto;
}

.quarter-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 64px;
}

.quarter-bar-track {
    width: 40px;
    height: 100px;
    background: var(--surface);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.quarter-bar-fill {
    width: 100%;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    min-height: 2px;
}

.quarter-bar-heavy {
    background: #8f3a36;
}

.quarter-bar-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
}

.quarter-bar-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.quarter-bar-count {
    font-size: 0.68rem;
    color: var(--muted);
}

.quarter-policy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}

.quarter-policy-row span {
    font-size: 0.72rem;
    color: var(--text-soft);
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 4px 8px;
}

.quarter-bar-status {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    padding: 2px 5px;
}

.quarter-good .quarter-bar-status {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, transparent);
}

.quarter-filled .quarter-bar-status {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, transparent);
}

.quarter-trimmed .quarter-bar-status {
    color: var(--accent-warm);
    background: color-mix(in srgb, var(--accent-warm) 14%, transparent);
}

.quarter-watch .quarter-bar-status {
    color: var(--accent-warm);
    background: color-mix(in srgb, var(--accent-warm) 12%, transparent);
}

.quarter-under .quarter-bar-status {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.quarter-heavy .quarter-bar-status {
    color: #d98a8a;
    background: rgba(143, 58, 54, 0.12);
}

.quarter-guidance-list {
    display: grid;
    gap: 7px;
    margin-top: 12px;
}

.quarter-guidance-row {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
    padding: 9px 11px;
}

.quarter-guidance-row strong {
    color: var(--text);
    font-size: 0.82rem;
}

.quarter-guidance-row span {
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.quarter-guidance-row em {
    color: var(--muted);
    font-size: 0.75rem;
    font-style: normal;
}

.quarter-guidance-row.quarter-under {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.06);
}

.quarter-guidance-row.quarter-heavy {
    border-color: rgba(143, 58, 54, 0.35);
    background: rgba(143, 58, 54, 0.06);
}

.quarter-guidance-row.quarter-good {
    border-color: color-mix(in srgb, var(--success) 35%, var(--line));
    background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

.quarter-guidance-row.quarter-filled {
    border-color: color-mix(in srgb, var(--success) 30%, var(--line));
    background: color-mix(in srgb, var(--success) 6%, var(--surface));
}

.quarter-guidance-row.quarter-trimmed {
    border-color: color-mix(in srgb, var(--accent-warm) 35%, var(--line));
    background: color-mix(in srgb, var(--accent-warm) 7%, var(--surface));
}


/* Combined deadline queue */

.recommendation-card {
    border-left: 3px solid var(--accent-warm);
}

.deadline-next-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(228, 191, 131, 0.55) rgba(168, 186, 214, 0.08);
}

.deadline-next-list::-webkit-scrollbar,
.deadline-event-list::-webkit-scrollbar {
    width: 8px;
}

.deadline-next-list::-webkit-scrollbar-track,
.deadline-event-list::-webkit-scrollbar-track {
    background: rgba(168, 186, 214, 0.08);
    border-radius: 999px;
}

.deadline-next-list::-webkit-scrollbar-thumb,
.deadline-event-list::-webkit-scrollbar-thumb {
    background: rgba(228, 191, 131, 0.45);
    border-radius: 999px;
}

.deadline-next-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.deadline-next-item.status-in-progress {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.deadline-next-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
}

.deadline-next-main {
    min-width: 0;
}

.deadline-next-title-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.deadline-next-title-row strong {
    font-size: 0.94rem;
    color: var(--text);
}

.deadline-next-title-row span {
    font-size: 0.78rem;
    color: var(--muted);
}

.deadline-next-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 0.74rem;
    color: var(--muted);
}

.deadline-next-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}


/* Study support on book cards */

.study-support-box {
    margin-top: 10px;
    padding: 0;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.study-support-summary {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
}

.study-support-summary strong {
    font-size: 0.76rem;
    color: var(--text);
}

.study-support-summary span:last-child {
    font-size: 0.74rem;
    color: var(--muted);
    justify-self: end;
}

.study-support-body {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
    border-top: 1px solid var(--line);
}

.resource-assigned-now {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.resource-assigned-head {
    display: grid;
    gap: 3px;
}

.resource-assigned-head span {
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.resource-assigned-head strong {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.35;
}

.resource-assigned-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.resource-assigned-chips span {
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 3px 7px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 700;
}

.resource-assigned-now p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.79rem;
    line-height: 1.45;
}

.resource-assigned-now p strong {
    color: var(--text);
}

.resource-use-order {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
}

.resource-use-order span {
    font-size: 0.7rem;
    color: var(--text-soft);
    background: rgba(170, 158, 96, 0.08);
    border: 1px solid rgba(170, 158, 96, 0.16);
    border-radius: 999px;
    padding: 3px 8px;
}

.resource-secondary-details {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
}

.resource-secondary-details>summary {
    cursor: pointer;
    padding: 10px 12px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.resource-secondary-body {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
    border-top: 1px solid var(--line);
}

.resource-section {
    display: grid;
    gap: 6px;
    padding-top: 10px;
}

.resource-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.resource-primary-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: baseline;
}

.resource-primary-row small {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.resource-kind {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}

.resource-extra-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.resource-extra-list span {
    font-size: 0.7rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2px 6px;
}

.support-chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.support-chip {
    font-size: 0.72rem;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
}

.support-paid-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--muted);
}

.support-paid-row span:not(.support-paid-label) {
    padding: 2px 7px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--accent-warm) 10%, transparent);
    color: var(--text-soft);
}

.support-paid-label {
    font-weight: 700;
    color: var(--accent-warm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.deadline-event-card {
    border-left: 3px solid var(--accent);
}

.deadline-event-list {
    display: grid;
    gap: 7px;
    max-height: 460px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(228, 191, 131, 0.55) rgba(168, 186, 214, 0.08);
}

.deadline-event-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.deadline-event-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--success);
    margin-top: 2px;
}

.deadline-event-checkpoint {
    border-left: 2px solid var(--accent-warm);
}

.deadline-event-final {
    border-left: 2px solid var(--accent);
}

.deadline-event-title {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.deadline-event-title strong {
    color: var(--text);
    font-size: 0.88rem;
}

.deadline-event-title span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.deadline-event-meta {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.73rem;
}

.today-command-center {
    border-left: 3px solid var(--accent);
}

.today-command-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.today-command-card {
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.today-command-card span {
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
}

.today-command-card strong {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.25;
}

.today-command-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.today-command-warn {
    border-color: rgba(228, 191, 131, 0.3);
    background: rgba(228, 191, 131, 0.06);
}

.weekly-hours-field.inline-hours {
    display: grid;
    grid-template-columns: auto 72px;
    gap: 6px;
    align-items: center;
    margin-top: auto;
}

.weekly-hours-field.inline-hours span {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.74rem;
}

.timeline-coverage-audit {
    border-style: dashed;
}

.timeline-coverage-audit summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--text);
}

.timeline-coverage-audit summary span {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.timeline-coverage-audit summary strong {
    font-size: 0.9rem;
}

.audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.audit-summary-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
}

.audit-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
}

.audit-summary-grid strong {
    color: var(--text);
    font-size: 1.05rem;
}

.audit-list {
    display: grid;
    gap: 7px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 10px;
    padding-right: 4px;
}

.audit-list div {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 8px 10px;
}

.audit-list strong {
    color: var(--text);
    font-size: 0.82rem;
}

.audit-list span {
    color: var(--text-soft);
    font-size: 0.78rem;
}

.backup-reminder-card {
    border-left: 3px solid var(--accent-warm);
}

.quarter-lock-card {
    border-left: 3px solid var(--accent);
}

.quarter-lock-card.quarter-locked {
    border-left-color: var(--success);
}

.adaptive-pace-card {
    border-left: 3px solid var(--success);
}

.adaptive-pace-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.adaptive-pace-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.adaptive-pace-meta span {
    font-size: 0.72rem;
    color: var(--muted);
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 3px 8px;
}

.adaptive-pace-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.planner-checkpoints {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    border: 1px solid var(--line);
}

.planner-checkpoint-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.planner-checkpoint-row+.planner-checkpoint-row {
    border-top: 1px solid var(--line);
}

.planner-checkpoint-row.checkpoint-done {
    color: var(--muted);
    opacity: 0.75;
}

.planner-checkpoint-box {
    width: 15px;
    height: 15px;
    accent-color: var(--success);
}

.checkpoint-label {
    font-weight: 600;
    color: var(--text);
}

.checkpoint-done .checkpoint-label {
    text-decoration: line-through;
    color: var(--muted);
}

.checkpoint-date {
    color: var(--muted);
    white-space: nowrap;
}

.checkpoint-status {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}


/* Zetamac logger */

.zetamac-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.zetamac-stat-grid article {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(14, 24, 34, 0.72);
    padding: 10px 12px;
}

.zetamac-stat-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.zetamac-stat-grid strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
    margin-top: 2px;
    line-height: 1.25;
}

.zetamac-targets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.zetamac-target-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    min-width: 72px;
    position: relative;
}

.zetamac-target-badge.zt-achieved {
    background: color-mix(in srgb, var(--success) 15%, transparent);
    border-color: var(--success);
}

.zt-score {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.zt-label {
    font-size: 0.72rem;
    color: var(--muted);
}

.zt-check {
    position: absolute;
    top: 6px;
    right: 8px;
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 700;
}

.zetamac-progress-box {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 10px;
    background: rgba(228, 191, 131, 0.07);
}

.zetamac-progress-box div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.zetamac-progress-box strong {
    color: var(--text);
}

.zetamac-progress-box span {
    color: var(--muted);
    font-size: 0.82rem;
}

.zetamac-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(168, 186, 214, 0.12);
    overflow: hidden;
}

.zetamac-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--success), var(--accent));
}

.zetamac-log-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.zetamac-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.zetamac-date-input {
    width: 150px;
}

.zetamac-score-input {
    width: 100px;
}

.zetamac-score-input.input-error,
.today-zetamac-input.input-error {
    border-color: #ff9c9c;
    box-shadow: 0 0 0 2px rgba(255, 156, 156, 0.22);
}

.zetamac-best {
    font-size: 0.85rem;
    color: var(--text-soft);
    margin: 0;
}

.zetamac-chart {
    position: relative;
    padding: 8px 0 0;
}

.zetamac-chart-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.zetamac-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 100px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.zetamac-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 20px;
    height: 100%;
    justify-content: flex-end;
}

.zetamac-bar {
    width: 16px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    transition: height 0.3s;
    min-height: 2px;
}

.zetamac-bar-score {
    font-size: 0.6rem;
    color: var(--muted);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.zetamac-target-lines {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
}

.zetamac-target-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    border-top: 1px dashed color-mix(in srgb, var(--accent-warm) 50%, transparent);
}

.zetamac-history {
    margin-top: 14px;
    display: grid;
    gap: 7px;
}

.zetamac-history-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 80px auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(14, 24, 34, 0.72);
}

.zetamac-history-row span {
    color: var(--muted);
    font-size: 0.82rem;
}

.zetamac-history-row strong {
    color: var(--text);
}

.zetamac-history-row button {
    padding: 5px 8px;
    min-height: 30px;
}


/* Platform milestones */

.platform-achievement-groups {
    display: grid;
    gap: 12px;
}

.platform-achievement-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.platform-achievement-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.platform-achievement-head strong {
    display: block;
    color: var(--text);
    font-size: 0.92rem;
}

.platform-achievement-head span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 2px;
}

.platform-achievement-head em {
    font-style: normal;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.platform-achievement-bar {
    height: 5px;
    background: rgba(168, 186, 214, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.platform-achievement-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--accent));
    border-radius: inherit;
    transition: width 240ms ease;
}

.platform-milestones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.platform-achievement-group .platform-milestones {
    margin-bottom: 0;
}

.platform-milestone-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
}

.platform-milestone-row:hover {
    background: var(--surface-hover);
}

.platform-milestone-row.pm-done {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    border-color: var(--success);
}

.pm-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--success);
    flex-shrink: 0;
}

.pm-label {
    font-size: 0.88rem;
    color: var(--text);
    flex: 1;
}

.pm-note {
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
}


/* Internship tracker */

.internship-context {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.internship-milestone {
    background: var(--surface);
    border-radius: 8px;
    padding: 10px 14px;
    flex: 1;
    min-width: 220px;
    border-left: 3px solid var(--accent-warm);
}

.im-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-warm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.im-when {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 2px 0;
}

.im-note {
    display: block;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.internship-add-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    align-items: center;
}

.internship-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.intern-row {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 60px 110px 1.5fr 30px;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.83rem;
}

.intern-row:last-child {
    border-bottom: none;
}

.intern-head {
    background: var(--surface);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.intern-firm {
    font-weight: 600;
    color: var(--text);
}

.intern-role {
    color: var(--text-soft);
}

.intern-year {
    color: var(--muted);
}

.intern-status-select {
    width: 100%;
    font-size: 0.8rem;
}

.intern-notes-input {
    width: 100%;
    font-size: 0.8rem;
    padding: 4px 6px;
}

.intern-delete-btn {
    padding: 2px 6px;
    font-size: 0.75rem;
    opacity: 0.5;
}

.intern-delete-btn:hover {
    opacity: 1;
    color: #d98a8a;
}

@media (max-width: 700px) {
    .workspace-sidebar.career-mode .sidebar-brand,
    .workspace-sidebar.tracker-mode .sidebar-brand {
        flex-direction: column;
        align-items: stretch;
    }
    .site-mode-switch {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .career-hero {
        align-items: stretch;
    }
    .career-hero-actions,
    .career-hero-actions a {
        width: 100%;
    }
    .career-stat-strip,
    .career-dashboard-grid,
    .career-signal-grid,
    .career-school-grid {
        grid-template-columns: 1fr;
    }
    .career-nav-scroll {
        grid-template-columns: repeat(7, 120px);
    }
    .career-deadline-row,
    .career-app-row {
        grid-template-columns: 24px minmax(0, 1fr);
    }
    .career-app-row {
        grid-template-columns: 1fr;
    }
    .career-next-action {
        grid-template-columns: 34px minmax(0, 1fr);
    }
    .career-next-action button {
        grid-column: 2;
        justify-self: start;
    }
    .career-deadline-row .career-lane,
    .career-deadline-row .deadline-pill,
    .career-deadline-row .career-type-pill,
    .career-deadline-row .career-score-pill,
    .career-deadline-row .priority-pill {
        grid-column: 2;
        justify-self: start;
    }
    .intern-row {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .intern-head {
        display: none;
    }
    .internship-context {
        flex-direction: column;
    }
    .self-study-health-grid,
    .self-study-protocol-grid,
    .self-study-next-strip,
    .content-audit-grid,
    .audit-summary-grid,
    .audit-list div,
    .weekly-review-strip,
    .today-command-grid,
    .survival-grid,
    .output-evidence-grid,
    .path-signal-grid,
    .monthly-stat-grid,
    .acceleration-summary-grid,
    .first-putnam-audit-grid,
    .putnam-maturity-grid,
    .monthly-form,
    .output-add-form {
        grid-template-columns: 1fr;
    }
    .weekly-budget-card,
    .output-row,
    .acceleration-target {
        grid-template-columns: 1fr;
    }
    .acc-target-actions {
        justify-content: flex-start;
    }
    .output-wide-field {
        grid-column: auto;
    }
    .planner-checkpoint-row {
        grid-template-columns: 18px 1fr;
    }
    .self-study-next-card {
        grid-template-columns: 28px minmax(0, 1fr);
    }
    .self-study-next-card button {
        grid-column: 2;
        justify-self: start;
    }
    .quarter-chart {
        gap: 6px;
    }
    .quarter-bar-track {
        width: 30px;
    }
    .deadline-next-item {
        grid-template-columns: 28px 1fr;
    }
    .deadline-next-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
    .study-support-summary {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .study-support-summary span:last-child {
        justify-self: start;
    }
    .resource-primary-row {
        grid-template-columns: 1fr;
    }
    .resource-primary-row small {
        grid-column: 1;
    }
    .planner-checkpoint-row {
        grid-template-columns: 18px 1fr;
    }
    .checkpoint-date,
    .checkpoint-status {
        grid-column: 2;
    }
    .zetamac-targets {
        gap: 8px;
    }
}


/* Three-axis impact scores */

.impact-scores {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.impact-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.impact-score {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.impact-critical {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
}

.impact-high {
    background: color-mix(in srgb, var(--success) 20%, transparent);
    color: var(--success);
}

.impact-med {
    background: color-mix(in srgb, var(--accent-warm) 20%, transparent);
    color: var(--accent-warm);
}

.impact-low {
    background: var(--surface);
    color: var(--muted);
}


/* Tier 3 / PhD Year 1 book visual treatment */

.tier3-item {
    opacity: 0.65;
    border-left: 3px solid var(--muted) !important;
}

.tier3-item:hover {
    opacity: 0.85;
}

.tier3-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--line);
    font-weight: 600;
}

.phd-year1-item {
    border-left: 3px solid #a78bfa !important;
}

.phd-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: color-mix(in srgb, #a78bfa 15%, transparent);
    color: #a78bfa;
    font-weight: 600;
}

.conditional-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--accent-warm) 15%, transparent);
    color: var(--accent-warm);
    font-weight: 600;
    border: 1px dashed var(--accent-warm);
}


/* Timeline survivability and decision boxes */

.tl-survivability-box {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: color-mix(in srgb, #8f3a36 8%, transparent);
    border-left: 3px solid #8f3a36;
    font-size: 0.83rem;
    color: var(--text-soft);
}

.tl-ahlfors-box {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent-warm) 8%, transparent);
    border-left: 3px solid var(--accent-warm);
    font-size: 0.83rem;
    color: var(--text-soft);
}

.partial-toolbox-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(228, 191, 131, 0.2);
    border-radius: var(--radius-1);
    background: rgba(228, 191, 131, 0.055);
}

.partial-toolbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.partial-toolbox-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(8, 14, 24, 0.72);
}

.partial-toolbox-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}


/* ============================================================
   GAMIFICATION
   Streak countdown, daily quests, doomscroll logger, quote card,
   XP wheel reward, achievement toasts, anti-doomscroll interrupts.
   Monkeytype-inspired dark palette. No mascots. No childishness.
   ============================================================ */

#gam-root {
    pointer-events: none;
}

#gam-root>* {
    pointer-events: auto;
}

.gam-deck {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 18px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gam-deck>article {
    min-width: 0;
    box-sizing: border-box;
}


/* ----- Streak widget ----- */

.gam-streak-widget {
    background: linear-gradient(135deg, #0a1726 0%, #0d2138 100%);
    border: 1px solid #1c3450;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.gam-streak-widget.gam-streak-danger {
    border-color: #e0a83a;
    box-shadow: 0 0 0 1px rgba(224, 168, 58, 0.3);
}

.gam-streak-widget.gam-streak-critical {
    border-color: #d98a8a;
    animation: gam-pulse-red 1.4s ease-in-out infinite;
}

@keyframes gam-pulse-red {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(143, 58, 54, 0.45);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(143, 58, 54, 0);
    }
}

.gam-streak-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.gam-streak-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #6c8baa;
    margin: 0;
}

.gam-streak-days {
    font-size: 36px;
    line-height: 1;
    color: #f4ecd8;
    font-variant-numeric: tabular-nums;
}

.gam-streak-body {
    color: #b8c8da;
    font-size: 13px;
    line-height: 1.5;
}

.gam-streak-body strong[data-gam-streak-countdown] {
    color: #f4d28a;
    font-variant-numeric: tabular-nums;
}

.gam-streak-widget.gam-streak-critical .gam-streak-body strong[data-gam-streak-countdown] {
    color: #d98a8a;
}

.gam-streak-freezes {
    margin-top: 4px !important;
    color: #79b0e6 !important;
    font-size: 12px;
}


/* ----- Quest panel ----- */

.gam-quest-panel {
    background: linear-gradient(135deg, #0a1f1a 0%, #0d2820 100%);
    border: 1px solid #1d4438;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gam-quest-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.gam-quest-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #5f9c87;
    margin: 0 0 2px 0;
}

.gam-quest-header small {
    color: #7eb3a0;
    font-size: 12px;
}

.gam-quest-chest-hint {
    font-size: 11px;
    color: #c9a86a;
    background: rgba(201, 168, 106, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(201, 168, 106, 0.3);
}

.gam-quest-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gam-quest-item label {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.15s;
}

.gam-quest-item label:hover {
    background: rgba(255, 255, 255, 0.06);
}

.gam-quest-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #a99e5e;
}

.gam-quest-item strong {
    color: #e8f0e8;
    font-size: 13px;
    display: block;
}

.gam-quest-item small {
    color: #97a8a0;
    font-size: 11px;
    display: block;
    margin-top: 2px;
}

.gam-quest-item em {
    color: #f4d28a;
    font-style: normal;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.gam-quest-done strong {
    text-decoration: line-through;
    opacity: 0.6;
}

.gam-quest-done em {
    opacity: 0.5;
}


/* ----- Doomscroll logger ----- */

.gam-doomscroll-logger {
    background: linear-gradient(135deg, #1f0e1a 0%, #2a1626 100%);
    border: 1px solid #4a2238;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gam-doomscroll-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #b87a98;
    margin: 0 0 2px 0;
}

.gam-doomscroll-logger header small {
    color: #9e8294;
    font-size: 12px;
}

.gam-doomscroll-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gam-doomscroll-form label {
    display: grid;
    grid-template-columns: 80px 60px 1fr;
    align-items: center;
    gap: 8px;
    color: #d6c4d0;
    font-size: 13px;
}

.gam-doomscroll-form input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4ecd8;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

.gam-doomscroll-total {
    color: #e8d4dc;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
    margin: 4px 0 0 0;
}

.gam-doomscroll-total strong {
    color: #f4d28a;
    font-variant-numeric: tabular-nums;
}

.gam-doomscroll-streak {
    color: #6ec896;
    font-size: 12px;
    margin: 0;
}

.gam-doomscroll-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* ----- Quote card ----- */

.gam-quote-card {
    background: linear-gradient(135deg, #15131f 0%, #1d1a2c 100%);
    border: 1px solid #2e2945;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
}

.gam-quote-card blockquote {
    margin: 0;
    color: #d6cfe5;
    font-size: 14px;
    line-height: 1.55;
    font-style: italic;
}

.gam-quote-card cite {
    display: block;
    margin-top: 8px;
    color: #8b86a4;
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.04em;
}


/* ----- Buttons ----- */

.gam-action-button {
    background: linear-gradient(180deg, #8a6a32 0%, #6e5226 100%);
    color: #fff;
    border: 1px solid #a07d3a;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.gam-action-button:hover {
    background: linear-gradient(180deg, #a07d3a 0%, #8a6a32 100%);
}

.gam-ghost-button {
    background: transparent;
    color: #b8c8da;
    border: 1px solid #2c4869;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.gam-ghost-button:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f4ecd8;
}


/* ----- XP reward flash ----- */

.gam-xp-flash {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    background: linear-gradient(135deg, #1a3a2c 0%, #1f4a36 100%);
    border: 2px solid #a99e5e;
    border-radius: 10px;
    padding: 14px 22px;
    color: #e8f0e8;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: gam-xp-enter 0.3s ease-out;
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
}

.gam-xp-flash.gam-xp-flash-leave {
    opacity: 0;
    transform: translateX(20px);
}

@keyframes gam-xp-enter {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.gam-xp-flash-inner strong {
    display: block;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

.gam-xp-flash-inner small {
    display: block;
    font-size: 12px;
    color: #a0c4b4;
    margin-top: 2px;
}

.gam-rarity-common {
    border-color: #6e7c89;
}

.gam-rarity-uncommon {
    border-color: #a99e5e;
}

.gam-rarity-rare {
    border-color: #4e9ce8;
    box-shadow: 0 0 24px rgba(228, 191, 131, 0.4);
}

.gam-rarity-epic {
    border-color: #d98a8a;
    box-shadow: 0 0 32px rgba(143, 58, 54, 0.5);
    animation: gam-xp-enter 0.3s ease-out, gam-pulse-epic 1.5s ease-in-out 0.3s;
}

.gam-rarity-legendary {
    border-color: #f4c84a;
    box-shadow: 0 0 40px rgba(244, 200, 74, 0.6);
    animation: gam-xp-enter 0.3s ease-out, gam-pulse-legendary 1.5s ease-in-out 0.3s infinite;
}

@keyframes gam-pulse-epic {
    0%,
    100% {
        box-shadow: 0 0 32px rgba(143, 58, 54, 0.5);
    }
    50% {
        box-shadow: 0 0 48px rgba(143, 58, 54, 0.8);
    }
}

@keyframes gam-pulse-legendary {
    0%,
    100% {
        box-shadow: 0 0 40px rgba(244, 200, 74, 0.6);
    }
    50% {
        box-shadow: 0 0 64px rgba(244, 200, 74, 0.95);
    }
}


/* ----- Achievement toast ----- */

.gam-toast-stack {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9998;
    max-width: 360px;
    pointer-events: none;
}

.gam-toast {
    background: rgba(10, 18, 28, 0.96);
    border: 2px solid #6e7c89;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
    animation: gam-toast-enter 0.35s ease-out;
    transition: opacity 0.6s, transform 0.6s;
    pointer-events: none;
}

.gam-toast * {
    pointer-events: none;
}

.gam-toast.gam-toast-leave {
    opacity: 0;
    transform: translateX(40px);
}

@keyframes gam-toast-enter {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gam-toast-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #8aa0b8;
    margin: 0 0 4px 0;
}

.gam-toast strong {
    display: block;
    color: #f4ecd8;
    font-size: 16px;
    margin-bottom: 4px;
}

.gam-toast small {
    display: block;
    color: #b8c8da;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.gam-toast em {
    color: #f4d28a;
    font-style: normal;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}


/* ----- Bonus chest ----- */

.gam-bonus-chest {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
    animation: gam-fade-in 0.3s ease-out;
}

@keyframes gam-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gam-bonus-chest-inner {
    background: linear-gradient(135deg, #1d1808 0%, #2e2510 100%);
    border: 2px solid #f4c84a;
    border-radius: 16px;
    padding: 32px 36px;
    max-width: 540px;
    text-align: center;
    box-shadow: 0 0 80px rgba(244, 200, 74, 0.4);
    animation: gam-chest-enter 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes gam-chest-enter {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.gam-bonus-eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #f4c84a;
    margin: 0 0 8px 0;
}

.gam-bonus-chest-inner h3 {
    color: #f4ecd8;
    font-size: 22px;
    margin: 0 0 20px 0;
}

.gam-bonus-chest-inner blockquote {
    color: #d6cfe5;
    font-style: italic;
    font-size: 15px;
    line-height: 1.55;
    border-left: 2px solid #f4c84a;
    padding-left: 16px;
    margin: 0 0 20px 0;
    text-align: left;
}

.gam-bonus-chest-inner cite {
    display: block;
    margin-top: 8px;
    color: #c9a86a;
    font-style: normal;
    font-size: 12px;
}


/* ----- Interrupt modal ----- */

.gam-interrupt {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 24px;
    animation: gam-fade-in 0.25s ease-out;
}

.gam-interrupt-card {
    max-height: 85vh;
    overflow-y: auto;
    background: #0a1726;
    border-radius: 14px;
    padding: 32px 36px;
    max-width: 560px;
    border: 2px solid #2c4869;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7);
    animation: gam-chest-enter 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.gam-interrupt-soft .gam-interrupt-card {
    max-height: 85vh;
    overflow-y: auto;
    border-color: #2c4869;
}

.gam-interrupt-medium .gam-interrupt-card {
    max-height: 85vh;
    overflow-y: auto;
    border-color: #c9a86a;
    box-shadow: 0 16px 64px rgba(201, 168, 106, 0.2);
}

.gam-interrupt-hard .gam-interrupt-card {
    max-height: 85vh;
    overflow-y: auto;
    border-color: #d98a8a;
    box-shadow: 0 16px 80px rgba(143, 58, 54, 0.3);
}

.gam-interrupt-eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #8aa0b8;
    margin: 0 0 12px 0;
}

.gam-interrupt-medium .gam-interrupt-eyebrow {
    color: #c9a86a;
}

.gam-interrupt-hard .gam-interrupt-eyebrow {
    color: #d98a8a;
}

.gam-interrupt-card h2 {
    color: #f4ecd8;
    font-size: 26px;
    line-height: 1.25;
    margin: 0 0 14px 0;
}

.gam-interrupt-card p {
    color: #b8c8da;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 22px 0;
}

.gam-interrupt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* ----- Mobile ----- */

@media (max-width: 720px) {
    .gam-deck {
        grid-template-columns: 1fr;
    }
    .gam-toast-stack {
        max-width: calc(100vw - 24px);
        top: auto;
        bottom: 74px;
        left: 12px;
    }
    .gam-xp-flash {
        top: 12px;
        right: 12px;
    }
    .gam-interrupt-card,
    .gam-bonus-chest-inner {
        padding: 24px 22px;
    }
    .gam-interrupt-card h2 {
        font-size: 22px;
    }
}


/* ============================================================
   GAMIFICATION PLUS — slot wheel, confetti, level-up, heat map,
   rare problem, quote feed, XP counter, combo, audio toggle
   ============================================================ */


/* ----- Slot wheel XP animation ----- */

.gam-slot {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    background: linear-gradient(135deg, #0a1726 0%, #0d2138 100%);
    border: 2px solid #6e7c89;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-out, opacity 0.5s;
    pointer-events: none;
}

.gam-slot * {
    pointer-events: none;
}

.gam-slot.gam-slot-leave {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
}

.gam-slot-inner {
    display: flex;
    align-items: center;
    gap: 18px;
}

.gam-slot-reels {
    display: flex;
    gap: 4px;
    background: #000;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #2a3a4d;
}

.gam-slot-reel {
    width: 36px;
    height: 48px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: 3px;
}

.gam-slot-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.gam-slot-strip span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    font-size: 30px;
    font-weight: 600;
    color: #f4d28a;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.gam-slot-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gam-slot-xp {
    font-size: 26px;
    color: #f4ecd8;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.gam-slot-result small {
    color: #a0c4b4;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.gam-slot-result em {
    color: #b8c8da;
    font-size: 12px;
    font-style: normal;
}

.gam-slot.gam-rarity-uncommon {
    border-color: #a99e5e;
}

.gam-slot.gam-rarity-rare {
    border-color: #4e9ce8;
    box-shadow: 0 0 32px rgba(228, 191, 131, 0.4), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.gam-slot.gam-rarity-epic {
    border-color: #d98a8a;
    box-shadow: 0 0 40px rgba(143, 58, 54, 0.5), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.gam-slot.gam-rarity-legendary {
    border-color: #f4c84a;
    box-shadow: 0 0 56px rgba(244, 200, 74, 0.7), 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: gam-pulse-legendary 1.5s ease-in-out infinite;
}


/* ----- Confetti ----- */

.gam-confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10002;
    overflow: hidden;
}

.gam-confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    animation: gam-confetti-fall linear forwards;
}

@keyframes gam-confetti-fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}


/* ----- Level-up modal ----- */

.gam-level-up {
    position: fixed;
    top: 88px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    background: transparent;
    animation: gam-fade-in 0.3s ease-out;
    pointer-events: none;
}


/* Let celebration play without delaying the next study action. */

.gam-slot,
.gam-confetti-container,
.gam-level-up,
.gam-toast-stack,
.gam-xp-flash {
    pointer-events: none !important;
}

.gam-level-up-inner {
    background: linear-gradient(135deg, #1d1808 0%, #2e2510 100%);
    border: 2px solid #f4c84a;
    border-radius: 10px;
    padding: 14px 20px;
    text-align: center;
    box-shadow: 0 0 40px rgba(244, 200, 74, 0.42);
    animation: gam-chest-enter 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

.gam-level-up-eyebrow {
    font-size: 12px;
    letter-spacing: 0.3em;
    color: #f4c84a;
    margin: 0 0 8px 0;
}

.gam-level-up-inner strong {
    display: block;
    font-size: 46px;
    line-height: 1;
    color: #f4ecd8;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 32px rgba(244, 200, 74, 0.6);
}

.gam-level-up-inner p {
    color: #c9a86a;
    font-size: 12px;
    margin: 6px 0 0;
}


/* ----- XP counter widget ----- */

.gam-xp-counter-widget {
    background: linear-gradient(135deg, #0d0a1a 0%, #15102a 100%);
    border: 1px solid #2c2349;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.gam-xp-counter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.gam-xp-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #8a7cb8;
    margin: 0;
}

.gam-xp-value {
    font-size: 28px;
    color: #f4ecd8;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 16px rgba(143, 58, 54, 0.3);
}

.gam-xp-level-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin: 4px 0;
}

.gam-xp-level-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4e9ce8, #8f3a36, #f4c84a);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gam-xp-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #8a7cb8;
}

.gam-combo-display {
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(244, 200, 74, 0.08);
    border: 1px solid rgba(244, 200, 74, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.gam-combo-display strong {
    color: #f4c84a;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.gam-combo-display small {
    color: #c9a86a;
    font-size: 11px;
}


/* ----- Heat map ----- */

.gam-heatmap-widget {
    background: linear-gradient(135deg, #0a1f1a 0%, #0d2820 100%);
    border: 1px solid #1d4438;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

@media (min-width: 980px) {
    .gam-heatmap-widget {
        grid-column: span 2;
    }
}

.gam-heatmap-widget header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.gam-heatmap-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #5f9c87;
    margin: 0;
}

.gam-heatmap-widget header small {
    color: #7eb3a0;
    font-size: 12px;
}

.gam-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 3px;
    margin-top: 6px;
}

.gam-heatmap-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: #1a2a22;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: transform 0.15s;
    cursor: help;
}

.gam-heatmap-cell:hover {
    transform: scale(1.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.gam-heatmap-cell.gam-heat-0 {
    background: #1a2a22;
}

.gam-heatmap-cell.gam-heat-1 {
    background: #2a5640;
}

.gam-heatmap-cell.gam-heat-2 {
    background: #3d8460;
}

.gam-heatmap-cell.gam-heat-3 {
    background: #50b080;
}

.gam-heatmap-cell.gam-heat-4 {
    background: #6ad8a0;
}

.gam-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #7eb3a0;
    margin-top: 8px;
}

.gam-heatmap-legend .gam-heatmap-cell {
    width: 12px;
    height: 12px;
    aspect-ratio: auto;
}


/* ----- Quote feed (swipeable) ----- */

.gam-quote-feed {
    background: linear-gradient(135deg, #15131f 0%, #1d1a2c 100%);
    border: 1px solid #2e2945;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.gam-quote-feed header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.gam-quote-feed-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #8b86a4;
    margin: 0;
}

.gam-quote-feed header small {
    color: #8b86a4;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.gam-quote-feed-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.gam-quote-feed-card {
    min-width: 100%;
    padding: 4px 2px;
}

.gam-quote-feed-card blockquote {
    margin: 0;
    color: #d6cfe5;
    font-size: 14px;
    line-height: 1.55;
    font-style: italic;
}

.gam-quote-feed-card cite {
    display: block;
    margin-top: 8px;
    color: #8b86a4;
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.gam-quote-feed-controls {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.gam-quote-feed-controls .gam-ghost-button {
    padding: 6px 12px;
    font-size: 12px;
}


/* ----- Rare problem modal ----- */

.gam-rare-problem {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 24px;
    animation: gam-fade-in 0.3s ease-out;
}

.gam-rare-problem-inner {
    background: linear-gradient(135deg, #1d1808 0%, #2e2510 100%);
    border: 2px solid #f4c84a;
    border-radius: 16px;
    padding: 32px 36px;
    max-width: 620px;
    box-shadow: 0 0 80px rgba(244, 200, 74, 0.4);
    animation: gam-chest-enter 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

.gam-rare-eyebrow {
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #f4c84a;
    margin: 0 0 8px 0;
}

.gam-rare-problem-inner h2 {
    color: #f4ecd8;
    font-size: 24px;
    margin: 0 0 6px 0;
}

.gam-rare-source {
    color: #c9a86a;
    font-size: 13px;
    margin: 0 0 14px 0;
}

.gam-rare-problem-inner blockquote {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #f4c84a;
    padding: 14px 18px;
    color: #e8d4b4;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px 0;
    border-radius: 0 6px 6px 0;
}

.gam-rare-prompt {
    color: #b8c8da;
    font-size: 13px;
    margin: 0 0 18px 0;
}

.gam-rare-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* ----- Audio toggle (floating bottom-left) ----- */

.gam-audio-toggle {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 9997;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(10, 18, 28, 0.85);
    border: 1px solid #2c4869;
    color: #b8c8da;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}

.gam-audio-toggle:hover {
    background: rgba(10, 18, 28, 0.95);
    transform: scale(1.05);
}


/* ============================================================
   RAPID DRILL (Monkeytype-style)
   ============================================================ */

.gam-drill-launcher {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: linear-gradient(180deg, #1a3a2c 0%, #1f4a36 100%);
    border: 1px solid #a99e5e;
    color: #f4ecd8;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    min-width: 124px;
    box-sizing: border-box;
}

.gam-drill-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(170, 158, 96, 0.3);
}

.gam-drill-launcher span {
    font-size: 18px;
}

.gam-drill-launcher small {
    font-size: 9px;
    letter-spacing: 0.15em;
    color: #a0d4c0;
}

.gam-drill {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gam-fade-in 0.2s ease-out;
}

.gam-drill-inner {
    width: 100%;
    max-width: 720px;
    padding: 24px;
    position: relative;
}

.gam-drill-inner header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.gam-drill-eyebrow {
    font-size: 12px;
    letter-spacing: 0.3em;
    color: #a99e5e;
    margin: 0;
}

.gam-drill-stats {
    display: flex;
    gap: 24px;
}

.gam-drill-stats>div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.gam-drill-stats small {
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #6c8baa;
}

.gam-drill-stats strong {
    font-size: 24px;
    color: #f4ecd8;
    font-variant-numeric: tabular-nums;
}

.gam-drill-stage {
    text-align: center;
}

.gam-drill-question {
    font-size: 64px;
    line-height: 1.2;
    color: #f4ecd8;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
    font-weight: 300;
}

@media (max-width: 600px) {
    .gam-drill-question {
        font-size: 44px;
    }
}

.gam-drill-input {
    width: 80%;
    max-width: 400px;
    font-size: 32px;
    text-align: center;
    background: transparent;
    border: none;
    border-bottom: 2px solid #a99e5e;
    color: #f4ecd8;
    padding: 12px 4px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.gam-drill-input:focus {
    border-bottom-color: #6ad8a0;
}

.gam-drill-feedback {
    height: 32px;
    font-size: 20px;
    margin-top: 20px;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.15s;
}

.gam-drill-correct {
    color: #6ad8a0;
}

.gam-drill-wrong {
    color: #d98a8a;
}

.gam-drill-close {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    color: #6c8baa;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 12px;
}

.gam-drill-close:hover {
    color: #f4ecd8;
}

.gam-drill-summary {
    margin-top: 32px;
    text-align: center;
    display: none;
}

.gam-drill-summary-show {
    display: block;
    animation: gam-chest-enter 0.4s ease-out;
}

.gam-drill-summary strong {
    display: block;
    font-size: 96px;
    line-height: 1;
    color: #f4c84a;
    font-variant-numeric: tabular-nums;
}

.gam-drill-summary small {
    display: block;
    color: #b8c8da;
    font-size: 14px;
    margin-top: 8px;
}

.gam-drill-summary em {
    display: block;
    color: #c9a86a;
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.15em;
    margin: 12px 0 20px 0;
}

.gam-drill-summary .gam-drill-pb {
    color: #f4c84a;
    text-shadow: 0 0 24px rgba(244, 200, 74, 0.5);
}

.gam-drill-summary button {
    margin: 0 6px;
}


/* ============================================================
   AI PROOF CHECKER
   ============================================================ */

.gam-ai-launcher {
    position: fixed;
    bottom: 16px;
    right: 156px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: linear-gradient(180deg, #1a1838 0%, #1f1f4a 100%);
    border: 1px solid #e4bf83;
    color: #f4ecd8;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    min-width: 124px;
    box-sizing: border-box;
}

.gam-ai-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(228, 191, 131, 0.3);
}

.gam-ai-launcher span {
    font-size: 18px;
}

.gam-ai-launcher small {
    font-size: 9px;
    letter-spacing: 0.15em;
    color: #a8b0e0;
}

@media (max-width: 600px) {
    .gam-ai-launcher {
        right: 16px;
        bottom: 80px;
    }
}

.gam-ai-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gam-fade-in 0.2s ease-out;
    padding: 24px;
    overflow-y: auto;
}

.gam-ai-inner {
    background: #0a1726;
    border: 2px solid #e4bf83;
    border-radius: 14px;
    padding: 28px 32px;
    width: 100%;
    max-width: 720px;
    position: relative;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7);
}

.gam-ai-inner header {
    margin-bottom: 20px;
}

.gam-ai-eyebrow {
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #a8b0e0;
    margin: 0 0 6px 0;
}

.gam-ai-inner h2 {
    color: #f4ecd8;
    font-size: 22px;
    margin: 0;
}

.gam-ai-inner .gam-drill-close {
    top: 16px;
    right: 16px;
}

.gam-ai-setup {
    background: rgba(228, 191, 131, 0.08);
    border: 1px solid rgba(228, 191, 131, 0.3);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #c8d0e8;
}

.gam-ai-setup a {
    color: #a8b0e0;
}

.gam-ai-setup label {
    display: block;
    margin: 10px 0;
    font-size: 12px;
    color: #b8c8da;
}

.gam-ai-safety {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: rgba(143, 58, 54, 0.08);
    border: 1px solid rgba(143, 58, 54, 0.35);
    border-radius: 6px;
    color: #e9d2ca;
    font-size: 12px;
    line-height: 1.5;
}

.gam-ai-provider-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.gam-ai-setup .gam-ai-provider {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #2c4869;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #d6e0ec;
    cursor: pointer;
}

.gam-ai-provider:has(input:checked) {
    border-color: #e4bf83;
    background: rgba(228, 191, 131, 0.15);
    color: #f4ecd8;
}

.gam-ai-provider input {
    accent-color: #e4bf83;
    margin: 0;
}

.gam-ai-provider-help {
    margin: 0 0 10px;
    color: #b8c8da;
    font-size: 12px;
}

.gam-ai-setup .gam-ai-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 11px 0 14px;
    color: #9aaec2;
}

.gam-ai-remember input {
    accent-color: #e4bf83;
}

.gam-ai-key-input {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.gam-ai-configured {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 9px 12px;
    border: 1px solid rgba(170, 158, 96, 0.35);
    border-radius: 6px;
    background: rgba(170, 158, 96, 0.08);
    color: #bce7d6;
    font-size: 12px;
}

.gam-ai-configured .gam-ghost-button {
    padding: 6px 10px;
}

.gam-ai-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #8aa0b8;
}

.gam-ai-problem,
.gam-ai-proof {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    box-sizing: border-box;
    resize: vertical;
}

.gam-ai-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.gam-ai-output {
    min-height: 40px;
}

.gam-ai-loading {
    color: #8aa0b8;
    font-style: italic;
}

.gam-ai-error {
    color: #d98a8a;
}

.gam-ai-result {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(228, 191, 131, 0.3);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 12px;
}

.gam-ai-result pre {
    color: #d6cfe5;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0 0 10px 0;
    font-family: monospace;
}

.gam-ai-disclaimer {
    color: #8aa0b8;
    font-size: 11px;
    font-style: italic;
    margin: 0;
}

@media (max-width: 560px) {
    .gam-ai-modal {
        padding: 12px;
    }
    .gam-ai-inner {
        padding: 20px 16px;
    }
    .gam-ai-inner h2 {
        font-size: 18px;
        padding-right: 32px;
    }
}


/* ============================================================
   QUICK REVIEW HEADER (injected above existing #queue wall-of-text)
   ============================================================ */

.gam-quick-review-header {
    margin: 0 0 24px 0;
}

.gam-quick-review-inner {
    background: linear-gradient(135deg, #0a1726 0%, #0d2138 100%);
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 22px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.gam-quick-eyebrow {
    font-size: 11px;
    letter-spacing: 0.25em;
    color: #a99e5e;
    margin: 0 0 6px 0;
}

.gam-quick-review-inner h2 {
    color: #f4ecd8;
    font-size: 22px;
    margin: 0 0 6px 0;
}

.gam-quick-review-inner p {
    color: #b8c8da;
    font-size: 13px;
    margin: 0;
}

.gam-quick-review-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* ============================================================
   NEXT-ACTION CARD (always-visible single CTA at top of deck)
   ============================================================ */

.gam-next-action {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #0a1726 0%, #0d2138 100%);
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 18px 22px;
    flex-wrap: wrap;
}

.gam-next-action.gam-priority-critical {
    border-color: #d98a8a;
    background: linear-gradient(135deg, #2a0e0a 0%, #3a1815 100%);
    animation: gam-pulse-red 1.6s ease-in-out infinite;
}

.gam-next-action.gam-priority-high {
    border-color: #f4c84a;
    background: linear-gradient(135deg, #1f1808 0%, #2a2010 100%);
}

.gam-next-action.gam-priority-medium {
    border-color: #a99e5e;
}

.gam-next-action.gam-priority-low {
    border-color: #2c4869;
    opacity: 0.85;
}

.gam-next-action-text {
    flex: 1;
    min-width: 240px;
}

.gam-next-eyebrow {
    font-size: 12px;
    letter-spacing: 0.25em;
    color: #a0c4b4;
    margin: 0 0 6px 0;
    font-weight: 600;
}

.gam-priority-critical .gam-next-eyebrow {
    color: #d98a8a;
}

.gam-priority-high .gam-next-eyebrow {
    color: #f4c84a;
}

.gam-next-body {
    color: #d6e0ec;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.gam-next-cta {
    font-size: 14px;
    padding: 10px 18px;
    white-space: nowrap;
}

.gam-priority-critical .gam-next-cta {
    background: linear-gradient(180deg, #8f3a36 0%, #c4453a 100%);
    border-color: #f06a5c;
}

.gam-priority-high .gam-next-cta {
    background: linear-gradient(180deg, #d4a83a 0%, #b48820 100%);
    border-color: #e0c050;
    color: #0a0a0a;
}


/* ============================================================
   AI TUTOR (multi-turn chat modal + launcher)
   ============================================================ */

.gam-tutor-launcher {
    position: fixed;
    bottom: 16px;
    right: 436px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: linear-gradient(180deg, #381a2e 0%, #4a1f3e 100%);
    border: 1px solid #8f3a36;
    color: #f4ecd8;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    min-width: 124px;
    box-sizing: border-box;
}

.gam-tutor-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(143, 58, 54, 0.3);
}

.gam-tutor-launcher span {
    font-size: 18px;
    font-weight: 700;
}

.gam-tutor-launcher small {
    font-size: 9px;
    letter-spacing: 0.15em;
    color: #e0a8d8;
}

@media (max-width: 760px) {
    .gam-tutor-launcher {
        right: 16px;
        bottom: 144px;
    }
}

@media (max-width: 600px) {
    .workspace-main {
        padding-bottom: 64px;
    }
    .gam-tutor-launcher,
    .gam-ai-launcher {
        display: none;
    }
    .gam-drill-launcher {
        right: 12px;
        bottom: 12px;
        width: 50px;
        height: 50px;
        padding: 0;
        justify-content: center;
        border-radius: 999px;
    }
    .gam-drill-launcher small {
        display: none;
    }
    .gam-drill-launcher span {
        font-size: 19px;
    }
}

@media (min-width: 701px) {
body:has(.workspace-shell.week-focus-mode) .gam-tutor-launcher,
body:has(.workspace-shell.week-focus-mode) .gam-ai-launcher,
body:has(.workspace-shell.week-focus-mode) .gam-drill-launcher,
body:has(.workspace-shell.week-focus-mode) .gam-coach-launcher,
body:has(.workspace-shell.week-focus-mode) .gam-audio-toggle {
    display: none;
}
}

body:has(.workspace-shell.week-focus-mode) .gam-toast-stack {
    display: none;
}

body:has(.gam-battle-mode) .gam-slot,
body:has(.gam-battle-mode) .gam-level-up,
body:has(.gam-battle-mode) .gam-toast-stack,
body:has(.gam-battle-mode) .gam-bonus-chest,
body:has(.gam-problem-feed) .gam-slot,
body:has(.gam-problem-feed) .gam-level-up,
body:has(.gam-problem-feed) .gam-toast-stack,
body:has(.gam-problem-feed) .gam-bonus-chest {
    display: none;
}

.gam-ai-tutor {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: gam-fade-in 0.2s ease-out;
}

.gam-ai-tutor-inner {
    background: #0a1726;
    border: 2px solid #8f3a36;
    border-radius: 14px;
    padding: 24px 28px;
    width: 100%;
    max-width: 720px;
    height: 85vh;
    max-height: 720px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 16px 80px rgba(143, 58, 54, 0.2);
}

.gam-ai-tutor-inner header {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.gam-ai-tutor-inner h2 {
    color: #f4ecd8;
    font-size: 20px;
    margin: 0;
}

.gam-tutor-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid #2c2349;
    border-bottom: 1px solid #2c2349;
    margin-bottom: 12px;
}

.gam-tutor-hint {
    color: #8aa0b8;
    font-size: 13px;
    font-style: italic;
    padding: 12px 0;
}

.gam-tutor-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 8px;
}

.gam-tutor-user {
    background: rgba(228, 191, 131, 0.08);
    border-left: 2px solid #4e9ce8;
}

.gam-tutor-assistant {
    background: rgba(143, 58, 54, 0.08);
    border-left: 2px solid #8f3a36;
}

.gam-tutor-role {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: #8aa0b8;
    text-transform: uppercase;
}

.gam-tutor-msg>div {
    color: #d6cfe5;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.gam-tutor-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.gam-tutor-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    outline: none;
}

.gam-tutor-input:focus {
    border-color: #d98a8a;
}


/* ============================================================
   DAILY ARENA, PROBLEM FEED, AND BATTLE MODE
   ============================================================ */

.gam-arena-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(228, 191, 131, 0.34);
    border-radius: 8px;
    background: linear-gradient(100deg, rgba(228, 191, 131, 0.1), rgba(10, 23, 38, 0.95) 40%);
}

.gam-arena-copy h3 {
    margin: 5px 0 4px;
    color: #f4ecd8;
    font-size: 20px;
}

.gam-arena-copy h3 small {
    margin-left: 8px;
    color: #91a8bd;
    font-size: 12px;
    font-weight: 500;
}

.gam-arena-copy>p:last-child {
    margin: 0;
    color: #b2bdca;
    font-size: 13px;
}

.gam-arena-stats {
    display: flex;
    gap: 10px;
}

.gam-arena-stats span {
    min-width: 70px;
    padding: 8px 10px;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 8px;
    text-align: center;
}

.gam-arena-stats strong {
    display: block;
    color: #f2c06c;
    font-size: 18px;
}

.gam-arena-stats small {
    color: #8aa0b8;
    font-size: 10px;
}

.gam-arena-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.gam-problem-feed,
.gam-battle-mode {
    position: fixed;
    inset: 0;
    z-index: 10006;
    display: flex;
    justify-content: center;
    background: rgba(2, 7, 12, 0.96);
    padding: 18px;
    animation: gam-fade-in 0.18s ease-out;
}

.gam-feed-shell {
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    height: calc(100vh - 36px);
    border: 1px solid #294663;
    border-radius: 8px;
    overflow: hidden;
    background: #091522;
}

.gam-feed-header,
.gam-battle-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 70px;
    padding: 14px 56px 14px 18px;
    border-bottom: 1px solid #203247;
}

.gam-feed-header h2,
.gam-battle-header h2 {
    margin: 3px 0 0;
    color: #f4ecd8;
    font-size: 18px;
}

.gam-feed-debt {
    margin-left: auto;
    text-align: center;
}

.gam-feed-debt strong {
    display: block;
    color: #f2c06c;
    font-size: 20px;
}

.gam-feed-debt small {
    color: #8aa0b8;
    font-size: 10px;
}

.gam-feed-track {
    flex: 1;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

.gam-feed-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    min-height: 100%;
    padding: clamp(22px, 6vh, 50px) clamp(20px, 6vw, 48px);
    box-sizing: border-box;
    scroll-snap-align: start;
    border-bottom: 1px solid #203247;
}

.gam-feed-source {
    margin: 0;
    color: #76cdb0;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gam-feed-card h3 {
    margin: 0;
    color: #f4ecd8;
    font-size: clamp(28px, 5vw, 36px);
}

.gam-feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gam-feed-meta span {
    padding: 5px 9px;
    border: 1px solid #284762;
    border-radius: 5px;
    color: #b8c5d3;
    font-size: 12px;
}

.gam-feed-prompt {
    margin: 0;
    color: #eef1f3;
    font-size: 18px;
    line-height: 1.6;
}

.gam-feed-techniques {
    margin: 0;
    color: #9eb0c2;
    font-size: 13px;
}

.gam-feed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gam-feed-skip {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #91a8bd;
    cursor: pointer;
    padding: 9px;
}

.gam-feed-rule {
    margin: 0;
    padding: 11px 18px;
    border-top: 1px solid #203247;
    color: #91a8bd;
    font-size: 12px;
}

.gam-feed-rule.gam-feed-warning {
    color: #f2c06c;
    background: rgba(242, 192, 108, 0.08);
}

.gam-feed-lock {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 10, 18, 0.95);
}

.gam-feed-lock>div {
    max-width: 420px;
    padding: 24px;
    border: 1px solid rgba(143, 58, 54, 0.48);
    border-radius: 8px;
    background: #0c1826;
}

.gam-feed-lock h3 {
    margin: 8px 0;
    color: #f4ecd8;
}

.gam-feed-lock p:not(.gam-drill-eyebrow) {
    margin-bottom: 18px;
    color: #b6c3cf;
    line-height: 1.55;
}

.gam-feed-lock button+button {
    margin-left: 8px;
}

.gam-feed-shell {
    position: relative;
}

.gam-battle-shell {
    width: min(1180px, 100%);
    height: calc(100vh - 36px);
    border: 1px solid #294663;
    border-radius: 8px;
    overflow: hidden;
    background: #08131f;
}

.gam-battle-timer {
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid rgba(170, 158, 96, 0.35);
    border-radius: 6px;
    color: #a99e5e;
    font: 700 24px/1 "Consolas", monospace;
}

.gam-battle-timer.expired {
    color: #d98a8a;
    border-color: rgba(143, 58, 54, 0.45);
}

.gam-battle-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.08fr);
    height: calc(100% - 70px);
}

.gam-battle-problem,
.gam-battle-work {
    min-height: 0;
    overflow-y: auto;
    padding: clamp(18px, 3vw, 30px);
}

.gam-battle-problem {
    border-right: 1px solid #203247;
}

.gam-battle-prompt {
    margin: 18px 0;
    color: #f4ecd8;
    font-size: 20px;
    line-height: 1.65;
}

.gam-hint-ladder {
    display: grid;
    gap: 12px;
    margin-top: 30px;
    padding: 15px;
    border: 1px solid #203b52;
    border-radius: 8px;
}

.gam-hint-ladder small {
    color: #91a8bd;
}

.gam-hint-ladder ol {
    display: grid;
    gap: 8px;
    margin: 0 0 0 18px;
    padding: 0;
    color: #c6d2dd;
    font-size: 13px;
}

.gam-battle-work {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.gam-battle-work label {
    display: grid;
    gap: 7px;
    color: #9eb0c2;
    font-size: 12px;
}

.gam-battle-work textarea {
    width: 100%;
    min-height: 160px;
    box-sizing: border-box;
    resize: vertical;
    padding: 12px;
    border: 1px solid #294663;
    border-radius: 6px;
    background: #07101b;
    color: #f1ede2;
    font: 14px/1.55 inherit;
}

.gam-battle-work label:nth-child(2) textarea {
    min-height: 92px;
}

.gam-battle-work textarea:focus {
    outline: 1px solid #a99e5e;
    border-color: #a99e5e;
}

.gam-battle-confidence,
.gam-battle-effort,
.gam-battle-result-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gam-battle-confidence {
    justify-content: space-between;
    color: #c6d2dd;
}

.gam-battle-confidence label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gam-battle-finish {
    margin-top: auto;
}

.gam-battle-rule {
    margin: 0;
    color: #91a8bd;
    font-size: 12px;
}

.gam-battle-result {
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
    padding: 28px;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Always-reachable close on the result screen (header is replaced on finish). */
.gam-battle-result-top {
    position: sticky;
    top: 0;
    z-index: 2;
    justify-self: stretch;
    display: flex;
    justify-content: flex-end;
    background: linear-gradient(#08131f 70%, transparent);
    padding-bottom: 6px;
    margin: -8px 0 0;
}

.gam-battle-result h2 {
    margin: 0;
    color: #f4ecd8;
}

.gam-battle-result p:not(.gam-drill-eyebrow) {
    margin: 0 0 8px;
    color: #c6d2dd;
    line-height: 1.55;
}

@media (max-width: 860px) {
    .gam-arena-card {
        grid-template-columns: 1fr;
    }
    .gam-arena-actions {
        justify-content: flex-start;
    }
    .gam-battle-grid {
        display: block;
        height: calc(100% - 70px);
        overflow-y: auto;
    }
    .gam-battle-problem,
    .gam-battle-work {
        overflow: visible;
    }
    .gam-battle-problem {
        border-right: 0;
        border-bottom: 1px solid #203247;
    }
}

@media (max-width: 600px) {
    .gam-problem-feed,
    .gam-battle-mode {
        padding: 0;
    }
    .gam-feed-shell,
    .gam-battle-shell {
        height: 100vh;
        border: 0;
        border-radius: 0;
    }
    .gam-feed-card {
        padding: 20px 16px;
    }
    .gam-feed-prompt {
        font-size: 16px;
    }
    .gam-battle-prompt {
        font-size: 17px;
    }
}


/* Static-site focus and output loop */

.strict-curriculum-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.strict-curriculum-panel div {
    display: grid;
    gap: 4px;
}

.strict-curriculum-panel span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.strict-mode-toggle {
    position: relative;
    flex: 0 0 48px;
    height: 27px;
    border: 1px solid rgba(120, 143, 171, 0.38);
    border-radius: 999px;
    background: rgba(13, 21, 33, 0.8);
    cursor: pointer;
}

.strict-mode-toggle span {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #95a6b9;
    transition: transform 0.18s ease, background 0.18s ease;
}

.strict-mode-toggle[aria-checked="true"] {
    border-color: rgba(170, 158, 96, 0.7);
    background: rgba(170, 158, 96, 0.18);
}

.strict-mode-toggle[aria-checked="true"] span {
    transform: translateX(21px);
    background: #a99e5e;
}

body.strict-curriculum-on .sidebar-nav a[data-route="compare"],
body.strict-curriculum-on .sidebar-nav a[data-route="books"],
body.strict-curriculum-on .sidebar-nav a[data-route="media"],
body.strict-curriculum-on .home-primary-actions a[href="#compare"],
body.strict-curriculum-on .home-primary-actions a[href="#media"],
body.strict-curriculum-on .home-library-rule,
body.strict-curriculum-on .week-audit-fold,
body.strict-curriculum-on .tracker-vault-gate {
    display: none;
}

.gam-strict-notice {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 10020;
    max-width: min(440px, calc(100% - 32px));
    transform: translate(-50%, -8px);
    opacity: 0;
    padding: 12px 16px;
    border: 1px solid rgba(170, 158, 96, 0.55);
    border-radius: 8px;
    background: #10231f;
    color: #eef1f3;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.gam-strict-notice.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.gam-output-card {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(120, 143, 171, 0.25);
    border-radius: 8px;
    background: rgba(9, 19, 32, 0.92);
}

.gam-output-card.unlocked {
    border-color: rgba(170, 158, 96, 0.45);
    background: linear-gradient(105deg, rgba(170, 158, 96, 0.12), rgba(9, 19, 32, 0.94) 45%);
}

.gam-output-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.gam-output-head h3 {
    margin: 3px 0 4px;
    color: #f4ecd8;
    font-size: 18px;
}

.gam-output-head p:last-child {
    margin: 0;
    color: #b2bdca;
    font-size: 13px;
}

.gam-output-reward {
    padding: 10px 13px;
    border: 1px solid rgba(242, 192, 108, 0.35);
    border-radius: 6px;
    color: #f2c06c;
    white-space: nowrap;
}

.gam-output-card.unlocked .gam-output-reward {
    border-color: rgba(170, 158, 96, 0.42);
    color: #a99e5e;
}

.gam-rep-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gam-rep-badges span {
    padding: 5px 10px;
    border: 1px solid #284762;
    border-radius: 5px;
    color: #7e94ab;
    font-size: 12px;
}

.gam-rep-badges span.earned {
    border-color: rgba(242, 192, 108, 0.55);
    background: rgba(242, 192, 108, 0.12);
    color: #f2c06c;
}

.gam-ghost-compare {
    display: flex;
    gap: 12px;
}

.gam-ghost-compare span {
    min-width: 78px;
    padding: 7px 10px;
    border: 1px solid #203247;
    border-radius: 6px;
}

.gam-ghost-compare strong,
.gam-ghost-compare small {
    display: block;
}

.gam-ghost-compare strong {
    color: #edf1f4;
    font-size: 17px;
}

.gam-ghost-compare small {
    color: #8aa0b8;
    font-size: 10px;
}

.gam-output-unlock {
    position: fixed;
    bottom: 28px;
    left: 50%;
    z-index: 10030;
    display: grid;
    gap: 5px;
    min-width: min(390px, calc(100% - 32px));
    padding: 16px 19px;
    border: 1px solid rgba(242, 192, 108, 0.58);
    border-radius: 8px;
    background: #17150e;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.gam-output-unlock.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.gam-output-unlock p {
    margin: 0;
    color: #f2c06c;
    font-size: 11px;
    letter-spacing: 0.14em;
}

.gam-output-unlock strong {
    color: #f4ecd8;
}

.gam-output-unlock span {
    color: #bdc7d1;
    font-size: 13px;
}

.gam-adaptive-score {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 13px;
    border: 1px solid rgba(170, 158, 96, 0.23);
    border-radius: 7px;
    background: rgba(170, 158, 96, 0.07);
}

.gam-adaptive-score p,
.gam-adaptive-score small {
    flex-basis: 100%;
}

.gam-adaptive-score small {
    color: #a99e5e;
    min-height: 18px;
}

.gam-intercept-rescue {
    position: fixed;
    inset: 0;
    z-index: 10025;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 7, 12, 0.95);
}

.gam-intercept-shell {
    width: min(620px, 100%);
    padding: 27px;
    border: 1px solid rgba(242, 192, 108, 0.4);
    border-radius: 8px;
    background: #0a1726;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.gam-intercept-shell h2 {
    margin: 8px 0;
    color: #f4ecd8;
}

.gam-intercept-shell p:not(.gam-drill-eyebrow) {
    margin: 0 0 20px;
    color: #c6d2dd;
}

.gam-intercept-lede strong {
    color: #f3a35c;
    font-size: 1.1rem;
}

.gam-intercept-reasons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.gam-intercept-reasons button {
    padding: 10px 8px;
    border: 1px solid rgba(228, 191, 131, 0.25);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    color: #dce6ef;
    font-weight: 800;
    cursor: pointer;
}

.gam-intercept-reasons button.selected {
    border-color: rgba(243, 163, 92, 0.95);
    background: rgba(243, 163, 92, 0.16);
    color: #ffd9a8;
}

.gam-intercept-reasons button:disabled,
.gam-intercept-action button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.gam-intercept-action {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.gam-intercept-note {
    margin-top: 14px !important;
    font-size: 0.86rem;
    color: #98a6ba !important;
}

.gam-intercept-artifact {
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 12px;
    padding: 12px;
    border: 1px solid rgba(228, 191, 131, 0.3);
    border-radius: 7px;
    background: rgba(2, 7, 12, 0.6);
    color: #f4ecd8;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    resize: vertical;
}

.gam-intercept-artifact:focus {
    outline: none;
    border-color: rgba(243, 163, 92, 0.9);
    box-shadow: 0 0 0 2px rgba(243, 163, 92, 0.18);
}

.gam-intercept-next {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.gam-toolkit-microcopy {
    margin: 10px 0 0 !important;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #8fa0b4 !important;
}

@media (max-width: 700px) {
    .gam-intercept-reasons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .gam-intercept-next {
        flex-direction: column;
    }
    .gam-intercept-next button {
        width: 100%;
    }
}

@media (min-width: 601px) {
    /* Full-size launchers with labels; spacing matches the min-width: 124px
       boxes so they never overlap. Drill at 16, AI at 156, Coach at 296,
       Tutor at 436 — exactly 140px between right edges, leaving a 16px gap
       between adjacent 124px-wide buttons. */
    .gam-drill-launcher { right: 16px; }
    .gam-ai-launcher { right: 156px; }
    .gam-coach-launcher { right: 296px; }
    .gam-tutor-launcher { right: 436px; }
    .gam-coach-launcher span { font-size: 0.95rem; line-height: 1.2; }
}

/* On narrower desktops where 4 full-size buttons would push off-screen,
   collapse to icon-only squares stacked tighter. */
@media (min-width: 601px) and (max-width: 900px) {
    .gam-drill-launcher,
    .gam-ai-launcher,
    .gam-coach-launcher,
    .gam-tutor-launcher {
        width: 50px;
        height: 50px;
        min-width: 50px;
        padding: 0;
        justify-content: center;
        border-radius: 8px;
    }
    .gam-drill-launcher small,
    .gam-ai-launcher small,
    .gam-coach-launcher small,
    .gam-tutor-launcher small { display: none; }
    .gam-drill-launcher { right: 14px; }
    .gam-ai-launcher { right: 72px; }
    .gam-coach-launcher { right: 130px; }
    .gam-tutor-launcher { right: 188px; }
}

@media (max-width: 600px) {
    .gam-output-head {
        display: grid;
    }
    .gam-ghost-compare {
        justify-content: space-between;
    }
    .gam-ghost-compare span {
        flex: 1;
        min-width: 0;
    }
}

.tracker-vault-gate {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.tracker-vault-gate h3,
.tracker-vault-gate p {
    margin: 3px 0;
}

.tracker-vault-gate p:last-child {
    color: var(--muted);
    max-width: 680px;
}

.polymath-vault-page {
    width: 100%;
}

.vault-hero .hero-chip a {
    margin-top: 7px;
}

.vault-warning {
    display: flex;
    gap: 18px;
    align-items: baseline;
    padding: 16px 19px;
    border: 1px solid rgba(242, 192, 108, 0.36);
    border-radius: 8px;
    background: rgba(242, 192, 108, 0.07);
}

.vault-warning strong {
    color: #f2c06c;
    white-space: nowrap;
}

.vault-warning p {
    margin: 0;
    color: var(--muted);
}

.vault-lane-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
    gap: 12px;
}

.vault-lane-card {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.vault-lane-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.vault-lane-head span {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--muted);
    font-size: 11px;
}

.vault-lane-card h3,
.vault-lane-card p {
    margin: 0;
}

.vault-lane-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.gam-training-card {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(228, 191, 131, 0.28);
    border-radius: 8px;
    background: rgba(8, 18, 30, 0.94);
}

.gam-training-lead h3,
.gam-training-lead p {
    margin: 3px 0;
}

.gam-training-lead h3 {
    color: #f1f4f6;
    font-size: 19px;
}

.gam-training-lead h3 small {
    padding-left: 10px;
    color: #95acc3;
    font-size: 12px;
}

.gam-training-lead p:last-child {
    color: #a9b8c8;
    font-size: 13px;
}

.gam-skill-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    gap: 8px;
}

.gam-skill-strip span {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid #203247;
    border-radius: 6px;
}

.gam-skill-strip span.weak {
    border-color: rgba(242, 192, 108, 0.45);
}

.gam-skill-strip small {
    color: #8aa0b8;
    font-size: 10px;
}

.gam-skill-strip strong {
    color: #edf1f4;
}

.gam-training-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gam-repair-modal,
.gam-insight-modal,
.gam-session-modal,
.gam-connected-modal,
.gam-weekly-modal {
    position: fixed;
    inset: 0;
    z-index: 10026;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 18px;
    background: rgba(2, 7, 12, 0.94);
}

.gam-repair-shell,
.gam-insight-shell,
.gam-session-shell,
.gam-connected-shell,
.gam-weekly-shell {
    display: grid;
    gap: 14px;
    width: min(650px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 23px;
    border: 1px solid #263f57;
    border-radius: 8px;
    background: #0a1726;
}

.gam-repair-shell header,
.gam-insight-shell header,
.gam-session-shell header,
.gam-connected-shell header,
.gam-weekly-shell header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.gam-repair-shell h2,
.gam-insight-shell h2,
.gam-session-shell h2,
.gam-connected-shell h2,
.gam-weekly-shell h2 {
    margin: 3px 0;
    color: #f4ecd8;
    font-size: 22px;
}

.gam-repair-gap,
.gam-repair-resource,
.gam-repair-blocked,
.gam-session-postmortem {
    padding: 13px;
    border: 1px solid #203247;
    border-radius: 7px;
    background: rgba(12, 27, 43, 0.74);
}

.gam-repair-gap p,
.gam-repair-resource p,
.gam-repair-blocked p,
.gam-repair-return,
.gam-session-postmortem p {
    margin: 6px 0 0;
    color: #b7c4d0;
    font-size: 13px;
}

.gam-repair-resource span {
    color: #a99e5e;
    font-size: 11px;
}

.gam-repair-resource h3 {
    margin: 6px 0 10px;
    color: #edf1f4;
}

.gam-repair-resource .gam-action-button {
    display: inline-flex;
    margin-top: 13px;
}

.gam-repair-write,
.gam-session-shell label {
    display: grid;
    gap: 7px;
    color: #d8e0e7;
    font-size: 13px;
}

.gam-repair-write textarea,
.gam-battle-capture textarea,
.gam-session-shell textarea {
    min-height: 72px;
    resize: vertical;
    padding: 10px;
    border: 1px solid #304b64;
    border-radius: 6px;
    background: #06111d;
    color: #ecf0f4;
    font: inherit;
}

.gam-repair-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gam-repair-shell>small,
.gam-battle-capture small,
.gam-session-shell>small {
    min-height: 18px;
    color: #a99e5e;
}

.gam-battle-rescue {
    justify-content: center;
}

.gam-battle-capture {
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid #203247;
    border-radius: 7px;
}

.gam-battle-capture p {
    margin: 0;
}

.gam-insight-summary {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid rgba(170, 158, 96, 0.3);
    border-radius: 6px;
    color: #cbd5dc;
}

.gam-insight-list {
    display: grid;
    gap: 9px;
}

.gam-insight-list article {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #203247;
    border-radius: 6px;
}

.gam-insight-list article span,
.gam-insight-list article small,
.gam-insight-empty {
    color: #8aa0b8;
    font-size: 12px;
}

.gam-insight-list article p {
    margin: 0;
    color: #edf1f4;
}

.gam-insight-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 11px 13px;
    border: 1px solid #203247;
    border-radius: 7px;
}

.gam-insight-search label,
.gam-connected-field,
.gam-connected-key label,
.gam-connected-result label,
.gam-connected-extras label {
    display: grid;
    gap: 6px;
    color: #cbd5dc;
    font-size: 12px;
}

.gam-insight-search input,
.gam-connected-shell input,
.gam-connected-shell select,
.gam-connected-shell textarea {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #304b64;
    border-radius: 6px;
    background: #06111d;
    color: #ecf0f4;
    font: inherit;
}

.gam-insight-search small {
    grid-column: 1 / -1;
    color: #8aa0b8;
}

.gam-connected-shell {
    width: min(700px, 100%);
}

.gam-connected-rule {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid rgba(242, 192, 108, 0.32);
    border-radius: 7px;
    background: rgba(242, 192, 108, 0.07);
    color: #cad4dc;
    font-size: 13px;
    line-height: 1.45;
}

.gam-connected-assigned,
.gam-connected-result {
    display: grid;
    gap: 8px;
    padding: 13px;
    border: 1px solid rgba(170, 158, 96, 0.28);
    border-radius: 7px;
    background: rgba(12, 27, 43, 0.74);
}

.gam-connected-assigned span,
.gam-connected-result span {
    color: #a99e5e;
    font-size: 11px;
    text-transform: uppercase;
}

.gam-connected-assigned strong,
.gam-connected-result h3 {
    margin: 0;
    color: #edf1f4;
}

.gam-connected-assigned p,
.gam-connected-result pre,
.gam-connected-extras p {
    margin: 0;
    color: #b7c4d0;
    font-size: 13px;
    line-height: 1.5;
}

.gam-connected-result pre {
    white-space: pre-wrap;
    font-family: inherit;
}

.gam-connected-key,
.gam-connected-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.gam-connected-key label {
    flex: 1 1 240px;
}

.gam-connected-key .gam-connected-remember {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 7px;
    min-height: 39px;
    padding: 0 7px;
}

.gam-connected-remember input,
.gam-personal-check input {
    width: auto;
    margin: 0;
    accent-color: #a99e5e;
}

.gam-connected-shell>small {
    color: #8aa0b8;
}

.gam-connected-extras {
    border: 1px solid #203247;
    border-radius: 7px;
    padding: 10px 12px;
}

.gam-connected-extras summary {
    cursor: pointer;
    color: #cbd5dc;
    font-weight: 700;
}

.gam-connected-extras>div {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: end;
    padding-top: 12px;
}

.gam-connected-extras p {
    flex-basis: 100%;
}

.gam-connected-extras label {
    flex: 1 1 240px;
}

.gam-personal-tool {
    display: grid;
    flex: 1 1 100%;
    gap: 10px;
    padding: 13px;
    border: 1px solid #29425b;
    border-radius: 7px;
    background: rgba(6, 17, 29, 0.6);
}

.gam-personal-tool h3 {
    margin: 0;
    color: #edf1f4;
    font-size: 15px;
}

.gam-personal-tool>p {
    color: #a9bac7;
}

.gam-personal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.gam-personal-grid label:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.gam-personal-check {
    display: inline-flex !important;
    align-items: center;
    gap: 7px !important;
    color: #cbd5dc;
}

.gam-personal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gam-personal-tool.compact {
    grid-template-columns: minmax(190px, 1fr) auto auto;
    align-items: end;
}

.gam-personal-tool.compact h3,
.gam-personal-tool.compact>p {
    grid-column: 1 / -1;
}

.gam-mathpix-output {
    min-height: 108px;
    resize: vertical;
}

.gam-weekly-shell {
    width: min(650px, 100%);
}

.gam-weekly-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.gam-weekly-metrics span {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid #203247;
    border-radius: 7px;
}

.gam-weekly-metrics strong {
    color: #edf1f4;
    font-size: 20px;
}

.gam-weekly-metrics small,
.gam-weekly-leak span,
.gam-weekly-next span {
    color: #8aa0b8;
    font-size: 11px;
    text-transform: uppercase;
}

.gam-weekly-leak,
.gam-weekly-next {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid #203247;
    border-radius: 7px;
}

.gam-weekly-leak strong,
.gam-weekly-next strong {
    color: #edf1f4;
}

.gam-weekly-leak p,
.gam-weekly-next p,
.gam-weekly-rule {
    margin: 0;
    color: #b7c4d0;
    font-size: 13px;
    line-height: 1.45;
}

.gam-weekly-next .gam-action-button {
    justify-self: start;
}

.gam-session-shell>p:not(.gam-drill-eyebrow) {
    margin: 0;
    color: #b7c4d0;
}

.gam-drill-next {
    margin: 4px 0 8px;
    color: #b7c4d0;
    font-size: 13px;
}

@media (max-width: 700px) {
    .workspace-shell.tracker-mode,
    .workspace-shell.career-mode {
        width: calc(100% - 16px);
    }
    .workspace-sidebar.tracker-mode,
    .workspace-sidebar.career-mode,
    .workspace-shell.tracker-mode .workspace-main,
    .workspace-shell.career-mode .workspace-main {
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
    }
    .tracker-vault-gate,
    .vault-warning {
        display: grid;
    }
    .gam-insight-search {
        grid-template-columns: 1fr;
    }
    .gam-personal-grid,
    .gam-personal-tool.compact {
        grid-template-columns: 1fr;
    }
    .gam-personal-tool.compact h3,
    .gam-personal-tool.compact>p,
    .gam-personal-grid label:last-child:nth-child(odd) {
        grid-column: auto;
    }
    .gam-weekly-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .gam-skill-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .gam-training-lead h3 small {
        display: block;
        padding: 5px 0 0;
    }
}


/* ====================================================================
   AI COACH MODAL (Daily mission / Weekly recap / Voices / Hint / LaTeX / Cluster)
   Reuses .gam-ai-modal / .gam-ai-inner scaffolding from the proof check modal.
   ==================================================================== */

.gam-coach-launcher {
    position: fixed;
    right: 296px;
    bottom: 16px;
    z-index: 9998;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 156, 60, 0.85);
    background: linear-gradient(180deg, rgba(255, 152, 45, 0.25), rgba(143, 58, 54, 0.18));
    color: #fff6e3;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(255, 140, 40, 0.18);
    min-width: 124px;
    box-sizing: border-box;
}

.gam-coach-launcher span {
    font-size: 0.95rem;
}

.gam-coach-launcher small {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: rgba(255, 245, 210, 0.85);
}

.gam-coach-launcher:hover {
    transform: translateY(-1px);
}

.gam-coach-inner {
    max-width: min(820px, 96vw);
}

.gam-coach-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 14px 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(168, 186, 214, 0.18);
}

.gam-coach-tabs button {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(168, 186, 214, 0.24);
    background: rgba(9, 17, 31, 0.7);
    color: #d4dde9;
    font-size: 0.82rem;
    cursor: pointer;
}

.gam-coach-tabs button.active {
    border-color: rgba(228, 191, 131, 0.55);
    background: rgba(228, 191, 131, 0.18);
    color: #f3f6fb;
}

.gam-coach-body {
    display: grid;
    gap: 12px;
}

.gam-coach-help {
    color: #98a6ba;
    margin: 0;
}

.gam-coach-out {
    display: grid;
    gap: 10px;
}

.gam-coach-out-title {
    margin: 0;
    font-size: 1.1rem;
}

.gam-coach-block {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(168, 186, 214, 0.18);
    background: rgba(9, 17, 31, 0.6);
    display: grid;
    gap: 4px;
}

.gam-coach-block header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.gam-coach-block .muted {
    color: #98a6ba;
    font-size: 0.82rem;
    margin: 0;
}

.gam-coach-boss {
    color: #e4bf83;
    margin: 0;
}

.gam-coach-roast {
    color: #f48484;
    font-style: italic;
    margin: 0;
}

.gam-coach-err {
    color: #f48484;
    margin: 0;
}

.gam-coach-voicebar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gam-coach-voice {
    margin: 0;
    padding: 8px 10px;
    border-left: 3px solid rgba(228, 191, 131, 0.6);
    background: rgba(228, 191, 131, 0.06);
    border-radius: 6px;
    color: #d4dde9;
}

.gam-coach-voice.analyst {
    border-left-color: rgba(228, 191, 131, 0.6);
    background: rgba(228, 191, 131, 0.06);
}

.gam-coach-voice.mentor {
    border-left-color: rgba(170, 158, 96, 0.6);
    background: rgba(170, 158, 96, 0.06);
}

.gam-coach-voice.rival {
    border-left-color: rgba(143, 58, 54, 0.6);
    background: rgba(143, 58, 54, 0.06);
}

.gam-coach-voice strong {
    color: rgba(228, 191, 131, 1);
    margin-right: 6px;
}

.gam-coach-voice.analyst strong {
    color: rgba(228, 191, 131, 1);
}

.gam-coach-voice.mentor strong {
    color: rgba(170, 158, 96, 1);
}

.gam-coach-voice.rival strong {
    color: rgba(143, 58, 54, 1);
}

.gam-coach-hintbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gam-coach-hint {
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid rgba(228, 191, 131, 0.6);
    background: rgba(228, 191, 131, 0.05);
    color: #d4dde9;
}

.gam-coach-hint.refusal {
    border-left-color: rgba(143, 58, 54, 0.6);
    background: rgba(143, 58, 54, 0.06);
}

.gam-coach-latex {
    background: rgba(7, 14, 24, 0.92);
    border: 1px solid rgba(168, 186, 214, 0.24);
    padding: 12px 14px;
    border-radius: 8px;
    color: #f3f6fb;
    white-space: pre-wrap;
    font-family: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
    font-size: 0.92rem;
    line-height: 1.55;
    overflow-x: auto;
}

.gam-coach-mistake-add {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px dashed rgba(168, 186, 214, 0.3);
    background: rgba(9, 17, 31, 0.55);
}

.gam-coach-cluster {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(168, 186, 214, 0.18);
    background: rgba(9, 17, 31, 0.6);
}

.gam-coach-cluster strong {
    display: block;
    margin-bottom: 4px;
    color: #f3f6fb;
}


/* ====================================================================
   COMPLETION MODAL
   ==================================================================== */

.gam-completion-inner {
    max-width: min(560px, 96vw);
}

.gam-completion-field {
    display: grid;
    gap: 6px;
    margin: 10px 0;
}

.gam-completion-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}


/* ====================================================================
   RIVAL GHOSTS
   ==================================================================== */

.gam-rival-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.gam-rival-card {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(168, 186, 214, 0.2);
    background: rgba(9, 17, 31, 0.65);
    display: grid;
    gap: 6px;
}

.gam-rival-card[data-ghost="passive-scroll"] {
    border-color: rgba(143, 58, 54, 0.45);
    background: rgba(143, 58, 54, 0.08);
}

.gam-rival-card[data-ghost="top100-candidate"] {
    border-color: rgba(228, 191, 131, 0.45);
    background: rgba(228, 191, 131, 0.08);
}

.gam-rival-card strong {
    font-size: 0.92rem;
    color: #f3f6fb;
}

.gam-rival-row {
    display: flex;
    gap: 12px;
    font-variant-numeric: tabular-nums;
    color: #d4dde9;
}

.gam-rival-card p {
    margin: 0;
    color: #98a6ba;
    font-size: 0.82rem;
}


/* ====================================================================
   RESOURCE METADATA CHIPS
   ==================================================================== */

.gam-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: rgba(228, 191, 131, 0.1);
    border: 1px solid rgba(228, 191, 131, 0.3);
    color: #d4dde9;
    margin-right: 4px;
    margin-bottom: 4px;
}

.gam-meta-chip.gam-meta-core {
    background: rgba(170, 158, 96, 0.12);
    border-color: rgba(170, 158, 96, 0.4);
    color: rgba(170, 158, 96, 1);
}

.gam-meta-chip.gam-meta-trusted {
    background: rgba(228, 191, 131, 0.12);
    border-color: rgba(228, 191, 131, 0.4);
    color: rgba(228, 191, 131, 1);
}

.gam-meta-chip.gam-meta-support {
    background: rgba(228, 191, 131, 0.12);
    border-color: rgba(228, 191, 131, 0.4);
    color: rgba(228, 191, 131, 1);
}

.gam-meta-chip.gam-meta-fixed {
    background: rgba(143, 58, 54, 0.1);
    border-color: rgba(143, 58, 54, 0.4);
    color: rgba(143, 58, 54, 1);
}

.gam-meta-chip.gam-meta-sliding {
    background: rgba(168, 186, 214, 0.1);
    border-color: rgba(168, 186, 214, 0.3);
    color: #d4dde9;
}

.gam-meta-chip.muted {
    opacity: 0.7;
}

.week-rival-panel {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.week-completion-record {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(170, 158, 96, 0.34);
    border-radius: 7px;
    background: rgba(170, 158, 96, 0.08);
    color: #d4dde9;
    font-size: 0.86rem;
    text-transform: capitalize;
}

.gam-research-results {
    display: grid;
    gap: 8px;
}

.gam-research-results article {
    display: grid;
    gap: 5px;
    padding: 9px 10px;
    border: 1px solid rgba(168, 186, 214, 0.18);
    border-radius: 7px;
    background: rgba(9, 17, 31, 0.48);
}

.gam-research-results a {
    color: #edf1f4;
    font-weight: 700;
}

.gam-research-results small,
.gam-research-results p {
    margin: 0;
    color: #a9bac7;
    font-size: 0.82rem;
    line-height: 1.42;
}

/* ============================================================
   TODAY PANEL: hero CTA, identity, sparkline, music, mistakes
   Implements the "Your next rep is ready" loop.
============================================================ */
.gam-today-panel {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, rgba(228, 191, 131, 0.22), rgba(15, 25, 45, 0.75));
    border: 1px solid rgba(228, 191, 131, 0.5);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    color: #f4ecd8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gam-today-head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(228, 191, 131, 0.2);
    padding-bottom: 16px;
}

.gam-today-identity h2 {
    margin: 6px 0 10px;
    font-size: 1.25rem;
    color: #edf1f4;
    font-weight: 700;
}

.gam-today-spark {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b9c8da;
}

.gam-today-spark small {
    color: #97a4b4;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.gam-spark {
    width: 220px;
    height: 48px;
    color: #e4bf83;
}

.gam-spark.up { color: #a99e5e; }
.gam-spark.down { color: #d98a8a; }
.gam-spark.flat { color: #97a4b4; }

.gam-spark-trend {
    font-weight: 700;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 5px;
}

.gam-spark-trend.up { color: #a99e5e; background: rgba(170, 158, 96, 0.15); }
.gam-spark-trend.down { color: #f0a280; background: rgba(143, 58, 54, 0.18); }
.gam-spark-trend.flat { color: #c9d2dc; background: rgba(151, 164, 180, 0.18); }

.gam-today-streak-mini {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 20px;
    align-items: center;
    color: #c9d2dc;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-radius: 10px;
}

.gam-today-streak-mini strong {
    font-size: 1.8rem;
    color: #f3a35c;
    line-height: 1;
}

.gam-today-streak-mini small {
    color: #97a4b4;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gam-today-hero {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(243, 163, 92, 0.5);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(243, 163, 92, 0.05);
}

.gam-today-hero h3 {
    margin: 8px 0 10px;
    font-size: 1.4rem;
    color: #f3a35c;
    font-weight: 700;
}

.gam-today-hero p {
    margin: 0 0 16px;
    color: #d6dde6;
    font-size: 0.95rem;
    line-height: 1.5;
}

.gam-today-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.gam-today-hero-actions .gam-action-button,
.gam-today-hero-actions .gam-ghost-button {
    padding: 10px 18px;
}

.gam-today-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .gam-today-row { grid-template-columns: 1fr; }
}

.gam-today-music, .gam-today-mistakes {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(44, 72, 105, 0.6);
    border-radius: 10px;
    padding: 16px 20px;
}

.gam-music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.gam-music-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(228, 191, 131, 0.08);
    border: 1px solid rgba(228, 191, 131, 0.25);
    border-radius: 8px;
    color: #f4ecd8;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.gam-music-pill:hover {
    background: rgba(228, 191, 131, 0.18);
    border-color: rgba(228, 191, 131, 0.5);
    transform: translateY(-2px);
}

.gam-music-pill strong {
    font-size: 0.95rem;
    color: #edf1f4;
}

.gam-music-pill small {
    color: #97a4b4;
    font-size: 11px;
    line-height: 1.2;
}

.gam-mistake-list {
    list-style: none;
    margin: 12px 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gam-mistake-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    align-items: center;
    padding: 12px 16px;
    background: rgba(143, 58, 54, 0.06);
    border-left: 4px solid #8f3a36;
    border-radius: 8px;
    border: 1px solid rgba(143, 58, 54, 0.15);
}

.gam-mistake-list strong {
    grid-column: 1 / 4;
    color: #f0a280;
    font-size: 0.95rem;
    font-weight: 700;
}

.gam-mistake-list span {
    grid-column: 1;
    color: #b9c8da;
    font-size: 0.88rem;
    line-height: 1.4;
    min-width: 0;
}

.gam-mistake-list button {
    grid-row: 2;
    font-size: 11px;
    padding: 6px 12px;
    white-space: nowrap;
}

.muted {
    color: #98a6ba !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
}

.eyebrow {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2em !important;
    text-transform: uppercase !important;
    color: #e4bf83 !important;
    margin-bottom: 6px !important;
}

/* ============================================================
   QUICK SAVE (Daily Minimum) modal
============================================================ */
.gam-quicksave-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gam-quicksave-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 460px;
    width: 100%;
    color: #f4ecd8;
}

.gam-quicksave-shell header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gam-quicksave-meta {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
}

.gam-quicksave-meta span {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gam-quicksave-meta strong {
    font-size: 1.4rem;
    color: #e4bf83;
}

.gam-quicksave-meta small {
    font-size: 10px;
    color: #97a4b4;
    text-transform: uppercase;
}

.gam-quicksave-shell h3 {
    font-size: 1.6rem;
    margin: 16px 0;
    text-align: center;
    color: #edf1f4;
    min-height: 50px;
}

.gam-quicksave-shell .gam-drill-input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    font-size: 1rem;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* ============================================================
   COACH TOOLS TAB
============================================================ */
.gam-coach-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.gam-coach-tool {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #2c4869;
    border-radius: 8px;
    padding: 12px 14px;
}

.gam-coach-tool header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.gam-coach-tool header strong {
    color: #edf1f4;
}

.gam-coach-tool header span {
    color: #97a4b4;
    font-size: 11px;
}

.gam-coach-tool input[type="text"] {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.gam-coach-tool button {
    margin-top: 2px;
}

.gam-coach-tool-out {
    margin-top: 8px;
    color: #c9d2dc;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}

.gam-coach-tool-out a {
    color: #a99e5e;
    text-decoration: none;
}

.gam-coach-tool-out a:hover {
    text-decoration: underline;
}

.gam-coach-latex-preview {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(228, 191, 131, 0.08);
    border-left: 3px solid #e4bf83;
    border-radius: 4px;
    color: #edf1f4;
    line-height: 1.6;
}

/* ============================================================
   Battle prompt: typeset math with proper spacing
============================================================ */
.gam-battle-prompt, .gam-feed-prompt, .gam-coach-latex-preview, .gam-drill-question {
    line-height: 1.55;
    overflow-x: auto;
    max-width: 100%;
}

.gam-battle-prompt .katex,
.gam-feed-prompt .katex,
.gam-drill-question .katex,
.gam-coach-latex-preview .katex {
    font-size: 1.05em;
}

.gam-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f1a2e;
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 10px 16px;
    border-radius: 6px;
    z-index: 9999;
    font-size: 13px;
}

/* ============================================================
   Rival panel + Concept Decay + Deep Work + Study Feed
============================================================ */
.gam-today-rival-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

@media (max-width: 900px) {
    .gam-today-rival-row { grid-template-columns: 1fr; }
}

.gam-rival-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(44, 72, 105, 0.6);
    border-left: 5px solid #c98716;
    border-radius: 10px;
    padding: 16px 20px;
}

.gam-rival-panel h3 {
    margin: 6px 0 8px;
    color: #f3a35c;
    font-size: 1.2rem;
    font-weight: 700;
}

.gam-rival-panel.ahead    { border-left-color: #a99e5e; }
.gam-rival-panel.close    { border-left-color: #f3a35c; }
.gam-rival-panel.near     { border-left-color: #c98716; }
.gam-rival-panel.behind   { border-left-color: #d98a8a; }

.gam-rival-panel p {
    margin: 6px 0;
    color: #d6dde6;
    font-size: 0.9rem;
    line-height: 1.4;
}

.gam-decay-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #2c4869;
    border-radius: 8px;
    padding: 12px 14px;
}

.gam-decay-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gam-decay-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: baseline;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid #a99e5e;
}

.gam-decay-list strong { color: #edf1f4; font-size: 0.88rem; }
.gam-decay-list span { color: #e4bf83; font-weight: 700; font-size: 0.85rem; }
.gam-decay-list small { color: #97a4b4; font-size: 0.75rem; }

.gam-decay-fresh    { background: rgba(170, 158, 96, 0.08); }
.gam-decay-fresh    { border-left-color: #a99e5e; }
.gam-decay-stable   { background: rgba(228, 191, 131, 0.06); border-left-color: #e4bf83; }
.gam-decay-weakening{ background: rgba(243, 163, 92, 0.08); border-left-color: #f3a35c; }
.gam-decay-atrisk   { background: rgba(143, 58, 54, 0.1); border-left-color: #d98a8a; }
.gam-decay-decayed  { background: rgba(143, 58, 54, 0.18); border-left-color: #d98a8a; opacity: 0.85; }

.gam-today-deepwork {
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(44, 72, 105, 0.6);
    border-radius: 10px;
    padding: 16px 20px;
}

.gam-deepwork-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.gam-deepwork-grid .gam-action-button,
.gam-deepwork-grid .gam-ghost-button {
    padding: 8px 14px;
    font-size: 13px;
}

/* Deep Work session modal */
.gam-deepwork-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gam-deepwork-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 720px;
    width: 100%;
    color: #f4ecd8;
    max-height: 92vh;
    overflow-y: auto;
}

.gam-deepwork-shell header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.gam-deepwork-clock {
    font-size: 1.5rem;
    color: #f3a35c;
    font-weight: 700;
    font-family: monospace;
}

.gam-deepwork-prompt {
    background: rgba(228, 191, 131, 0.08);
    border-left: 3px solid #e4bf83;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 12px 0;
    line-height: 1.55;
}

.gam-deepwork-scratch {
    display: block;
    width: 100%;
    min-height: 200px;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 12px 14px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.55;
}

.gam-deepwork-actions {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

/* Study Feed modal */
.gam-studyfeed-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gam-studyfeed-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 540px;
    width: 100%;
    color: #f4ecd8;
}

.gam-studyfeed-shell header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.gam-sf-card {
    background: rgba(228, 191, 131, 0.06);
    border: 1px solid #2c4869;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
    min-height: 200px;
}

.gam-sf-card.gam-sf-coach    { border-left: 3px solid #e4bf83; }
.gam-sf-card.gam-sf-rematch  { border-left: 3px solid #8f3a36; background: rgba(143, 58, 54, 0.08); }
.gam-sf-card.gam-sf-flashcard{ border-left: 3px solid #a99e5e; }
.gam-sf-card.gam-sf-formula  { border-left: 3px solid #c98716; }
.gam-sf-card.gam-sf-trigger  { border-left: 3px solid #f3a35c; }
.gam-sf-card.gam-sf-concept  { border-left: 3px solid #caa24f; }
.gam-sf-card.gam-sf-boss     { border-left: 3px solid #e05a2b; background: rgba(143, 58, 54, 0.1); }

.gam-sf-type {
    color: #97a4b4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
}

.gam-sf-card h3 {
    color: #edf1f4;
    margin: 4px 0 10px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.gam-sf-a {
    color: #c9d2dc;
    line-height: 1.55;
    margin: 6px 0 0;
}

.gam-sf-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

/* Battle hint ladder spacing */
.gam-hint-ladder ol li .katex { font-size: 1em; }

/* ============================================================
   KAHOOT MODE
============================================================ */
.gam-kahoot-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gam-kahoot-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 640px;
    width: 100%;
    color: #f4ecd8;
}

.gam-kahoot-shell header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.gam-kahoot-meta {
    display: flex;
    gap: 14px;
}

.gam-kahoot-meta span {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gam-kahoot-meta strong { font-size: 1.4rem; color: #f3a35c; }
.gam-kahoot-meta small { font-size: 10px; color: #97a4b4; text-transform: uppercase; }

.gam-kahoot-q {
    font-size: 1.4rem;
    margin: 12px 0;
    line-height: 1.45;
    color: #edf1f4;
    min-height: 60px;
}

.gam-kahoot-topic {
    color: #97a4b4;
    font-size: 12px;
    margin: 0 0 14px;
}

.gam-kahoot-opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gam-kahoot-opt {
    padding: 18px 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f4ecd8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}

.gam-kahoot-opt:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gam-kahoot-opt:disabled { opacity: 0.5; cursor: default; }

.gam-kahoot-opt-0 { background: #8f3a36; }
.gam-kahoot-opt-1 { background: #caa24f; }
.gam-kahoot-opt-2 { background: #c98716; }
.gam-kahoot-opt-3 { background: #a99e5e; }

.gam-kahoot-opt.gam-kahoot-correct { box-shadow: 0 0 0 3px #a99e5e inset; opacity: 1; }
.gam-kahoot-opt.gam-kahoot-wrong   { box-shadow: 0 0 0 3px #8f3a36 inset; opacity: 0.6; }

.gam-kahoot-trap {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(228, 191, 131, 0.08);
    border-left: 3px solid #e4bf83;
    border-radius: 4px;
    color: #d6dde6;
    font-size: 0.9rem;
}

.gam-kahoot-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.gam-kahoot-result strong {
    font-size: 3rem;
    color: #f3a35c;
}

.gam-kahoot-result small {
    color: #97a4b4;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   IN-PAGE NOTIFICATIONS
============================================================ */
.gam-notif {
    max-width: calc(100vw - 32px);
    position: fixed;
    top: 24px;
    right: 24px;
    width: 320px;
    background: linear-gradient(180deg, #0f1a2e, #1a2740);
    border: 1px solid #2c4869;
    border-radius: 10px;
    padding: 14px 16px;
    color: #f4ecd8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 9998;
    transform: translateX(360px);
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    border-left-width: 4px;
}

.gam-notif.show { transform: translateX(0); }

.gam-notif-streak  { border-left-color: #f3a35c; }
.gam-notif-rival   { border-left-color: #c98716; }
.gam-notif-push    { border-left-color: #e4bf83; }
.gam-notif-mistake { border-left-color: #d98a8a; }
.gam-notif-decay   { border-left-color: #d98a8a; }

.gam-notif-eyebrow {
    color: #97a4b4;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    margin: 0 0 4px;
}

.gam-notif h4 {
    margin: 2px 0 6px;
    font-size: 1rem;
    color: #f3a35c;
}

.gam-notif p {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: #d6dde6;
    line-height: 1.4;
}

.gam-notif-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================
   PRODUCTIVITY TOOLKIT
============================================================ */
.gam-toolkit-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.gam-toolkit-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 880px;
    width: 100%;
    color: #f4ecd8;
    max-height: 92vh;
    overflow-y: auto;
}

.gam-toolkit-shell header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gam-toolkit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.gam-toolkit-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #2c4869;
    border-radius: 8px;
    padding: 14px 16px;
}

.gam-toolkit-card p { margin: 6px 0; font-size: 0.9rem; }

.gam-toolkit-pomos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 8px 0;
}

.gam-toolkit-pomo-state {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(228, 191, 131, 0.1);
    border-left: 3px solid #e4bf83;
    border-radius: 4px;
    font-family: monospace;
}

.gam-toolkit-break {
    background: rgba(243, 163, 92, 0.08);
    border-left: 3px solid #f3a35c;
    padding: 12px 14px;
    border-radius: 4px;
    margin: 8px 0 10px;
    color: #f4ecd8;
    line-height: 1.55;
}

.gam-toolkit-habits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gam-toolkit-habits li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.gam-toolkit-habits strong { color: #f3a35c; font-size: 1.1rem; }
.gam-toolkit-habits small { color: #97a4b4; font-size: 12px; }

.gam-toolkit-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gam-toolkit-checklist li {
    padding: 6px 0 6px 22px;
    position: relative;
    color: #d6dde6;
    font-size: 0.88rem;
}

.gam-toolkit-checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #a99e5e;
    font-weight: 700;
}

/* ============================================================
   SKILL TREE / MASTERY MAP
============================================================ */
.gam-tree-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.gam-tree-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 20px 24px;
    max-width: 720px;
    width: 100%;
    color: #f4ecd8;
    max-height: 95vh;
    overflow-y: auto;
}

.gam-tree-shell header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gam-tree-svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    background: radial-gradient(circle at center, rgba(228, 191, 131, 0.1), #070d18);
    background-image: 
        radial-gradient(rgba(228, 191, 131, 0.1) 1px, transparent 1px),
        radial-gradient(rgba(228, 191, 131, 0.05) 1.5px, transparent 1.5px);
    background-size: 20px 20px, 60px 60px;
    border-radius: 12px;
    border: 1px solid rgba(228, 191, 131, 0.2);
}

.gam-tree-edge {
    stroke: rgba(228, 191, 131, 0.35);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke 0.3s, stroke-width 0.3s;
}

.gam-tree-node { cursor: pointer; transition: transform 0.2s; }
.gam-tree-node:hover { transform: scale(1.08); }
.gam-tree-node:hover .gam-tree-edge-connected { stroke: #e4bf83; stroke-width: 3.5; }

.gam-tree-node rect {
    fill: #0a111f;
    stroke: #3d4a5e;
    stroke-width: 2.5;
    transition: all 0.3s;
}

.gam-tree-node text {
    fill: #f4ecd8;
    pointer-events: none;
    text-transform: uppercase;
}

.gam-tree-icon {
    font-size: 14px;
    font-weight: 900;
    fill: #e4bf83 !important;
}

.gam-tree-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    fill: #b9c8da !important;
}

.gam-tree-node text.gam-tree-rating {
    fill: #f3a35c !important;
    font-size: 9px;
    font-weight: 800;
    opacity: 0.8;
}

.gam-tree-locked rect      { stroke: #2a3442; fill: #070d18; }
.gam-tree-locked .gam-tree-icon { fill: #2a3442 !important; }
.gam-tree-locked .gam-tree-label { fill: #2a3442 !important; }

.gam-tree-open rect        { stroke: #e4bf83; fill: rgba(228, 191, 131, 0.12); }
.gam-tree-open .gam-tree-icon { fill: #8fa1ff !important; }

.gam-tree-developing rect  { stroke: #caa24f; fill: rgba(228, 191, 131, 0.18); }
.gam-tree-developing .gam-tree-icon { fill: #a5c7f7 !important; }

.gam-tree-stable rect      { stroke: #a99e5e; fill: rgba(170, 158, 96, 0.2); }
.gam-tree-stable .gam-tree-icon { fill: #a99e5e !important; }

.gam-tree-mastered rect    { 
    stroke: #a99e5e; 
    fill: rgba(170, 158, 96, 0.25); 
    stroke-width: 4; 
    filter: drop-shadow(0 0 10px rgba(170, 158, 96, 0.5));
}
.gam-tree-mastered .gam-tree-icon { fill: #f4ecd8 !important; }
.gam-tree-mastered .gam-tree-label { fill: #f4ecd8 !important; }
.gam-tree-mastered text.gam-tree-rating { fill: #a99e5e !important; opacity: 1; }

.gam-tree-decay-atrisk rect  { stroke: #f3a35c; stroke-dasharray: 5 3; }
.gam-tree-decay-decayed rect { 
    stroke: #8f3a36; 
    stroke-dasharray: 4 4; 
    stroke-width: 3.5; 
    filter: drop-shadow(0 0 8px rgba(143, 58, 54, 0.6));
}


.gam-tree-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #2c4869;
}

.gam-tree-legend span {
    font-size: 11px;
    color: #c9d2dc;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #2c4869;
}

.gam-tree-legend-mastered    { color: #a99e5e; border-color: #a99e5e; }
.gam-tree-legend-stable      { color: #a99e5e; border-color: #a99e5e; }
.gam-tree-legend-developing  { color: #caa24f; border-color: #caa24f; }
.gam-tree-legend-open        { color: #e4bf83; border-color: #e4bf83; }
.gam-tree-legend-locked      { color: #97a4b4; border-color: #4a5b6e; }
.gam-tree-legend-decayed     { color: #d98a8a; border-color: #d98a8a; }

/* anti-doomscroll panel in Today */
.gam-today-tools {
    margin-top: 16px;
    background: linear-gradient(180deg, rgba(143, 58, 54, 0.1), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(143, 58, 54, 0.45);
    border-radius: 10px;
    padding: 16px 20px;
}

/* ============================================================
   Rapid drill duration picker
============================================================ */
.gam-drill-duration-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin: 10px 0 14px;
    padding: 8px 12px;
    background: rgba(228, 191, 131, 0.05);
    border-left: 3px solid #e4bf83;
    border-radius: 4px;
}

.gam-drill-duration-picker small {
    color: #97a4b4;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

.gam-drill-duration-picker button {
    font-size: 12px;
    padding: 4px 10px;
}

/* ============================================================
   Wall of Trophies modal
============================================================ */
.gam-trophies-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gam-trophies-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 880px;
    width: 100%;
    color: #f4ecd8;
    max-height: 92vh;
    overflow-y: auto;
}

.gam-trophies-shell header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gam-trophies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.gam-trophy {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2c4869;
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.gam-trophy.locked { opacity: 0.4; filter: grayscale(0.8); }

.gam-trophy.earned {
    border-color: #f3a35c;
    background: linear-gradient(180deg, rgba(243, 163, 92, 0.15), rgba(0, 0, 0, 0.3));
}

.gam-trophy-icon { font-size: 2.2rem; line-height: 1; }
.gam-trophy strong { font-size: 0.92rem; color: #edf1f4; }
.gam-trophy small { font-size: 11px; color: #b9c8da; line-height: 1.4; }
.gam-trophy em { font-size: 10px; color: #f3a35c; font-style: normal; font-weight: 700; }

/* ============================================================
   Arena ladder (Clash of Clans-style)
============================================================ */
.gam-arena-ladder {
    margin-bottom: 20px;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(228, 191, 131, 0.08), rgba(0, 0, 0, 0.3));
    border: 1px solid #2c4869;
    border-radius: 10px;
}

.gam-arena-current {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(151, 164, 180, 0.2);
    margin-bottom: 12px;
}

.gam-arena-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--arena-color), rgba(0, 0, 0, 0.6));
    border: 3px solid var(--arena-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.gam-arena-info h3 {
    margin: 4px 0 4px;
    font-size: 1.3rem;
    color: var(--arena-color);
}

.gam-arena-info p { margin: 2px 0; font-size: 0.9rem; }

.gam-arena-progress { margin-bottom: 14px; }

.gam-arena-progress-head {
    color: #d6dde6;
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.gam-arena-progress-head strong { color: #f3a35c; }

.gam-arena-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2c4869;
}

.gam-arena-bar-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    border-radius: 6px;
}

.gam-arena-reward {
    margin-top: 6px;
    font-size: 0.82rem;
}

.gam-arena-strip {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-top: 14px;
}

@media (max-width: 680px) {
    .gam-arena-strip { grid-template-columns: repeat(4, 1fr); }
}

.gam-arena-tile {
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2c4869;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
    transition: transform 0.15s;
}

.gam-arena-tile.reached {
    border-color: var(--arena-color);
    background: linear-gradient(180deg, color-mix(in srgb, var(--arena-color) 18%, transparent), rgba(0, 0, 0, 0.4));
}

.gam-arena-tile.locked {
    opacity: 0.4;
    filter: grayscale(0.6);
}

.gam-arena-tile.current {
    transform: translateY(-3px);
    box-shadow: 0 0 12px var(--arena-color), 0 4px 14px rgba(0, 0, 0, 0.4);
    border-width: 2px;
}

.gam-arena-tile.current::after {
    content: "YOU";
    position: absolute;
    top: -8px;
    right: 4px;
    font-size: 9px;
    background: var(--arena-color);
    color: #07111e;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.gam-arena-tile-icon { font-size: 1.7rem; line-height: 1; }
.gam-arena-tile small { font-size: 10px; color: #d6dde6; font-weight: 700; }
.gam-arena-tile em { font-size: 9px; color: #97a4b4; font-style: normal; }

.gam-trophies-section-title {
    margin: 6px 0 12px;
    font-size: 1rem;
    color: #d6dde6;
}

/* Archive problem badge + solution reveal */
.gam-archive-badge {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(228, 191, 131, 0.25);
    color: #a8b0e0;
    border: 1px solid rgba(228, 191, 131, 0.4);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-left: 4px;
}

.gam-hint-ladder-archive {
    border-left-color: #e4bf83 !important;
}

.gam-archive-solution {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid #a99e5e;
    padding: 8px 12px;
    border-radius: 4px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.gam-archive-solution details { margin-bottom: 8px; }
.gam-archive-solution summary { cursor: pointer; color: #a99e5e; font-weight: 700; padding: 2px 0; }
.gam-archive-solution details[open] summary { color: #a99e5e; }
.gam-archive-solution div { padding: 6px 0; white-space: pre-wrap; }

.gam-archive-answer {
    background: rgba(170, 158, 96, 0.15);
    color: #a99e5e;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}

/* ============================================================
   BODY DOUBLE MODE — webcam preview + timer overlay
============================================================ */
.gam-body-double {
    position: fixed;
    bottom: 220px;
    right: 24px;
    width: 280px;
    background: #0f1a2e;
    border: 1px solid #e4bf83;
    border-radius: 10px;
    color: #f4ecd8;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.gam-body-double:hover { box-shadow: 0 14px 36px rgba(228, 191, 131, 0.4); }

.gam-bd-head {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(228, 191, 131, 0.15);
    border-bottom: 1px solid #2c4869;
    cursor: move;
    user-select: none;
}

.gam-bd-eyebrow {
    margin: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #e4bf83;
}

.gam-bd-clock {
    font-family: monospace;
    font-size: 14px;
    color: #f3a35c;
}

.gam-bd-link, .gam-bd-close {
    background: none;
    border: none;
    color: #c9d2dc;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
}

.gam-bd-link:hover { background: rgba(228, 191, 131, 0.2); color: #e4bf83; }
.gam-bd-close:hover { background: rgba(143, 58, 54, 0.2); color: #d98a8a; }

.gam-bd-video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #000;
    display: block;
    transform: scaleX(-1); /* mirror for selfie-style natural feel */
}

.gam-bd-status {
    padding: 8px 10px;
    font-size: 11px;
    color: #97a4b4;
    line-height: 1.45;
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================================
   LADDER MODE — 8-belt progressive curriculum modal
============================================================ */
.gam-ladder-modal {
    position: fixed; inset: 0;
    background: rgba(7, 17, 30, 0.92);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 14px; overflow: hidden;
}

.gam-ladder-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 18px 22px;
    max-width: 1080px;
    width: 100%;
    color: #f4ecd8;
    max-height: 94vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gam-ladder-shell header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.gam-ladder-shell header h2 {
    font-size: 1.15rem;
    color: #edf1f4;
    margin: 4px 0 6px;
    font-weight: 500;
}

.gam-ladder-shell header h2 strong { color: var(--belt-color, #f3a35c); }

.gam-ladder-belts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.gam-ladder-belt {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2c4869;
    border-left: 5px solid var(--belt-color);
    border-radius: 8px;
    padding: 14px 18px;
}

.gam-ladder-belt header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(151, 164, 180, 0.15);
}

.gam-ladder-belt-icon {
    font-size: 2.4rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px var(--belt-color));
}

.gam-ladder-belt header strong {
    color: var(--belt-color);
    font-size: 1.1rem;
    display: block;
}

.gam-ladder-belt header small {
    color: #97a4b4;
    font-size: 11px;
}

.gam-ladder-belt header small em {
    color: #f3a35c;
    font-style: normal;
    font-weight: 700;
}

.gam-ladder-progress {
    color: #c9d2dc;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.gam-ladder-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.gam-ladder-badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.gam-ladder-badge.complete { color: #a99e5e; background: rgba(170, 158, 96, 0.18); border: 1px solid #a99e5e; }
.gam-ladder-badge.ontrack { color: #97a4b4; background: rgba(151, 164, 180, 0.12); border: 1px solid #4a5b6e; }
.gam-ladder-badge.tight { color: #f3a35c; background: rgba(243, 163, 92, 0.18); border: 1px solid #f3a35c; }
.gam-ladder-badge.behind { color: #ffb8a0; background: rgba(143, 58, 54, 0.25); border: 1px solid #8f3a36; animation: gam-pulse-warn 2.4s infinite; }

@keyframes gam-pulse-warn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(143, 58, 54, 0); }
    50% { box-shadow: 0 0 0 6px rgba(143, 58, 54, 0.18); }
}

.gam-ladder-belt.gam-ladder-dl-behind {
    border-left-width: 7px;
    box-shadow: 0 0 20px rgba(143, 58, 54, 0.18);
}

.gam-ladder-belt.gam-ladder-dl-tight {
    border-left-width: 6px;
}

/* Today panel deadline countdown banner */
.gam-today-countdown {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 4px solid;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gam-today-countdown strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.gam-today-countdown small {
    color: #97a4b4;
    font-size: 11px;
}

.gam-today-countdown-ontrack {
    background: rgba(228, 191, 131, 0.08);
    border-left-color: #e4bf83;
    color: #c9d2dc;
}

.gam-today-countdown-tight {
    background: rgba(243, 163, 92, 0.14);
    border-left-color: #f3a35c;
    color: #f3a35c;
}

.gam-today-countdown-behind {
    background: rgba(143, 58, 54, 0.18);
    border-left-color: #d98a8a;
    color: #ffb8a0;
    animation: gam-pulse-warn 2.4s infinite;
}

.gam-ladder-tagline {
    color: #d6dde6;
    font-size: 0.92rem;
    margin: 2px 0 8px;
}

.gam-ladder-lessons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gam-ladder-lessons li {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
}

.gam-ladder-lessons li.done { background: rgba(170, 158, 96, 0.1); }
.gam-ladder-lessons li.belt-test { background: rgba(243, 163, 92, 0.12); }
.gam-ladder-lessons li.belt-test.done { background: rgba(170, 158, 96, 0.18); }

.lesson-status { font-size: 1.1rem; text-align: center; }

.gam-ladder-lesson-link {
    background: none;
    border: none;
    color: #edf1f4;
    text-align: left;
    cursor: pointer;
    font-size: 0.92rem;
    padding: 2px 0;
}

.gam-ladder-lesson-link:hover { color: var(--belt-color); text-decoration: underline; }

.gam-ladder-locked { opacity: 0.4; filter: grayscale(0.5); }
.gam-ladder-locked-msg { color: #97a4b4; font-style: italic; }

.gam-ladder-current { box-shadow: 0 0 16px rgba(243, 163, 92, 0.25); }
.gam-ladder-complete { opacity: 0.85; }

.gam-ladder-footer {
    padding-top: 8px;
    border-top: 1px solid #2c4869;
    color: #97a4b4;
    font-size: 13px;
}

.gam-ladder-footer strong { color: #f3a35c; }

.gam-belt-promotion {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f3a35c, #c98716);
    color: #0f1a2e;
    padding: 18px 28px;
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    z-index: 10001;
    text-align: center;
    box-shadow: 0 12px 40px rgba(243, 163, 92, 0.5);
    animation: gam-belt-pop 0.5s ease-out;
}

@keyframes gam-belt-pop {
    0%   { transform: translateX(-50%) translateY(-40px) scale(0.7); opacity: 0; }
    60%  { transform: translateX(-50%) translateY(8px) scale(1.05); opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

/* ============================================================
   LESSON VIEW — single-lesson detail modal
============================================================ */
.gam-lesson-modal {
    position: fixed; inset: 0;
    background: rgba(7, 17, 30, 0.95);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 14px;
}

.gam-lesson-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-left: 4px solid var(--belt-color);
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 720px;
    width: 100%;
    max-height: 94vh;
    overflow-y: auto;
    color: #f4ecd8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gam-lesson-shell header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.gam-lesson-shell h2 {
    color: var(--belt-color);
    font-size: 1.3rem;
    margin: 4px 0 0;
}

.gam-lesson-concept {
    background: rgba(228, 191, 131, 0.08);
    border-left: 3px solid var(--belt-color);
    border-radius: 6px;
    padding: 12px 16px;
}

.gam-lesson-concept p {
    margin: 6px 0;
    line-height: 1.55;
    color: #d6dde6;
}

.gam-lesson-block {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 10px 14px;
}

.gam-lesson-block p {
    margin: 4px 0;
    color: #d6dde6;
}

.gam-lesson-block a {
    color: #a99e5e;
    text-decoration: none;
    font-weight: 700;
}

.gam-lesson-block a:hover { text-decoration: underline; }

.gam-lesson-problems {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 12px 16px;
}

.gam-lesson-problem-list {
    list-style: decimal inside;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gam-lesson-problem-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(228, 191, 131, 0.06);
    border-radius: 4px;
}

.gam-lesson-problem-list strong { grid-column: 1; color: #edf1f4; }
.gam-lesson-problem-list small { grid-column: 1; color: #97a4b4; font-size: 11px; }
.gam-lesson-problem-list button { grid-column: 2; grid-row: 1 / 3; }

.gam-lesson-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #2c4869;
}

.gam-lesson-footer .muted { flex: 1; min-width: 200px; }

.gam-slot-trainer-banner {
    background: linear-gradient(90deg, rgba(243, 163, 92, 0.18), rgba(228, 191, 131, 0.12));
    border-left: 4px solid #f3a35c;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gam-slot-trainer-banner strong { color: #f3a35c; font-size: 1.02rem; }
.gam-slot-trainer-banner small { color: #c9d2dc; font-size: 12px; line-height: 1.45; }
.gam-slot-trainer-banner code { background: rgba(0,0,0,0.35); padding: 1px 5px; border-radius: 3px; color: #a99e5e; font-size: 11px; }

/* Archive Browser modal */
.gam-archive-browser-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    overflow: hidden;
}

.gam-archive-browser-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 18px 22px;
    max-width: 1080px;
    width: 100%;
    color: #f4ecd8;
    max-height: 94vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gam-archive-browser-shell header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
}

.gam-archive-browser-shell h2 {
    margin: 4px 0 0;
    font-size: 1.05rem;
    color: #d6dde6;
    font-weight: 500;
}

.gam-archive-browser-shell h2 strong { color: #f3a35c; }

.gam-archive-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #2c4869;
    border-radius: 8px;
}

.gam-archive-filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.gam-archive-filter-row label {
    font-size: 11px;
    color: #97a4b4;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-width: 70px;
}

.gam-archive-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.gam-chip {
    padding: 3px 9px;
    background: rgba(228, 191, 131, 0.08);
    border: 1px solid rgba(228, 191, 131, 0.3);
    color: #c9d2dc;
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.gam-chip:hover { background: rgba(228, 191, 131, 0.18); border-color: #e4bf83; }

.gam-chip.active {
    background: #e4bf83;
    border-color: #e4bf83;
    color: #07111e;
    font-weight: 700;
}

/* Current program week marker in Guidance Mode's week strip. */
.gam-chip-now:not(.active) {
    border-color: #f5b94d;
    color: #f5b94d;
    box-shadow: 0 0 0 1px rgba(245, 185, 77, 0.25) inset;
}

/* Quota-met badge in Guidance Mode. */
.gam-chip-mini.gam-quota-done {
    background: rgba(170, 158, 96, 0.16);
    border-color: #a99e5e;
    color: #a99e5e;
}

/* Battle result: your-attempt + reveal-solution + AI grade. */
.gam-battle-yourwork {
    margin: .75rem 0;
    border: 1px solid rgba(228, 191, 131, 0.3);
    border-radius: 10px;
    padding: .5rem .75rem;
    background: rgba(228, 191, 131, 0.06);
}
.gam-battle-yourwork summary { cursor: pointer; font-size: 13px; color: #c9d2dc; }
.gam-battle-worktext {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: auto;
    margin: .5rem 0 0;
    font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    color: #e6edf5;
}
.gam-battle-solbody, .gam-ai-grade-out {
    margin-top: .5rem;
    padding: .65rem .8rem;
    border-radius: 10px;
    background: rgba(170, 158, 96, 0.07);
    border: 1px solid rgba(170, 158, 96, 0.25);
    font-size: 13.5px;
    line-height: 1.6;
    max-height: 320px;
    overflow: auto;
}
.gam-ai-grade-out { background: rgba(245, 185, 77, 0.07); border-color: rgba(245, 185, 77, 0.25); }
.gam-battle-solcheck, .gam-battle-aigrade { margin: .5rem 0; }

/* Backup overdue: turn the always-visible sidebar safety panel into a nudge. */
.sidebar-safety-panel.is-alert {
    border-color: #f5b94d;
    background: rgba(245, 185, 77, 0.10);
    box-shadow: 0 0 0 1px rgba(245, 185, 77, 0.35) inset;
    animation: backup-alert-pulse 2.4s ease-in-out infinite;
}
.sidebar-safety-panel.is-alert #backup-status-main {
    color: #f5b94d;
}
@keyframes backup-alert-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(245, 185, 77, 0.30) inset; }
    50% { box-shadow: 0 0 0 1px rgba(245, 185, 77, 0.65) inset; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar-safety-panel.is-alert { animation: none; }
}

.gam-chip-mini {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(228, 191, 131, 0.12);
    color: #b8c8da;
    border: 1px solid rgba(228, 191, 131, 0.25);
    border-radius: 3px;
    font-size: 10px;
    margin-right: 4px;
}

.gam-chip-mini.muted { color: #97a4b4; border-color: #4a5b6e; background: rgba(0, 0, 0, 0.2); }

.gam-archive-search {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 13px;
}

.gam-archive-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
}

.gam-archive-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid #e4bf83;
    border-radius: 5px;
}

.gam-archive-row-tutorial   { border-left-color: #a99e5e; }
.gam-archive-row-warmup     { border-left-color: #a99e5e; }
.gam-archive-row-standard   { border-left-color: #caa24f; }
.gam-archive-row-challenge  { border-left-color: #c98716; }
.gam-archive-row-boss       { border-left-color: #f3a35c; }
.gam-archive-row-nightmare  { border-left-color: #d98a8a; }

.gam-archive-status { font-size: 1.1rem; text-align: center; }

.gam-archive-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gam-archive-meta strong { color: #edf1f4; font-size: 0.94rem; }
.gam-archive-meta small { color: #97a4b4; font-size: 11px; }
.gam-archive-tags { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }

/* Phase 2: explicit mark-done + archive progress. */
.gam-archive-row-actions { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.gam-archive-row.is-done { border-left-color: #7bc6aa; }
.gam-archive-done { font-size: 12px; padding: 4px 8px; white-space: nowrap; }
.gam-archive-done.is-done { color: #7bc6aa; border-color: #7bc6aa; }
.gam-archive-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.gam-archive-progress-label { font-size: 12px; color: #7bc6aa; white-space: nowrap; }
.gam-archive-progress-bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; min-width: 90px; }
.gam-archive-progress-bar > span { display: block; height: 100%; background: #7bc6aa; }

.gam-archive-review { font-size: 12px; padding: 4px 10px; white-space: nowrap; border-color: #7bc6aa; color: #7bc6aa; }

/* Phase 3: flashcard / spaced-repetition review modal. */
.gam-flashcard-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 30, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}
.gam-flashcard-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 18px 22px;
    max-width: 760px;
    width: 100%;
    color: #f4ecd8;
    max-height: 94vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gam-flashcard-shell header { display: flex; justify-content: space-between; align-items: flex-start; }
.gam-flashcard-card {
    border: 1px solid #2c4869;
    border-left: 3px solid #e4bf83;
    border-radius: 8px;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.25);
    min-height: 140px;
}
.gam-flashcard-title { font-size: 12px; color: #97a4b4; margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.gam-flashcard-front { font-size: 1.02rem; line-height: 1.5; }
.gam-flashcard-back { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(228, 191, 131, 0.35); }
.gam-flashcard-back-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #7bc6aa; margin: 0 0 6px; }
.gam-flashcard-solution { font-size: 0.95rem; line-height: 1.5; }
.gam-flashcard-answer { margin-top: 10px; color: #e4bf83; }
.gam-flashcard-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gam-flashcard-actions button { min-width: 120px; }
.gam-flashcard-empty { text-align: center; padding: 28px 12px; }
@media (max-width: 560px) {
    .gam-flashcard-actions button { min-width: 0; flex: 1; }
}

.gam-archive-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #2c4869;
    color: #97a4b4;
    font-size: 13px;
}

/* Mini arena badge in the Today panel */
.gam-today-arena-mini {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2c4869;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.gam-today-arena-mini:hover { border-color: #e4bf83; transform: translateY(-1px); }

.gam-today-arena-badge {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--arena-color), rgba(0, 0, 0, 0.5));
    border: 2px solid var(--arena-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), inset 0 0 6px rgba(255, 255, 255, 0.12);
}

.gam-today-arena-mini strong {
    display: block;
    color: #f4ecd8;
    font-size: 0.9rem;
}

.gam-today-arena-mini small {
    display: block;
    color: #97a4b4;
    font-size: 11px;
}

/* ============================================================
   SRS deck modal
============================================================ */
.gam-srs-modal {
    position: fixed; inset: 0;
    background: rgba(7, 17, 30, 0.9);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}

.gam-srs-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 560px; width: 100%;
    color: #f4ecd8; max-height: 95vh; overflow-y: auto;
}

.gam-srs-shell header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.gam-srs-card {
    background: rgba(228, 191, 131, 0.08);
    border-left: 3px solid #e4bf83;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 14px;
    min-height: 160px;
}

.gam-srs-card h3 { color: #edf1f4; font-size: 1.2rem; margin: 4px 0 12px; line-height: 1.45; }

.gam-srs-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.gam-srs-add {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #2c4869;
    display: flex; flex-direction: column; gap: 6px;
}

.gam-srs-add input[type="text"] {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* ============================================================
   Mock Day modal
============================================================ */
.gam-mockday-modal {
    position: fixed; inset: 0;
    background: rgba(7, 17, 30, 0.95);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; overflow-y: auto;
}

.gam-mockday-shell {
    background: #0f1a2e;
    border: 2px solid #8f3a36;
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 760px; width: 100%;
    color: #f4ecd8; max-height: 95vh; overflow-y: auto;
}

.gam-mockday-shell header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }

.gam-mockday-clock {
    font-size: 1.4rem; font-weight: 700;
    color: #d98a8a; font-family: monospace;
    display: flex; flex-direction: column; align-items: center;
}

.gam-mockday-clock small { font-size: 10px; color: #97a4b4; text-transform: uppercase; }

/* ============================================================
   Session History modal
============================================================ */
.gam-history-modal {
    position: fixed; inset: 0;
    background: rgba(7, 17, 30, 0.9);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}

.gam-history-shell {
    background: #0f1a2e;
    border: 1px solid #2c4869;
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 700px; width: 100%;
    color: #f4ecd8; max-height: 92vh; overflow-y: auto;
}

.gam-history-shell header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.gam-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.gam-history-list li {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid #e4bf83;
    border-radius: 4px;
}

.gam-history-list li strong { color: #edf1f4; font-size: 0.9rem; }
.gam-history-list li span { color: #c9d2dc; font-size: 0.82rem; }
.gam-history-list li small { color: #97a4b4; font-size: 11px; font-family: monospace; }

.gam-history-battle    { border-left-color: #e4bf83; }
.gam-history-drill-pb  { border-left-color: #a99e5e; }
.gam-history-kahoot-pb { border-left-color: #f3a35c; }
.gam-history-mock-day  { border-left-color: #d98a8a; }
.gam-history-deep-work { border-left-color: #c98716; }

/* ============================================================
   Floating extra launchers tray
============================================================ */
.gam-extra-launchers {
    position: fixed;
    right: 10px;
    bottom: 96px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 9000;
    pointer-events: auto;
}

.gam-extra-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1a2740, #0f1a2e);
    border: 1px solid #2c4869;
    color: #f4ecd8;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.gam-extra-btn:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(228, 191, 131, 0.4);
    border-color: #e4bf83;
}

/* ============================================================
   Coach voice TTS toggle + speak button
============================================================ */
.gam-coach-voice-tts {
    display: flex; align-items: center; gap: 8px;
    margin: 10px 0;
    color: #c9d2dc;
    font-size: 13px;
}

.gam-coach-voice-tts input { accent-color: #e4bf83; }

.gam-coach-voice-speak {
    margin-left: 6px;
    font-size: 12px;
    padding: 2px 8px;
}

/* ============================================================
   Improved Productivity Toolkit UI
============================================================ */
.gam-toolkit-card h3 { margin: 0 0 6px; color: #f3a35c; font-size: 1.05rem; }

.gam-toolkit-card {
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gam-toolkit-card:hover {
    border-color: #e4bf83;
    box-shadow: 0 2px 8px rgba(228, 191, 131, 0.2);
}

.gam-toolkit-pomos button { font-size: 11px; padding: 6px 8px; }

.gam-toolkit-pomo-state strong {
    display: inline-block;
    margin-right: 6px;
    color: #f3a35c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
}

/* ============================================================
   Roadmap V2 gate architecture
============================================================ */
.roadmap-v2-page .week-page {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.roadmap-v2-shell {
    display: grid;
    gap: 1.15rem;
    padding: 1.35rem;
    border-color: rgba(228, 191, 131, 0.22);
}

.roadmap-v2-shell.current { border-color: rgba(170, 158, 96, 0.48); }
.roadmap-v2-shell.behind { border-color: rgba(255, 176, 88, 0.6); }

.roadmap-v2-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}

.roadmap-v2-header h2 {
    margin: 0.2rem 0 0.4rem;
    font-size: clamp(1.35rem, 2vw, 2rem);
}

.roadmap-v2-header p {
    max-width: 78ch;
    color: var(--muted);
}

.roadmap-v2-meta {
    display: grid;
    gap: 0.45rem;
    justify-items: end;
    min-width: 10rem;
}

.roadmap-v2-meta span,
.roadmap-gate-status,
.topic-chip-row .mini-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.34rem 0.62rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.roadmap-v2-meta .danger {
    border-color: rgba(255, 176, 88, 0.55);
    color: #ffd59a;
}

.roadmap-v2-progress {
    display: grid;
    grid-template-columns: auto minmax(12rem, 1fr);
    gap: 0.85rem;
    align-items: center;
}

.roadmap-v2-bar {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.roadmap-v2-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #63f1be, #7aa2ff);
}

.roadmap-v2-controls {
    display: grid;
    grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.roadmap-v2-controls .toggle-row {
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.035);
}

.roadmap-v2-controls .toggle-row input {
    width: 1.1rem;
    height: 1.1rem;
}

.roadmap-v2-controls .toggle-row span {
    display: grid;
    gap: 0.15rem;
}

.roadmap-v2-controls .toggle-row small { color: var(--muted); }

.topic-chip-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.roadmap-v2-gates {
    display: grid;
    gap: 0.75rem;
}

.roadmap-v2-groups {
    display: grid;
    gap: 0.85rem;
}

.roadmap-gate-group {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

.roadmap-gate-group.complete {
    border-color: rgba(99, 241, 190, 0.32);
}

.roadmap-gate-group.locked {
    opacity: 0.68;
}

.roadmap-gate-group > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(8rem, 18rem);
    gap: 0.9rem;
    align-items: center;
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.035);
}

.roadmap-gate-group > summary strong {
    display: block;
    color: var(--text);
}

.roadmap-gate-group > summary small {
    display: block;
    margin-top: 0.12rem;
    color: var(--muted);
}

.roadmap-gate-group > .roadmap-v2-gates {
    padding: 0.85rem;
}

.roadmap-v2-bar.compact {
    height: 0.42rem;
}

.roadmap-gate {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0.6rem;
    overflow: hidden;
    background: rgba(7, 13, 24, 0.72);
}

.roadmap-gate.complete { border-color: rgba(170, 158, 96, 0.44); }
.roadmap-gate.locked { opacity: 0.62; }

.roadmap-gate summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 1rem;
    cursor: pointer;
}

.roadmap-gate summary strong {
    display: block;
    color: var(--text);
}

.roadmap-gate summary small {
    display: block;
    margin-top: 0.16rem;
    color: var(--muted);
}

.roadmap-gate-body {
    display: grid;
    gap: 0.85rem;
    padding: 0 1rem 1rem;
}

.roadmap-gate-block {
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.035);
}

.roadmap-archive-button { justify-self: start; }

.roadmap-recommendations-panel {
    border-color: rgba(170, 158, 96, 0.28);
    background:
        linear-gradient(135deg, rgba(170, 158, 96, 0.07), transparent 34%),
        rgba(7, 13, 24, 0.82);
}

.roadmap-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.85rem;
}

.roadmap-rec-card {
    display: grid;
    gap: 0.65rem;
    align-content: start;
    padding: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0.62rem;
    background: rgba(255, 255, 255, 0.04);
}

.roadmap-rec-card.required { border-color: rgba(170, 158, 96, 0.42); }
.roadmap-rec-card.repair { border-color: rgba(255, 176, 88, 0.45); }
.roadmap-rec-card.pressure { border-color: rgba(228, 191, 131, 0.45); }
.roadmap-rec-card.stretch { border-color: rgba(143, 58, 54, 0.42); }

.roadmap-rec-type {
    justify-self: start;
    padding: 0.22rem 0.48rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.roadmap-rec-card h4 {
    margin: 0;
    font-size: 0.98rem;
}

.roadmap-rec-card p {
    margin: 0;
    color: var(--muted);
}

.roadmap-rec-card p strong { color: var(--text); }

.roadmap-rec-meta {
    font-size: 0.78rem;
    font-weight: 750;
    color: #d8e3ff;
}

.roadmap-rec-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.roadmap-note-fold {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.7rem;
}

.roadmap-note-fold summary {
    display: block;
    padding: 0;
    color: var(--muted);
}

.roadmap-note-fold pre {
    max-height: 18rem;
    overflow: auto;
    white-space: pre-wrap;
    color: var(--muted);
    font-size: 0.82rem;
}

.roadmap-verify-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 0.6fr) minmax(0, 1fr);
    gap: 0.85rem;
}

@media (max-width: 820px) {
    .roadmap-v2-header,
    .roadmap-v2-progress,
    .roadmap-v2-controls,
    .roadmap-verify-grid {
        grid-template-columns: 1fr;
    }

    .roadmap-v2-meta,
    .topic-chip-row {
        justify-items: start;
        justify-content: flex-start;
    }
}

/* ============================================================
   Roadmap V3 visual layer — phase identity, track lanes,
   resource badges, milestone strip, celebration
   ============================================================ */

/* --- Phase identity ----------------------------------------- */
.roadmap-v2-shell {
    position: relative;
    border-left: 3px solid transparent;
    transition: box-shadow 240ms ease;
}

.roadmap-v2-shell[data-phase="Boot"] { border-left-color: var(--accent-warm); }
.roadmap-v2-shell[data-phase="Toolkit"] { border-left-color: var(--accent); }
.roadmap-v2-shell[data-phase="Mastery"] { border-left-color: var(--success); }

.roadmap-v2-shell.current {
    box-shadow: 0 0 0 2px rgba(228, 191, 131, 0.4), var(--shadow-lg);
}

.roadmap-v2-shell .phase-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--muted);
    vertical-align: 1px;
}

.roadmap-v2-shell[data-phase="Boot"] .phase-dot { background: var(--accent-warm); box-shadow: 0 0 8px rgba(228, 191, 131, 0.65); }
.roadmap-v2-shell[data-phase="Toolkit"] .phase-dot { background: var(--accent); box-shadow: 0 0 8px rgba(228, 191, 131, 0.65); }
.roadmap-v2-shell[data-phase="Mastery"] .phase-dot { background: var(--success); box-shadow: 0 0 8px rgba(170, 158, 96, 0.65); }

.roadmap-v2-meta .success {
    border-color: rgba(170, 158, 96, 0.55);
    color: #c9c89a;
}

/* --- Progress bar shimmer ----------------------------------- */
.roadmap-v2-bar span {
    position: relative;
    overflow: hidden;
    transition: width 600ms cubic-bezier(0.22, 0.9, 0.36, 1);
}

.roadmap-v2-bar span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.32) 50%, transparent 62%);
    background-size: 220% 100%;
    animation: roadmap-bar-shimmer 2.6s ease-in-out infinite;
}

@keyframes roadmap-bar-shimmer {
    0% { background-position: 130% 0; }
    100% { background-position: -90% 0; }
}

/* --- Milestone strip ----------------------------------------- */
.roadmap-v2-milestone {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.025);
}

/* Sticky "Today: next gate" CTA — pins the single next action above the gates. */
.roadmap-next-cta {
    position: sticky;
    top: 0.4rem;
    z-index: 6;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    margin: 0.5rem 0 0.95rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--gold, #e4bf83);
    border-left: 3px solid #6e2b2b;
    border-radius: 0.7rem;
    background: linear-gradient(180deg, rgba(110, 43, 43, 0.22), rgba(20, 26, 44, 0.96));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.roadmap-next-cta.done {
    grid-template-columns: auto minmax(0, 1fr);
    border-left-color: var(--gold, #e4bf83);
    background: linear-gradient(180deg, rgba(123, 198, 170, 0.14), rgba(20, 26, 44, 0.96));
}
.roadmap-next-cta-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(228, 191, 131, 0.16);
    color: var(--gold, #e4bf83);
    font-size: 0.85rem;
}
.roadmap-next-cta-body { min-width: 0; }
.roadmap-next-cta-eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.66rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold, #e4bf83);
}
.roadmap-next-cta-body strong { display: block; font-size: 0.98rem; line-height: 1.2; }
.roadmap-next-cta-body small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: rgba(243, 246, 251, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Goal 4 steal (b): THE one ivory pill terminal CTA per view — everything
   else on the page stays ghost/oxblood so this reads as "the button". */
.roadmap-next-cta-go {
    white-space: nowrap;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(32, 26, 18, 0.35);
    background: #f3ead7;
    color: #241c11;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.roadmap-next-cta-go:hover { background: #fdf6e4; }
/* Overview "cards due" chip — gold accent when reviews are waiting. */
.ghost-button.review-due { border-color: var(--gold, #e4bf83); color: var(--gold, #e4bf83); font-weight: 700; }
.roadmap-gate-flash { animation: roadmapGateFlash 1.3s ease-out; }
@keyframes roadmapGateFlash {
    0% { box-shadow: 0 0 0 0 rgba(228, 191, 131, 0); }
    18% { box-shadow: 0 0 0 3px rgba(228, 191, 131, 0.7); }
    100% { box-shadow: 0 0 0 0 rgba(228, 191, 131, 0); }
}
@media (max-width: 640px) {
    .roadmap-next-cta { grid-template-columns: auto minmax(0, 1fr); }
    .roadmap-next-cta-go { grid-column: 1 / -1; text-align: center; }
    .roadmap-next-cta-body small { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
    .roadmap-gate-flash { animation: none; }
}

/* Curated exact repair reps inside a repair recommendation card. */
.roadmap-rec-curated {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin: 0.2rem 0 0.5rem;
}
.roadmap-rec-curated-label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gold, #e4bf83);
    margin-right: 0.2rem;
}

.roadmap-v2-milestone .milestone-icon {
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    font-size: 1.05rem;
    filter: grayscale(1) opacity(0.7);
}

.roadmap-v2-milestone.done {
    border-style: solid;
    border-color: rgba(170, 158, 96, 0.5);
    background: linear-gradient(135deg, rgba(170, 158, 96, 0.12), transparent 55%);
}

.roadmap-v2-milestone.done .milestone-icon {
    filter: none;
    border-color: rgba(170, 158, 96, 0.6);
    background: rgba(170, 158, 96, 0.16);
    animation: roadmap-milestone-pop 700ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes roadmap-milestone-pop {
    0% { transform: scale(0.5); }
    62% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* --- Track lanes (Toolkit weeks) ----------------------------- */
.roadmap-track-lanes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 0.85rem;
    align-items: start;
}

.roadmap-track-lane {
    display: grid;
    gap: 0.6rem;
    padding: 0.7rem;
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, rgba(228, 191, 131, 0.05), transparent 30%), rgba(7, 13, 24, 0.5);
}

.roadmap-track-lane.lane-done {
    border-color: rgba(170, 158, 96, 0.42);
    background: linear-gradient(180deg, rgba(170, 158, 96, 0.07), transparent 32%), rgba(7, 13, 24, 0.5);
}

.roadmap-track-lane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 0.25rem 0.2rem;
}

.roadmap-track-lane-header strong {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #cfe0ff;
}

.roadmap-track-lane.lane-done .roadmap-track-lane-header strong { color: #c9c89a; }

.roadmap-track-lane-header span {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.roadmap-general-gates { margin-top: 0.85rem; }
.roadmap-general-gates .panel-label { margin-bottom: 0.55rem; }

/* --- Gate status + lock state -------------------------------- */
.roadmap-gate {
    transition: border-color 200ms ease, transform 160ms ease;
}

.roadmap-gate:not(.locked):hover { border-color: rgba(228, 191, 131, 0.34); }

.roadmap-gate-status.is-done {
    border-color: rgba(170, 158, 96, 0.55);
    background: rgba(170, 158, 96, 0.14);
    color: #c9c89a;
}

.roadmap-gate-status.is-open {
    border-color: rgba(228, 191, 131, 0.4);
    color: #cfe0ff;
}

.roadmap-gate.locked { opacity: 1; background: rgba(7, 13, 24, 0.42); }
.roadmap-gate.locked > summary { opacity: 0.48; }

.roadmap-lock-note {
    margin: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 176, 88, 0.3);
    border-radius: 0.55rem;
    background: rgba(255, 176, 88, 0.07);
    color: #ffd59a;
    font-size: 0.88rem;
}

.roadmap-lock-note strong { color: #ffe7c4; }

/* --- Resource rows with type badges --------------------------- */
.roadmap-resource-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.roadmap-resource-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.55rem;
    background: rgba(7, 13, 24, 0.55);
    transition: border-color 160ms ease, background 160ms ease;
}

.roadmap-resource-row:hover {
    border-color: rgba(228, 191, 131, 0.3);
    background: rgba(13, 22, 38, 0.72);
}

.res-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.26rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.res-badge i { font-style: normal; }

.res-badge.res-book {
    border: 1px solid rgba(228, 191, 131, 0.4);
    background: rgba(228, 191, 131, 0.1);
    color: #cfe0ff;
}

.res-badge.res-video {
    border: 1px solid rgba(228, 191, 131, 0.42);
    background: rgba(228, 191, 131, 0.1);
    color: #f3dcb2;
}

.res-badge.res-handout {
    border: 1px solid rgba(170, 158, 96, 0.42);
    background: rgba(170, 158, 96, 0.1);
    color: #c9c89a;
}

.roadmap-resource-copy { min-width: 0; display: grid; gap: 0.1rem; }
.roadmap-resource-copy strong { color: var(--text); font-size: 0.92rem; }
.roadmap-resource-copy span { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }

.roadmap-resource-open {
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(228, 191, 131, 0.32);
    border-radius: 0.5rem;
    background: rgba(228, 191, 131, 0.08);
    color: #cfe0ff;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.roadmap-resource-open:hover {
    background: rgba(228, 191, 131, 0.18);
    border-color: rgba(228, 191, 131, 0.55);
}

/* --- Problem level chips --------------------------------------- */
.level-chip {
    display: inline-block;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--muted);
}

.level-chip.level-tutorial { border-color: rgba(170, 158, 96, 0.45); color: #c9c89a; }
.level-chip.level-amc { border-color: rgba(228, 191, 131, 0.45); color: #cfe0ff; }
.level-chip.level-putnam { border-color: rgba(228, 191, 131, 0.5); color: #f3dcb2; }
.level-chip.level-nightmare { border-color: rgba(143, 58, 54, 0.5); color: #f2c4ff; }

/* --- Program stats strip (roadmap index) ----------------------- */
.roadmap-program-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.7rem;
    margin: 1.1rem 0 0.75rem;
}

.roadmap-stat {
    display: grid;
    gap: 0.15rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.035);
}

.roadmap-stat strong {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
}

.roadmap-stat strong small {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
}

.roadmap-stat span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.roadmap-stat.exam {
    border-color: rgba(228, 191, 131, 0.42);
    background: linear-gradient(135deg, rgba(228, 191, 131, 0.1), transparent 60%);
}

.roadmap-stat.exam strong { color: #f3dcb2; }

.roadmap-program-bar {
    height: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.roadmap-program-bar span {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent) 55%, var(--success));
    transition: width 600ms cubic-bezier(0.22, 0.9, 0.36, 1);
}

/* --- Week directory cards --------------------------------------- */
.roadmap-phase-legend { display: flex; gap: 0.45rem; }

.roadmap-phase-legend span {
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid;
}

.roadmap-phase-legend span[data-phase="Boot"] { border-color: rgba(228, 191, 131, 0.5); color: #f3dcb2; }
.roadmap-phase-legend span[data-phase="Toolkit"] { border-color: rgba(228, 191, 131, 0.5); color: #cfe0ff; }
.roadmap-phase-legend span[data-phase="Mastery"] { border-color: rgba(170, 158, 96, 0.5); color: #c9c89a; }

.roadmap-week-card {
    position: relative;
    border-top: 3px solid transparent;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.roadmap-week-card[data-phase="Boot"] { border-top-color: rgba(228, 191, 131, 0.55); }
.roadmap-week-card[data-phase="Toolkit"] { border-top-color: rgba(228, 191, 131, 0.55); }
.roadmap-week-card[data-phase="Mastery"] { border-top-color: rgba(170, 158, 96, 0.55); }

.roadmap-week-card:hover {
    transform: translateY(-2px);
    background: rgba(20, 33, 54, 0.85);
}

.roadmap-week-card-bar {
    height: 0.28rem;
    margin-top: 0.35rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.roadmap-week-card-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #63f1be, #7aa2ff);
}

.roadmap-week-card.done .roadmap-week-card-bar span { background: var(--success); }

/* --- Confetti celebration ---------------------------------------- */
.roadmap-confetti-host {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.roadmap-confetti-host span {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
    animation: roadmap-confetti-pop 1.15s cubic-bezier(0.16, 0.84, 0.36, 1) forwards;
}

@keyframes roadmap-confetti-pop {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(var(--cx), var(--cy)) rotate(var(--cr)) scale(0.55); }
}

/* --- Responsive --------------------------------------------------- */
@media (max-width: 900px) {
    .roadmap-track-lanes { grid-template-columns: 1fr; }
    .roadmap-program-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .roadmap-resource-row { grid-template-columns: auto minmax(0, 1fr); }
    .roadmap-resource-row .roadmap-resource-open { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    .roadmap-v2-bar span::after,
    .roadmap-confetti-host span,
    .roadmap-v2-milestone.done .milestone-icon { animation: none; }
}

/* ============================================================
   Battle attempt-feedback mini-form (feeds recommendation engine)
   ============================================================ */
.gam-attempt-feedback-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.4rem 0;
}

.gam-attempt-feedback-row [data-gam-attempt-result="partial"] {
    border-color: rgba(228, 191, 131, 0.45);
    color: #f3dcb2;
}

.gam-attempt-feedback-row [data-gam-attempt-result="missed"] {
    border-color: rgba(143, 58, 54, 0.45);
    color: #ffc4c4;
}

.gam-attempt-gap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.35rem 0 0.2rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.gam-attempt-gap select {
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.5rem;
    background: rgba(7, 13, 24, 0.9);
    color: var(--text-soft);
    font-size: 0.85rem;
}

.gam-attempt-gap select:disabled { opacity: 0.55; }

/* ============================================================
   Recommendation cards v2 — repair chain + retry tier
   ============================================================ */
.roadmap-rec-card.retry { border-color: rgba(228, 191, 131, 0.45); }
.roadmap-rec-card.reinforcement { border-color: rgba(168, 186, 214, 0.4); }

.roadmap-rec-chain {
    margin: 0;
    padding: 0.55rem 0.7rem 0.55rem 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.55rem;
    background: rgba(7, 13, 24, 0.55);
    display: grid;
    gap: 0.35rem;
}

.roadmap-rec-chain li {
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.5;
}

.roadmap-rec-chain li::marker {
    color: var(--accent);
    font-weight: 800;
}

.roadmap-rec-actions .inline-solve-link { margin-left: 0; }

/* ============================================================
   Session 3 UI — roadmap search, save status, week toast,
   accelerated bump chip
   ============================================================ */

/* --- Roadmap search ------------------------------------------ */
.roadmap-search-row { margin: 14px 0 4px; display: grid; gap: 8px; }

.roadmap-search-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-1);
    background: rgba(7, 13, 24, 0.8);
    color: var(--text);
    font-size: 0.95rem;
}

.roadmap-search-input::placeholder { color: var(--muted); }

.roadmap-search-input:focus {
    outline: none;
    border-color: rgba(228, 191, 131, 0.55);
    box-shadow: 0 0 0 3px rgba(228, 191, 131, 0.14);
}

.roadmap-search-results {
    display: grid;
    gap: 6px;
    max-height: 24rem;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-1);
    background: rgba(7, 13, 24, 0.6);
}

.roadmap-search-hit {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.roadmap-search-hit:hover {
    border-color: rgba(228, 191, 131, 0.32);
    background: rgba(20, 33, 54, 0.85);
}

.roadmap-search-hit .hit-week {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--muted);
    white-space: nowrap;
}

.roadmap-search-hit .hit-week[data-phase="Boot"] { border-color: rgba(228, 191, 131, 0.5); color: #f3dcb2; }
.roadmap-search-hit .hit-week[data-phase="Toolkit"] { border-color: rgba(228, 191, 131, 0.5); color: #cfe0ff; }
.roadmap-search-hit .hit-week[data-phase="Mastery"] { border-color: rgba(170, 158, 96, 0.5); color: #c9c89a; }

.roadmap-search-hit strong { display: block; color: var(--text); font-size: 0.92rem; }

.roadmap-search-hit div span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roadmap-search-hit mark {
    background: rgba(228, 191, 131, 0.3);
    color: #ffe7c4;
    border-radius: 3px;
    padding: 0 2px;
}

/* --- Saved status flash ---------------------------------------- */
.roadmap-save-status {
    margin-left: 8px;
    color: var(--success);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0;
    transition: opacity 250ms ease;
}

.roadmap-save-status.show { opacity: 1; }
.roadmap-verify-label { min-height: 1rem; margin-bottom: 4px; }

/* --- Week-complete toast ---------------------------------------- */
.roadmap-week-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%) translateY(16px);
    z-index: 10000;
    display: grid;
    gap: 3px;
    padding: 14px 22px;
    border: 1px solid rgba(170, 158, 96, 0.55);
    border-radius: var(--radius-1);
    background: linear-gradient(135deg, rgba(170, 158, 96, 0.16), rgba(8, 14, 24, 0.97) 55%);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 320ms ease, transform 320ms ease;
    pointer-events: none;
    max-width: min(480px, calc(100vw - 48px));
}

.roadmap-week-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.roadmap-week-toast strong {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.05rem;
    color: #c9c89a;
}

.roadmap-week-toast span { color: var(--text-soft); font-size: 0.88rem; }

.roadmap-week-toast.phase {
    border-color: rgba(228, 191, 131, 0.6);
    background: linear-gradient(135deg, rgba(228, 191, 131, 0.18), rgba(8, 14, 24, 0.97) 55%);
}

.roadmap-week-toast.phase strong { color: #f3dcb2; }

/* --- Accelerated bump chip --------------------------------------- */
.accel-bump {
    display: inline-block;
    margin-left: 6px;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(143, 58, 54, 0.5);
    background: rgba(143, 58, 54, 0.1);
    color: #f2c4ff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.build-stamp {
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: center;
}

.mock-slot-row { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0.3rem 0; }

.mock-slot {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
}

.mock-slot.good { border-color: rgba(170, 158, 96, 0.55); color: #c9c89a; }
.mock-slot.partial { border-color: rgba(228, 191, 131, 0.5); color: #f3dcb2; }
.mock-slot.zero { border-color: rgba(143, 58, 54, 0.4); color: #ffc4c4; }

/* ============================================================
   UX v4 — microinteractions (pure CSS + IntersectionObserver)
   GSAP-grade feel without external dependencies.
   ============================================================ */

/* --- Scroll-reveal (paired with JS observer) ------------------ */
.ux-reveal {
    opacity: 0;
    transform: translateY(14px);
}

.ux-reveal.ux-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 520ms cubic-bezier(0.22, 0.9, 0.3, 1), transform 520ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* --- Card hover lift (workspace-wide) -------------------------- */
.workspace-card,
.roadmap-rec-card,
.roadmap-stat {
    transition: transform 200ms cubic-bezier(0.22, 0.9, 0.3, 1), border-color 200ms ease, box-shadow 200ms ease;
}

.roadmap-rec-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.roadmap-stat:hover {
    transform: translateY(-2px);
    border-color: rgba(228, 191, 131, 0.35);
}

/* --- Week directory card: shine sweep on hover ------------------ */
.roadmap-week-card {
    overflow: hidden;
}

.roadmap-week-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 55%;
    height: 100%;
    background: linear-gradient(100deg, transparent 18%, rgba(228, 191, 131, 0.1) 50%, transparent 82%);
    transform: skewX(-18deg);
    transition: left 600ms cubic-bezier(0.22, 0.9, 0.3, 1);
    pointer-events: none;
}

.roadmap-week-card:hover::after { left: 125%; }

/* --- Gate accordion: smooth open + hover ------------------------- */
details.roadmap-gate {
    transition: border-color 200ms ease, background 200ms ease, transform 160ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

details.roadmap-gate:not(.locked):hover {
    transform: translateX(3px);
    border-color: rgba(228, 191, 131, 0.4);
    background: rgba(11, 19, 33, 0.85);
}

details.roadmap-gate > summary { position: relative; }

details.roadmap-gate > summary::after {
    content: "▾";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    color: var(--muted);
    font-size: 0.8rem;
    transition: transform 240ms cubic-bezier(0.22, 0.9, 0.3, 1), color 200ms ease;
}

details.roadmap-gate[open] > summary::after {
    transform: translateY(-50%) rotate(0deg);
    color: var(--accent);
}

details.roadmap-gate[open] > .roadmap-gate-body {
    animation: gate-body-in 280ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes gate-body-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Buttons: press + sheen --------------------------------------- */
.action-button,
.ghost-button,
.inline-solve-link,
.roadmap-resource-open {
    position: relative;
    overflow: hidden;
    transition: transform 140ms cubic-bezier(0.22, 0.9, 0.3, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.action-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.action-button:active:not(:disabled),
.ghost-button:active:not(:disabled),
.inline-solve-link:active {
    transform: scale(0.97);
}

.inline-solve-link:hover {
    box-shadow: 0 0 14px rgba(228, 191, 131, 0.28);
    border-color: rgba(228, 191, 131, 0.6);
}

/* --- Resource rows: badge pop + arrow nudge ------------------------ */
.roadmap-resource-row .res-badge {
    transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.roadmap-resource-row:hover .res-badge { transform: scale(1.07); }

.roadmap-resource-open { transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.roadmap-resource-row:hover .roadmap-resource-open { transform: translateX(2px); }

/* --- Progress bar: near-complete pulse ------------------------------ */
.roadmap-v2-bar span[style*="width: 9"],
.roadmap-v2-bar span[style*="width:9"] {
    animation: bar-near-done 1.8s ease-in-out infinite;
}

@keyframes bar-near-done {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.35); }
}

/* --- Hero: slow ambient gradient drift ------------------------------- */
.roadmap-index-hero {
    background-image: linear-gradient(120deg, rgba(228, 191, 131, 0.07), rgba(228, 191, 131, 0.05) 40%, rgba(170, 158, 96, 0.06) 70%, rgba(228, 191, 131, 0.07));
    background-size: 300% 300%;
    animation: hero-drift 18s ease-in-out infinite;
}

@keyframes hero-drift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Mini chips + phase legend hover ---------------------------------- */
.mini-chip,
.roadmap-phase-legend span {
    transition: transform 140ms ease, border-color 140ms ease, color 140ms ease;
    cursor: default;
}

.mini-chip:hover { transform: translateY(-1px); border-color: rgba(228, 191, 131, 0.45); color: var(--text); }

/* --- Search hits: slide on hover ---------------------------------------- */
.roadmap-search-hit { transition: transform 150ms ease, border-color 150ms ease, background 150ms ease; }
.roadmap-search-hit:hover { transform: translateX(4px); }

/* --- Milestone icon: gentle idle float when locked ----------------------- */
.roadmap-v2-milestone:not(.done) .milestone-icon { animation: milestone-idle 3.4s ease-in-out infinite; }

@keyframes milestone-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* --- Sidebar nav: active indicator slide ----------------------------------- */
.sidebar-nav a { position: relative; transition: padding-left 180ms cubic-bezier(0.22, 0.9, 0.3, 1), background 180ms ease, border-color 180ms ease, color 180ms ease; }
.sidebar-nav a:hover { padding-left: 22px; }

/* --- Reduced motion: kill all of it ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .ux-reveal { opacity: 1; transform: none; }
    .ux-reveal.ux-in { transition: none; }
    .roadmap-week-card::after,
    .roadmap-index-hero,
    .roadmap-v2-milestone:not(.done) .milestone-icon,
    .roadmap-v2-bar span[style*="width: 9"],
    details.roadmap-gate[open] > .roadmap-gate-body { animation: none; }
    .workspace-card, .roadmap-rec-card, .roadmap-stat, details.roadmap-gate,
    .action-button, .ghost-button, .inline-solve-link, .sidebar-nav a { transition: none; }
}

/* ============================================================
   Performance panel — projected score, streak, mock band,
   review queue, paper logger
   ============================================================ */
.roadmap-performance-panel {
    border-color: rgba(228, 191, 131, 0.28);
    background: linear-gradient(135deg, rgba(228, 191, 131, 0.06), transparent 38%), rgba(7, 13, 24, 0.82);
}

.perf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.8rem;
    margin-top: 0.4rem;
}

.perf-score,
.perf-mock {
    display: grid;
    gap: 0.15rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.035);
}

.perf-score strong,
.perf-mock strong {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f3dcb2;
    line-height: 1.1;
}

.perf-score.idle strong { color: var(--muted); }
.perf-score strong small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.perf-score span, .perf-mock span { color: var(--text-soft); font-weight: 700; font-size: 0.88rem; }
.perf-score small, .perf-mock small { color: var(--muted); font-size: 0.78rem; }

.perf-streak {
    display: grid;
    gap: 0.2rem;
    height: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.035);
}

.perf-streak strong { color: var(--text); font-size: 0.95rem; }
.perf-streak span { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

.perf-streak.danger {
    border-color: rgba(143, 58, 54, 0.5);
    background: linear-gradient(135deg, rgba(143, 58, 54, 0.1), transparent 55%);
    animation: streak-pulse 2.4s ease-in-out infinite;
}

.perf-streak.danger strong { color: #ffc4c4; }
.perf-streak.ok { border-color: rgba(170, 158, 96, 0.4); }
.perf-streak.ok strong { color: #c9c89a; }
.perf-streak.warn { border-color: rgba(228, 191, 131, 0.4); }

@keyframes streak-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(143, 58, 54, 0); }
    50% { box-shadow: 0 0 18px 0 rgba(143, 58, 54, 0.18); }
}

.perf-review { margin-top: 1rem; display: grid; gap: 0.5rem; }

.perf-review-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(228, 191, 131, 0.22);
    border-radius: 0.6rem;
    background: rgba(228, 191, 131, 0.05);
}

.perf-review-card strong { display: block; color: #cfe0ff; font-size: 0.85rem; }
.perf-review-card span { color: var(--muted); font-size: 0.83rem; line-height: 1.45; }
.perf-review-actions { display: flex; gap: 0.4rem; }

.perf-logger { margin-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 0.7rem; }
.perf-logger summary { color: var(--muted); cursor: pointer; font-size: 0.88rem; }
.perf-logger summary:hover { color: var(--text); }

.perf-logger-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.7rem;
}

.perf-logger-form input[type="text"] { flex: 1 1 14rem; }
.perf-logger-form input[type="number"] { width: 5rem; }

.perf-logger-form input,
.perf-logger-form select {
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.5rem;
    background: rgba(7, 13, 24, 0.85);
    color: var(--text-soft);
    font-size: 0.85rem;
}

.perf-logger-form small { color: var(--success); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
    .perf-streak.danger { animation: none; }
}


/* ============================================================
   Landing hero — "the observatory deck" (FABLE5 Stage 2)
   Competition-paper serif over a living constellation of every
   archive problem. Brass/gold instrumentation on deep navy.
   ============================================================ */

#landing-hero {
    position: relative;
    height: clamp(540px, 74vh, 780px);
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 70% 10%, rgba(36, 52, 84, 0.55), transparent 60%),
        radial-gradient(90% 70% at 15% 85%, rgba(58, 44, 22, 0.35), transparent 55%),
        #060b15;
    border-bottom: 1px solid rgba(228, 191, 131, 0.22);
    transition: height 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

#landing-hero.hero-settled { height: clamp(420px, 52vh, 560px); }

#landing-hero.hero-min {
    height: 72px;
}

#landing-hero.hero-min .hero-canvas,
#landing-hero.hero-min .hero-fallback,
#landing-hero.hero-min .hero-mission,
#landing-hero.hero-min .hero-vitals,
#landing-hero.hero-min .hero-hint,
#landing-hero.hero-min .hero-actions .hero-ghost { display: none; }

#landing-hero.hero-min .hero-content {
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;
    padding: 0 4.5rem 0 2rem;
}

#landing-hero.hero-min .hero-headline { font-size: 1.05rem; margin: 0; }
#landing-hero.hero-min .hero-eyebrow { margin: 0; white-space: nowrap; }
#landing-hero.hero-min .hero-cta { padding: 0.45rem 1rem; font-size: 0.85rem; }

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* No-WebGL fallback: a designed CSS night sky, not a blank box */
.hero-fallback { display: none; }

#landing-hero.hero-no-webgl .hero-canvas { display: none; }
#landing-hero.hero-no-webgl .hero-fallback {
    display: block;
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 30%, rgba(243, 220, 178, 0.9), transparent 100%),
        radial-gradient(1px 1px at 28% 64%, rgba(228, 191, 131, 0.8), transparent 100%),
        radial-gradient(2px 2px at 41% 22%, rgba(243, 220, 178, 0.75), transparent 100%),
        radial-gradient(1px 1px at 55% 48%, rgba(255, 255, 255, 0.6), transparent 100%),
        radial-gradient(1.5px 1.5px at 67% 75%, rgba(228, 191, 131, 0.7), transparent 100%),
        radial-gradient(1px 1px at 78% 35%, rgba(243, 220, 178, 0.8), transparent 100%),
        radial-gradient(2px 2px at 88% 58%, rgba(255, 255, 255, 0.5), transparent 100%),
        radial-gradient(1px 1px at 18% 82%, rgba(255, 255, 255, 0.55), transparent 100%),
        radial-gradient(1.5px 1.5px at 92% 14%, rgba(228, 191, 131, 0.65), transparent 100%),
        radial-gradient(1px 1px at 47% 88%, rgba(243, 220, 178, 0.6), transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem clamp(1.2rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.9rem;
    pointer-events: none;
}

.hero-content > * { pointer-events: auto; }

.hero-eyebrow {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(228, 191, 131, 0.85);
    margin: 0;
}

.hero-headline {
    font-family: "KaTeX_Main", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(2rem, 4.6vw, 3.7rem);
    line-height: 1.08;
    letter-spacing: -0.012em;
    color: #f4ecdd;
    margin: 0;
    max-width: 18ch;
    text-wrap: balance;
}

.hero-word { display: inline-block; }

/* Track-run under the hero headline — sibling of the word-split target. */
.hero-tracks {
    margin: 10px 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(228, 191, 131, 0.78);
    line-height: 1.7;
    max-width: 58ch;
}
.hero-tracks i { font-style: normal; margin: 0 0.55em; color: rgba(228, 191, 131, 0.38); }

.hero-mission {
    font-family: "KaTeX_Main", "Georgia", serif;
    font-style: italic;
    font-size: clamp(0.98rem, 1.4vw, 1.15rem);
    line-height: 1.5;
    color: rgba(214, 222, 238, 0.78);
    max-width: 56ch;
    margin: 0;
}

.hero-vitals {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.65rem;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(170, 184, 209, 0.85);
    margin-top: 0.2rem;
}

.hero-vital strong {
    font-size: 1.05rem;
    color: #f3dcb2;
    font-weight: 800;
    letter-spacing: 0;
    margin-right: 0.25em;
}

.hero-vital-sep { color: rgba(228, 191, 131, 0.4); }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.hero-cta {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-block;
    padding: 0.85rem 1.7rem;
    border-radius: 0.55rem;
    background: linear-gradient(160deg, #f3dcb2, #e4bf83 70%);
    color: #15120a;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: 0 0 0 1px rgba(228, 191, 131, 0.35), 0 6px 24px rgba(228, 191, 131, 0.18);
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(228, 191, 131, 0.55), 0 10px 32px rgba(228, 191, 131, 0.3);
}

.hero-cta:active { transform: translateY(0); }

.hero-cta:focus-visible {
    outline: 2px solid #f3dcb2;
    outline-offset: 3px;
}

.hero-ghost {
    display: inline-block;
    padding: 0.7rem 1.1rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(214, 222, 238, 0.25);
    color: rgba(214, 222, 238, 0.85);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: border-color 0.16s ease-out, color 0.16s ease-out, background 0.16s ease-out;
}

.hero-ghost:hover {
    border-color: rgba(228, 191, 131, 0.6);
    color: #f3dcb2;
    background: rgba(228, 191, 131, 0.06);
}

.hero-ghost:focus-visible {
    outline: 2px solid #f3dcb2;
    outline-offset: 2px;
}

.hero-hint {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.76rem;
    color: rgba(170, 184, 209, 0.55);
    margin: 0.4rem 0 0;
}

.hero-min-toggle {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(214, 222, 238, 0.2);
    background: rgba(7, 13, 24, 0.6);
    color: rgba(214, 222, 238, 0.7);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.16s, color 0.16s;
}

#landing-hero.hero-min .hero-min-toggle { top: 50%; transform: translateY(-50%); }

.hero-min-toggle:hover { border-color: rgba(228, 191, 131, 0.5); color: #f3dcb2; }
.hero-min-toggle:focus-visible { outline: 2px solid #f3dcb2; outline-offset: 2px; }

@media (max-width: 760px) {
    #landing-hero { height: clamp(480px, 86vh, 640px); }
    #landing-hero.hero-settled { height: clamp(380px, 60vh, 480px); }
    .hero-headline { font-size: clamp(1.7rem, 8vw, 2.3rem); }
    .hero-actions { gap: 0.5rem; }
    .hero-cta { width: 100%; text-align: center; }
    .hero-vitals { font-size: 0.72rem; }
    #landing-hero.hero-min .hero-content { padding-right: 3.4rem; }
    #landing-hero.hero-min .hero-eyebrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    #landing-hero { transition: none; }
    .hero-cta, .hero-ghost, .hero-min-toggle { transition: none; }
}

/* Legibility scrim — soft dark gradient anchoring the text block (critique r1) */
.hero-content::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: clamp(-2rem, -3vw, -1rem);
    top: 10%;
    bottom: 10%;
    width: min(720px, 78%);
    background: radial-gradient(80% 70% at 30% 50%, rgba(6, 11, 21, 0.78), rgba(6, 11, 21, 0.35) 60%, transparent 100%);
    pointer-events: none;
}

#landing-hero.hero-min .hero-content::before { display: none; }

/* ============================================================
   Craft pass (award-level texture, dark academia)
   Film grain · instrument-reticle cursor · museum-label rules
   ============================================================ */

#fx-grain {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: 2147483000;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
    animation: fx-grain-shift 0.9s steps(4) infinite;
}

@keyframes fx-grain-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, 1%); }
    50% { transform: translate(1%, -2%); }
    75% { transform: translate(-1%, -1%); }
    100% { transform: translate(2%, 2%); }
}

#fx-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483001;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(228, 191, 131, 0.55);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: width 0.22s cubic-bezier(0.65, 0, 0.35, 1), height 0.22s cubic-bezier(0.65, 0, 0.35, 1),
        border-color 0.22s, opacity 0.3s;
    will-change: transform;
}

#fx-cursor-ring.on { opacity: 1; }

#fx-cursor-ring.hot {
    width: 48px;
    height: 48px;
    border-color: rgba(243, 220, 178, 0.9);
}

#fx-cursor-ring::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    margin: -1.5px 0 0 -1.5px;
    border-radius: 50%;
    background: rgba(243, 220, 178, 0.9);
}

/* Museum-label eyebrow: small caps between engraved hairlines */
.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
    content: "";
    height: 1px;
    flex: 0 0 2.4rem;
    background: linear-gradient(90deg, transparent, rgba(228, 191, 131, 0.55));
}

.hero-eyebrow::after {
    flex: 0 1 6rem;
    background: linear-gradient(90deg, rgba(228, 191, 131, 0.55), transparent);
}

.hero-eyebrow-num {
    color: rgba(214, 222, 238, 0.6);
    border-left: 1px solid rgba(228, 191, 131, 0.35);
    padding-left: 0.9rem;
}

.hero-cta { will-change: transform; }
.hero-cta-label { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    #fx-grain { animation: none; opacity: 0.03; }
    #fx-cursor-ring { display: none; }
}

@media (pointer: coarse) {
    #fx-cursor-ring { display: none; }
}

/* ============================================================
   Stage 3 — the Ramp (engraved instrument scale) + mastery meters
   ============================================================ */

.ramp-card, .mastery-card {
    border-color: rgba(228, 191, 131, 0.2);
}

.rule-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.rule-label::after {
    content: "";
    height: 1px;
    flex: 0 1 5rem;
    background: linear-gradient(90deg, rgba(228, 191, 131, 0.5), transparent);
}

.ramp-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.ramp-head h3 {
    font-family: "KaTeX_Main", "Georgia", serif;
    font-weight: 400;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    margin: 0.25rem 0 0;
    color: #ece4d4;
}

.ramp-phase-now {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--seg, #e4bf83);
    border: 1px solid color-mix(in srgb, var(--seg, #e4bf83) 45%, transparent);
    border-radius: 0.45rem;
    padding: 0.4rem 0.7rem;
    background: color-mix(in srgb, var(--seg, #e4bf83) 8%, transparent);
}

.ramp-strip {
    display: flex;
    gap: 3px;
    height: 30px;
    align-items: stretch;
}

.ramp-seg {
    flex: 1;
    position: relative;
    background: color-mix(in srgb, var(--seg) 26%, rgba(255, 255, 255, 0.02));
    border-top: 2px solid color-mix(in srgb, var(--seg) 55%, transparent);
    transition: background 0.16s ease-out, transform 0.16s ease-out;
}

.ramp-seg:hover {
    background: color-mix(in srgb, var(--seg) 55%, transparent);
    transform: translateY(-2px);
}

.ramp-seg.done {
    background: color-mix(in srgb, var(--seg) 60%, transparent);
}

.ramp-seg.current {
    background: color-mix(in srgb, var(--seg) 75%, white 4%);
    box-shadow: 0 0 14px 0 color-mix(in srgb, var(--seg) 55%, transparent);
}

.ramp-seg.current::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -9px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #f3dcb2;
}

.ramp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin-top: 0.8rem;
}

.ramp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.ramp-legend-item i {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 2px;
    background: var(--seg);
    opacity: 0.85;
}

/* Goal 4 steal (c): the difficulty mix floats as an overlap panel breaking
   the week header's edge instead of sitting in the flow. */
.week-mix {
    margin: -1.55rem 0.4rem 0.5rem auto;
    max-width: 460px;
    position: relative;
    z-index: 2;
    background: var(--surface-2, #141a28);
    border: 1px solid rgba(228, 191, 131, 0.18);
    border-radius: 10px;
    padding: 8px 12px 9px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
}

/* Goal 4 steal (a): labeled data triplet — smallcap label over value. */
.data-triplet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 4px 22px;
    text-align: left;
    justify-items: start;
}
/* Neutralize the old pill-chip dress when the meta row becomes a triplet. */
.roadmap-v2-meta.data-triplet span {
    border: none;
    background: none;
    padding: 0;
    border-radius: 0;
}
.data-triplet > span { display: flex; flex-direction: column; gap: 2px; }
.data-triplet > span > small {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(228, 191, 131, 0.75);
}
.data-triplet > span > strong { font-size: 0.86rem; font-weight: 600; color: var(--text, #e8e2d4); }
.data-triplet > span.danger > strong { color: #e08585; }
.data-triplet > span.success > strong { color: #9fd6a4; }

/* Goal 4 steal (d): the two handwritten moments — nothing else site-wide
   may use this voice. Segoe Script ships with Windows: zero new assets. */
.hand-note,
.folio-hand-note {
    font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
    color: rgba(233, 205, 158, 0.92);
    font-style: normal;
}
.hand-note {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.95rem;
    transform: rotate(-3deg);
}
.folio-hand-note {
    position: absolute;
    right: 6px;
    top: 16px;
    font-size: 0.72rem;
    transform: rotate(-5deg);
    pointer-events: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.week-mix-bar {
    display: flex;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.week-mix-bar i { display: block; height: 100%; }

.week-mix small {
    display: block;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.mastery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
    gap: 0.55rem;
}

.mastery-meter {
    appearance: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "topic rate" "track track";
    align-items: center;
    gap: 0.25rem 0.6rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.16s ease-out, background 0.16s ease-out, transform 0.16s ease-out;
}

.mastery-meter:hover {
    border-color: rgba(228, 191, 131, 0.5);
    background: rgba(228, 191, 131, 0.05);
    transform: translateY(-1px);
}

.mastery-meter:focus-visible { outline: 2px solid #f3dcb2; outline-offset: 2px; }

.mastery-topic {
    grid-area: topic;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mastery-track {
    grid-area: track;
    display: block;
    width: var(--w, 100%);
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.mastery-track i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #e4bf83, #f3dcb2);
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.mastery-meter.weak .mastery-track i { background: linear-gradient(90deg, #c96a6a, #ff8a8a); }
.mastery-meter.mid .mastery-track i { background: linear-gradient(90deg, #c9a36a, #e4bf83); }
.mastery-meter.strong .mastery-track i { background: linear-gradient(90deg, #a99e5e, #c9c89a); }

.mastery-rate {
    grid-area: rate;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-weight: 800;
    font-size: 0.92rem;
    color: #f3dcb2;
}

.mastery-meter.idle .mastery-rate { color: var(--muted); }
.mastery-rate small { color: var(--muted); font-weight: 600; }

.mastery-note { color: var(--muted); font-size: 0.74rem; max-width: 16rem; text-align: right; }

@media (max-width: 760px) {
    .ramp-strip { height: 24px; }
    .ramp-legend { gap: 0.3rem 0.8rem; }
    .mastery-note { text-align: left; }
}

/* ============================================================
   Stage 6 — Today's 3 ring · clean-sweep toast · crack-note gate
   ============================================================ */

.t3-card { border-color: rgba(170, 158, 96, 0.25); }
.t3-card.complete { border-color: rgba(170, 158, 96, 0.55); background: linear-gradient(135deg, rgba(170, 158, 96, 0.07), transparent 45%), var(--card-bg, rgba(7, 13, 24, 0.82)); }

.t3-body {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.t3-ring { width: 88px; height: 88px; flex: 0 0 auto; }
.t3-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 7; }
.t3-ring-fill {
    fill: none;
    stroke: #e4bf83;
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dasharray 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.t3-ring-fill.full { stroke: #a99e5e; filter: drop-shadow(0 0 6px rgba(170, 158, 96, 0.5)); }
.t3-ring-text {
    fill: #f3dcb2;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 800;
    text-anchor: middle;
}

.t3-rows { display: grid; gap: 0.5rem; flex: 1; min-width: 0; }

.t3-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.02);
}

.t3-row.done { border-color: rgba(170, 158, 96, 0.35); background: rgba(170, 158, 96, 0.05); }

.t3-check {
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #c9c89a;
    font-size: 0.8rem;
    font-weight: 800;
}

.t3-row.done .t3-check { border-color: rgba(170, 158, 96, 0.7); background: rgba(170, 158, 96, 0.15); }

.t3-copy { flex: 1; min-width: 0; }
.t3-copy strong { display: block; font-size: 0.88rem; color: var(--text-soft); }
.t3-copy small { color: var(--muted); font-size: 0.76rem; line-height: 1.4; }
.t3-go { flex: 0 0 auto; padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.t3-ghost-host { margin-top: 0.8rem; }

.hero-freeze { color: #9fd6f0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0; }

.clean-sweep-toast {
    position: fixed;
    left: 50%;
    bottom: 2.2rem;
    transform: translateX(-50%);
    z-index: 2147483002;
    display: grid;
    gap: 0.15rem;
    padding: 0.9rem 1.4rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(170, 158, 96, 0.6);
    background: rgba(7, 18, 16, 0.95);
    box-shadow: 0 8px 40px rgba(170, 158, 96, 0.25);
    text-align: center;
}

.clean-sweep-toast strong { color: #c9c89a; letter-spacing: 0.12em; font-size: 0.9rem; }
.clean-sweep-toast span { color: var(--muted); font-size: 0.8rem; }
.clean-sweep-toast.leave { opacity: 0; transition: opacity 0.6s; }

.crack-note-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483002;
    display: grid;
    place-items: center;
    background: rgba(3, 6, 12, 0.72);
    backdrop-filter: blur(3px);
}

.crack-note-card {
    width: min(94vw, 520px);
    display: grid;
    gap: 0.7rem;
    padding: 1.4rem 1.6rem;
    border: 1px solid rgba(228, 191, 131, 0.4);
    border-radius: 0.8rem;
    background: #0a1220;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.crack-note-card h3 {
    font-family: "KaTeX_Main", "Georgia", serif;
    font-weight: 400;
    font-size: 1.5rem;
    margin: 0;
    color: #f4ecdd;
}

.crack-note-card p { color: var(--muted); font-size: 0.88rem; margin: 0; }
.crack-note-card textarea { min-height: 4.5rem; }
.crack-note-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

@media (max-width: 760px) {
    .t3-body { flex-direction: column; align-items: stretch; }
    .t3-ring { margin: 0 auto; }
}

/* ============================================================
   Stage 7 — command palette + a11y floor
   ============================================================ */

.cmdk-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483003;
    display: grid;
    place-items: start center;
    padding-top: 14vh;
    background: rgba(3, 6, 12, 0.66);
    backdrop-filter: blur(2px);
}

.cmdk-card {
    width: min(94vw, 620px);
    border: 1px solid rgba(228, 191, 131, 0.35);
    border-radius: 0.8rem;
    background: #0a1220;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

.cmdk-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: transparent;
    color: var(--text, #e8edf7);
    font-size: 1rem;
    font-family: "Manrope", "Segoe UI", sans-serif;
    outline: none;
}

.cmdk-results { max-height: 46vh; overflow-y: auto; padding: 0.4rem; }

.cmdk-item {
    appearance: none;
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr);
    grid-template-areas: "kind label" "kind hint";
    align-items: center;
    gap: 0 0.6rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-soft);
    text-align: left;
    cursor: pointer;
}

.cmdk-item.active, .cmdk-item:hover { background: rgba(228, 191, 131, 0.1); }
.cmdk-kind { grid-area: kind; color: rgba(228, 191, 131, 0.7); font-weight: 800; text-align: center; }
.cmdk-label { grid-area: label; font-size: 0.92rem; font-weight: 700; }
.cmdk-item small { grid-area: hint; color: var(--muted); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-empty { color: var(--muted); padding: 1rem; font-size: 0.88rem; }
.cmdk-foot { margin: 0; padding: 0.55rem 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 0.72rem; }

/* A11y floor: visible focus everywhere interactive */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid #f3dcb2 !important;
    outline-offset: 2px;
}

/* ============================================================
   v3-S1 — app shell: instrument rail + route transitions
   The sidebar becomes the observatory's brass rail; every view
   change is a 180ms fade-through. Tokens extend, not replace.
   ============================================================ */

:root {
    --serif: "KaTeX_Main", "Georgia", "Times New Roman", serif;
    --gold: #e4bf83;
    --gold-bright: #f3dcb2;
    --gold-line: rgba(228, 191, 131, 0.35);
    --gold-faint: rgba(228, 191, 131, 0.12);
    --ink: #060b15;
}

/* Brand block: competition-paper serif, engraved underline */
.sidebar-brand h1 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.015em;
    color: #f4ecdd;
}

.sidebar-kicker {
    letter-spacing: 0.26em !important;
    color: var(--gold) !important;
}

.sidebar-brand {
    position: relative;
    padding-bottom: 1rem;
}

.sidebar-brand::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--gold-line), transparent 80%);
}

/* Nav: small-caps instrument labels with a gold seam on active */
.sidebar-nav a {
    position: relative;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    transition: color 0.16s ease-out, background 0.16s ease-out, padding-left 0.16s ease-out;
}

.sidebar-nav a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 2px;
    border-radius: 2px;
    background: var(--gold);
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.sidebar-nav a:hover { color: var(--gold-bright); }
.sidebar-nav a:hover::before { opacity: 0.45; transform: scaleY(0.7); }

.sidebar-nav a.active {
    color: var(--gold-bright);
    background: var(--gold-faint);
}

.sidebar-nav a.active::before { opacity: 1; transform: scaleY(1); }

/* Panels: unified hairline cards with museum labels */
.workspace-sidebar .sidebar-panel {
    border: 1px solid var(--line);
    border-top: 1px solid var(--gold-line);
    transition: border-color 0.16s ease-out;
}

.workspace-sidebar .sidebar-panel:hover { border-color: var(--line-strong); }

.workspace-sidebar .panel-label {
    letter-spacing: 0.18em;
    color: var(--gold);
}

.sidebar-status-grid strong {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--gold-bright);
}

/* Mode switch: segmented instrument toggle */
.site-mode-switch a {
    letter-spacing: 0.08em;
    transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.site-mode-switch a:hover { border-color: var(--gold-line); color: var(--gold-bright); }

/* Route transition: entrance fade-through on every view change */
@keyframes route-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

#app.route-in > * { animation: route-in 0.2s cubic-bezier(0.3, 0.7, 0.4, 1) both; }

@media (prefers-reduced-motion: reduce) {
    #app.route-in > * { animation: none; }
    .sidebar-nav a, .sidebar-nav a::before { transition: none; }
}

/* ============================================================
   v3-S2 — atlas plates (roadmap index) + ledger (week view)
   ============================================================ */

.roadmap-week-card.atlas-plate {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas: "arc meta" "arc title" "arc small" "bar bar";
    gap: 0.15rem 0.8rem;
    align-items: center;
    border-top: 2px solid color-mix(in srgb, var(--seg, #8aa3c8) 55%, transparent);
    overflow: hidden;
}

.atlas-plate > span { grid-area: meta; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.atlas-plate > strong { grid-area: title; font-family: var(--serif); font-weight: 400; font-size: 1.02rem; line-height: 1.25; color: #ece4d4; }
.atlas-plate > small { grid-area: small; }
.atlas-plate .roadmap-week-card-bar { grid-area: bar; margin-top: 0.5rem; }

.atlas-arc { grid-area: arc; width: 44px; height: 44px; }
.atlas-arc-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 2.5; }
.atlas-arc-fill {
    fill: none;
    stroke: var(--seg, #e4bf83);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.atlas-arc-num {
    fill: var(--gold-bright);
    font-family: var(--serif);
    font-size: 11px;
    text-anchor: middle;
}

.atlas-plate:hover {
    transform: translateY(-2px);
    border-color: var(--gold-line);
    border-top-color: var(--seg);
}

.atlas-plate.current { box-shadow: inset 0 0 0 1px var(--gold-line), 0 0 18px rgba(228, 191, 131, 0.08); }

.atlas-seal {
    display: inline-grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 1px solid rgba(170, 158, 96, 0.7);
    background: rgba(170, 158, 96, 0.14);
    color: #c9c89a;
    font-style: normal;
    font-size: 0.65rem;
    vertical-align: -0.2em;
}

/* Week view — the ledger */
.roadmap-v2-header h2 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.012em;
    color: #f4ecdd;
}

.roadmap-v2-shell { border-top: 2px solid var(--gold-line); }

details.roadmap-gate {
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease-out;
}

details.roadmap-gate:hover { border-left-color: var(--gold-line); }
details.roadmap-gate[data-complete="true"], details.roadmap-gate.complete { border-left-color: var(--success); }

details.roadmap-gate summary {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.02rem;
    color: #ece4d4;
    transition: color 0.16s ease-out;
}

details.roadmap-gate summary:hover { color: var(--gold-bright); }

/* Resource rows -> catalog cards */
.roadmap-gate .roadmap-resource-row, .roadmap-gate li {
    transition: background 0.16s ease-out, border-color 0.16s ease-out;
}

.roadmap-gate .detail-list li:hover { background: rgba(228, 191, 131, 0.04); }

/* Problems block framed like an exam paper excerpt */
.roadmap-gate-block .detail-list.tight {
    border-left: 2px solid var(--gold-line);
    padding-left: 0.9rem;
}

/* Wax-seal stamp on gate completion (plays once via animation) */
@keyframes seal-stamp {
    0% { transform: scale(2.2) rotate(-14deg); opacity: 0; }
    55% { transform: scale(0.92) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.gate-seal {
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.5rem;
    border-radius: 50%;
    border: 1.5px solid rgba(170, 158, 96, 0.8);
    background: radial-gradient(circle at 35% 30%, rgba(170, 158, 96, 0.3), rgba(170, 158, 96, 0.12));
    color: #c9c89a;
    font-size: 0.75rem;
    font-weight: 800;
    animation: seal-stamp 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .gate-seal { animation: none; }
    .atlas-arc-fill { transition: none; }
    .atlas-plate:hover { transform: none; }
}

/* ============================================================
   v3-S3 — Battle = the examination hall · Archive = the collection
   CSS-only reskin; all gamification logic and selectors untouched.
   ============================================================ */

/* The problem sits on lamplit paper; the room stays dark */
.gam-battle-problem, .gam-battle-prompt {
    background: linear-gradient(178deg, #f6efe0, #efe6d2) !important;
    color: #1c2433 !important;
    border: 1px solid rgba(120, 100, 60, 0.35) !important;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px rgba(228, 191, 131, 0.2), 0 18px 60px rgba(0, 0, 0, 0.5);
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.65;
}

.gam-battle-problem .katex, .gam-battle-prompt .katex { color: #14203a; }

.gam-battle-problem::before {
    content: "";
    display: block;
    height: 3px;
    margin: -0.2rem 0 0.8rem;
    background: linear-gradient(90deg, var(--gold), transparent 70%);
    opacity: 0.5;
}

/* Chronometer timer */
.gam-battle-timer {
    font-variant-numeric: tabular-nums;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    background: rgba(228, 191, 131, 0.06);
    color: var(--gold-bright);
}

/* Battle header gets the museum label */
.gam-battle-header h2, .gam-battle-header h3 {
    font-family: var(--serif);
    font-weight: 400;
    color: #f4ecdd;
}

/* Result scorer -> grader's stamps */
.gam-battle-result button[data-gam-attempt-result],
[data-gam-attempt-result] {
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 800;
    border-width: 1.5px !important;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

[data-gam-attempt-result]:active { transform: scale(0.96) rotate(-1deg); }
[data-gam-attempt-result="clean"]:hover { box-shadow: 0 0 14px rgba(170, 158, 96, 0.35); }
[data-gam-attempt-result="partial"]:hover { box-shadow: 0 0 14px rgba(228, 191, 131, 0.35); }
[data-gam-attempt-result="missed"]:hover { box-shadow: 0 0 14px rgba(143, 58, 54, 0.35); }

/* Hint = sealed envelope */
[class*="gam-hint"] button, button[data-gam-hint] {
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Archive Browser -> museum collection */
.gam-archive-browser-shell h2, .gam-archive-browser-shell h3 {
    font-family: var(--serif);
    font-weight: 400;
    color: #f4ecdd;
}

.gam-archive-row {
    border-left: 2px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.16s ease-out, background 0.16s ease-out, transform 0.16s ease-out;
}

.gam-archive-row:hover {
    border-left-color: var(--gold);
    background: rgba(228, 191, 131, 0.045);
    transform: translateX(2px);
}

.gam-archive-meta, .gam-archive-badge {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
}

.gam-archive-badge {
    border: 1px solid var(--gold-line);
    border-radius: 3px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-faint);
}

.gam-archive-filters select,
.gam-archive-filters input,
.gam-archive-search input {
    border-color: var(--line) !important;
    transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out;
}

.gam-archive-filters select:focus,
.gam-archive-search input:focus {
    border-color: var(--gold-line) !important;
    box-shadow: 0 0 0 2px var(--gold-faint);
}

.gam-archive-solution {
    border-left: 2px solid var(--gold-line);
    font-family: var(--serif);
}

@media (prefers-reduced-motion: reduce) {
    .gam-archive-row:hover { transform: none; }
}

/* ============================================================
   v3-S4 — instrument cluster + tutor rooms + one modal family
   ============================================================ */

/* Radial gauge for projected score */
.perf-gauge { width: 110px; height: 68px; display: block; }
.perf-gauge-bg { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 6; stroke-linecap: round; }
.perf-gauge-fill {
    fill: none;
    stroke: url(#none), var(--gold);
    stroke: var(--gold);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dasharray 0.9s cubic-bezier(0.65, 0, 0.35, 1);
    filter: drop-shadow(0 0 5px rgba(228, 191, 131, 0.35));
}
.perf-gauge-num {
    fill: var(--gold-bright);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 21px;
    font-weight: 800;
    text-anchor: middle;
}
.perf-gauge-sub {
    fill: var(--muted);
    font-size: 7.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-anchor: middle;
}

/* Attempts sparkline */
.perf-spark { margin-top: 0.9rem; }
.perf-spark svg { width: 100%; height: 46px; display: block; }
.perf-spark-total { fill: none; stroke: rgba(228, 191, 131, 0.55); stroke-width: 1.5; }
.perf-spark-clean { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.perf-spark-now { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1; stroke-dasharray: 3 3; }
.perf-spark small { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.05em; }
.spark-key { display: inline-block; width: 0.9rem; height: 2px; vertical-align: middle; margin: 0 0.25rem; }
.spark-key.total { background: rgba(228, 191, 131, 0.55); }
.spark-key.clean { background: var(--gold); }

/* One modal family: every overlay card matches the crack-note treatment */
.gam-ai-modal .gam-ai-inner,
.gam-interrupt-card,
.gam-completion-modal .gam-ai-inner {
    border: 1px solid var(--gold-line) !important;
    border-radius: 0.8rem !important;
    background: #0a1220 !important;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6) !important;
}

.gam-interrupt-card h2,
.gam-ai-inner h2, .gam-ai-inner h3,
.gam-completion-modal h2 {
    font-family: var(--serif);
    font-weight: 400;
    color: #f4ecdd;
}

.gam-interrupt-eyebrow, .gam-ai-eyebrow {
    letter-spacing: 0.18em !important;
    text-transform: uppercase;
    color: var(--gold) !important;
    font-size: 0.72rem !important;
}

/* Ladder belts -> engraved medallions */
.gam-ladder-shell h2, .gam-ladder-shell h3 { font-family: var(--serif); font-weight: 400; color: #f4ecdd; }

.gam-ladder-belt {
    border: 1px solid var(--line);
    border-top: 2px solid var(--gold-line);
    transition: border-color 0.16s ease-out, transform 0.16s ease-out;
}

.gam-ladder-belt:hover { border-color: var(--gold-line); transform: translateY(-1px); }

.gam-ladder-belt-icon {
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(228, 191, 131, 0.3), 0 0 10px rgba(228, 191, 131, 0.12);
}

.gam-ladder-progress-wrap { border-color: var(--gold-line); }

/* Guidance rows: ledger treatment */
.guidance-row {
    border-left: 2px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.16s ease-out, background 0.16s ease-out;
}

.guidance-row:hover { border-left-color: var(--gold-line); background: rgba(228, 191, 131, 0.035); }

@media (prefers-reduced-motion: reduce) {
    .perf-gauge-fill { transition: none; }
    .gam-ladder-belt:hover { transform: none; }
}

/* ============================================================
   v3-S5 — the stacks: global surface language for every view
   (workspace-card ×82 + assignment-card ×48 carry the whole app)
   ============================================================ */

/* The museum voice: serif display headings across the workspace */
.workspace-main h2, .workspace-main h3 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: #f4ecdd;
}

.workspace-main .eyebrow, .workspace-main .panel-label {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

/* Universal card surface: engraved hairline, gold breath on hover */
.workspace-card {
    border: 1px solid var(--line);
    transition: border-color 0.18s ease-out, box-shadow 0.18s ease-out;
}

.workspace-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 1px var(--gold-faint), var(--shadow-lg);
}

.assignment-card, .stat-card, .home-action-card, .vault-lane-card {
    border: 1px solid var(--line);
    border-top: 2px solid rgba(228, 191, 131, 0.22);
    transition: border-color 0.16s ease-out, transform 0.16s ease-out;
}

.assignment-card:hover, .stat-card:hover, .home-action-card:hover, .vault-lane-card:hover {
    border-color: var(--gold-line);
    transform: translateY(-1px);
}

.stat-card strong {
    font-variant-numeric: tabular-nums;
    color: var(--gold-bright);
}

/* Library: lecture rows as catalog entries */
.book-lecture-row {
    border-left: 2px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.16s ease-out, background 0.16s ease-out;
}

.book-lecture-row:hover {
    border-left-color: var(--gold);
    background: rgba(228, 191, 131, 0.04);
}

.book-companion { font-family: var(--serif); font-style: italic; }

.book-filter-bar select, .book-filter-bar input {
    transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out;
}

.book-filter-bar select:focus, .book-filter-bar input:focus {
    border-color: var(--gold-line) !important;
    box-shadow: 0 0 0 2px var(--gold-faint);
}

.media-tier-section { border-top: 1px solid var(--gold-line); padding-top: 0.6rem; }

/* Tables across stats/tracker views: ledger numerals */
.workspace-main table { font-variant-numeric: tabular-nums; }
.workspace-main th {
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
    .assignment-card:hover, .stat-card:hover, .home-action-card:hover, .vault-lane-card:hover { transform: none; }
}

/* ============================================================
   v3-S6 — micro-interaction sweep
   ============================================================ */

/* Textareas: gold hairline glow on focus */
.notes-box:focus, textarea:focus {
    border-color: var(--gold-line) !important;
    box-shadow: 0 0 0 2px var(--gold-faint), inset 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* Details chevron rotation (custom marker on gate + note folds) */
details.roadmap-gate > summary::after,
details.perf-logger > summary::after,
details.roadmap-note-fold > summary::after {
    content: "›";
    float: right;
    margin-left: 0.6rem;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.2s cubic-bezier(0.65, 0, 0.35, 1), color 0.16s;
}

details[open].roadmap-gate > summary::after,
details[open].perf-logger > summary::after,
details[open].roadmap-note-fold > summary::after {
    transform: rotate(90deg);
    color: var(--gold);
}

/* Buttons: press depth everywhere */
.action-button:active, .ghost-button:active { transform: translateY(1px) scale(0.99); }

.action-button.done {
    border-color: rgba(170, 158, 96, 0.55) !important;
    color: #c9c89a !important;
}

/* Gate body: smooth-ish open via fade (height animation avoided for perf) */
@keyframes gate-body-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
details.roadmap-gate[open] > .roadmap-gate-body { animation: gate-body-in 0.22s ease-out both; }

@media (prefers-reduced-motion: reduce) {
    details.roadmap-gate[open] > .roadmap-gate-body { animation: none; }
    details.roadmap-gate > summary::after { transition: none; }
    .action-button:active, .ghost-button:active { transform: none; }
}

/* v3-S7 — course transcript card */
.transcript-card { border-color: rgba(228, 191, 131, 0.22); }
.transcript-rows { display: grid; gap: 0.65rem; }

.transcript-row {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    grid-template-areas: "name track" "name spine";
    gap: 0.1rem 1rem;
    align-items: center;
    opacity: 0.85;
}

.transcript-row.active { opacity: 1; }

.transcript-name {
    grid-area: name;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--seg, var(--text-soft));
}

.transcript-track {
    grid-area: track;
    position: relative;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.transcript-track i {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 4px;
    opacity: 0.75;
}

.transcript-row.active .transcript-track i { opacity: 1; box-shadow: 0 0 8px 0 color-mix(in srgb, var(--seg, #e4bf83) 40%, transparent); }

.transcript-row small { grid-area: spine; color: var(--muted); font-size: 0.74rem; }

@media (max-width: 760px) {
    .transcript-row { grid-template-columns: 1fr; grid-template-areas: "name" "track" "spine"; }
}

/* ============================================================
   v4-S6 — Daily Observatory Ritual (sealed card session opener)
   ============================================================ */
.gam-ritual {
  position: fixed; inset: 0; z-index: 9400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 18, 0.82);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 480ms ease;
  padding: 24px;
}
.gam-ritual.show { opacity: 1; }
.gam-ritual-card {
  position: relative;
  width: min(440px, 92vw);
  background: linear-gradient(172deg, #0b1322 0%, #060b15 100%);
  border: 1px solid var(--gold-line, rgba(228, 191, 131, 0.28));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(243, 220, 178, 0.08);
  padding: 34px 34px 30px;
  text-align: center;
  transform: translateY(14px);
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}
.gam-ritual.show .gam-ritual-card { transform: translateY(0); }
.gam-ritual-card::before {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(228, 191, 131, 0.14); pointer-events: none;
}
.gam-ritual-eyebrow {
  font-family: var(--serif, Georgia, serif);
  font-size: 10.5px; letter-spacing: 0.22em;
  color: #e4bf83; margin: 0 0 18px;
}
.gam-ritual-card h2 {
  font-family: var(--serif, Georgia, serif);
  font-weight: 400; font-size: 22px; line-height: 1.3;
  color: #f3dcb2; margin: 14px 0 8px;
}
.gam-ritual-sub { color: rgba(214, 222, 238, 0.75); font-size: 13.5px; line-height: 1.55; margin: 0 0 6px; }
.gam-ritual-artifact {
  margin: 14px auto 4px; padding: 10px 14px;
  border-top: 1px solid rgba(228, 191, 131, 0.16);
  border-bottom: 1px solid rgba(228, 191, 131, 0.16);
  color: rgba(228, 191, 131, 0.85); font-size: 12px; line-height: 1.55;
  font-style: italic;
}
.gam-ritual-artifact span { font-style: normal; margin-right: 6px; }
.gam-ritual-seal {
  width: 76px; height: 76px; margin: 4px auto 6px;
  border-radius: 50%;
  border: 1px solid rgba(228, 191, 131, 0.5);
  background:
    radial-gradient(circle at 35% 30%, rgba(243, 220, 178, 0.22), transparent 55%),
    radial-gradient(circle, #5d1f1f 0%, #471417 62%, #320d10 100%);
  color: #f3dcb2; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 -2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 320ms ease, box-shadow 320ms ease;
}
.gam-ritual-seal:hover { transform: scale(1.06) rotate(-4deg); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 -2px 6px rgba(0, 0, 0, 0.45); }
.gam-ritual-seal:focus-visible { outline: 2px solid #e4bf83; outline-offset: 3px; }
.gam-ritual-card[data-stage="open"] .gam-ritual-open-face { animation: ritual-reveal 540ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes ritual-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.gam-ritual-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  .gam-ritual, .gam-ritual-card, .gam-ritual-seal { transition: none; }
  .gam-ritual { opacity: 1; }
  .gam-ritual-card { transform: none; }
  .gam-ritual-card[data-stage="open"] .gam-ritual-open-face { animation: none; }
  .gam-ritual-seal:hover { transform: none; }
}

/* ============================================================
   v4-S7 — Mid-proof process glyph rail (Battle Mode, zero-XP)
   ============================================================ */
.gam-glyph-rail {
  margin: 10px 0 4px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(228, 191, 131, 0.18);
  background: linear-gradient(180deg, rgba(228, 191, 131, 0.04), transparent);
}
.gam-glyph-rail-eyebrow {
  font-family: var(--serif, Georgia, serif);
  font-size: 9.5px; letter-spacing: 0.2em;
  color: rgba(228, 191, 131, 0.7);
  margin: 0 0 8px;
}
.gam-glyph-stations { display: flex; gap: 6px; flex-wrap: wrap; }
.gam-glyph {
  flex: 1 1 0; min-width: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px 7px;
  background: transparent;
  border: 1px solid rgba(228, 191, 131, 0.16);
  color: rgba(214, 222, 238, 0.55);
  cursor: pointer;
  transition: border-color 240ms ease, color 240ms ease, background 240ms ease;
}
.gam-glyph:hover { border-color: rgba(228, 191, 131, 0.4); color: rgba(214, 222, 238, 0.85); }
.gam-glyph:focus-visible { outline: 2px solid #e4bf83; outline-offset: 2px; }
.gam-glyph-mark {
  font-family: var(--serif, Georgia, serif);
  font-size: 17px; line-height: 1;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid currentColor; border-radius: 50%;
}
.gam-glyph-label { font-size: 10px; letter-spacing: 0.04em; text-align: center; line-height: 1.25; }
.gam-glyph.lit {
  border-color: rgba(228, 191, 131, 0.65);
  color: #e4bf83;
  background: rgba(228, 191, 131, 0.07);
}
.gam-glyph.lit .gam-glyph-mark {
  box-shadow: 0 0 0 3px rgba(228, 191, 131, 0.12);
  animation: glyph-strike 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes glyph-strike {
  0% { transform: scale(0.85); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .gam-glyph { transition: none; }
  .gam-glyph.lit .gam-glyph-mark { animation: none; }
}

/* ============================================================
   v4-S8 — Case files + technique cabinet
   ============================================================ */
.gam-case-modal {
  position: fixed; inset: 0; z-index: 9300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 18, 0.84); backdrop-filter: blur(3px);
  padding: 24px;
}
.gam-case-shell {
  width: min(680px, 94vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(172deg, #0b1322 0%, #060b15 100%);
  border: 1px solid var(--gold-line, rgba(228, 191, 131, 0.28));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  padding: 26px 28px 30px;
}
.gam-case-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gam-case-modal-head h2 { font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 21px; color: #f3dcb2; margin: 4px 0 0; }
.gam-case-ledger { color: rgba(228, 191, 131, 0.82); font-size: 12.5px; letter-spacing: 0.02em; margin: 14px 0 18px; padding-bottom: 12px; border-bottom: 1px solid rgba(228, 191, 131, 0.16); }
.gam-case-list { display: flex; flex-direction: column; gap: 14px; }
.gam-case {
  border: 1px solid rgba(228, 191, 131, 0.18);
  border-left-width: 3px;
  padding: 14px 16px 12px;
  background: rgba(228, 191, 131, 0.03);
}
.gam-case.open { border-left-color: #b6794a; }
.gam-case.cracked { border-left-color: #e4bf83; }
.gam-case.sealed { border-left-color: rgba(120, 140, 170, 0.5); opacity: 0.82; }
.gam-case-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gam-case-head h3 { font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 15.5px; color: #eef2fb; margin: 0; flex: 1 1 auto; }
.gam-case-status { font-size: 9.5px; letter-spacing: 0.18em; padding: 2px 7px; border: 1px solid currentColor; }
.gam-case-status-open { color: #d89a63; }
.gam-case-status-cracked { color: #e4bf83; }
.gam-case-status-sealed { color: rgba(150, 168, 196, 0.8); }
.gam-case-lane { font-size: 10.5px; letter-spacing: 0.08em; color: rgba(214, 222, 238, 0.55); text-transform: uppercase; }
.gam-case-meta { font-size: 11px; color: rgba(214, 222, 238, 0.55); margin: 8px 0 8px; }
.gam-case-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; margin-left: 3px;
  font-family: var(--serif, Georgia, serif); font-size: 10px;
  border: 1px solid rgba(228, 191, 131, 0.4); border-radius: 9px;
  color: #e4bf83; vertical-align: middle;
}
.gam-case-crack {
  position: relative;
  margin: 8px 0; padding: 9px 12px;
  border-left: 2px solid rgba(228, 191, 131, 0.4);
  background: rgba(228, 191, 131, 0.05);
  font-style: italic; font-size: 12.5px; line-height: 1.5;
  color: rgba(238, 242, 251, 0.9);
}
.gam-case-srs { display: inline-block; margin-top: 7px; font-style: normal; font-size: 10.5px; }
.gam-case-empty { font-size: 11.5px; color: rgba(214, 222, 238, 0.5); line-height: 1.5; margin: 6px 0; font-style: italic; }
.gam-case-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.gam-case-sealed-note { font-size: 11px; color: rgba(150, 168, 196, 0.75); }
.gam-linklike { background: none; border: none; color: #e4bf83; cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

/* ============================================================
   v4-S9 — Constellation expeditions + earned rest (Seal the Observatory)
   ============================================================ */
.t3-seal-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gold-faint, rgba(228, 191, 131, 0.16)); text-align: center; }
.t3-seal-row small { display: block; margin-top: 6px; color: rgba(214, 222, 238, 0.55); font-size: 11.5px; }
.t3-seal-btn { letter-spacing: 0.04em; }
.t3-sealed-note { color: rgba(228, 191, 131, 0.86); font-size: 12.5px; line-height: 1.55; margin: 0; font-style: italic; }
.t3-sealed-note span { font-style: normal; margin-right: 6px; }
.t3-card.sealed { border-color: rgba(228, 191, 131, 0.4); }

.exped-card-wrap .exped-intro { color: rgba(214, 222, 238, 0.6); font-size: 12.5px; line-height: 1.55; margin: 4px 0 16px; }
.exped-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.exped-card {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(228, 191, 131, 0.16);
  background: rgba(228, 191, 131, 0.03);
}
.exped-card.discovered { border-color: rgba(228, 191, 131, 0.42); background: rgba(228, 191, 131, 0.06); }
.exped-constellation { width: 58px; height: 58px; flex: 0 0 58px; }
.exped-constellation .exped-edges line { stroke: rgba(150, 168, 196, 0.3); stroke-width: 0.8; }
.exped-constellation .exped-stars circle { fill: rgba(180, 196, 220, 0.5); }
.exped-constellation.lit .exped-edges line { stroke: rgba(228, 191, 131, 0.7); stroke-width: 1; }
.exped-constellation.lit .exped-stars circle { fill: #f3dcb2; filter: drop-shadow(0 0 3px rgba(243, 220, 178, 0.6)); }
.exped-copy { flex: 1 1 auto; min-width: 0; }
.exped-name { font-family: var(--serif, Georgia, serif); font-size: 14px; color: #eef2fb; margin: 0 0 3px; }
.exped-card.discovered .exped-name { color: #f3dcb2; }
.exped-seal { color: #e4bf83; }
.exped-copy small { display: block; color: rgba(214, 222, 238, 0.55); font-size: 11px; line-height: 1.45; margin-bottom: 8px; }
.exped-progress { display: flex; align-items: center; gap: 8px; }
.exped-bar { flex: 1 1 auto; height: 4px; background: rgba(228, 191, 131, 0.12); overflow: hidden; }
.exped-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #b6794a, #e4bf83); transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1); }
.exped-progress em { font-style: normal; font-size: 10.5px; color: rgba(228, 191, 131, 0.8); letter-spacing: 0.03em; }
@media (prefers-reduced-motion: reduce) {
  .exped-bar > span { transition: none; }
}

/* ============================================================
   v4-S10 — Renaissance art plates (duotone) + material texture
   Plates are The Met open-access (CC0); see docs/FABLE5_SITE_AUDIT.md.
   The duotone recipe turns each chiaroscuro painting into a navy/gold
   observatory surface. One plate per viewport, always behind content,
   never interfering with legibility or interaction.
   ============================================================ */
:root {
  --plate-filter: grayscale(1) sepia(1) hue-rotate(176deg) saturate(1.5) brightness(0.42) contrast(1.06);
  /* FLUX scene plates ship in-palette; grade lightly instead of duotoning */
  --scene-filter: saturate(0.92) brightness(0.58) contrast(1.05);
}

/* Hero — Pieter Claesz, Still Life with a Skull and a Writing Quill (1628),
   sits UNDER the no-WebGL starfield so the fallback hero is a painting. */
#landing-hero.hero-no-webgl .hero-fallback::before {
  content: "";
  position: absolute; inset: 0;
  background: url("assets/plates/hero.webp") center/cover no-repeat;
  filter: var(--plate-filter);
  opacity: 0.55;
  z-index: -1;
}
#landing-hero.hero-no-webgl .hero-fallback::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 30% 28%, rgba(243, 220, 178, 0.16), transparent 70%),
              radial-gradient(120% 100% at 50% 50%, transparent 52%, rgba(4, 8, 18, 0.7) 100%);
  z-index: -1;
}

/* Battle + mocks — Jacques-Louis David, The Death of Socrates (1787).
   A figure making his case under pressure, behind the lamplit problem. */
.gam-battle-mode::before {
  content: "";
  position: absolute; inset: 0;
  background: url("assets/plates/battle.webp") center/cover no-repeat;
  filter: var(--plate-filter);
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}
.gam-battle-mode::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 50% 38%, rgba(243, 220, 178, 0.1), transparent 72%),
              radial-gradient(130% 110% at 50% 50%, transparent 46%, rgba(2, 7, 12, 0.82) 100%);
  z-index: 0; pointer-events: none;
}
.gam-battle-mode > * { position: relative; z-index: 1; }

/* Roadmap week page — Edwaert Collier, Vanitas Still Life (1662): books,
   globe, instruments laid out like a map. Faint top-corner watermark. */
.week-page { position: relative; }
.week-page::before {
  content: "";
  position: absolute; top: 0; right: 0;
  width: min(46%, 420px); height: 240px;
  background: url("assets/plates/roadmap.webp") top right/cover no-repeat;
  filter: var(--plate-filter);
  opacity: 0.14;
  -webkit-mask-image: linear-gradient(225deg, #000 0%, transparent 78%);
  mask-image: linear-gradient(225deg, #000 0%, transparent 78%);
  pointer-events: none; z-index: 0;
}
.week-page > * { position: relative; z-index: 1; }

/* Reflect + verify gates — Salvator Rosa, Self-Portrait (~1647): the
   philosopher who interrogates. Faint material wash on the introspective gate. */
.roadmap-gate-body .roadmap-verify-grid,
.roadmap-gate-body [data-roadmap-reflection] {
  position: relative;
}
.roadmap-gate-body .roadmap-verify-grid::before {
  content: "";
  position: absolute; inset: 0;
  background: url("assets/plates/reflect.webp") right center/cover no-repeat;
  filter: var(--plate-filter);
  opacity: 0.1;
  -webkit-mask-image: linear-gradient(270deg, #000, transparent 70%);
  mask-image: linear-gradient(270deg, #000, transparent 70%);
  pointer-events: none; z-index: 0;
}
.roadmap-gate-body .roadmap-verify-grid > * { position: relative; z-index: 1; }

/* ---- Material textures (replace reliance on global grain) ---- */
/* Ruled-ledger hint on the week page workspace. */
.week-page::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 31px, rgba(228, 191, 131, 0.05) 31px, rgba(228, 191, 131, 0.05) 32px);
  pointer-events: none; z-index: 0;
}
/* Paper-fiber tooth on the battle problem panel. */
.gam-battle-problem {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(120, 90, 50, 0.04) 0.5px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(120, 90, 50, 0.035) 0.5px, transparent 1px),
    radial-gradient(circle at 45% 85%, rgba(120, 90, 50, 0.03) 0.5px, transparent 1px);
  background-size: 7px 7px, 11px 11px, 9px 9px;
}
@media (prefers-reduced-motion: reduce) {
  .gam-battle-mode::before, .gam-battle-mode::after { opacity: 0.18; }
}

/* ============================================================
   v4-S11 — Route choreography + marginalia + ledger-unfold
   ============================================================ */
/* Route-specific entrance. Default keeps the original quiet fade; the named
   routes get their own gesture. All gated behind prefers-reduced-motion below. */
#app[data-route="roadmap"].route-in > * {
  animation: route-plate-set 0.62s cubic-bezier(0.16, 0.84, 0.3, 1) both;
}
@keyframes route-plate-set {
  from { opacity: 0; transform: scale(1.035) translateY(10px); filter: blur(2px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
#app[data-route="archive"].route-in > * {
  animation: route-drawer 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes route-drawer {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}
#app[data-route="overview"].route-in > * {
  animation: route-in 0.4s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}

/* Battle Mode: lamp dim-then-bloom (500–700ms) instead of a flat fade-in. */
.gam-battle-mode { animation: battle-lamp 0.62s cubic-bezier(0.18, 0.7, 0.3, 1) both; }
@keyframes battle-lamp {
  0% { opacity: 0; filter: brightness(0.4); }
  35% { opacity: 1; }
  55% { filter: brightness(0.78); }
  100% { opacity: 1; filter: brightness(1); }
}
.gam-battle-mode .gam-battle-problem { animation: battle-paper-rise 0.7s cubic-bezier(0.16, 0.84, 0.3, 1) both 0.1s; }
@keyframes battle-paper-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ledger-unfold beat on roadmap gate open. */
.roadmap-gate[open] > .roadmap-gate-body { animation: ledger-unfold 0.42s cubic-bezier(0.16, 0.84, 0.3, 1) both; transform-origin: top; }
@keyframes ledger-unfold {
  from { opacity: 0; transform: scaleY(0.94) translateY(-6px); }
  to { opacity: 1; transform: scaleY(1) translateY(0); }
}

/* ---- Hand-drawn marginalia (feTurbulence wobble + stroke draw-on) ---- */
.marginalia { pointer-events: none; }
.marginalia path, .marginalia line { stroke: var(--gold, #e4bf83); fill: none; }
/* Hero headline underline — drawn under the title once on load. */
.hero-underline {
  display: block; width: 280px; height: 16px; margin-top: 6px;
  overflow: visible; opacity: 0.85;
}
.hero-underline path {
  stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 320; stroke-dashoffset: 320;
  animation: draw-on 1.1s ease-out 0.5s forwards;
}
@keyframes draw-on { to { stroke-dashoffset: 0; } }
/* Section eyebrow flourish — small underline that draws on when scrolled in. */
.rule-label { position: relative; }
/* Q.E.D.? margin mark on completed gates. */
.roadmap-gate.complete > summary { position: relative; }
.roadmap-gate.complete > summary::after {
  content: "Q.E.D.";
  position: absolute; right: 38px; top: 50%; transform: translateY(-50%) rotate(-7deg);
  font-family: var(--serif, Georgia, serif); font-size: 11px; letter-spacing: 0.08em;
  color: rgba(228, 191, 131, 0.5); font-style: italic;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #app[data-route].route-in > * { animation: none; }
  .gam-battle-mode { animation: none; filter: none; }
  .gam-battle-mode .gam-battle-problem { animation: none; }
  .roadmap-gate[open] > .roadmap-gate-body { animation: none; }
  .hero-underline path { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   v4-S12 — Cellarius phase-completion ceremony
   ============================================================ */
.phase-ceremony {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 6, 14, 0.9); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 520ms ease; padding: 24px;
}
.phase-ceremony.show { opacity: 1; }
.phase-ceremony.leaving { opacity: 0; }
.phase-ceremony-card {
  position: relative; width: min(560px, 94vw);
  border: 1px solid var(--gold-line, rgba(228, 191, 131, 0.35));
  background: #060b15;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(243, 220, 178, 0.1);
  overflow: hidden;
  transform: translateY(18px) scale(0.985);
  transition: transform 560ms cubic-bezier(0.16, 0.84, 0.3, 1);
}
.phase-ceremony.show .phase-ceremony-card { transform: translateY(0) scale(1); }
.phase-ceremony-plate {
  height: 300px;
  background: url("assets/plates/ceremony.webp") center 18%/cover no-repeat;
  filter: grayscale(1) sepia(1) hue-rotate(176deg) saturate(1.5) brightness(0.5) contrast(1.05);
}
.phase-ceremony-plate::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 300px;
  background: radial-gradient(70% 80% at 50% 36%, rgba(243, 220, 178, 0.2), transparent 70%),
              linear-gradient(180deg, transparent 50%, #060b15 98%);
}
.phase-ceremony.show .phase-ceremony-plate { animation: ceremony-rotate 60s linear infinite; }
@keyframes ceremony-rotate { from { background-position: center 18%; } to { background-position: center 22%; } }
.phase-ceremony-body { position: relative; padding: 22px 30px 28px; text-align: center; margin-top: -40px; }
.phase-ceremony-eyebrow { font-family: var(--serif, Georgia, serif); font-size: 10.5px; letter-spacing: 0.24em; color: #e4bf83; margin: 0 0 10px; }
.phase-ceremony-body h2 { font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: 26px; color: #f3dcb2; margin: 0 0 10px; }
.phase-ceremony-msg { color: rgba(214, 222, 238, 0.8); font-size: 14px; line-height: 1.55; margin: 0 0 20px; }
@media (prefers-reduced-motion: reduce) {
  .phase-ceremony, .phase-ceremony-card { transition: none; }
  .phase-ceremony { opacity: 1; }
  .phase-ceremony-card { transform: none; }
  .phase-ceremony.show .phase-ceremony-plate { animation: none; }
}

/* ============================================================
   v4-S13 — uMorph atlas overlay (crossfades above the canvas as
   the constellation flattens into the engraved index plate)
   ============================================================ */
.hero-atlas {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 120ms linear;
}
.hero-atlas-frame {
  margin-bottom: 12%;
  text-align: center;
  padding: 14px 26px;
  border-top: 1px solid rgba(228, 191, 131, 0.4);
  border-bottom: 1px solid rgba(228, 191, 131, 0.4);
  background: linear-gradient(180deg, transparent, rgba(6, 11, 21, 0.35), transparent);
}
.hero-atlas-title {
  font-family: var(--serif, "KaTeX_Main", Georgia, serif);
  font-size: clamp(15px, 2.2vw, 22px); letter-spacing: 0.16em;
  color: #f3dcb2; margin: 0 0 6px;
}
.hero-atlas-sub {
  font-family: var(--serif, Georgia, serif); font-style: italic;
  font-size: 12.5px; color: rgba(228, 191, 131, 0.75); margin: 0;
}
#landing-hero.hero-no-webgl .hero-atlas,
#landing-hero.hero-min .hero-atlas { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-atlas { display: none; }
}

/* ============================================================
   MINERVA / PRODUCTIVITY TOOLKIT EXTENSIONS
   ============================================================ */
.gam-toolkit-wide {
  grid-column: 1 / -1;
}

.gam-toolkit-minerva {
  border-color: rgba(228, 191, 131, 0.45);
  background:
    radial-gradient(circle at top left, rgba(228, 191, 131, 0.14), transparent 42%),
    rgba(11, 22, 39, 0.92);
}

.gam-toolkit-card h3 {
  margin: 4px 0 8px;
  color: #f4ecd8;
}

.gam-toolkit-textarea,
.gam-toolkit-email {
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid #2c4869;
  border-radius: 6px;
  background: rgba(5, 12, 22, 0.84);
  color: #f4ecd8;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}

.gam-toolkit-email {
  min-height: 220px;
}

.gam-toolkit-parking {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.gam-toolkit-parking span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: #d6dde6;
  font-size: 0.86rem;
}

.gam-toolkit-parking small {
  color: #97a4b4;
  white-space: nowrap;
}

.gam-toolkit-links {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.gam-toolkit-links a {
  padding: 8px 10px;
  border: 1px solid rgba(228, 191, 131, 0.18);
  border-radius: 6px;
  background: rgba(228, 191, 131, 0.07);
  color: #e4bf83;
  text-decoration: none;
}

.gam-toolkit-links a:hover {
  border-color: rgba(228, 191, 131, 0.42);
  background: rgba(228, 191, 131, 0.12);
}

.gam-minerva-return {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 17, 30, 0.82);
}

.gam-minerva-card {
  position: relative;
  width: min(520px, 100%);
  padding: 22px 24px;
  border: 1px solid rgba(228, 191, 131, 0.36);
  border-radius: 12px;
  background: #0f1a2e;
  color: #f4ecd8;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.gam-minerva-card h3 {
  margin: 4px 0 8px;
  color: #e4bf83;
}

.gam-minerva-card p {
  margin: 8px 0;
}

.gam-minerva-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* UX (goal 3): the fixed launcher rail overlaps content at phone widths —
   hide it below 700px; Goal 5 replaces it with a collapsible FAB. */
@media (max-width: 700px) {
    .gam-extra-launchers { display: none; }
}

/* Goal 5: archive waiting-room note (deferred archive-data.js) */
.gam-archive-wait {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 400;
    background: rgba(16, 22, 36, 0.96);
    border: 1px solid rgba(228, 191, 131, 0.35);
    border-radius: 10px;
    color: #e9d7ae;
    font-size: 0.82rem;
    padding: 9px 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

/* Goal 5: mobile FAB — the four AI pills collapse behind one toggle. */
.gam-fab-toggle { display: none; }

@media (max-width: 700px) {
    .gam-fab-toggle {
        display: grid;
        place-items: center;
        position: fixed;
        right: calc(14px + env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 320;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        border: 1px solid rgba(228, 191, 131, 0.5);
        background: #171d2d;
        color: #e4bf83;
        font-size: 1.3rem;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
        cursor: pointer;
    }
    body.gam-fab-open .gam-fab-toggle { background: #6e2b2b; color: #f6ecd9; }

    .gam-drill-launcher,
    .gam-tutor-launcher,
    .gam-coach-launcher,
    .gam-ai-launcher {
        display: none;
    }
    body.gam-fab-open .gam-drill-launcher,
    body.gam-fab-open .gam-tutor-launcher,
    body.gam-fab-open .gam-coach-launcher,
    body.gam-fab-open .gam-ai-launcher {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: auto;
        top: auto;
        right: calc(14px + env(safe-area-inset-right, 0px));
        z-index: 318;
        margin: 0;
        height: 44px;
        min-width: 150px;
        max-width: 180px;
        box-sizing: border-box;
        transform: none;
    }
    body.gam-fab-open .gam-drill-launcher { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
    body.gam-fab-open .gam-tutor-launcher { bottom: calc(134px + env(safe-area-inset-bottom, 0px)); }
    body.gam-fab-open .gam-coach-launcher { bottom: calc(188px + env(safe-area-inset-bottom, 0px)); }
    body.gam-fab-open .gam-ai-launcher { bottom: calc(242px + env(safe-area-inset-bottom, 0px)); }
}

/* Goal 5: personal-workspace top bar stacks on phones — the desktop row
   layout crushed the six-mode switch and strict-plan card at 390px. */
@media (max-width: 700px) {
    .workspace-sidebar.tracker-mode,
    .workspace-sidebar.career-mode {
        flex-direction: column;
        align-items: stretch;
    }
    .workspace-sidebar.tracker-mode .sidebar-brand,
    .workspace-sidebar.career-mode .sidebar-brand {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .workspace-sidebar.tracker-mode .strict-curriculum-panel,
    .workspace-sidebar.career-mode .strict-curriculum-panel,
    .workspace-sidebar.tracker-mode .sidebar-build-note,
    .workspace-sidebar.career-mode .sidebar-build-note {
        display: none;
    }
    .workspace-sidebar.tracker-mode .site-mode-switch,
    .workspace-sidebar.career-mode .site-mode-switch {
        width: 100%;
    }
}

/* Goal 6 row 3: folio corner illuminations (drawn SVG, ~2KB total). Each
   corner rotates the same L-flourish to hug its own angle. */
.folio-frame {
    position: relative;
    /* manuscript margin: the corner illuminations live here, off the cells */
    padding: 34px;
    border: 1px solid rgba(228, 191, 131, 0.14);
    border-radius: 12px;
    background: rgba(10, 16, 28, 0.35);
}
.folio-corner {
    position: absolute;
    width: 76px;
    height: 76px;
    color: rgba(228, 191, 131, 0.78);
    pointer-events: none;
    z-index: 3;
}
.folio-corner svg { width: 100%; height: 100%; }
.folio-corner-nw { top: -6px; left: -6px; }
.folio-corner-ne { top: -6px; right: -6px; }
.folio-corner-sw { bottom: -6px; left: -6px; }
.folio-corner-se { bottom: -6px; right: -6px; }
@media (max-width: 700px) {
    .folio-frame { padding: 20px 10px; }
    .folio-corner { width: 46px; height: 46px; }
}

/* Goal 7: Dev / QR Engineering section */
.dev-qr-header .section-title { align-items: flex-start; }
.dev-cap-badge {
    align-self: center;
    white-space: nowrap;
    border: 1px solid rgba(228, 191, 131, 0.5);
    border-radius: 999px;
    padding: 6px 14px;
    color: #e4bf83;
    font-size: 0.78rem;
    font-weight: 700;
}
.dev-lane-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.dev-lane-count { color: var(--gold, #e4bf83); font-weight: 700; font-size: 0.9rem; align-self: center; }
.dev-lane-note { color: var(--muted); font-size: 0.86rem; margin: 2px 0 10px; }
.dev-module-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dev-module {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.02);
}
.dev-module.is-done { border-color: rgba(159, 214, 164, 0.35); opacity: 0.75; }
.dev-module-main { display: grid; gap: 2px; min-width: 0; }
.dev-module-main strong { font-size: 0.9rem; }
.dev-module-main small { color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
.dev-module-main .dev-output { color: rgba(228, 191, 131, 0.8); }
.dev-module-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dev-paid-chip {
    border: 1px solid rgba(224, 133, 133, 0.5);
    color: #e08585;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 1000px) {
    .dev-lane-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .dev-module { flex-direction: column; }
    .dev-module-side { justify-content: flex-start; flex-wrap: wrap; }
    .dev-qr-header .section-title { flex-direction: column; gap: 8px; }
}

/* Vault graph (brain workspace) + finance projection desk */
.brain-graph-wrap { position: relative; }
.brain-graph-canvas { width: 100%; display: block; border-radius: 10px; background: radial-gradient(ellipse at 50% 40%, rgba(20, 28, 46, 0.9), rgba(7, 11, 20, 0.95)); border: 1px solid rgba(228, 191, 131, 0.14); }
.brain-graph-tip {
    position: absolute;
    max-width: 240px;
    background: rgba(12, 18, 32, 0.97);
    border: 1px solid rgba(228, 191, 131, 0.4);
    border-radius: 8px;
    color: #e9d7ae;
    font-size: 0.74rem;
    padding: 5px 9px;
    pointer-events: none;
    z-index: 5;
}
.brain-graph-legend i, .finance-proj-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.brain-graph-legend .support-text { margin-left: auto; }
.finance-proj-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.finance-proj-wrap { position: relative; }
.finance-proj-canvas { width: 100%; display: block; }
@media (max-width: 700px) {
    .finance-proj-controls { grid-template-columns: 1fr; }
}

/* Net-worth-first finance (reference adoption) */
.finance-networth { text-align: right; display: grid; gap: 3px; justify-items: end; }
.finance-networth strong { font-size: 2.1rem; font-family: var(--serif, Georgia, serif); color: #f3ead7; line-height: 1.1; }
.finance-networth small { color: var(--gold, #e4bf83); font-size: 0.8rem; }
.finance-networth-sub { color: var(--muted); font-size: 0.72rem; }
.finance-horizons { display: flex; gap: 6px; align-self: center; flex-wrap: wrap; }
.finance-horizons .horizon-active { border-color: var(--gold, #e4bf83); color: var(--gold, #e4bf83); font-weight: 700; }
.finance-proj-sub { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.whatif-verdict { border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid; font-size: 0.95rem; }
.whatif-verdict strong { font-size: 1.3rem; }
.whatif-verdict.ok { border-color: rgba(159, 214, 164, 0.5); background: rgba(159, 214, 164, 0.07); }
.whatif-verdict.mid { border-color: rgba(228, 191, 131, 0.5); background: rgba(228, 191, 131, 0.07); }
.whatif-verdict.bad { border-color: rgba(224, 133, 133, 0.55); background: rgba(224, 133, 133, 0.08); }
.whatif-triplet { grid-template-columns: 1fr; gap: 10px; }
.whatif-triplet strong { font-size: 0.92rem; }
@media (max-width: 700px) {
    .finance-networth { text-align: left; justify-items: start; }
}

/* ============================================================
   SMOOTHNESS REFACTOR (usamo-guide study adoption, our idiom)
   ============================================================ */

/* View-transition crossfade: short and quiet. */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 170ms;
    animation-timing-function: ease;
}

/* One micro-transition layer for every interactive element — states are
   traveled through, not jumped between. Layout props excluded on purpose. */
button,
select,
summary,
.action-button,
.ghost-button,
.lane-tile,
.mini-chip,
.hero-chip span,
.site-mode-switch a,
.sidebar-nav a,
.folio-week,
.dev-module,
.finance-field input,
.planner-status-select {
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        box-shadow 220ms ease,
        transform 180ms ease,
        opacity 180ms ease;
}

@media (prefers-reduced-motion: no-preference) {
    /* Press states: every button physically responds. */
    button:active:not(:disabled),
    .action-button:active,
    .ghost-button:active,
    .lane-tile:active,
    .site-mode-switch a:active {
        transform: scale(0.97);
    }

    /* The signature card lift (their ui-card recipe, tenebrist shadow). */
    .workspace-card {
        transition: transform 250ms ease, box-shadow 250ms ease;
    }
    .workspace-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
    }
    /* Rows inside cards get a quieter response so hovers don't stack. */
    .dev-module:hover {
        border-color: rgba(228, 191, 131, 0.3);
        transform: none;
    }
    .folio-week:hover { transform: translateY(-2px); }
}

/* Ghost buttons gain a visible hover (they previously only changed color). */
.ghost-button:hover {
    border-color: rgba(228, 191, 131, 0.45);
    background: rgba(228, 191, 131, 0.06);
}

/* The ivory pill learns the circular wipe (900ms signature, gold sweep). */
.roadmap-next-cta-go {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition:
        transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
        color 600ms ease,
        box-shadow 300ms ease;
}
.roadmap-next-cta-go::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 100%;
    background: var(--gold, #e4bf83);
    transform: translate(150%, 150%) scale(2.5);
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
    .roadmap-next-cta-go:hover {
        transform: scale(1.05);
        background: #f3ead7;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
    }
    .roadmap-next-cta-go:hover::before {
        transform: translate(0, 0) scale(2.5);
    }
    .roadmap-next-cta-go:active { transform: scale(0.95); }
}

/* Candlelight cursor spotlight — warm light follows the pointer. Desktop
   fine-pointer only; blends over every surface it crosses. */
.tnbr-cursor-glow {
    display: none;
}
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .tnbr-cursor-glow {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 560px;
        height: 560px;
        margin: -280px 0 0 -280px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(233, 199, 138, 0.10) 0%, rgba(233, 199, 138, 0.045) 38%, transparent 68%);
        mix-blend-mode: screen;
        pointer-events: none;
        z-index: 90;
    }
}

/* Smooth in-page anchor travel. */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* Answer check (battle result) */
.gam-answer-check { margin: 12px 0; padding: 12px 14px; border: 1px solid rgba(228, 191, 131, 0.22); border-radius: 10px; background: rgba(228, 191, 131, 0.04); }
.gam-answer-check-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; color: rgba(228, 191, 131, 0.8); margin: 0 0 8px; }
.gam-answer-check-row { display: flex; gap: 8px; }
.gam-answer-check-row input { flex: 1; padding: 8px 11px; border-radius: 8px; border: 1px solid #243049; background: #07101e; color: #f3f6fb; font-size: 0.95rem; }
.gam-answer-check-row input:focus { outline: none; border-color: var(--gold, #e4bf83); }
.gam-answer-verdict { margin: 8px 0 0; font-weight: 700; font-size: 0.9rem; }
.gam-answer-verdict.is-correct { color: #9fd6a4; }
.gam-answer-verdict.is-wrong { color: #e08585; }

/* Archive rich status select + tints */
.gam-archive-state { padding: 5px 8px; border-radius: 7px; border: 1px solid #243049; background: #0a1322; color: #cfd8ea; font-size: 0.78rem; }
.gam-archive-state:focus { outline: none; border-color: var(--gold, #e4bf83); }
.gam-archive-row.status-solving { border-left: 2px solid #e0a85f; }
.gam-archive-row.status-reviewing { border-left: 2px solid #e08585; }
.gam-archive-row.status-skipped { opacity: 0.62; }

/* Wall-page mini TOC (scroll-spy) */
.wall-toc { display: none; }
@media (min-width: 1280px) {
    .wall-toc {
        display: block;
        position: fixed;
        right: 64px; /* clear of the launcher rail */
        top: 120px;
        width: 210px;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 60;
        padding: 12px 14px;
        border: 1px solid rgba(228, 191, 131, 0.16);
        border-radius: 10px;
        background: rgba(10, 16, 28, 0.88);
        backdrop-filter: blur(10px);
    }
    .wall-toc-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(228, 191, 131, 0.7); margin: 0 0 8px; }
    .wall-toc a { display: block; padding: 4px 0; font-size: 0.76rem; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; padding-left: 8px; transition: color 160ms ease, border-color 160ms ease; }
    .wall-toc a:hover { color: #e8e2d4; }
    .wall-toc a.active { color: var(--gold, #e4bf83); border-left-color: var(--gold, #e4bf83); }
}

/* ============================================================
   ALIVE AT REST (motion-study fix): the plates breathe like
   candlelit canvas — a slow Ken-Burns drift + irregular flicker.
   ============================================================ */
@keyframes tnbr-candleflicker {
    0%, 100% { filter: var(--plate-filter, none) brightness(1); }
    7%  { filter: var(--plate-filter, none) brightness(1.04); }
    11% { filter: var(--plate-filter, none) brightness(0.985); }
    23% { filter: var(--plate-filter, none) brightness(1.02); }
    41% { filter: var(--plate-filter, none) brightness(0.975); }
    58% { filter: var(--plate-filter, none) brightness(1.05); }
    73% { filter: var(--plate-filter, none) brightness(0.99); }
    86% { filter: var(--plate-filter, none) brightness(1.03); }
}
@keyframes tnbr-kenburns {
    0%   { transform: scale(1.02) translate(0, 0); }
    100% { transform: scale(1.09) translate(-1.6%, -1.2%); }
}
@media (prefers-reduced-motion: no-preference) {
    @keyframes tnbr-candleflicker-unused {
        0%, 100% { filter: var(--plate-filter, none) brightness(1); }
        7%  { filter: var(--plate-filter, none) brightness(1.04); }
        11% { filter: var(--plate-filter, none) brightness(0.985); }
        23% { filter: var(--plate-filter, none) brightness(1.02); }
        41% { filter: var(--plate-filter, none) brightness(0.975); }
        58% { filter: var(--plate-filter, none) brightness(1.05); }
        73% { filter: var(--plate-filter, none) brightness(0.99); }
        86% { filter: var(--plate-filter, none) brightness(1.03); }
    }
    .career-page .career-hero::before,
    .finance-page .workspace-hero::before,
    .brain-page .workspace-hero::before,
    .polymath-vault-page .vault-hero::before,
    .tracker-page:not(.finance-page):not(.brain-page) > .workspace-hero::before,
    .workspace-shell.week-focus-mode .roadmap-v2-shell.current::before {
        animation:
            tnbr-kenburns 48s ease-in-out infinite alternate,
            tnbr-candleflicker 9s steps(1, end) infinite;
        will-change: transform, filter;
    }
}

/* Force-motion override: the OS reduced-motion setting is respected only if
   the user hasn't chosen full motion (localStorage putnam-motion !== "reduced"
   -> html.force-motion, set in <head> before first paint). Duplicates the
   motion-gated rules for the reduce+force case. */
@media (prefers-reduced-motion: reduce) {
    html.force-motion { scroll-behavior: smooth; }
    html.force-motion button:active:not(:disabled),
    html.force-motion .action-button:active,
    html.force-motion .ghost-button:active,
    html.force-motion .lane-tile:active,
    html.force-motion .site-mode-switch a:active { transform: scale(0.97); }
    html.force-motion .workspace-card { transition: transform 250ms ease, box-shadow 250ms ease; }
    html.force-motion .workspace-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38); }
    html.force-motion .dev-module:hover { border-color: rgba(228, 191, 131, 0.3); transform: none; }
    html.force-motion .folio-week:hover { transform: translateY(-2px); }
    html.force-motion .roadmap-next-cta-go:hover { transform: scale(1.05); background: #f3ead7; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); }
    html.force-motion .roadmap-next-cta-go:hover::before { transform: translate(0, 0) scale(2.5); }
    html.force-motion .roadmap-next-cta-go:active { transform: scale(0.95); }
    html.force-motion .career-page .career-hero::before,
    html.force-motion .finance-page .workspace-hero::before,
    html.force-motion .brain-page .workspace-hero::before,
    html.force-motion .polymath-vault-page .vault-hero::before,
    html.force-motion .tracker-page:not(.finance-page):not(.brain-page) > .workspace-hero::before,
    html.force-motion .workspace-shell.week-focus-mode .roadmap-v2-shell.current::before {
        animation: tnbr-kenburns 48s ease-in-out infinite alternate, tnbr-candleflicker 9s steps(1, end) infinite;
        will-change: transform, filter;
    }
}
@media (prefers-reduced-motion: reduce) and (pointer: fine) {
    html.force-motion .tnbr-cursor-glow {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 560px;
        height: 560px;
        margin: -280px 0 0 -280px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(233, 199, 138, 0.10) 0%, rgba(233, 199, 138, 0.045) 38%, transparent 68%);
        mix-blend-mode: screen;
        pointer-events: none;
        z-index: 90;
    }
}

/* ====== Goal 10 bucket 3 — usamo division-page adoptions (refs 11-13, 18-19) ====== */
.roadmap-start-cta { display: flex; align-items: center; gap: 0.6rem; width: 100%; margin: 14px 0 4px; padding: 13px 18px; border-radius: 10px; background: linear-gradient(90deg, #f3ead7, #e4bf83); color: #241c10; font-weight: 700; text-decoration: none; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4); }
.roadmap-start-cta .roadmap-start-kicker { font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.13em; }
.roadmap-start-cta .roadmap-start-label { flex: 1; font-size: 1.04rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .roadmap-start-cta { flex-wrap: wrap; } .roadmap-start-cta .roadmap-start-label { flex-basis: 100%; white-space: normal; overflow: visible; } }
.roadmap-start-cta .roadmap-start-week { font-size: 0.8rem; opacity: 0.72; font-weight: 600; white-space: nowrap; }
.roadmap-start-cta .roadmap-start-arrow { font-size: 1.15rem; transition: transform 200ms ease; }
.roadmap-start-cta:hover { filter: brightness(1.045); }
.roadmap-start-cta:hover .roadmap-start-arrow { transform: translateX(4px); }
.roadmap-start-cta:active { transform: scale(0.988); }
.roadmap-start-cta.done { background: linear-gradient(90deg, #17321f, #1d4127); color: var(--gold, #e4bf83); justify-content: center; }
.roadmap-phase-rings { display: flex; gap: 20px; flex-wrap: wrap; margin: 13px 0 0; }
.phase-ring { display: flex; align-items: center; gap: 9px; }
.phase-ring svg { width: 44px; height: 44px; }
.phase-ring .pr-bg { fill: none; stroke: rgba(228, 191, 131, 0.14); stroke-width: 3.4; }
.phase-ring .pr-fill { fill: none; stroke: var(--seg, var(--gold, #e4bf83)); stroke-width: 3.4; stroke-linecap: round; }
.phase-ring .pr-num { fill: #f3f6fb; font-size: 11px; text-anchor: middle; font-weight: 700; }
.phase-ring b { display: block; font-size: 0.82rem; color: #f3f6fb; }
.phase-ring small { color: #8fa1b8; font-size: 0.72rem; }
.roadmap-week-dots { display: flex; align-items: center; margin: 10px 0 0; }
.rw-dot { position: relative; flex: 1; height: 28px; min-width: 28px; display: flex; align-items: center; }
.rw-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(228, 191, 131, 0.16); }
.rw-dot::after { content: ""; position: relative; z-index: 1; width: 9px; height: 9px; margin: 0 auto; border-radius: 50%; background: #1b2536; border: 1px solid rgba(228, 191, 131, 0.35); transition: transform 160ms ease; }
.rw-dot.started::after { background: #6e5a36; }
.rw-dot.done::after { background: var(--gold, #e4bf83); border-color: var(--gold, #e4bf83); }
.rw-dot.current::after { background: #0f1626; border-color: var(--gold, #e4bf83); box-shadow: 0 0 0 3px rgba(228, 191, 131, 0.25), 0 0 12px rgba(228, 191, 131, 0.5); }
.rw-dot:hover::after { transform: scale(1.55); }
@media (max-width: 720px) { .roadmap-week-dots { flex-wrap: wrap; } .rw-dot { min-width: 24px; } }
/* Tenebrist dropdown recipe — the Tippy scale-subtle pattern transposed
   (design.md §7). Add .tnbr-pop to any click-popover to adopt it. */
@keyframes tnbrPopIn { from { opacity: 0; transform: translateY(-4px) scale(0.96); } to { opacity: 1; transform: none; } }
.roadmap-search-results:not([hidden]), .tnbr-pop { transform-origin: top left; animation: tnbrPopIn 160ms cubic-bezier(0.22, 1, 0.36, 1); }

/* ====== deep passes 3-4: daily-surface + modal polish ====== */
/* next gate: unmistakable at scan distance */
.roadmap-gate.next { border-left: 3px solid var(--gold, #e4bf83); background: linear-gradient(90deg, rgba(228, 191, 131, 0.07), transparent 40%); }
.roadmap-gate.next > summary { background: rgba(228, 191, 131, 0.05); }
.gate-next-pill { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--gold, #e4bf83); color: #241c10; font: 700 0.62rem "Manrope", sans-serif; letter-spacing: 0.14em; font-style: normal; vertical-align: 2px; }
/* done gate: quiet persistent wash */
.roadmap-gate.complete > summary { background: rgba(170, 158, 96, 0.07); }
/* secondary action button exists now */
.action-button.secondary { background: transparent; color: var(--gold, #e4bf83); border: 1px solid rgba(228, 191, 131, 0.35); box-shadow: none; }
.action-button.secondary:hover { border-color: var(--gold, #e4bf83); background: rgba(228, 191, 131, 0.08); }
/* folio corners: stop colliding on phones */
@media (max-width: 520px) { .folio-corner { display: none; } }

/* modal polish (visual only — behavior untouched) */
:is(.gam-toolkit-shell, .gam-ladder-shell, .gam-srs-shell, .gam-mockday-shell, .gam-flashcard-shell, .gam-case-shell) .gam-drill-close { position: static; width: 36px; height: 36px; padding: 0; flex: 0 0 auto; }
body:has(.gam-battle-mode, .gam-drill, .gam-ai-modal, .gam-ai-tutor, .gam-toolkit-modal, .gam-ladder-modal, .gam-srs-modal, .gam-mockday-modal, .gam-case-modal) { overflow: hidden; }
.gam-battle-mode, .gam-drill, .gam-ai-modal, .gam-ai-tutor, .gam-toolkit-modal, .gam-ladder-modal, .gam-srs-modal, .gam-mockday-modal, .gam-case-modal { overscroll-behavior: contain; }
.gam-battle-header { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; align-items: center; gap: 12px; }
.gam-battle-header > :first-child { min-width: 0; }
.gam-battle-prompt { border: none !important; box-shadow: none !important; background: transparent !important; margin: 16px 0 0 !important; }
.gam-battle-prompt .katex-display { margin: 12px 0; }
.gam-anscheck-row input { min-width: 0; }
.gam-anscheck-row button { flex: 0 0 auto; }
@media (max-width: 560px) { .gam-anscheck-row { flex-wrap: wrap; } }
/* grade buttons escalate */
[data-gam-fc-grade="again"], [data-gam-srs-rate="again"] { border-color: rgba(217, 138, 138, 0.55) !important; color: #d98a8a !important; }
[data-gam-fc-grade="hard"], [data-gam-srs-rate="hard"] { border-color: rgba(228, 191, 131, 0.45) !important; color: #e4bf83 !important; }
[data-gam-fc-grade="easy"], [data-gam-srs-rate="easy"] { border-color: rgba(123, 198, 170, 0.5) !important; color: #7bc6aa !important; }
/* flashcard reveal settles instead of jumping */
@media (prefers-reduced-motion: no-preference) {
  .gam-flashcard-back, .gam-sf-a { animation: gamRevealIn 220ms ease; }
}
html.force-motion .gam-flashcard-back, html.force-motion .gam-sf-a { animation: gamRevealIn 220ms ease; }
@keyframes gamRevealIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ====== deep pass 7: mobile ====== */
@media (max-width: 760px) {
    /* shell is already a 1fr grid at this width; order alone reflows it */
  .workspace-main { order: 1; }
  .workspace-sidebar { order: 2; }
}
@media (max-width: 640px) {
  .roadmap-next-cta-body small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ====== deep passes 11-15: secondary routes + chrome ====== */
/* P12: repair before accounting — the due queue leads */
.review-page { display: flex; flex-direction: column; }
.review-page > .review-dashboard-panel { order: 2; }
/* P14: archive rows breathe horizontally on desktop */
@media (min-width: 761px) {
  .gam-archive-row-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
}
/* P14: topic chips become a scroll strip instead of a wall */
.gam-archive-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; } .gam-archive-chips .gam-chip { flex: 0 0 auto; }
/* P15: chrome zones — notifications sit below the XP flash corner */
.gam-notif { top: 88px; }

/* ============ W69 — printable protocol (trainer: mock records, plans) ============ */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; }
  .workspace-sidebar, nav, canvas, .gam-fab, .gam-toast, audio, video,
  [class*="ember"], [class*="tnbr-plate"], .hero-plate { display: none !important; }
  main, section, .panel, [class*="card"] { background: #fff !important; color: #111 !important; border-color: #ccc !important; box-shadow: none !important; }
  h1, h2, h3, h4 { color: #000 !important; break-after: avoid; }
  a { color: #111 !important; text-decoration: none; }
  .katex { color: #000 !important; }
  .katex-display { overflow: visible !important; break-inside: avoid; }
  button, input[type="range"] { display: none !important; }
  input[type="checkbox"] { display: inline-block !important; }
  /* mock records and postmortems print as flat documents */
  .gam-modal, .gam-overlay, [class*="mock"], [class*="postmortem"] { position: static !important; max-height: none !important; overflow: visible !important; }
}
