/* handwriting.css — page layer for /handwriting-worksheet-generator/. The shell (header, controls,
   buttons, explainer, footer) is /assets/polyatic.css; this adds the green mat stage with the printed
   sheet lying on it (white in both themes: it is paper) and the form details. Built from polyatic's tokens. */
.hw-noscript{margin:1rem;padding:.875rem 1rem;border:1px solid var(--line);border-left:.25rem solid var(--accent);border-radius:.625rem;background:var(--surface)}
.hw-head h1{margin-bottom:.25rem}
.hw-free{margin:0 0 .625rem;font-size:.9375rem;font-weight:600;color:var(--ink-2)}

/* ---------- the stage ---------- */
.duo.hw-duo>.pane-result{position:static}
@media (min-width:920px){
  .duo.hw-duo{grid-template-columns:minmax(19rem,1fr) minmax(0,1fr)}
  .duo.hw-duo>.pane-result{position:sticky;top:1rem;align-self:start}
}
.hw-stage{color:var(--mat-ink);border-radius:var(--r);padding:.625rem .625rem .75rem;box-shadow:var(--shadow);min-width:0;
  background:repeating-linear-gradient(0deg,rgba(255,255,255,.05) 0 1px,transparent 1px 1.5rem),repeating-linear-gradient(90deg,rgba(255,255,255,.05) 0 1px,transparent 1px 1.5rem),linear-gradient(180deg,var(--mat),var(--mat-2))}
.hw-sheet{max-width:34rem;margin:0 auto}
/* desktop: the whole sheet and its Download button fit in one screen */
@media (min-width:920px){.hw-sheet{max-width:min(34rem,calc((100vh - 17rem) * .76))}}
.hw-sheet svg{display:block;width:100%;height:auto;background:#fff;border-radius:2px;box-shadow:0 1px 2px rgba(0,0,0,.35),0 10px 24px -12px rgba(0,0,0,.6)}
.hw-pager{display:flex;align-items:center;justify-content:center;gap:.75rem;margin:.5rem 0 0;font-size:.875rem;font-weight:600;font-variant-numeric:tabular-nums}
.hw-pager[hidden]{display:none}
.hw-pager .btn{min-width:2.75rem;padding:0 .5rem;font-size:1.25rem;line-height:1}
.hw-stage .btn:focus-visible,.hw-stage button:focus-visible{outline:2px solid var(--signal);outline-offset:2px}
.hw-actions{display:flex;flex-wrap:wrap;gap:.375rem;margin:.5rem 0 0}
.hw-actions .btn{flex:1 1 3.5rem;padding:0 .5rem;white-space:nowrap}
.hw-actions .btn.hw-main{flex:3 1 8.5rem;font-size:.9375rem}
.hw-stage .btn.ghost{color:var(--mat-ink);border-color:rgba(255,255,255,.4);background:transparent}
.hw-stage .btn:disabled{opacity:.6}
.hw-warn{margin:.5rem 0 0;padding:.5rem .625rem;border-radius:.5rem;font-size:.875rem;font-weight:600;line-height:1.45;color:#3b2a00;background:#ffe8a3;border:1px solid #e0b43c}
.hw-warn:empty{display:none}
.hw-cap{margin:.5rem 0 0;font-family:var(--mono);font-size:.6875rem;line-height:1.5;letter-spacing:.01em;color:var(--mat-muted)}
.hw-msg{margin:.5rem 0 0;font-size:.875rem;font-weight:600;line-height:1.45;color:var(--mat-ink)}
.hw-msg:empty{display:none}

/* ---------- settings ---------- */
.hw-form-h{margin:0 0 .75rem;font-size:1.1875rem}
.hw-form [hidden]{display:none!important}
.hw-form .modes button{padding:.5rem .125rem}
.hw-form .modes button small{display:block;font-weight:500;font-size:.6875rem;opacity:.8}
.hw-form .modes button:disabled{opacity:.4;cursor:not-allowed}
.hw-small.modes{margin:.5rem 0 .625rem}
/* five practise choices: on a phone, three over two rather than four and an orphan */
@media (max-width:26rem){#modeBtns button{flex-basis:30%}}
.hw-label{display:block;font-size:.875rem;font-weight:600;color:var(--ink-2);margin:0 0 .375rem}
.hw-opt{font-weight:500;color:var(--muted);font-size:.8125rem}
.hw-input{width:100%;box-sizing:border-box;font:inherit;font-size:1rem;color:var(--ink);background:var(--surface);border:1px solid var(--line-2);border-radius:.5rem;padding:.5rem .625rem}
.hw-input:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:transparent}
.hw-text{resize:vertical;min-height:5.5rem;line-height:1.45}
.hw-own{display:flex;gap:.75rem;font-size:.875rem;font-weight:600;color:var(--ink-2)}
.hw-own label{display:flex;align-items:center;gap:.375rem;flex:1}
.hw-own .hw-input{flex:1;min-width:0}
.hw-hint{margin:-.5rem 0 .75rem;font-size:.8125rem;color:var(--muted);line-height:1.5}
.hw-hint.hw-fixed{margin:0 0 .25rem}
.hw-hint:empty{display:none}
.hw-check{display:flex;gap:.5rem;align-items:flex-start;font-size:.875rem;line-height:1.45;color:var(--ink-2);cursor:pointer;margin:0 0 .75rem}
.hw-check input{margin-top:.2rem;accent-color:var(--accent);width:1rem;height:1rem;flex:none}
.hw-check input:disabled+*{opacity:.5}
.hw-range{display:flex;align-items:center;gap:.625rem;font-size:.875rem;font-weight:600;margin:0 0 .5rem;color:var(--ink-2)}
.hw-range span{min-width:7.5rem;font-variant-numeric:tabular-nums}
.hw-range input{flex:1;accent-color:var(--accent);min-height:2rem}
