:root{color-scheme:light;--bg:#f6f3ec;--paper:#fffefa;--ink:#202a27;--muted:#626c66;--line:#d7dcd4;--accent:#235e52;--accent-dark:#18483f;--soft:#e7f0ea;--danger:#8b392d;--danger-soft:#fff3ef;font-family:system-ui,-apple-system,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;font-size:18px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:300px;background:var(--bg);color:var(--ink);line-height:1.65}
button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.47}button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #a65d23;outline-offset:3px}
.skip{position:absolute;top:-80px;left:12px;background:#fff;padding:8px;z-index:10}.skip:focus{top:6px}
.site-header,.site-footer{max-width:1120px;margin:auto;padding:20px 30px;display:flex;justify-content:space-between;align-items:center;gap:16px}.site-header{border-bottom:1px solid var(--line)}
.brand{font-size:1rem;font-weight:750;letter-spacing:.015em;display:flex;align-items:center;gap:12px}.brand-symbol{background:var(--accent);color:white;width:37px;height:37px;display:grid;place-items:center;border-radius:13px;font-size:21px}.muted{color:var(--muted);font-weight:400}
.status{font-size:.73rem;color:var(--muted);background:#edeee7;border-radius:99px;padding:6px 11px;max-width:45%;text-align:center}
main{max-width:1040px;margin:auto;padding:clamp(30px,7vw,72px) 30px 100px;min-height:65vh}
.site-footer{border-top:1px solid var(--line);color:var(--muted);font-size:.73rem;align-items:start}
h1{font-size:clamp(2.1rem,6vw,3.6rem);line-height:1.22;margin:14px 0 18px;letter-spacing:-.035em;font-weight:760}
h2{font-size:1.3rem;line-height:1.4;margin:0 0 16px}h3{font-size:1rem;margin:0 0 8px}p{margin:8px 0 16px}
.kicker{font-size:.8rem;letter-spacing:.11em;text-transform:uppercase;font-weight:750;color:var(--accent)}
.lead{font-size:1.08rem;color:#44524c;max-width:635px}
.hero{padding:clamp(18px,4vw,45px) 0 50px}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin:28px 0 14px}
.btn{border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:12px 22px;min-height:50px;border-radius:14px;font-weight:650;display:inline-flex;justify-content:center;align-items:center;gap:9px;text-align:center;text-decoration:none}
.btn:hover:not(:disabled){border-color:var(--accent);background:#f5fbf6}.btn-primary{background:var(--accent);border-color:var(--accent);color:white}.btn-primary:hover:not(:disabled){background:var(--accent-dark);color:white}
.btn-quiet{background:transparent;border-color:transparent}.btn-danger{color:var(--danger);border-color:#e5c2bb}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.card,.sheet{border:1px solid var(--line);background:var(--paper);border-radius:22px;padding:25px}
.card{display:flex;flex-direction:column;align-items:stretch;gap:9px}.card .btn{margin-top:auto}.card p{font-size:.85rem;color:var(--muted)}
.split{display:grid;grid-template-columns:1.5fr 1fr;gap:20px}.section{margin-top:43px}.detail-note{font-size:.83rem;color:var(--muted)}
.stat-row{display:flex;gap:15px;flex-wrap:wrap;margin-top:26px}.stat{border-left:3px solid var(--accent);padding-left:15px;min-width:130px}.stat strong{display:block;font-size:1.45rem;line-height:1.2}.stat span{display:block;font-size:.77rem;color:var(--muted)}
.back{color:var(--accent);font-size:.86rem;font-weight:700;background:transparent;border:0;padding:8px 0;margin-bottom:23px}.back:hover{text-decoration:underline}
.quiz-top{display:flex;align-items:center;justify-content:space-between;gap:14px}.quiz-meta{font-size:.82rem;color:var(--muted)}.bar{height:7px;background:#e3e8df;border-radius:10px;overflow:hidden;margin:13px 0 31px}.bar>div{background:var(--accent);height:100%;transition:width .2s}
.quiz-card{max-width:850px;margin:auto}.question-text{font-size:clamp(1.15rem,3vw,1.4rem);line-height:1.7;font-weight:650;margin:17px 0 28px}
.options{display:grid;gap:11px;border:0;margin:0;padding:0;min-width:0}.option-row{display:flex;gap:15px;align-items:flex-start;min-height:55px;padding:13px 18px;border:1.5px solid var(--line);border-radius:14px;background:white;cursor:pointer;transition:background .12s,border-color .12s}
.option-row:hover{background:#f4f8f3}.option-row:has(input:checked){border-color:var(--accent);background:var(--soft)}.option-row input{flex-shrink:0;margin:8px 0 0;accent-color:var(--accent);width:20px;height:20px}
.option-id{font-weight:800;min-width:1.8em}.option-text{flex:1}.option-row:has(input:disabled){cursor:default}
.quiz-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:28px;align-items:center}.quiz-actions .btn-primary{min-width:160px}.hint{font-size:.8rem;color:var(--muted)}
.feedback{padding:18px 20px;border-radius:16px;margin-top:20px;background:var(--soft);border-left:4px solid var(--accent)}.feedback.incorrect{background:var(--danger-soft);border-left-color:var(--danger)}
.feedback strong{font-size:1.1rem}.feedback p{margin:8px 0}.feedback details{font-size:.8rem;margin-top:11px}.feedback summary{cursor:pointer;color:var(--accent)}
.notice{border-left:3px solid #a68b50;padding:10px 18px;background:#fbf7ec;margin:20px 0;font-size:.82rem}
.question-footer{font-size:.76rem;color:var(--muted);margin-top:28px}
.summary-head{font-size:2rem;margin:12px 0}.summary-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:25px 0}.summary-metrics div{padding:18px;background:var(--soft);border-radius:16px;text-align:center}.summary-metrics strong{display:block;font-size:2rem}
.item-list{display:grid;gap:12px}.item-list>div{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:12px 18px}
.settings-actions{display:flex;gap:12px;flex-wrap:wrap;margin:22px 0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.loading{color:var(--muted)}.message{color:var(--accent);font-weight:650}.error{color:var(--danger)}
@media(max-width:730px){.cards{grid-template-columns:1fr}.split{grid-template-columns:1fr}.site-header,.site-footer{padding:16px 18px;align-items:flex-start}.site-footer{flex-direction:column;gap:2px}main{padding:33px 18px 65px}.site-header{gap:8px}.status{max-width:50%;font-size:.65rem}.card,.sheet{padding:20px}.hero{padding-bottom:27px}.hero-actions .btn{width:100%}.quiz-top{align-items:flex-start}.summary-metrics{gap:5px}.summary-metrics div{padding:10px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Partial topic sets with explicit reviewed positions */
.topics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.topic-card{background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:9px}
.topic-card h3{font-size:1rem;line-height:1.45;margin:0 0 6px}.topic-card .btn{margin-top:auto;align-self:flex-start}
@media(max-width:730px){.topics-grid{grid-template-columns:1fr}.topic-card .btn{width:100%}}

/* FGS-T1 v5: human-surface visual system, inspired by warm reading rooms,
   not an imitation of the institutional logo or of the reference website. */
:root{
  --bg:#faf7f0;--paper:#fffcf7;--ink:#2d2a25;--muted:#5e5d57;
  --line:#d8cbbb;--accent:#713c35;--accent-dark:#552a27;
  --soft:#f5e9d7;--danger:#81382e;--danger-soft:#fbf0e8;
  --gold:#a67c42;--ink-light:#514840;
  font-size:18px;
  font-family:system-ui,-apple-system,"Noto Sans CJK TC","Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
}
body{background:var(--bg);color:var(--ink);line-height:1.8}
button,input{touch-action:manipulation}
button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible{
  outline:3px solid #a36932;outline-offset:4px
}
.site-header{
  max-width:none;padding:16px max(20px,calc((100vw - 1080px)/2));
  border-bottom:1px solid var(--line);border-top:5px solid var(--accent);
  background:#f3ecdf;min-height:88px
}
.site-footer{max-width:1080px;font-size:.75rem;line-height:1.5}
.brand{color:var(--accent-dark);font-weight:750;letter-spacing:.01em}
.brand-symbol{
  width:42px;height:42px;min-width:42px;border-radius:50%;
  background:var(--accent);color:#fff5df;box-shadow:inset 0 0 0 2px #ae8059;
  font-family:"Noto Serif CJK TC","Songti TC","STSong",serif;font-size:1.18rem
}
.header-tools{display:flex;align-items:center;gap:13px;justify-content:flex-end;flex-wrap:wrap}
.font-tools{display:flex;align-items:center;gap:2px;padding:3px;border:1px solid #d5c5b1;border-radius:12px}
.font-tools button{
  border:0;background:transparent;color:var(--ink);min-width:45px;min-height:40px;
  border-radius:9px;font-weight:750;font-size:.8rem
}
.font-tools button:not(:disabled):hover{background:#e7dac8}
.status{border:0;background:#eee5d6;color:var(--ink-light);font-size:.69rem;max-width:230px}
main{max-width:1060px;padding-top:42px;padding-bottom:90px}
.hero{
  background:#f3e9da;border:1px solid #e2d4bf;border-left:5px solid var(--accent);
  border-radius:24px;padding:clamp(24px,4vw,46px);margin-bottom:45px
}
.hero h1{
  font-family:"Noto Serif CJK TC","Noto Serif TC","Songti TC","STSong",serif;
  color:var(--accent-dark);font-weight:700;font-size:clamp(2.1rem,5vw,3.1rem)
}
h1,h2,h3{color:var(--ink);text-wrap:pretty}
h2{font-family:"Noto Serif CJK TC","Songti TC","STSong",serif;font-size:1.35rem;font-weight:700}
.lead{color:var(--ink-light);font-size:1rem;line-height:1.9}
.kicker{color:var(--accent);letter-spacing:.06em;font-size:.75rem}
.hero .kicker{color:#734c3a}
.hero-actions{margin:24px 0}
.btn{border-radius:12px;min-height:50px;font-size:.88rem;padding:11px 19px;line-height:1.45}
.btn-primary{background:var(--accent);border-color:var(--accent)}
.btn-primary:hover:not(:disabled){background:var(--accent-dark);border-color:var(--accent-dark)}
.btn:hover:not(:disabled){border-color:var(--accent)}
.btn-quiet{color:var(--accent)}
.btn-danger{color:var(--danger);border-color:#d9aca4;background:#fffaf8}
.card,.sheet,.topic-card{
  border:1px solid var(--line);background:var(--paper);
  border-radius:18px;box-shadow:0 2px 12px rgba(79,55,31,.035)
}
.card,.topic-card{gap:9px}
.card p,.detail-note,.hint{color:var(--muted)}
.section{margin-top:48px}
.section>h2{border-bottom:1px solid #e0d5c7;padding-bottom:12px;margin-bottom:20px}
.topic-card{min-height:170px}
.topic-card h3{font-size:1rem;font-weight:700;line-height:1.5}
.stat{border-left:2px solid var(--gold)}
.stat strong{font-family:"Noto Serif CJK TC","Songti TC","STSong",serif;color:var(--accent-dark)}
.quiz-card{max-width:790px}
.quiz-card .sheet{padding:clamp(21px,4vw,42px)}
.quiz-top strong{color:var(--ink-light)}
.bar{background:#e8dfd2;height:5px}
.bar>div{background:var(--gold)}
.question-text{
  font-size:clamp(1.2rem,3vw,1.48rem);font-weight:650;line-height:1.85;
  color:var(--ink);margin:20px 0 30px;overflow-wrap:anywhere
}
.option-row{
  border:1.5px solid #d9d0c6;background:#fffefa;
  border-radius:13px;padding:15px 18px;min-height:60px;line-height:1.7
}
.option-row:hover{background:#fbf4e9}
.option-row:has(input:checked){background:#f7e8d9;border-color:var(--accent)}
.option-row input{accent-color:var(--accent);min-width:20px;min-height:20px}
.option-id{color:var(--accent-dark);font-variant-numeric:tabular-nums}
.quiz-actions{border-top:1px solid #e7ddce;padding-top:22px;margin-top:28px}
.feedback{
  background:#f9f1e6;border:1px solid #e6d7c2;border-left:4px solid var(--accent);
  border-radius:13px;padding:22px;margin-top:22px
}
.feedback.incorrect{background:#fcf3e9;border-left-color:#bd884b}
.feedback-title{font-size:1.2rem;display:block;color:var(--accent-dark)}
.selection-review{font-size:.89rem;color:var(--ink-light);margin:12px 0 4px}
.correct-answer{font-weight:730;line-height:1.9}
.reading-panel{border-top:1px solid #ddcdbc;margin-top:22px;padding-top:19px}
.reading-panel h3{font-size:1.12rem;margin:8px 0;font-weight:720;color:var(--ink)}
.reading-kicker{font-size:.73rem;letter-spacing:.05em;color:var(--accent);font-weight:750}
.reading-explanation{font-size:.95rem;line-height:1.9}
.reading-quote{
  margin:15px 0;padding:8px 0 8px 15px;border-left:2px solid #b88e50;
  color:var(--accent-dark);font-family:"Noto Serif CJK TC","Songti TC",serif;
  font-size:1.04rem
}
.reading-link{display:inline-block;color:var(--accent-dark);font-size:.87rem;
  font-weight:750;text-decoration:underline;text-underline-offset:4px;
  text-decoration-color:#bb906e;overflow-wrap:anywhere}
.reading-caveat,.unlinked-note,.source-detail,.result-reading{font-size:.78rem;color:var(--muted)}
.reading-caveat{margin:10px 0 4px}
.source-detail{margin-top:18px}
.source-detail summary,.result-reading summary{color:var(--accent);cursor:pointer}
.result-reading .reading-panel{margin-top:8px;padding:15px}
.site-footer{border-top-color:#d6c5ae}
@media(max-width:730px){
  .site-header{padding:14px 16px;min-height:80px;align-items:center;flex-wrap:wrap}
  .brand{font-size:.86rem}.brand-symbol{width:38px;height:38px;min-width:38px}
  .brand .muted{display:none}
  .header-tools{gap:6px}.font-tools button{min-width:38px;min-height:38px}
  .status{max-width:200px;font-size:.65rem}
  main{padding:22px 16px 72px}
  .hero{padding:23px;border-radius:18px;margin-bottom:30px}
  .hero h1{font-size:clamp(1.9rem,8vw,2.65rem)}
  .card,.sheet,.topic-card{padding:21px}
  .option-row{padding:13px 14px;gap:11px}
  .quiz-card .sheet{padding:21px}
  .section{margin-top:36px}
  .reading-panel{padding-top:16px}
}
@media(max-width:380px){
  .brand{max-width:60%}.header-tools{width:100%;justify-content:space-between}
  .status{flex:1;max-width:none}
  .quiz-actions .btn-primary{width:100%}
  .stat-row{gap:11px}
}
@media(prefers-reduced-motion:reduce){
  .bar>div,.option-row{transition:none!important}
}

/* Keep the ten partial topic entries useful without an excessively long mobile home. */
.topic-card{
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;
  gap:2px 14px;align-items:center;min-height:0;padding:16px 19px
}
.topic-card .kicker{grid-column:1;grid-row:1}
.topic-card h3{grid-column:1;grid-row:2;margin:2px 0;overflow-wrap:anywhere}
.topic-card .btn{
  grid-column:2;grid-row:1/span 2;align-self:center;
  width:auto;min-width:96px;min-height:48px;margin:0;font-size:.82rem
}
@media(max-width:730px){
  .card{display:grid;grid-template-columns:minmax(0,1fr) 112px;
    grid-template-rows:auto auto auto;column-gap:12px;row-gap:2px;padding:16px 18px}
  .card .kicker{grid-column:1;grid-row:1}
  .card h3{grid-column:1;grid-row:2;margin:0}
  .card p{grid-column:1;grid-row:3;margin:0;font-size:.76rem}
  .card .btn{grid-column:2;grid-row:1/span 3;align-self:center;
    min-height:52px;margin:0;padding:8px;font-size:.8rem;line-height:1.5}
  .topic-card .btn{width:auto;padding:10px 12px}
}
@media(max-width:350px){
  .topic-card{grid-template-columns:minmax(0,1fr) 85px;padding:14px}
  .topic-card .btn{min-width:85px}
}

/* Genuine user correction notes: readable, not a default tiny browser textarea. */
.question-note{border-top:1px solid #e0d0bc;margin-top:18px;padding-top:17px}
.question-note summary{
  color:var(--accent);font-size:.87rem;font-weight:720;line-height:1.6;
  cursor:pointer;min-height:40px
}
.question-note-input{
  display:block;width:100%;min-width:0;min-height:112px;margin:12px 0;
  border:1.5px solid #cdbba6;border-radius:11px;padding:13px 14px;
  background:#fffefa;color:var(--ink);font:inherit;font-size:.88rem;
  line-height:1.75;resize:vertical;overflow-wrap:anywhere
}
.question-note-input::placeholder{color:#74695e;opacity:1}
.note-actions{display:flex;gap:9px;flex-wrap:wrap;margin:10px 0}
.note-actions .btn{min-height:44px}
.note-status{color:var(--accent-dark);font-size:.78rem;margin-top:8px}
@media(max-width:380px){.note-actions .btn{width:100%}}

/* r6 deliberate practice: no faux-official labels, large controls and visible scope */
.practice-builder,.exam-scope{margin:18px 0 26px}
.builder-label{display:block;font-weight:700;color:var(--ink);margin:16px 0 8px}
.builder-select{width:100%;min-height:52px;border:1px solid var(--line);border-radius:10px;padding:10px 14px;
  background:var(--paper);color:var(--ink);font:inherit}
.builder-types{border:1px solid var(--line);border-radius:14px;padding:14px 18px;margin:20px 0}
.builder-type{display:flex;align-items:center;gap:12px;min-height:50px;padding:6px 0;cursor:pointer}
.builder-type input{width:22px;height:22px;accent-color:var(--accent)}
.exam-scope{border-left:4px solid var(--gold)}
.practice-builder .hero-actions{display:flex;gap:12px;flex-wrap:wrap}
@media(max-width:600px){.practice-builder .hero-actions>.btn{width:100%}}
/* r6 deep reading: compact primary explanation, expandable answer reasoning */
.deep-insight{margin:16px 0;border-top:1px solid var(--line);padding-top:14px}
.deep-insight h4{font-size:.92rem;color:var(--accent-dark);margin:16px 0 6px}
.deep-insight p{line-height:1.8}
.deep-concept{font-weight:730;color:var(--accent-dark)}
.deep-reason{margin:8px 0 12px}
.deep-choices{border:1px solid var(--line);background:var(--paper);border-radius:12px;padding:12px 14px}
.deep-choices>summary{color:var(--accent-dark);font-weight:700;cursor:pointer;min-height:34px}
.deep-choice-list{padding-top:4px}
.deep-choice-line{border-top:1px solid var(--line);padding:9px 0;margin:0;font-size:.86rem}
.deep-choice-line strong{color:var(--accent-dark);margin-right:6px}
.local-profiles{margin:18px 0 24px;border-left:4px solid var(--gold)}
.local-profiles>.btn{margin:12px 0}
.local-profiles .builder-label{margin-top:15px}
.local-profiles input.builder-select{font-size:.95rem}
.profile-identifier{font-size:.74rem;color:var(--muted);overflow-wrap:anywhere;line-height:1.65}

/* r8: voluntary analytics transparency, readable on small screens */
.privacy-banner{border:1px solid var(--line);border-left:4px solid var(--gold);border-radius:12px;background:var(--paper);padding:18px;margin:18px 0}
.privacy-banner .detail-note{line-height:1.8}
.privacy-banner .hero-actions{display:flex;flex-wrap:wrap;gap:10px}
.privacy-settings{border-left:4px solid var(--gold);margin:18px 0 24px}
.privacy-mode{font-size:.84rem;font-weight:750;color:var(--accent-dark)}
.privacy-settings .settings-actions{display:flex;gap:10px;flex-wrap:wrap}
@media(max-width:570px){.privacy-banner .hero-actions>.btn,.privacy-settings .settings-actions>.btn{width:100%}}

/* Stage-1 private small-room entry: only when backend declares room capability. */
.room-entry{margin:18px 0 12px;padding:17px;border-radius:14px;border:1px solid var(--line);background:var(--paper)}
.room-entry h2{font-size:1.15rem;margin:0 0 8px;color:var(--accent-dark)}
.room-entry .btn{margin-top:9px}
@media(max-width:570px){.room-entry .btn{width:100%}}

/* r12: Human-Surface First — explicit states, readable actions, calm night reading */
.theme-toggle{border:1px solid var(--line);border-radius:11px;background:var(--paper);
  color:var(--ink);font-weight:700;min-width:61px;min-height:44px;padding:6px 10px;font-size:.8rem}
.theme-toggle:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.order-note{margin:-20px 0 20px;color:var(--muted);font-size:.78rem;line-height:1.6}
.feedback-quick{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin:12px 0 15px}
.feedback-quick .btn{min-width:138px;min-height:46px}
.option-row.answer-selected-correct,.option-row.answer-missed-correct{background:#e7f2e9;border-color:#347153}
.option-row.answer-selected-wrong{background:#f9e5df;border-color:#a34a35}
.option-row.answer-neutral{background:var(--paper);border-color:var(--line)}
.option-row.answer-missed-correct:has(input:checked){background:#e7f2e9}
.option-row:has(input:disabled).answer-selected-wrong{background:#f9e5df;border-color:#a34a35}
.option-row:has(input:disabled).answer-missed-correct{background:#e7f2e9;border-color:#347153}
.option-row:has(input:disabled).answer-selected-correct{background:#e7f2e9;border-color:#347153}
.choice-tag{font-size:.7rem;font-weight:780;min-width:70px;text-align:center;
  white-space:nowrap;padding:5px 6px;border-radius:7px}
.answer-selected-correct .choice-tag,.answer-missed-correct .choice-tag{background:#cce4d5;color:#15583d}
.answer-selected-wrong .choice-tag{background:#f4c9be;color:#7b291e}
.result-missed,.result-extra{border-radius:10px;padding:9px 12px;margin:7px 0;font-size:.88rem}
.result-missed{background:#e4f2e8;color:#15583d}
.result-extra{background:#f9dfd5;color:#7b291e}
.retry-context{font-size:.85rem;color:var(--muted);font-weight:600}
.keep-review-toggle{display:flex;gap:11px;align-items:center;cursor:pointer;
 border:1px solid var(--line);border-radius:11px;background:var(--paper);
 padding:12px 14px;margin:14px 0;font-size:.85rem}
.keep-review-toggle input{width:22px;height:22px;min-width:22px;accent-color:var(--accent)}
html[data-theme="dark"]{
 color-scheme:dark;--bg:#151a1a;--paper:#222a29;--ink:#e9e4d9;--muted:#b4bdb5;
 --line:#53615b;--accent:#e1aa8c;--accent-dark:#f7c0a1;--soft:#333b34;
 --danger:#f4b2a3;--danger-soft:#382a29;--gold:#e4bd81;--ink-light:#d3c7b7
}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .site-header{background:#222824;border-top-color:#ca8b70}
html[data-theme="dark"] .brand,.site-footer,html[data-theme="dark"] .lead{color:var(--ink)}
html[data-theme="dark"] .brand-symbol{background:#9b6253;color:#fff8eb}
html[data-theme="dark"] .hero{background:#292d29;border-color:#586153;border-left-color:#e1aa8c}
html[data-theme="dark"] .hero h1,html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3{color:var(--ink)}
html[data-theme="dark"] .status{background:#373f3a;color:#d2d8ce}
html[data-theme="dark"] .font-tools{border-color:var(--line)}
html[data-theme="dark"] .font-tools button{color:var(--ink)}
html[data-theme="dark"] .font-tools button:hover{background:#404843}
html[data-theme="dark"] .btn{background:#303b36;border-color:#68756c;color:#f6ebdf}
html[data-theme="dark"] .btn-primary{background:#b7755f;border-color:#c48a6e;color:#fffdf8}
html[data-theme="dark"] .btn-primary:hover:not(:disabled){background:#cf896f;border-color:#cf896f;color:white}
html[data-theme="dark"] .btn-quiet{background:transparent;color:#efb89a;border-color:transparent}
html[data-theme="dark"] .option-row{background:#2c3732;border-color:#5e6b62;color:var(--ink)}
html[data-theme="dark"] .option-row:hover{background:#39473f}
html[data-theme="dark"] .option-row:has(input:checked):not(:has(input:disabled)){background:#463c36;border-color:#deb19a}
html[data-theme="dark"] .option-row.answer-selected-correct,
html[data-theme="dark"] .option-row.answer-missed-correct,
html[data-theme="dark"] .option-row:has(input:disabled).answer-selected-correct,
html[data-theme="dark"] .option-row:has(input:disabled).answer-missed-correct{background:#25493b;border-color:#80cfa6}
html[data-theme="dark"] .option-row.answer-selected-wrong,
html[data-theme="dark"] .option-row:has(input:disabled).answer-selected-wrong{background:#51332f;border-color:#f0a391}
html[data-theme="dark"] .answer-selected-correct .choice-tag,
html[data-theme="dark"] .answer-missed-correct .choice-tag{background:#35664a;color:#e7ffef}
html[data-theme="dark"] .answer-selected-wrong .choice-tag{background:#744036;color:#ffe4d9}
html[data-theme="dark"] .result-missed{background:#25493b;color:#d9ffea}
html[data-theme="dark"] .result-extra{background:#51332f;color:#ffe2dc}
html[data-theme="dark"] .feedback{background:#2b332e;border-color:#546756;border-left-color:#e1aa8c}
html[data-theme="dark"] .feedback.incorrect{background:#39332d;border-left-color:#e6b376}
html[data-theme="dark"] .question-note-input,html[data-theme="dark"] .builder-select{background:#2d3832;color:var(--ink);border-color:#677267}
html[data-theme="dark"] .question-note-input::placeholder{color:#b6bdb6}
html[data-theme="dark"] .deep-choices{background:#29322d}
html[data-theme="dark"] .reading-quote{color:#f0c5a4}
html[data-theme="dark"] .notice{background:#33352d;color:var(--ink);border-color:#bd9a6b}
html[data-theme="dark"] .summary-metrics div{background:#2e3833}
html[data-theme="dark"] .bar{background:#49564c}
html[data-theme="dark"] .privacy-banner,html[data-theme="dark"] .room-entry{background:#2a322e}
html[data-theme="dark"] .stat strong,html[data-theme="dark"] .option-id{color:var(--accent-dark)}
html[data-theme="dark"] .skip{background:var(--paper);color:var(--ink)}
@media(max-width:730px){
 .feedback-quick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .feedback-quick .btn{min-width:0;padding:10px 8px}
 .choice-tag{min-width:57px;font-size:.65rem}
 .option-row{flex-wrap:wrap}
 .option-row .option-text{min-width:60%}
 .option-row .choice-tag{margin-left:auto}
 .order-note{margin:-16px 0 16px}
}


/* r14: quiet, action-first wrong-question management */
.review-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin:13px 0 20px;flex-wrap:wrap}
.review-summary .detail-note{margin:0;max-width:630px}
.review-list{display:grid;gap:14px}
.review-item{background:var(--paper);border:1px solid var(--line);border-radius:16px;
  padding:22px 24px;box-shadow:0 2px 12px rgba(79,55,31,.03)}
.review-question{font-family:inherit;font-size:1.04rem;line-height:1.8;margin:9px 0 16px;
  overflow-wrap:anywhere}
.review-item-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.review-item-actions .btn{min-height:46px}
.review-undo{border:1px solid var(--gold);background:var(--soft);color:var(--ink);
  display:flex;gap:16px;align-items:center;flex-wrap:wrap;justify-content:space-between;
  border-radius:12px;padding:11px 16px;margin:14px 0}
@media(max-width:570px){
 .review-summary>.btn{width:100%}
 .review-item{padding:18px}
 .review-item-actions .btn{flex:1;min-width:115px;padding:10px}
 .review-undo .btn{margin-left:auto}
}


/* r15: missed correct != selected correct. Warm amber = something to learn,
   not green = learner actually selected correctly. Words + shape do not
   require color perception. Contrast measured separately for light and dark. */
.option-row.answer-missed-correct,
.option-row:has(input:disabled).answer-missed-correct{
  background:#fff2d7;border:2px dashed #906017;color:#3f3020;
}
.option-row.answer-missed-correct:has(input:checked){background:#fff2d7;border-color:#906017}
.answer-missed-correct .choice-tag{
  background:#eac782;color:#593a0d;border:1px solid #946419;
}
.result-missed{background:#fff0c9;color:#624318;border-left:4px dashed #906017}
html[data-theme="dark"] .option-row.answer-missed-correct,
html[data-theme="dark"] .option-row:has(input:disabled).answer-missed-correct{
  background:#43351f;border:2px dashed #e1b86f;color:#ffe7bb;
}
html[data-theme="dark"] .answer-missed-correct .choice-tag{
  background:#725021;color:#fff0ce;border:1px solid #dfb06b;
}
html[data-theme="dark"] .result-missed{
  background:#43351f;color:#ffe6b4;border-left:4px dashed #dfb06b
}

/* r21: task navigation is distinct from internal domain/schema pages. */
.study-nav{display:flex;gap:6px;max-width:1060px;margin:0 auto;padding:9px 20px;
 border-bottom:1px solid var(--line);overflow-x:auto;overscroll-behavior-x:contain;
 scrollbar-width:thin;white-space:nowrap}
.study-nav a{display:inline-flex;align-items:center;justify-content:center;
 min-height:45px;padding:7px 13px;border-radius:11px;text-decoration:none;
 color:var(--muted);font-size:.81rem;font-weight:700}
.study-nav a:hover{background:var(--soft);color:var(--accent)}
.study-nav a[aria-current="page"]{background:var(--soft);color:var(--accent);
 box-shadow:inset 0 -3px 0 var(--accent)}
.study-nav a:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.room-entry{padding:22px 26px;border:1px solid var(--line);background:var(--paper);
 border-radius:18px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 22px}
.room-entry h2{margin:0}.room-entry p{flex:1 1 300px;margin:0}
.room-entry button{flex:0 0 auto}
.room-entry-actions{display:grid;gap:9px;flex:0 0 min(100%,280px);width:100%}
.room-entry-actions button{width:100%;min-height:49px}
.privacy-banner{max-width:100%;background:var(--soft);padding:14px 18px;
 margin:8px 0 25px;border-radius:12px;border:1px solid var(--line)}
.privacy-banner .hero-actions{margin:12px 0 0}
@media(max-width:730px){
 .study-nav{padding:7px 10px;gap:3px}
 .study-nav a{min-height:46px;padding:6px 11px;font-size:.75rem}
 .room-entry{padding:17px 19px}
 .room-entry button{width:100%}
}


/* r26 same-origin room membership chooser: a voluntary, server-verified
   return path, not an authentication prompt or device account. */
.room-session-dialog{
 color:var(--ink);background:var(--paper);
 border:1px solid var(--line);border-radius:22px;
 width:min(94vw,570px);max-height:88vh;overflow:auto;padding:clamp(20px,4vw,32px);
 box-shadow:0 25px 80px #0005
}
.room-session-dialog::backdrop{background:#151715a8}
.room-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:18px}
.room-dialog-head h2{margin:0}
.room-dialog-tools{display:flex;align-items:center;gap:8px}
.room-dialog-tools .room-trash{
 color:#888;min-width:44px;min-height:44px;border-radius:12px;
 background:transparent;border:1px solid var(--line);font-size:1.1rem
}
.room-dialog-tools .room-trash[aria-pressed="true"]{
 color:var(--red);border-color:var(--red)
}
.room-session-items{display:grid;gap:10px;margin:18px 0}
.room-return-item,.room-session-choice{
 display:flex;gap:12px;align-items:center;padding:14px 15px;
 width:100%;min-height:60px;border-radius:14px;
 background:var(--surface,var(--paper));border:1px solid var(--line);
 color:var(--ink);text-align:left;font-weight:650;
}
.room-return-item:not(:disabled):hover{border-color:var(--accent,var(--ink))}
.room-session-choice{cursor:pointer;flex-wrap:wrap}
.room-session-choice input{width:22px;height:22px;accent-color:var(--red)}
.room-session-choice span{flex:1}
.room-session-choice small{width:100%;padding-left:34px;color:var(--muted,var(--ink));font-size:.75rem}
.room-dialog-status{color:var(--muted,var(--ink));font-size:.88rem;min-height:1.4em}
.room-dialog-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:18px}
.room-dialog-actions .btn{min-height:50px;flex:1 1 180px}
.room-session-dialog .btn-danger{
 background:#972f30!important;border-color:#972f30!important;color:white!important
}
.room-session-dialog .btn-danger:disabled{opacity:.55}
.room-delete-summary{margin:14px 0;padding-left:23px;overflow-wrap:anywhere}
.room-session-dialog :focus-visible{outline:3px solid var(--accent,#a96b2d);outline-offset:3px}
@media(max-width:400px){
 .room-session-dialog{padding:18px 16px;width:96vw}
 .room-dialog-tools .btn{padding:9px 12px}
}

.room-session-group-heading{margin:15px 0 1px;font-size:.95rem;color:var(--muted,var(--ink))}

/* R19: separate formal grading from authorial first-pass coverage. */
.editorial-status{padding:18px 0 0;border-top:1px solid var(--line)}
.editorial-status h2{margin-top:4px}
.editorial-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.editorial-stat{padding:20px 22px;background:var(--paper);border:1px solid var(--line);
 border-radius:17px;min-width:0}
.editorial-number{display:block;font-size:clamp(1.6rem,3.8vw,2.45rem);
 line-height:1.25;color:var(--accent-dark);font-variant-numeric:tabular-nums}
.editorial-stat h3{margin:8px 0 7px;font-size:.9rem;line-height:1.45}
.editorial-stat p{margin:0;font-size:.78rem;line-height:1.75}
.editorial-disposition{margin:17px 0 5px;font-size:.82rem;font-weight:680;color:var(--ink-light)}
.editorial-grading-delta{font-size:.83rem;font-weight:680;margin:7px 0;color:var(--accent-dark)}
.editorial-status .detail-note{line-height:1.7;margin:7px 0}
.editorial-source{font-size:.7rem;color:var(--muted);margin:9px 0 0}
@media(max-width:430px){
 .editorial-stats{gap:9px}
 .editorial-stat{padding:15px 13px}
 .editorial-number{font-size:1.65rem}
 .editorial-stat h3{font-size:.79rem}
 .editorial-stat p{font-size:.7rem}
}

/* S8 candidate: public aggregate-only admissions gap, no individual QIDs */
.admission-gap-summary{margin:18px 0 0;border:1px solid #9fae9c;border-radius:14px;padding:18px 20px;background:rgba(87,125,105,.08)}
.admission-gap-summary h3{margin:0 0 8px;font-size:1rem}
.admission-gap-summary .editorial-number{display:block;font-size:2rem;font-variant-numeric:tabular-nums}
.admission-gap-summary .detail-note{margin:8px 0}

.review-study-panel{margin-block:1.5rem;border:1px solid var(--border,#cbbdaa);border-radius:1rem;padding:1.15rem}
.review-study-tools{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin:.8rem 0}
.review-study-tools input,.review-study-tools select{min-width:0;max-width:100%;padding:.65rem;border:1px solid #b8b8b8;border-radius:.55rem;background:var(--paper);color:var(--ink)}
.review-study-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:.8rem}
.review-study-item{padding:.9rem;border:1px solid #b3aca0;border-radius:.8rem;background:var(--paper);min-width:0}
.review-study-item h3{overflow-wrap:anywhere;font-size:1rem}
.review-options{padding-inline-start:1.3rem;line-height:1.8}
.review-answer summary{cursor:pointer;font-weight:600;line-height:1.6}
.review-study-item a{overflow-wrap:anywhere}
.review-pager{display:flex;gap:.7rem;justify-content:flex-end;margin-top:1rem}
@media(max-width:440px){.review-study-panel{padding:.75rem}.review-study-list{grid-template-columns:1fr}}


/* R22: explicit day default and dark-native form surfaces.
   The R21 study panel accidentally referenced undefined --surface (#fff fallback).
   Keep controls calm, readable and opt-in dark in ALL study controls. */
html[data-theme="dark"] .review-study-panel {
 background:#1a2220;border-color:var(--line);
}
html[data-theme="dark"] :is(
 input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
 select,textarea
) {
 color-scheme:dark;background:#2b3631;color:#f3ede2;
 border-color:#68776b;
}
html[data-theme="dark"] :is(input,textarea)::placeholder {
 color:#b9c6ba;opacity:1;
}
html[data-theme="dark"] select option {
 background:#2b3631;color:#f3ede2;
}
html[data-theme="dark"] :is(input,select,textarea):disabled {
 background:#29302d;color:#c3cbc3;opacity:.8;
}
html[data-theme="dark"] .review-study-item {
 background:var(--paper);border-color:var(--line);
}
html[data-theme="dark"] .review-study-tools :is(input,select):focus-visible {
 outline:3px solid #e4bd81;outline-offset:2px;
}

/* R23: one clear selection axis, two alternatives; no parallel quiz entry. */
.axis-toggle{display:flex;gap:.65rem;flex-wrap:wrap;margin:.8rem 0 1.2rem}
.axis-toggle .btn{flex:1 1 8rem;min-height:2.8rem}
.practice-builder .builder-label{display:block;margin:.65rem 0 .3rem}
.practice-builder .builder-select{width:100%;max-width:35rem;margin-bottom:.7rem}

/* R27: source-linked per-option editorial reasoning, collapsible on mobile. */
.editorial-rationale .editorial-choice-details{margin:.9rem 0}
.editorial-choice-list{display:grid;gap:.6rem;margin:.7rem 0}
.editorial-choice-line{margin:0;line-height:1.6}
.editorial-choice-line strong{margin-right:.4rem}
.editorial-source-links{display:flex;flex-direction:column;gap:.4rem;margin:.75rem 0}
.editorial-source-links .reading-link{overflow-wrap:anywhere}


/* R30 official polish: one primary action, separate room entry, no governance UI. */
.home-page{display:grid;gap:24px;align-content:start}
.home-page .home-hero{margin:0;padding:clamp(26px,4vw,42px)}
.home-page .home-hero h1{font-size:clamp(2rem,5.4vw,2.9rem);line-height:1.28;letter-spacing:-.025em}
.home-page .home-hero .lead{max-width:34rem;margin:12px 0 8px;line-height:1.65}
.home-page .home-hero .hero-actions{margin:22px 0 0}
.home-page .home-hero .hero-actions .btn{min-width:min(100%,230px)}
.home-page .home-room{display:grid;grid-template-columns:minmax(0,1fr) auto;
 align-items:center;gap:22px;margin:0;padding:28px 34px;border-radius:20px;
 box-shadow:0 3px 14px rgba(79,55,31,.035)}
.home-page .room-entry-copy{min-width:0}
.home-page .home-room h2{margin:0 0 8px;font-size:1.35rem}
.home-page .home-room p{font-size:.9rem;line-height:1.65;margin:0;color:var(--muted)}
.home-page .room-entry-actions{width:min(260px,100%);min-width:175px;display:grid;gap:10px}
.home-page .room-entry-actions .btn{margin:0;min-height:52px}
.home-page .privacy-banner{margin:0}
.practice-builder{margin-top:26px;padding:clamp(24px,4.5vw,38px)}
.practice-builder h2{margin-bottom:22px}
.practice-builder .axis-toggle{margin:10px 0 24px;gap:12px}
.practice-builder .builder-label{margin:20px 0 8px}
.practice-builder .builder-select{margin-bottom:6px;max-width:none}
.practice-builder .detail-note{margin:9px 0 20px}
@media(max-width:730px){
 main{padding:28px 20px 80px}
 .home-page{gap:22px}
 .home-page .home-hero{padding:26px 24px}
 .home-page .home-hero h1{font-size:clamp(2rem,7.8vw,2.5rem)}
 .home-page .home-hero .hero-actions .btn{width:100%}
 .home-page .home-room{grid-template-columns:1fr;gap:18px;padding:24px}
 .home-page .home-room h2{font-size:1.27rem}
 .home-page .room-entry-actions{width:100%;min-width:0}
 .home-page .room-entry-actions .btn{width:100%}
 .practice-builder{padding:25px 23px}
 .practice-builder .axis-toggle{gap:10px}
 .practice-builder .axis-toggle .btn{min-width:0;flex:1}
}
@media(max-width:360px){
 main{padding-inline:17px}
 .home-page .home-hero,.home-page .home-room{padding:22px}
 .practice-builder{padding:21px}
}
html[data-theme="dark"] .home-page .home-room{background:var(--paper);border-color:var(--line)}
