:root{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color:#172033;background:#e9edf2;font-synthesis:none;--ink: #172033;--muted: #687184;--line: #ccd4df;--soft-line: #e3e8ef;--paper: #ffffff;--canvas: #e9edf2;--panel: #f7f9fc;--blue: #12368f;--blue-dark: #0b266b;--blue-pale: #edf2ff;--coral: #d9684f;--teal: #2e807a;--gold: #a57924;--focus: #76a0ff}*{box-sizing:border-box}html{min-width:320px;background:var(--canvas)}body{margin:0;min-width:320px;min-height:100vh;background:var(--canvas);color:var(--ink)}button,input{font:inherit}button{color:inherit}button,summary,label{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 55%,transparent);outline-offset:2px}.app-shell{min-height:100vh}.topbar{position:sticky;z-index:20;top:0;display:flex;align-items:center;justify-content:flex-start;height:66px;padding:0 28px;border-bottom:1px solid var(--line);background:#f7f9fcf0;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.brand{display:inline-flex;align-items:center;gap:11px;color:inherit;text-decoration:none}.brand-mark{display:grid;grid-template-columns:repeat(2,8px);grid-template-rows:repeat(2,8px);gap:2px;width:24px;height:24px;padding:3px;border:1px solid #b9c6e9;background:var(--blue-pale)}.brand-mark i{display:block;background:var(--blue)}.brand-mark i:nth-child(2),.brand-mark i:nth-child(3){opacity:.45}.brand>span:last-child{display:grid;line-height:1}.brand strong{font-size:.92rem;letter-spacing:-.01em}.brand small{margin-top:5px;color:var(--muted);font-size:.66rem;letter-spacing:.035em;text-transform:uppercase}.workspace{display:grid;grid-template-columns:minmax(340px,410px) minmax(0,1fr);min-height:calc(100vh - 66px)}.settings-panel{padding:32px 28px 60px;border-right:1px solid var(--line);background:var(--panel)}.panel-intro{padding-bottom:28px;border-bottom:1px solid var(--line)}.eyebrow{margin:0 0 8px;color:var(--blue);font-size:.67rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.panel-intro h1{max-width:330px;margin:0;font-family:Georgia,Times New Roman,serif;font-size:clamp(1.75rem,2.6vw,2.35rem);font-weight:500;line-height:1.04;letter-spacing:-.035em}.panel-intro>p:last-child{max-width:340px;margin:13px 0 0;color:var(--muted);font-size:.88rem;line-height:1.55}.control-section{padding:26px 0 28px;border-bottom:1px solid var(--line)}.compact-section{padding-bottom:24px}.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:17px}.section-heading>div{display:flex;align-items:baseline;gap:9px}.section-heading h2{margin:0;font-size:.9rem;letter-spacing:-.01em}.step-number{color:#9a9285;font-family:SFMono-Regular,Consolas,monospace;font-size:.66rem}.selection-label{padding:3px 7px;border:1px solid #cdd6ed;border-radius:999px;color:var(--blue-dark);background:var(--blue-pale);font-size:.66rem;font-weight:700}.difficulty-track{position:relative;display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.difficulty-track:before{position:absolute;z-index:0;top:50%;right:8%;left:8%;height:1px;background:#c8c5bc;content:""}.difficulty-track button{position:relative;z-index:1;display:grid;place-items:center;height:39px;padding:0;border:1px solid #c9c6bd;border-radius:50%;background:var(--panel);cursor:pointer}.difficulty-track button span{display:grid;place-items:center;width:27px;height:27px;border-radius:50%;color:#626b7a;font-family:SFMono-Regular,Consolas,monospace;font-size:.75rem;font-weight:700}.difficulty-track button:hover{border-color:#7e8caf}.difficulty-track button.active{border-color:var(--blue);background:var(--blue);box-shadow:0 0 0 3px #dfe7fb}.difficulty-track button.active span{color:#fff}.difficulty-copy{margin-top:14px;padding-left:2px}.difficulty-copy strong{font-size:.78rem}.difficulty-copy p{margin:5px 0 0;color:var(--muted);font-size:.75rem;line-height:1.45}.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.preset-card{min-height:61px;padding:11px 12px;border:1px solid #d4d0c7;border-radius:7px;background:#fffefa;text-align:left;cursor:pointer;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}.preset-card:first-child{grid-column:1 / -1}.preset-card:hover{border-color:#9ca8c8;transform:translateY(-1px)}.preset-card.active{border-color:var(--blue);background:var(--blue-pale);box-shadow:inset 3px 0 0 var(--blue)}.preset-card strong,.preset-card span{display:block}.preset-card strong{font-size:.79rem}.preset-card span{margin-top:4px;color:var(--muted);font-size:.67rem}.custom-notice{margin:10px 0 0;color:var(--blue);font-size:.69rem;font-weight:700}.layout-toggle{display:grid;grid-template-columns:1fr 1fr;gap:8px}.layout-toggle button{min-height:66px;padding:12px;border:1px solid #cfd6e0;border-radius:7px;background:#fff;text-align:left;cursor:pointer}.layout-toggle button:hover{border-color:#8f9bb0}.layout-toggle button.active{border-color:var(--blue);background:var(--blue-pale);box-shadow:inset 3px 0 0 var(--blue)}.layout-toggle strong,.layout-toggle span{display:block}.layout-toggle strong{font-size:.78rem}.layout-toggle span{margin-top:4px;color:var(--muted);font-size:.66rem}.field{display:grid;gap:7px}.field>span{color:var(--muted);font-size:.69rem;font-weight:700}.field input,.lookup-row input,.weight-field input{width:100%;border:1px solid #cbc8bf;border-radius:6px;background:#fffefa;color:var(--ink)}.field input{height:42px;padding:0 12px;font-size:.82rem}.field input:hover,.lookup-row input:hover,.weight-field input:hover{border-color:#969eac}.advanced-panel{border-bottom:1px solid var(--line)}.advanced-panel summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 0;list-style:none;cursor:pointer}.advanced-panel summary::-webkit-details-marker{display:none}.advanced-panel summary>span:first-child{display:grid;gap:4px}.advanced-panel summary strong{font-size:.82rem}.advanced-panel summary small{color:var(--muted);font-size:.68rem}.summary-action{color:var(--blue);font-size:.69rem;font-weight:800}.advanced-panel[open] .summary-action{color:var(--muted)}.advanced-content{padding:0 0 25px}.subsection-heading{display:flex;align-items:center;justify-content:space-between;margin:6px 0 12px}.subsection-heading strong{font-size:.73rem}.subsection-heading span{color:var(--muted);font-family:SFMono-Regular,Consolas,monospace;font-size:.65rem}.weight-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.weight-field{padding:10px;border:1px solid var(--soft-line);border-radius:6px;background:#fffefa}.weight-field>span,.weight-field>em{display:block}.weight-field>span{margin-bottom:7px;color:#515b6d;font-size:.67rem;font-weight:700}.weight-field>div{position:relative}.weight-field input{height:34px;padding:0 39px 0 9px;font-family:SFMono-Regular,Consolas,monospace;font-size:.76rem;font-weight:700}.weight-field>div small{position:absolute;top:10px;right:8px;color:#9298a3;font-size:.58rem}.weight-field>em{margin-top:6px;color:var(--blue);font-size:.61rem;font-style:normal}.helper{margin:9px 0 0;color:var(--muted);font-size:.65rem;line-height:1.4}.divider{height:1px;margin:20px 0;background:var(--soft-line)}.range-field{display:block}.range-field.disabled{opacity:.48}.range-field>div{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.range-field>div span{color:#4f5869;font-size:.71rem}.range-field>div strong{color:var(--blue);font-family:SFMono-Regular,Consolas,monospace;font-size:.73rem}.range-field input{width:100%;accent-color:var(--blue)}.range-field>small{display:block;margin-top:6px;color:var(--muted);font-size:.65rem}.toggle-stack{display:grid;gap:4px}.toggle-row{position:relative;display:grid;grid-template-columns:1fr 34px;gap:12px;align-items:center;padding:8px 0;cursor:pointer}.toggle-row>span{display:grid;gap:3px}.toggle-row strong{font-size:.7rem}.toggle-row small{color:var(--muted);font-size:.61rem;line-height:1.35}.toggle-row input{position:absolute;top:50%;right:0;width:34px;height:19px;margin:0;opacity:0;cursor:pointer;transform:translateY(-50%)}.toggle-row>i{position:relative;display:block;width:34px;height:19px;border:1px solid #b8b8b3;border-radius:999px;background:#dddcd7;pointer-events:none;transition:background .14s ease}.toggle-row>i:after{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #17203340;content:"";transition:transform .14s ease}.toggle-row input:checked+i{border-color:var(--blue);background:var(--blue)}.toggle-row input:checked+i:after{transform:translate(15px)}.toggle-row input:focus-visible+i{outline:3px solid color-mix(in srgb,var(--focus) 55%,transparent);outline-offset:2px}.print-style-toggle{padding:0}.generate-button{display:flex;align-items:center;justify-content:space-between;width:100%;height:50px;margin:24px 0;padding:0 16px;border:1px solid var(--blue);border-radius:6px;background:var(--blue);color:#fff;cursor:pointer;box-shadow:0 7px 18px #2055d62e;transition:background .14s ease,transform .14s ease}.generate-button:hover{background:var(--blue-dark);transform:translateY(-1px)}.generate-button span{font-size:.81rem;font-weight:800}.generate-button b{font-size:1rem}.code-lookup{padding-top:2px}.section-heading.simple{margin-bottom:11px}.section-heading.simple>div{display:grid;gap:3px}.section-heading.simple h2{font-size:.77rem}.section-heading.simple p{margin:0;color:var(--muted);font-size:.64rem}.lookup-row{display:grid;grid-template-columns:1fr auto;gap:7px}.lookup-row input{height:38px;padding:0 10px;font-family:SFMono-Regular,Consolas,monospace;font-size:.73rem;letter-spacing:.04em;text-transform:uppercase}.lookup-row button{padding:0 13px;border:1px solid #bfc5d1;border-radius:6px;background:#fffefa;font-size:.7rem;font-weight:800;cursor:pointer}.lookup-row button:hover{border-color:var(--blue);color:var(--blue)}.lookup-message{margin:8px 0 0;color:var(--muted);font-size:.64rem;line-height:1.4}.history-list{display:grid;gap:1px;margin-top:14px;border-top:1px solid var(--soft-line)}.history-list button{display:flex;align-items:center;justify-content:space-between;padding:10px 2px;border:0;border-bottom:1px solid var(--soft-line);background:transparent;text-align:left;cursor:pointer}.history-list button:hover strong{color:var(--blue)}.history-list button span{display:grid;gap:3px}.history-list strong{font-family:SFMono-Regular,Consolas,monospace;font-size:.68rem;letter-spacing:.03em}.history-list small{color:var(--muted);font-size:.6rem}.history-list b{color:#8b929f;font-size:1rem}.preview-panel{min-width:0;background:var(--canvas)}.preview-toolbar{position:sticky;z-index:10;top:66px;display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:82px;padding:14px 26px;border-bottom:1px solid #cbd2dd;background:#e9edf2f0;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.preview-toolbar .eyebrow{margin-bottom:6px;color:#797367}.document-tabs{display:flex;gap:3px}.document-tabs button{padding:6px 10px;border:0;border-radius:4px;background:transparent;color:#697181;font-size:.75rem;font-weight:750;cursor:pointer}.document-tabs button:hover{color:var(--ink)}.document-tabs button.active{background:#fffefb;color:var(--ink);box-shadow:0 1px 4px #2b261d1f}.toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.toolbar-actions button,.preview-footer button{min-height:36px;padding:0 11px;border-radius:5px;font-size:.7rem;font-weight:750;cursor:pointer}.quiet-button{border:1px solid #c9c5bc;background:#fffefbb8}.quiet-button:first-child{font-family:SFMono-Regular,Consolas,monospace;letter-spacing:.02em}.quiet-button:hover{border-color:#9199a8;background:#fffefb}.download-button{border:1px solid var(--ink);background:var(--ink);color:#fff}.download-button:hover{background:#2b354a}.preview-stage{display:grid;min-height:calc(100vh - 215px);place-items:start center;overflow:auto;padding:clamp(22px,4vw,52px)}.paper{display:flex;flex-direction:column;width:min(100%,760px);min-width:620px;aspect-ratio:210 / 297;padding:2.35% 2.5% 1.9%;background:var(--paper);color:#1a2130;border:1px solid #d5d9e0;box-shadow:0 2px 3px #1c243314,0 18px 45px #1c243329}.paper-header{display:grid;min-height:5.2%;place-items:center;background:var(--blue-dark)}.paper-header h2{margin:0;color:#fff;font-size:clamp(.72rem,1.7vw,1.2rem);font-weight:900;line-height:1;text-align:center;text-transform:uppercase}.paper-header h2 span{margin-left:.5em;color:#dce7ff;font-weight:800}.paper-meta{display:flex;align-items:baseline;gap:2.2%;min-height:4.6%;padding-top:1.2%;color:#111827;font-size:clamp(.44rem,.85vw,.62rem);font-weight:700}.paper-meta span{display:flex;align-items:flex-end;gap:6px}.paper-meta i{display:block;width:clamp(92px,16vw,170px);border-bottom:1px solid #171f2f}.paper-meta i.short{width:clamp(56px,7.8vw,95px)}.problem-grid{display:grid;flex:1;grid-template-columns:repeat(10,minmax(0,1fr));grid-template-rows:repeat(10,minmax(0,1fr));gap:.55%;min-height:0}.sectioned-grid{display:grid;flex:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:1.4%;min-height:0}.sectioned-grid.single-section{grid-template-columns:1fr;grid-template-rows:1fr}.sectioned-grid.single-section .section-problems{grid-template-columns:repeat(10,minmax(0,1fr))}.problem-section{display:flex;flex-direction:column;min-width:0;min-height:0}.problem-section h3{margin:0 0 1.2%;color:#111827;font-size:clamp(.45rem,.95vw,.66rem);font-weight:900;line-height:1;text-transform:uppercase}.section-problems{display:grid;flex:1;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:1.1%;min-height:0}.problem-card{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr) auto;align-items:center;min-width:0;min-height:0;padding:5% 10% 8%;overflow:hidden;border:0;border-radius:0;background:#fff}.answer-sheet .problem-card{background:#f9fafb}.problem-number{justify-self:start;color:#8b95a4;font-family:SFMono-Regular,Consolas,monospace;font-size:clamp(.28rem,.48vw,.4rem);font-weight:700}.stacked-problem{display:grid;align-self:center;justify-self:center;min-width:2.4em;color:#111827;font-family:ui-sans-serif,system-ui,sans-serif;font-size:clamp(.62rem,1.2vw,1rem);font-weight:800;line-height:1.04;text-align:right}.stacked-problem span{display:flex;justify-content:flex-end;gap:.22em}.stacked-problem b{min-width:.72em;font-weight:900;text-align:left}.problem-card[data-operation=division]{grid-template-rows:auto minmax(0,1fr);padding-right:6%;padding-left:6%}.division-problem{display:grid;align-self:center;justify-self:stretch;gap:clamp(3px,.6vw,6px);color:#111827;font-family:ui-sans-serif,system-ui,sans-serif;font-size:clamp(.58rem,1.08vw,.92rem);font-weight:900;line-height:1}.division-row{display:flex;align-items:flex-end;justify-content:center;min-width:0}.divisor{padding-right:.03em}.division-bracket{align-self:stretch;width:.38em;min-height:.95em;border-top:2px solid currentColor;border-left:2px solid currentColor;border-top-left-radius:.16em}.dividend{min-width:2.15em;padding:.07em .1em 0 .05em;border-top:2px solid currentColor;text-align:left}.answer-line{justify-self:center;width:78%;height:clamp(8px,1.8vw,13px);border:1px solid #9097a3;background:#fff}.quotient-box{justify-self:center;width:58%;min-height:clamp(9px,1.9vw,14px);margin:0}.answer-value{justify-self:stretch;margin:0 5%;padding:3% 2%;border:1px solid #c9d3e8;border-radius:0;background:#eef3ff;color:var(--blue-dark);font-family:SFMono-Regular,Consolas,monospace;font-size:clamp(.35rem,.72vw,.52rem);font-weight:800;text-align:center}.paper-footer{display:flex;align-items:flex-end;justify-content:space-between;min-height:2.8%;color:#7e8795;font-size:clamp(.31rem,.55vw,.42rem)}.paper.ink-saver{--blue-dark: #111;color:#111;box-shadow:none}.paper.ink-saver .paper-header{border:1px solid #111;background:#fff}.paper.ink-saver .paper-header h2,.paper.ink-saver .paper-header h2 span,.paper.ink-saver .answer-value{color:#111}.paper.ink-saver .answer-value{border-color:#777;background:#fff}.paper.ink-saver .paper-footer,.paper.ink-saver .problem-number{color:#555}.preview-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px 26px 24px;border-top:1px solid #d4cfc4}.preview-footer p{margin:0;color:#6f6c65;font-size:.69rem}.preview-footer p strong{color:var(--ink)}.preview-footer>div{display:flex;gap:7px}.preview-footer button{border:1px solid #c2beb5;background:#f9f7f1}.preview-footer button:hover{border-color:#8b93a1;background:#fff}@media(max-width:1120px){.workspace{grid-template-columns:350px minmax(0,1fr)}.settings-panel{padding-right:22px;padding-left:22px}.preview-toolbar{align-items:flex-start;flex-direction:column}.toolbar-actions{justify-content:flex-start}}@media(max-width:820px){.topbar{position:static;padding:0 18px}.workspace{display:block}.settings-panel{padding:28px 20px 40px;border-right:0;border-bottom:1px solid var(--line)}.preview-toolbar{position:static;padding:16px 20px}.preview-stage{place-items:start;padding:20px}.paper{min-width:760px}.preview-footer{align-items:flex-start;flex-direction:column;padding:15px 20px 24px}}@media(max-width:460px){.preset-grid,.weight-grid,.layout-toggle{grid-template-columns:1fr}.preset-card:first-child{grid-column:auto}.toolbar-actions{display:grid;width:100%;grid-template-columns:1fr 1fr}.toolbar-actions .download-button{grid-column:1 / -1}}@page{size:A4 portrait;margin:0}@media print{:root,html,body{width:210mm;height:297mm;background:#fff}.topbar,.settings-panel,.preview-toolbar,.preview-footer{display:none!important}.workspace,.preview-panel,.preview-stage{display:block;width:210mm;min-height:0;margin:0;padding:0;overflow:visible;background:#fff}.paper{width:210mm;height:297mm;min-width:0;max-width:none;padding:7mm 8mm 5mm;aspect-ratio:auto;box-shadow:none;print-color-adjust:exact;-webkit-print-color-adjust:exact}.paper-header{min-height:11mm}.paper-header h2{font-size:15pt}.paper-meta{min-height:10.5mm;font-size:7pt}.problem-grid{gap:1mm}.sectioned-grid{gap:4mm}.sectioned-grid.single-section .section-problems{grid-template-columns:repeat(10,minmax(0,1fr))}.problem-section h3{font-size:8pt}.section-problems{gap:1mm}.problem-card{padding:.8mm 1.3mm 1.3mm}.problem-number{font-size:4pt}.stacked-problem{font-size:11pt}.answer-value{font-size:6.2pt}.paper-footer{min-height:5mm;font-size:5.5pt}}
