/* Lined paper + handwriting section (2026-11-20). Exercise-book paper, school-blue ink. Built from the multiplication section's sheet. */
:root{--paper:#f7f4ec;--sheet:#fff;--ink:#1d2433;--ink2:#3a4356;--muted:#5b6474;--line:#e3ddcf;--line2:#cfc7b5;--blue:#1f4e8c;--blue2:#e4edf9;--sq:#fff1c9;--sqb:#f2d58a;--good:#2f7d4f;--goodbg:#e2f3e8;--bad:#b3412e;--font:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.55 var(--font);
  background-image:linear-gradient(90deg,transparent 0 46px,#f0c9c4 46px 47px,transparent 47px),repeating-linear-gradient(transparent 0 31px,#ebe5d6 31px 32px)}
a{color:var(--blue)}
.wrap{max-width:1080px;margin:0 auto;padding:0 18px}
.muted{color:var(--muted)}.small{font-size:.86rem}
.mast{background:var(--sheet);border-bottom:1px solid var(--line)}
.mast-in{display:flex;align-items:center;gap:18px;min-height:58px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:.55rem;text-decoration:none;color:var(--ink);font-weight:750;font-size:1.06rem}
.brand .mark{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:7px;background:var(--blue);color:#fff;font-size:1.25rem;line-height:1}
.brand small{font-weight:500;font-size:.8rem;color:var(--muted)}
.brand small::before{content:"/";margin-right:.4rem;color:var(--line2)}
.top{display:flex;gap:2px;margin-left:auto;overflow-x:auto;scrollbar-width:none;max-width:100%}
.top::-webkit-scrollbar{display:none}
.top a{flex:none;text-decoration:none;color:var(--ink2);font-size:.9rem;font-weight:600;padding:.4rem .65rem;border-radius:7px}
.top a:hover{background:var(--paper)}
.top a[aria-current]{background:var(--blue2);color:var(--blue)}
@media(max-width:820px){.mast-in{padding:6px 0}.top{margin-left:0;width:100%}}
.crumbs{font-size:.84rem;color:var(--muted);margin:.9rem 0 0}
.crumbs a{color:var(--ink2);text-decoration:none}.crumbs a:hover{text-decoration:underline}
.intro{padding:.4rem 0 .6rem}
.intro h1{font-size:clamp(1.7rem,4.2vw,2.5rem);line-height:1.15;margin:.3rem 0 .4rem;letter-spacing:-.01em}
.lede{font-size:1.07rem;color:var(--ink2);max-width:46rem;margin:0}
.panel{background:var(--sheet);border:1px solid var(--line);border-radius:14px;padding:20px;margin:18px 0;box-shadow:0 1px 0 rgba(0,0,0,.03)}
.panel h2{font-size:1.25rem;margin:0 0 .6rem}
.narrow{max-width:780px}
.panel ul,.panel ol{padding-left:1.2rem}.panel li{margin:.35rem 0}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:44px;padding:.55rem 1.1rem;border-radius:10px;border:1px solid var(--blue);background:var(--blue);color:#fff;font:600 1rem var(--font);text-decoration:none;cursor:pointer}
.btn:hover{filter:brightness(1.08)}
.btn.ghost{background:#fff;color:var(--blue)}
.btn.big{min-height:52px;font-size:1.1rem;padding:.6rem 2rem;margin-top:.8rem}
.btns{display:flex;gap:8px;flex-wrap:wrap;margin:.9rem 0 .4rem}
.linkbtn{background:none;border:0;color:var(--blue);font:inherit;text-decoration:underline;cursor:pointer;padding:0}
.seg{display:inline-flex;flex-wrap:wrap;gap:4px;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:3px}
.seg button{border:0;background:none;font:600 .92rem var(--font);color:var(--ink2);padding:.45rem .75rem;border-radius:7px;cursor:pointer;min-height:38px}
.seg button[aria-pressed="true"]{background:#fff;color:var(--blue);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.tick{display:inline-flex;align-items:center;gap:.4rem;font-weight:600;font-size:.92rem;cursor:pointer}
.tick input{width:18px;height:18px;accent-color:var(--blue)}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:.3rem 0 .6rem}
.chip input{position:absolute;opacity:0;pointer-events:none}
.chip span{display:inline-grid;place-items:center;min-width:40px;height:40px;padding:0 .5rem;border-radius:9px;border:1px solid var(--line2);background:#fff;font-weight:700;cursor:pointer;user-select:none}
.chip input:checked+span{background:var(--blue);border-color:var(--blue);color:#fff}
.chip input:focus-visible+span{outline:2px solid var(--blue);outline-offset:2px}
.lab{font-weight:650;font-size:.92rem;margin:.6rem 0 0}

/* maker */
.maker-in{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:24px;align-items:start}
@media(max-width:820px){.maker-in{grid-template-columns:1fr}}
.maker-opts label:not(.tick):not(.chip){display:block;font-weight:650;font-size:.92rem;margin:.55rem 0}
.maker-opts select{display:block;width:100%;margin-top:.25rem;min-height:42px;border:1px solid var(--line2);border-radius:9px;padding:.4rem .6rem;font:inherit;background:#fff}
.maker-opts .tick{margin:.5rem 1rem .3rem 0}
.maker-prev{margin:0;background:#e9e4d6;border-radius:12px;padding:14px;display:grid;place-items:center}
.maker-prev svg{width:100%;max-width:440px;height:auto;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.18)}
[data-show][hidden]{display:none!important}

/* gallery */
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:14px;margin:18px 0}
.gcard{display:flex;flex-direction:column;gap:4px;background:var(--sheet);border:1px solid var(--line);border-radius:12px;padding:10px;text-decoration:none;color:var(--ink)}
.gcard:hover{border-color:var(--blue)}
.gcard img{width:100%;height:auto;aspect-ratio:612/792;border:1px solid #eee;background:#fff}
.gcard b{font-size:.95rem;margin-top:4px}.gcard span{font-size:.82rem;color:var(--muted)}

.faq details{border-bottom:1px solid var(--line);padding:.6rem 0}
.faq summary{font-weight:650;cursor:pointer}
.faq details p{margin:.5rem 0 .2rem;color:var(--ink2)}

/* footer */
.foot{background:var(--sheet);border-top:1px solid var(--line);margin-top:34px;padding:26px 0 18px;font-size:.92rem}
.foot-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:18px}
.foot-h{font-weight:750;margin:0 0 .3rem}
.foot ul{list-style:none;padding:0;margin:0}.foot li{margin:.22rem 0}
.foot a{color:var(--ink2);text-decoration:none}.foot a:hover{text-decoration:underline;color:var(--blue)}
.tabs a{display:inline-block;min-width:28px;text-align:center;padding:.1rem .2rem;border:1px solid var(--line);border-radius:6px;margin:2px}
@media print{.mast,.crumbs,.foot,.maker,.game,.gal,.faq,.peel,.chart-tools,.readout,.known-line{display:none!important}body{background:#fff}.chartbox{border:0}}

/* writing section */
.brand .mark{font-size:1.05rem}
.maker-opts textarea{display:block;width:100%;margin-top:.25rem;border:1px solid var(--line2);border-radius:9px;padding:.5rem .6rem;font:inherit;background:#fff;resize:vertical}
.hint{font-size:.82rem;color:var(--muted);margin:.2rem 0 .4rem}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.maker-prev{min-height:240px}
.maker-prev.busy svg{opacity:.55}
.tscroll{overflow-x:auto}
table.facts{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums;font-size:.95rem}
table.facts th,table.facts td{text-align:left;padding:.45rem .6rem;border-bottom:1px solid #eef0f4}
table.facts th{font-size:.85rem;color:var(--muted)}
.lcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin:18px 0}
.lcard{display:flex;flex-direction:column;align-items:center;gap:2px;background:var(--sheet);border:1px solid var(--line);border-radius:12px;padding:8px 6px 10px;text-decoration:none;color:var(--ink)}
.lcard:hover{border-color:var(--blue)}
.lcard svg{width:100%;height:auto}
.lcard span{font-size:.86rem;font-weight:650;color:var(--ink2)}
.artbox{margin:0 0 .6rem;overflow-x:auto}
.artbox svg{max-width:100%;height:auto}
.letterhero .lh-in{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.letterhero figure,.wordrow figure{margin:0;text-align:center}
.letterhero svg{width:100%;max-width:300px;height:auto}
.letterhero figcaption,.wordrow figcaption{font-size:.9rem;font-weight:650;color:var(--muted)}
.lfacts{margin:.8rem 0 0}
.wordrow{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.wordrow svg{width:100%;height:auto}
.gen textarea{display:block;width:100%;border:1px solid var(--line2);border-radius:10px;padding:.6rem .7rem;font:1.1rem/1.4 var(--font);background:#fff;resize:vertical}
.genlab{font-weight:700;display:block;margin-bottom:.3rem}
.gen-opts{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:end;margin:.7rem 0}
.gen-opts label:not(.tick){font-weight:650;font-size:.92rem}
.gen-opts select{display:block;margin-top:.2rem;min-height:40px;border:1px solid var(--line2);border-radius:9px;padding:.3rem .5rem;font:inherit;background:#fff}
.genout{margin:0;background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px;min-height:120px;overflow-x:auto}
.genout svg{max-width:100%;height:auto;display:block}
.hubs{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px;margin:18px 0}
.hub{display:flex;flex-direction:column;gap:3px;background:var(--sheet);border:1px solid var(--line);border-radius:12px;padding:14px 16px;text-decoration:none;color:var(--ink)}
.hub:hover{border-color:var(--blue)}
.hub b{font-size:1.05rem;color:var(--blue)}.hub span{font-size:.88rem;color:var(--muted)}
@media(max-width:560px){.pair{grid-template-columns:1fr}.letterhero .lh-in{grid-template-columns:1fr 1fr;gap:6px}}
@media print{.mast,.crumbs,.foot,.maker,.gal,.faq,.gen,.hubs{display:none!important}body{background:#fff}}

.maker-prev{display:flex;flex-direction:column;gap:12px;align-items:center}
@media(max-width:700px){body{background-image:repeating-linear-gradient(transparent 0 31px,#ebe5d6 31px 32px)}}
