:root {
  color-scheme: dark;
  --med-bg: #000000;
  --med-panel: #0b111b;
  --med-panel-2: #111b29;
  --med-text: #f3f6fc;
  --med-muted: #94a3b8;
  --med-border: rgba(148, 163, 184, 0.17);
  --med-accent: #2dd4bf;
  --med-accent-2: #c4b5fd;
  --med-green: #54e0b4;
  --med-red: #ff8497;
  --med-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 70% -20%, rgba(167, 139, 250, .08), transparent 50%), var(--med-bg); color: var(--med-text); }
body[data-theme="CLASSIC"] {
  color-scheme: light;
  --med-bg: #f8fbff; --med-panel: #fff; --med-panel-2: #eef4ff;
  --med-text: #102a43; --med-muted: #52657d; --med-border: rgba(11, 74, 168, .16);
  --med-accent: #0b56c5; --med-accent-2: #7c3aed; --med-green: #087e5a; --med-red: #bd334c;
  --med-shadow: 0 22px 60px rgba(53, 35, 76, .12);
  background: radial-gradient(ellipse at 70% -20%, rgba(192, 132, 252, .17), transparent 50%), var(--med-bg);
}
button, select, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.med-app { min-height: 100vh; }
.med-app-locked { overflow: hidden; }
.med-app-locked .med-app { pointer-events: none; }
.med-header { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 76px; padding: 14px 24px; border-bottom: 1px solid var(--med-border); background: color-mix(in srgb, var(--med-bg) 89%, transparent); backdrop-filter: blur(18px); }
.med-logo { flex: none; color: var(--med-text); text-decoration: none; font-size: 1.4rem; font-weight: 950; letter-spacing: -.06em; }
.med-logo span { color: var(--med-accent); }
.menu-pill { min-height: 42px; display: inline-flex; align-items: center; padding: 9px 13px; border: 1px solid var(--med-border); border-radius: 999px; color: var(--med-muted); text-decoration: none; font-size: .8rem; font-weight: 800; }
.med-nav { display: flex; align-items: center; gap: 5px; }
.med-nav button, .theme-toggle, .memory-pill { min-height: 42px; padding: 9px 13px; border: 1px solid var(--med-border); border-radius: 999px; background: transparent; color: var(--med-muted); cursor: pointer; font-size: .78rem; font-weight: 750; }
.med-nav button:hover, .med-nav button:focus-visible, .theme-toggle:hover, .memory-pill:hover { border-color: var(--med-border); color: var(--med-text); outline: none; }
.med-nav button.nav-active { background: var(--med-panel-2); color: var(--med-text); }
.due-badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 4px; padding: 0 5px; border-radius: 20px; background: var(--med-accent); color: #1d0b2b; font-size: .7rem; }
.med-head-tools { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.access-badge { padding: 8px 12px; border: 1px solid var(--med-border); border-radius: 999px; color: var(--med-green); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.theme-toggle { border-color: var(--med-border); }
.memory-pill { border-color: var(--med-border); font-weight: 850; }
.med-main { width: min(100% - 36px, 1040px); margin: 0 auto; padding: clamp(28px, 6vw, 64px) 0 32px; }
.hero-card { position: relative; overflow: hidden; padding: clamp(24px, 5vw, 40px); border: 1px solid var(--med-border); border-radius: 22px; background: var(--med-panel); box-shadow: var(--med-shadow); }
body[data-theme="CLASSIC"] .hero-card { background: var(--med-panel); }
.study-kicker { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--med-accent); font-size: .78rem; font-weight: 800; }
.hero-card h1 { position: relative; z-index: 1; max-width: 700px; margin: 22px 0 12px; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.04em; }
.hero-card h1 span { color: #e4bdff; }
body[data-theme="CLASSIC"] .hero-card h1 span { color: #7e22ce; }
.hero-card>p:not(.eyebrow) { position: relative; z-index: 1; max-width: 610px; color: var(--med-muted); font-size: 1.05rem; line-height: 1.7; }
.hero-orbit { position: absolute; right: 6%; top: 18%; display: grid; width: clamp(120px, 20vw, 210px); aspect-ratio: 1; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: radial-gradient(circle, rgba(240,171,252,.3), rgba(192,132,252,.03) 68%); font-size: clamp(3rem, 9vw, 6rem); opacity: .8; }
.eyebrow { margin: 0; color: var(--med-accent-2); font-size: .72rem; font-weight: 900; letter-spacing: .17em; }
.hero-stats { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-stats span { padding: 10px 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(17, 11, 27, .23); color: var(--med-muted); font-size: .8rem; }
.hero-stats strong { color: var(--med-text); }
.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0 48px; }
.path-card { display: flex; min-height: 220px; flex-direction: column; align-items: flex-start; padding: 24px; border: 1px solid var(--med-border); border-radius: 18px; background: var(--med-panel); color: var(--med-text); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.path-card:hover, .path-card:focus-visible { transform: translateY(-3px); border-color: var(--med-accent); outline: none; }
.path-purple { background: var(--med-panel); }
.path-icon { margin-bottom: 16px; font-size: 1.6rem; }
.path-card strong { margin-bottom: 8px; font-size: 1.3rem; }
.path-card>span:not(.path-icon) { color: var(--med-muted); line-height: 1.55; }
.path-card small { margin-top: auto; padding-top: 18px; color: var(--med-accent); font-size: .7rem; font-weight: 900; letter-spacing: .1em; }
.section-overview { padding: 28px; border: 1px solid var(--med-border); border-radius: 24px; background: var(--med-panel); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-title h2, .page-heading h1 { margin: 7px 0 0; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.04em; }
.section-title>span { color: var(--med-muted); font-size: .77rem; text-align: right; }
.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.section-tile { min-width: 0; padding: 18px; border: 1px solid var(--med-border); border-radius: 16px; background: var(--med-panel-2); }
.section-tile>span { display: block; margin-bottom: 9px; color: var(--med-accent); font-size: .7rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.section-tile strong, .section-tile small { display: block; }
.section-tile strong { line-height: 1.4; }
.section-tile small { margin-top: 8px; color: var(--med-muted); line-height: 1.5; }
.notice-line { margin: 18px 0 0; color: var(--med-muted); font-size: .78rem; line-height: 1.65; }
.roadmap-panel { margin-top: 20px; padding: 26px; border: 1px solid var(--med-border); border-radius: 23px; background: var(--med-panel); }
.roadmap-panel .section-title { margin-bottom: 0; }
.roadmap-list { display: grid; gap: 9px; margin-top: 18px; }
.roadmap-item { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 12px; padding: 14px; border: 1px solid var(--med-border); border-radius: 13px; background: var(--med-panel-2); cursor: pointer; }
.roadmap-item input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--med-accent); }
.roadmap-item strong, .roadmap-item small { display: block; }
.roadmap-item strong { margin-bottom: 4px; font-size: .88rem; }
.roadmap-item small { color: var(--med-muted); line-height: 1.5; }
.page-heading { margin-bottom: 22px; }
.page-heading>p:not(.eyebrow) { max-width: 720px; color: var(--med-muted); line-height: 1.6; }
.section-pick { margin: 22px 0; }
.pick-tile { width: 100%; color: var(--med-text); text-align: left; cursor: pointer; }
.pick-tile:hover, .pick-tile:focus-visible, .pick-tile.tile-selected { border-color: var(--med-accent); outline: none; box-shadow: inset 0 0 0 1px var(--med-accent); }
.practice-controls, .review-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.practice-controls label, .review-filters label { display: grid; gap: 8px; min-width: min(100%, 220px); color: var(--med-muted); font-size: .8rem; font-weight: 750; }
.practice-controls select, .review-filters select { min-height: 44px; padding: 9px 12px; border: 1px solid var(--med-border); border-radius: 10px; background: var(--med-panel); color: var(--med-text); }
.primary-button, .purchase-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 12px 19px; border: 0; border-radius: 12px; background: linear-gradient(100deg, #c084fc, #e879f9); color: #210d31; text-decoration: none; cursor: pointer; font-size: .88rem; font-weight: 900; box-shadow: 0 8px 24px rgba(192,132,252,.2); }
.primary-button:hover, .purchase-button:hover { filter: brightness(1.06); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.start-set { margin-top: 20px; }
.test-shell { padding: clamp(18px, 4vw, 34px); border: 1px solid var(--med-border); border-radius: 25px; background: var(--med-panel); box-shadow: var(--med-shadow); }
.test-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-topline>div { display: flex; align-items: center; gap: 10px; }
.test-shell { padding: clamp(18px, 4vw, 32px); border: 1px solid var(--med-border); border-radius: 22px; background: var(--med-panel); box-shadow: var(--med-shadow); }
.test-topline { flex-wrap: wrap; }
.question-grid-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--med-border); border-radius: 18px; background: var(--med-panel); color: var(--med-text); }
.question-grid-dialog::backdrop { background: rgba(10, 15, 29, .8); backdrop-filter: blur(8px); }
.grid-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-dialog-head h2 { margin: 0; font-size: 1.2rem; }
.question-grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin-top: 20px; }
.grid-item { position: relative; min-height: 44px; border: 1px solid var(--med-border); border-radius: 10px; background: var(--med-panel-2); color: var(--med-muted); cursor: pointer; }
.grid-answered { background: color-mix(in srgb, var(--med-accent) 20%, var(--med-panel)); color: var(--med-text); }
.grid-current { border: 2px solid var(--med-accent); }
.grid-item span { position: absolute; top: -3px; right: 1px; color: #fbbf24; }
.struck-through:not(.answer-key) strong { text-decoration: line-through; opacity: .45; }
.quiet-button, .flag-button { min-height: 42px; padding: 9px 13px; border: 1px solid var(--med-border); border-radius: 10px; background: transparent; color: var(--med-muted); cursor: pointer; font-size: .82rem; font-weight: 750; }
.quiet-button:disabled { opacity: .4; cursor: not-allowed; }
.section-chip, .mode-pill, .timer-pill, .item-count { color: var(--med-muted); font-size: .76rem; font-weight: 800; }
.section-chip { color: var(--med-accent); }
.timer-pill { min-width: 68px; padding: 8px 10px; border-radius: 9px; background: var(--med-panel-2); color: var(--med-text); font-variant-numeric: tabular-nums; text-align: center; }
.timer-warning { background: #722c44; color: #fff; }
.progress-track { height: 5px; overflow: hidden; margin: 18px 0 24px; border-radius: 99px; background: var(--med-panel-2); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--med-accent), var(--med-accent-2)); }
.passage-box { margin: 0 0 20px; padding: 19px; border-left: 3px solid var(--med-accent); border-radius: 0 13px 13px 0; background: var(--med-panel-2); }
.passage-box p:not(.eyebrow) { margin: 10px 0 0; color: var(--med-muted); line-height: 1.7; }
.question-topic { margin: 20px 0 10px; }
.question-prompt { margin: 18px 0 20px; font-size: clamp(1.25rem, 3vw, 1.7rem); line-height: 1.4; letter-spacing: -.025em; }
.answer-grid { display: grid; gap: 10px; }
.answer-option { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 11px; min-height: 68px; padding: 16px; border: 1px solid var(--med-border); border-radius: 14px; background: color-mix(in srgb, var(--med-text) 3%, var(--med-bg)); color: var(--med-text); text-align: left; cursor: pointer; transition: border-color .18s, background .18s; }
.answer-option>span { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--med-border); border-radius: 9px; color: var(--med-accent); font-weight: 900; }
.answer-option strong { font-size: .9rem; font-weight: 650; line-height: 1.5; }
.answer-option:hover:not(:disabled) { border-color: var(--med-accent); }
.answer-option.correct, .answer-option.answer-key { border-color: var(--med-green); background: color-mix(in srgb, var(--med-green) 10%, var(--med-bg)); }
.answer-option.incorrect { border-color: var(--med-red); background: color-mix(in srgb, var(--med-red) 9%, var(--med-bg)); }
.answer-option.selected { border-color: var(--med-accent); box-shadow: inset 0 0 0 1px var(--med-accent); }
.answer-option.option-muted { opacity: .3; }
.question-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.question-tags span { padding: 7px 11px; border: 1px solid var(--med-border); border-radius: 999px; color: var(--med-accent); font-size: .7rem; font-weight: 800; }
.paragraph-number { display: inline-block; margin-right: 8px; color: var(--med-accent); font: 700 .7rem ui-monospace, monospace; }
.data-figure { margin: 22px 0 0; }
.data-figure figcaption { margin-bottom: 10px; color: var(--med-text); font-size: .82rem; font-weight: 750; line-height: 1.5; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--med-border); border-radius: 10px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.table-scroll th, .table-scroll td { padding: 11px; border-bottom: 1px solid var(--med-border); text-align: left; vertical-align: top; line-height: 1.45; min-width: 100px; }
.table-scroll thead { background: var(--med-panel); }
.table-scroll tbody th { color: var(--med-accent); font-weight: 650; }
.post-answer { animation: med-reveal .25s ease-out; }
.distractor-review, .recall-prompt { margin-top: 18px; padding: 14px; border: 1px solid var(--med-border); border-radius: 12px; }
.distractor-review summary, .recall-prompt summary { cursor: pointer; color: var(--med-text); font-size: .85rem; font-weight: 750; line-height: 1.6; }
.distractor-review ul { list-style: none; padding: 0; margin-bottom: 0; }
.distractor-review li { margin: 18px 0 0; }
.distractor-review li strong { color: var(--med-text); font-size: .84rem; }
.recall-prompt { border-left: 3px solid var(--med-accent); }
.source-note { font-size: .72rem; }
.core-concepts { margin-top: 24px; }
.core-concepts > .eyebrow { margin-bottom: 12px; }
.concept-option { width: 100%; }
.concept-option small { display: block; margin-top: 8px; color: var(--med-muted); font-size: .75rem; font-weight: 500; }
.core-concepts > .quiet-button { margin-top: 12px; }
.core-concepts > p[role="status"] { color: var(--med-green); font-size: .78rem; }
.explanation { margin-top: 17px; padding: 17px; border-left: 3px solid var(--med-accent); border-radius: 0 12px 12px 0; background: var(--med-panel-2); }
.explanation strong { color: var(--med-accent); }
.explanation p { margin: 8px 0 0; color: var(--med-muted); line-height: 1.65; }
.explanation-good { border-left-color: var(--med-green); }
.explanation-good strong { color: var(--med-green); }
.explanation-review { border-left-color: var(--med-red); }
.explanation-review strong { color: var(--med-red); }
.submit-summary { margin-top: 16px; padding: 13px; border-radius: 10px; background: var(--med-panel-2); color: var(--med-muted); font-size: .84rem; }
.test-actions, .card-navigation { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 22px; }
.flag-active { color: #fbbf24; border-color: #fbbf24; }
.card-count { margin: 16px 0 9px; color: var(--med-muted); font-size: .79rem; text-align: center; }
.flash-card { display: flex; width: 100%; min-height: 270px; flex-direction: column; justify-content: center; gap: 20px; padding: clamp(25px, 6vw, 48px); border: 1px solid color-mix(in srgb, var(--med-accent) 42%, transparent); border-radius: 18px; background: var(--med-panel); color: var(--med-text); text-align: center; cursor: pointer; box-shadow: var(--med-shadow); }
.flash-card.is-flipped { animation: med-reveal .2s ease-out; }
.flash-card strong { max-width: 760px; margin: 0 auto; font-size: clamp(1.25rem, 3.6vw, 1.9rem); line-height: 1.5; }
.flash-card small { color: var(--med-muted); }
.card-label { color: var(--med-accent); font-size: .7rem; font-weight: 950; letter-spacing: .16em; }
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 14px; }
.grade-row button { min-height: 54px; border: 1px solid var(--med-border); border-radius: 12px; background: var(--med-panel); color: var(--med-text); cursor: pointer; font-weight: 850; }
.grade-row button:hover { border-color: var(--med-accent); }
.grade-row small { display: block; margin-top: 3px; color: var(--med-muted); font-size: .67rem; font-weight: 600; }
.med-footer { margin-top: 48px; padding: 20px 6px; border-top: 1px solid var(--med-border); color: var(--med-muted); font-size: .72rem; line-height: 1.65; }
.med-footer p { margin: 8px 0; }
.access-shade { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; overflow-y: auto; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: rgba(10, 15, 29, .95); backdrop-filter: blur(8px); }
body[data-theme="CLASSIC"] .access-shade { background: rgba(242, 237, 250, .95); }
.access-dialog { width: min(100%, 510px); max-height: calc(100dvh - 36px); overflow: auto; padding: clamp(24px, 5vw, 38px); border: 1px solid rgba(192,132,252,.42); border-radius: 24px; background: var(--med-panel); box-shadow: 0 26px 80px rgba(0,0,0,.38); }
.access-dialog h1 { margin: 9px 0 14px; font-size: clamp(1.7rem, 5vw, 2.25rem); letter-spacing: -.045em; }
.access-theme { display: block; min-height: 38px; margin: 0 0 14px auto; padding: 7px 12px; border: 1px solid var(--med-border); border-radius: 999px; background: transparent; color: var(--med-muted); cursor: pointer; font-size: .75rem; }
.access-dialog p:not(.eyebrow) { color: var(--med-muted); font-size: .91rem; line-height: 1.65; }
.mission-note { padding: 13px; border-left: 3px solid var(--med-accent); border-radius: 0 10px 10px 0; background: var(--med-panel-2); }
.age-confirmation { display: flex; gap: 11px; align-items: flex-start; margin: 20px 0 8px; padding: 13px; border: 1px solid var(--med-border); border-radius: 12px; background: var(--med-bg); }
.age-confirmation input { flex: 0 0 20px; width: 20px; min-height: 20px; margin: 2px 0 0; padding: 0; accent-color: var(--med-accent); cursor: pointer; }
.access-dialog .age-confirmation label { margin: 0; font-size: .86rem; line-height: 1.5; cursor: pointer; }
.age-confirmation:focus-within { outline: 3px solid var(--med-accent); outline-offset: 2px; }
.age-error { margin: 0 0 8px !important; color: var(--med-red) !important; font-weight: 800; }
.access-dialog label { display: block; margin: 19px 0 8px; font-size: .84rem; font-weight: 800; }
.access-dialog input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--med-border); border-radius: 10px; background: var(--med-bg); color: var(--med-text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.access-dialog input:focus-visible, .access-dialog button:focus-visible, .access-dialog a:focus-visible { outline: 3px solid var(--med-accent); outline-offset: 3px; }
.access-dialog form .primary-button, .purchase-button { width: 100%; margin-top: 12px; }
.license-error { margin-top: 11px; color: var(--med-red); font-size: .83rem; line-height: 1.5; overflow-wrap: anywhere; }
.fine-print { font-size: .73rem !important; }
.back-link { display: inline-block; margin-top: 12px; color: var(--med-accent); font-size: .82rem; }
@media (max-width: 800px) {
  .med-header { flex-wrap: wrap; gap: 8px 14px; padding: 12px 18px; }
  .med-head-tools { gap: 5px; }
  .med-nav { order: 3; width: 100%; }
  .med-nav button { flex: 1; padding: 9px 6px; }
  .access-badge { font-size: .65rem; }
}
@media (min-width: 801px) and (max-width: 1180px) {
  .med-head-tools { width: 100%; justify-content: flex-end; }
}
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible, .table-scroll:focus-visible { outline: 3px solid var(--med-accent); outline-offset: 3px; }
@keyframes med-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 560px) {
  .med-main { width: min(100% - 24px, 1040px); padding-top: 20px; }
  .hero-card { border-radius: 22px; }
  .hero-orbit { right: -12px; top: 12%; opacity: .32; }
  .path-grid, .section-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 180px; }
  .section-overview { padding: 19px; }
  .section-title { align-items: start; flex-direction: column; }
  .section-title>span { text-align: left; }
  .test-topline { flex-wrap: wrap; }
  .test-topline>div { order: 3; width: 100%; }
  .answer-option { grid-template-columns: 31px 1fr; }
  .grade-row { grid-template-columns: repeat(2, 1fr); }
  .test-actions>* { flex: 1 1 42%; }
  .grade-row button { min-height: 58px; }
}
@media (max-width: 420px) {
  .med-head-tools { width: 100%; justify-content: space-between; gap: 6px; margin-left: 0; }
  .access-badge { flex: 1; max-width: 140px; white-space: normal; text-align: center; line-height: 1.25; }
  .theme-toggle, .memory-pill { flex: none; padding-right: 9px; padding-left: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .post-answer, .flash-card.is-flipped { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Study tools, split-screen practice, focus mode ---------- */
.study-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.study-toolbar .quiet-button { min-height: 38px; padding: 7px 12px; border-radius: 999px; font-size: .76rem; }
.pane-label { margin: 4px 0 0; }
.split-pane:focus-visible { outline: 3px solid var(--med-accent); outline-offset: 3px; }
.explanation-placeholder { display: none; }
.split-discrete .split-left .question-tags, .split-passage .split-left .question-tags { margin-bottom: 16px; }
body.med-view-test .med-main { width: min(100% - 36px, 1560px); padding-top: 22px; }
@media (min-width: 960px) {
  .split-pane { position: relative; }
  .split-pane .passage-box { margin-bottom: 0; }
  .split-pane .question-prompt { margin-top: 12px; font-size: clamp(1.05rem, 1.5vw, 1.3rem); }
  .split-right .post-answer > .explanation:first-child { margin-top: 0; }
  .split-discrete .split-right .post-answer { animation: med-reveal .25s ease-out; }
  .explanation-placeholder { display: grid; place-content: center; gap: 6px; min-height: 100%; padding: 30px; color: var(--med-muted); text-align: center; line-height: 1.6; }
  .explanation-placeholder p:not(.eyebrow) { max-width: 380px; margin: 0 auto; font-size: .88rem; }
  .split-passage .split-right .explanation-placeholder { display: none; }
}
body.study-focus .med-header, body.study-focus .med-footer { display: none; }
body.study-focus .med-main { padding-top: 12px; }
body.study-focus .test-shell { box-shadow: none; }

/* ---------- Flashcard origin labels ---------- */
.card-origin { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.card-chip { padding: 5px 10px; border: 1px solid var(--med-border); border-radius: 999px; color: var(--med-muted); font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.card-chip-section { border-color: color-mix(in srgb, var(--med-accent) 55%, transparent); color: var(--med-accent); }
.card-from { color: var(--med-muted); font-size: .74rem; line-height: 1.45; }

/* ---------- Periodic table reference ---------- */
.reference-dialog { width: min(1120px, calc(100% - 24px)); }
.pt-scroll { margin-top: 16px; overflow-x: auto; padding-bottom: 6px; }
.pt-grid { display: grid; grid-template-columns: repeat(18, minmax(48px, 1fr)); grid-template-rows: repeat(7, auto) 12px repeat(2, auto); gap: 3px; min-width: 900px; }
.pt-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 3px 2px; border: 1px solid var(--med-border); border-radius: 6px; background: var(--med-panel-2); line-height: 1.1; }
.pt-cell strong { font-size: .95rem; }
.pt-z, .pt-mass { color: var(--med-muted); font-size: .6rem; font-variant-numeric: tabular-nums; }
.pt-f { background: color-mix(in srgb, var(--med-accent-2) 10%, var(--med-panel-2)); }
.pt-marker { color: var(--med-accent-2); font-weight: 900; background: transparent; border-style: dashed; }
.pt-label { align-self: center; color: var(--med-muted); font-size: .66rem; font-weight: 800; }
