:root {
  --ink: #18303d;
  --muted: #526b76;
  --bg: #eef3f4;
  --card: #ffffff;
  --line: #d5e1e3;
  --teal: #166e61;
  --mint: #e7f3ee;
  --nav: #112c3b;
  --gold: #b98227;
  --green: #12683f;
  --red: #ae293a;
  --redbg: #fff0f2;
  --greenbg: #e9f7ed;
  --selected: #284f9b;
  --selectedbg: #eef3ff;
  --shadow: 0 14px 38px #123d4e08, 0 2px 4px #123d4e04;
  --reading: 18px;
  --radius: 20px;
  --nav-width: 224px;
}
:root[data-theme="dark"] {
  --ink: #e9f1f2;
  --muted: #afc2cb;
  --bg: #0c1c28;
  --card: #162d3b;
  --line: #355060;
  --mint: #1b3c39;
  --teal: #80dcc0;
  --nav: #081a26;
  --gold: #e3b869;
  --green: #90e4ad;
  --red: #ffb0b7;
  --redbg: #482d3c;
  --greenbg: #244637;
  --selected: #b4caff;
  --selectedbg: #293e60;
  --shadow: 0 14px 38px #0002, 0 2px 4px #0001;
  color-scheme: dark;
}
:root.large-font { --reading: 22px; }
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, 'Noto Sans Hebrew', sans-serif; line-height: 1.7; }
main, section, article, aside, nav, header, footer, div, p, h1, h2, h3, h4 { min-width: 0; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .48; transform: none !important; box-shadow: none !important; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--selected); outline-offset: 4px; }
input, select, textarea { min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); padding: 12px 14px; box-shadow: inset 0 2px 3px #18303d04; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
label { display: block; font-size: 14px; font-weight: 700; }
textarea { resize: vertical; }
h1, h2, h3, h4, p { margin-top: 0; overflow-wrap: break-word; word-break: normal; }
h1 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.3; letter-spacing: -.7px; }
h2 { font-size: 27px; line-height: 1.45; }
h3 { font-size: 21px; line-height: 1.5; }
h4 { font-size: 17px; line-height: 1.6; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.hidden { display: none !important; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.8; }
.small { font-size: 14px; }
.full { width: 100%; }
.good-text { color: var(--green); }
.bad-text { color: var(--red); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 48px; height: 48px; flex: none; border-radius: 14px; box-shadow: 0 5px 14px #0002; }
.brand strong { display: block; font-size: 28px; line-height: 1.1; letter-spacing: -.8px; }
.brand span { display: block; font-size: 12px; letter-spacing: 2.3px; }
.brand.inverse { color: #f3f7f4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 12px 21px; border: 1px solid transparent; border-radius: 13px; font-weight: 700; font-size: 15px; line-height: 1.5; text-align: center; white-space: normal; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.button.primary { background: linear-gradient(165deg, #237f70, #125d54); color: #fff; border-color: #0e5149; box-shadow: 0 4px 0 #0b443e, 0 9px 18px #145e5424, inset 0 1px 0 #ffffff40; }
.button.secondary { background: linear-gradient(165deg, #f2faf6, #dceee6); color: #185e51; border-color: #bad7cb; box-shadow: 0 3px 0 #b1cec2, 0 7px 15px #204d3610, inset 0 1px 0 #fff; }
.button.outline { background: linear-gradient(170deg, var(--card), var(--bg)); color: var(--ink); border-color: var(--line); box-shadow: 0 3px 0 var(--line), 0 6px 12px #16344808; }
.button.danger, .button.reset-button { background: var(--redbg); color: var(--red); border-color: #be61716b; box-shadow: 0 3px 0 #be617144, 0 6px 12px #8d273308; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #18303d20, inset 0 2px 4px #0001; }
:root[data-theme="dark"] .button.primary { background: linear-gradient(165deg, #99e4ce, #61bc9f); color: #102e2b; border-color: #6dc5ab; box-shadow: 0 4px 0 #3f8d79, 0 9px 18px #0002, inset 0 1px 0 #ffffff66; }
:root[data-theme="dark"] .button.secondary { background: linear-gradient(165deg, #254a45, #1b3737); color: #a5e6d2; border-color: #456c64; box-shadow: 0 3px 0 #34564d, 0 7px 15px #0002; }
.text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 11px; border-radius: 10px; background: transparent; color: var(--teal); font-size: 14px; line-height: 1.6; font-weight: 700; text-align: center; }
.text-button:hover { background: var(--mint); }
.text-button.reset-button { color: var(--red); background: var(--redbg); border: 1px solid #be61716b; }
.icon-button { display: inline-grid; place-items: center; width: 46px; min-width: 46px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); font-size: 20px; box-shadow: 0 3px 0 var(--line); }
.icon-button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

.access-screen { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); background: var(--card); }
.access-art { position: relative; overflow: hidden; padding: 60px; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 80% 20%, #245264, var(--nav) 70%); color: #f8f6ee; }
.access-art > img { width: 105px; margin-bottom: 40px; }
.access-art h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.35; max-width: 440px; }
.access-art > p { color: #bbd1d6; font-size: 20px; }
.art-lines { position: absolute; left: -190px; bottom: -170px; width: 510px; height: 510px; border: 1px solid #9cc8c150; border-radius: 50%; box-shadow: 0 0 0 42px #9cc8c113, 0 0 0 90px #9cc8c10e, 0 0 0 145px #9cc8c108; pointer-events: none; }
.access-content { width: 100%; max-width: 660px; padding: 40px 48px; margin: auto; }
.access-content .brand { margin-bottom: 28px; }
.access-content h1 { margin-bottom: 17px; }
.access-content h2 { margin: 15px 0; font-size: 34px; line-height: 1.4; }
.access-content label { margin-top: 20px; margin-bottom: 6px; }
.access-content input, .access-content textarea { width: 100%; }
.access-content .button { margin-top: 16px; }
.id-row { display: flex; align-items: stretch; gap: 8px; }
.id-row input { font: 12px/1.6 monospace; letter-spacing: .2px; }
.id-row .button { margin: 0; padding: 10px 14px; }
.id-row code { display: block; width: 100%; overflow-wrap: anywhere; padding: 12px; background: var(--bg); border-radius: 10px; font-size: 12px; user-select: all; }
.device-tag { display: block; max-width: 100%; margin: 0 0 15px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.device-tag summary { min-height: 44px; cursor: pointer; font-size: 13px; }
.access-message { min-height: 28px; margin: 15px 0; color: var(--red); font-size: 14px; }
.access-footer { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.activation-device { margin: 23px 0 28px; padding: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.activation-step { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.activation-step > span { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: var(--teal); font-size: 13px; font-weight: 700; }
.activation-step h3, .activation-step label { margin: 0 !important; font-size: 15px; }
.activation-device .id-row code { background: var(--card); border: 1px solid var(--line); font-size: 13px; letter-spacing: .5px; line-height: 1.9; }
.activation-device .button { margin-top: 12px; }
.permanent-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.permanent-note span { color: var(--teal); font-weight: 700; }
#activation-code { min-height: 90px; font: 12px/1.7 monospace; }
#activation-code.short-activation-code { min-height: 74px; width: 100%; text-align: center; font: 700 clamp(24px, 6vw, 34px)/1.25 ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; border: 2px solid var(--teal); border-radius: 16px; box-shadow: inset 0 2px 5px #103e3810; }
#activation-code.short-activation-code::placeholder { letter-spacing: 0; font-family: inherit; font-size: 20px; font-weight: 400; }
.access-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
#activation-form .access-message { margin: 8px 0; min-height: 24px; }

.navigation { position: fixed; inset: 0 0 0 auto; z-index: 15; display: flex; flex-direction: column; width: var(--nav-width); padding: 34px 18px; background: radial-gradient(ellipse at 100% 0, #234859, var(--nav) 65%); color: #cbdadd; border-left: 1px solid #ffffff10; }
.nav-caption { margin: 40px 12px 14px; font-size: 11px; color: #b0c5ca; }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; margin-bottom: 9px; padding: 13px 12px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #c9dadd; font-size: 16px; font-weight: 700; text-align: right; }
.nav-button:hover { background: #ffffff0c; }
.nav-button.active { background: linear-gradient(125deg, #2d5866, #24424f); border-color: #4d778577; color: #fff; box-shadow: inset -3px 0 #8cddc4, 0 5px 14px #0001; }
.nav-symbol { font-size: 26px; line-height: 1; }
.nav-footer { margin-top: auto; font-size: 11px; }
.nav-small { display: block; width: 100%; min-height: 44px; padding: 10px 8px; border-radius: 10px; background: transparent; color: #c4d6da; font-size: 13px; text-align: right; }
.nav-small:hover { background: #ffffff0c; }
.active-license { display: flex; align-items: center; gap: 8px; padding: 20px 8px 10px; font-size: 12px; }
.active-license span { width: 7px; height: 7px; border-radius: 50%; background: #7ce0bc; box-shadow: 0 0 0 4px #7ce0bc15; }
#platform-label { color: #aac3c9; padding-right: 8px; }
.app-workspace { margin-right: var(--nav-width); min-height: 100vh; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 102px; padding: 21px 36px; background: var(--card); border-bottom: 1px solid var(--line); }
.app-header h2 { margin: 2px 0 0; font-size: 25px; }
.brand-caption { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); }
.header-buttons { display: flex; align-items: center; gap: 10px; flex: none; }
#mobile-tools, #mobile-stats { display: none; }
.main { max-width: 1440px; min-width: 0; margin: auto; padding: 34px 32px 60px; }
.intro { display: block; max-width: 100%; margin-bottom: 28px; padding: 2px 0 8px; }
.intro .eyebrow { margin-bottom: 10px; }
.intro h1 { max-width: 28em; margin-bottom: 13px; }
.intro p { max-width: 75ch; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.intro > .button { margin-top: 18px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.card-head h2, .card-head h3, .card-head h4 { margin: 0; font-size: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 30px 0 18px; }
.section-header h1, .section-header h2, .section-header h3 { margin: 0; }
.section-header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 25px 0; }
.stat-box { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: 0 5px 12px #15394b04; }
.stat-box .stat-label, .stat-box .muted { color: var(--muted); font-size: 13px; }
.stat-box strong { display: block; margin: 7px 0; color: var(--ink); font-size: 34px; line-height: 1.4; }
.stat-box small { color: var(--muted); font-size: 12px; }
.stat-icon { position: absolute; left: 17px; top: 19px; color: var(--teal); font-size: 20px; }
.dashboard-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-bottom: 28px; }
.legend { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i, .legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.legend i, .legend-dot.correct-dot { background: var(--teal); }
.legend i.gray { background: var(--line); }
.legend i.red, .legend-dot.wrong-dot { background: var(--red); }
.chart { display: block; width: 100%; height: auto; overflow: visible; direction: ltr; }
.chart text { fill: var(--muted); font: 12px Arial, sans-serif; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.ring-row { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; direction: rtl; }
.ring { position: relative; width: 140px; height: 140px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.ring-label strong { font-size: 33px; line-height: 1.3; }
.ring-label small, .ring-label span { font-size: 12px; color: var(--muted); }
.ring-detail p { margin: 5px 0; font-size: 14px; }
.ring-detail b, .ring-detail strong { font-size: 22px; margin: 0 6px; }
.stacked-bar { display: flex; height: 9px; margin-top: 8px; overflow: hidden; border-radius: 9px; background: var(--line); }
.stacked-bar span { height: 100%; }
.topic-bar { margin: 20px 0; }
.topic-bar > div:first-child { display: flex; justify-content: space-between; gap: 15px; font-size: 14px; }
.topic-bar strong { font-weight: 500; }
.topic-bar .progress-line { margin: 8px 0; }

.segmented { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { min-height: 46px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); font-size: 14px; font-weight: 700; box-shadow: 0 2px 0 var(--line); }
.chip.active { color: var(--teal); background: var(--mint); border-color: #43887377; box-shadow: inset 0 0 0 1px #43887333, 0 2px 0 #43887344; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0 26px; }
.filters input, .filters select { width: 100%; margin-top: 7px; font-weight: 400; }
.filters label { font-size: 13px; }
.filters .span-2 { grid-column: span 2; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; grid-column: 1 / -1; padding-top: 17px; border-top: 1px solid var(--line); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.practice-tile, .lesson-tile { display: flex; flex-direction: column; width: 100%; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: var(--shadow); text-align: right; transition: border-color .16s, box-shadow .16s; }
.practice-tile:hover, .lesson-tile:hover { border-color: #83a99f; box-shadow: 0 14px 28px #15394b0c; }
.practice-tile h3 { margin: 16px 0 9px; }
.practice-tile .tile-top, .lesson-tile .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tile-index { color: var(--muted); font-size: 13px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; background: var(--mint); color: var(--teal); font-size: 12px; font-weight: 700; }
.badge.neutral { background: var(--bg); color: var(--muted); }
.badge.correct { background: var(--greenbg); color: var(--green); }
.badge.wrong { background: var(--redbg); color: var(--red); }
.progress-line { height: 7px; margin: 18px 0 12px; border-radius: 7px; overflow: hidden; background: var(--line); }
.progress-line span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.draft-progress .progress-line span, .progress-line.draft-progress span { background: var(--selected); }
.tile-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: auto; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-top: auto; padding-top: 18px; }
.tile-actions > .button { flex: 1 1 150px; padding: 11px 12px; }
.tile-actions > .reset-button { flex: 1 1 130px; }
.lesson-tile h2 { font-size: 24px; margin: 18px 0 12px; }
.lesson-tile h3 { margin: 17px 0 10px; }
.lesson-tile p { color: var(--muted); font-size: 16px; line-height: 1.85; }
.concept-card { display: flex; flex-direction: column; align-items: flex-start; }
.concept-card h3 { margin: 17px 0 9px; font-size: 20px; }
.concept-card p { font-size: 15px; line-height: 1.8; }
.concept-card .text-button { margin-top: auto; }

.backline { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.backline .button { padding: 10px 14px; font-size: 14px; }
.runner { display: grid; grid-template-columns: minmax(0, 1fr) 242px; gap: 22px; align-items: start; }
.runner > section { min-width: 0; }
.runner-sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.runner-sidebar .card { padding: 20px; }
.runner-sidebar.card { padding: 20px; }
.runner-sidebar h3 { font-size: 19px; }
.runner-sidebar .button.full { display: flex; margin-top: 14px; }
.question-card { padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.question-meta > strong { flex: none; direction: ltr; }
.question-meta .tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.question-text { max-width: 75ch; font-size: var(--reading); line-height: 1.95; white-space: pre-line; margin: 22px 0 28px; }
.question-text p { white-space: normal; }
.question-text p:last-child { margin-bottom: 0; }
.choices { display: flex; flex-direction: column; gap: 15px; }
.choice { display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 66px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--line); font-size: max(16px, calc(var(--reading) - 1px)); line-height: 1.85; text-align: right; transition: border-color .15s, background .15s, transform .15s; }
.choice:hover { border-color: #6c8496; }
.choice:active { transform: translateY(2px); }
.choice-letter { display: flex; align-items: center; justify-content: center; flex: none; width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; font-weight: 700; }
.choice > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: break-word; }
.choice.selected { border: 2px solid var(--selected); padding: 17px; background: var(--selectedbg); box-shadow: 0 3px 0 var(--selected); }
.choice.selected .choice-letter { border-color: var(--selected); background: var(--selected); color: var(--card); }
:root[data-theme="dark"] .choice.selected .choice-letter { color: #172a46; }
.choice.good { border: 2px solid var(--green); padding: 17px; background: var(--greenbg); box-shadow: 0 3px 0 var(--green); }
.choice.bad { border: 2px solid var(--red); padding: 17px; background: var(--redbg); box-shadow: 0 3px 0 var(--red); }
.choice.good .choice-letter { background: var(--green); color: var(--card); border-color: var(--green); }
.choice.bad .choice-letter { background: var(--red); color: var(--card); border-color: var(--red); }
.choice-indicator { margin-right: auto; flex: none; font-size: 20px; font-weight: 700; color: var(--selected); }
.choice.good .choice-indicator { color: var(--green); }
.choice.bad .choice-indicator { color: var(--red); }
.question-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 25px; padding: 17px 0 6px; }
.question-actions .button { min-height: 54px; padding: 15px; font-size: 16px; }
.secondary-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 21px; }
.secondary-actions .button { min-height: 46px; padding: 10px 13px; font-size: 13px; }
.practice-toolbar, .exam-reset-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.practice-toolbar > .button { flex: 0 1 auto; }
.practice-status { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 700; line-height: 1.7; }
.practice-status.draft { background: var(--selectedbg); color: var(--selected); border-color: #6084bb66; }
.practice-status.submitted { background: var(--mint); color: var(--teal); }
.draft-progress { color: var(--selected); }
.draft-progress > strong { display: block; margin: 10px 0; font-size: 30px; }
.practice-result-summary { margin-bottom: 24px; }
.practice-review-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.answer-feedback { margin-top: 28px; padding: 25px; border-right: 4px solid var(--teal); border-radius: 15px; background: var(--bg); }
.answer-feedback.good { border-right-color: var(--green); }
.answer-feedback.bad { border-right-color: var(--red); }
.answer-feedback h3 { margin-bottom: 10px; }
.answer-feedback p { margin-bottom: 0; font-size: max(16px, calc(var(--reading) - 1px)); line-height: 1.95; }
.feedback-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rationales { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; margin-top: 21px; }
.rationale { padding: 20px; border: 1px solid var(--line); border-radius: 14px; font-size: max(15px, calc(var(--reading) - 2px)); line-height: 1.9; }
.rationale h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; font-size: 15px; }
.rationale p { margin-bottom: 0; }
.rationale.good { background: var(--greenbg); border-color: #3d996244; }
.rationale.bad { background: var(--redbg); border-color: #bd3c4444; }
.question-map { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 7px; margin-top: 16px; }
.map-button { min-height: 44px; min-width: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 14px; }
.map-button.answered, .map-button.draft-answered { background: var(--selectedbg); color: var(--selected); border-color: #6084bb66; }
.map-button.wrong { background: var(--redbg); color: var(--red); }
.map-button.current { border: 2px solid var(--selected); font-weight: 700; box-shadow: 0 0 0 2px var(--card); }
.map-button.flagged { box-shadow: inset 0 -4px var(--gold); }
.mini-score strong { display: block; margin: 10px 0; font-size: 35px; line-height: 1.3; }
.mini-score p { margin: 5px 0; font-size: 13px; }

.sources { display: block; margin-top: 25px; color: var(--ink); font-size: 15px; }
.sources > summary { display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; min-height: 74px; padding: 12px 18px; border: 1px solid #a5cabd; border-radius: 16px; background: linear-gradient(155deg, #f7fcf9, #e1f0e9); color: #175e52; list-style: none; cursor: pointer; box-shadow: 0 4px 0 #b0cec1, 0 9px 18px #1a564d13, inset 0 1px 0 #fff; transition: transform .16s, box-shadow .16s; }
.sources > summary::-webkit-details-marker { display: none; }
.sources > summary:hover { transform: translateY(-2px); }
.sources > summary:active { transform: translateY(3px); box-shadow: 0 1px 0 #b0cec1; }
.legal-icon { display: grid; place-items: center; flex: none; width: 45px; height: 45px; padding: 6px; border: 1px solid #a6cbbb; border-radius: 12px; background: #fff9; box-shadow: inset 0 1px 0 #fff, 0 2px 4px #2457460c; color: #986816; }
.legal-scales { width: 100%; height: 100%; }
.source-label { display: flex; flex-direction: column; text-align: start; }
.source-label strong { font-size: 17px; }
.source-label > span { font-size: 12px; font-weight: 400; }
.source-chevron { flex: none; width: 21px; height: 21px; margin-inline-start: 12px; transition: transform .2s; }
.sources[open] > summary .source-chevron { transform: rotate(180deg); }
.source-content { margin-top: 17px; padding: 8px 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.source-content > p { margin: 0; padding: 12px 0; font-size: 15px; overflow-wrap: anywhere; }
.source-content > p + p { border-top: 1px solid var(--line); }
.source-content .text-button { text-align: start; justify-content: flex-start; }
:root[data-theme="dark"] .sources > summary { background: linear-gradient(155deg, #254a45, #1b3737); color: #b1ecd9; border-color: #487065; box-shadow: 0 4px 0 #35554d, 0 9px 18px #0002, inset 0 1px 0 #ffffff18; }
:root[data-theme="dark"] .legal-icon { background: #183b36; color: #e3bf7b; border-color: #587463; box-shadow: inset 0 1px 0 #ffffff18; }

.notice { margin: 19px 0; padding: 17px 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); color: var(--muted); font-size: 15px; line-height: 1.85; }
.empty { padding: 50px 20px; color: var(--muted); text-align: center; }
.empty h3 { color: var(--ink); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 242px; grid-template-areas: "article contents"; align-items: start; gap: 24px; }
.article-layout > article { grid-area: article; min-width: 0; width: 100%; max-width: none; }
.article-layout > aside { grid-area: contents; min-width: 0; }
.article-nav { position: sticky; top: 22px; padding: 22px; align-self: start; }
.article-nav h3 { margin-bottom: 12px; font-size: 20px; }
.article-nav a, .article-nav > .text-button { display: flex; align-items: center; width: 100%; min-height: 46px; padding: 10px 11px; color: var(--teal); font-size: 14px; line-height: 1.75; text-align: right; justify-content: flex-start; }
.article-nav li { margin: 12px 0; }
.article-nav p, .article-nav li { font-size: 15px; line-height: 1.85; }
.article { width: 100%; max-width: 1050px; min-width: 0; padding: 38px; }
.article > h1 { max-width: 30em; font-size: 34px; }
.article h2 { max-width: 32em; margin: 36px 0 17px; }
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 28px 0 13px; }
.article p, .article li { max-width: 75ch; font-size: var(--reading); line-height: 1.95; }
.article li { margin: 8px 0; padding: 4px 0; }
.article ol, .article ul { padding-right: 25px; padding-left: 0; }
.article section { scroll-margin-top: 28px; }
.article table { width: 100%; margin: 17px 0; border-collapse: collapse; font-size: 15px; }
.article td, .article th { padding: 13px; border: 1px solid var(--line); text-align: right; vertical-align: top; }
.article th { background: var(--mint); }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.article .question-actions { position: static; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; background: transparent; }
.article-layout:has(> aside.article:not(.article-nav)) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.article-layout > aside.article { padding: 28px; }
.article-layout > aside.article p { font-size: max(16px, calc(var(--reading) - 1px)); }
.example { margin: 25px 0; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.example h4 { margin-bottom: 11px; }
.article .example p:last-child { margin-bottom: 0; }
.selfcheck { margin: 14px 0; padding: 19px 21px; border: 1px solid var(--line); border-radius: 14px; }
.selfcheck summary { min-height: 44px; font-weight: 700; line-height: 1.85; cursor: pointer; }
.selfcheck p { margin: 17px 0 0; }
.trap { margin: 20px 0; padding: 17px 22px; border-right: 4px solid var(--gold); border-radius: 10px; background: #bc893013; }
.trap p:last-child { margin-bottom: 0; }
.learning-context { margin: 20px 0; padding: 15px 18px; border-right: 3px solid var(--gold); border-radius: 9px; background: var(--bg); font-size: 14px; line-height: 1.85; }
.bullet-line { padding-right: 12px; }

.exam-setup { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 23px; }
.exam-poster { padding: 36px; border: 1px solid #395766; border-radius: var(--radius); background: radial-gradient(ellipse at 100% 0, #285766, var(--nav) 70%); color: #fff; box-shadow: 0 15px 32px #12384913; }
.exam-poster h2 { margin: 20px 0; font-size: 33px; }
.exam-poster p { color: #c2d5d8; font-size: 16px; line-height: 1.9; }
.exam-poster img { width: 57px; }
.exam-poster .eyebrow { color: #afd7ca; }
.schedule-line { display: flex; align-items: center; gap: 17px; padding: 18px 0; border-bottom: 1px solid #ffffff25; font-size: 14px; }
.schedule-line > strong { min-width: 42px; color: #a0dbc8; font-size: 26px; }
.schedule-line b { color: #a0dbc8; }
.schedule-line h3 { margin: 0; font-size: 21px; }
.schedule-line span { color: #d0e0e2; font-size: 14px; }
.exam-settings label { margin-bottom: 20px; }
.exam-settings select { width: 100%; margin-top: 6px; }
.setup-list { padding-right: 21px; color: var(--muted); font-size: 15px; }
.setup-list li { margin: 12px 0; }
.phase-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 25px; }
.phase-track > div, .phase-track > span { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--muted); font-size: 13px; }
.phase-track > span > b { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.phase-track strong { display: block; font-size: 16px; }
.phase-track .active { color: var(--teal); background: var(--mint); border-color: #43887377; }
.phase-track .done { color: var(--green); }
.timer { margin: 9px 0; font: 700 37px/1.2 Arial, sans-serif; letter-spacing: 1px; text-align: center; direction: ltr; }
.timer.low { color: var(--red); }
.timer-label { font-size: 12px; color: var(--muted); text-align: center; }
.timer-wrap { display: flex; flex-direction: column; align-items: center; min-width: 150px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 4px 0 var(--line); }
.timer-wrap .timer { display: block; margin: 4px 0; }
.writing-area { width: 100%; min-height: 460px; padding: 21px; margin-top: 12px; font-size: var(--reading); line-height: 1.95; }
.writing-count { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 9px 0 18px; color: var(--muted); font-size: 13px; }
.writing-tabs { margin-bottom: 22px; }
.exam-between { max-width: 700px; padding: 50px 36px; margin: 40px auto; text-align: center; }
.exam-between .complete-mark { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 24px; border-radius: 50%; background: var(--mint); color: var(--teal); font-size: 30px; box-shadow: 0 0 0 9px var(--bg); }
.result-top { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; margin-bottom: 24px; }
.result-top .ring { width: 160px; height: 160px; }
.result-top > div { min-width: 150px; flex: 1; }
.result-top h1 { font-size: 32px; }
.result-top h3 { font-size: 16px; }
.result-score { display: block; font-size: 50px; line-height: 1.6; }
.result-score small { color: var(--muted); font-size: 18px; }
.result-history { display: flex; align-items: center; justify-content: space-between; gap: 13px; flex-wrap: wrap; padding: 19px 0; border-bottom: 1px solid var(--line); }
.result-history p { margin: 0; font-size: 13px; }
.grade-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.grade-fields input { width: 100%; margin-top: 6px; }
.review-question { padding: 20px 0; border-bottom: 1px solid var(--line); }
.review-question.card { padding: 25px; margin-bottom: 13px; }
.review-question summary { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 700; font-size: 16px; line-height: 1.85; }
.review-question summary::after { content: '+'; display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-right: auto; border: 1px solid var(--line); border-radius: 9px; color: var(--teal); background: var(--bg); font-size: 23px; }
.review-question[open] summary::after { content: '-'; }
.review-question summary span:nth-child(2) { flex: 1; min-width: 0; }
.review-question .choice { font-size: max(15px, calc(var(--reading) - 2px)); }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.tool-grid .button { width: 100%; }
dialog { width: min(980px, calc(100% - 28px)); max-height: 90vh; max-height: 90dvh; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 30px 100px #0005; }
dialog::backdrop { background: #082334b8; backdrop-filter: blur(5px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 24px; }
dialog .article h2 { font-size: 23px; }
#toast { position: fixed; z-index: 99; left: 50%; bottom: 25px; max-width: calc(100vw - 30px); padding: 13px 24px; border: 1px solid #53757e; border-radius: 14px; background: var(--nav); color: #fff; box-shadow: 0 12px 30px #0003; font-size: 14px; text-align: center; transform: translate(-50%, 160px); transition: transform .2s; }
#toast.visible { transform: translate(-50%, 0); }
.loading { padding: 55px 20px; text-align: center; }
.loading .spinner { width: 37px; height: 37px; margin: 0 auto 20px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1280px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "contents" "article"; }
  .article-nav { position: static; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; padding: 20px 24px; }
  .article-nav > h3 { flex: 1 0 100%; margin: 0 0 4px; }
  .article-nav > .text-button, .article-nav > a { width: auto; max-width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; font-size: 14px; }
  .article-nav > .progress-line { display: none; }
  .article-nav > .hint { margin: 4px 0 0; flex: 1 0 100%; }
  .article-nav > p, .article-nav > ol { flex: 1 0 100%; margin-bottom: 0; }
  .article-layout:has(> aside.article:not(.article-nav)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "article" "contents"; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runner { grid-template-columns: minmax(0, 1fr); }
  .runner-sidebar { position: static; order: -1; display: block; }
  .runner-sidebar .question-map { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); max-height: 114px; overflow-y: auto; padding: 3px; }
  .runner-sidebar .card, .runner-sidebar.card { padding: 21px; }
  .runner-sidebar .card-head { margin-bottom: 10px; }
  .runner-sidebar .mini-score strong { display: inline-block; margin: 0 8px; font-size: 29px; }
  .runner-sidebar .button.full { width: auto; min-width: 190px; margin-top: 8px; }
  .runner-sidebar .small, .runner-sidebar .hint { margin-bottom: 8px; }
  .dashboard-row { grid-template-columns: minmax(0, 1fr); }
  .stat-icon { display: none; }
}
@media (max-width: 1050px) {
  .navigation { inset: auto 0 0; width: 100%; min-height: calc(78px + env(safe-area-inset-bottom, 0px)); padding: 7px 12px calc(7px + env(safe-area-inset-bottom, 0px)); flex-direction: row; border-top: 1px solid #456571; box-shadow: 0 -8px 30px #102e3b12; }
  .navigation > .brand, .nav-caption, .nav-footer { display: none; }
  .navigation nav { display: flex; width: 100%; gap: 8px; }
  .nav-button { flex: 1; flex-direction: column; justify-content: center; gap: 4px; min-height: 62px; margin: 0; padding: 7px 5px; border-radius: 12px; font-size: 12px; text-align: center; }
  .nav-button.active { box-shadow: inset 0 3px #8cddc4; }
  .nav-symbol { font-size: 25px; }
  .app-workspace { margin: 0; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .app-header { min-height: 92px; padding: 18px 25px; }
  .main { padding: 28px 26px 50px; }
  #mobile-tools, #mobile-stats { display: inline-grid; }
  .access-screen { grid-template-columns: minmax(0, 1fr); }
  .access-art { display: none; }
  .access-content { max-width: 600px; padding: 36px 30px; }
  .article { padding: 34px; }
  .exam-setup { grid-template-columns: minmax(0, 1fr); }
  #toast { bottom: calc(99px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 760px) {
  .main { padding: 25px 20px 45px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .article { padding: 29px; }
  .article-layout > aside.article { padding: 26px; }
  .article-nav { padding: 20px; }
  .question-card { padding: 27px; }
  .result-top { gap: 23px; }
  .result-top > div { min-width: 145px; }
  .grade-fields { grid-template-columns: minmax(0, 1fr); }
  .phase-track { gap: 8px; }
  .phase-track > div, .phase-track > span { padding: 12px; font-size: 12px; }
  .phase-track strong { font-size: 14px; }
  .intro h1 { font-size: 34px; }
}
@media (max-width: 520px) {
  :root { --reading: 18px; }
  .main { padding: 23px 14px 42px; }
  .app-header { flex-wrap: wrap; min-height: 102px; padding: 15px 16px; gap: 13px; }
  .app-header > div:first-child { flex: 1 1 125px; }
  .app-header h2 { font-size: 22px; }
  .brand-caption { font-size: 10px; letter-spacing: .5px; }
  .header-buttons { gap: 7px; }
  .header-buttons .icon-button { width: 44px; min-width: 44px; height: 44px; font-size: 19px; }
  .intro { margin-bottom: 22px; }
  .intro h1 { font-size: 31px; line-height: 1.4; }
  .intro p { font-size: 16px; }
  .intro .eyebrow { font-size: 12px; }
  .card { padding: 21px; border-radius: 17px; }
  .stats-grid { margin: 22px 0; gap: 11px; }
  .stat-box { padding: 17px; }
  .stat-box strong { font-size: 30px; }
  .stat-box .stat-label, .stat-box .muted { font-size: 12px; }
  .filters { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .filters .span-2 { grid-column: auto; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions > .button { flex: 1 1 160px; }
  .segmented { gap: 9px; }
  .chip { flex: 1 1 auto; min-height: 46px; padding: 10px 12px; font-size: 13px; }
  .practice-tile, .lesson-tile { padding: 23px; }
  .practice-tile h3, .lesson-tile h2 { font-size: 23px; }
  .tile-actions { gap: 13px; }
  .tile-actions > .button { flex-basis: 100%; }
  .section-header { gap: 14px; margin-top: 27px; }
  .section-header h2 { font-size: 25px; }
  .section-header > .button { width: 100%; }
  .question-card { padding: 23px 19px; border-radius: 17px; }
  .question-meta { gap: 10px; padding-bottom: 15px; margin-bottom: 18px; }
  .question-meta .tags { font-size: 13px; }
  .question-text { margin: 20px 0 26px; line-height: 1.95; }
  .choice { gap: 10px; padding: 16px 13px; border-radius: 13px; }
  .choice.selected, .choice.good, .choice.bad { padding: 15px 12px; }
  .choice-letter { width: 31px; height: 33px; font-size: 15px; }
  .choice-indicator { font-size: 18px; }
  .question-actions { gap: 12px; margin-top: 19px; }
  .question-actions .button { min-height: 54px; padding: 12px 8px; font-size: 14px; }
  .secondary-actions { justify-content: flex-start; gap: 9px; }
  .secondary-actions > .button, .secondary-actions > .text-button { flex: 1 1 125px; }
  .practice-toolbar, .exam-reset-toolbar { align-items: stretch; }
  .practice-toolbar > .button, .exam-reset-toolbar > .button { flex: 1 1 150px; }
  .runner-sidebar .card, .runner-sidebar.card { padding: 19px; }
  .runner-sidebar .button.full { width: 100%; }
  .runner-sidebar .question-map { max-height: 113px; }
  .article { padding: 25px 21px; }
  .article > h1 { font-size: 29px; }
  .article h2 { font-size: 26px; line-height: 1.5; margin-top: 31px; }
  .article h3 { font-size: 22px; }
  .article p, .article li { font-size: var(--reading); }
  .article-layout { gap: 17px; }
  .article-nav { padding: 19px; gap: 9px; }
  .article-nav > .text-button, .article-nav > a { width: 100%; padding: 10px 13px; font-size: 15px; }
  .article-nav > h3 { margin-bottom: 5px; }
  .article .question-actions { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .article-layout > aside.article { padding: 25px 21px; }
  .example { padding: 20px 17px; }
  .trap { padding: 17px; }
  .selfcheck { padding: 17px; }
  .answer-feedback { padding: 21px 17px; }
  .rationale { padding: 18px 16px; }
  .review-question.card { padding: 20px 17px; }
  .review-question summary { gap: 9px; font-size: 15px; }
  .review-question summary::after { width: 29px; height: 32px; }
  .phase-track { gap: 7px; }
  .phase-track > div, .phase-track > span { flex-direction: column; gap: 6px; padding: 10px 8px; font-size: 11px; text-align: center; }
  .phase-track strong { font-size: 13px; }
  .timer-wrap { min-width: 126px; padding: 10px 13px; }
  .timer-wrap .timer { font-size: 30px; }
  .writing-area { min-height: 380px; padding: 17px; }
  .exam-poster { padding: 27px 24px; }
  .exam-poster h2 { font-size: 31px; }
  .schedule-line { gap: 12px; }
  .schedule-line span { font-size: 13px; }
  .exam-between { margin-top: 23px; padding: 35px 24px; }
  .result-top > div { min-width: 120px; }
  .result-top h1 { font-size: 28px; }
  .result-score { font-size: 44px; }
  .ring-row { gap: 23px; }
  .ring { width: 128px; height: 128px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  dialog { padding: 21px; }
  .dialog-header h2 { font-size: 22px; }
  .access-content { padding: 30px 23px; }
  .access-content h2 { font-size: 30px; }
  .activation-device { padding: 17px; }
  .activation-device .id-row code { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .button:hover:not(:disabled), .button:active:not(:disabled), .choice:active, .icon-button:active { transform: none; }
}
@media (forced-colors: active) {
  .button, .choice, .map-button, .chip, .icon-button { border: 2px solid ButtonText; box-shadow: none; }
  .choice.selected, .map-button.current, .nav-button.active { outline: 3px solid Highlight; }
}
@media print {
  .navigation, .app-header, .backline, .article-nav, .question-actions, .secondary-actions, #toast { display: none !important; }
  .app-workspace { margin: 0; padding: 0; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 0; }
  .article-layout { display: block; }
  .article { max-width: none; padding: 0; }
  body { background: #fff; color: #111; }
  .article h2 { break-after: avoid; }
  .example, .trap { break-inside: avoid; }
}

/* Reading and source question presentation */
.article-layout.single-column{grid-template-columns:minmax(0,1fr);max-width:1080px;margin-inline:auto}
.knowledge-question{margin-block:24px;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--surface,#fff)}
.knowledge-options{list-style:none;margin:16px 0;padding:0;display:grid;gap:12px}
.knowledge-options li{padding:14px 16px;border:1px solid var(--line);border-radius:12px;line-height:1.8}
.knowledge-options strong{margin-inline-end:8px}
.previous-exams{margin-block:28px}
@media(max-width:600px){.knowledge-question{padding:16px}.knowledge-options li{padding:12px}}

/* Timed exam entrance and persistent live clock */
.exam-briefing { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr); overflow: hidden; border: 1px solid var(--line); border-radius: 27px; background: var(--card); box-shadow: 0 6px 0 var(--line), 0 25px 48px #193e4810; }
.exam-briefing-hero { padding: 45px 38px; background: radial-gradient(ellipse at 95% 0, #31636d, #102c3a 75%); color: #fff; }
.exam-briefing-hero .eyebrow { color: #a6ddc9; }
.briefing-symbol { width: 89px; height: 89px; padding: 18px; margin: 38px 0 30px; border: 1px solid #6e9291; border-radius: 24px; background: linear-gradient(135deg, #ffffff12, #ffffff02); color: #e9c789; box-shadow: 0 5px 0 #0c2630, inset 0 1px 0 #ffffff30; }
.exam-briefing-hero h1 { max-width: 450px; margin-bottom: 22px; font-size: 43px; line-height: 1.38; }
.exam-briefing-hero p { font-size: 17px; line-height: 1.9; color: #c5dcdf; }
.exam-briefing-hero .briefing-lead { color: #fff; font-size: 20px; }
.briefing-goodluck { display: block; margin-top: 32px; color: #e5c887; font-size: 28px; font-weight: 700; }
.exam-briefing-body { padding: 36px; }
.briefing-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; font-size: 14px; }
.exam-briefing-body h2 { font-size: 25px; }
.briefing-parts { display: grid; gap: 0; margin: 22px 0; }
.briefing-part { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.briefing-part-index { flex: none; color: var(--teal); font-size: 24px; font-weight: 700; }
.briefing-part > div { flex: 1; }
.briefing-part > div strong, .briefing-part > div span { display: block; }
.briefing-part > div span { font-size: 13px; color: var(--muted); }
.briefing-duration { flex: none; color: var(--muted); font-size: 13px; }
.briefing-duration b { font-size: 21px; color: var(--ink); }
.briefing-clock { display: block; text-align: center; padding: 15px 20px; margin-top: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.briefing-clock > strong { display: block; margin: 1px 0; font: 700 52px/1.2 Arial, sans-serif; font-variant-numeric: tabular-nums; color: var(--teal); }
.briefing-clock > span { display: block; color: var(--muted); font-size: 13px; }
.briefing-clock .clock-caption { color: var(--ink); font-weight: 700; font-size: 15px; }
.exam-start-button { min-height: 62px; font-size: 17px; margin-top: 8px; }
.start-play { font-size: 19px; margin-inline-end: 5px; }
.start-reassurance { text-align: center; margin: 17px 0 0; }
.exam-live-header { position: sticky; top: 8px; z-index: 8; padding: 16px 21px; margin: 20px 0; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 8px 24px #13344216; flex-wrap: nowrap; }
.exam-live-header > div:first-child { flex: 1; }
.exam-live-header h1 { font-size: 29px; }
.exam-live-header .eyebrow { font-size: 12px; }
.exam-live-header .timer-wrap { display: block; text-align: center; flex: none; min-width: 248px; padding: 12px 20px; border-color: #68978b; background: linear-gradient(150deg, var(--card), var(--mint)); box-shadow: 0 4px 0 #9dbeb2, inset 0 1px 0 #ffffff70; }
.timer-heading { width: 100%; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 7px; }
.timer-heading svg { width: 20px; height: 20px; flex: none; color: var(--teal); }
.timer-kicker { color: var(--teal); font: 700 10px/1 Arial, sans-serif; letter-spacing: 1.1px; }
.exam-live-header .timer { font-size: 54px; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: var(--ink); }
.timer-units { display: block; color: var(--muted); font-size: 11px; }
.exam-live-header .timer-wrap.low-time { background: var(--redbg); border-color: var(--red); box-shadow: 0 4px 0 #be61716b; }
.exam-live-header .timer.low { color: var(--red); }
.autosave-notice { display: flex; align-items: flex-start; gap: 14px; padding: 20px; margin-bottom: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--mint); }
.autosave-notice > span { flex: none; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 12px; background: var(--card); color: var(--teal); font-size: 22px; }
.autosave-notice strong { color: var(--teal); }
.autosave-notice p { margin: 5px 0 0; font-size: 14px; color: var(--muted); }
:root[data-theme="dark"] .exam-live-header .timer-wrap { border-color: #487065; box-shadow: 0 4px 0 #35554d, inset 0 1px 0 #ffffff18; }
@media (max-width: 1160px) {
  .exam-briefing { grid-template-columns: minmax(0, 1fr); }
  .exam-briefing-hero { padding: 30px; }
  .briefing-symbol { float: left; margin: 0 15px 15px 0; width: 70px; height: 70px; padding: 13px; border-radius: 20px; }
  .exam-briefing-hero h1 { font-size: 35px; margin-top: 15px; }
  .briefing-goodluck { margin-top: 18px; }
}
@media (max-width: 620px) {
  .exam-live-header { top: 4px; padding: 10px 12px; gap: 12px; border-radius: 16px; }
  .exam-live-header h1 { font-size: 20px; line-height: 1.5; }
  .exam-live-header .eyebrow { font-size: 11px; }
  .exam-live-header .timer-wrap { min-width: 156px; padding: 9px 10px; border-radius: 13px; }
  .exam-live-header .timer { font-size: 39px; letter-spacing: .5px; }
  .timer-heading { gap: 5px; }
  .timer-heading svg { width: 16px; height: 16px; }
  .timer-heading .timer-label { font-size: 11px; }
  .timer-kicker { display: none; }
  .exam-briefing-body { padding: 24px 21px; }
  .exam-briefing-hero { padding: 26px 24px; }
  .exam-briefing-hero h1 { font-size: 31px; }
  .exam-briefing-hero .briefing-lead { font-size: 18px; }
  .exam-briefing-hero p { font-size: 16px; }
  .briefing-part { gap: 10px; }
  .briefing-duration b { font-size: 19px; }
  .briefing-part-index { font-size: 21px; }
  .briefing-part > div strong { font-size: 15px; }
  .exam-start-button { font-size: 16px; padding: 13px 15px; }
  .sources > summary { width: 100%; padding: 12px 14px; gap: 11px; }
  .source-label { flex: 1; }
  .source-label strong { font-size: 16px; }
  .source-chevron { margin-inline-start: 0; }
}
@media (max-width: 360px) {
  .exam-live-header { padding: 10px; gap: 8px; }
  .exam-live-header h1 { font-size: 18px; }
  .exam-live-header .timer-wrap { min-width: 142px; padding: 8px; }
  .exam-live-header .timer { font-size: 35px; }
  .sources > summary { gap: 9px; padding: 11px; }
  .legal-icon { width: 39px; height: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  .sources > summary:hover, .sources > summary:active { transform: none; }
}
@media (forced-colors: active) {
  .sources > summary, .legal-icon, .exam-live-header, .exam-live-header .timer-wrap { border: 2px solid ButtonText; box-shadow: none; }
}

/* iPhone install welcome. Content remains accessible with larger text. */
.iphone-intro h2 { font-size: clamp(34px, 9vw, 48px); line-height: 1.3; margin: 16px 0; }
.iphone-intro > .hint { margin-top: 20px; }
.iphone-intro > .button { min-height: 56px; }
@media(max-width:520px) { .iphone-intro { padding-top: 12px; } }
@media(max-width:1050px) {
 .app-header { padding-top: max(18px, env(safe-area-inset-top)); padding-left: max(25px, env(safe-area-inset-left)); padding-right: max(25px, env(safe-area-inset-right)); }
 .main { padding-left: max(26px, env(safe-area-inset-left)); padding-right: max(26px, env(safe-area-inset-right)); }
 .navigation { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
 .access-content { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
 .filters input, .filters select, .grade-fields input { font-size: 16px; }
}
@media(max-width:520px) {
 .app-header { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
 .main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
}
