:root {
  color-scheme: dark;
  --ink: #f4f7f4;
  --muted: #9eb0bc;
  --muted-2: #9aafbc;
  --base: #06111a;
  --base-2: #091823;
  --panel: #0c202c;
  --panel-2: #102936;
  --line: rgba(171, 211, 226, .16);
  --line-strong: rgba(171, 211, 226, .28);
  --sky: #55c8ef;
  --sky-strong: #87dcf7;
  --amber: #f0b65d;
  --danger: #ff8e7c;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--base); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background:
  linear-gradient(rgba(85,200,239,.025) 1px, transparent 1px),
  linear-gradient(90deg, rgba(85,200,239,.025) 1px, transparent 1px),
  radial-gradient(circle at 18% -10%, rgba(25,119,155,.22), transparent 38rem), var(--base);
  background-size: 48px 48px, 48px 48px, auto;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, dialog:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 50; padding: .75rem 1rem; background: var(--sky); color: #041016; border-radius: 4px; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem clamp(1rem, 4vw, 4.5rem); border-bottom: 1px solid var(--line); background: rgba(6,17,26,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-align: left; border: 0; padding: 0; background: none; cursor: pointer; }
.brand b, .brand small { display: block; line-height: 1.05; }
.brand b { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; }
.brand small { color: var(--muted); margin-top: .2rem; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; display: block; object-fit: contain; flex-shrink: 0; }
.top-actions { display: flex; align-items: center; gap: 1.25rem; }
.review-date { color: var(--muted); font-size: .8rem; letter-spacing: .04em; }
.quiet-button, .text-button, .back-button { border: 0; background: none; color: var(--sky-strong); cursor: pointer; padding: .65rem .35rem; }
.quiet-button { color: var(--ink); border-bottom: 1px solid var(--line-strong); }
main { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; flex: 1; }
.view { padding: clamp(2.25rem, 6vw, 6rem) 0 4rem; }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr); gap: clamp(2rem, 7vw, 8rem); align-items: end; }
.eyebrow { margin: 0 0 1rem; color: var(--sky-strong); text-transform: uppercase; letter-spacing: .15em; font-size: .78rem; font-weight: 700; }
.eyebrow span { display: inline-block; width: 24px; height: 1px; background: var(--sky); vertical-align: middle; margin-right: .55rem; }
h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 6.2rem); line-height: .92; letter-spacing: -.055em; max-width: 900px; }
h1 em { color: var(--sky); font-style: normal; font-weight: 400; }
.intro-copy { border-left: 1px solid var(--line-strong); padding-left: clamp(1.25rem, 3vw, 2.5rem); color: #cad5da; font-size: 1.05rem; line-height: 1.65; }
.disclaimer-short { color: var(--muted); font-size: .9rem; }
.disclaimer-short strong { color: var(--amber); }
.selection-bar { margin: clamp(2.5rem, 5vw, 4.5rem) 0 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 1rem 1rem 1.25rem; background: var(--panel); border: 1px solid var(--line-strong); border-left: 3px solid var(--sky); border-radius: var(--radius); }
.selection-bar .label { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .13em; margin-bottom: .2rem; }
.selection-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.primary-button, .secondary-button, .study-controls button, .completion-actions button { min-height: 46px; border-radius: 6px; padding: .75rem 1rem; border: 1px solid var(--line-strong); cursor: pointer; font-weight: 700; }
.primary-button { background: var(--sky); color: #04131b; border-color: var(--sky); }
.secondary-button { background: transparent; color: var(--ink); }
button:disabled { opacity: .42; cursor: not-allowed; }
.topic-fieldset { border: 0; padding: 0; margin: 0; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.category-card { min-height: 210px; padding: 1.35rem; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(8,25,36,.72); position: relative; display: flex; flex-direction: column; transition: background .18s ease, transform .18s ease; }
.category-card:hover { background: var(--panel); }
.category-card:has(input:checked) { background: linear-gradient(145deg, rgba(85,200,239,.13), rgba(10,32,44,.94)); box-shadow: inset 0 -3px 0 var(--sky); }
.category-card input { position: absolute; inset: 1rem 1rem auto auto; width: 22px; height: 22px; accent-color: var(--sky); }
.category-index { color: var(--muted-2); font: 700 .75rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.category-card h3 { margin: auto 2.2rem .65rem 0; font-size: 1.22rem; line-height: 1.15; }
.category-card p { margin: 0 2rem 1rem 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.category-meta { display: flex; justify-content: space-between; color: var(--sky-strong); font: 700 .75rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.category-meta .supplemental { color: var(--amber); }

.custom-view { width: min(980px, 100%); margin: 0 auto; }
.custom-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(2rem, 5vw, 4rem); }
.custom-context { text-align: right; }
.custom-context span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.custom-context strong { font: 700 1rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.custom-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr); gap: 2rem; align-items: end; margin-bottom: 2rem; }
.custom-intro h2 { margin: 0; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: .95; letter-spacing: -.045em; }
.custom-intro > p { margin: 0; padding-left: 1.5rem; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 1rem; line-height: 1.6; }
.custom-panel { border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(8,25,36,.72); overflow: hidden; }
.custom-panel-heading, .custom-category-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px; gap: 1.25rem; align-items: center; }
.custom-panel-heading { padding: .8rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); font: 700 .7rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.custom-panel-heading span:nth-child(n+2) { text-align: center; }
.custom-category-row { min-height: 76px; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); transition: background .16s ease; }
.custom-category-row:last-child { border-bottom: 0; }
.custom-category-row:focus-within { background: rgba(85,200,239,.06); }
.custom-category-row.has-error { background: rgba(255,142,124,.08); }
.custom-category-row label { display: flex; align-items: center; gap: .9rem; font-weight: 700; cursor: pointer; }
.custom-category-index { color: var(--muted-2); font: 700 .72rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.custom-available { color: var(--sky-strong); text-align: center; font: 700 .78rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.custom-count-wrap { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; color: var(--muted); font-size: .78rem; }
.custom-count-input { width: 84px; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--base-2); color: var(--ink); padding: .55rem .65rem; text-align: center; font-weight: 800; }
.custom-count-input[aria-invalid="true"] { border-color: var(--danger); }
.custom-error { margin: 1rem 0 0; padding: .8rem 1rem; border: 1px solid rgba(255,142,124,.36); border-radius: 6px; background: rgba(255,142,124,.08); color: #ffc2b8; }
.custom-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; }

.inspect-view, .flags-view { width: min(1060px, 100%); margin: 0 auto; }
.inspect-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(2rem, 5vw, 4rem); }
.inspect-context { text-align: right; }
.inspect-context span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.inspect-context strong { font: 700 1rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.inspect-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .65fr); gap: 2rem; align-items: end; margin-bottom: 2rem; }
.inspect-intro h2 { margin: 0; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: .95; letter-spacing: -.045em; }
.inspect-intro > p { margin: 0; padding-left: 1.5rem; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 1rem; line-height: 1.6; }
.inspect-actions, .flags-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin: -1rem 0 1.25rem; }
.inspect-actions span { margin-right: auto; color: var(--muted); font: 700 .78rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.flags-actions { margin-top: 0; }
.flags-empty { padding: 2rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.inspect-list { display: grid; gap: 1.25rem; }
.inspect-group { border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(8,25,36,.72); overflow: hidden; }
.inspect-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.inspect-group-heading h3 { margin: 0; font-size: 1.2rem; }
.inspect-group-heading span { color: var(--sky-strong); font: 700 .75rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.inspect-questions { list-style: none; padding: 0; margin: 0; }
.inspect-question { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; min-height: 96px; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); }
.inspect-question:last-child { border-bottom: 0; }
.inspect-card-id { display: block; margin-bottom: .35rem; color: var(--muted-2); font: 700 .75rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.inspect-question p { margin: 0; font-size: 1rem; line-height: 1.5; }
.inspect-question.is-flagged { background: rgba(255,142,124,.045); }
.inspect-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.inspect-bookmark, .inspect-flag { min-width: 132px; min-height: 44px; padding: .65rem .85rem; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font-weight: 700; }
.inspect-bookmark:hover, .inspect-flag:hover { background: var(--panel-2); }
.inspect-bookmark[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); }
.inspect-flag[aria-pressed="true"], .flag-button[aria-pressed="true"] { color: var(--danger)!important; border-color: var(--danger)!important; background: rgba(255,142,124,.07)!important; }
.danger-button { color: var(--danger); border-color: rgba(255,142,124,.5); }
.clipboard-fallback { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

.study-view { width: min(940px, 100%); margin: 0 auto; }
.study-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.back-button { color: var(--muted); }
.study-context { text-align: right; }
.study-context span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.study-context strong { font: 700 1rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.card-stage { perspective: 1400px; }
.flashcard { width: 100%; min-height: clamp(430px, 57vh, 620px); position: relative; border: 1px solid var(--line-strong); border-radius: 14px; padding: 0; background: transparent; cursor: pointer; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.75,.25,1); box-shadow: 0 30px 80px rgba(0,0,0,.32); }
.flashcard::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(85,200,239,.09); border-radius: 9px; pointer-events: none; z-index: 2; }
.flashcard.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(2rem, 7vw, 5.5rem); background: radial-gradient(circle at 50% 0, rgba(85,200,239,.08), transparent 40%), var(--panel); border-radius: 14px; overflow: auto; }
.card-back { transform: rotateY(180deg); background: radial-gradient(circle at 50% 110%, rgba(240,182,93,.08), transparent 42%), var(--panel-2); }
.card-topline { position: absolute; top: 1.5rem; left: 1.75rem; right: 1.75rem; display: flex; justify-content: space-between; color: var(--muted); font: 700 .78rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .1em; }
.prompt-label { color: var(--sky-strong); text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 800; margin-bottom: 1.4rem; }
.answer-label { color: var(--amber); }
.card-copy { display: block; max-width: 760px; font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1.24; letter-spacing: -.025em; text-align: center; white-space: pre-line; }
.answer-copy { font-size: clamp(1.15rem, 2.45vw, 1.85rem); line-height: 1.5; letter-spacing: -.012em; }
.flip-hint { position: absolute; bottom: 1.5rem; color: var(--muted); font-size: .8rem; }
kbd { display: inline-grid; place-items: center; min-width: 1.55rem; min-height: 1.45rem; padding: 0 .32rem; border: 1px solid var(--line-strong); border-radius: 4px; background: rgba(255,255,255,.04); font: 600 .72rem/1 ui-monospace, monospace; box-shadow: 0 1px 0 rgba(255,255,255,.1); }
.source-line { position: absolute; bottom: 1.5rem; left: 1.75rem; right: 1.75rem; color: var(--muted); font-size: .78rem; text-align: center; }
.source-line a { color: var(--sky-strong); }
.study-controls { display: grid; grid-template-columns: 1fr 1.2fr 1fr 1fr 1fr; gap: .65rem; margin-top: 1rem; }
.study-controls button { background: var(--panel); }
.study-controls .primary-button { background: var(--sky); }
.study-controls button[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); }
.shortcut-note { text-align: center; color: var(--muted-2); font-size: .75rem; }
.shortcut-note kbd { margin: 0 .2rem; }

