/* Listening Room — a quiet, welcoming study space. */
:root {
  --ink: #203e37;
  --muted: #62746c;
  --paper: #f7f7f2;
  --line: #e1e7df;
  --teal: #296c53;
  --mint: #e9f1e6;
  --orange: #b7753f;
  --red: #a13c35;
  --white: #fff;
  --shadow: 0 4px 20px #233d3210;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: default; opacity: .48; }
button, a, input, select, summary { outline-offset: 4px; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #5d9976; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; vertical-align: middle; }
.skip-link { position: fixed; top: -80px; left: 20px; background: var(--ink); color: white; padding: 12px 20px; z-index: 100; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sidebar { width: 232px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 35px 22px 26px; background: #fff; border-right: 1px solid var(--line); z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 27px; font-weight: 750; letter-spacing: -1.3px; line-height: 1.1; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 47px; background: var(--ink); color: #f0eacb; border-radius: 15px 15px 15px 4px; }
.brand-small { display: block; margin-top: 8px; font-size: 9px; font-weight: 650; letter-spacing: 2.7px; }
.side-caption { margin: 53px 12px 16px; color: #738276; font-size: 10px; font-weight: 600; letter-spacing: 1.3px; }
nav { display: grid; gap: 9px; }
nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 10px; color: #68796f; font-size: 13px; font-weight: 550; transition: background .15s, color .15s; }
nav a > span:first-child { display: flex; }
nav a:hover { background: #f3f6ef; }
nav a.active { background: var(--mint); color: #245a44; font-weight: 650; }
nav a.active::after { content: ''; position: absolute; right: 13px; width: 5px; height: 5px; border-radius: 50%; background: #4d805d; }
.side-note { margin-top: auto; padding: 23px 18px; background: #f5f5ea; border: 1px solid #eeeee0; border-radius: 14px; color: #6b7969; font-size: 11px; }
.side-note p { margin: 19px 0; color: var(--ink); font: 25px/1.4 Georgia, "Times New Roman", serif; letter-spacing: -.6px; }
.side-note > span:last-child { font-size: 9px; letter-spacing: 1.5px; }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #5a845b; margin-right: 5px; vertical-align: middle; }
.side-footer { margin-top: 23px; text-align: center; color: #78877a; font-size: 10px; }
.shell { margin-left: 232px; }
.topbar { height: 78px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 44px; color: #6d7c71; font-size: 12px; background: #fafaf6; }
.profile { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 550; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; background: #ecebda; border: 3px solid white; border-radius: 50%; font-size: 12px; }
main { max-width: 1440px; min-height: calc(100vh - 154px); margin: auto; padding: 36px 44px 60px; }
h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.22; font-weight: 650; letter-spacing: -1.5px; margin: 0 0 16px; }
h2 { font-size: 24px; line-height: 1.4; font-weight: 650; letter-spacing: -.65px; }
h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
p { margin: 0 0 16px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.8px; color: #547257; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 21px; min-height: 46px; border: 1px solid transparent; border-radius: 9px; color: white; background: var(--ink); font-size: 13px; font-weight: 650; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover:not(:disabled) { background: #345e49; box-shadow: 0 4px 12px #203e371a; transform: translateY(-1px); }
.btn.secondary { background: #eff3e9; border-color: #e0e7d8; color: var(--ink); }
.btn.secondary:hover:not(:disabled) { background: #e3ebda; }
.btn.danger { background: #fcf0eb; color: var(--red); border-color: #efdcd5; }
.btn.danger:hover { background: #f4e1da; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: none; color: var(--teal); font-size: 13px; font-weight: 650; min-height: 40px; padding: 5px 0; }
.text-button:hover { color: #163f2f; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 21px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; min-height: 302px; padding: 34px 40px; background: #eaf0e3; border: 1px solid #dce5d3; border-radius: 18px; margin-bottom: 23px; }
.hero-copy { position: relative; z-index: 1; }
.hero .eyebrow { margin-bottom: 16px; }
.hero h1 { font-size: clamp(32px, 3.3vw, 46px); letter-spacing: -1.7px; line-height: 1.22; margin-bottom: 17px; }
.hero h1 em { color: #63784c; font-family: Georgia, "Times New Roman", serif; font-weight: 450; letter-spacing: -1.8px; }
.hero p { color: #5e735e; font-size: 13px; line-height: 1.8; margin: 0; }
.hero-actions { display: flex; align-items: center; gap: 17px; margin-top: 24px; flex-wrap: wrap; }
.hero-actions .btn { font-size: 12px; padding: 11px 17px; min-height: 43px; }
.hero-hint { color: #5e735e; font-size: 10px; }
.hero-art { width: 290px; min-width: 250px; height: 240px; position: relative; display: grid; place-items: center; }
.art-orbit { position: absolute; width: 216px; height: 216px; border: 1px solid #cbd9be; border-radius: 50%; }
.orbit-two { width: 260px; height: 260px; border-style: dashed; opacity: .6; }
.headphone-art { width: 215px; height: 215px; background: #e0e9d5; border-radius: 50%; transform: rotate(-12deg); }
.headphone-art svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 4px #224e4712); }
.art-spark { position: absolute; color: #b97640; }
.spark-one { top: 4px; right: 8px; font-size: 35px; transform: rotate(12deg); }
.spark-two { bottom: 40px; left: 6px; font-size: 24px; }
.audio-sticker { position: absolute; bottom: -5px; right: -8px; display: flex; align-items: center; gap: 13px; width: 238px; padding: 13px 16px; border: 1px solid #dce3d3; background: #fffffff5; border-radius: 12px; transform: rotate(-5deg); box-shadow: 0 9px 20px #425b2d13; }
.audio-sticker strong { display: block; font-size: 9px; margin-bottom: 7px; font-weight: 600; }
.sticker-play { width: 31px; height: 31px; background: var(--ink); color: #f0e8ca; border-radius: 50%; display: grid; place-items: center; font-size: 10px; padding-left: 2px; }
.waveform { height: 23px; display: flex; align-items: center; gap: 3px; }
.waveform i { display: block; width: 3px; height: calc(var(--h) * .65); background: #92a67f; border-radius: 2px; }
.waveform i:nth-child(n+12) { background: #d7dfce; }
.sticker-time { color: #61795c; background: #f0f4e9; padding: 3px 5px; font-size: 10px; margin-left: auto; border-radius: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 21px 23px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.stat-icon { display: grid; place-items: center; width: 43px; height: 43px; background: #edf3e8; color: #4d7654; border-radius: 12px; }
.stat:nth-child(2) .stat-icon { color: #a2713b; background: #fbf0e2; }
.stat:nth-child(3) .stat-icon { color: #797393; background: #f0eef7; }
.stat strong { display: block; font-size: 27px; font-weight: 650; line-height: 1.2; letter-spacing: -1px; }
.stat small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.stat strong .small { font-size: 12px; font-weight: 450; letter-spacing: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 24px 0 16px; }
.section-heading h2 { margin: 0; }
.pill { display: inline-block; background: #e8ecdf; color: #576e4d; font-size: 10px; font-weight: 550; letter-spacing: .3px; padding: 3px 9px; border-radius: 5px; margin-left: 12px; vertical-align: middle; }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 19px 0 23px; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid #e1e6db; border-radius: 10px; background: #ecefe5; }
.segmented button { background: transparent; color: #65735f; padding: 8px 15px; border-radius: 7px; font-size: 12px; min-height: 35px; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 2px 5px #2f432c10; font-weight: 650; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap > .icon { position: absolute; left: 13px; color: #788573; pointer-events: none; }
.search { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px 11px 39px; width: 225px; max-width: 100%; font-size: 12px; }
.search::placeholder { color: #74816d; }
.test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.test-card { position: relative; background: white; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; }
.test-card:hover { transform: translateY(-3px); border-color: #b4c6aa; box-shadow: var(--shadow); }
.card-body { padding: 22px 23px 19px; }
.card-top { display: flex; align-items: center; gap: 9px; position: relative; margin-bottom: 22px; }
.test-icon { display: grid; place-items: center; width: 39px; height: 39px; background: #edf3e7; color: #4a6c42; border-radius: 12px; }
.test-index { color: #a4ad9c; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.status { font-size: 10px; background: #f3f4ef; border: 1px solid #edf0e7; padding: 3px 8px; color: #6a7865; border-radius: 5px; margin-left: auto; white-space: nowrap; }
.status.done { color: #386a45; background: #edf5e8; border-color: #e0ecd6; }
.status.draft { color: #90642c; background: #fff4e2; border-color: #f3e6cc; }
.test-card h3 { margin-bottom: 4px; }
.test-card p { color: #74806e; font-size: 11px; margin-bottom: 19px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; color: #6e7e65; font-size: 11px; }
.meta > span { display: inline-flex; align-items: center; gap: 5px; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #ebeee4; background: #fdfefa; padding: 10px 22px; color: #6d7b65; font-size: 11px; }
.card-bottom .text-button { font-size: 12px; min-height: 32px; }
.empty { grid-column: 1/-1; text-align: center; padding: 55px 25px; border: 1px dashed #cfdac7; background: white; color: var(--muted); border-radius: 13px; }
.footer { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 22px 44px; color: #71806c; font-size: 10px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }
/* Reading and answering take priority in the exercise view. */
body[data-page="exercise"] main, body[data-page="review"] main { max-width: 1260px; }
#back { font-size: 12px; color: #667b60; }
.work-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 13px 0 29px; }
.work-header h1 { font-size: 32px; letter-spacing: -1px; margin: 3px 0 6px; }
.work-header .eyebrow { margin-bottom: 7px; }
.timer { min-width: 165px; border: 1px solid #e0e7d6; border-radius: 11px; background: #edf2e5; padding: 12px 18px; font-size: 28px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; text-align: center; }
.timer small { display: block; color: #63745b; font-size: 9px; font-weight: 550; letter-spacing: 1px; margin-top: 5px; }
.timer.urgent { color: var(--red); background: #fdf0ea; border-color: #e9c4b5; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 216px; gap: 24px; align-items: start; }
.part-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 17px; }
.part-tabs button { border: 1px solid #e0e7d8; border-radius: 9px; padding: 9px 10px; background: #edf1e6; color: #667b5e; text-align: left; font-size: 12px; font-weight: 650; line-height: 1.5; min-height: 59px; }
.part-tabs button small { display: block; font-size: 10px; font-weight: 450; margin-top: 1px; }
.part-tabs button.active { background: var(--ink); border-color: var(--ink); color: white; }
.part-tabs button:hover:not(.active) { background: #e0ead8; }
.player-box { position: sticky; top: 12px; z-index: 3; border: 1px solid #dce6d1; border-radius: 13px; background: #edf3e7; padding: 20px 23px 17px; margin-bottom: 22px; box-shadow: 0 4px 15px #304d2010; }
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; font-size: 13px; }
.player-head strong { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.audio-badge { background: #fff9; border: 1px solid #dbe5d1; color: #667d5c; border-radius: 5px; padding: 2px 7px; font-size: 10px; }
.player-box audio { display: block; width: 100%; height: 44px; border-radius: 22px; }
.player-box audio::-webkit-media-controls-panel { background: #f9fbf6; }
.player-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-top: 12px; font-size: 11px; color: #526b49; }
.player-tools button, .player-tools select { background: #ffffffbd; border: 1px solid #d7e2cd; border-radius: 5px; padding: 5px 9px; color: #375a2e; font-size: 11px; min-height: 31px; }
.player-tools label { display: inline-flex; align-items: center; gap: 5px; }
.player-tools input { accent-color: var(--teal); }
.instructions { font-size: 14px; color: #61745b; border-left: 2px solid #bccdaf; padding-left: 14px; margin: 23px 0; line-height: 1.8; }
.question { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 24px; margin-bottom: 18px; scroll-margin-top: 215px; }
.q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.q-prompt { display: flex; align-items: baseline; gap: 12px; font-size: 16px; font-weight: 550; line-height: 1.65; }
.q-number { display: inline-grid; place-items: center; flex-shrink: 0; min-width: 29px; height: 29px; font-size: 12px; font-weight: 650; border-radius: 8px; color: #516b43; background: #edf2e6; }
.flag { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; background: #f7f8f3; color: #8e9a83; }
.flag:hover { background: #eff2e7; color: #687c50; }
.flag.flagged { color: #a37126; background: #fff3d9; }
.question img { display: block; width: 100%; height: auto; margin-bottom: 21px; border-radius: 4px; }
.options { display: grid; gap: 10px; }
.options.image-options { grid-template-columns: repeat(3, 1fr); }
.option { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 15px; border: 1px solid #dde5d7; border-radius: 9px; font-size: 14px; line-height: 1.6; cursor: pointer; transition: background .12s, border-color .12s; }
.option:hover { background: #f6f9f1; border-color: #b2c5a6; }
.option input { margin: 0; width: 16px; height: 16px; accent-color: var(--teal); flex-shrink: 0; }
.option strong { font-size: 12px; font-weight: 650; color: #657c57; }
.option:has(input:checked) { background: #edf5e7; border-color: #6c9760; box-shadow: inset 0 0 0 .5px #6c9760; }
.option:has(input:focus-visible) { outline: 3px solid #7ba76e; outline-offset: 3px; }
.option.correct { border-color: #7fa16d; background: #edf6e6; }
.option.incorrect, .option.incorrect:has(input:checked) { border-color: #f5aaa3; background: #fee4e2; color: #b42318; box-shadow: inset 0 0 0 .5px #f5aaa3; }
.option.incorrect strong { color: #b42318; }
.option.incorrect input { accent-color: #b42318; }
.question-side { position: sticky; top: 24px; background: white; border: 1px solid var(--line); border-radius: 13px; padding: 21px 18px; }
.question-side h3 { font-size: 14px; margin-bottom: 17px; }
.question-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.question-map button { display: grid; place-items: center; border: 1px solid #e8ecdf; background: #f6f7f1; color: #65775c; border-radius: 7px; height: 33px; font-size: 11px; font-weight: 550; }
.question-map button:hover { border-color: #a8bb99; }
.question-map button.answered, .question-map button.correct { background: #e4efd9; border-color: #d0dfc3; color: #365e2a; }
.question-map button.flagged { box-shadow: inset 0 0 0 1.5px #c89a42; }
.question-map button.wrong { background: #fee4e2; border-color: #f5aaa3; color: #b42318; font-weight: 700; }
.question-map button.unanswered { background: #f2f4f3; border-color: #e0e5e1; color: #66756c; }
.progress { height: 6px; margin: 19px 0 10px; background: #edf1e6; border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: #799c63; transition: width .2s; border-radius: inherit; }
.question-side > .small { font-size: 11px; }
.question-side .btn { width: 100%; margin-top: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 13px; color: #66785c; font-size: 10px; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: #b5cda0; margin-right: 4px; }
.legend i.gold { background: #c5a055; }
.legend i.red { background: #d92d20; }
.legend i.neutral { background: #a6b0a9; }
#save-status { font-size: 10px; text-align: center; }
.gap-document { border: 1px solid var(--line); border-radius: 13px; background: white; padding: 28px; margin-bottom: 20px; font-size: 16px; line-height: 2.2; }
.gap-document p { margin-bottom: 17px; }
.gap-document p:first-child { color: #627859; font-size: 14px; line-height: 1.9; padding-bottom: 15px; border-bottom: 1px solid #e7ecdf; }
.gap-document label { scroll-margin-top: 235px; display: inline-block; }
.gap-label { display: inline-block; font-size: 11px; font-weight: 650; color: #6b805e; margin-right: 4px; }
.gap-input { width: 173px; max-width: 100%; min-height: 43px; border: 1px solid #bbcdb0; border-radius: 7px; padding: 7px 10px; margin: 3px 0; color: var(--ink); background: #f7faf2; font-size: 15px; }
.gap-input:focus { background: white; border-color: #6a9659; }
.gap-input.correct { border-color: #7a9f67; background: #eff6e8; }
.gap-input.incorrect { border-color: #ce9e8d; background: #fff1ea; }
.answer-note { font-size: 12px; padding: 10px 12px; margin-top: 15px; border-radius: 7px; color: #47703b; background: #eff6e8; line-height: 1.7; }
.answer-note.wrong { color: var(--red); background: #fcf0e9; }
.gap-document .answer-note { display: inline; padding: 4px 7px; margin: 0 6px; overflow-wrap: anywhere; }
.transcript { padding: 22px 25px; margin-top: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.transcript summary { font-size: 14px; font-weight: 600; cursor: pointer; }
.transcript p { font-size: 15px; line-height: 1.9; margin: 20px 0 0; }
.part-controls { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.result-banner { display: flex; align-items: center; gap: 27px; border: 1px solid #d5e3c6; border-radius: 15px; background: #eaf1e1; padding: 28px; margin: 10px 0 30px; }
.score-circle { flex-shrink: 0; width: 108px; height: 108px; display: grid; place-items: center; border: 6px solid #a2be86; border-radius: 50%; background: #f9fcf3; font-size: 33px; font-weight: 650; letter-spacing: -1px; }
.score-circle small { font-size: 13px; color: #6b805a; letter-spacing: 0; }
.result-banner .eyebrow { margin-bottom: 6px; }
.result-banner h2 { font-size: 25px; margin: 0 0 8px; }
.result-banner p { font-size: 13px; margin-bottom: 0; color: #5c7351; }
.result-banner .actions { margin-top: 16px; gap: 8px; }
.result-banner .btn { font-size: 12px; min-height: 42px; padding: 9px 14px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 13px 0; padding: 22px 25px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.history-row > div { flex: 1; }
.history-row strong { font-size: 16px; }
.history-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.score-pill { background: #eef5e6; color: #436837; border: 1px solid #e2ecd8; border-radius: 8px; padding: 6px 13px; font-size: 16px; font-weight: 650; white-space: nowrap; }
.settings-card { max-width: 750px; border: 1px solid var(--line); background: white; border-radius: 13px; padding: 28px; margin: 22px 0; }
.settings-card h2 { font-size: 22px; margin-top: 0; }
.field { display: grid; gap: 9px; font-size: 14px; margin: 19px 0; }
.field input { padding: 12px 14px; border: 1px solid #ccd9c4; border-radius: 8px; color: var(--ink); background: #fcfdf9; }
.notice { border-left: 3px solid #a8bf94; border-radius: 0 7px 7px 0; background: #f2f6eb; padding: 13px 16px; color: #5f7553; font-size: 12px; margin-top: 20px; }
dialog { width: 470px; max-width: calc(100vw - 32px); padding: 32px; border: 1px solid #dfe7d4; border-radius: 17px; color: var(--ink); box-shadow: 0 25px 100px #203e3738; }
dialog::backdrop { background: #203e376b; backdrop-filter: blur(5px); }
dialog h2 { font-size: 27px; margin: 10px 0; }
.close { display: grid; place-items: center; width: 32px; height: 32px; float: right; background: #f4f6ee; color: #718168; font-size: 25px; border-radius: 50%; line-height: 1; }
.mode-card { display: block; padding: 17px; border: 1px solid #dfe7d7; border-radius: 10px; margin-top: 13px; cursor: pointer; }
.mode-card:has(input:checked) { background: #f0f6e9; border-color: #83a16f; }
.mode-card input { accent-color: var(--teal); margin-right: 9px; width: 15px; height: 15px; }
.mode-card strong { font-size: 14px; }
.mode-card small { display: block; margin: 5px 0 0 28px; color: #66795b; font-size: 12px; line-height: 1.7; }
dialog .actions > .btn { flex: 1; }
#toast { display: none; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 35px); z-index: 100; border-radius: 10px; padding: 13px 22px; color: white; background: var(--ink); font-size: 13px; box-shadow: 0 6px 30px #203e3729; }
@media (min-width: 1600px) {
  .test-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .sidebar { width: 214px; padding-inline: 17px; }
  .shell { margin-left: 214px; }
  main { padding: 30px 30px 50px; }
  .topbar, .footer { padding-inline: 30px; }
  .hero { padding: 30px; }
  .hero-art { min-width: 205px; width: 205px; transform: scale(.85); margin-right: -10px; }
  .hero-hint { display: none; }
  .test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: minmax(0, 1fr) 185px; gap: 18px; }
  .question-side { padding: 18px 13px; }
  .question-map { gap: 5px; }
  .stat { padding: 18px; gap: 11px; }
  .stat-icon { width: 35px; height: 38px; }
}
@media (max-width: 950px) {
  .hero-art { min-width: 160px; width: 160px; transform: scale(.72); margin-right: -12px; }
  .hero h1 { font-size: 33px; }
  .hero { gap: 0; }
  .stats { gap: 10px; }
  .stat { padding: 17px 15px; }
  .stat-icon { display: none; }
  .stat small { font-size: 10px; }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .question-side { position: static; }
  .question-side .question-map { grid-template-columns: repeat(13, 1fr); }
  .question-side .btn { width: auto; float: right; margin-top: 12px; }
  .question-side::after { content: ''; display: block; clear: both; }
  #save-status { text-align: left; padding-top: 14px; }
  .question-side h3 { margin-bottom: 14px; }
  .gap-input { font-size: 16px; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(79px + env(safe-area-inset-bottom)); }
  .sidebar { position: static; width: auto; padding: 20px 23px; border-right: 0; border-bottom: 1px solid var(--line); background: #fff; }
  .brand { font-size: 24px; gap: 10px; }
  .brand-mark { height: 40px; width: 40px; border-radius: 12px 12px 12px 4px; }
  .brand-small { font-size: 8px; letter-spacing: 2.5px; margin-top: 6px; }
  .side-caption, .side-note, .side-footer { display: none; }
  nav { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 9px 14px calc(9px + env(safe-area-inset-bottom)); background: #fffffff5; border-top: 1px solid #dce4d4; box-shadow: 0 -4px 25px #203e3708; backdrop-filter: blur(12px); }
  nav a { flex-direction: column; justify-content: center; gap: 5px; border-radius: 9px; padding: 8px 3px; font-size: 10px; min-height: 58px; line-height: 1.3; }
  nav a .icon { width: 20px; height: 20px; }
  nav a.active::after { display: none; }
  .shell { margin-left: 0; }
  .topbar { height: 50px; padding: 0 23px; font-size: 11px; }
  .avatar { height: 29px; width: 29px; }
  main { padding: 24px 23px 40px; }
  .hero { padding: 28px; min-height: 295px; }
  .hero h1 { font-size: 35px; }
  .hero-art { width: 200px; min-width: 200px; transform: scale(.8); margin-right: -15px; }
  .hero p { font-size: 12px; }
  .hero-actions { margin-top: 20px; }
  .stats { gap: 12px; margin-bottom: 30px; }
  .stat { padding: 18px; }
  .stat-icon { display: grid; }
  .stat strong { font-size: 25px; }
  .stat small { font-size: 10px; }
  .section-heading h2 { font-size: 22px; }
  .section-heading > .small { font-size: 10px; }
  .question { padding: 24px; }
  .work-header h1 { font-size: 29px; }
  .timer { min-width: 145px; font-size: 26px; padding: 12px; }
  .timer small { font-size: 8px; }
  .question-side .question-map { grid-template-columns: repeat(10, 1fr); gap: 8px; }
  .question-map button { min-height: 38px; font-size: 12px; }
  .question-side { padding: 20px; }
  .legend { font-size: 11px; }
  .footer { padding: 20px 23px; }
  #toast { bottom: calc(93px + env(safe-area-inset-bottom)); }
}
@media (max-width: 540px) {
  .sidebar { padding: 17px 20px; }
  .topbar { padding: 0 20px; }
  main { padding: 21px 18px 35px; }
  .hero { padding: 26px; min-height: 0; position: relative; }
  .hero-copy { width: 100%; }
  .hero .eyebrow { font-size: 9px; letter-spacing: 1.3px; margin-bottom: 16px; }
  .hero h1 { font-size: 34px; letter-spacing: -1.4px; line-height: 1.25; }
  .hero h1 em { letter-spacing: -1.5px; }
  .hero-art { display: none; }
  .hero-actions .btn { min-height: 44px; }
  .hero p { line-height: 1.8; }
  .stats { gap: 9px; }
  .stat { padding: 16px 12px; }
  .stat-icon { display: none; }
  .stat strong { font-size: 25px; }
  .stat small { font-size: 10px; line-height: 1.6; max-width: 83px; }
  .section-heading { flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .section-heading h2 { font-size: 23px; }
  .section-heading > .small { display: none; }
  .pill { font-size: 9px; margin-left: 8px; }
  .filters { flex-direction: column; align-items: stretch; gap: 13px; margin-top: 16px; }
  .segmented button { flex: 1; min-height: 37px; padding: 7px 9px; font-size: 11px; }
  .search { width: 100%; font-size: 14px; padding-block: 12px; }
  .test-grid { gap: 13px; }
  .card-body { padding: 17px; }
  .card-top { gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
  .test-icon { width: 33px; height: 34px; border-radius: 10px; }
  .test-icon .icon { width: 19px; height: 19px; }
  .test-index { display: none; }
  .status { font-size: 8px; padding: 3px 5px; }
  .test-card h3 { font-size: 15px; letter-spacing: -.4px; white-space: nowrap; }
  .test-card p { font-size: 10px; line-height: 1.5; margin-top: 5px; margin-bottom: 15px; }
  .meta { gap: 9px; font-size: 10px; }
  .meta .icon { width: 12px; height: 12px; }
  .card-bottom { flex-direction: column; align-items: stretch; gap: 4px; padding: 11px 14px; font-size: 10px; }
  .card-bottom > span { display: none; }
  .card-bottom .text-button { justify-content: space-between; min-height: 31px; font-size: 12px; }
  .footer { padding: 20px; flex-direction: column; gap: 5px; }
  .work-header { gap: 10px; margin: 13px 0 23px; align-items: center; }
  .work-header h1 { font-size: 25px; letter-spacing: -.7px; }
  .work-header .eyebrow { font-size: 9px; letter-spacing: 1.2px; }
  .work-header .small { font-size: 10px; }
  .timer { min-width: 111px; width: 111px; padding: 11px 7px; font-size: 24px; border-radius: 9px; }
  .timer small { font-size: 7px; line-height: 1.5; letter-spacing: .3px; }
  .part-tabs { gap: 6px; margin-bottom: 14px; }
  .part-tabs button { padding: 9px 8px; min-height: 56px; font-size: 12px; }
  .part-tabs button small { font-size: 9px; }
  .player-box { padding: 17px; top: 8px; }
  .player-head { font-size: 13px; }
  .player-head .icon { width: 18px; }
  .player-tools { gap: 11px; font-size: 11px; }
  .player-tools button, .player-tools select { min-height: 34px; padding: 5px 7px; }
  .player-tools input { height: 16px; width: 16px; }
  .audio-badge { font-size: 9px; }
  .instructions { font-size: 13px; margin: 21px 0; }
  .question { padding: 19px 17px; border-radius: 11px; scroll-margin-top: 210px; }
  .q-head { gap: 6px; margin-bottom: 17px; }
  .q-prompt { font-size: 15px; gap: 9px; line-height: 1.65; }
  .q-number { min-width: 25px; height: 26px; font-size: 11px; border-radius: 6px; }
  .flag { width: 29px; height: 30px; }
  .flag .icon { width: 16px; }
  .question img { margin-bottom: 19px; }
  .option { min-height: 48px; font-size: 14px; padding: 11px 12px; gap: 10px; }
  .image-options .option { justify-content: center; padding-inline: 7px; }
  .gap-document { padding: 22px 20px; font-size: 16px; line-height: 2; }
  .gap-document p { margin-bottom: 19px; }
  .gap-document p:first-child { font-size: 13px; }
  .gap-input { width: 165px; font-size: 16px; min-height: 44px; }
  .gap-document .answer-note { display: inline-block; font-size: 11px; }
  .transcript { padding: 20px; }
  .transcript p { font-size: 14px; }
  .question-side .question-map { grid-template-columns: repeat(7, 1fr); gap: 7px; }
  .question-map button { height: 38px; }
  .question-side .btn { min-height: 44px; font-size: 13px; }
  .part-controls .btn { padding: 11px 15px; font-size: 12px; }
  .result-banner { flex-direction: column; align-items: flex-start; padding: 25px; gap: 21px; }
  .score-circle { width: 96px; height: 96px; font-size: 29px; }
  .result-banner h2 { font-size: 23px; }
  .result-banner p { font-size: 13px; }
  .result-banner .actions { gap: 9px; }
  .history-row { flex-wrap: wrap; gap: 13px; padding: 19px; }
  .history-row > div { min-width: 100%; }
  .history-row .text-button { margin-left: auto; }
  .settings-card { padding: 23px; }
  .settings-card h2 { font-size: 21px; }
  .field input { font-size: 16px; }
  dialog { padding: 26px; }
  dialog h2 { font-size: 25px; }
  .mode-card { padding: 15px; }
}
@media (max-width: 360px) {
  main { padding-inline: 14px; }
  .hero { padding: 23px; }
  .hero h1 { font-size: 30px; }
  .card-body { padding: 14px 12px; }
  .test-card h3 { font-size: 14px; }
  .status { font-size: 7px; }
  .meta { gap: 6px; font-size: 9px; }
  .timer { min-width: 100px; width: 100px; }
  .work-header h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
