:root{font-family:"Noto Sans JP","Yu Gothic",Meiryo,sans-serif;color:#111;background:#f3f4f6;line-height:1.42}*{box-sizing:border-box}body{margin:0}.app-header,.controls{max-width:1100px;margin:0 auto;padding:18px 22px}.app-header{padding-bottom:4px}.eyebrow{margin:0;font-size:.8rem;color:#555}.app-header h1{margin:.25rem 0;font-size:1.5rem}.sub{margin:.2rem 0;color:#555}.controls{background:#fff;border:1px solid #ddd;border-radius:12px;margin-top:12px}.controls h2{font-size:1.05rem;margin:0 0 10px}.mode-fieldset{display:flex;gap:18px;flex-wrap:wrap;border:0;padding:0;margin:0 0 12px}.mode-fieldset legend{font-weight:700;margin-bottom:5px}.selection-panel{border-top:1px solid #e3e3e3;padding-top:10px}.panel-help{margin:.2rem 0 .65rem;color:#555;font-size:.9rem}.grade-groups{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.grade-groups fieldset{border:1px solid #ddd;border-radius:9px;padding:9px 11px}.grade-groups legend{font-weight:700}.grade-groups label{display:block;margin:5px 0}.select-label{display:flex;align-items:center;gap:9px;font-weight:700}.select-label select{font:inherit;padding:7px 9px;border:1px solid #777;border-radius:7px;background:#fff}.button-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.button-row button{font:inherit;padding:8px 13px;border:1px solid #777;border-radius:7px;background:#fff;cursor:pointer}.button-row button:first-child{background:#111;color:#fff}.button-row button:disabled{opacity:.45;cursor:not-allowed}.status{min-height:1.4em;margin:.7rem 0 0}.stale-notice{margin:.45rem 0 0;padding:.5rem .65rem;background:#fff5cf;border:1px solid #dfc869;border-radius:7px}.fatal-error,.empty-state{max-width:1100px;margin:14px auto;padding:16px 22px;border-radius:10px}.fatal-error{background:#fff0f0;border:1px solid #d99}.empty-state{background:#fff;border:1px dashed #bbb;color:#555}.worksheet-root{max-width:1100px;margin:18px auto 50px}.sheet-page{width:210mm;min-height:297mm;margin:0 auto 18px;background:#fff;padding:9mm 10mm;box-shadow:0 2px 14px rgba(0,0,0,.13)}.sheet-header{display:flex;justify-content:space-between;align-items:baseline;border-bottom:1.5px solid #111;padding-bottom:2mm;margin-bottom:1.7mm}.sheet-header h2{font-size:14pt;margin:0}.sheet-header span{font-weight:700}.sheet-sub{display:flex;justify-content:space-between;gap:8px;font-size:9pt;margin-bottom:1.3mm}.problem-list{display:flex;flex-direction:column;gap:.05mm}.worksheet-problem{break-inside:avoid}.problem-row{display:grid;grid-template-columns:7mm 1fr;gap:1mm;align-items:start;font-size:9.35pt;line-height:1.18}.problem-number{font-weight:700;white-space:nowrap}.problem-body{min-width:0}.problem-instruction{font-family:"Noto Sans JP","Yu Gothic",Meiryo,sans-serif}.problem-native{min-width:0}.math,.math-expression,.math-answer,.fraction,.frac,.equation,.system,.chain,.answer-main .math{font-family:"Cambria Math","STIX Two Math","STIXGeneral","DejaVu Serif","Noto Serif",serif;font-size:1.04em;letter-spacing:.002em;font-kerning:normal}.unit{font-family:"Noto Sans JP","Yu Gothic",Meiryo,sans-serif;font-size:.95em}.renderer-current-locked .system{display:inline-grid;grid-template-columns:auto 1fr;gap:.1em;vertical-align:middle;margin:.1em .15em;max-width:100%}.renderer-current-locked .system-brace{font-size:2.45em;line-height:.75;align-self:center;transform:scaleY(1.25);transform-origin:center}.renderer-current-locked .system-lines{display:flex;flex-direction:column;line-height:1.14;white-space:nowrap}.renderer-current-locked .frac,.renderer-current-locked .fraction{display:inline-grid;grid-template-rows:auto auto;vertical-align:middle;text-align:center;line-height:1.02;min-width:1.5em;margin:0 .08em;white-space:nowrap}.renderer-current-locked .frac .num,.renderer-current-locked .frac-num{display:block;border-bottom:1px solid currentColor;padding:0 .12em .03em}.renderer-current-locked .frac .den,.renderer-current-locked .frac-den{display:block;padding:.03em .12em 0}.renderer-current-locked .sqrt{display:inline-flex;align-items:flex-start;white-space:nowrap}.renderer-current-locked .sqrt::before{content:"√";font-size:1.08em;line-height:1}.renderer-current-locked .sqrt>.radicand{border-top:1px solid currentColor;padding:0 .08em;line-height:1.02}.write-space{margin-left:8mm}.worksheet-problem.ws-1 .write-space{height:3.6mm}.worksheet-problem.ws-2 .write-space{height:7.2mm}.worksheet-problem.ws-3 .write-space{height:10.8mm}.answer-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:5mm;row-gap:.35mm;align-items:start}.answer-item{break-inside:avoid;border-bottom:.2mm solid #ddd;padding:.35mm 0 .5mm;font-size:7.15pt;line-height:1.09}.answer-head{display:grid;grid-template-columns:6mm 1fr;gap:.7mm;align-items:start}.answer-main{font-weight:600;min-width:0}.answer-detail,.answer-steps{margin-left:6.7mm;margin-top:.12mm}.transformation-line,.answer-step{margin-top:.08mm;white-space:normal}.justification{font-family:"Noto Sans JP","Yu Gothic",Meiryo,sans-serif;font-size:.92em}.answer-page{display:none}.worksheet-root.show-answers .answer-page{display:block}
@media(max-width:820px){.app-header,.controls{margin-left:10px;margin-right:10px}.grade-groups{grid-template-columns:1fr}.sheet-page{width:100%;min-height:auto;padding:18px 14px}.sheet-header{align-items:flex-start;gap:8px}.sheet-header h2{font-size:1rem}.problem-row{font-size:.91rem}.answer-grid{grid-template-columns:1fr}.worksheet-root{margin:12px 10px 40px}.button-row button{flex:1 1 44%}.renderer-current-locked .renderer-current-locked .system-lines{white-space:normal}.renderer-current-locked .system{max-width:100%}.problem-body,.answer-main,.transformation-line{overflow-wrap:anywhere}}
@page{size:A4 portrait;margin:0}@media print{:root,body{background:#fff}.no-print{display:none!important}.empty-state{display:none!important}.worksheet-root{display:block!important;max-width:none;margin:0}.sheet-page{display:block!important;width:210mm;height:297mm;min-height:297mm;margin:0;padding:7.2mm 8.2mm;box-shadow:none;overflow:hidden;break-after:page;page-break-after:always}.sheet-page:last-child{break-after:auto;page-break-after:auto}.sheet-header{margin-bottom:1mm;padding-bottom:1.25mm}.sheet-header h2{font-size:12pt}.sheet-sub{font-size:8pt;margin-bottom:.65mm}.problem-list{gap:0}.problem-row{font-size:8.1pt;line-height:1.1;grid-template-columns:5.8mm 1fr}.write-space{margin-left:6.8mm}.worksheet-problem.ws-1 .write-space{height:3.6mm}.worksheet-problem.ws-2 .write-space{height:7.2mm}.worksheet-problem.ws-3 .write-space{height:10.8mm}.answer-grid{column-gap:3.8mm;row-gap:.08mm}.answer-item{font-size:6.75pt;line-height:1.04;padding:.18mm 0 .28mm}.answer-detail,.answer-steps{margin-left:6mm;margin-top:.03mm}.transformation-line,.answer-step{margin-top:.02mm}.renderer-current-locked .renderer-current-locked .system-brace{font-size:2.2em}}

/* Formal renderer integration v1 */
.math-render-v1{white-space:nowrap}.math-render-katex .katex{font-size:1.04em}.formal-answer-detail{margin-top:.12mm}


/* Light Page-shell v0.1 — screen-only outer shell. Generator selectors remain untouched. */
.public-shell{width:calc(100% - 32px);max-width:960px;margin-left:auto;margin-right:auto;color:#111827}
.public-identity{padding-top:24px;margin-bottom:20px}
.public-identity .service-name{margin:0 0 8px;font-size:18px;font-weight:700;line-height:1.45;color:#1e40af}
.public-identity h1{margin:0;font-size:28px;font-weight:700;line-height:1.4;letter-spacing:-.01em}
.public-identity .public-support{max-width:760px;margin:8px 0 0;font-size:16px;line-height:1.65;color:#4b5563}
.public-identity .fact-cues{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 0;padding:0;list-style:none}
.public-identity .fact-cues li{padding:5px 10px;border-radius:999px;background:#f4f8ff;color:#1e40af;font-size:14px;font-weight:600;line-height:1.4;border:1px solid #dbe7fb}
.sample-shell{margin-top:24px}
.sample-disclosure{border-top:1px solid #d8e0e8;border-bottom:1px solid #d8e0e8;background:#fff}
.sample-disclosure summary{display:flex;align-items:center;min-height:48px;padding:10px 4px;font-size:16px;font-weight:600;line-height:1.5;color:#1d4ed8;cursor:pointer;list-style-position:inside}
.sample-disclosure summary:hover{text-decoration:underline;text-underline-offset:3px}
.sample-disclosure summary:focus-visible{outline:3px solid #1d4ed8;outline-offset:3px;border-radius:4px}
.sample-expanded{padding:4px 0 22px;text-align:center}
.sample-expanded h2{margin:8px 0 16px;font-size:20px;line-height:1.5}
.sample-pair{display:flex;justify-content:center;align-items:flex-start;gap:28px;max-width:520px;margin:0 auto}
.sample-pair figure{width:min(220px,44%);margin:0}
.sample-pair figcaption{margin-bottom:8px;font-size:14px;font-weight:700;line-height:1.4}
.sample-pair img{display:block;width:100%;height:auto;aspect-ratio:210/297;object-fit:cover;object-position:top;background:#fff;border:1px solid #d8e0e8;border-radius:6px;box-shadow:0 3px 12px rgba(17,24,39,.08)}
.sample-caption{margin:16px auto 0;max-width:520px;font-size:14px;line-height:1.55;color:#4b5563}
.trust-footer{margin-top:44px;margin-bottom:32px;padding:22px 0;border-top:1px solid #d8e0e8;color:#4b5563}
.trust-footer p{margin:0;font-size:14px;line-height:1.65}
@media(max-width:959px){.public-shell{width:calc(100% - 40px)}}
@media(max-width:599px){.public-shell{width:calc(100% - 32px)}.public-identity{padding-top:16px;margin-bottom:16px}.public-identity .service-name{font-size:17px}.public-identity h1{font-size:24px;line-height:1.4}.public-identity .public-support{font-size:15px}.sample-shell{margin-top:20px}.sample-pair{flex-direction:column;align-items:center;gap:20px}.sample-pair figure{width:min(220px,100%)}.trust-footer{margin-top:40px}.sample-disclosure summary{min-height:48px}}
@media print{.public-shell{display:none!important}}
