:root{--forest:#173e35;--forest-dark:#10332b;--green:#286451;--green-soft:#e9f1eb;--paper:#fbfaf6;--canvas:#f2f1eb;--ink:#243a32;--muted:#65736b;--line:#dedfd5;--gold:#d3aa62;--gold-soft:#f7eedc;--red:#a53c36;--red-soft:#fbede8;--radius:12px;--sidebar:244px;--shadow:0 8px 32px #203e2b0a;--font:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--mono:"Cascadia Code","SFMono-Regular",Consolas,monospace}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--canvas);color:var(--ink);font:15px/1.55 var(--font);-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.52}button,a,input,textarea,select,summary,[tabindex]{outline-offset:4px}button:focus-visible,a:focus-visible,textarea:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:3px solid #bc8c34}a{color:var(--green)}button{color:inherit}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(27px,2.6vw,37px);line-height:1.22;letter-spacing:-1.1px;font-weight:650;margin-bottom:14px}h2{font-size:23px;line-height:1.3;letter-spacing:-.5px;margin-bottom:12px}h3{font-size:18px}small{font-size:13px}svg.icon{height:20px;width:20px;flex-shrink:0;vertical-align:middle}button svg{pointer-events:none}.muted{color:var(--muted)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip-link{position:fixed;left:16px;top:-80px;z-index:99;background:#fff;padding:12px;border-radius:8px}.skip-link:focus{top:16px}.app-shell{min-height:100vh;display:grid;grid-template-columns:var(--sidebar) minmax(0,1fr)}.sidebar{position:sticky;top:0;height:100vh;background:var(--forest);color:#e6eee7;padding:38px 23px 24px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:13px;color:#fafaf3;text-decoration:none;font-size:19px;line-height:1.1;letter-spacing:-.3px;width:fit-content}.brand strong{font-weight:650}.brand-mark{display:grid;place-items:center;width:45px;height:45px;border:1px solid #88a28b;border-radius:12px;font:bold 36px/1 Georgia,serif;color:#e7c78a;padding-bottom:7px}.sidebar-caption{font-size:9px;letter-spacing:1.7px;margin:19px 0 44px;color:#abc1b2}.main-nav{display:flex;flex-direction:column;gap:8px}.nav-item{width:100%;display:flex;align-items:center;gap:13px;background:none;border:0;color:#c9d9cf;border-radius:8px;padding:13px 12px;text-align:left;font-size:14px}.nav-item:hover{background:#ffffff0a;color:#fff}.nav-item.active{background:#e6efdf;color:var(--forest-dark);font-weight:650}.nav-item .icon{width:19px;height:19px}.sidebar-footer{margin-top:auto;border-top:1px solid #365a4f;padding-top:22px}.tiny-label{font-size:10px;font-weight:700;letter-spacing:1.4px;line-height:1.6}.sidebar-footer .tiny-label{font-size:8px;color:#c8d2a6;letter-spacing:1px}.sidebar-footer p{font:italic 21px/1.5 Georgia,serif;margin:12px 0 22px;color:#edf0df}.sidebar-footnote{font-size:11px;color:#adc1b3}.main{width:100%;max-width:1510px;padding:44px clamp(24px,3.6vw,64px) 20px;min-width:0;outline:none}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:26px;margin-bottom:32px}.page-header>div:first-child{max-width:630px}.eyebrow{font-size:10px;font-weight:750;letter-spacing:1.6px;color:var(--green);margin-bottom:12px}.page-description{font-size:15px;color:var(--muted);max-width:590px;margin-bottom:0;line-height:1.75}.grade-switch{display:flex;gap:4px;background:#e8e9e1;padding:5px;border-radius:10px;flex-shrink:0}.grade-button{border:0;background:transparent;padding:9px 12px;border-radius:7px;white-space:nowrap;font-weight:600}.grade-button span{font-size:12px;font-weight:400}.grade-button.selected{background:var(--forest);color:#fff}.button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:44px;padding:11px 18px;border:1px solid var(--line);border-radius:8px;text-decoration:none;white-space:nowrap;font-weight:600;font-size:14px;transition:background .15s}.button.primary{background:var(--forest);border-color:var(--forest);color:#fff}.button.primary:hover:not(:disabled){background:#245446}.button.secondary{background:var(--paper)}.button.secondary:hover:not(:disabled){background:#fff}.button.small{min-height:36px;font-size:12px;padding:6px 10px}.text-button{border:0;background:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;color:var(--green);padding:8px 4px;font-size:13px;font-weight:600;min-height:40px;text-decoration:underline;text-underline-offset:4px;text-decoration-color:transparent}.text-button:hover{text-decoration-color:currentColor}.icon-button{border:1px solid transparent;border-radius:8px;background:none;display:inline-grid;place-items:center;padding:9px;min-width:40px;min-height:40px}.icon-button:hover{background:#e9ede4}.resume-banner{display:flex;align-items:center;gap:18px;background:#e7ede1;border:1px solid #d1ddca;border-radius:var(--radius);padding:24px;margin:0 0 26px}.resume-symbol{width:49px;height:56px;display:grid;place-items:center;background:var(--paper);border:1px solid #d3ddce;border-radius:9px;color:var(--green)}.resume-symbol .icon{width:25px;height:25px}.resume-banner>div{flex:1}.resume-banner .tiny-label{font-size:8px;color:#526b43;letter-spacing:1.1px}.resume-banner h2{font-size:18px;margin:6px 0 4px}.resume-banner p{font-size:13px;color:#5b6d55;margin:0}.stats-strip{display:grid;grid-template-columns:repeat(3,1fr) 1.5fr;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:38px;padding:22px 24px;gap:20px}.stats-strip>div{border-right:1px solid var(--line);display:flex;flex-direction:column;gap:2px}.stats-strip strong{font-size:29px;line-height:1.15;font-weight:600;letter-spacing:-1px}.stats-strip span{font-size:11px;color:var(--muted)}.stats-strip p{font-size:11px;color:var(--muted);margin:0;align-self:center;padding-left:24px;position:relative}.stats-strip p .icon{position:absolute;left:0;top:2px;height:16px;width:16px}.collection{margin-top:38px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.section-heading h2{margin:6px 0 0;font-size:22px}.section-number{font-size:9px;color:var(--muted);font-weight:700;letter-spacing:1.5px}.section-note{font-size:11px;color:var(--muted)}.paper-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.paper-card{background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:20px;display:flex;align-items:center;gap:16px;min-width:0;text-align:left;transition:border-color .18s,background .18s}.paper-card:hover{border-color:#97ac91;background:#fffef9}.paper-icon{width:39px;height:44px;background:#eef0e6;display:grid;place-items:center;flex-shrink:0;border-radius:6px;color:#62714c}.paper-icon>span{font-size:21px;font-family:Georgia,serif}.paper-body{display:flex;flex-direction:column;gap:5px;min-width:0}.paper-body strong{font-size:15px;line-height:1.5;overflow-wrap:anywhere}.paper-kicker{font-size:8px;font-weight:750;letter-spacing:1.3px;color:#6d785a}.paper-meta{font-size:11px;color:var(--muted);display:flex;flex-wrap:wrap;gap:5px;line-height:1.6}.visual-note{font-size:10px;color:#69745e;display:flex;align-items:center;gap:5px}.visual-note .icon{width:13px;height:13px}.card-arrow{margin-left:auto;align-self:center;color:#8e9d87}.card-arrow .icon{width:18px}.segmented{display:inline-flex;align-items:center;gap:3px;border:1px solid var(--line);border-radius:8px;padding:3px;background:#eaece3}.segmented>button{background:none;border:0;border-radius:5px;padding:7px 14px;color:var(--muted);font-size:12px;min-height:35px}.segmented>button.selected{background:#fffdf5;color:var(--forest);box-shadow:0 1px 3px #173e3510;font-weight:650}.topic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 26px}.topic-card{padding:18px 2px;display:flex;align-items:center;gap:15px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;min-width:0}.topic-card:hover{background:#e9ece3}.topic-number{font:12px var(--mono);color:#8a947e;align-self:flex-start;padding-top:4px}.topic-card>span:nth-child(2){display:flex;flex-direction:column;gap:3px;min-width:0}.topic-card strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}.topic-card small{color:var(--muted);font-size:11px}.topic-card>.icon{margin-left:auto;width:17px;color:#8a987d}.page-footer{margin-top:50px;padding:20px 0 0;border-top:1px solid var(--line);color:#7c867a;font-size:10px;display:flex;gap:8px}.history-list{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--paper)}.history-row{display:flex;align-items:center;width:100%;gap:15px;padding:20px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}.history-row:last-child{border-bottom:0}.history-row:hover{background:#fffef8}.history-symbol{width:34px;height:34px;background:var(--green-soft);border-radius:50%;display:grid;place-items:center;color:var(--green)}.history-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.history-copy strong{font-size:14px}.history-copy>span{font-size:11px;color:var(--muted)}.history-score{font-size:19px;font-weight:650;white-space:nowrap}.history-score small{font-size:11px;color:var(--muted);font-weight:400}.history-row>.icon{width:16px}.empty-state{padding:40px 25px;text-align:center;background:var(--paper);border:1px dashed #ccd1c4;border-radius:12px;color:var(--muted)}.empty-state>.icon{height:32px;width:32px;margin-bottom:18px}.empty-state h3,.empty-state h2{color:var(--ink);margin-bottom:9px}.empty-state p{max-width:430px;margin:0 auto;font-size:14px}.workspace-header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:26px}.workspace-header h1{font-size:24px;margin:7px 0 7px;letter-spacing:-.5px}.workspace-header .text-button{padding-top:0;min-height:24px;font-size:11px}.workspace-meta{font-size:12px;color:var(--muted);margin:0}.session-status{display:flex;flex-direction:column;gap:9px;align-items:flex-end;flex-shrink:0}.timer{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 14px;background:var(--paper);border:1px solid var(--line);border-radius:8px;min-width:108px;font:600 20px var(--mono);font-variant-numeric:tabular-nums}.timer.untimed{font:12px var(--font);max-width:160px}.timer.urgent{color:var(--red);background:var(--red-soft);border-color:#d7aea3}.save-status{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:5px}.save-status .icon{height:13px;width:13px}.save-status.pending{color:#85652a}.workspace-grid{display:grid;grid-template-columns:minmax(0,1fr) 232px;gap:24px;align-items:start}.question-column{min-width:0}.question-card{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:28px 30px;box-shadow:var(--shadow);overflow:hidden}.question-top{display:flex;justify-content:space-between;gap:10px;padding-bottom:22px;margin-bottom:23px;border-bottom:1px solid var(--line)}.question-top>div:first-child{display:flex;flex-direction:column;gap:8px}.question-index{font-size:18px;font-weight:700;line-height:1.4;outline:none}.question-index small{font-size:12px;font-weight:400;color:#7d8779}.topic-tag{font-size:10px;color:var(--muted)}.question-tools{display:flex;align-items:flex-start;gap:13px;flex-shrink:0}.point-tag{color:#5d6d4d;background:#edf0e5;border-radius:5px;font-size:11px;padding:4px 8px;white-space:nowrap}.flag-button{font-size:10px;min-height:25px;padding:3px 0;gap:4px}.flag-button .icon{width:15px;height:15px}.flag-button.flagged{color:#957323}.rich-text{font-size:16px;line-height:1.8;overflow-wrap:anywhere}.rich-text>p{margin:0 0 16px;white-space:normal}.rich-text>p:last-child{margin-bottom:0}.rich-text ul,.rich-text ol{padding-left:24px}.rich-text li{margin-bottom:10px}.rich-text .text-heading{font-weight:700}.rich-text code,.option-text code{font-family:var(--mono);font-size:.91em;background:#edf0e7;border-radius:3px;padding:2px 4px;white-space:break-spaces;overflow-wrap:anywhere}.rich-text pre{padding:20px;background:#e9ede4;border:1px solid #d9e0d3;border-radius:8px;overflow:auto;line-height:1.75;max-width:100%;margin:18px 0}.rich-text pre code{display:block;font-size:13px;padding:0;background:none;white-space:pre;overflow-wrap:normal}.option-text{overflow-wrap:anywhere;line-height:1.65;font-size:14px}.option-text p{margin:0}.option-text pre{overflow:auto}.table-scroll{overflow:auto;max-width:100%;border:1px solid var(--line);border-radius:7px;margin:18px 0}.table-scroll table{border-collapse:collapse;min-width:100%;width:max-content;font-size:13px;background:#fffef9}.table-scroll th,.table-scroll td{padding:9px 15px;border:1px solid #dce0d3;text-align:left;max-width:350px;overflow-wrap:anywhere}.table-scroll th{background:#e9ede2;font-weight:650;color:#53644a}.resolution-notice{padding:12px;background:var(--gold-soft);border-left:3px solid #c6a257;border-radius:4px;display:flex;gap:10px;align-items:flex-start;margin-bottom:22px;font-size:11px;line-height:1.65;color:#6f5a32}.resolution-notice .icon{width:16px;height:16px;margin-top:2px}.resolution-notice>span{flex:1}.resolution-notice .text-button{flex-shrink:0;min-height:20px;font-size:11px;padding:0;color:#72552b}.source-action{text-align:right;margin-bottom:10px}.source-figure{margin:22px 0}.source-figure>button{display:flex;flex-direction:column;align-items:center;width:100%;background:#fff;border:1px solid var(--line);border-radius:8px;padding:12px;gap:9px}.source-figure img{display:block;max-width:100%;max-height:420px;object-fit:contain}.source-figure span{font-size:11px;color:var(--muted)}.source-figure .icon{width:14px;height:14px}.answer-area{margin-top:26px}.options{display:flex;flex-direction:column;gap:10px}.option{display:flex;gap:14px;align-items:center;min-height:65px;border:1px solid #dfe1d7;border-radius:8px;background:#fffefb;text-align:left;padding:14px 16px;transition:border-color .15s,background .15s}.option:hover:not(:disabled){border-color:#8d9f80;background:#f6f8f0}.option.chosen{border-color:var(--green);background:#edf3e9;box-shadow:inset 0 0 0 1px var(--green)}.option-letter{display:grid;place-items:center;width:31px;height:31px;flex-shrink:0;border:1px solid #dce0d4;border-radius:6px;color:#677761;font-size:13px;font-weight:600}.option.chosen .option-letter{color:#fff;background:var(--forest);border-color:var(--forest)}.option-content{flex:1;min-width:0}.option-state{width:18px;flex-shrink:0;color:var(--green)}.option-state .icon{width:18px;height:18px}.option:disabled{opacity:1}.option.correct-option{border-color:#5f956d;background:#edf4e8}.option.wrong-option{border-color:#cf9187;background:var(--red-soft);box-shadow:none}.option.wrong-option .option-letter{background:var(--red);border-color:var(--red)}.answer-foot{display:flex;align-items:center;justify-content:space-between;margin-top:12px;gap:10px}.clear-answer{font-size:11px;color:var(--muted)}.open-label{display:block;font-size:13px;font-weight:650;margin-bottom:8px}.open-answer{width:100%;resize:vertical;border:1px solid #a9b6a3;border-radius:8px;background:#fffefb;padding:14px;font:16px/1.6 var(--mono);color:var(--ink);min-height:84px;max-height:400px}.open-answer[readonly]{background:#eef0e8}.input-help{color:var(--muted);font-size:11px;margin:7px 0}.question-navigation{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px}.question-navigation>span{font-size:12px;color:var(--muted)}.workspace-hint{font-size:11px;text-align:center;margin-top:18px;color:var(--muted);line-height:1.8}.question-sidebar{position:sticky;top:25px;border:1px solid var(--line);background:#eceee5;border-radius:12px;padding:20px 16px}.map-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.map-heading h2{font-size:13px;margin:0;letter-spacing:0}.map-heading>span{font-size:11px;color:var(--muted)}progress{display:block;appearance:none;width:100%;height:5px;border:0;border-radius:4px;background:#d9dfd1;overflow:hidden}progress::-webkit-progress-bar{background:#d9dfd1;border-radius:4px}progress::-webkit-progress-value{background:#507350;border-radius:4px}progress::-moz-progress-bar{background:#507350;border-radius:4px}.question-map{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:20px 0;max-height:52vh;overflow:auto;padding:4px}.map-button{position:relative;aspect-ratio:1;min-height:29px;background:#fbfaf5;border:1px solid #d3d8ca;border-radius:5px;font-size:11px;padding:0;font-variant-numeric:tabular-nums;color:#687461}.map-button.answered{background:#d3e2cc;border-color:#b9ceb1;color:#2c5434}.map-button.current{box-shadow:0 0 0 2px var(--forest);border-color:var(--forest);font-weight:750}.map-button.marked{border-bottom:3px solid #b58b36}.map-flag{position:absolute;font-size:12px;line-height:8px;top:2px;right:3px;color:#8c620c}.map-button.correct{background:#d5e8ce}.map-button.wrong{background:#f3dace;border-color:#d1a89a;color:#873f34}.map-legend{display:flex;flex-wrap:wrap;gap:9px 12px;color:var(--muted);font-size:9px}.map-legend>span{display:flex;gap:5px;align-items:center}.legend-dot{width:9px;height:9px;border:1px solid #bdc9b4;background:#fbfaf5;border-radius:2px;display:inline-block}.legend-dot.answered{background:#c1d6b8}.legend-dot.marked{border-bottom:3px solid #b58b36}.finish-button{width:100%;font-size:11px;background:none;border-color:#b9c6af;margin-top:20px;padding:9px 6px;gap:6px}.finish-button .icon{width:16px;height:16px}.score-chip{background:var(--green-soft);padding:10px 16px;border:1px solid #c4d7bf;border-radius:8px;font-weight:650;font-size:17px}.review-filters{margin-bottom:20px}.review-verdict{display:flex;align-items:center;gap:9px;padding:13px;border-radius:6px;margin-top:20px;font-size:13px}.review-verdict.success{background:var(--green-soft);color:var(--green)}.review-verdict.failure{background:var(--red-soft);color:var(--red)}.review-verdict.neutral{background:#efeee7;color:#6f6d5b}.review-verdict>span{margin-left:auto;font-size:12px}.explanation{border-top:1px solid var(--line);margin-top:26px;padding-top:24px}.explanation h2{font-size:19px}.explanation .rich-text{font-size:14px;line-height:1.85}.result-hero{background:var(--forest);color:#f3f4df;border-radius:12px;padding:35px 40px;display:flex;align-items:center;gap:50px}.result-hero .tiny-label{color:#c2d0ac;font-size:9px}.big-score{font-size:76px;font-weight:550;line-height:1.25;letter-spacing:-3px;color:#efd199;font-variant-numeric:tabular-nums}.big-score>span{font-size:29px;font-weight:400;letter-spacing:-.5px;color:#9ab4a5;margin-left:12px}.result-hero p{margin:0;color:#bacfbd;font-size:13px}.result-counts{display:grid;grid-template-columns:repeat(2,minmax(85px,1fr));gap:26px 42px;margin-left:auto;padding-left:40px;border-left:1px solid #456455}.result-counts>div{display:flex;flex-direction:column}.result-counts strong{font-size:27px;font-weight:550}.result-counts small{font-size:11px;font-weight:400}.result-counts span{font-size:11px;color:#b8caba}.result-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.topic-results{background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:0 22px}.topic-result{display:grid;grid-template-columns:minmax(170px,1.4fr) 1fr 95px 40px;gap:22px;align-items:center;border-bottom:1px solid var(--line);padding:18px 0}.topic-result:last-child{border-bottom:0}.topic-result>div{display:flex;flex-direction:column;gap:4px}.topic-result>div strong{font-size:14px}.topic-result>div span{font-size:11px;color:var(--muted)}.topic-result>strong{text-align:right;font-size:17px}.topic-result>strong small{font-size:12px;font-weight:400;color:var(--muted)}.bilingual{display:grid;gap:15px}.bilingual>section+section{padding-top:14px;border-top:1px dashed #d5dccc}.syntax-label{display:block;font-size:9px;font-weight:700;letter-spacing:1px;color:#6e805d;margin-bottom:7px}.bilingual .rich-text p:last-child{margin-bottom:0}.spreadsheet{margin:22px 0;background:#fff;border:1px solid #d2ddc9;border-radius:8px;overflow:hidden}.spreadsheet figcaption{background:#e2eada;color:#47613e;padding:9px 12px;font-size:11px;display:flex;align-items:center;gap:6px}.spreadsheet figcaption .icon{width:14px;height:14px}.spreadsheet .table-scroll{margin:0;border:0;border-radius:0}.spreadsheet table{font-family:var(--mono);font-size:12px}.spreadsheet th{text-align:center;font-size:10px;min-width:32px;padding:7px;background:#edf1e7}.spreadsheet td{min-width:72px;max-width:280px;white-space:pre-wrap}.spreadsheet .active-cell{outline:2px solid #497c41;outline-offset:-2px;background:#f1f8ec}.spreadsheet .highlight-range,.spreadsheet .highlight-reference{background:#edf3e8}.spreadsheet .highlight-border{background:#dcead1}.spreadsheet .highlight-source{background:#e6edf7}.spreadsheet .highlight-target{background:#faf0da}.formula-bar{display:flex;gap:12px;padding:7px 12px;background:#fbfcf7;border-bottom:1px solid #dce0d3;font-size:12px;overflow:auto}.formula-bar>span{font-style:italic;color:#7c9070}.formula-bar code{white-space:pre}.function-legend{display:flex;gap:8px;flex-wrap:wrap;align-items:center;font-size:10px;color:#66765b;margin:12px 0 20px}.function-legend code{font-family:var(--mono);border:1px solid #d4dfcb;padding:3px 7px;background:#f1f5e9;border-radius:4px;font-size:10px}.function-legend code span{color:#9aaa8e}.error-banner{background:#fff0e6;border:1px solid #d9b895;border-radius:8px;margin-bottom:25px;padding:12px 16px;display:flex;align-items:center;gap:14px;font-size:13px}.error-banner>span{display:flex;gap:10px;align-items:center;flex:1}.error-banner .button{white-space:normal;flex-shrink:0}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 32px);z-index:110;background:var(--forest-dark);color:#fff;padding:13px 21px;border-radius:8px;box-shadow:0 8px 30px #10261930;font-size:13px}.toast[hidden]{display:none}dialog{border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink);padding:28px;width:min(570px,calc(100% - 32px));max-height:88vh;overflow:auto;box-shadow:0 20px 80px #09251d30}dialog::backdrop{background:#0e291c73;backdrop-filter:blur(3px)}dialog h2{font-size:25px;margin-top:15px;line-height:1.4}dialog p{font-size:14px;line-height:1.7}.dialog-header{display:flex;justify-content:space-between;align-items:center}.dialog-header .eyebrow{margin:0}.dialog-header>.icon-button{margin:-6px -8px -6px 10px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:25px;flex-wrap:wrap}.preview-stats{display:flex;padding:23px 0;margin:22px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.preview-stats>div{flex:1;display:flex;flex-direction:column;border-right:1px solid var(--line);padding:0 20px}.preview-stats>div:first-child{padding-left:0}.preview-stats>div:last-child{border:0}.preview-stats strong{font-size:30px;font-weight:600;letter-spacing:-1px}.preview-stats span{font-size:11px;color:var(--muted)}.preview-rules{padding-left:19px;font-size:13px;color:var(--muted)}.preview-rules li{padding-left:4px;margin-bottom:13px}.notice-box{background:var(--gold-soft);border:1px solid #e4d4b3;border-radius:7px;padding:14px;margin:20px 0;font-size:13px;color:#725c2b}.notice-box.success{background:var(--green-soft);border-color:#c7d7bd;color:var(--green)}.notice-box .icon{width:17px;height:17px;margin-right:5px}.original-option{display:flex;gap:14px;padding:12px 0;border-top:1px solid var(--line)}.original-option .rich-text{font-size:14px}.original-option>strong{font-family:var(--mono);font-size:13px;padding-top:2px}dialog.image-dialog{width:min(1100px,calc(100% - 24px));padding:20px}.image-viewer{overflow:auto;background:#fff;max-height:65vh;border:1px solid var(--line);margin-top:16px}.image-viewer img{display:block;max-width:100%;height:auto;margin:auto}.image-viewer.enlarged img{max-width:none;min-width:100%}.zoom-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted);margin-top:15px}.loading-panel{padding:40px 0;max-width:580px}.loading-panel p{color:var(--muted)}.loading-bar{display:block;width:70px;height:4px;background:var(--gold);margin-bottom:24px;border-radius:5px;animation:pulse 1.5s ease-in-out infinite}.noscript{background:#fff5d9;padding:30px;position:fixed;bottom:0;left:0;right:0}.busy-indicator{opacity:.72}@keyframes pulse{50%{opacity:.3}}@media(min-width:1600px){.main{padding-left:60px;padding-right:60px}.paper-card{padding:25px}.question-card{padding:35px}.workspace-grid{grid-template-columns:minmax(0,1fr) 255px;gap:30px}}
@media(max-width:1190px){:root{--sidebar:212px}.sidebar{padding-left:17px;padding-right:17px}.main{padding:32px 28px 20px}.page-header{flex-direction:column;gap:20px}.grade-switch{align-self:flex-start}.workspace-grid{grid-template-columns:minmax(0,1fr) 196px;gap:16px}.question-card{padding:23px}.question-tools{flex-direction:column;align-items:flex-end;gap:7px}.question-sidebar{padding:16px 12px}.question-map{gap:5px}.map-heading{flex-direction:column;align-items:flex-start;gap:5px}.stats-strip{grid-template-columns:repeat(3,1fr);gap:12px;padding:20px}.stats-strip>div:last-of-type{border-right:0}.stats-strip>p{grid-column:1/-1;padding-left:24px;padding-top:10px;border-top:1px solid var(--line)}.stats-strip p .icon{top:11px}.stats-strip p br{display:none}.paper-card{padding:16px;gap:12px}.paper-icon{width:32px;height:39px}.paper-meta{font-size:10px}.paper-body strong{font-size:13px}.paper-kicker{font-size:7px}.topic-result{grid-template-columns:minmax(150px,1fr) 90px 75px 35px;gap:12px}.result-hero{padding:30px;gap:25px}.result-counts{padding-left:25px;gap:24px}.big-score{font-size:60px}.big-score>span{font-size:23px}}
@media(max-width:950px){.workspace-grid{grid-template-columns:minmax(0,1fr)}.question-sidebar{position:static;grid-row:2}.question-map{grid-template-columns:repeat(10,minmax(0,1fr));max-height:260px;margin:17px 0}.map-heading{flex-direction:row;align-items:center}.map-button{min-height:32px;max-height:40px;aspect-ratio:auto}.finish-button{width:auto;min-width:190px}.question-tools{flex-direction:row;align-items:flex-start}.topic-grid{grid-template-columns:1fr}.paper-grid{grid-template-columns:1fr}.result-counts{gap:20px}.big-score{font-size:54px}.result-hero{padding:25px;gap:18px}.result-counts{grid-template-columns:repeat(2,minmax(60px,1fr));padding-left:20px}.topic-result{grid-template-columns:minmax(120px,1fr) 85px 35px}.topic-result progress{grid-column:1;grid-row:auto}.topic-result>strong{grid-column:2;grid-row:1}.topic-result>.icon-button{grid-column:3;grid-row:1}.topic-result>div{grid-column:1;grid-row:1}.topic-result{row-gap:8px}.section-note{max-width:140px;text-align:right}}
@media(max-width:720px){:root{--sidebar:0px}.app-shell{display:block}.sidebar{position:relative;width:100%;height:auto;padding:19px 20px 0}.brand{font-size:17px;line-height:1;gap:10px}.brand br{display:none}.brand strong{margin-left:5px}.brand-mark{width:32px;height:32px;font-size:28px;border-radius:8px;padding-bottom:5px}.sidebar-caption{display:none}.main-nav{flex-direction:row;gap:5px;overflow:auto;margin-top:18px;padding:0 0 9px;scrollbar-width:thin}.nav-item{width:auto;white-space:nowrap;font-size:11px;padding:9px 12px;gap:6px;min-height:37px}.nav-item .icon{width:15px;height:15px}.sidebar-footer{display:none}.main{padding:27px 20px 20px}.page-header{margin-bottom:25px;gap:20px}.page-header>div:first-child{max-width:100%}h1{font-size:29px;letter-spacing:-.8px}.page-description{font-size:13px;line-height:1.8}.eyebrow{font-size:8px;letter-spacing:1.2px}.grade-switch{padding:4px;align-self:stretch}.grade-button{flex:1;padding:8px 13px;font-size:14px}.grade-button span{font-size:11px}.resume-banner{flex-wrap:wrap;padding:18px;gap:12px}.resume-symbol{width:39px;height:47px}.resume-banner h2{font-size:15px}.resume-banner p{font-size:11px}.resume-banner .button{margin-left:51px;min-height:39px;padding:8px 14px;font-size:12px}.resume-banner .tiny-label{font-size:7px;letter-spacing:.7px}.stats-strip{gap:12px;padding:18px;margin-bottom:29px}.stats-strip strong{font-size:26px}.stats-strip span{font-size:10px}.stats-strip p{font-size:10px}.collection{margin-top:29px}.section-heading{gap:14px;align-items:flex-start}.section-heading h2{font-size:20px}.section-number{font-size:8px;letter-spacing:1px}.section-note{font-size:9px;max-width:110px;padding-top:4px}.paper-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.paper-card{padding:15px;flex-wrap:wrap;gap:10px}.paper-icon{width:29px;height:31px}.paper-body{order:3;width:100%;gap:5px}.card-arrow{order:2}.paper-body strong{font-size:13px}.paper-kicker{font-size:7px}.paper-meta{font-size:10px}.visual-note{font-size:9px}.practice-grid .paper-icon{background:#f1eadb;color:#83703c}.segmented>button{padding:7px 11px;font-size:11px}.topic-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}.topic-card{gap:9px;padding:15px 0}.topic-card strong{font-size:12px}.topic-card small{font-size:9px}.topic-number{font-size:10px}.topic-card>.icon{width:13px}.page-footer{margin-top:35px;font-size:9px;flex-wrap:wrap}.workspace-header{gap:12px;align-items:flex-start;margin-bottom:20px}.workspace-header h1{font-size:21px}.workspace-meta{font-size:10px}.workspace-header .text-button{font-size:10px}.session-status{gap:8px}.timer{font-size:16px;min-width:89px;padding:8px 10px;gap:5px}.timer .icon{width:15px;height:15px}.timer.untimed{font-size:9px;max-width:110px;min-width:0}.save-status{font-size:9px}.session-status .save-status .icon{display:none}.question-card{padding:22px 20px}.question-top{padding-bottom:18px;margin-bottom:20px}.question-index{font-size:17px}.question-index small{font-size:10px}.question-tools{flex-direction:column;align-items:flex-end}.point-tag{font-size:10px}.flag-button{font-size:9px}.topic-tag{font-size:9px;max-width:200px}.rich-text{font-size:15px;line-height:1.8}.rich-text pre{padding:16px;font-size:12px}.rich-text pre code{font-size:12px}.option{min-height:61px;padding:12px;gap:12px}.option-text{font-size:13px}.option-letter{height:28px;width:28px;font-size:12px}.option-state{width:15px}.option-state .icon{width:15px}.answer-area{margin-top:24px}.question-navigation{gap:8px}.question-navigation .button{padding:10px 14px;font-size:12px;min-height:42px;gap:6px}.question-navigation .icon{width:16px}.question-navigation .text-button{font-size:11px}.question-map{grid-template-columns:repeat(10,minmax(0,1fr));gap:5px}.map-button{min-height:30px;font-size:10px}.resolution-notice{flex-wrap:wrap;font-size:10px;padding:10px;gap:7px}.resolution-notice>span{min-width:calc(100% - 25px)}.resolution-notice .text-button{margin-left:23px}.result-hero{padding:24px;gap:24px}.big-score{font-size:56px}.big-score>span{font-size:23px;margin-left:6px}.result-counts{gap:21px;min-width:130px}.result-counts strong{font-size:22px}.result-counts span{font-size:10px}.result-actions{gap:9px}.result-actions .button{font-size:12px;padding:10px 13px}.topic-results{padding:0 17px}.topic-result{grid-template-columns:minmax(120px,1fr) 75px 30px;gap:8px 14px}.topic-result>div strong{font-size:12px}.topic-result>div span{font-size:10px}.topic-result>strong{font-size:14px}.topic-result>strong small{font-size:10px}.history-row{padding:16px;gap:11px;flex-wrap:wrap}.history-copy strong{font-size:12px}.history-copy>span{font-size:10px}.history-score{font-size:16px}.history-score small{font-size:10px}.history-row>.icon{display:none}.history-symbol{width:28px;height:28px}.error-banner{font-size:11px;padding:12px;flex-wrap:wrap}.error-banner .button{margin-left:30px}.review-filters{max-width:100%;display:flex}.review-filters>button{flex:1;padding:7px 8px;font-size:10px}.review-verdict{padding:11px;font-size:12px}.review-verdict>span{font-size:10px}.explanation .rich-text{font-size:13px}.score-chip{font-size:13px;padding:9px 10px}dialog{padding:23px;width:calc(100% - 28px)}dialog h2{font-size:23px}.dialog-actions .button{font-size:12px;padding:10px 14px}.preview-stats>div{padding:0 14px}.preview-stats strong{font-size:27px}.preview-stats span{font-size:10px}.preview-rules{font-size:12px}.toast{font-size:12px;padding:12px 16px}}
@media(max-width:390px){.main{padding:24px 14px 18px}.sidebar{padding-left:15px;padding-right:15px}.brand{font-size:16px}h1{font-size:27px}.section-heading{flex-wrap:wrap;gap:13px}.section-note{max-width:none;text-align:left}.paper-card{padding:13px}.paper-body strong{font-size:12px}.paper-meta{font-size:9px}.topic-grid{grid-template-columns:1fr}.topic-card strong{font-size:13px}.topic-card small{font-size:10px}.question-card{padding:19px 15px}.question-navigation .button{padding:10px 11px;font-size:11px}.question-navigation .text-button{font-size:10px}.question-map{grid-template-columns:repeat(8,minmax(0,1fr))}.workspace-header h1{font-size:19px}.result-hero{padding:22px 18px;gap:20px;flex-direction:column;align-items:stretch}.result-counts{border-left:0;border-top:1px solid #456455;padding:17px 0 0;grid-template-columns:repeat(4,minmax(0,1fr));margin:0;gap:10px}.big-score{font-size:70px}.result-counts strong{font-size:21px}.history-score{width:100%;margin-left:39px}.resume-banner .tiny-label{font-size:6px}.stats-strip{padding:17px 14px}.stats-strip span{font-size:9px}.stats-strip p br{display:block}.topic-result{grid-template-columns:minmax(110px,1fr) 62px 25px;gap:8px}.topic-result>.icon-button{min-width:30px;min-height:30px;padding:6px}.option{gap:10px;padding:12px 10px}.option-state{width:12px}.option-state .icon{width:12px}.answer-foot .text-button{font-size:10px}.dialog-actions{justify-content:stretch}.dialog-actions .button{flex:1}.preview-stats>div{padding:0 9px}}
.topic-completion{display:flex;flex-direction:column;gap:5px;padding:17px 0 0;color:var(--muted);font-size:12px}.topic-completion strong{color:var(--ink);font-size:14px}
.nav-mobile-label{display:none}.source-image-link{margin:12px 0}.source-image-link .text-button{font-size:11px}.source-image-link .icon{height:15px;width:15px}
@media(max-width:720px){.main-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;overflow:visible}.nav-item{min-width:0;flex-direction:column;justify-content:center;gap:5px;padding:8px 2px;min-height:53px;font-size:9px;text-align:center}.nav-item .icon{width:17px;height:17px}.nav-desktop-label{display:none}.nav-mobile-label{display:inline}.question-map{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}.map-button{min-height:42px;max-height:none;font-size:12px}.question-map{max-height:340px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}

/* Compact study home and Telegram Mini App surfaces. */
.skip-link:not(:focus) { clip-path: inset(50%); }
.skip-link:focus { top: calc(12px + var(--app-safe-top, 0px)); background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.spreadsheet .table-scroll { max-height: 320px; overflow: auto; }
.spreadsheet thead th { position: sticky; top: 0; z-index: 1; }
.spreadsheet .sheet-ellipsis th { color: var(--muted); font-size: 18px; }
.spreadsheet .sheet-ellipsis td { padding: 10px 15px; background: var(--surface-soft, #e9ede3); }
.sheet-ellipsis td > span, .sheet-ellipsis td > small { display: block; }
.sheet-ellipsis td > span { font-size: 12px; font-family: var(--mono); }
.sheet-ellipsis td > small { font-size: 12px; font-family: var(--font); margin-top: 3px; color: var(--muted); }
.sheet-compact-note { padding: 8px 12px; font-size: 12px; color: var(--muted); margin: 0; border-top: 1px solid var(--line); }
:root {
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-right: env(safe-area-inset-right, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-left: env(safe-area-inset-left, 0px);
  --app-viewport-height: 100dvh;
  --app-stable-height: 100dvh;
  --nav-height: 76px;
  --dock-height: 78px;
  --surface-soft: #e9ede3;
  --surface-raised: #fffefb;
  --focus: #a97929;
}

body { min-height: var(--app-stable-height); }
.app-shell { min-height: var(--app-stable-height); }
.dashboard-header { margin-bottom: 28px; }
.dashboard-header h1 { max-width: 610px; }
.study-routes { display: grid; grid-template-columns: 1.12fr 1fr 1fr; gap: 14px; }
.study-route {
  display: flex; flex-direction: column; align-items: flex-start; position: relative;
  gap: 22px; padding: 24px; min-width: 0; min-height: 224px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); color: var(--ink); text-align: left;
  transition: border-color .15s, background .15s;
}
.study-route:hover { border-color: #83977b; background: var(--surface-raised); }
.route-symbol { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #d4ddcb; border-radius: 12px; background: #eef1e5; color: #607447; }
.route-symbol .icon { width: 23px; height: 23px; }
.route-copy { display: flex; flex-direction: column; gap: 8px; }
.route-copy strong { font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -.3px; }
.route-copy > span { font-size: 13px; line-height: 1.6; color: var(--muted); }
.route-copy small { font-size: 12px; color: var(--muted); margin-top: 5px; }
.route-arrow { position: absolute; right: 22px; top: 34px; color: #7e8e72; }
.route-practice { background: var(--forest); border-color: var(--forest); color: #f4f5e9; }
.route-practice:hover { background: #214b3d; border-color: #527961; }
.route-practice .route-symbol { border-color: #52705b; background: #355842; color: #e3c58c; }
.route-practice .route-copy > span, .route-practice .route-copy small { color: #c6d5c5; }
.route-practice .route-arrow { color: #c3d3b9; }
.dashboard-progress.stats-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 20px 0 0; padding: 15px 18px; border-radius: 9px; box-shadow: none; }
.dashboard-progress.stats-strip > span { font-size: 12px; color: var(--muted); }
.dashboard-progress.stats-strip strong { display: inline; margin-right: 4px; font-size: 17px; letter-spacing: -.3px; color: var(--ink); }
.dashboard-progress.stats-strip .text-button { margin-left: auto; font-size: 12px; min-height: 32px; }
.dashboard-preview .paper-grid { max-width: none; }
.dashboard-preview .section-heading h2, .recent-results .section-heading h2 { font-size: 20px; }
.catalog-collection { margin-top: 24px; }
.resume-banner progress { max-width: 310px; margin-top: 12px; height: 4px; }
.question-secondary-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 12px 0; }
.question-secondary-actions p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.65; }
.question-secondary-actions .text-button { min-width: 72px; min-height: 44px; flex-shrink: 0; }
.question-navigation .map-toggle { background: transparent; border-color: transparent; gap: 8px; color: var(--muted); }
.map-toggle > span { display: flex; align-items: center; gap: 8px; }
.map-toggle small { font-size: 12px; color: var(--muted); font-weight: 400; }
.question-map-dialog .dialog-header h2 { margin: 0; font-size: 23px; }
.question-map-dialog .map-dialog-summary { margin: 10px 0 24px; font-size: 13px; color: var(--muted); }
.question-map-dialog .map-heading h2 { font-size: 14px; }
.question-map-dialog .map-heading > span { font-size: 13px; }
.question-map-dialog .question-map { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-height: min(49vh, 450px); margin: 20px 0; }
.question-map-dialog .map-button { min-height: 44px; max-height: none; font-size: 14px; }
.question-map-dialog .map-legend { font-size: 12px; gap: 12px; }
.question-map-dialog .finish-button { width: 100%; min-height: 46px; font-size: 14px; margin-top: 23px; }
.map-dialog { max-height: calc(var(--app-viewport-height) - var(--app-safe-top) - var(--app-safe-bottom) - 32px); }

/* System palettes are intentionally bounded; source images keep their pixels. */
html[data-theme="dark"] {
  color-scheme: dark;
  --forest: #234d3d;
  --forest-dark: #0b2118;
  --green: #a6d0af;
  --green-soft: #263e2d;
  --paper: #192a23;
  --canvas: #101d17;
  --ink: #e9eee4;
  --muted: #aebaab;
  --line: #374b3d;
  --gold: #e2bc77;
  --gold-soft: #3b3321;
  --red: #f1aaa0;
  --red-soft: #442c26;
  --surface-soft: #25392d;
  --surface-raised: #20342a;
  --focus: #edc680;
  --shadow: 0 8px 32px #00000014;
}
html[data-theme="dark"] .sidebar { background: #112c21; }
html[data-theme="dark"] .grade-switch,
html[data-theme="dark"] .segmented { background: #26392c; }
html[data-theme="dark"] .segmented > button.selected { background: #3b513c; color: var(--ink); }
html[data-theme="dark"] .button.secondary:hover:not(:disabled),
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .paper-card:hover,
html[data-theme="dark"] .topic-card:hover,
html[data-theme="dark"] .history-row:hover { background: var(--surface-raised); }
html[data-theme="dark"] .resume-banner { background: #223928; border-color: #49603e; }
html[data-theme="dark"] .resume-banner p,
html[data-theme="dark"] .resume-banner .tiny-label { color: #c3d2b8; }
html[data-theme="dark"] .resume-symbol { border-color: #4a603e; }
html[data-theme="dark"] .route-symbol,
html[data-theme="dark"] .paper-icon { background: #2a402e; border-color: #455d3d; color: #cad7b5; }
html[data-theme="dark"] .paper-kicker,
html[data-theme="dark"] .visual-note,
html[data-theme="dark"] .card-arrow,
html[data-theme="dark"] .topic-number,
html[data-theme="dark"] .topic-card > .icon { color: #b3c0a4; }
html[data-theme="dark"] .empty-state { border-color: var(--line); }
html[data-theme="dark"] .question-sidebar { background: #1d2e24; }
html[data-theme="dark"] .point-tag { background: #2c422b; color: #c6d7b7; }
html[data-theme="dark"] .question-index small,
html[data-theme="dark"] .page-footer { color: var(--muted); }
html[data-theme="dark"] .rich-text code,
html[data-theme="dark"] .option-text code { background: #2b3c2c; }
html[data-theme="dark"] .rich-text pre { background: #14231b; border-color: #3a503c; }
html[data-theme="dark"] .rich-text pre code { background: transparent; }
html[data-theme="dark"] .table-scroll table,
html[data-theme="dark"] .spreadsheet,
html[data-theme="dark"] .formula-bar { background: #192a22; color: var(--ink); }
html[data-theme="dark"] .table-scroll th,
html[data-theme="dark"] .spreadsheet th,
html[data-theme="dark"] .spreadsheet figcaption { background: #2b422e; color: #d4e0c8; }
html[data-theme="dark"] .table-scroll th,
html[data-theme="dark"] .table-scroll td,
html[data-theme="dark"] .spreadsheet,
html[data-theme="dark"] .formula-bar { border-color: #425842; }
html[data-theme="dark"] .spreadsheet .active-cell { background: #28432b; outline-color: #b0cf92; }
html[data-theme="dark"] .spreadsheet .highlight-range,
html[data-theme="dark"] .spreadsheet .highlight-reference { background: #263c2b; }
html[data-theme="dark"] .spreadsheet .highlight-border { background: #345132; }
html[data-theme="dark"] .spreadsheet .highlight-source { background: #2a3c47; }
html[data-theme="dark"] .spreadsheet .highlight-target { background: #443c28; }
html[data-theme="dark"] .formula-bar > span,
html[data-theme="dark"] .function-legend,
html[data-theme="dark"] .syntax-label { color: #baccaa; }
html[data-theme="dark"] .function-legend code { background: #243927; border-color: #495f3e; }
html[data-theme="dark"] .function-legend code span { color: #adc097; }
html[data-theme="dark"] .bilingual > section + section { border-color: #465b3e; }
html[data-theme="dark"] .source-figure > button { background: var(--paper); }
html[data-theme="dark"] .source-figure img { background: #fff; border-radius: 5px; }
html[data-theme="dark"] .resolution-notice,
html[data-theme="dark"] .notice-box { color: #e3d1a6; border-color: #6b5935; }
html[data-theme="dark"] .resolution-notice .text-button { color: #efd199; }
html[data-theme="dark"] .option { background: #1d2f25; border-color: #43553f; }
html[data-theme="dark"] .option:hover:not(:disabled) { background: #293e2c; border-color: #8ea47b; }
html[data-theme="dark"] .option.chosen,
html[data-theme="dark"] .option.correct-option { background: #2b472e; border-color: #a4c991; }
html[data-theme="dark"] .option.wrong-option { background: #442b26; border-color: #ba8270; }
html[data-theme="dark"] .option-letter { color: #cad6bc; border-color: #5e7350; }
html[data-theme="dark"] .option.wrong-option .option-letter { background: #7e493f; border-color: #a87565; color: #fff; }
html[data-theme="dark"] .open-answer { background: #14241b; border-color: #68805b; }
html[data-theme="dark"] .open-answer[readonly] { background: #223328; }
html[data-theme="dark"] .map-button,
html[data-theme="dark"] .legend-dot { color: #dce5d0; background: #1e3025; border-color: #4a6040; }
html[data-theme="dark"] .map-button.answered,
html[data-theme="dark"] .legend-dot.answered { background: #395536; color: #e4f0d5; border-color: #6d8b56; }
html[data-theme="dark"] .map-button.current { box-shadow: 0 0 0 2px #d9bb78; border-color: #d9bb78; }
html[data-theme="dark"] .map-button.correct { background: #305631; }
html[data-theme="dark"] .map-button.wrong { background: #57382b; border-color: #9b6b53; color: #f6dbc6; }
html[data-theme="dark"] .map-flag { color: #efd08c; }
html[data-theme="dark"] .map-button.marked,
html[data-theme="dark"] .legend-dot.marked { border-bottom-color: #dcba70; }
html[data-theme="dark"] .review-verdict.neutral { background: #373c2b; color: #d5d5b7; }
html[data-theme="dark"] .score-chip,
html[data-theme="dark"] .notice-box.success { border-color: #52754a; }
html[data-theme="dark"] .error-banner { background: #443623; border-color: #a28049; }
html[data-theme="dark"] .finish-button { border-color: #657d51; }
html[data-theme="dark"] progress,
html[data-theme="dark"] progress::-webkit-progress-bar { background: #3c5035; }
html[data-theme="dark"] progress::-webkit-progress-value { background: #a1c583; }
html[data-theme="dark"] progress::-moz-progress-bar { background: #a1c583; }
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] [tabindex]:focus-visible { outline-color: var(--focus); }

@media (min-width: 721px) and (max-width: 1190px) {
  .study-routes { grid-template-columns: 1fr; gap: 12px; }
  .study-route { flex-direction: row; align-items: center; padding: 22px; min-height: 120px; gap: 20px; }
  .route-copy { gap: 4px; padding-right: 26px; }
  .route-copy small { margin-top: 2px; }
  .route-arrow { top: 50%; transform: translateY(-50%); }
}

@media (max-width: 720px) {
  :root { --nav-height: 76px; --dock-height: 80px; }
  html { scroll-padding-top: calc(14px + var(--app-safe-top)); scroll-padding-bottom: calc(110px + var(--app-safe-bottom)); }
  .app-shell { display: block; }
  .sidebar { background: var(--canvas); color: var(--ink); padding: calc(15px + var(--app-safe-top)) max(20px, var(--app-safe-right)) 0 max(20px, var(--app-safe-left)); }
  .brand { color: var(--ink); font-size: 15px; letter-spacing: -.2px; gap: 9px; }
  .brand-mark { border-color: var(--line); color: var(--green); background: var(--paper); width: 31px; height: 31px; font-size: 26px; }
  .main-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0;
    min-height: calc(var(--nav-height) + var(--app-safe-bottom));
    padding: 8px max(10px, var(--app-safe-right)) calc(8px + var(--app-safe-bottom)) max(10px, var(--app-safe-left));
    border-top: 1px solid var(--line); background: var(--paper); box-shadow: 0 -8px 24px #172e1e05;
  }
  .nav-item { flex-direction: column; gap: 4px; padding: 4px 1px; min-height: 55px; font-size: 12px; line-height: 1.3; color: var(--muted); border-radius: 8px; }
  .nav-item .icon { width: 23px; height: 23px; }
  .nav-item:hover { color: var(--green); background: var(--surface-soft); }
  .nav-item.active { color: var(--green); background: var(--green-soft); font-weight: 700; }
  .nav-item.active .icon { stroke-width: 2; }
  .nav-desktop-label { display: none; }
  .nav-mobile-label { display: inline; }
  .sidebar.study-sidebar { display: none; }
  .main { padding: 23px max(18px, var(--app-safe-right)) calc(var(--nav-height) + var(--app-safe-bottom) + 24px) max(18px, var(--app-safe-left)); }
  .main[data-screen="question"] { padding-top: calc(12px + var(--app-safe-top)); padding-bottom: calc(var(--dock-height) + var(--app-safe-bottom) + 32px); }
  .page-header { gap: 20px; margin-bottom: 24px; }
  .page-header h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.7px; margin-bottom: 10px; }
  .page-header .eyebrow { font-size: 11px; letter-spacing: 1px; margin-bottom: 9px; }
  .page-description { font-size: 14px; line-height: 1.65; }
  .grade-switch { width: 100%; padding: 4px; border-radius: 10px; background: #e7ebdf; }
  .grade-button { min-height: 44px; font-size: 16px; padding: 9px; }
  .grade-button span { font-size: 13px; }
  .study-routes { grid-template-columns: 1fr; gap: 11px; }
  .study-route { flex-direction: row; align-items: center; gap: 15px; min-height: 111px; padding: 19px 17px; border-radius: 13px; }
  .route-symbol { width: 44px; height: 46px; flex-shrink: 0; border-radius: 11px; }
  .route-symbol .icon { width: 23px; height: 23px; }
  .route-copy { gap: 4px; padding-right: 20px; }
  .route-copy strong { font-size: 17px; line-height: 1.3; letter-spacing: -.2px; }
  .route-copy > span { font-size: 12px; line-height: 1.5; }
  .route-copy small { font-size: 12px; margin-top: 3px; }
  .route-arrow { right: 13px; top: 50%; transform: translateY(-50%); }
  .route-arrow .icon { width: 16px; height: 16px; }
  .dashboard-progress.stats-strip { gap: 9px 16px; padding: 13px 15px; margin-top: 16px; }
  .dashboard-progress.stats-strip > span { font-size: 12px; }
  .dashboard-progress.stats-strip .text-button { display: none; }
  .dashboard-progress.stats-strip strong { font-size: 16px; }
  .resume-banner { padding: 18px; gap: 12px; margin-bottom: 18px; }
  .resume-symbol { display: none; }
  .resume-banner .tiny-label { font-size: 11px; letter-spacing: .7px; }
  .resume-banner h2 { font-size: 17px; margin-top: 7px; }
  .resume-banner p { font-size: 12px; }
  .resume-banner > div { flex-basis: 100%; }
  .resume-banner .button { margin: 2px 0 0; min-height: 44px; font-size: 14px; width: 100%; padding: 11px 15px; }
  .resume-banner progress { max-width: none; }
  .section-heading { align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
  .section-heading h2, .dashboard-preview .section-heading h2, .recent-results .section-heading h2 { font-size: 19px; margin: 0; }
  .section-note { font-size: 12px; max-width: none; text-align: left; padding: 0; }
  .catalog-collection { margin-top: 26px; }
  .paper-grid { grid-template-columns: 1fr; gap: 11px; }
  .paper-card { padding: 18px 16px; flex-wrap: nowrap; gap: 14px; min-height: 102px; }
  .paper-icon { width: 39px; height: 45px; border-radius: 8px; }
  .paper-icon > span { font-size: 25px; }
  .paper-body { order: 0; width: auto; gap: 5px; }
  .paper-body strong { font-size: 15px; line-height: 1.4; }
  .paper-kicker { display: none; }
  .paper-meta { font-size: 12px; gap: 4px; }
  .visual-note { font-size: 12px; gap: 5px; }
  .visual-note .icon { width: 14px; height: 14px; }
  .card-arrow { flex-shrink: 0; }
  .segmented { width: 100%; gap: 4px; padding: 4px; }
  .segmented > button { flex: 1; min-height: 44px; font-size: 14px; padding: 8px 7px; }
  .topic-grid { grid-template-columns: 1fr; gap: 0; }
  .topic-card { min-height: 84px; padding: 17px 3px; gap: 14px; }
  .topic-card strong { font-size: 15px; }
  .topic-card small { font-size: 12px; }
  .topic-number { font-size: 12px; padding-top: 4px; }
  .topic-card > .icon { width: 19px; height: 19px; }
  .page-footer { font-size: 12px; padding-top: 18px; margin-top: 29px; }
  .history-row { padding: 17px 15px; gap: 12px; }
  .history-copy strong { font-size: 14px; }
  .history-copy > span { font-size: 12px; }
  .history-score { font-size: 19px; width: auto; margin-left: auto; }
  .history-score small { font-size: 12px; }
  .history-symbol { width: 31px; height: 31px; }
  .workspace-header { align-items: center; gap: 12px; margin-bottom: 18px; }
  .workspace-header > div:first-child { flex: 1; min-width: 0; }
  .workspace-header h1 { font-size: 17px; line-height: 1.45; letter-spacing: -.2px; margin: 3px 0 5px; }
  .workspace-header .text-button { font-size: 12px; min-height: 44px; padding: 5px 0; }
  .workspace-header .text-button .icon { width: 17px; height: 17px; }
  .workspace-meta { font-size: 12px; line-height: 1.6; }
  .session-status { gap: 9px; }
  .timer { font-size: 17px; min-width: 92px; min-height: 43px; padding: 9px 10px; }
  .timer.untimed { max-width: 104px; font-size: 12px; line-height: 1.4; padding: 8px; text-align: center; }
  .timer.untimed .icon { display: none; }
  .save-status { font-size: 12px; line-height: 1.5; }
  .session-status .save-status { text-align: right; max-width: 111px; }
  .question-card { border-radius: 12px; padding: 20px 18px; }
  .question-top { gap: 10px; padding-bottom: 16px; margin-bottom: 21px; }
  .question-index { font-size: 18px; }
  .question-index small, .topic-tag, .point-tag { font-size: 12px; }
  .topic-tag { max-width: none; line-height: 1.5; }
  .point-tag { padding: 4px 8px; }
  .question-tools { gap: 2px; }
  .flag-button { font-size: 12px; min-height: 44px; padding: 7px 0; }
  .flag-button .icon { width: 17px; height: 17px; }
  .rich-text { font-size: 16px; line-height: 1.85; }
  .rich-text pre { padding: 16px; }
  .rich-text pre code { font-size: 13px; }
  .option { min-height: 68px; padding: 14px 12px; gap: 12px; }
  .option-text { font-size: 15px; line-height: 1.75; }
  .option-letter { width: 31px; height: 33px; font-size: 14px; }
  .option-state { width: 17px; }
  .option-state .icon { width: 17px; height: 17px; }
  .syntax-label { font-size: 12px; letter-spacing: .3px; line-height: 1.5; }
  .answer-foot { align-items: center; gap: 12px; }
  .clear-answer, .answer-foot .text-button { font-size: 12px; min-height: 44px; padding: 8px 0; }
  .open-label { font-size: 14px; }
  .input-help { font-size: 12px; line-height: 1.7; }
  .resolution-notice { font-size: 12px; padding: 12px; gap: 8px; }
  .resolution-notice .text-button { font-size: 12px; min-height: 36px; }
  .source-image-link .text-button, .source-figure span { font-size: 12px; min-height: 44px; }
  .source-image-link .text-button .icon { width: 16px; height: 16px; }
  .spreadsheet figcaption, .formula-bar, .function-legend, .function-legend code { font-size: 12px; }
  .function-legend { line-height: 1.65; }
  .spreadsheet th { font-size: 12px; }
  .spreadsheet td { font-size: 13px; }
  .question-sidebar { display: none; }
  .question-secondary-actions { align-items: center; margin: 13px 0 8px; }
  .question-secondary-actions p { font-size: 12px; max-width: 235px; }
  .question-secondary-actions .text-button { font-size: 13px; padding: 8px 2px; }
  .question-navigation {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .95fr) minmax(0, 1fr);
    align-items: center; gap: 8px; margin: 0;
    min-height: calc(var(--dock-height) + var(--app-safe-bottom));
    padding: 12px max(14px, var(--app-safe-right)) calc(12px + var(--app-safe-bottom)) max(14px, var(--app-safe-left));
    border-top: 1px solid var(--line); background: var(--paper); box-shadow: 0 -7px 24px #14271907;
  }
  .question-navigation .button { min-width: 0; min-height: 48px; padding: 10px 7px; font-size: 13px; gap: 5px; border-radius: 9px; }
  .question-navigation .button .icon { width: 17px; height: 17px; }
  .question-navigation .map-toggle { color: var(--green); padding: 3px; gap: 7px; }
  .map-toggle > span { flex-direction: column; gap: 0; font-size: 12px; }
  .map-toggle small { font-size: 12px; }
  .review-filters { margin: 0 0 17px; }
  .review-filters > button { font-size: 12px; min-height: 44px; padding: 8px 5px; }
  .review-verdict { font-size: 14px; padding: 13px 11px; gap: 7px; }
  .review-verdict > span { font-size: 12px; }
  .explanation .rich-text { font-size: 15px; line-height: 1.85; }
  .score-chip { font-size: 14px; padding: 11px; }
  .result-hero { border-radius: 13px; }
  .result-counts span, .result-counts small { font-size: 12px; }
  .result-actions { display: flex; flex-direction: column; gap: 10px; }
  .result-actions .button { min-height: 48px; font-size: 14px; width: 100%; }
  .result-actions .text-button { min-height: 44px; font-size: 13px; }
  .topic-result > div strong { font-size: 14px; }
  .topic-result > div span, .topic-result > strong small { font-size: 12px; }
  .topic-result { grid-template-columns: minmax(0, 1fr) 73px 44px; gap: 8px; }
  .topic-result > .icon-button { min-width: 44px; min-height: 44px; }
  .error-banner { position: relative; z-index: 2; font-size: 13px; line-height: 1.65; }
  .error-banner .button { min-height: 44px; font-size: 13px; }
  .toast { bottom: calc(var(--nav-height) + var(--app-safe-bottom) + 14px); font-size: 13px; width: max-content; line-height: 1.6; }
  dialog { max-height: calc(var(--app-viewport-height) - var(--app-safe-top) - var(--app-safe-bottom) - 30px); padding: 24px 20px; border-radius: 17px; }
  dialog .icon-button { min-width: 44px; min-height: 44px; }
  dialog p, .preview-rules { font-size: 14px; }
  .preview-stats span { font-size: 12px; }
  .dialog-actions .button { min-height: 48px; font-size: 14px; padding: 11px 13px; }
  .zoom-controls { font-size: 12px; flex-wrap: wrap; }
  .zoom-controls .button { min-height: 44px; font-size: 13px; }
  .image-viewer { max-height: calc(var(--app-viewport-height) - var(--app-safe-top) - var(--app-safe-bottom) - 190px); }
  dialog.map-dialog, dialog:has(.question-map-dialog) {
    position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%;
    padding: 23px max(20px, var(--app-safe-right)) calc(22px + var(--app-safe-bottom)) max(20px, var(--app-safe-left));
    border-radius: 22px 22px 0 0; border-bottom: 0;
  }
  .question-map-dialog .question-map { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; max-height: calc(var(--app-viewport-height) * .45); padding: 4px; }
  .question-map-dialog .map-button { aspect-ratio: 1; min-height: 44px; min-width: 0; font-size: 14px; border-radius: 7px; }
  .question-map-dialog .map-legend { font-size: 12px; line-height: 1.6; }
  .question-map-dialog .map-heading h2 { font-size: 14px; }
  .question-map-dialog .map-heading { margin-bottom: 13px; }
  .question-map-dialog .map-dialog-summary { margin-bottom: 19px; }
  html[data-theme="dark"] .sidebar { background: var(--canvas); }
  html[data-theme="dark"] .nav-item.active { background: #2a432e; color: #d9e6c9; }
  html[data-theme="dark"] .practice-grid .paper-icon { background: #433b26; color: #e0cca4; }
  html[data-telegram="true"] .sidebar:not(.study-sidebar) { padding-top: var(--app-safe-top); }
  html[data-telegram="true"] .sidebar > .brand { display: none; }
  html[data-keyboard="true"] .main-nav,
  html[data-keyboard="true"] .question-navigation { display: none; }
  html[data-keyboard="true"] .main { padding-bottom: 26px; }
  html[data-keyboard="true"] .toast { bottom: calc(var(--app-safe-bottom) + 12px); }
}

.access-mode { display: block; }
.access-gate { min-height: var(--app-stable-height); max-width: 560px; margin: auto; padding: calc(var(--app-safe-top) + 32px) max(20px, var(--app-safe-right)) calc(var(--app-safe-bottom) + 28px) max(20px, var(--app-safe-left)); display: flex; flex-direction: column; justify-content: center; }
.access-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 650; margin-bottom: 32px; }
.access-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.access-symbol { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--surface-soft); color: var(--green); margin-bottom: 28px; }
.access-symbol .icon { width: 26px; height: 26px; }
.access-card h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.7px; margin: 12px 0 18px; }
.access-description { color: var(--muted); font-size: 15px; line-height: 1.8; margin-bottom: 26px; }
.access-card > .button { display: flex; width: 100%; text-decoration: none; min-height: 48px; }
.access-card > .text-button { display: block; margin: 12px auto 0; min-height: 44px; }
.access-id { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; margin: 0 0 24px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-soft); }
.access-id > span, .access-footnote { font-size: 12px; color: var(--muted); }
.access-id > strong { font: 600 23px var(--mono); overflow-wrap: anywhere; }
.access-footnote { text-align: center; margin: 24px 0 0; }
.access-detail { font-size: 13px; color: var(--muted); }
.account-strip { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.account-strip > span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-strip strong { color: var(--ink); }
.admin-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.admin-summary > div { display: flex; align-items: baseline; gap: 10px; }
.admin-summary strong { font-size: 32px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.admin-summary span { font-size: 13px; color: var(--muted); }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface-soft); border-radius: 99px; }
.admin-badge .icon { width: 16px; color: var(--green); }
.admin-card { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.admin-card h2 { font-size: 20px; margin: 0 0 8px; }
.admin-card .muted, .admin-hint { color: var(--muted); font-size: 13px; }
.admin-hint { font-size: 12px; margin: 16px 0 0; }
.admin-form { display: grid; grid-template-columns: minmax(145px, .8fr) minmax(180px, 1.2fr) auto; align-items: end; gap: 16px; margin-top: 22px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; }
.admin-form label > span { font-weight: 400; color: var(--muted); }
.admin-form input, .admin-search input { display: block; width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--ink); padding: 11px 12px; font-size: 16px; }
.admin-form input { margin-top: 8px; }
.admin-form input::placeholder, .admin-search input::placeholder { color: var(--muted); opacity: 1; }
.admin-form > .button { min-height: 48px; }
.admin-card .section-heading { align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.admin-card .section-heading h2 { margin: 0; }
.admin-search { display: flex; align-items: center; gap: 10px; }
.admin-search .button { min-height: 48px; }
.student-row { display: flex; align-items: center; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.student-row:last-child { border-bottom: 0; padding-bottom: 0; }
.student-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; background: var(--surface-soft); color: var(--green); border-radius: 12px; }
.student-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.student-info strong { font-size: 14px; }
.student-info span, .student-info small { font-size: 12px; color: var(--muted); }
.student-row .button { flex-shrink: 0; }
.danger-quiet { color: var(--red); background: transparent; }
.danger-quiet:hover { background: var(--red-soft); }
.admin-pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
@media (max-width: 1000px) {
  .admin-form { grid-template-columns: 1fr 1fr; }
  .admin-form > .button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 560px) {
  .access-gate { justify-content: flex-start; padding-top: calc(var(--app-safe-top) + 24px); }
  .access-brand { margin-bottom: 24px; }
  .access-card { padding: 26px 22px; }
  .access-card h1 { font-size: 29px; }
  .admin-card { padding: 20px 16px; }
  .admin-form { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .admin-form > .button { width: 100%; }
  .student-row { flex-wrap: wrap; gap: 12px; }
  .student-info { flex-basis: calc(100% - 54px); }
  .student-row .button { margin-left: 54px; min-height: 44px; }
  .account-strip .button { min-height: 44px; }
}

@media (max-width: 359px) {
  .main { padding-left: max(14px, var(--app-safe-left)); padding-right: max(14px, var(--app-safe-right)); }
  .nav-item { font-size: 11px; }
  .study-route { padding: 17px 13px; gap: 12px; }
  .route-symbol { width: 37px; height: 42px; }
  .route-copy strong { font-size: 16px; }
  .route-copy > span { display: none; }
  .question-card { padding: 19px 14px; }
  .question-navigation { gap: 5px; padding-left: max(10px, var(--app-safe-left)); padding-right: max(10px, var(--app-safe-right)); }
  .question-navigation .button { font-size: 12px; gap: 4px; }
  .question-map-dialog .question-map { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .question-top { gap: 8px; }
  .question-tools { gap: 0; }
  .flag-button > span { font-size: 11px; }
  .topic-tag { max-width: 145px; }
}

.access-plan { display: flex; align-items: center; gap: 28px; justify-content: space-between; padding: 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.access-plan h2 { margin: 8px 0; font-size: 23px; }
.access-plan p:not(.eyebrow) { max-width: 570px; margin: 8px 0 0; font-size: 13px; line-height: 1.75; color: var(--muted); }
.access-plan-actions { display: flex; flex-direction: column; flex-shrink: 0; gap: 12px; align-items: center; }
.access-plan-actions .text-button { font-size: 12px; min-height: 44px; }
.locked-label, .open-label-tag { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.locked-label .icon { width: 13px; height: 13px; }
.open-label-tag { color: var(--green); }
.locked-card { border-style: dashed; }
@media (max-width: 950px) {
  .access-plan { flex-direction: column; align-items: stretch; gap: 20px; padding: 20px; }
  .access-plan-actions { align-items: stretch; }
}
