/* BoardCraft companion surfaces. Layout and maths overflow rules live in styles.css. */
.course-options{border:0;padding:0;margin:0 0 28px;min-width:0}
.course-options legend{font-weight:600;font-size:1.125rem;margin-bottom:14px;padding:0}
.course-option-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.course-option{display:flex;align-items:center;gap:12px;border:1px solid var(--control-border);border-radius:var(--radius-lg);padding:18px 16px;background:var(--control-bg);cursor:pointer;transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease),box-shadow var(--motion-fast) var(--ease)}
.course-option:hover{background:var(--hover-bg);border-color:var(--hover-border)}
.course-option:has(input:checked){border-color:var(--selected-border);background:var(--selected-bg);box-shadow:0 0 0 1px var(--selected-border)}
.course-option input{accent-color:var(--accent);width:19px;height:19px;flex:none}
.course-option strong,.course-option small{display:block}
.course-option small{font-size:.8125rem;color:var(--muted);margin-top:5px;line-height:1.4}
.course-picker{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px}
.course-picker label{display:block;font-weight:600;font-size:1.0625rem;margin-bottom:4px}
.course-picker select{font:inherit;color:var(--ink);background:var(--control-bg);border:1px solid var(--control-border);border-radius:var(--radius-md);padding:13px 36px 13px 14px;min-height:var(--control-h);max-width:100%}
.course-empty{max-width:720px;padding:32px}
.course-empty .heading-icon{margin-bottom:20px}
.course-empty h2{margin-top:16px}
.install-steps{display:grid;gap:18px;margin:24px 0}
.install-steps h3{margin:0 0 5px}
.install-steps p{margin:0;line-height:1.6}
.nav a{flex:1}
@media(max-width:650px){.course-picker{align-items:stretch;flex-direction:column}.course-picker select{width:100%}.course-option{padding:15px 12px;gap:9px}.course-option-grid{gap:10px}.course-empty{padding:24px}}
@media(max-width:360px){.course-option-grid{grid-template-columns:minmax(0,1fr)}}
body{letter-spacing:-.01em}
/* Type scale: headings at 600 (docs/DESIGN.md); 700 is kept for the wordmark and monograms. */
h1,h2,h3{font-weight:600}
h1{font-size:var(--text-display);letter-spacing:-.7px;line-height:1.2}
h2{font-size:var(--text-section);letter-spacing:-.4px;line-height:1.35}
h3{font-size:var(--text-subsection);line-height:1.4;margin-bottom:var(--space-2)}
p{line-height:1.65}
button,.btn{font-weight:600}
/* One focus language for every control; the programmatically focused <main> is a landing point, not a control. */
:is(button,a,input,textarea,select,summary,[tabindex]:not([tabindex="-1"])):focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px}
#main:focus,#main:focus-visible{outline:none}
.eyebrow{font-size:.875rem;text-transform:none;letter-spacing:0;font-weight:500}
.topbar{background:var(--surface);border-color:var(--border)}
.topbar-inner{min-height:72px;max-width:1440px;padding:12px 30px;gap:24px}
.brand{gap:12px;flex-wrap:wrap}
.icon-btn{border-radius:var(--radius-md);background:var(--control-bg);border:1px solid transparent;color:var(--ink);transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease)}
.icon-btn:hover{background:var(--hover-bg);border-color:var(--hover-border)}
.ico{stroke-width:1.6}
.nav{gap:4px}
.nav a{border-radius:var(--radius-pill);font-weight:500;font-size:.875rem;padding:11px 16px;color:var(--muted);white-space:nowrap;transition:background-color var(--motion-fast) var(--ease),color var(--motion-fast) var(--ease)}
.nav a.active{background:var(--selected-bg);color:var(--selected-ink)}
.nav a:hover{background:var(--hover-bg);color:var(--ink)}
.nav a.active:hover{background:var(--selected-bg);color:var(--selected-ink)}
.main{max-width:1240px;padding:32px 0 40px;margin-inline:auto}
.footer{max-width:1240px;font-size:.8125rem;line-height:1.6;padding:22px 0 28px}
.footer a:hover{color:var(--accent)}
.page-heading{margin-bottom:26px}
.page-heading h1{margin-bottom:6px}
.page-heading p{font-size:1rem}
.heading-with-icon{display:flex;align-items:center;gap:16px}
.heading-icon{width:56px;height:56px;display:grid;place-items:center;flex:none;border-radius:50%;background:var(--accent-tint);color:var(--accent)}
.heading-icon .ico{width:28px;height:28px}
/* Surface ladder: cards lift gently off the page; dark mode relies on tone and border rather than shadow. */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:var(--shadow-low);padding:var(--space-6)}
.card-title{margin-bottom:18px}
.card-title .text-btn{font-size:.875rem}
.home-grid{grid-template-columns:minmax(0,1fr)}
.home-main{align-content:start}
/* Gold is the weekly highlight. Secondary text inside it uses a darker ink so it meets AA on gold. */
.weekly-card{--muted:var(--highlight-ink-secondary);background:var(--highlight-bg);color:var(--ink);border:1px solid var(--highlight-border);border-radius:var(--radius-xl);box-shadow:var(--shadow-low);padding:var(--space-7)}
.weekly-card:after{display:none}
.weekly-card h2{font-size:var(--text-title);font-weight:600;line-height:1.25;margin-top:28px;letter-spacing:-.5px;max-width:none}
.weekly-card p{color:var(--muted);max-width:500px}
.week-label{color:var(--accent);text-transform:none;letter-spacing:0;font-weight:600}
.status-tag{color:var(--accent);border:1px solid var(--gold);background:var(--surface);border-radius:var(--radius-pill);padding:7px 12px;font-size:.8125rem}
.weekly-bottom{gap:24px;margin-top:30px}
.progress-wrap{max-width:300px}
.progress-label{color:var(--muted);gap:12px}
/* Progress: neutral groove, blue fill, so 0% reads as empty in every context. */
.progress-track{height:7px;background:var(--progress-track)}
.progress-track>span{background:var(--progress-fill)}
/* Buttons: one height, one radius, blue primary, neutral secondary. */
.btn,.btn.yellow{border-radius:var(--radius-md);background:var(--accent);color:var(--on-accent);min-height:var(--control-h);font-weight:600;box-shadow:none;transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease),color var(--motion-fast) var(--ease),transform var(--motion-fast) var(--ease)}
.btn:hover:not(:disabled),.btn.yellow:hover:not(:disabled){background:var(--accent-hover)}
.btn:active:not(:disabled),.sprint-btn:active,.keypad button:active,.confidence-btn:active,.option:active:not(:disabled){transform:translateY(1px)}
.btn:disabled{cursor:not-allowed}
.btn.secondary{background:var(--surface);color:var(--ink);border-color:var(--border-strong)}
.btn.secondary:hover:not(:disabled){background:var(--hover-bg);border-color:var(--hover-border)}
.btn.ghost{background:transparent;color:var(--ink)}
.btn.ghost:hover:not(:disabled){background:var(--hover-bg)}
.btn.danger{background:var(--error-bg);color:var(--error);border-color:var(--error-border)}
.btn.danger:hover:not(:disabled){background:var(--error);border-color:var(--error);color:var(--surface)}
.btn.sm{min-height:var(--control-h-sm)}
.text-btn{color:var(--accent);font-weight:500}
.text-btn:hover{color:var(--accent-hover)}
/* Informational chips are neutral; colour is reserved for status. */
.pill,.schedule-label{border-radius:var(--radius-pill);background:var(--control-bg);color:var(--muted);padding:7px 12px}
.pill.ready{color:var(--success);background:var(--success-bg)}
.score-item{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--control-bg)}
.score-item .score{font-weight:600;letter-spacing:-.7px}
.score-track{background:var(--progress-track)}
.score-track span{background:var(--progress-fill)}
.check-line{color:var(--success)}
.topic-symbol{width:48px;height:48px;border-radius:var(--radius-md);background:var(--accent-tint);color:var(--accent);border:1px solid var(--control-border);font-size:1.15rem;font-weight:700}
[data-tone="0"] .topic-symbol{color:#426fa6;background:#eaf2fb;border-color:#cbdfee}
[data-tone="1"] .topic-symbol{color:#8851a7;background:#f3eaf8;border-color:#e1cce9}
[data-tone="2"] .topic-symbol{color:#b34352;background:#fcecef;border-color:#edced3}
[data-tone="3"] .topic-symbol{color:#9b5817;background:#fff0e1;border-color:#ecd5bd}
[data-tone="4"] .topic-symbol{color:#377a46;background:#eaf6eb;border-color:#cce5ce}
[data-tone="5"] .topic-symbol{color:#2f7478;background:#e6f4f4;border-color:#c4e0e1}
[data-theme=dark] [data-tone="0"] .topic-symbol{color:#a0c8ef;background:#293c50;border-color:#41556a}
[data-theme=dark] [data-tone="1"] .topic-symbol{color:#d4aae9;background:#3a2e47;border-color:#584165}
[data-theme=dark] [data-tone="2"] .topic-symbol{color:#efa5b0;background:#452e37;border-color:#674550}
[data-theme=dark] [data-tone="3"] .topic-symbol{color:#eec391;background:#433729;border-color:#62503b}
[data-theme=dark] [data-tone="4"] .topic-symbol{color:#a0d1a4;background:#2a3b2e;border-color:#455c49}
[data-theme=dark] [data-tone="5"] .topic-symbol{color:#94d3d5;background:#233a3c;border-color:#3f5c5e}
.topic-card{padding:0;margin-bottom:14px;border-radius:var(--radius-lg)}
.topic-card summary{padding:21px 22px;gap:16px}
.topic-card summary strong{font-size:1rem;font-weight:600;line-height:1.4}
.topic-card summary small{font-size:.875rem;margin-top:5px}
.topic-card summary::after{content:'';width:8px;height:8px;flex:none;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:rotate(-45deg);margin-right:4px;font-size:initial}
.topic-card[open] summary::after{content:'';transform:rotate(45deg)}
.topic-card summary::-webkit-details-marker{display:none}
.topic-body{padding:3px 22px 20px;background:var(--control-bg);border-top-color:var(--border)}
.checkbox-line{font-size:1rem;padding-top:17px;gap:12px;line-height:1.5}
.checkbox-line input{accent-color:var(--accent)}
.checkbox-line .mini-label{display:inline-block;margin-top:3px}
.setup{max-width:760px}
.setup-topics .card{box-shadow:none}
.setup form.card{padding:28px}
.setup-topics{margin-top:22px}
.field label{font-weight:600}
.input,input[type=text],select,textarea{border-radius:var(--radius-md);border-color:var(--control-border);background:var(--control-bg);font-size:1rem;transition:border-color var(--motion-fast) var(--ease),background-color var(--motion-fast) var(--ease)}
input[type=text]:focus,select:focus,textarea:focus{border-color:var(--accent);background:var(--surface)}
.input-help{line-height:1.5}
.question-shell{max-width:870px}
.question-toolbar{background:var(--surface-raised);border:1px solid var(--border);border-radius:var(--radius-pill);padding:9px 16px;box-shadow:var(--shadow-float);gap:16px}
.question-toolbar .text-btn{text-decoration:none;font-size:.875rem}
.question-dots{gap:7px}
.qdot{width:26px;height:26px;background:var(--control-bg);font-size:.75rem}
.qdot.current{background:var(--accent);color:var(--on-accent)}
.qdot.correct{background:var(--success-bg);color:var(--success)}
.qdot.wrong{background:var(--error-bg);color:var(--error)}
.question-card{padding:var(--space-7);border-radius:var(--radius-xl)}
.qmeta{font-size:.875rem;letter-spacing:0;text-transform:none;font-weight:500;gap:10px;margin-bottom:26px}
.qmeta>span:last-child{background:var(--control-bg);border-radius:var(--radius-pill);padding:7px 12px}
/* The maths well: an inset, edged surface in both themes. */
.stem{font-size:1.25rem;line-height:1.85;letter-spacing:0;padding:16px 18px;background:var(--surface-inset);border:1px solid var(--border-inset);border-radius:var(--radius-md);margin-bottom:24px}
/* Selectable controls: neutral at rest and on hover, blue tint + ring when selected, semantic when marked. */
.option{border-radius:var(--radius-md);border:1px solid var(--control-border);background:var(--control-bg);min-height:76px;font-weight:400;transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease),box-shadow var(--motion-fast) var(--ease),transform var(--motion-fast) var(--ease)}
.option:hover:not(:disabled){border-color:var(--hover-border);background:var(--hover-bg)}
.option.selected,.option.selected:hover:not(:disabled){border-color:var(--selected-border);background:var(--selected-bg);box-shadow:0 0 0 1px var(--selected-border)}
.option-letter{border-radius:var(--radius-sm);background:var(--surface);color:var(--muted);font-weight:600;border:1px solid var(--border)}
.option.selected .option-letter{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.option.right{background:var(--success-bg);border-color:var(--success);color:var(--ink)}
.option.wrong{background:var(--error-bg);border-color:var(--error);color:var(--ink)}
.option.selected.right{box-shadow:0 0 0 1px var(--success)}
.option.selected.wrong{box-shadow:0 0 0 1px var(--error)}
.option.right .option-letter{background:var(--success-bg);border-color:var(--success-border);color:var(--success)}
.option.wrong .option-letter{background:var(--error-bg);border-color:var(--error-border);color:var(--error)}
.confidence legend{font-size:1rem;font-weight:600}
.confidence-btn{border-radius:var(--radius-pill);background:var(--control-bg);border-color:var(--control-border);font-size:.9375rem;font-weight:500;transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease),box-shadow var(--motion-fast) var(--ease),transform var(--motion-fast) var(--ease)}
.confidence-btn:hover{background:var(--hover-bg);border-color:var(--hover-border)}
.confidence-btn.selected,.confidence-btn.selected:hover{background:var(--selected-bg);color:var(--selected-ink);border-color:var(--selected-border);box-shadow:0 0 0 1px var(--selected-border);font-weight:600}
.feedback{border-radius:var(--radius-lg);background:var(--surface);border-color:var(--border)}
.feedback-heading{color:var(--success);background:var(--success-bg);font-weight:600}
.feedback.incorrect .feedback-heading{color:var(--error);background:var(--error-bg)}
.feedback-body .eyebrow{font-size:.875rem;line-height:1.6}
.feedback-body p{line-height:1.7}
.solution{gap:17px;border-top-color:var(--border)}
.solution>strong{font-size:.9375rem;font-weight:600;color:var(--ink)}
.solution>div{line-height:1.8}
.schedule-label{line-height:1.6;border-radius:var(--radius-md)}
.keypad{gap:10px}
.keypad button{border-radius:var(--radius-md);background:var(--control-bg);border-color:var(--control-border);min-height:var(--control-h);font-weight:600;transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease),transform var(--motion-fast) var(--ease)}
.keypad button:hover{background:var(--hover-bg);border-color:var(--hover-border)}
/* Typed answers read at answer size, not form-field size. */
.typed-entry input,.typed-entry input[type=text]{font-size:1.5rem;font-weight:500;background:var(--control-bg);border:1px solid var(--control-border)}
.typed-entry input.active{background:var(--surface);border:2px solid var(--selected-border);box-shadow:0 0 0 3px var(--selected-bg)}
.level-circle{background:var(--highlight-bg);color:var(--accent)}
.teacher-assignment{background:var(--accent-soft);border-color:var(--accent-soft)}
.teacher-assignment .eyebrow{color:var(--accent)}
.teacher-grid .sidebar-sticky{top:24px}
.scenario{border-radius:17px;min-height:104px;background:var(--soft);gap:13px}
.scenario:hover{border-color:var(--accent-line);background:var(--accent-soft)}
.scenario .ico{width:23px;height:23px}
.scenario strong{font-weight:600}
.week-row{padding-block:20px}
.week-row.current{background:var(--accent-soft);border-radius:16px}
.week-row strong{font-weight:600}
.week-row .btn{border-radius:999px}
.week-info{overflow-wrap:anywhere}
.instruction-box{background:var(--soft);border-radius:16px}
/* The upload zone is an action target, so it uses the blue tint with a softened dashed edge. */
.upload-zone{border:1.5px dashed var(--hover-border);background:var(--accent-tint);border-radius:var(--radius-lg);padding:32px 20px;transition:border-color var(--motion-fast) var(--ease)}
.upload-zone:hover{border-color:var(--accent)}
.upload-zone:focus-within{outline:2px solid var(--focus-ring);outline-offset:3px;border-color:var(--accent)}
.upload-zone input{border:0;min-height:0}
.upload-zone .ico{padding:12px;width:54px;height:54px;border-radius:50%;background:var(--surface);color:var(--accent)}
.qr-box{background:#fff;border-color:var(--border);border-radius:18px}
.callout{border-radius:var(--radius-md);background:var(--control-bg)}
.callout.warn{background:var(--warning-bg);color:var(--warning);border-color:var(--warning)}
.callout.good{background:var(--success-bg);color:var(--success)}
.callout.error{background:var(--error-bg);color:var(--error)}
.demo-strip{background:var(--accent-soft);border-color:var(--accent-line);color:var(--muted)}
.demo-strip>div{max-width:1300px;font-size:.8125rem;justify-content:flex-start;gap:12px}
.demo-strip .text-btn{margin-left:auto;font-size:.875rem}
.demo-pill{border-radius:999px;background:var(--surface);color:var(--accent);font-size:.75rem;letter-spacing:0;padding:6px 10px}
.receipt{background:var(--surface);color:var(--ink);border-color:var(--line);border-radius:24px;box-shadow:var(--shadow)}
.receipt-head{--muted:var(--highlight-ink-secondary);background:var(--highlight-bg);color:var(--ink);padding:22px 20px;gap:16px}
.receipt-head .eyebrow{color:var(--accent);font-size:.8125rem}
.receipt-head p{color:var(--muted);font-size:.8125rem}
.receipt-meta,.receipt-stats small,.receipt-next,.receipt-caption,.receipt-footer{color:var(--muted)}
.receipt-next strong{color:var(--ink)}
.receipt-stats,.receipt-stats>div+div,.receipt-footer{border-color:var(--line)}
.receipt-body{padding:22px}
.receipt-breakdown{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.receipt-breakdown h3{font-size:.875rem;font-weight:700;margin-bottom:12px;color:var(--ink);text-align:center}
.breakdown-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:column;grid-template-rows:repeat(5,auto);gap:8px 16px;font-size:.8125rem}
.breakdown-item{display:flex;align-items:center;gap:6px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.breakdown-num{font-weight:700;color:var(--muted);min-width:14px}
.breakdown-mark{font-weight:700;min-width:14px;text-align:center}
.breakdown-mark.right{color:var(--success)}
.breakdown-mark.wrong{color:var(--error)}
.breakdown-topic{color:var(--ink);font-weight:500}
.breakdown-sep{color:var(--muted)}
.breakdown-id{color:var(--muted);font-size:.75rem}
@media(max-width:380px){.breakdown-grid{grid-auto-flow:row;grid-template-rows:none;grid-template-columns:1fr;gap:6px}}
.receipt .qr-box{border-radius:16px;margin-block:16px;background:#fff}
.sample-tag{background:var(--accent-soft);color:var(--accent);letter-spacing:0;padding:10px;font-size:.75rem}
.late-tag{background:var(--error-bg);color:var(--error);font-size:.875rem}
.receipt-footer{font-size:.8125rem;text-transform:none}
dialog{background:var(--surface-raised);border-color:var(--border);border-radius:var(--radius-xl);box-shadow:var(--shadow-float)}
dialog::backdrop{background:#191a2866;backdrop-filter:blur(4px)}
#toast{border:1px solid var(--border);background:var(--ink);color:var(--bg);border-radius:var(--radius-md);line-height:1.5;box-shadow:var(--shadow-float)}
.skip{background:var(--accent);color:var(--on-accent);border-radius:var(--radius-pill)}
.loading{font-family:var(--font);color:var(--muted)}
@media(min-width:1440px){.main{padding-top:36px}}
@media(max-width:1300px){.main{margin-inline:30px}.footer{margin-inline:30px}}
@media(max-width:1000px){.topbar-inner{padding-inline:24px}.nav a{padding-inline:12px}.brand .course-badge{display:none}}
@media(max-width:900px){.home-grid,.teacher-grid,.topic-layout{grid-template-columns:minmax(0,1fr)}.sidebar-sticky{position:static}.topbar-inner{gap:6px 18px}.main{margin-inline:24px}.brand{margin-bottom:8px}.topright{margin-bottom:8px}.nav{border-top:1px solid var(--line)}.nav a{padding:12px}.weekly-bottom{flex-direction:row;align-items:center}.progress-wrap{max-width:300px}.brand .course-badge{display:inline-flex}}
@media(max-width:650px){
  html{scroll-padding-bottom:110px}
  .topbar-inner{min-height:70px;padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));gap:8px}
  .brand{margin:0;display:grid;gap:5px}
  .brand .wordmark{font-size:1.4rem;letter-spacing:-.65px}
  .brand .course-badge{background:none;padding:0;border-radius:0;font-size:.75rem;color:var(--muted)}
  .topright{gap:6px;margin:0 0 0 auto}
  .icon-btn{width:42px;min-height:44px;height:44px;border-radius:13px}
  .nav{position:fixed;bottom:max(10px,env(safe-area-inset-bottom));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));width:auto;padding:7px;border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface-raised);box-shadow:var(--shadow-float);gap:2px}
  .nav a{padding:7px 2px;min-height:56px;border-radius:17px;font-size:.75rem;gap:5px;line-height:1.3}
  .nav .ico{display:block;width:21px;height:21px}
  .main{margin:0 max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left));padding:24px 0 30px}
  .footer{margin:0 20px;padding-bottom:calc(110px + env(safe-area-inset-bottom));font-size:.8125rem;gap:12px}
  .page-heading{margin-bottom:22px;gap:10px}
  .page-heading h1{font-size:1.5rem;line-height:1.3;letter-spacing:-.45px}
  .page-heading p{font-size:.9375rem;line-height:1.6}
  .heading-with-icon{gap:12px;align-items:flex-start}
  .heading-icon{width:44px;height:44px}
  .heading-icon .ico{width:23px;height:23px}
  .home-grid{gap:18px}
  .home-main{gap:18px}
  .weekly-card{padding:23px 21px;border-radius:var(--radius-xl)}
  .weekly-card h2{font-size:1.375rem;margin-top:24px}
  .weekly-card p{font-size:1rem}
  .weekly-top{gap:10px}
  .week-label{font-size:.875rem}
  .status-tag{font-size:.75rem;padding:6px 9px}
  .weekly-bottom{flex-direction:column;align-items:stretch;gap:22px;margin-top:24px}
  .progress-wrap{max-width:none}
  .card{padding:var(--space-5);border-radius:var(--radius-xl)}
  .btn{padding:13px 16px}
  .score-list{gap:8px}
  .score-item{padding:12px 10px;border-radius:14px}
  .score-item .score{font-size:1.4rem}
  .check-line{font-size:.75rem}
  .topic-card,.setup .topic-card{padding:0;border-radius:var(--radius-lg)}
  .topic-card summary{padding:17px 16px;gap:13px}
  .topic-symbol{width:44px;height:44px;font-size:1.05rem;border-radius:var(--radius-md)}
  .topic-body{padding:2px 16px 18px}
  .topic-card summary strong{font-size:.9375rem}
  .topic-card summary small{font-size:.8125rem}
  .setup form.card{padding:20px 16px}
  .question-toolbar{border-radius:22px;padding:7px 13px;gap:4px;margin-bottom:16px}
  .question-toolbar .text-btn{min-height:38px}
  .question-dots{gap:5px;padding-block:8px}
  .qdot{width:22px;height:22px}
  .question-card{padding:20px 16px}
  .qmeta{margin-bottom:18px;gap:8px;font-size:.8125rem}
  .qmeta>span:last-child{padding:6px 10px}
  .stem{padding:14px 13px;font-size:1.125rem;line-height:1.9;margin-bottom:20px}
  .option-grid{grid-template-columns:minmax(0,1fr);gap:10px}
  .option{min-height:64px;padding:12px;gap:12px;border-radius:var(--radius-md)}
  .option-letter{width:30px;height:32px;font-size:.9375rem}
  .option .katex{font-size:1.12em}
  .confidence-btn{font-size:.875rem;padding:12px 6px}
  .feedback-body{padding:16px 13px}
  .feedback-heading{padding:16px 14px}
  .teacher-grid .card{padding:21px 17px}
  .teacher-assignment h2{font-size:1.2rem}
  .week-row{gap:9px;padding-block:18px}
  .week-row .btn{padding:9px;font-size:.8125rem}
  .week-number{width:20px}
  .scenario{padding:17px 13px}
  .receipt-shell{max-width:480px}
  .receipt-head{padding:20px 14px}
  .receipt-head h1{font-size:1.4rem}
  .receipt-body{padding:20px 16px}
  .receipt-stats small{font-size:.8125rem}
  .receipt-caption{font-size:.875rem}
  .receipt-actions .btn{min-width:0}
  .completion-mode .main{padding-bottom:calc(22px + env(safe-area-inset-bottom))}
  .demo-strip>div{padding:10px 16px;font-size:.8125rem;gap:7px 10px}
  .demo-strip .text-btn{margin-left:0}
  dialog{padding:22px 18px;border-radius:24px}
  #toast{bottom:calc(100px + env(safe-area-inset-bottom))}
}
@media(max-width:360px){.brand .wordmark{font-size:1.25rem}.topbar-inner{padding-inline:12px}.main{margin-inline:12px}.heading-icon{display:none}.weekly-card{padding:20px 17px}.confidence-options{flex-direction:column}.question-toolbar{padding-inline:11px}.question-dots{gap:4px}.qdot{width:21px;height:21px}.score-list{grid-template-columns:minmax(0,1fr)}.receipt-head h1{font-size:1.2rem}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

.math-graph{margin:12px auto 4px;width:100%;max-width:440px;line-height:1}.math-graph svg{display:block;width:100%;height:auto;min-width:220px}.graph-bg{fill:var(--surface,#fff)}.graph-grid{stroke:currentColor;opacity:.09;stroke-width:1;fill:none}.graph-axes{stroke:currentColor;stroke-width:1.25;fill:none}.graph-labels,.graph-title{fill:currentColor;font:13px Inter,Arial,sans-serif}.graph-title{font-size:12px}.graph-curve{fill:none;stroke:var(--brand-supporting,#4F7EAA);stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}.graph-curve-second{stroke:var(--brand-gold,#D3A62C)}.graph-shade{fill:var(--brand-supporting,#4F7EAA);opacity:.28;stroke:none}.graph-mark{fill:currentColor;stroke:var(--surface,#fff);stroke-width:1.5}.graph-mark-label{fill:currentColor;font:12px Inter,Arial,sans-serif;font-weight:500}.graph-axis-label{paint-order:stroke;stroke:var(--surface,#fff);stroke-width:4px;stroke-linejoin:round}.options .math-graph{max-width:360px}.option:has(.math-graph){align-items:flex-start}.option:has(.math-graph)>span:last-child{width:100%;min-width:0}@media(max-width:540px){.math-graph svg{min-width:180px}.option:has(.math-graph){padding:10px}.option:has(.math-graph) .math-graph{margin:0 auto}.option:has(.graph-mark-label){flex-direction:column;align-items:stretch;gap:6px;padding:8px}.option:has(.graph-mark-label)>.option-letter{align-self:flex-start}}@media(max-width:900px){.option-grid:has(.graph-mark-label){grid-template-columns:minmax(0,1fr)}}

/* Practice sprint selection and Fix Gaps */
.sprint-options{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
/* Segmented control: shares the selected language of options and confidence. */
.sprint-btn{flex:1;min-width:100px;min-height:var(--control-h);padding:12px 18px;border-radius:var(--radius-md);border:1px solid var(--control-border);background:var(--control-bg);color:var(--ink);font-weight:600;font-size:.9375rem;cursor:pointer;transition:background-color var(--motion-fast) var(--ease),border-color var(--motion-fast) var(--ease),box-shadow var(--motion-fast) var(--ease),transform var(--motion-fast) var(--ease)}
.sprint-btn:hover{background:var(--hover-bg);border-color:var(--hover-border)}
.sprint-btn.active,.sprint-btn.active:hover{background:var(--selected-bg);color:var(--selected-ink);border-color:var(--selected-border);box-shadow:0 0 0 1px var(--selected-border)}
.status-tag.success{color:var(--success);background:var(--success-bg);border-color:var(--success)}
.level-progress{background:var(--progress-track)}
.level-progress span{background:var(--progress-fill)}
.target-list{display:flex;flex-direction:column;gap:12px;margin-top:18px}
.target-item{padding:18px 20px;border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--surface);transition:border-color var(--motion-fast) var(--ease)}
.target-item.completed{background:var(--control-bg);opacity:.85}
.pill.pill-warn{color:var(--warning);background:var(--warning-bg)}
.pill.pill-success{color:var(--success);background:var(--success-bg)}
.mb8{margin-bottom:8px}
.mb16{margin-bottom:16px}
.mt16{margin-top:16px}
.text-center{text-align:center}

/* Privacy page */
.privacy-card{max-width:760px;margin:0 auto;padding:36px 40px}
.privacy-card h1{font-size:2rem;letter-spacing:-.65px;margin-bottom:16px}
.privacy-card h2{font-size:1.25rem;letter-spacing:-.35px;margin-top:34px;margin-bottom:12px;color:var(--ink)}
.privacy-card p{font-size:1rem;line-height:1.7;margin-bottom:14px;color:var(--ink)}
.privacy-card .privacy-lead{font-size:1.125rem;font-weight:500;line-height:1.65;color:var(--ink)}
.privacy-card ul{margin:12px 0 20px;padding-left:22px;display:flex;flex-direction:column;gap:8px}
.privacy-card li{font-size:1rem;line-height:1.65;color:var(--ink)}
.privacy-card a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.privacy-card a:hover{color:var(--accent-hover)}
.privacy-card-actions{margin-top:36px;padding-top:24px;border-top:1px solid var(--line)}
@media(max-width:650px){
  .privacy-card{padding:24px 20px}
  .privacy-card h1{font-size:1.6rem}
  .privacy-card h2{font-size:1.15rem;margin-top:28px}
  .privacy-card .privacy-lead{font-size:1.05rem}
  .privacy-card ul{padding-left:18px}
}


/* Stem-derived Vector solid diagrams; the existing graph container supplies sizing. */
.vector-edges{fill:none;stroke:currentColor;stroke-width:1.2;opacity:.45}.vector-arrow{fill:none;stroke:currentColor;stroke-width:2}.vector-directions{color:var(--brand-supporting,#4F7EAA)}.vector-vertices circle{fill:currentColor}.vector-vertices text,.vector-edge-label{fill:currentColor;font:16px Inter,Arial,sans-serif;font-weight:600;paint-order:stroke;stroke:var(--surface,#fff);stroke-width:4px;stroke-linejoin:round}.vector-edge-label{font-style:italic}.vector-caption{fill:currentColor;font:11px Inter,Arial,sans-serif;opacity:.65}

/* Stem-derived circle geometry diagrams; the existing graph container supplies sizing. */
.circle-curve{fill:none;stroke:var(--brand-supporting,#4F7EAA);stroke-width:2.6}.circle-curve-second{stroke:var(--brand-gold,#D3A62C)}.circle-line{fill:none;stroke:currentColor;stroke-width:1.8;opacity:.8}.circle-segment{fill:none;stroke:currentColor;stroke-width:1.4;stroke-dasharray:5 4;opacity:.7}.circle-points circle{fill:currentColor}.circle-points text{fill:currentColor;font:15px Inter,Arial,sans-serif;font-weight:600;paint-order:stroke;stroke:var(--surface,#fff);stroke-width:4px;stroke-linejoin:round}.circle-points .circle-sub{font-size:11px}

/* ---------- Premium polish Stage 2: core pupil experience ----------
   Screen composition on top of the Stage 1 tokens. Presentation only. */

/* Home: the hero stays full width; supporting cards pair up on wide screens instead of stretching. */
@media(min-width:901px){
  .home-main{grid-template-columns:repeat(6,minmax(0,1fr))}
  .home-main>*{grid-column:1/-1}
  .home-main>.home-fix,.home-main>.home-practice{grid-column:span 3}
  .home-main:not(:has(.home-fix))>.home-practice{grid-column:1/-1}
  .home-main>.home-recent{grid-column:span 4}
  .home-main>.level-card{grid-column:span 2}
  .home-main:not(:has(.level-card))>.home-recent{grid-column:1/-1}
  /* Hero: text on the left, progress and the one action gathered on the right. */
  .weekly-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,320px);column-gap:48px}
  .weekly-card>.weekly-top{grid-column:1/-1}
  .weekly-card>h2,.weekly-card>p{grid-column:1}
  .weekly-card>.weekly-bottom{grid-column:2;grid-row:2/span 3;align-self:end;flex-direction:column;align-items:stretch;justify-content:flex-end;margin-top:0;gap:18px}
  .weekly-card .progress-wrap{max-width:none;flex:none}
}
.home-action .row.between{align-items:center}
.home-action h3{display:flex;align-items:center;gap:8px;margin-bottom:6px}
/* A small status dot says "there is something to do" (warning) or "done" (success) without another badge. */
.home-fix h3::before{content:"";width:8px;height:8px;border-radius:50%;flex:none}
.home-fix.is-actionable h3::before{background:var(--warning)}
.home-fix.is-resolved h3::before{background:var(--success)}

/* Recent weeks: one tile language that reads as a row on phone. */
.score-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.score-item{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"label status" "score score" "track track";align-items:center;gap:10px 8px;padding:14px 16px}
.score-item>.mini-label{grid-area:label}
.score-item>.check-line{grid-area:status;margin:0;justify-self:end;white-space:nowrap}
.score-item>.score{grid-area:score;margin:0}
.score-item>.score-track{grid-area:track}
/* The markup is upper case; present it in the app's sentence case. */
.score-item>.mini-label,.level-card .mini-label{display:inline-block;text-transform:lowercase}
.score-item>.mini-label::first-letter,.level-card .mini-label::first-letter{text-transform:uppercase}

/* Level card: present, but quieter than the learning cards. */
.level-card{gap:14px;align-items:center}
.level-card .level-circle{width:44px;height:44px;font-size:1.125rem;font-weight:600}
.level-card h3{font-size:1rem;margin-bottom:2px}
.level-card .level-progress{height:5px;margin-top:8px}

/* Topics: two columns of collapsed topics on wide screens; an open topic takes the full row. */
@media(min-width:760px){
  .topic-layout>section,.practice-topics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
  .topic-layout>section>.topic-card,.practice-topics>.topic-card{margin-bottom:0}
  .topic-layout>section>.topic-card[open],.practice-topics>.topic-card[open]{grid-column:1/-1}
  :is(.topic-layout>section,.practice-topics)>.topic-card[open] .topic-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:28px}
  :is(.topic-layout>section,.practice-topics)>.topic-card[open] .topic-body>.checkbox-line:first-child{grid-column:1/-1}
}
/* Skills already met in homework carry a small dot; the skill name stays the main content. */
.checkbox-line .mini-label{color:var(--muted)}
.checkbox-line.is-practised .mini-label::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-right:6px;vertical-align:.1em}
.practice-topics .topic-card.has-selection summary small{color:var(--selected-ink);font-weight:500}
.selection-count.is-active{background:var(--selected-bg);color:var(--selected-ink);border-radius:var(--radius-pill);padding:4px 10px;font-weight:500}

/* Segmented controls: sprint length and confidence share one compact, secondary shape. */
.segmented,.confidence-options{display:flex;flex-wrap:nowrap;gap:4px;padding:4px;background:var(--control-bg);border:1px solid var(--control-border);border-radius:var(--radius-md)}
.segmented{max-width:480px;margin-top:14px}
.segmented .sprint-btn,.confidence-options .confidence-btn{flex:1 1 0;min-width:0;min-height:var(--control-h-sm);padding:8px 6px;border:1px solid transparent;border-radius:var(--radius-sm);background:transparent;box-shadow:none;white-space:nowrap;font-size:.9375rem;font-weight:500;color:var(--ink)}
.segmented .sprint-btn:hover,.confidence-options .confidence-btn:hover{background:var(--hover-bg);border-color:transparent}
.segmented .sprint-btn.active,.segmented .sprint-btn.active:hover,.confidence-options .confidence-btn.selected,.confidence-options .confidence-btn.selected:hover{background:var(--selected-bg);border-color:var(--selected-border);color:var(--selected-ink);box-shadow:none;font-weight:600}
/* Confidence is the second decision: a labelled compact control, not another set of answer tiles. */
.confidence{margin-top:24px;padding-top:20px;border-top-color:var(--border)}
.confidence legend{font-size:.9375rem;font-weight:600;margin-bottom:10px}
.confidence-options{max-width:520px}

/* Answer options: the answer outweighs its letter; inline fractions are set large enough to read. */
.option{gap:14px}
.option-letter{width:28px;height:28px;font-size:.8125rem;color:var(--muted)}
.option .katex-html>.base>.mord>.mfrac{font-size:1.3em}
.option .katex{padding-block:6px}
.stem .katex-html>.base>.mord>.mfrac,.solution .katex-html>.base>.mord>.mfrac,.feedback-body p .katex-html>.base>.mord>.mfrac{font-size:1.15em}

/* Typed answers take the same marked language as options once checked. */
.typed-entry.marked-right input,.typed-entry.marked-right input.active{background:var(--success-bg);border:2px solid var(--success);box-shadow:none;color:var(--ink)}
.typed-entry.marked-wrong input,.typed-entry.marked-wrong input.active{background:var(--error-bg);border:2px solid var(--error);box-shadow:none;color:var(--ink)}
.typed-entry.marked-right::after,.typed-entry.marked-wrong::after{font-size:1.25rem;font-weight:600;line-height:1}
.typed-entry.marked-right::after{content:"✓";color:var(--success)}
.typed-entry.marked-wrong::after{content:"✕";color:var(--error)}

/* Remediation context: one visible line (the question meta); the toolbar keeps a short chip and
   carries the repeated detail for assistive technology only. */
.mode-chip{white-space:nowrap}
.mode-chip-detail{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Feedback: a semantic header, then the content flows in the question card instead of a box within a box. */
.feedback{border:0;border-radius:0;background:transparent;overflow:visible}
.feedback-heading{border-radius:var(--radius-md);padding:14px 16px}
.feedback-body{padding:18px 2px 0}
.feedback-body>.eyebrow{margin-bottom:10px}
.feedback-answer{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:12px 16px;background:var(--success-bg);border-radius:var(--radius-md);color:var(--muted);font-size:.9375rem}
.feedback-answer strong{color:var(--ink);font-weight:600;font-size:1.0625rem}
.feedback-answer .katex{font-size:1.2em}
.solution{margin-top:20px;padding-top:18px;gap:12px}
.solution>div{line-height:1.75}
/* System metadata is present but secondary to the mathematics. */
.feedback-body .schedule-label{margin-top:20px;padding:5px 10px;font-size:.8125rem;background:transparent;border:1px solid var(--border);color:var(--muted);flex-wrap:nowrap;align-items:flex-start;max-width:100%}
.schedule-label .ico{width:15px;height:15px;margin-top:3px}
.feedback-body .fine{margin-top:10px;font-size:.75rem;color:var(--text-tertiary)}
.qactions>.small.muted{font-size:.8125rem;color:var(--text-tertiary)}

/* Fix gaps: a focused workspace the width of the question card, with calm fixed rows. */
.main[data-screen=fix-gaps]>*{max-width:870px;margin-inline:auto}
.target-list{gap:10px}
.target-item{padding:16px 18px;box-shadow:var(--shadow-low)}
.target-item .row.gap8{gap:14px}
.target-item strong{font-weight:600}
.target-item .small{margin-top:2px}
.target-item .topic-symbol{width:44px;height:44px;font-size:1.05rem}
.target-item.completed{opacity:1;background:var(--surface);box-shadow:none;border-color:var(--success-border)}
.target-item.completed strong{color:var(--muted);font-weight:500}
.main[data-screen=fix-gaps] .row.mb8{flex-wrap:wrap;gap:6px 10px}
.main[data-screen=fix-gaps] .row.mb8 h3{flex:1 1 220px;margin:0}

@media(min-width:651px){
  /* Page-closing actions are content width and centred on larger screens; full width stays for phone. */
  .main[data-screen=practice] [data-action=start-practice],.main[data-screen=fix-gaps] .stack>.btn.full{justify-self:center;width:auto;min-width:280px;padding-inline:32px}
}
@media(max-width:900px){
  /* Two-row tablet header: keep both rows, trim their padding. */
  .topbar-inner{padding-top:10px}
  .nav{padding:4px 0}
  .nav a{padding-block:9px}
}
@media(max-width:650px){
  /* Question screens: less chrome and nesting before the maths. */
  .main:is([data-screen=question],[data-screen=practice-session],[data-screen=remediation-session]){margin:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));padding-top:12px}
  .topbar-inner{min-height:60px;padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:8px}
  .question-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;border-radius:var(--radius-lg);padding:2px 10px 9px;gap:2px 8px;margin-bottom:10px}
  .question-toolbar .text-btn{min-height:40px}
  .question-toolbar .mode-chip{font-size:.75rem;padding:5px 9px}
  .question-dots{grid-column:1/-1;flex-wrap:nowrap;gap:3px;padding:0}
  .qdot{flex:1 1 0;min-width:0;max-width:30px;width:auto;height:19px;border-radius:6px;font-size:.6875rem}
  .question-card{padding:14px 14px 16px}
  .qmeta{margin-bottom:12px;gap:2px 10px;font-size:.8125rem}
  .qmeta>span:last-child{background:none;padding:0;color:var(--muted)}
  .stem{padding:10px 12px;margin-bottom:16px;line-height:1.75}
  .typed-entry input{height:52px}
  .keypad{gap:6px;margin-top:10px}
  .keypad button{min-height:46px}
  .confidence{margin-top:20px;padding-top:16px}
  .confidence-options{max-width:none}
  .feedback-body{padding:16px 0 0}
  .feedback-heading{padding:12px 14px}
  .feedback-answer{padding:10px 12px}
  /* Recent weeks as compact rows. */
  .score-list{grid-template-columns:minmax(0,1fr);gap:8px}
  .score-item{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"label score status" "track track track";padding:12px 14px;gap:8px 12px}
  .score-item>.score{font-size:1.25rem}
  .segmented .sprint-btn{font-size:.875rem;padding-inline:4px}
  .target-item{padding:14px}
}
@media(max-width:360px){
  .confidence-options{flex-direction:row}
  .confidence-options .confidence-btn,.segmented .sprint-btn{font-size:.8125rem}
}

/* ---------- Premium polish Stage 3: completion surfaces, dialogs, diagrams ---------- */

/* Completion Ticket: a finished document with a firm edge, deliberate lift and a framed QR well. */
.receipt{border:1px solid var(--border-strong);border-radius:var(--radius-xl);box-shadow:var(--shadow-float)}
.receipt-head{justify-content:center;text-align:center;padding:24px 22px 20px;border-bottom:1px solid var(--highlight-border)}
.receipt-head>div{text-align:center}
.receipt-head .eyebrow{font-weight:600;margin-bottom:2px}
.receipt-head h1{font-size:1.625rem;margin:2px 0 4px}
.receipt-body{padding:22px 24px 20px}
.receipt-name{font-size:1.1875rem;font-weight:600;margin-bottom:2px}
.receipt-stats{margin:16px 0 12px;padding:14px 0}
.receipt-stats strong{font-size:1.75rem;font-weight:600;letter-spacing:-.5px;font-variant-numeric:tabular-nums}
/* Units sit beside every number at one size, so "1 m 31 s" reads as one value. */
.stat-unit{font-size:.9375rem;font-weight:500;letter-spacing:0;color:var(--muted);margin-left:1px}
.confidence-counts{gap:6px 16px;margin-bottom:4px}
.receipt-breakdown{margin-top:16px;padding-top:14px}
.receipt-breakdown .breakdown-grid{text-align:left;gap:7px 20px}
.breakdown-item{display:grid;grid-template-columns:18px 14px minmax(0,1fr) auto;align-items:baseline;column-gap:6px;overflow:visible}
.breakdown-sep{display:none}
.breakdown-topic{overflow:hidden;text-overflow:ellipsis}
/* Question references stay on the ticket for teachers, but recede. */
.breakdown-id{font-size:.6875rem;color:var(--text-tertiary)}
@media(min-width:651px){.receipt-shell{max-width:520px}}
.receipt-next{margin:14px 0 4px}
.receipt .qr-box{background:#fff;border:1px solid var(--border-strong);border-radius:18px;padding:12px;width:min(100%,300px);margin:18px auto 8px;box-shadow:0 1px 2px #1c1b2e0f}
.receipt-caption{max-width:320px}
.receipt-footer{margin-top:14px;padding-top:12px}
.receipt-actions{margin-top:16px;flex-wrap:wrap}
.receipt-actions .btn{white-space:nowrap}

/* Practice summary: the same document language, lighter and without the weekly gold. */
.practice-summary{border-color:var(--border);box-shadow:var(--shadow-low)}
.practice-summary .receipt-head{--muted:var(--text-secondary);background:var(--accent-tint);border-bottom-color:var(--border)}
.practice-summary .receipt-head .eyebrow{color:var(--accent)}
.practice-summary .receipt-stats{border-top:0;margin-top:0;padding-top:4px}
.practice-summary .callout{text-wrap:balance}
.practice-skills{margin-top:18px}
.practice-skills h3{font-size:.875rem;font-weight:600;margin-bottom:10px}
.practice-skills ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.practice-skills li{background:var(--control-bg);border:1px solid var(--border);border-radius:var(--radius-pill);padding:4px 11px;font-size:.8125rem;line-height:1.5}

/* Progress / Restore: one column until two genuinely fit; cards keep their own height. */
.restore-layout{grid-template-columns:minmax(0,1fr);align-items:start;gap:20px}
@media(min-width:1000px){.restore-layout{grid-template-columns:repeat(2,minmax(0,1fr))}}
.restore-save .row.wrap{gap:10px}
.restore-save .btn{min-height:var(--control-h)}
.trust-note{display:flex;align-items:flex-start;gap:10px}
.trust-note .ico{flex:none;width:18px;height:18px;margin-top:2px;color:var(--accent)}
/* Reset is an advanced, separate action: a quiet full-width strip rather than a promoted card. */
.restore-reset{grid-column:1/-1;background:transparent;box-shadow:none;padding:6px 20px}
.restore-reset .disclosure>summary{color:var(--muted)}
/* Disclosures: a whole tappable row with the app's chevron, closed right and open down. */
.disclosure>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:var(--control-h-sm);padding:10px 14px;margin:0 -14px;border-radius:var(--radius-md);font-size:.9375rem;font-weight:500;color:var(--accent);cursor:pointer;transition:background-color var(--motion-fast) var(--ease)}
.disclosure>summary::-webkit-details-marker{display:none}
.disclosure>summary::after{content:'';flex:none;width:8px;height:8px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);margin-right:4px}
.disclosure[open]>summary::after{transform:rotate(45deg)}
.disclosure>summary:hover{background:var(--hover-bg)}

/* Dialogs share one rhythm; every action is a full-height control. */
dialog h2{font-size:1.25rem;margin-bottom:10px}
dialog .actions{margin-top:20px;gap:10px}
dialog .actions .btn,dialog>.btn{min-height:var(--control-h)}
.install-steps{gap:10px;margin:18px 0}
.install-steps section{background:var(--control-bg);border:1px solid var(--border);border-radius:var(--radius-md);padding:12px 14px}
.install-steps h3{font-size:.9375rem;margin:0 0 4px}
.install-steps p{font-size:.9375rem;line-height:1.55;color:var(--muted)}

/* Maths punctuation stays on the maths' line (see glueMathPunctuation). */
.math-nowrap{white-space:nowrap}
.qactions>.small.muted:empty{display:none}

/* Diagrams: labels carry a halo in the plate colour so they stay legible where they meet lines;
   numbers and maths letters use the KaTeX faces already loaded for the notation. */
.graph-labels text,.graph-mark-label,.graph-title{paint-order:stroke;stroke:var(--surface,#fff);stroke-width:4px;stroke-linejoin:round}
.graph-labels text,.graph-mark-label{font-family:KaTeX_Main,'Times New Roman',serif;font-size:14px}
.math-graph:not(.circle-diagram) .graph-axes+.graph-labels text:nth-last-child(-n+2),.circle-diagram .graph-labels text{font-family:KaTeX_Math,'Times New Roman',serif;font-style:italic;font-size:15px}
.circle-diagram .graph-labels text:nth-child(3){font-family:KaTeX_Main,'Times New Roman',serif;font-style:normal;font-size:14px}
.graph-title{font-size:11.5px}
/* The y letter sits left of the axis arrow so a right-aligned graph title never runs into it. */
.math-graph:not(.circle-diagram) .graph-axes+.graph-labels text:last-child{transform:translateX(-21px)}
.vector-vertices text,.circle-points text{font-family:KaTeX_Math,'Times New Roman',serif;font-style:italic;font-weight:400}
.circle-points .circle-sub{font-family:KaTeX_Main,'Times New Roman',serif;font-style:normal}
.vector-edge-label{font-family:KaTeX_Main,'Times New Roman',serif;font-style:normal;font-weight:700}
[data-theme=dark] .vector-edges{opacity:.72}
[data-theme=dark] .graph-grid{opacity:.14}
[data-theme=dark] .circle-segment{opacity:.9}
@media(max-width:540px){
  /* Graphs scale down with the screen; lift label sizes so they stay near 12px on phone. */
  .graph-labels text{font-size:16px}
  .graph-mark-label{font-size:14.5px}
  .math-graph:not(.circle-diagram) .graph-axes+.graph-labels text:nth-last-child(-n+2),.circle-diagram .graph-labels text{font-size:17px}
  .circle-diagram .graph-labels text:nth-child(3){font-size:16px}
  .graph-title{font-size:11.5px}
  .vector-vertices text,.vector-edge-label{font-size:18px}
  .circle-points text{font-size:17px}
  .circle-points .circle-sub{font-size:12px}
}
@media(max-width:650px){
  .completion-mode .main{margin-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
  .receipt-body{padding:18px 16px}
  .receipt-head{padding:20px 16px 18px}
  .receipt .qr-box{padding:10px}
}
