@import url('https://fonts.googleapis.com/css2?family=Literata:opsz,wght@7..72,400;7..72,500;7..72,600;7..72,700&family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif&display=swap');
*{box-sizing:border-box}
body{margin:0;background:#f4f3ee;color:#202c2a;font:16px 'DM Sans',sans-serif}
button{font:inherit;cursor:pointer}
.brand{font-weight:700;letter-spacing:-.04em;font-size:20px}
.brand span{color:#718f67}
.header-right{font-size:13px;color:#6f7a73}
.wrap{max-width:1080px;margin:auto;padding:58px 28px 90px}
.eyebrow{color:#657f5e;font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase}
h1{font:normal clamp(44px,6vw,68px)/1 'Instrument Serif',Georgia,serif;letter-spacing:-.025em;margin:14px 0 18px}
h2{font:normal 36px 'Instrument Serif',Georgia,serif;margin:0 0 12px}
.intro{color:#68776f;line-height:1.65;max-width:560px}
.card{background:white;border:1px solid #e0e5dc;border-radius:18px;box-shadow:0 12px 35px #253b2409}
.start{margin-top:42px;max-width:720px;padding:32px;display:flex;justify-content:space-between;align-items:center;gap:28px}
.start h2{margin:5px 0}
.meta{color:#77827a;font-size:14px}
.layout{display:grid;grid-template-columns:1fr 220px;gap:22px;align-items:start}
.question{padding:34px}
.qhead{display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid #edf0ea;padding-bottom:22px;margin-bottom:24px}
.question h2{font:600 18px 'DM Sans',sans-serif;margin:0}
.stem{font-size:17px;line-height:1.75;white-space:pre-line;overflow-x:auto}
.figure{display:block;max-width:min(100%,570px);max-height:350px;object-fit:contain;margin:26px auto}
.choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%, 95px),1fr));gap:10px;margin-top:28px}
.choices.long{grid-template-columns:repeat(auto-fit,minmax(min(100%, 260px),1fr))}
.choice{width:100%;min-width:0;max-width:100%;display:flex;text-align:left;align-items:center;gap:12px;background:#fff;border:1px solid #e1e7dd;border-radius:10px;padding:12px 16px;color:#27372c;font-size:18px;line-height:1.5}
.choice:hover{border-color:#83a47a}
.choice.selected{background:#eef5ec;border-color:#527f5e}
.letter{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:7px;background:#f1f4ef;font-weight:700}
.controls{display:flex;justify-content:space-between;margin-top:30px;gap:10px}
.controls button:disabled{opacity:.4;cursor:default}
.side{padding:24px}
.side h3{margin:0 0 8px;font-size:15px}
.small{font-size:13px;color:#78847c;line-height:1.5}
.grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin:20px 0}
.grid button{padding:0;height:31px;border:0;border-radius:6px;background:#f1f3ee;color:#536256;font-size:12px}
.grid button.done{background:#d6e9d3;color:#245837}
.grid button.current{outline:2px solid #527f5e}
.side .primary{width:100%}
.score{display:flex;align-items:baseline;gap:12px;margin:28px 0}
.score strong{font:normal 64px 'Instrument Serif',Georgia}
.result-row{padding:14px 0;border-top:1px solid #edf0ea;display:flex;justify-content:space-between;gap:10px}
.result-row button{border:0;background:transparent;color:#285a43;font-weight:700}
.good{color:#397649}
.bad{color:#a04c3d}
.warning{font-size:13px;color:#8c6241}
.hide{display:none}
@media(max-width:720px){
.wrap{padding:38px 18px}
.layout{grid-template-columns:1fr}
.question{padding:23px}
.side{order:-1}
.grid{grid-template-columns:repeat(10,1fr)}
.start{align-items:flex-start;flex-direction:column}
}

#feedback{font-weight:700;margin:18px 0 12px}
.choice:disabled{cursor:default;color:#27372c}
.choice.correct-choice{border:2px solid #368351;background:#edf7ed;box-shadow:0 0 0 3px #438d5633}
.choice.incorrect-choice{border:2px solid #b84442;background:#fff0ed;box-shadow:0 0 0 3px #bd4a4633}
.choice-marker{font-size:12px;font-weight:700;margin-left:auto}
.choices:has(.choice-marker){grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))}
.grid button.correct{background:#dcf0dd;color:#205b36}
.grid button.incorrect{background:#f8dfda;color:#8e3029}
#explanation{margin-top:16px;border:1px solid #dfe6da;border-radius:10px;background:#f7f9f4}
#explanation summary{cursor:pointer;padding:14px 16px;font-weight:700;color:#244c3d}
.explanation-body{padding:0 16px 16px;line-height:1.65}
.explanation-body h3{margin:16px 0 6px;font-size:17px}
.explanation-body h4{margin:10px 0 4px;font-size:15px}
.explanation-body p{margin:0 0 10px}
.side #restart{width:100%}


.primary,.secondary{border:0;border-radius:9px;padding:13px 20px;font-weight:700}.primary{background:#244c3d;color:white}.primary:hover{background:#193b2e}.secondary{background:#eef2eb;color:#274b3d}

:root{--header-height:62px}
.topbar{position:sticky;top:0;z-index:2;height:var(--header-height);display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid #e6e0d2;padding:8px max(5%,calc((100% - 1240px)/2));background:#fbf8f1}
.topbar .brand{border:0;background:transparent;color:#172d25;padding:6px 0;text-align:left;font-size:clamp(18px,3.6vw,24px);white-space:nowrap}
.topbar .brand span{color:#a64e32;font-weight:700;margin:0 .06em}
.topbar nav{display:flex;gap:10px;align-items:center;justify-content:flex-end}
.topbar nav.hide{display:none}
.topbar .primary{white-space:nowrap}
.topbar .nav-outline,.topbar .primary,.topbar summary{display:flex;align-items:center;justify-content:center;height:40px;padding:0 14px;font-size:14px;line-height:1}
.nav-outline,.topbar summary{border:1px solid #597566;border-radius:9px;padding:0 14px;background:transparent;color:#173e2f;font-weight:700;text-decoration:none}
.nav-outline:hover,.topbar summary:hover{background:#e9ede3}
.topbar details{position:relative}
.topbar summary{cursor:pointer;list-style:none;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar summary::-webkit-details-marker{display:none}

.header-actions{display:flex;align-items:center;gap:10px;min-width:0}
@media(max-width:650px){
  .topbar{gap:10px;padding-inline:14px}
  .header-actions,.topbar nav{gap:6px}
  .topbar .nav-outline,.topbar .primary,.topbar summary{padding:0 11px;font-size:13px}
}
@media(max-width:390px){
  .topbar .brand{font-size:16px}
  .topbar .nav-outline,.topbar .primary,.topbar .account-menu summary{padding-inline:7px}
  .topbar .theme-toggle{width:28px}
}

body{background:#f8f5ee}
.wrap:has(#home:not(.hide)){max-width:1328px;padding:22px 30px 38px}
.hero{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,23%);align-items:center;gap:14px;isolation:isolate;border:1px solid #e8e0d1;border-radius:22px;background:#f4eee2;overflow:hidden;min-height:clamp(322px,37vw,394px);padding:24px clamp(16px,2.5vw,34px)}
.hero-copy{z-index:1;width:min(100%,440px);padding-left:clamp(4px,2vw,25px)}
.hero-copy .eyebrow{margin:0 0 12px;color:#526253}
.hero h1{margin:0;color:#142922;font-size:clamp(51px,6.2vw,89px);line-height:.9;letter-spacing:-.035em}
.hero h1 em{font-style:normal;color:#355b42}
.hero .intro{color:#4b564e;margin:16px 0 19px;max-width:min(100%,345px);line-height:1.45}
.hero-actions{display:flex;gap:8px;flex-wrap:wrap}
.hero-actions .primary span{margin-left:8px}
.hero-photo{position:absolute;z-index:-1;inset:0 0 0 25%}
.hero-photo-frame{position:relative;width:89%;height:100%;overflow:hidden;--photo-anchor-x:49%}
.hero-photo img{position:absolute;display:block;width:100%;height:100%;object-fit:cover;object-position:var(--photo-anchor-x) top}
.hero-photo::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#f4eee2 0%,#f4eee2ef 7%,#f4eee29e calc(17% + var(--photo-fade,0%) * .5),transparent calc(35% + var(--photo-fade,0%)),transparent 73%,#f4eee2 89%)}
.progress-card{z-index:1;min-width:0;align-self:end;margin:0 0 4px;padding:clamp(10px,1.5vw,18px);border:1px solid #ffffffc0;border-radius:15px;background:#fffdf1ef;color:#163f32;box-shadow:0 12px 35px #172f2733;backdrop-filter:blur(7px)}
.progress-card figcaption{display:grid;grid-template-columns:1fr auto;align-items:baseline;gap:5px}
.progress-label{grid-column:1/-1;font-size:12px;font-weight:700;color:#496554}
.progress-score{font:normal clamp(35px,4vw,54px)/1 'Instrument Serif',Georgia,serif;white-space:nowrap}
.progress-score small{font-size:.52em;color:#536b5c}
.progress-gain{font-size:clamp(10px,1vw,13px);font-weight:700;color:#194f3b;white-space:nowrap}
.progress-card canvas{display:block;width:100%;height:auto;margin-top:7px}
.progress-axis{display:flex;justify-content:space-between;gap:4px;padding-left:8%;font-size:clamp(9px,.9vw,12px);color:#496554}
.home-benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:15px 0}
.home-benefits section{display:flex;gap:9px;padding:0 clamp(7px,1.3vw,16px)}
.home-benefits section+section{border-left:1px solid #e6e0d2}
.home-benefits span{color:#497957;font-size:19px;line-height:1}
.home-benefits h2{font-size:clamp(19px,2.2vw,25px);color:#1b3328;margin:0 0 3px;line-height:1.05}
.home-benefits p{margin:0;color:#59645c;font-size:13px;line-height:1.35}
#archive{margin-top:17px;scroll-margin-top:80px}
.archive-heading{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.account-panel{max-width:470px}
.account-panel form{display:grid;gap:15px}
.account-panel input{display:block}
.account-alternatives{display:grid;gap:7px;justify-items:start}
.text-button{padding:4px 0;border:0;background:none;color:#244c3d;text-decoration:underline}
.panel{padding:clamp(20px,4vw,40px);max-width:780px;margin:auto}
.panel form{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin:20px 0}
.panel label{display:grid;gap:6px;font-size:14px;font-weight:600}
.panel input{font:inherit;padding:10px;border:1px solid #c7d5c8;border-radius:8px;width:100%}
.panel table{border-collapse:collapse;width:100%}
.panel th,.panel td{text-align:left;border-bottom:1px solid #dfe8de;padding:10px}
.panel caption{text-align:left;margin:12px 0}
.notice{margin:0;padding:12px max(5%,calc((100% - 1024px)/2));background:#f8e6da;color:#793a30}
.choice .figure{width:min(100%,220px);max-height:150px;margin:0}
.choice:has(img){flex-wrap:wrap}
.choices.visual{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))}
.mistake-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #e5ebe3}
@media(max-width:1024px){
  .wrap:has(#home:not(.hide)){padding:16px 20px 32px}
  .hero-copy{width:min(100%,350px)}
  .hero .intro{max-width:270px}
  .hero-photo{left:28%}
  .hero-actions button{font-size:14px;padding:10px 12px}
  .hero-actions .primary span{margin-left:4px}
}
@media(max-width:820px){
  .hero-photo{left:30%}
  .hero-photo-frame{--photo-anchor-x:42%}
  .hero-photo::after{background:linear-gradient(90deg,#f4eee2 0%,#f4eee2ef 9%,#f4eee293 calc(21% + var(--photo-fade,0%) * .5),transparent calc(37% + var(--photo-fade,0%)),transparent 73%,#f4eee2 89%)}
  .progress-card{align-self:end;margin-bottom:0}
}
@media(max-width:650px){
  .wrap:has(#home:not(.hide)){padding:14px 14px 30px}
  .hero{grid-template-columns:minmax(0,1fr);min-height:0;padding:0}
  .hero-copy{padding:24px 18px 0}
  .hero-photo{position:relative;inset:auto;height:clamp(196px,55vw,310px);grid-row:2}
  .hero-photo-frame{width:100%;--photo-anchor-x:50%}
  .hero-photo::after{background:linear-gradient(#f4eee2,transparent calc(18% + var(--photo-fade,0%)))}
  .progress-card{position:absolute;right:10px;bottom:10px;width:clamp(128px,36vw,172px);padding:8px 9px}
  .progress-label{font-size:10px}
  .progress-card canvas{margin-top:3px}
  .home-benefits{grid-template-columns:1fr;padding:9px 0;gap:0}
  .home-benefits section{padding:7px 3px}
  .home-benefits section+section{border-left:0}
}

/* Keep the answer rail independent of the question's length. */
#exam .layout{grid-template-columns:minmax(0,1fr) clamp(264px,34vw,330px);gap:16px}
#exam .question{min-width:0;padding:clamp(18px,3vw,32px)}
.exam-rail{position:sticky;top:calc(var(--header-height) + 14px);max-height:calc(100dvh - var(--header-height) - 24px);display:flex;flex-direction:column;gap:7px;overflow:visible;padding:0}
.wrap:has(#exam:not(.hide)){padding-top:14px}
.answer-panel{flex:none;padding:13px}
#exam .controls{position:sticky;top:0;margin:0 0 10px;display:grid;grid-template-columns:1fr 1.22fr;gap:8px}
#exam .controls button{min-height:44px;padding:8px;font-size:14px}
#exam .choices{grid-template-columns:minmax(0,1fr);margin:0;gap:6px}
#exam .choice{padding:7px 10px;min-height:44px;font-size:17px}
#exam .choice .letter{width:28px;height:28px}
#exam .choice:has(img){flex-wrap:nowrap}
#exam .choice span:has(img){flex:1;min-width:0}
#exam .choice-marker{max-width:72px;font-size:10px;text-align:right}
@media(max-width:670px){
  .wrap:has(#exam:not(.hide)){padding:14px 14px calc(82px + env(safe-area-inset-bottom))}
  #exam .layout{grid-template-columns:minmax(0,1fr);gap:12px}
  .exam-rail{position:static;max-height:none}
  #exam .controls{position:fixed;z-index:3;inset:auto 0 0;margin:0;background:#fbf8f1;padding:8px max(16px,5%) calc(8px + env(safe-area-inset-bottom));border-top:1px solid #dfdfd4}
}

.rail-actions{flex:none;padding:9px}
.rail-scroll{min-height:0;overflow:auto;display:flex;flex-direction:column;gap:9px;padding:3px}
#exam .rail-actions .controls{position:static;margin:0;column-gap:16px}
@media(max-width:670px){
  .rail-actions{padding:0;border:0}
  .rail-scroll{overflow:visible;padding:0}
  #exam .rail-actions .controls{position:fixed}
}

.photo-editor{margin:0 0 14px;padding:14px 16px;border:1px solid #dcded1;border-radius:12px;background:#fffdf7}
.photo-editor h2{font-size:25px;margin:0 0 8px}
.photo-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:8px 16px}
.photo-fields label{display:grid;grid-template-columns:1fr auto;gap:4px;font-size:14px;font-weight:700}
.photo-fields output{color:#456953;font-variant-numeric:tabular-nums}
.photo-fields input{grid-column:1/-1;width:100%;margin:0;accent-color:#244c3d}
.photo-editor-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.photo-editor-actions button{font-size:13px;padding:8px 12px}
#photo-status{font-size:13px;color:#456953}

.hero-photo-frame.extended-photo::before{content:"";position:absolute;inset:-18px;background:linear-gradient(#f4eee263,#f4eee263),url("/hero-study.jpg") center/cover no-repeat;filter:blur(14px)}
.hero-photo-frame.extended-photo img{
  -webkit-mask-image:var(--photo-mask-x),var(--photo-mask-y);
  -webkit-mask-composite:source-in;
  mask-image:var(--photo-mask-x),var(--photo-mask-y);
  mask-composite:intersect;
}

#exam .rail-actions .controls{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
#exam .rail-actions .controls button{width:100%;display:flex;align-items:center;justify-content:center;text-align:center}
.exam-progress{padding:15px 20px;margin-bottom:14px}
.exam-progress>div{display:flex;justify-content:space-between;align-items:center;gap:12px}
#timer{width:88px;flex:0 0 88px;margin-left:auto;white-space:nowrap;text-align:right;font-weight:700;font-variant-numeric:tabular-nums;color:#244c3d}
.progress-meta{margin-top:10px;color:#67786d;font-size:14px}
.stem{line-height:1.9}
.score-screen{max-width:780px;margin:40px auto;padding:34px;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:25px}
.score-screen.hide{display:none}
.score-screen h1{font-size:52px;margin:10px 0}
.score-badge{display:grid;place-items:center;border:9px solid #dbe9d8;border-radius:50%;width:150px;height:150px}
.score-badge strong{font-size:29px;align-self:end}.score-badge span{font-size:13px;align-self:start;color:#50695a}
.score-actions{width:100%;display:flex;gap:10px}

.exam-progress>div:first-child{display:flex;align-items:center;gap:14px}
#progress-title{white-space:nowrap;flex:none}
/* Keep all 25 question numbers in one row. */
#top-questions{display:grid;grid-template-columns:repeat(25,minmax(20px,27px));justify-content:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:thin}
#top-questions .top-question{display:grid;place-items:center;width:100%;height:27px;padding:0;border:1px solid transparent;border-radius:5px;background:#f6f8f5;color:#66766b;font:600 12px 'DM Sans',sans-serif}
#top-questions .top-question.answered{background:#d6e8d5;color:#235a3b}
#top-questions .top-question.correct{background:#d6e8d5;color:#235a3b}
#top-questions .top-question.incorrect{background:#f8e2de;color:#963c35}
#top-questions .top-question[aria-current=step]{border-color:#397454;box-shadow:inset 0 0 0 1px #397454}
#top-questions .top-question:focus-visible{outline:2px solid #244c3d;outline-offset:2px}
.exam-progress progress{display:block;width:min(100%,620px);accent-color:#397454;height:12px;border:0;border-radius:8px;overflow:hidden;background:#e6ebe4}
.exam-progress progress::-webkit-progress-bar{background:#e6ebe4;border-radius:8px}
.exam-progress progress::-webkit-progress-value{background:#397454;border-radius:8px}
.exam-progress progress::-moz-progress-bar{background:#397454;border-radius:8px}
@media(max-width:850px){
  .exam-progress>div:first-child{flex-wrap:wrap}
  #top-questions{order:3;flex-basis:100%;justify-content:start}
}

.exam-progress .progress-meta{display:flex;align-items:flex-end;gap:16px}
.progress-track{flex:1;min-width:0;display:grid;gap:7px}
.exam-progress .progress-track progress{width:100%;margin:0}
#finish-top{flex:none;white-space:nowrap;padding:0 0 0 2px;line-height:12px;min-height:24px;text-align:right}

.solution-steps {
  padding-inline-start: 1.5rem;
}
.solution-steps li + li {
  margin-top: 1rem;
}
#structured-lesson .lesson-operation {
  color: #244c3d;
  font-weight: 700;
}
#structured-lesson details {
  margin-block: 1rem;
}

.mistake-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
}
.mistake-actions { display: flex; align-items: center; gap: 10px; }
.mistake-controls button { min-height: 42px; padding: 9px 16px; font-size: 14px; line-height: 1.2; }
.mistake-back { background: transparent; border: 0; color: #244c3d; font-weight: 700; cursor: pointer; }
html[data-theme="dark"] .mistake-back { color: #d1e5d3; }
@media (max-width: 600px) {
  .mistake-controls { align-items: stretch; }
  .mistake-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
}
.mistake-controls.hide { display: none; }
#retry-status { flex-basis: 100%; margin: 0; }
#retry-status:empty, #tutor-status:empty { display: none; }
#tutor-panel {
  border-top: 1px solid #dfe6da;
  margin-top: 18px;
  padding-top: 14px;
}
#tutor-panel h3 { color: #244c3d; margin: 0 0 10px; font: 700 17px 'DM Sans', sans-serif; }
#tutor-chat { white-space: pre-wrap; overflow-wrap: anywhere; }
#tutor-form label { display: block; margin: 14px 0 6px; }
#tutor-message { width: 100%; font: inherit; padding: 8px; }

.header-actions nav { order: 1; }

.score-screen { column-gap: 18px; row-gap: 14px; }
.score-screen .score-meta { margin: 7px 0 0; color: #6d7d73; font-size: 13px; }
.score-badge {
  border: 0;
  padding: 9px;
  position: relative;
  isolation: isolate;
}
.score-badge::before, .score-badge::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}
.score-badge::before {
  inset: 0;
  background: conic-gradient(#397454 var(--score-percent, 0%), #dbe9d8 0);
}
.score-badge::after { inset: 9px; background: white; }

.submit-dialog {
  width: min(440px, calc(100% - 32px));
  max-width: none;
  border: 1px solid #dfe6da;
  border-radius: 18px;
  padding: 0;
  background: #fffefa;
  color: #202c2a;
  box-shadow: 0 20px 65px #142d2440;
}
.submit-dialog::backdrop { background: #172a22a6; }
.submit-dialog-content { padding: 28px; }
.submit-dialog h2 { margin: 10px 0; font-size: 36px; }
.submit-dialog p:not(.eyebrow) { color: #596b60; line-height: 1.55; margin: 0; }
.submit-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width: 420px) {
  .submit-dialog-content { padding: 22px; }
  .submit-dialog-actions { flex-direction: column-reverse; }
  .submit-dialog-actions button { width: 100%; }
}

.progress-page { max-width: 1100px; margin: 4px auto; }
.progress-heading h1 { font-size: clamp(40px, 5vw, 60px); margin: 7px 0; }
.progress-heading > p:last-child, .progress-card-head p, .progress-summary-card p:not(.eyebrow) {
  color: #718077; margin: 5px 0 0; font-size: 14px; line-height: 1.45;
}
.progress-overview { display: grid; grid-template-columns: minmax(0, 1fr) 255px; gap: 16px; margin-top: 22px; }
.progress-chart-card, .progress-summary-card, .progress-topics-card { padding: 23px; }
.progress-card-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.progress-page h2 { font: 600 18px 'DM Sans', sans-serif; margin: 0; }
.progress-card-head > strong { color: #66806d; white-space: nowrap; font-size: 13px; }
.score-chart{display:grid;flex:1;min-width:0;min-height:215px;overflow-x:auto;margin-top:12px}
.score-chart-plot{position:relative}
.score-chart svg{position:absolute;inset:0;display:block;width:100%;height:100%}
.chart-hit[role="button"]{cursor:pointer}
.chart-hit:focus-visible .chart-point,.chart-point.is-active{r:6.5;stroke-width:4}
.score-tooltip{
  position:absolute;z-index:1;transform:translateX(-50%);pointer-events:none;
  display:grid;gap:2px;padding:7px 11px;white-space:nowrap;
  border:1px solid #c7d9c9;border-radius:9px;background:#fff;color:#244c3d;
  box-shadow:0 3px 12px #244c3d1c;font-size:12px;line-height:1.2
}
.score-tooltip strong{font-size:16px;font-variant-numeric:tabular-nums}
.score-tooltip small{font-size:11px;color:#536b5c}
html[data-theme="dark"] .score-tooltip{background:#26382d;border-color:#607e66;color:#e2f0e2;box-shadow:0 3px 12px #0004}
html[data-theme="dark"] .score-tooltip small{color:#b8cfbe}
.chart-gridline { stroke: #e7ede5; stroke-width: 1; }
.chart-label { fill: #8a9a8f; font: 12px 'DM Sans', sans-serif; }
.chart-line { fill: none; stroke: #397454; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: #fff; stroke: #397454; stroke-width: 3; }
.progress-summary-card > strong { display: block; margin-top: 7px; color: #244c3d; font: 42px/1 'Instrument Serif', Georgia, serif; }
.progress-divider { height: 1px; background: #e7ebe3; margin: 20px 0; }
.progress-summary-card button { margin-top: 16px; padding: 9px 12px; font-size: 13px; }
.progress-topics-card { margin-top: 16px; }
.progress-note { color: #7c8b81; font-size: 12px; line-height: 1.5; }
.progress-empty { padding: 15px 0; color: #7c8b81; font-size: 14px; }
.topic-item { border-top: 1px solid #edf0ea; padding: 14px 0; }
.topic-summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; color: #244c3d; list-style: none; }
.topic-summary::-webkit-details-marker { display: none; }
.topic-summary span { color: #8c6241; white-space: nowrap; font-size: 13px; }
.topic-bar { height: 6px; border-radius: 8px; overflow: hidden; background: #edf0eb; margin-top: 9px; }
.topic-bar-fill { display: block; height: 100%; background: #c58b69; border-radius: inherit; }
.topic-questions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.topic-question { border: 0; background: #eef4ed; border-radius: 7px; color: #285a43; padding: 8px 10px; font-weight: 600; font-size: 13px; }
@media(max-width: 700px) {
  .progress-overview { grid-template-columns: 1fr; }
  .progress-summary-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .progress-divider { display: none; }
  .progress-summary-card button { grid-column: 1 / -1; justify-self: start; }
}

#timer.timer-expired { color: #a04c3d; }
.exam-progress .time-expired {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  color: #94533d;
  font-size: 12px;
}
.exam-progress .time-expired.hide { display: none; }
.time-expired button {
  border: 0;
  padding: 0;
  color: #244c3d;
  background: transparent;
  text-decoration: underline;
  font-weight: 700;
}

.profile-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.profile-actions { display:flex; gap:8px; padding-top:4px; }
.profile-actions button { padding:9px 12px; font-size:13px; white-space:nowrap; }
.profile-actions button.hide { display:none; }
#mistakes { scroll-margin-top:80px; }
#mistake-list:empty { display:none; }
@media(max-width:540px) {
  .profile-heading { flex-direction:column; gap:6px; }
  .profile-actions { padding:0; }
}

.chart-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}
.chart-legend{display:flex;flex-wrap:wrap;gap:14px;color:#6d7f71;font-size:12px}
.chart-legend span{display:flex;align-items:center;gap:6px}
.chart-legend i{display:inline-block;flex:none}
.legend-score{width:17px;height:3px;border-radius:2px;background:#397454}
.legend-time{width:10px;height:12px;border-radius:2px;background:#c3d9c0}
#chart-mode{border:0;background:transparent;color:#2d6348;font-size:12px;font-weight:700;text-decoration:underline;padding:5px;white-space:nowrap}
.chart-time-bar{fill:#d1e2cc}

.profile-tabs { display:flex; gap:22px; border-bottom:1px solid #e4eae1; }
.profile-tabs button { border:0; border-bottom:2px solid transparent; margin-bottom:-1px; padding:2px 0 11px; background:transparent; color:#7b8a80; font:600 15px 'DM Sans',sans-serif; }
.profile-tabs button[aria-selected="true"] { color:#244c3d; border-bottom-color:#397454; }
.profile-tabs button:focus-visible { outline:2px solid #397454; outline-offset:3px; border-radius:2px; }
.profile-review [role="tabpanel"].hide { display:none; }

/* Keep instructional text and typeset math comfortable to read together. */
#structured-lesson,
#lesson,
#tutor-chat {
  font-family: "Literata", Georgia, serif;
  font-variant-numeric: slashed-zero;
}

#structured-lesson mjx-container,
#lesson mjx-container,
#tutor-chat mjx-container {
  font-size: 120% !important;
}

#structured-lesson h3,
#structured-lesson h4,
#lesson h3,
#lesson h4,
#structured-lesson summary {
  font-family: "DM Sans", sans-serif;
}

#exam .choice > span:not(.letter):not(.choice-marker) {
  font-family: "Literata", Georgia, serif;
}

.followup-question { margin-block: 14px; }
.followup-question fieldset { min-width: 0; padding: 14px; border: 1px solid #dfe5da; border-radius: 10px; }
.followup-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; padding-block: 4px; }
.followup-choice > span { min-width: 0; font-family: "Literata", Georgia, serif; }
.followup-question .primary { margin-top: 8px; }
#study-advice-result { white-space: pre-wrap; font-family: "Literata", Georgia, serif; }
#study-advice-result:empty { display: none; }
#study-advice-result p { margin: 1em 0; }
#study-advice-result .study-report-heading { font: 700 1em/1.4 "DM Sans", sans-serif; margin: 1.5em 0 .5em; }
#study-advice-result .study-report-notice { font-family: "DM Sans", sans-serif; font-size: .9em; color: var(--profile-muted,#607267); }
#study-advice-result.is-thinking { font-family: "DM Sans", sans-serif; color: #5a7662; margin-top: 14px; }
#study-advice-result.is-thinking::after { content: ''; display: inline-block; width: 1.2em; animation: tutor-thinking 1.5s linear infinite; }
html[data-theme="dark"] #study-advice-result.is-thinking, html[data-theme="dark"] #study-advice-result .study-report-notice { color: #b2d2b8; }
@media (prefers-reduced-motion: reduce) { #study-advice-result.is-thinking::after { content: '...'; animation: none; } }

.admin-table-wrap { overflow-x: auto; margin-top: 24px; }
.admin-users { width: 100%; border-collapse: collapse; text-align: left; }
.admin-users caption { text-align: left; font-weight: 700; padding-bottom: 12px; }
.admin-users th, .admin-users td { padding: 12px 14px; border-bottom: 1px solid #e2e8dd; vertical-align: top; }
.admin-users th { color: #657568; font-size: 13px; white-space: nowrap; }
.admin-users td { font-size: 14px; }
.admin-detail { display: block; margin-top: 5px; color: #6e7c72; white-space: nowrap; }
.admin-users button { white-space: nowrap; }
#reset-dialog, #delete-user-dialog { width: min(92vw, 430px); border: 1px solid #dfe6da; border-radius: 16px; padding: 24px; }
#reset-dialog::backdrop, #delete-user-dialog::backdrop { background: #17271e88; }
#reset-form label { display: grid; gap: 8px; margin-top: 18px; }
#reset-form input { padding: 10px; font: inherit; }
.admin-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
#reset-error, #delete-user-error { color: #a23d36; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#admin .admin-delete-button { background: #f8ece9; color: #8f3833; }
#delete-user-dialog .admin-delete-confirm { background: #9b3b35; color: #fff; }
#delete-user-dialog .admin-delete-confirm:hover { background: #82302b; }

/* Let tall expressions expand the question instead of scrolling vertically. */
.stem { overflow: visible; overflow-wrap: anywhere; }
.stem mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: 0.25em; }

/* Account forms use a consistent single-column layout at all widths. */
.panel.account-panel { max-width: 470px; }
.panel #account-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 14px; }
#account-form .account-field { min-width: 0; }
#account-form label { width: 100%; }
#account-form input { min-width: 0; width: 100%; }
#account-form .field-status { display: none; }
#account-form.signup-form .field-status { display: block; min-height: 18px; margin: 4px 0 0; color: #65786a; font-size: 12px; line-height: 18px; }
#account-form #account-submit { width: 100%; }

.admin-users select { display: block; margin-top: 8px; max-width: 140px; padding: 7px; font: inherit; border: 1px solid #c7d5c8; border-radius: 7px; background: white; }

#tutor-send { display: block; margin: 14px 0 0 auto; }

 .progress-summary-card .profile-membership {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e7ebe3;
}
.progress-summary-card .profile-membership .profile-quota {
  display: block;
  margin-top: 7px;
  color: #244c3d;
  font: 42px/1 'Instrument Serif', Georgia, serif;
}
.progress-summary-card .profile-membership #profile-quota-label { margin: 6px 0 0; }
@media (max-width: 720px) {
  .progress-summary-card .profile-membership { grid-column: 1 / -1; }
}

.theme-toggle { order: 3; display: grid; place-items: center; width: 36px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #244c3d; font-size: 25px; line-height: 1; }
.theme-toggle:hover { background: #e9ede3; }
.theme-toggle:focus-visible { outline: 2px solid #397454; outline-offset: 2px; }

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #121b17; color: #edf3eb; }
html[data-theme="dark"] .topbar { background: #19241e; border-color: #35463a; }
html[data-theme="dark"] .topbar .brand { color: #edf3eb; }
html[data-theme="dark"] .topbar .brand span { color: #e69873; }
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .nav-outline,
html[data-theme="dark"] .text-button { color: #cbe5d0; }
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .nav-outline:hover { background: #34493a; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .photo-editor,
html[data-theme="dark"] .submit-dialog,
html[data-theme="dark"] #reset-dialog,
html[data-theme="dark"] #delete-user-dialog { background: #202e26; color: #edf3eb; border-color: #3a4b3f; box-shadow: none; }
html[data-theme="dark"] #admin .admin-delete-button { background: #583631; color: #ffe3dc; }
html[data-theme="dark"] #delete-user-error { color: #ffb4aa; }
html[data-theme="dark"] .small,
html[data-theme="dark"] .progress-note,
html[data-theme="dark"] .progress-empty,
html[data-theme="dark"] .progress-heading > p:last-child,
html[data-theme="dark"] .progress-card-head p,
html[data-theme="dark"] .progress-summary-card p:not(.eyebrow),
html[data-theme="dark"] .score-screen .score-meta,
html[data-theme="dark"] .admin-detail { color: #b6c7b9; }
html[data-theme="dark"] .eyebrow { color: #a9cba7; }
html[data-theme="dark"] .primary { background: #507d5b; color: #fff; }
html[data-theme="dark"] .primary:hover { background: #63906d; }
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .topic-question { background: #34483a; color: #e5f3e6; }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select { background: #17231b; color: #edf3eb; border-color: #62796a; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #aebfb1; }
html[data-theme="dark"] .paper-button,
html[data-theme="dark"] .home-benefits,
html[data-theme="dark"] .home-benefits section+section,
html[data-theme="dark"] .qhead,
html[data-theme="dark"] .progress-divider,
html[data-theme="dark"] .profile-tabs,
html[data-theme="dark"] .profile-membership,
html[data-theme="dark"] .topic-item,
html[data-theme="dark"] .mistake-row,
html[data-theme="dark"] .admin-users th,
html[data-theme="dark"] .admin-users td,
html[data-theme="dark"] .followup-question fieldset { border-color: #405246; }
html[data-theme="dark"] .home-benefits h2,
html[data-theme="dark"] .home-benefits p { color: #dbe9dc; }
html[data-theme="dark"] #exam .choice,
html[data-theme="dark"] #exam .choice:disabled { background: #26382d; color: #edf3eb; border-color: #4b6250; opacity: 1; }
html[data-theme="dark"] #exam .choice .letter { background: #3b5140; color: #e2efe2; }
html[data-theme="dark"] #exam .choice.selected { background: #385a42; border-color: #90c99c; }
html[data-theme="dark"] #exam .choice.correct-choice { background: #28523a; border-color: #7bc98c; }
html[data-theme="dark"] #exam .choice.incorrect-choice { background: #60322f; border-color: #ef9690; }
html[data-theme="dark"] #top-questions .top-question { background: #314138; color: #d8e5d9; }
html[data-theme="dark"] #top-questions .top-question.answered { background: #4c7655; color: #fff; }
html[data-theme="dark"] #top-questions .top-question.correct { background: #4c7655; color: #fff; }
html[data-theme="dark"] #top-questions .top-question.incorrect { background: #703f3a; color: #ffe1dc; }
html[data-theme="dark"] #top-questions .top-question[aria-current="step"] { border-color: #a6dcb0; box-shadow: inset 0 0 0 1px #a6dcb0; }
html[data-theme="dark"] #timer,
html[data-theme="dark"] .topic-summary,
html[data-theme="dark"] .profile-tabs button[aria-selected="true"],
html[data-theme="dark"] .progress-summary-card > strong,
html[data-theme="dark"] .progress-summary-card .profile-membership .profile-quota { color: #d4efda; }
html[data-theme="dark"] #explanation { background: #26382d; border-color: #405b47; }
html[data-theme="dark"] #explanation summary,
html[data-theme="dark"] #structured-lesson .lesson-operation,
html[data-theme="dark"] #tutor-panel h3 { color: #bce4c3; }
html[data-theme="dark"] .score-badge::after { background: #202e26; }
html[data-theme="dark"] .chart-gridline { stroke: #405246; }
html[data-theme="dark"] .chart-label { fill: #b4c5b7; }
html[data-theme="dark"] .chart-line { stroke: #91c99a; }
html[data-theme="dark"] .chart-point { fill: #202e26; stroke: #91c99a; }
html[data-theme="dark"] .figure { background: #fff; border-radius: 5px; }
html[data-theme="dark"] #chart-mode,
html[data-theme="dark"] .progress-card-head > strong,
html[data-theme="dark"] .chart-legend { color: #c3d9c7; }
html[data-theme="dark"] .hero .nav-outline { color: #173e2f; border-color: #597566; }
html[data-theme="dark"] .hero .nav-outline:hover { background: #e9ede3; }

.theme-toggle svg { width: 24px; height: 24px; }
.theme-toggle .theme-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
html[data-theme="dark"] .theme-toggle:hover { background: #34493a; color: #e4f3e6; }
html[data-theme="dark"] .submit-dialog p:not(.eyebrow),
html[data-theme="dark"] #account-form.signup-form .field-status,
html[data-theme="dark"] .admin-users th,
html[data-theme="dark"] .profile-tabs button,
html[data-theme="dark"] .topic-summary span,
html[data-theme="dark"] .score-badge span { color: #c1d2c4; }
html[data-theme="dark"] .profile-tabs button[aria-selected="true"] { color: #e2f3e5; }
html[data-theme="dark"] #timer.timer-expired,
html[data-theme="dark"] .time-expired,
html[data-theme="dark"] #reset-error { color: #ffb7a8; }
html[data-theme="dark"] .time-expired button { color: #cbe5d0; }
html[data-theme="dark"] .exam-progress progress,
html[data-theme="dark"] .exam-progress progress::-webkit-progress-bar { background: #35483b; }
html[data-theme="dark"] .paper-button:hover { background: #3b5743; color: #fff; }

/* Align the summary heading and use the same spacing around both dividers. */
.progress-summary-card > .eyebrow,
.progress-summary-card .profile-membership .eyebrow { margin: 0; line-height: 1.2; }
.progress-summary-card .progress-divider { height: 1px; margin: 20px 0; }
.progress-summary-card .profile-membership { margin-top: 20px; padding-top: 20px; }
html[data-theme="dark"] .progress-summary-card .progress-divider { background: #405246; }
@media (max-width: 700px) {
  .progress-summary-card { display: block; }
  .progress-summary-card .progress-divider { display: block; }
}

#tutor-chat { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
#tutor-chat:empty { display: none; }
.tutor-message { min-width: 0; line-height: 1.65; }
.tutor-message-name { display: block; margin-bottom: 5px; font: 700 12px/1.3 'DM Sans', sans-serif; color: #65816e; }
.tutor-message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tutor-message-user { align-self: flex-end; width: fit-content; max-width: 85%; padding: 12px 16px; border: 1px solid #d8e8da; border-radius: 18px 18px 5px 18px; background: #eaf3e9; color: #1d3829; }
.tutor-message-assistant { align-self: flex-start; max-width: 100%; padding: 2px 0; }
html[data-theme="dark"] .tutor-message-user { background: #365244; border-color: #52765c; color: #f1f8f0; }
html[data-theme="dark"] .tutor-message-name { color: #b2d2b8; }
@media (max-width: 600px) { .tutor-message-user { max-width: 94%; } }

#tutor-status.is-thinking { color: #5a7662; font-size: 14px; }
#tutor-status.is-thinking::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: tutor-thinking 1.5s linear infinite; }
@keyframes tutor-thinking {
  0%, 24% { content: ''; }
  25%, 49% { content: '.'; }
  50%, 74% { content: '..'; }
  75%, 100% { content: '...'; }
}
html[data-theme="dark"] #tutor-status.is-thinking { color: #b2d2b8; }
@media (prefers-reduced-motion: reduce) { #tutor-status.is-thinking::after { content: "..."; animation: none; } }

#tutor-status:not(:empty) { margin: 14px 0; }

/* Reserve the same vertical scrollbar space on short and long pages. */
html { overflow-y: scroll; scrollbar-gutter: stable; }

/* Give the administrator view room on desktop and readable account cards on tablets. */
.wrap:has(#admin:not(.hide)) { max-width: 1328px; }
#admin.panel { max-width: 1240px; }
#admin .admin-table-wrap { overflow: visible; }
#admin .admin-users { table-layout: fixed; }
#admin .admin-users th,
#admin .admin-users td { overflow-wrap: anywhere; }
#admin .admin-detail { white-space: normal; }
#admin .admin-users button { white-space: normal; }
@media (max-width: 1100px) {
  #admin .admin-users, #admin .admin-users tbody, #admin .admin-users caption { display: block; width: 100%; }
  #admin .admin-users thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  #admin .admin-users tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 18px; margin-bottom: 12px; border: 1px solid #dfe6da; border-radius: 12px; }
  #admin .admin-users td { display: block; min-width: 0; padding: 0; border: 0; }
  #admin .admin-users td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #657568; font-size: 12px; font-weight: 700; }
  #admin .admin-users td:last-child { grid-column: 1 / -1; }
  html[data-theme="dark"] #admin .admin-users tr { border-color: #405246; }
  html[data-theme="dark"] #admin .admin-users td::before { color: #c1d2c4; }
}
@media (max-width: 420px) {
  #admin .admin-users tr { grid-template-columns: 1fr; }
}

/* Compact administrator controls while keeping account information readable. */
#admin .admin-users th, #admin .admin-users td { padding: 10px 8px; }
#admin .admin-users th:nth-child(1) { width: 10%; }
#admin .admin-users th:nth-child(2) { width: 18%; }
#admin .admin-users th:nth-child(3) { width: 12%; }
#admin .admin-users th:nth-child(4), #admin .admin-users th:nth-child(5) { width: 5%; }
#admin .admin-users th:nth-child(6) { width: 8%; }
#admin .admin-users th:nth-child(7) { width: 12%; }
#admin .admin-users th:nth-child(8) { width: 16%; }
#admin .admin-users th:nth-child(9) { width: 14%; }
#admin .admin-users select { margin: 0 0 4px; padding: 6px 8px; width: 100%; max-width: 180px; }
#admin .admin-users button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 10px; font-size: 13px; line-height: 1.25; white-space: nowrap; }
#admin .admin-users .admin-icon-button { width: 36px; height: 36px; padding: 0; border-radius: 8px; }
.admin-icon-button svg { width: 18px; height: 18px; }
@media (max-width: 1100px) {
  #admin .admin-users td { padding: 0; }
}

/* A brief confirmation after the understood status has been saved. */
#mark-understood { position: relative; }
.understood-celebration {
  position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 4px);
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; color: #fff; background: #39765a;
  box-shadow: 0 7px 18px #244c3d40; pointer-events: none;
  animation: understood-pop 900ms ease-out forwards;
}
.understood-celebration svg { width: 27px; height: 27px; }
@keyframes understood-pop {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.5); }
  25% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  55% { opacity: 1; transform: translate(-50%, -5px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(.9); }
}
@media (prefers-reduced-motion: reduce) {
  .understood-celebration { animation: none; transform: translateX(-50%); }
}

.understood-transition {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: rgba(20, 35, 27, .18);
}
.understood-transition-card {
  display: flex; align-items: center; gap: 12px; padding: 16px 22px;
  border: 1px solid #d4e3d4; border-radius: 14px; background: #fff;
  color: #244c3d; font: 700 15px 'DM Sans', sans-serif;
  box-shadow: 0 12px 35px rgba(20, 35, 27, .16);
}
.understood-spinner {
  width: 21px; height: 21px; border: 2.5px solid #d4e6d5;
  border-top-color: #39765a; border-radius: 50%; animation: understood-spin .7s linear infinite;
}
@keyframes understood-spin { to { transform: rotate(360deg); } }
html[data-theme="dark"] .understood-transition { background: rgba(0, 0, 0, .35); }
html[data-theme="dark"] .understood-transition-card { background: #20332a; border-color: #516a58; color: #e0eee0; }
@media (prefers-reduced-motion: reduce) { .understood-spinner { animation: none; } }

.progress-chart-card{display:flex;flex-direction:column}
.score-chart-stage{position:relative;display:flex;flex:1;min-width:0}
#score-chart-content{width:100%;display:flex;flex-direction:column;min-width:0}
.score-chart-empty{display:grid;place-items:center;flex:1;min-height:215px;padding:14px 0;text-align:center}
#score-chart-content.hide,.score-chart-empty.hide,.route-pending #home{display:none}
.score-chart-empty p:last-child{margin-bottom:0}
.math-profile-body[inert]{filter:blur(2px);opacity:.86;user-select:none}
.progress-chart-lock{position:absolute;inset:0;display:grid;place-items:center;padding:14px;text-align:center;background:rgba(255,255,255,.07)}
.chart-unlock-prompt{max-width:340px;padding:14px 20px;border:1px solid #dce6d9;border-radius:12px;background:rgba(255,255,255,.88);box-shadow:0 6px 22px rgba(24,49,35,.08)}
.chart-unlock-prompt p{margin:7px 0;line-height:1.45}
.chart-unlock-count{font-size:.85rem;font-weight:700}
html[data-theme="dark"] .progress-chart-lock{background:rgba(30,45,37,.11)}
html[data-theme="dark"] .chart-unlock-prompt{background:rgba(30,45,37,.92);border-color:#405246}
#progress-chart:empty{display:none}

.progress-chart-lock.hide,#paper-progress-tip.hide,#study-advice-note.hide{display:none}
#paper-progress-tip{margin:10px 0 0}
.math-profile{margin-top:16px}
.math-profile h2{margin:0}
.math-profile-body{display:grid;grid-template-columns:minmax(0,280px) minmax(0,1fr);align-items:start;gap:18px}
#math-radar svg{width:100%;display:block}
.math-radar-grid{fill:none;stroke:#9aac9d;stroke-opacity:.65}
.math-radar-area{fill:#71a67a;fill-opacity:.28;stroke:#588969;stroke-width:2}
.math-radar-point{stroke:#588969;stroke-width:2}
.math-radar-point{fill:#71a67a}
.math-radar-unavailable{font-size:8px}
.math-domains{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.math-domain-card{min-width:0;padding:9px 12px;border:1px solid #dce6d9;border-radius:10px}
.math-domains small{display:block;margin-top:3px}
.math-profile-stage{position:relative;margin-top:12px;overflow:hidden}
.math-profile-stage:has([inert]){min-height:220px}
.math-profile-stage .progress-chart-lock{border-radius:12px}
#math-profile-note:empty{display:none}
.math-profile-incomplete{margin:10px 0 0;padding:10px 12px;border:1px solid #dce6d9;border-radius:9px;background:#f5f9f2;color:#405e49;font-size:13px;line-height:1.45}
.math-profile-incomplete[hidden]{display:none}
html[data-theme="dark"] .math-profile-incomplete{background:#293d30;border-color:#506b55;color:#d5e7d7}
.math-sample-label{display:block;margin-top:6px;opacity:.8}
html[data-theme="dark"] .math-domain-card{border-color:#405246}
@media(max-width:580px){.math-profile-body{grid-template-columns:1fr}#math-radar{max-width:250px;margin-inline:auto;width:100%}}
.math-radar-label{fill:currentColor;font:600 10px 'DM Sans',sans-serif}
.site-nav{margin-right:auto;margin-left:28px}
.papers-menu summary{border:0;padding:8px 12px}
.papers-dropdown{position:absolute;top:calc(100% + 8px);left:0;min-width:145px;padding:6px;background:#fff;border:1px solid #dce4d8;border-radius:10px;box-shadow:0 8px 25px #203a2520;z-index:5}
.papers-dropdown a{display:block;padding:10px 12px;color:#244c3d;text-decoration:none;border-radius:6px;font-weight:700}
.papers-dropdown a:hover{background:#edf2e9}
#home{
  --home-section-space:clamp(24px,4vw,44px);
  --home-divider:#e2e6dd;
}
html[data-theme="dark"] #home{--home-divider:#405246}
#home > :is(.home-section,.home-faq,.home-footer){
  padding-block:var(--home-section-space);
  border-top:1px solid var(--home-divider);
}
#home > .home-footer{padding-block-end:0}
.home-section{scroll-margin-top:var(--header-height)}
.home-section h2{font-size:clamp(36px,4vw,52px)}
.price-card p{line-height:1.55;color:#596b60}
.pricing-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:950px;align-items:stretch}
.price-card .price{font:clamp(31px,4vh,39px) 'Instrument Serif',serif;color:#244c3d;margin:12px 0 6px}
.price-card .price small{font:14px 'DM Sans',sans-serif}
#past-papers{max-width:1050px;margin:0 auto}
.papers-intro h1{margin:8px 0 24px}
.latest-paper{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;min-height:220px;padding:clamp(24px,4vw,42px);border-radius:20px;background:#254939;color:#f5faf2}
.latest-paper-content{position:relative;z-index:1}
.latest-paper .eyebrow{color:#c1dbbd;margin:0 0 8px}
.latest-paper h2{font-size:clamp(36px,5vw,52px);line-height:1;margin:0}
#latest-paper-format{color:#d9e8db;margin:10px 0 20px}
#latest-paper-start{background:#f0f6eb;color:#234936}
#latest-paper-start:hover{background:#d9ebd5}
#latest-paper-start:focus-visible{outline:2px solid #d9ebd5;outline-offset:3px}
.latest-paper-art{position:absolute;right:clamp(12px,5vw,64px);top:50%;transform:translateY(-50%);height:76%;aspect-ratio:1.8;display:grid;place-items:center;border:1px solid #c8e0c354;border-radius:15px;color:#d6ead141;pointer-events:none}
.latest-paper-art::before,.latest-paper-art::after{content:'';position:absolute;inset:12px;border:1px solid #c8e0c32b;border-radius:10px;transform:rotate(-7deg)}
.latest-paper-art::after{transform:rotate(7deg)}
.latest-paper-art span{font:clamp(68px,12vw,150px)/1 'Instrument Serif',Georgia,serif}
#past-papers #archive{margin-top:32px}
#past-papers .archive-heading h2{margin:0}
#past-papers .archive-heading .small{margin:0}
.paper-year-group{margin-top:20px}
.paper-year-group h3{margin:0 0 10px;font-size:24px;line-height:1.2;font-weight:700;color:#244c3d}
.paper-year-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:10px}
.paper-button{min-height:66px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;background:#fcfaf4;border:1px solid #d9dfd2;color:#244c3d;border-radius:11px;text-align:left}
.paper-button:hover{border-color:#42775a;background:#e9f1e4}
.paper-button:focus-visible{outline:2px solid #679172;outline-offset:2px}
.paper-card-year{font:600 18px/1.2 'DM Sans',sans-serif}
.paper-card-score{position:relative;flex:none;width:58px;height:31px;overflow:hidden;color:#315c44;font:700 11px/1 'DM Sans',sans-serif;font-variant-numeric:tabular-nums}
.paper-card-score[hidden]{display:none}
.paper-card-score::before{content:'';position:absolute;inset:0 0 auto;width:58px;height:58px;border-radius:50%;background:conic-gradient(from 270deg,#397454 calc(var(--paper-score) * 180deg),#dce9da 0 180deg,transparent 0);mask:radial-gradient(circle,transparent 0 19px,#000 19.5px);-webkit-mask:radial-gradient(circle,transparent 0 19px,#000 19.5px)}
.paper-gauge-label{position:absolute;bottom:0;left:0;width:100%;text-align:center;white-space:nowrap}
.latest-paper-score{margin:-10px 0 16px;color:#d9e8db;font-size:14px;font-weight:600}
html[data-theme="dark"] .paper-card-score{color:#dfecdc}
html[data-theme="dark"] .paper-card-score::before{background:conic-gradient(from 270deg,#91c99a calc(var(--paper-score) * 180deg),#415c49 0 180deg,transparent 0)}
html[data-theme="dark"] .latest-paper{background:#253e32;border:1px solid #4f6b57}
html[data-theme="dark"] .paper-year-group h3{color:#b6c7b9}
@media(max-width:560px){.latest-paper-art{right:-12%;opacity:.48}.paper-year-grid{grid-template-columns:repeat(auto-fill,minmax(112px,1fr))}}

html[data-theme="dark"] .papers-dropdown{background:#20332a;border-color:#405246}
html[data-theme="dark"] .papers-dropdown a,html[data-theme="dark"] .price-card .price{color:#dbe9dc}
html[data-theme="dark"] .papers-dropdown a:hover{background:#344b3b}
html[data-theme="dark"] .price-card p{color:#c2d1c5}
@media(max-width:700px){.site-nav{margin-left:0}.pricing-grid{grid-template-columns:1fr}}

.section-heading{max-width:760px;margin-bottom:clamp(16px,3vh,28px)}
.section-heading .eyebrow{margin:0}
.section-heading h2{margin:8px 0;line-height:1}
.section-heading>p:last-child{margin:0;color:#66776b;line-height:1.5}
.learning-journey{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:clamp(14px,2vw,22px)}
.learning-journey article{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,43%);align-items:center;gap:clamp(10px,1.5vw,20px);min-height:clamp(188px,18.5vw,238px);padding:clamp(14px,1.7vw,22px);border:1px solid #dfe6da;background:#fbfcf8;border-radius:14px}
.learning-journey h3{margin:0 0 5px;font-size:clamp(17px,2vw,20px)}
.learning-journey p{max-inline-size:32ch;margin:0;text-wrap:pretty;color:#596b60;line-height:1.45;font-size:clamp(14px,1.4vw,16px)}
.step-number{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#e5eee2;color:#366448;font-size:13px;font-weight:700}
.price-card{display:flex;flex-direction:column;padding:clamp(18px,2.5vh,26px)}
.plan-name{font-size:12px;font-weight:700;letter-spacing:.12em;color:#648163!important;margin:0}
.price-card .plan-intro{margin:5px 0 0;color:#66776b;font-size:14px}
.plan-features{list-style:none;display:grid;gap:clamp(6px,1vh,10px);padding:15px 0;margin:0;color:#30473a;font-size:clamp(13px,1.4vw,15px)}
.plan-features li{position:relative;padding-left:23px;line-height:1.35}
.plan-features li::before{content:'✓';position:absolute;left:0;color:#438255;font-weight:700}
.price-card .primary{margin-top:auto;align-self:flex-start}
.price-card-featured{border-color:#9ebaa0;background:#f5f9f2}
.price-card .subscription-note{margin:auto 0 0;font-size:12px;line-height:1.4}
html[data-theme="dark"] .learning-journey article{background:#20332a;border-color:#405246}
html[data-theme="dark"] .learning-journey p,html[data-theme="dark"] .section-heading>p:last-child,html[data-theme="dark"] .plan-features{color:#c2d1c5}
html[data-theme="dark"] .step-number{background:#344d3b;color:#d5ead5}
html[data-theme="dark"] .price-card-featured{background:#24382b;border-color:#56735c}
.learning-illustration{
  grid-column:2;grid-row:1;display:block;width:100%;
  height:clamp(148px,18vw,212px);object-fit:contain;
  transform:translateX(clamp(-16px,-1.15vw,-7px));
}
.learning-journey article > div{grid-column:1;grid-row:1;min-width:0}
@media(max-width:700px){
  .learning-journey{grid-template-columns:1fr}
  .learning-journey article{grid-template-columns:minmax(0,1fr) minmax(0,38%);min-height:158px}
  .learning-illustration{height:clamp(118px,25vw,184px)}
}
@media(max-width:400px){
  .learning-journey article{min-height:140px}
  .learning-illustration{height:112px}
}

/* Compact account navigation and a clear, accessible papers menu. */
.topbar .site-nav{margin:0}
.topbar .site-nav.hide{display:none}
.topbar .papers-menu summary{display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;border:0;color:#244c3d;font-size:14px;font-weight:700}
.papers-chevron{display:block;width:7px;height:7px;border-right:1.7px solid currentColor;border-bottom:1.7px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .15s}
.papers-menu[open] .papers-chevron{transform:rotate(225deg) translate(-1px,-1px)}
.papers-dropdown{left:auto;right:0;min-width:160px}
.papers-dropdown a{display:flex;justify-content:space-between;gap:24px;align-items:center}
html[data-theme="dark"] .topbar .papers-menu summary{color:#dbe9dc}
@media(max-width:700px){.topbar .papers-menu summary{padding:0 8px;gap:6px;font-size:13px}.papers-dropdown{right:0}}
.topbar .papers-dropdown{min-width:140px;padding:5px}
.topbar .papers-dropdown a{min-height:40px;padding:8px 10px;font-size:13px;font-weight:600;line-height:1.3}
@media(max-width:700px){.topbar .papers-dropdown a{font-size:12px}}
.account-menu{position:relative}
.topbar .account-menu summary{display:flex;align-items:center;gap:8px;justify-content:center;height:40px}
.account-dropdown{position:absolute;right:0;top:calc(100% + 8px);min-width:155px;padding:5px;border:1px solid #dce4d8;border-radius:10px;background:#fff;box-shadow:0 8px 25px #203a2520;z-index:5}
.account-dropdown button{display:block;width:100%;border:0;border-radius:6px;padding:10px;text-align:left;background:transparent;color:#244c3d;font-size:13px;font-weight:600}
.account-dropdown button:hover,.account-dropdown button:focus-visible{background:#edf2e9}
.account-dropdown button+button{border-top:1px solid #e5ebe1;border-radius:0 0 6px 6px}
.account-menu[open] .papers-chevron{transform:rotate(225deg) translate(-1px,-1px)}
html[data-theme="dark"] .account-dropdown{background:#20332a;border-color:#405246}
html[data-theme="dark"] .account-dropdown button{color:#dbe9dc}
html[data-theme="dark"] .account-dropdown button:hover,html[data-theme="dark"] .account-dropdown button:focus-visible{background:#344b3b}
html[data-theme="dark"] .account-dropdown button+button{border-color:#405246}
/* Keep navigation menus readable across dark-mode interaction states. */
html[data-theme="dark"] .topbar .papers-menu summary:hover,
html[data-theme="dark"] .topbar .papers-menu summary:focus-visible,
html[data-theme="dark"] .topbar .papers-menu[open] summary{background:#34493a;color:#e4f3e6}
html[data-theme="dark"] .topbar .papers-dropdown a:focus-visible{background:#344b3b;color:#e4f3e6;outline:2px solid #91c99a;outline-offset:-2px}
/* Dark-mode navigation and profile interaction states. */
html[data-theme="dark"] .topbar .account-menu summary{color:#dbe9dc;border-color:#668574;background:transparent}
html[data-theme="dark"] .topbar .account-menu summary:hover,
html[data-theme="dark"] .topbar .account-menu summary:focus-visible,
html[data-theme="dark"] .topbar .account-menu[open] summary{background:#34493a;color:#e4f3e6}
html[data-theme="dark"] .topbar summary:focus-visible{outline:2px solid #91c99a;outline-offset:2px}
html[data-theme="dark"] .secondary:hover,
html[data-theme="dark"] .topic-question:hover{background:#425e49;color:#f1f8f0}
html[data-theme="dark"] .chart-unlock-prompt{color:#edf3eb}
html[data-theme="dark"] .profile-tabs button:focus-visible,
html[data-theme="dark"] .account-dropdown button:focus-visible{outline:2px solid #91c99a;outline-offset:2px}
.testimonials-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.testimonial-card{display:flex;flex-direction:column;min-height:240px;padding:24px}
.quote-mark{color:#86a98a;font:56px/0.8 'Instrument Serif',serif}
.testimonial-card blockquote{flex:1;margin:18px 0 22px;font:clamp(17px,1.5vw,20px)/1.5 'Literata',Georgia,serif;color:#243b30}
.testimonial-card>p{margin:0;padding-top:15px;border-top:1px solid #e2e9df;color:#708074;font-size:13px;font-weight:700}
html[data-theme="dark"] .testimonial-card blockquote{color:#e3eee2}
html[data-theme="dark"] .testimonial-card>p{border-color:#405246;color:#b6c7b9}
@media(max-width:700px){.testimonials-grid{grid-template-columns:1fr}.testimonial-card{min-height:0}}
.testimonial-card{min-height:0}
.testimonial-card blockquote{margin:0 0 22px}
.testimonials-controls{display:flex;justify-content:flex-end;gap:8px;margin:-40px 0 12px}
.testimonials-controls button{display:grid;place-items:center;width:38px;height:38px;border:1px solid #b8cabc;border-radius:50%;background:transparent;color:#244c3d;font-size:19px}
.testimonials-controls button:hover{background:#e8efe5}
.testimonials-grid{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 32px)/3);grid-template-columns:none;gap:16px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x mandatory;scrollbar-width:none;padding:2px 2px 8px}
.testimonials-grid::-webkit-scrollbar{display:none}
.testimonial-card{min-height:285px;scroll-snap-align:start}
html[data-theme="dark"] .testimonials-controls button{border-color:#668574;color:#dbe9dc}
html[data-theme="dark"] .testimonials-controls button:hover{background:#34493a}
@media(max-width:900px){.testimonials-grid{grid-auto-columns:calc((100% - 16px)/2)}}
@media(max-width:580px){.testimonials-controls{margin:0 0 12px}.testimonials-grid{grid-auto-columns:88%}.testimonial-card{min-height:240px}}
.testimonial-card{padding:clamp(24px,2.2vw,32px)}
.testimonial-card blockquote{font-size:clamp(18px,1.55vw,21px);line-height:1.65;margin-bottom:24px}
.testimonial-card>p{padding-top:17px;font-size:14px}
@media(max-width:580px){.testimonial-card{padding:23px}.testimonial-card blockquote{font-size:17px;line-height:1.6}}

.home-faq {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr);
  gap: clamp(18px, 4vw, 60px);
}
.home-faq h2 { margin: 0; font-size: clamp(32px, 4vw, 46px); }
.home-faq-list details { border-bottom: 1px solid #e2e6dd; }
.home-faq-list summary { padding: 14px 0; cursor: pointer; font-weight: 700; }
.home-faq-list p { margin: 0 0 16px; max-width: 54ch; color: #596b60; line-height: 1.55; }
.home-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: var(--home-section-space);
  padding: clamp(24px, 5vw, 52px);
  border-radius: 20px;
  background: #244c3d;
  color: #f5faf2;
}
.home-start h2 { margin: 0 0 8px; font-size: clamp(34px, 4vw, 50px); line-height: 1.08; }
.home-start p { margin: 0; max-width: 55ch; color: #d9e8db; line-height: 1.5; }
.home-start a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 9px;
  background: #f0f6eb;
  color: #244c3d;
  font-weight: 700;
  text-decoration: none;
}
.home-start a:hover { background: #d9ebd5; }
.home-start a:focus-visible { outline: 2px solid #d9ebd5; outline-offset: 4px; }
html[data-theme="dark"] .home-start { background: #253e32; border: 1px solid #4f6b57; }
.home-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}
.home-footer-brand strong { font-size: 20px; letter-spacing: -.04em; }
.home-footer-brand strong span { color: #a64e32; }
.home-footer-brand p { margin: 4px 0 0; color: #596b60; font-size: 14px; }
.home-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.home-footer nav a:not(.nav-outline) { color: inherit; font-size: 14px; text-underline-offset: 4px; }
.home-footer .nav-outline { padding: 9px 12px; font-size: 14px; }
html[data-theme="dark"] .home-faq-list details { border-color: var(--home-divider); }
html[data-theme="dark"] .home-faq-list p,
html[data-theme="dark"] .home-footer-brand p { color: #b6c7b9; }
html[data-theme="dark"] .home-footer-brand strong span { color: #e69873; }
@media (max-width: 680px) {
  .home-faq { grid-template-columns: 1fr; gap: 8px; }
}
.testimonials-dots{display:flex;justify-content:center;gap:8px;margin-top:14px}
.testimonials-dots button{width:9px;height:9px;padding:0;border:0;border-radius:50%;background:#c2d0c0;cursor:pointer}
.testimonials-dots button[aria-current="true"]{background:#397454}
.testimonials-dots button:focus-visible{outline:2px solid #397454;outline-offset:4px}
html[data-theme="dark"] .testimonials-dots button{background:#536b59}
html[data-theme="dark"] .testimonials-dots button[aria-current="true"]{background:#a0d2a7}

/* The demo uses the same results, review, and profile sections as practice. */
.demo-mode .wrap:has(#demo-toolbar:not(.hide)) { padding-top: 14px; }
.demo-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.demo-toolbar.hide { display: none; }
.demo-toolbar p { margin: 0; font-weight: 700; }
.demo-toolbar nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.demo-toolbar button { min-height: 36px; font-size: 13px; padding: 7px 10px; white-space: nowrap; }
.demo-toolbar [aria-current="page"] { outline: 1px solid currentColor; outline-offset: -1px; }
@media (max-width: 670px) {
  .demo-mode .wrap:has(#demo-toolbar:not(.hide)) { padding-inline: 14px; }
}
.demo-mode #redo-paper, .demo-mode .profile-actions,
.demo-mode [aria-labelledby="followup-title"] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .demo-mode #progress-chart .chart-time-bar { transform-box: fill-box; transform-origin: bottom; animation: demo-rise .7s ease-out both; }
  .demo-mode #progress-chart .chart-line, .demo-mode #progress-chart .chart-point { animation: demo-reveal .5s .45s ease-out both; }
  .demo-mode #math-radar .math-radar-area, .demo-mode #math-radar .math-radar-point { transform-origin: center; animation: demo-expand .75s ease-out both; }
}
@keyframes demo-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes demo-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes demo-expand { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }


.hero-demo{display:inline-flex;align-items:center;padding:13px 16px;font-size:16px;font-weight:700}
@media(max-width:1024px){.hero-demo{font-size:14px;padding:10px 12px}}
.profile-next{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;margin-bottom:16px}
.study-advice-quota{font-size:.65em;font-weight:500;color:var(--profile-muted,#607267)}
html[data-theme="dark"] .study-advice-quota{color:#c3d9c7}
.profile-next h2{margin:0 0 4px;font:700 17px/1.3 'DM Sans',sans-serif}
.profile-next.first-step{border-color:#d99c95;box-shadow:0 0 0 1px rgba(190,103,94,.12)}
html[data-theme="dark"] .profile-next.first-step{border-color:#b87872;box-shadow:0 0 0 1px rgba(211,143,134,.16)}
.profile-next.first-step .primary{animation:first-step-pulse 1.4s ease-in-out 3}
@keyframes first-step-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.1)}}
@media (prefers-reduced-motion:reduce){.profile-next.first-step .primary{animation:none}}
.profile-next p{margin:0;color:var(--profile-muted,#607267);font-size:14px}
html[data-theme="dark"] .profile-next{--profile-muted:#c3d9c7}
.profile-next .primary{flex-shrink:0}
#followup-title{scroll-margin-top:calc(var(--header-height) + 12px)}
@media(max-width:520px){
  .profile-next{align-items:flex-start;flex-direction:column;gap:10px}
}

.question-reference{display:flex;flex-direction:column;align-items:flex-end;gap:3px;flex-shrink:0}
#tutor-example-jump{font-size:13px}
#tutor-heading{scroll-margin-top:calc(var(--header-height) + 16px)}

.followup-question{scroll-margin-top:calc(var(--header-height) + 16px)}

#tutor-character-count{margin:5px 0 0;text-align:right}
.tutor-limit-note{margin:10px 0 0}
.tutor-limit-note a{color:inherit;font-weight:700}


.profile-layout{display:grid;grid-template-columns:170px minmax(0,1fr);gap:24px;align-items:start}
.progress-overview{grid-template-columns:minmax(0,1fr) minmax(190px,215px)}
#progress-latest-label{white-space:pre-line;line-height:1.5}
.math-profile-body{grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:24px;align-items:start}
.math-domains{gap:12px}
.math-domain-card{padding:14px;line-height:1.4;background:#fafcf9}
.math-domain-card strong{display:block}
.math-domain-card>small{color:#607267;margin-top:6px}
.math-domain-details{margin-top:9px;font-size:13px}
.math-domain-details summary{cursor:pointer;color:#397454;font-weight:600}
.math-domain-details small{padding-top:6px;line-height:1.45}
html[data-theme="dark"] .math-domain-card{background:#20332a}
html[data-theme="dark"] .math-domain-card>small,html[data-theme="dark"] .math-domain-details summary{color:#c3d9c7}
@media(max-width:700px){.progress-overview{grid-template-columns:1fr}.math-profile-body{grid-template-columns:1fr}#math-radar{max-width:280px;width:100%;margin-inline:auto}}
.profile-content{min-width:0}
.profile-nav{position:sticky;top:86px;display:flex;flex-direction:column;gap:4px}
.profile-nav::before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:#d5e1d4;border-radius:2px}
.profile-nav::after{content:"";position:absolute;left:-3px;top:var(--indicator-y,20px);width:8px;height:24px;transform:translateY(-50%);border-radius:5px;background:#397454;transition:top .2s ease}
.profile-nav button{margin-left:12px}
.profile-nav button.is-active{color:#244c3d;font-weight:700}
html[data-theme="dark"] .profile-nav::before{background:#496153}
html[data-theme="dark"] .profile-nav::after{background:#9bcda5}
html[data-theme="dark"] .profile-nav button.is-active{color:#e7f5e8}
.profile-nav button{border:0;background:transparent;color:var(--profile-muted,#607267);text-align:left;padding:10px 12px;border-radius:8px;font:600 14px/1.3 "DM Sans",sans-serif;cursor:pointer}
.profile-nav button:hover,.profile-nav button:focus-visible{background:#eaf0e8;color:#244c3d}
html[data-theme="dark"] .profile-nav button{color:#c3d9c7}
html[data-theme="dark"] .profile-nav button:hover,html[data-theme="dark"] .profile-nav button:focus-visible{background:#34493a;color:#edf3eb}
#profile-next,#profile-scores,#math-profile-title,#mistakes-tab,#followup-title,#study-advice-title{scroll-margin-top:90px}
@media(max-width:900px){.profile-layout{display:block}.profile-nav{position:static;flex-direction:row;flex-wrap:wrap;margin-bottom:20px;gap:4px}.profile-nav::before,.profile-nav::after{display:none}.profile-nav button{padding:8px 10px;margin-left:0}.profile-nav button.is-active{background:#eaf0e8}html[data-theme="dark"] .profile-nav button.is-active{background:#34493a}}
@media(prefers-reduced-motion:reduce){.profile-nav::after{transition:none}}
@media (min-width: 721px) and (max-width: 1366px) {
  .wrap:has(#progress:not(.hide)) { max-width: none; padding-inline: 50px; }
  .progress-page { max-width: none; }
  .progress-chart-card, .progress-summary-card, .progress-topics-card { padding: 16px; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .profile-layout { grid-template-columns: 150px minmax(0, 1fr); gap: 16px; }
}