.complete-view { text-align: center; min-height: 70vh; display: grid; place-content: center; justify-items: center; }
.complete-view[hidden] { display: none; }
.completion-ring { width: 108px; height: 108px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--sky); box-shadow: inset 0 0 0 10px rgba(85,200,239,.07); color: var(--sky); font-size: 2.3rem; margin-bottom: 2rem; }
.complete-view h2 { font-size: clamp(2.6rem, 7vw, 5.6rem); margin: 0; letter-spacing: -.05em; }
.complete-view > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; }
.completion-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }

footer { border-top: 1px solid var(--line); padding: 1.5rem clamp(1rem,4vw,4.5rem); color: var(--muted-2); font-size: .76rem; line-height: 1.5; }
footer p { max-width: 1050px; margin: 0 auto; }
dialog { width: min(760px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); color: var(--ink); background: var(--base-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,8,13,.78); backdrop-filter: blur(5px); }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.5rem; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 2rem; }
.dialog-header .eyebrow { margin-bottom: .5rem; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 1.7rem; }
.dialog-body { padding: 1.5rem; color: #c7d3d8; line-height: 1.55; }
.sources-list { display: grid; gap: .6rem; margin: 1.5rem 0; }
.source-item { border-left: 2px solid var(--line-strong); padding: .55rem 0 .55rem 1rem; }
.source-item a { color: var(--sky-strong); font-weight: 700; }
.source-item span { display: block; color: var(--muted); font-size: .83rem; margin-top: .18rem; }
.caution-note { border: 1px solid rgba(240,182,93,.34); background: rgba(240,182,93,.08); color: #ead9bb; padding: 1rem; border-radius: 7px; }

@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; align-items: start; gap: 2rem; }
  .intro-copy { max-width: 680px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .selection-bar { align-items: flex-start; flex-direction: column; }
  .selection-actions { justify-content: flex-start; }
  .inspect-intro { grid-template-columns: 1fr; align-items: start; }
  .inspect-intro > p { max-width: 680px; }
  .custom-intro { grid-template-columns: 1fr; align-items: start; }
  .custom-intro > p { max-width: 680px; }
}
@media (max-width: 620px) {
  .topbar { position: static; align-items: flex-start; }
  .review-date { display: none; }
  .quiet-button { font-size: .82rem; }
  main { width: min(100% - 1.2rem, 1240px); }
  .view { padding-top: 2.4rem; }
  h1 { font-size: clamp(2.65rem, 14vw, 4.5rem); }
  .intro-copy { border-left: 0; border-top: 1px solid var(--line-strong); padding: 1.2rem 0 0; }
  .selection-bar { margin-top: 2.25rem; }
  .selection-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .selection-actions .primary-button, .selection-actions .secondary-button { grid-column: 1 / -1; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 180px; }
  .custom-header { align-items: flex-start; }
  .custom-intro > p { border-left: 0; border-top: 1px solid var(--line-strong); padding: 1rem 0 0; }
  .custom-panel-heading { display: none; }
  .custom-category-row { grid-template-columns: minmax(0, 1fr) auto; gap: .45rem 1rem; padding: 1rem; }
  .custom-category-row label { align-self: end; }
  .custom-available { grid-column: 1; text-align: left; padding-left: 2.25rem; }
  .custom-count-wrap { grid-column: 2; grid-row: 1 / 3; }
  .custom-count-wrap span { display: none; }
  .custom-actions { align-items: stretch; flex-direction: column-reverse; }
  .custom-actions .primary-button { width: 100%; }
  .inspect-header { align-items: flex-start; }
  .inspect-intro > p { border-left: 0; border-top: 1px solid var(--line-strong); padding: 1rem 0 0; }
  .inspect-question { grid-template-columns: 1fr; gap: .8rem; }
  .inspect-card-actions { grid-template-columns: 1fr; }
  .inspect-bookmark, .inspect-flag { width: 100%; }
  .inspect-actions, .flags-actions { align-items: stretch; flex-direction: column; }
  .inspect-actions span { margin-right: 0; }
  .inspect-actions button, .flags-actions button { width: 100%; }
  .flashcard { min-height: 480px; }
  .card-face { padding: 4.6rem 1.35rem 4.2rem; }
  .card-topline { left: 1.25rem; right: 1.25rem; top: 1.25rem; }
  .source-line { left: 1.2rem; right: 1.2rem; bottom: 1.1rem; }
  .card-copy { font-size: clamp(1.55rem, 7.2vw, 2.2rem); }
  .answer-copy { font-size: clamp(1.05rem, 4.6vw, 1.35rem); }
  .study-controls { grid-template-columns: 1fr 1fr; }
  .study-controls .primary-button { grid-row: 1; grid-column: 1 / -1; }
  .study-controls .flag-button { grid-column: 1 / -1; }
  .shortcut-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}

/* Study workspace: flow-based cards, compact navigation, and portable progress. */
[hidden] { display: none!important; }
main:focus { outline: none; }
.topics-view { padding-top: 2.5rem; }
.intro-grid { grid-template-columns: minmax(0,1.2fr) minmax(280px,1fr); gap: 3rem; }
h1 { font-size: clamp(2.35rem,4.8vw,4.2rem); line-height: 1.03; letter-spacing: -.045em; }
.intro-copy { font-size: .98rem; line-height: 1.55; }
.selection-bar { margin-top: 1.8rem; }
.top-actions { gap: .7rem; flex-wrap: wrap; justify-content: flex-end; }
.label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .35rem; }
.resume-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; padding: 1rem 1.25rem; border: 1px solid rgba(240,182,93,.45); border-radius: var(--radius); background: rgba(240,182,93,.06); }
.resume-banner strong { font-size: .95rem; }
.resume-banner .primary-button { white-space: nowrap; }
.flashcard { min-height: 0; transform: none!important; transform-style: flat; transition: none; cursor: default; }
.flashcard::before { display: none; }
.card-face { position: relative; inset: auto; min-height: 360px; padding: 1.5rem 2.25rem; overflow: visible; transform: none!important; backface-visibility: visible; gap: 1.25rem; }
.card-topline { position: static; width: 100%; gap: 1rem; line-height: 1.5; align-items: flex-start; margin-bottom: auto; }
.card-topline > :last-child { white-space: nowrap; }
.prompt-label { margin: 0; }
.card-copy { font-size: clamp(1.5rem,3vw,2.5rem); overflow-wrap: anywhere; }
.answer-copy { font-size: clamp(1.1rem,2vw,1.6rem); line-height: 1.6; }
.source-line { position: static; display: block; width: 100%; font-size: .82rem; line-height: 1.6; overflow-wrap: anywhere; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.card-reveal { background: transparent; color: var(--sky-strong); border: 1px solid var(--line-strong); border-radius: 6px; padding: .7rem 1rem; min-height: 44px; margin-top: auto; cursor: pointer; }
.review-rating { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.review-rating > span { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.review-rating > div { display: flex; gap: .5rem; flex-shrink: 0; }
.review-rating button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: rgba(240,182,93,.06); }
.study-controls { margin-top: 0; }
.inspect-search { margin-bottom: 1.25rem; }
.inspect-search label, .backup-import label { display: block; font-weight: 700; margin-bottom: .65rem; }
.search-row { display: flex; gap: .6rem; }
.search-row input { min-width: 0; flex: 1; min-height: 46px; padding: .75rem 1rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; }
.inspect-search p { color: var(--muted); font-size: .85rem; margin-bottom: 0; }
.inspect-question { align-items: start; }
.inspect-question details { margin-top: .7rem; color: #c7d3d8; }
.inspect-question summary { color: var(--sky-strong); cursor: pointer; padding: .35rem 0; width: fit-content; }
.inspect-question details p { margin: .6rem 0; font-size: .95rem; }
.inspect-question details a { color: var(--sky-strong); font-size: .8rem; overflow-wrap: anywhere; }
.inspect-card-actions { padding-top: .25rem; }
.backup-import { margin-top: 1.5rem; }
.backup-import input { max-width: 100%; padding: .7rem 0; }
#backupStatus { color: var(--sky-strong); }
.save-notice { padding: 1rem; border: 1px solid var(--amber); color: var(--amber); border-radius: 6px; }
dialog { overflow-y: auto; }
.dialog-body { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .intro-copy { border: 0; padding-left: 0; max-width: 720px; }
  .study-controls { position: sticky; bottom: 0; z-index: 5; background: rgba(6,17,26,.97); padding: .75rem 0; }
}
@media (max-width: 620px) {
  .topbar { padding: .9rem .75rem; gap: .65rem; align-items: center; }
  .brand { gap: .5rem; }
  .brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
  .brand b { font-size: .72rem; }
  .brand small { font-size: .62rem; }
  .top-actions { gap: .1rem; flex-direction: column; align-items: flex-end; }
  .quiet-button { padding: .35rem; font-size: .75rem; min-height: 32px; }
  .topics-view { padding-top: 1.6rem; padding-bottom: 10rem; }
  h1 { font-size: clamp(2rem,9vw,3rem); }
  .intro-copy { padding: 0; }
  .disclaimer-short { font-size: .8rem; }
  .resume-banner { flex-direction: column; align-items: stretch; padding: 1rem; }
  .selection-bar { display: block; padding: .9rem; margin-top: 1.2rem; }
  .selection-bar > div:first-child { margin-bottom: .7rem; }
  .selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
  .selection-actions .secondary-button, .selection-actions .primary-button { grid-column: auto; padding: .6rem .4rem; min-width: 0; font-size: .8rem; }
  #startButton { grid-column: 1 / -1; }
  #customStudyButton { grid-column: 1 / -1; }
  #inspectButton, #startButton { position: fixed; bottom: max(.5rem,env(safe-area-inset-bottom)); width: calc(50% - 1rem); margin: 0; z-index: 15; box-shadow: 0 -4px 20px rgba(0,0,0,.5); background: var(--panel-2); }
  #inspectButton { left: .65rem; }
  #startButton { right: .65rem; background: var(--sky); }
  .category-card { min-height: 160px; padding: 1.1rem; }
  .category-card p { margin-right: .8rem; }
  .custom-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(6,17,26,.98); padding: .7rem .5rem; flex-direction: row; align-items: center; }
  .custom-actions .primary-button { width: auto; flex: 1; }
  .custom-actions .text-button { font-size: .8rem; }
  .custom-category-row { padding: .9rem .75rem; gap: .4rem .5rem; }
  .custom-category-row label { font-size: .9rem; gap: .5rem; }
  .custom-count-input { width: 65px; }
  .custom-available { padding-left: 1.8rem; }
  .study-view { padding-top: 1rem; }
  .card-face { min-height: 320px; padding: 1.2rem 1.1rem; gap: 1rem; }
  .card-topline { font-size: .67rem; letter-spacing: .04em; gap: .6rem; }
  .card-copy { font-size: 1.5rem; }
  .answer-copy { font-size: 1.08rem; }
  .source-line { font-size: .78rem; }
  .review-rating { flex-direction: column; align-items: stretch; gap: .6rem; }
  .review-rating > div { display: grid; grid-template-columns: 1fr 1fr; }
  .review-rating button { padding: .65rem .4rem; font-size: .85rem; }
  .study-controls { grid-template-columns: repeat(6,minmax(0,1fr)); gap: .4rem; }
  #prevButton { grid-row: 1; grid-column: 1 / 3; }
  .study-controls .primary-button { grid-row: 1; grid-column: 3 / 5; }
  #nextButton { grid-row: 1; grid-column: 5 / 7; }
  #bookmarkButton { grid-row: 2; grid-column: 1 / 4; }
  .study-controls .flag-button { grid-row: 2; grid-column: 4 / 7; }
  .study-controls button { padding: .65rem .4rem; font-size: .85rem; }
  .inspect-actions { margin-top: 0; }
  .inspect-card-actions { grid-template-columns: 1fr 1fr; }
  .inspect-bookmark, .inspect-flag { min-width: 0; font-size: .8rem; padding: .65rem .35rem; }
  .search-row { flex-wrap: wrap; }
  .search-row input { flex-basis: 100%; }
  .search-row button { padding: .5rem .8rem; font-size: .8rem; }
  footer { padding-bottom: 5rem; }
}

/* Public library: discoverable starting points and transparent review tools. */
.getting-started { margin-top: 2rem; padding: 1.4rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(12,32,44,.65); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-heading h2, .library-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
#librarySummary { color: var(--sky-strong); font: 700 .85rem ui-monospace, monospace; }
.help-copy { color: var(--muted); font-size: .9rem; line-height: 1.6; margin: .6rem 0 1rem; }
.starter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; }
.starter-card { text-align: left; display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--base-2); cursor: pointer; }
.starter-card:hover { border-color: var(--sky); background: var(--panel-2); }
.starter-card .label { color: var(--sky-strong); margin: 0; }
.starter-card strong { font-size: 1rem; }
.starter-card > span:last-child { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.library-search { margin-top: 1.2rem; }
.library-search label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .6rem; }
.library-heading { margin: 1.5rem 0 1rem; }
.inspect-filters { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.inspect-filters label { display: flex; align-items: center; gap: .6rem; font-size: .85rem; margin: 0; }
select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: .65rem; min-height: 44px; max-width: 100%; }
textarea { width: 100%; margin: .75rem 0; }
a:focus-visible, summary:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.backup-preview { border: 1px solid var(--amber); border-radius: 6px; padding: 1rem; margin-top: 1rem; }
.backup-preview label { display: flex; align-items: flex-start; gap: .5rem; }
.backup-preview input { width: 20px; height: 20px; flex-shrink: 0; }
.aircraft-notice { padding: .8rem 1rem; border-left: 3px solid var(--amber); color: var(--amber); background: rgba(240,182,93,.06); font-size: .85rem; line-height: 1.5; }
.flags-actions { flex-wrap: wrap; }
#flagCopyStatus { color: var(--sky-strong); }
.inspect-group { content-visibility: auto; contain-intrinsic-size: auto 400px; }
.category-card { cursor: pointer; }
.category-meta { gap: .5rem; line-height: 1.4; flex-wrap: wrap; }
.category-card:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: -3px; }
footer p + p { margin-top: .8rem; }
@media (max-width: 900px) {
  .inspect-question { grid-template-columns: minmax(0,1fr); }
  .inspect-card-actions { width: 100%; }
}
@media (max-width: 700px) {
  .starter-grid { grid-template-columns: 1fr; }
  .starter-card { gap: .35rem; }
  .getting-started { padding: 1rem; }
  .inspect-filters { flex-direction: column; align-items: stretch; }
  .inspect-filters label { justify-content: space-between; }
  .library-search .search-row { flex-wrap: wrap; }
  .library-search input { flex-basis: 100%; }
  .library-search button { width: 100%; }
}
@media (max-width: 620px) {
  body:not(.has-selection) #inspectButton, body:not(.has-selection) #startButton { position: static; width: auto; box-shadow: none; }
  .quiet-button { min-height: 44px; }
  .dialog-actions > button { width: 100%; }
  .flags-actions { justify-content: stretch; }
  .flags-actions button { flex: 1 1 130px; }
}

