:root {
  --ink: #192126;
  --muted: #66727a;
  --line: #dce3e6;
  --surface: #ffffff;
  --page: #f4f6f5;
  --dark: #17262c;
  --dark-2: #21373e;
  --red: #c93032;
  --red-dark: #a72126;
  --orange: #ef9f31;
  --mint: #dcefe8;
  --green: #167454;
  --green-bg: #e8f6f0;
  --danger: #b12d35;
  --danger-bg: #fff0f1;
  --shadow: 0 12px 30px rgba(22, 42, 48, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }

.app-shell { min-height: 100vh; }
.topbar {
  background: var(--dark); color: #fff; min-height: 74px; padding: 0 5.5vw;
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: fit-content; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--red); display: grid; place-items: center; font-weight: 850; box-shadow: 0 4px 12px rgba(201, 48, 50, .42); }
.brand p, .brand h1 { margin: 0; }
.brand h1 { font-size: 14px; letter-spacing: .045em; text-transform: uppercase; }
.brand p { color: #b8c8ca; font-size: 11px; margin-top: 2px; }
.nav { display: flex; align-items: stretch; align-self: stretch; gap: 3px; }
.nav button { position: relative; color: #c8d5d7; background: transparent; border: 0; padding: 0 14px; font-size: 13px; font-weight: 650; }
.nav button:hover, .nav button.active { color: #fff; }
.nav button.active::after { content: ""; position: absolute; height: 3px; left: 14px; right: 14px; bottom: 0; background: var(--orange); border-radius: 4px 4px 0 0; }
.sync-account { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-left: auto; min-width: 0; font-size: 11px; font-weight: 750; }
.sync-state { color: #c8d5d7; white-space: nowrap; }
.sync-state.connected { color: #9fe0c6; }
.sync-state.offline { color: #ffcf7f; }
.sync-signin, .account-link { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 7px 9px; white-space: nowrap; }
.sync-signin { background: rgba(255,255,255,.11); }
.account-link { color: #d9e7e7; max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
.mobile-nav { display: none; }

.page { width: min(1190px, 89vw); margin: 0 auto; padding: 38px 0 60px; }
.eyebrow { margin: 0 0 7px; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; margin: 0; line-height: 1.08; }
.page-heading p { color: var(--muted); max-width: 590px; margin: 9px 0 0; line-height: 1.55; font-size: 14px; }

.hero { background: linear-gradient(128deg, #1a2e35 0%, #24444b 58%, #2d5c5b 100%); color: #fff; border-radius: 22px; padding: clamp(27px, 5vw, 54px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 34px; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.hero::after { content: ""; width: 340px; height: 340px; border-radius: 50%; border: 56px solid rgba(239, 159, 49, .13); position: absolute; right: -160px; top: -168px; }
.hero h2 { font-size: clamp(32px, 4vw, 49px); line-height: 1; letter-spacing: -.055em; margin: 8px 0 15px; position: relative; z-index: 1; }
.hero h2 span { color: #f8bd63; }
.hero p { max-width: 590px; color: #d6e4e3; line-height: 1.58; font-size: 15px; margin: 0 0 23px; position: relative; z-index: 1; }
.hero .eyebrow { color: #ffc76d; }
.hero-card { position: relative; z-index: 1; align-self: end; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255,255,255,.2); border-radius: 16px; padding: 20px; backdrop-filter: blur(6px); }
.hero-card strong { display: block; font-size: 32px; letter-spacing: -.05em; }
.hero-card p { font-size: 13px; margin: 2px 0 14px; }
.hero-card .progress-track { background: rgba(255,255,255,.2); }
.hero-card .progress-fill { background: #f4b758; }
.sync-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px 0 0; padding: 15px 17px; background: #eef6f4; border: 1px solid #cbe2da; border-radius: 13px; color: #38514d; }
.sync-notice strong { display: block; color: #1e5e4b; font-size: 13px; }
.sync-notice p { margin: 4px 0 0; color: #526a66; line-height: 1.42; font-size: 12px; }
.sync-notice .sync-state { color: #167454; font-size: 12px; }
.sync-notice .sync-state.offline { color: #98570a; }
.sync-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }

.button { border: 0; border-radius: 10px; min-height: 42px; padding: 0 17px; font-size: 14px; font-weight: 750; transition: transform .15s, background .15s, border-color .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--red); box-shadow: 0 7px 15px rgba(170, 35, 38, .27); }
.button.primary:hover:not(:disabled) { background: var(--red-dark); }
.button.warm { color: #412600; background: #ffc467; }
.button.ghost { color: var(--dark-2); background: #fff; border: 1px solid var(--line); }
.button.ghost:hover:not(:disabled) { border-color: #aebabe; background: #fdfefe; }
.button.subtle { color: var(--red-dark); background: #fff5f5; border: 1px solid #f5d6d7; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.hero .button { position: relative; z-index: 1; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 22px 0 34px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric strong { display: block; margin-top: 4px; font-size: 27px; letter-spacing: -.045em; }
.metric .metric-note { margin-top: 6px; color: var(--green); font-size: 11px; font-weight: 700; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 15px; }
.section-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.section-heading p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.section-heading a, .text-button { color: var(--red-dark); background: none; border: 0; font-weight: 750; font-size: 13px; padding: 5px 0; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.topic { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 18px; text-align: left; transition: .15s; }
.topic:hover { transform: translateY(-2px); border-color: #c1ccce; box-shadow: 0 9px 22px rgba(15,35,39,.07); }
.topic .topic-icon { height: 30px; width: 30px; display: grid; place-items: center; border-radius: 9px; background: #fff3e0; color: #9f5b00; font-size: 15px; margin-bottom: 13px; }
.topic:nth-child(2) .topic-icon { background: #e7f3f0; color: #0e7153; }
.topic:nth-child(3) .topic-icon { background: #fbe7e7; color: #a9292d; }
.topic:nth-child(4) .topic-icon { background: #e9eefb; color: #314c9b; }
.topic:nth-child(5) .topic-icon { background: #f2eafb; color: #7c3e9b; }
.topic:nth-child(6) .topic-icon { background: #edf0f2; color: #3f5058; }
.topic strong { display: block; font-size: 14px; }
.topic span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }

.config-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 25px; box-shadow: 0 8px 23px rgba(20,38,43,.035); }
.panel h3 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.panel > p { margin: 6px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.field-group { margin-top: 23px; }
.field-label { display: block; font-size: 13px; font-weight: 770; margin-bottom: 9px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 6px 0 0; }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.segmented { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { min-height: 60px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: #4a5a60; font-size: 13px; line-height: 1.25; cursor: pointer; transition: .14s; }
.segmented label small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.segmented input:checked + label { border-color: var(--red); background: #fff5f5; color: var(--red-dark); box-shadow: 0 0 0 2px rgba(201,48,50,.07); font-weight: 750; }
.theme-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check-label { border: 1px solid var(--line); min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; color: #415057; font-size: 12px; cursor: pointer; }
.check-label:has(input:checked) { border-color: #e9afb0; background: #fff7f7; color: var(--red-dark); font-weight: 700; }
.check-label input { accent-color: var(--red); }
.source-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 275px; overflow: auto; padding-right: 4px; }
.source-check-label { border: 1px solid var(--line); min-height: 48px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; color: #415057; font-size: 11px; line-height: 1.25; cursor: pointer; }
.source-check-label:has(input:checked) { border-color: #e9afb0; background: #fff7f7; color: var(--red-dark); font-weight: 700; }
.source-check-label input { accent-color: var(--red); }
.source-check-label em { min-width: 22px; font-style: normal; text-align: center; padding: 3px 5px; border-radius: 99px; color: #5d6b70; background: #edf1f1; font-size: 10px; font-weight: 800; }
.source-check-label:has(input:checked) em { background: #f8dfe0; color: var(--red-dark); }
.select { border: 1px solid var(--line); border-radius: 10px; color: var(--ink); width: 100%; height: 43px; padding: 0 11px; background: #fff; }
.config-summary { background: var(--dark-2); color: #fff; border-radius: 16px; padding: 25px; align-self: start; }
.config-summary .eyebrow { color: #ffcd7a; }
.config-summary p { color: #c9d8d8; font-size: 13px; line-height: 1.5; }
.config-summary ul { list-style: none; padding: 0; margin: 21px 0 25px; }
.config-summary li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.13); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.config-summary li span:last-child { color: #ffcf7f; text-align: right; }
.config-summary .button { width: 100%; }
.saved-session { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 0 0 22px; padding: 18px 20px; border: 1px solid #b9ddd1; border-radius: 14px; background: #edf8f4; }
.saved-session .eyebrow { margin: 0 0 3px; color: #147056; }
.saved-session h3 { margin: 0; font-size: 16px; color: #1d4037; }
.saved-session p:not(.eyebrow) { margin: 5px 0 0; color: #49645e; font-size: 13px; line-height: 1.45; }
.saved-session-actions { display: flex; align-items: center; gap: 13px; flex: none; }
.error-home { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 22px 0 34px; padding: 19px 21px; background: #fff7f7; border: 1px solid #f0cbcd; border-radius: 15px; }
.error-home .eyebrow { margin-bottom: 3px; }.error-home h3 { margin: 0; font-size: 17px; }.error-home p:not(.eyebrow) { margin: 5px 0 0; color: #5a686d; font-size: 13px; }
.mistake-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.mistake-summary article { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; }.mistake-summary article:first-child { border-color: #f0bfc2; background: #fff7f7; }.mistake-summary span { color: var(--muted); font-size: 12px; font-weight: 700; }.mistake-summary strong { display: block; margin-top: 4px; color: var(--danger); font-size: 27px; letter-spacing: -.045em; }.mistake-summary article:not(:first-child) strong { color: var(--dark-2); }.mistake-summary p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.most-error-metric { border-color: #f6d49a !important; background: #fff9ee !important; }.mistake-summary .most-error-metric strong { color: #9b5a00; font-size: clamp(16px, 1.6vw, 23px); line-height: 1.14; }.recovery-rate { color: var(--green); font-size: 12px; font-weight: 780; white-space: nowrap; }
.error-topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 12px; margin: 0 0 24px; }.error-topic-card { padding: 15px; border-radius: 13px; border: 1px solid var(--line); background: #fff; }.error-topic-card.most-errors { border-color: #e9b9bc; background: #fff8f8; }.error-topic-card > div { display: flex; justify-content: space-between; gap: 8px; color: #445359; font-size: 12px; font-weight: 770; }.error-topic-card em { color: #a42e34; font-size: 10px; font-style: normal; text-transform: uppercase; letter-spacing: .05em; }.error-topic-card strong { display: block; margin-top: 8px; color: var(--danger); font-size: 25px; letter-spacing: -.045em; }.error-topic-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.mistake-config { display: grid; grid-template-columns: minmax(220px, .56fr) minmax(0, 1.44fr); gap: 25px; margin: 28px 0; padding: 25px; border: 1px solid #cbdcda; border-radius: 17px; background: #f0f8f6; }.mistake-config .eyebrow { color: #147056; }.mistake-config h3 { margin: 0; color: #1d4037; font-size: 20px; letter-spacing: -.025em; }.mistake-config > div > p:not(.eyebrow) { margin: 7px 0 0; color: #526a66; font-size: 13px; line-height: 1.5; }.mistake-config-grid { min-width: 0; }.mistake-config-grid .field-group { margin-top: 0; margin-bottom: 17px; }.mistake-scope-row { grid-template-columns: repeat(2, 1fr); }.error-topic-selects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }.error-topic-select { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 58px; border: 1px solid #c8d8d7; border-radius: 10px; padding: 9px 10px; color: #344d49; background: #fff; cursor: pointer; }.error-topic-select:has(input:checked) { border-color: #57a68b; background: #f5fcf9; box-shadow: 0 0 0 2px rgba(22,116,84,.07); }.error-topic-select input { accent-color: var(--green); }.error-topic-icon { color: var(--green); font-size: 15px; }.error-topic-select strong, .error-topic-select small { display: block; }.error-topic-select strong { font-size: 12px; line-height: 1.25; }.error-topic-select small { margin-top: 2px; color: #657773; font-size: 10px; line-height: 1.25; }.error-topic-select em { padding: 3px 6px; border-radius: 99px; color: #24664f; background: #ddf0e9; font-size: 10px; font-style: normal; font-weight: 800; }.mistake-start { width: 100%; }
.mistake-list { display: grid; gap: 12px; }.mistake-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }.mistake-card h3 { margin: 9px 0 8px; font-size: 15px; line-height: 1.4; }.mistake-meta, .mistake-answer { margin: 4px 0 0; color: #5a676c; font-size: 12px; line-height: 1.45; }.mistake-answer { color: #8a4348; }.mistake-pending { background: #fde8e9; color: #a32930; }.mistake-resolved { background: #e8f6f0; color: #167454; }

.filter-row { display: grid; grid-template-columns: 1.1fr .55fr .55fr; gap: 10px; margin-bottom: 22px; }
.search { border: 1px solid var(--line); border-radius: 10px; min-height: 43px; width: 100%; padding: 0 12px; background: #fff; }
.search:focus, .select:focus { outline: 3px solid rgba(201,48,50,.12); border-color: #dc7779; }
.question-list { display: grid; gap: 12px; }
.question-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 19px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.question-card h3 { font-size: 15px; margin: 9px 0 0; line-height: 1.4; font-weight: 710; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: #ecf1f1; color: #516168; }
.chip.source { background: #fff0dd; color: #955807; }
.chip.mastered { background: #e8f6f0; color: #157054; }
.chip.noted { background: #edf0fb; color: #3f5795; }
.empty { padding: 37px 20px; border: 1px dashed #b9c5c8; border-radius: 13px; text-align: center; color: var(--muted); background: rgba(255,255,255,.55); }

.practice-shell { max-width: 880px; margin: 0 auto; }
.practice-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.practice-top .text-button { color: var(--muted); }
.practice-save-controls > div { display: flex; flex-wrap: wrap; gap: 8px; }
.practice-save-controls p { margin: 6px 0 0; color: #397460; font-size: 11px; font-weight: 700; }
.discard-session { color: #8d5255; }
.practice-progress { margin: 0 0 24px; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; font-weight: 700; }
.progress-track { background: #dfe7e7; height: 8px; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--red); border-radius: inherit; transition: width .3s ease; }
.question-stage { background: #fff; border: 1px solid var(--line); border-radius: 19px; padding: clamp(23px, 4vw, 40px); box-shadow: var(--shadow); }
.question-stage h2 { font-size: clamp(21px, 3vw, 28px); line-height: 1.28; letter-spacing: -.035em; margin: 13px 0 25px; }
.question-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.answers { display: grid; gap: 10px; }
.answer { width: 100%; display: flex; text-align: left; align-items: center; gap: 13px; min-height: 61px; border-radius: 11px; padding: 11px 15px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; line-height: 1.35; transition: .14s; }
.answer:hover:not(:disabled) { border-color: #b2c0c3; background: #fbfdfd; }
.answer .letter { flex: none; display: grid; place-items: center; width: 26px; height: 26px; background: #eef2f2; border-radius: 50%; font-size: 11px; color: #607078; font-weight: 850; }
.answer.selected { border: 2px solid var(--red); background: #fff7f7; padding: 10px 14px; }
.answer.selected .letter { background: var(--red); color: #fff; }
.answer.correct { border: 2px solid var(--green); background: var(--green-bg); padding: 10px 14px; }
.answer.correct .letter { background: var(--green); color: #fff; }
.answer.incorrect { border: 2px solid var(--danger); background: var(--danger-bg); padding: 10px 14px; }
.answer.incorrect .letter { background: var(--danger); color: #fff; }
.practice-actions { display: flex; justify-content: space-between; align-items: center; gap: 13px; margin-top: 23px; }
.practice-actions .source-link { margin-right: auto; }
.feedback { margin-top: 20px; padding: 16px; border-radius: 11px; border: 1px solid #bee1d2; background: var(--green-bg); }
.feedback.bad { border-color: #f0c5c8; background: var(--danger-bg); }
.feedback h3 { margin: 0 0 5px; color: var(--green); font-size: 15px; }
.feedback.bad h3 { color: var(--danger); }
.feedback p { margin: 0; color: #405057; font-size: 13px; line-height: 1.52; }
.reflection-card { margin-top: 16px; padding: 17px; border-radius: 11px; border: 1px solid #d7e2e4; background: #f8fbfb; }
.reflection-card h3 { margin: 0; color: #273c42; font-size: 14px; }
.reflection-card > div > p { margin: 4px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.reflection-label { display: block; margin-bottom: 7px; color: #43545a; font-size: 12px; font-weight: 770; }
.reflection-card textarea { display: block; width: 100%; min-height: 105px; resize: vertical; border: 1px solid #bcc9cd; border-radius: 9px; padding: 11px 12px; color: var(--ink); line-height: 1.45; background: #fff; }
.reflection-card textarea:focus { outline: 3px solid rgba(22,116,84,.12); border-color: #5fac94; }
.reflection-status { margin: 7px 0 0; color: #55716a; font-size: 11px; line-height: 1.4; }
.source-link { border: 0; background: transparent; color: var(--red-dark); font-weight: 750; font-size: 13px; padding: 8px 0; }

.history-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; margin-bottom: 25px; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 20px; }
.chart-card h3 { margin: 0; font-size: 15px; }
.chart-card p { margin: 4px 0 16px; color: var(--muted); font-size: 12px; }
.bar-chart { height: 106px; display: flex; align-items: end; gap: 9px; padding-top: 8px; }
.bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; gap: 5px; min-width: 25px; }
.bar { background: linear-gradient(to top, var(--red), #ea8885); min-height: 3px; border-radius: 5px 5px 2px 2px; }
.bar-wrap span { font-size: 9px; color: var(--muted); white-space: nowrap; text-align: center; overflow: hidden; }
.theme-score { display: grid; gap: 11px; }
.theme-line { display: grid; grid-template-columns: 135px 1fr 37px; align-items: center; gap: 8px; font-size: 11px; color: #435157; }
.theme-line .progress-track { height: 7px; }
.theme-line em { font-style: normal; font-weight: 780; text-align: right; }
.session-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.session-table th, .session-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #edf0f1; font-size: 13px; }
.session-table th { background: #f6f8f8; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #718087; }
.session-table tr:last-child td { border-bottom: 0; }
.score-good { color: var(--green); font-weight: 800; }.score-low { color: var(--danger); font-weight: 800; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(18, 29, 32, .62); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal { background: #fff; width: min(690px, 100%); border-radius: 17px; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,.32); }
.modal-header { padding: 21px 24px 15px; display: flex; gap: 18px; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #eef1f1; }
.modal-header h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.03em; }.modal-header p { margin: 0; font-size: 11px; color: var(--muted); font-weight: 700; }
.close { border: 0; background: #eef2f2; width: 32px; height: 32px; border-radius: 50%; color: #4f6066; font-size: 20px; line-height: 1; }
.modal-body { padding: 22px 24px; }.modal-body > p { color: #4a5b61; line-height: 1.55; font-size: 13px; }
.citation { margin: 18px 0; border-left: 4px solid var(--orange); background: #fff8ee; padding: 17px; color: #46565b; line-height: 1.58; font-size: 14px; }
mark { background: #ffe183; padding: 1px 3px; border-radius: 2px; font-weight: 800; color: #443400; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #eef1f1; display: flex; justify-content: flex-end; gap: 10px; }
.notice { padding: 13px 15px; font-size: 12px; line-height: 1.45; color: #5b696e; background: #f5f8f8; border: 1px solid #e3e9e9; border-radius: 9px; }
.detail-grid { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(400px, 1.25fr); gap: 19px; align-items: start; }
.detail-answer { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 22px; }
.detail-answer h3 { margin: 0 0 10px; font-size: 15px; }.detail-answer p { color: #526167; font-size: 13px; line-height: 1.55; }
.answer-key { color: #27383d !important; font-size: 16px !important; font-weight: 760; }.detail-answer .citation { margin: 18px 0 0; font-size: 13px; }
.pdf-frame { min-height: 670px; width: 100%; border: 1px solid var(--line); border-radius: 15px; background: #fff; overflow: hidden; }.pdf-frame iframe { width: 100%; height: 670px; border: 0; }
.pdf-frame-highlight { min-height: 0; }
.pdf-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.pdf-toolbar strong { display: block; color: #304248; font-size: 13px; }.pdf-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pdf-status { flex: none; color: #1a7054; font-size: 11px; font-weight: 750; text-align: right; line-height: 1.35; }
.pdf-highlight-viewer { min-height: 420px; max-height: 720px; overflow: auto; padding: 14px; background: #dfe6e5; }
.pdf-canvas-host { position: relative; margin: 0 auto; box-shadow: 0 4px 14px rgba(20, 36, 40, .2); background: #fff; }
.pdf-canvas-host canvas { display: block; }.pdf-highlight-layer { position: absolute; inset: 0; pointer-events: none; }
.pdf-text-highlight { position: absolute; display: block; background: rgba(255, 223, 74, .57); border: 1px solid rgba(177, 126, 0, .65); border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset; }
.pdf-load-error { margin: 0; padding: 18px; color: var(--muted); text-align: center; font-size: 13px; }

@media (max-width: 840px) {
  .topbar { padding: 0 5vw; }.nav { display: none; }.mobile-nav { display: block; border: 0; background: #2b4249; color: #fff; border-radius: 8px; padding: 9px; }
  .hero, .config-grid, .detail-grid, .mistake-config { grid-template-columns: 1fr; }.hero-card { max-width: 360px; }.metric-grid, .mistake-summary { grid-template-columns: repeat(2, 1fr); }.topic-grid { grid-template-columns: repeat(2, 1fr); }.error-topic-selects { grid-template-columns: 1fr; }.filter-row { grid-template-columns: 1fr 1fr; }.filter-row .search { grid-column: span 2; }
}
@media (max-width: 570px) {
  .page { width: min(92vw, 1190px); padding-top: 27px; }.topbar { min-height: 66px; gap: 10px; }.brand h1 { font-size: 12px; }.brand p { display: none; }.brand-mark { width: 31px; height: 31px; }.sync-account { gap: 5px; }.sync-state { display: none; }.sync-signin, .account-link { padding: 6px 7px; max-width: 106px; }.page-heading { display: block; }.metric-grid, .mistake-summary { gap: 9px; grid-template-columns: 1fr; }.metric, .mistake-summary article { padding: 14px; }.metric strong, .mistake-summary strong { font-size: 22px; }.sync-notice { align-items: flex-start; flex-direction: column; gap: 11px; }.sync-actions { align-items: stretch; width: 100%; }.sync-notice .button { width: 100%; }.topic-grid, .error-topic-grid, .error-topic-selects, .mistake-scope-row { grid-template-columns: 1fr; }.choice-row { grid-template-columns: 1fr; }.theme-checks, .source-checks { grid-template-columns: 1fr; }.error-home { align-items: flex-start; flex-direction: column; gap: 14px; }.error-home .button { width: 100%; }.mistake-config { gap: 18px; margin: 20px 0; padding: 18px; }.mistake-card { grid-template-columns: 1fr; gap: 13px; }.mistake-card .button { width: 100%; }.question-card { grid-template-columns: 1fr; gap: 13px; }.question-card .button { width: 100%; }.saved-session { align-items: flex-start; flex-direction: column; gap: 14px; }.saved-session-actions { width: 100%; flex-wrap: wrap; }.saved-session-actions .button { flex: 1; }.practice-top { align-items: flex-start; }.practice-save-controls { width: 100%; }.practice-save-controls > div .button { flex: 1; }.practice-top > .chip { flex: none; }.practice-actions { flex-wrap: wrap; }.practice-actions .source-link { order: 3; width: 100%; }.history-summary { grid-template-columns: 1fr; }.session-table th:nth-child(2), .session-table td:nth-child(2) { display: none; }.theme-line { grid-template-columns: 108px 1fr 33px; }.modal-footer { flex-wrap: wrap; }.modal-footer .button { width: 100%; }
}