/* Study dashboard and library tools. */
.learning-panel { margin: .5rem 0 1.5rem; padding: 1.25rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: linear-gradient(135deg,rgba(85,200,239,.09),var(--panel)); }
.learning-panel h2 { font-size: 1.5rem; }
.learning-stats { margin: .7rem 0 1rem; color: var(--sky-strong); font-size: 1.1rem; font-weight: 700; }
.learning-actions, .session-options, .library-filters, .saved-mixes, .card-secondary-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; }
.schedule-help { margin-top: 1rem; color: var(--muted); font-size: .85rem; line-height: 1.6; }
.schedule-help summary { cursor: pointer; width: fit-content; padding: .4rem 0; }
.resume-banner { margin: 0 0 1.2rem; }
.intro-details { margin: 1.4rem 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.2rem 1.2rem; }
.intro-details > summary { font-weight: 700; color: var(--sky-strong); padding: 1rem 0; cursor: pointer; }
.intro-details:not([open]) { padding-bottom: 0; }
.intro-details .intro-grid { margin-top: .5rem; }
.intro-details .getting-started { border: none; margin-top: 1rem; padding: 1rem 0 0; background: none; }
.library-search { margin: 1rem 0; }
.library-filters, .session-options { margin: 1rem 0; padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.library-filters label, .session-options label, .saved-mixes label { display: flex; flex-direction: column; gap: .5rem; font-size: .85rem; font-weight: 600; flex: 1 1 170px; }
.library-filters input, .saved-mixes input { background: var(--base-2); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; padding: .65rem; min-height: 44px; min-width: 0; width: 100%; }
#topicFilterStatus { font-size: .8rem; color: var(--muted); padding-bottom: .8rem; }
.saved-mixes { margin-bottom: 1.2rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: 7px; }
.saved-mixes > p { flex-basis: 100%; margin: 0; color: var(--sky-strong); }
.category-progress { order: 5; margin-top: .65rem; padding-top: .6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.4; }
.category-card { min-height: 235px; }
.practice-figure { width: 100%; margin: .75rem 0; }
.practice-figure img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; background: #f6f8fa; border-radius: 6px; }
.practice-figure figcaption { margin: .5rem 0; font-size: .75rem; line-height: 1.5; color: var(--muted); }
.source-review { display: block; font-size: .75rem!important; line-height: 1.5; color: var(--muted); margin: .6rem 0 0; }
.card-link { color: var(--sky-strong); padding: .65rem .5rem; font-size: .85rem; text-align: center; align-self: center; }
.inspect-card-actions .text-button { font-size: .8rem; }
.card-secondary-actions { justify-content: center; margin-top: .65rem; align-items: center; font-size: .85rem; }
.card-secondary-actions span { color: var(--sky-strong); overflow-wrap: anywhere; }
.undo-notice { padding: .65rem 1rem; margin-bottom: .8rem; border: 1px solid var(--amber); border-radius: 6px; color: var(--amber); }
.inbox-report { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.inbox-report a { color: var(--sky-strong); font-weight: 700; }
.inbox-report p { white-space: pre-wrap; }
#syncStatus, #reportStatus { color: var(--sky-strong); line-height: 1.6; }
#syncSignIn, #reportSignIn { display: inline-block; color: var(--sky-strong); padding: .7rem 0; }
#reportForm label { display: block; font-weight: 700; }
#reportConcern { resize: vertical; }
@media (max-width: 620px) {
  .learning-panel { padding: 1rem; }
  .learning-stats { font-size: .95rem; line-height: 1.6; }
  .learning-actions { display: grid; grid-template-columns: 1fr; }
  .learning-actions button { width: 100%; }
  .intro-details { padding-left: .8rem; padding-right: .8rem; }
  .library-filters, .session-options { padding: .8rem; gap: .8rem; }
  .library-filters label, .session-options label { flex-basis: 100%; }
  #topicFilterStatus { padding: 0; }
  .saved-mixes { align-items: stretch; }
  .saved-mixes label { flex-basis: 100%; }
  .saved-mixes button { flex: 1 1 100px; }
  .category-card { min-height: 195px; }
}

/* A quieter homepage: choose topics first, reveal tools when needed. */
body { min-width: 300px; }
.topbar { z-index: 30; }
.tools-menu { position: relative; }
.tools-menu > summary { min-height: 44px; display: flex; align-items: center; gap: .6rem; padding: .65rem .85rem; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; font-size: .85rem; font-weight: 600; list-style: none; }
.tools-menu > summary::-webkit-details-marker { display: none; }
.tools-menu > summary::after { content: '⌄'; color: var(--sky); }
.tools-menu[open] > summary { border-color: var(--sky); }
.tools-popover { position: absolute; right: 0; top: calc(100% + .6rem); width: 360px; max-width: calc(100vw - 1.5rem); max-height: calc(100dvh - 110px); overflow: auto; padding: 1rem; background: var(--base-2); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 12px 35px rgba(0,0,0,.4); }
.tools-popover .library-search { margin: 0 0 .8rem; }
.tools-popover .search-row { display: flex; flex-wrap: nowrap; gap: .4rem; }
.tools-popover .search-row input { flex: 1; width: 0; min-width: 0; }
.tools-popover .search-row button { flex: 0 0 auto; width: auto; }
.tools-links { display: grid; border-top: 1px solid var(--line); padding-top: .5rem; }
.tools-links .quiet-button { text-align: left; border: 0; padding: .7rem .5rem; min-height: 44px; font-size: .85rem; border-radius: 4px; }
.tools-links .quiet-button:hover:not(:disabled) { background: var(--panel-2); }
.tools-popover .review-date { display: block; margin-top: .7rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .72rem; }
.topics-view { padding-top: clamp(1.7rem,4vw,3rem); }
.home-intro { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.home-intro h1 { font-size: clamp(1.8rem,3.2vw,2.65rem); line-height: 1.12; letter-spacing: -.035em; }
.home-intro p { margin: .65rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.home-intro #librarySummary { font-family: inherit; font-size: .8rem; font-weight: 500; line-height: 1.4; white-space: nowrap; color: var(--muted); }
.home-disclosures { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.home-disclosures > details { flex: 1 1 180px; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 0 .95rem; margin: 0; background: rgba(8,25,36,.35); }
.home-disclosures > details > summary { padding: .8rem 0; font-size: .85rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.home-disclosures > details > summary:hover { color: var(--ink); }
.home-disclosures > details[open] { flex-basis: 100%; }
.home-disclosures .getting-started { margin: 0; padding: 0 0 .9rem; }
.home-disclosures .help-copy { margin: 0 0 .8rem; font-size: .85rem; }
.home-disclosures .starter-card { padding: .85rem; gap: .4rem; }
.home-disclosures .starter-card strong { font-size: .9rem; }
.home-disclosures .starter-card > span:last-child { color: var(--sky); }
.home-disclosures .learning-panel { background: none; border: 0; margin: 0; padding: 0 0 .9rem; }
.home-disclosures .learning-stats { margin: 0 0 .8rem; font-size: .9rem; }
#reviewQueueSummary, #sessionOptionsState { color: var(--sky-strong); font-size: .75rem; }
.topics-view .library-filters { padding: 0; border: 0; background: none; gap: .7rem 1rem; margin: 1.2rem 0 .1rem; }
.topics-view .library-filters label { flex: 1 1 170px; gap: .4rem; font-size: .8rem; }
.topics-view #topicFilterStatus { flex-basis: 100%; padding: 0; font-size: .75rem; }
.topic-utilities { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; }
.topic-utilities .text-button { font-size: .8rem; padding: .65rem .35rem; min-height: 44px; }
.topic-utilities .text-button + .text-button { margin-left: .6rem; }
.session-settings > summary { font-size: .8rem; color: var(--muted); cursor: pointer; padding: .7rem .25rem; min-height: 44px; }
.session-settings[open] { flex-basis: 100%; order: 2; }
.session-settings .session-options { margin: .3rem 0; }
.session-settings > .help-copy { margin: .5rem 0; font-size: .8rem; }
.topics-view .selection-bar { margin: .6rem 0 1rem; padding: .75rem .9rem; position: sticky; top: 76px; z-index: 8; gap: .6rem; flex-direction: row; align-items: center; }
.selection-bar strong { font-size: .85rem; font-weight: 500; }
.selection-actions #customStudyButton { font-size: .82rem; min-height: 44px; }
.topics-view .category-grid { gap: .65rem; border: 0; grid-template-columns: repeat(3,minmax(0,1fr)); }
.topics-view .category-card { min-height: 155px; padding: 1rem; border: 1px solid var(--line); border-radius: 7px; }
.topics-view .category-index, .topics-view .category-meta > span:nth-child(2) { display: none; }
.topics-view .category-card h3 { font-size: 1rem; line-height: 1.25; margin: 0 1.75rem .55rem 0; }
.topics-view .category-card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 .8rem; font-size: .8rem; line-height: 1.45; }
.topics-view .category-meta { margin-top: auto; font-size: .7rem; color: var(--sky-strong); }
.topics-view .category-progress { margin-top: .55rem; padding-top: .5rem; font-size: .7rem; }
.home-study-note { color: var(--muted); font-size: .75rem; line-height: 1.5; margin-top: 1.2rem; }
.aircraft-section { margin-top: 2.3rem; padding-top: 1.4rem; border-top: 1px solid var(--line-strong); }
.aircraft-section .section-heading h2 { font-size: 1.5rem; }
#aircraftSummary { font-size: .8rem; color: var(--muted); }
.aircraft-section > .help-copy { max-width: 800px; margin: .6rem 0 1rem; }
.topics-view .aircraft-section .category-card p { -webkit-line-clamp: unset; }
.topics-view .aircraft-section .category-card { min-height: 185px; }
.topics-view .resume-banner { padding: .85rem 1rem; margin-bottom: 1rem; }
.topics-view .resume-banner > div { min-width: 0; }
@media (max-width: 900px) {
  .home-intro { align-items: flex-start; flex-direction: column; gap: .6rem; }
  .topics-view .category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .selection-actions { gap: .4rem; }
}
@media (max-width: 620px) {
  .topbar { min-height: 72px; }
  .topics-view { padding-top: 1.6rem; }
  .home-intro { margin-bottom: 1rem; }
  .home-intro h1 { max-width: 340px; font-size: 1.85rem; }
  .home-intro p { font-size: .85rem; max-width: 320px; }
  .home-intro #librarySummary { font-size: .75rem; }
  .home-disclosures { gap: .5rem; }
  .home-disclosures > details { flex-basis: 140px; padding: 0 .75rem; }
  .home-disclosures > details > summary { font-size: .78rem; min-height: 44px; }
  .home-disclosures > details[open] { flex-basis: 100%; }
  .topics-view .library-filters label { flex: 1 1 130px; min-width: 0; }
  .topics-view .library-filters select, .topics-view .library-filters input { font-size: .8rem; }
  .topics-view .selection-bar { position: static; display: flex; flex-direction: column; align-items: stretch; padding: .6rem .75rem; }
  .selection-bar > div:first-child { margin: 0; }
  .selection-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; }
  .selection-actions #customStudyButton { margin-right: auto; }
  .selection-actions #inspectButton, .selection-actions #startButton { font-size: .8rem; }
  .topics-view .category-grid { gap: .5rem; }
  .topics-view .category-card { padding: .85rem .7rem; min-height: 155px; }
  .topics-view .category-card input { top: .75rem; right: .6rem; width: 19px; height: 19px; }
  .topics-view .category-card h3 { font-size: .9rem; margin-right: 1.3rem; }
  .topics-view .category-card p { font-size: .75rem; }
  .topics-view .resume-banner { flex-direction: row; align-items: center; gap: .6rem; padding: .75rem; }
  .topics-view .resume-banner .label { font-size: .65rem; }
  .topics-view .resume-banner strong { font-size: .8rem; }
  .topics-view .resume-banner button { font-size: .75rem; padding: .6rem; }
}
@media (max-width: 360px) {
  .topics-view .resume-banner { flex-direction: column; align-items: stretch; }
  .home-disclosures > details { flex-basis: 120px; }
  .topics-view .category-grid { grid-template-columns: 1fr; }
}
