/* hat.css — page layer for /christmas-hat-template/. The shell (header, controls, buttons,
   explainer, footer) is /assets/polyatic.css; this adds the cutting-mat stage with the finished hat
   (it keeps its own colours in both themes, like the printed sheet), the sheet preview, the
   Santa/elf and paper/sew toggles, and the pickers. Built from the site's tokens only. */
.ht-noscript{margin:1rem;padding:.875rem 1rem;border:1px solid var(--line);border-left:.25rem solid var(--accent);border-radius:.625rem;background:var(--surface)}
.ht-head h1{margin-bottom:.25rem}
.ht-head .sub{margin-bottom:.75rem}

/* ---------- the stage ---------- */
.duo.ht-duo>.pane-result{position:static}
.ht-stage{background:radial-gradient(120% 80% at 50% 0%,rgba(255,226,160,.12),transparent 60%),linear-gradient(180deg,var(--mat),var(--mat-2));
  color:var(--mat-ink);border-radius:var(--r);padding:.5rem .625rem .75rem;box-shadow:var(--shadow);min-width:0}
.ht-stage-h{font-family:var(--mono);font-size:.6875rem;font-weight:500;text-transform:uppercase;letter-spacing:.07em;color:var(--mat-muted);margin:0 0 .25rem;text-align:center}
.ht-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,5.25rem);gap:.5rem;align-items:center}
.ht-scene{line-height:0;height:clamp(11.5rem,50vw,20rem);display:flex;justify-content:center}
.ht-scene svg{height:100%;width:auto;max-width:100%;filter:drop-shadow(0 10px 14px rgba(0,0,0,.35))}
.ht-side{min-width:0;display:flex;flex-direction:column;gap:.375rem}
.ht-paper{line-height:0;display:flex;justify-content:center}
.ht-paper canvas{display:block;width:100%;height:auto;border-radius:2px;background:#fff;box-shadow:0 1px 0 rgba(0,0,0,.1),0 14px 30px -14px rgba(0,0,0,.6)}
.ht-pager{display:flex;align-items:center;justify-content:center;gap:.25rem;font-family:var(--mono);font-size:.6875rem;color:var(--mat-muted)}
.ht-pg{width:1.75rem;height:1.75rem;border-radius:.5rem;border:1px solid rgba(255,255,255,.3);background:transparent;color:var(--mat-ink);font:inherit;font-size:.9375rem;cursor:pointer}
.ht-pg:disabled{opacity:.35;cursor:default}
.ht-toggles{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.375rem;margin:.375rem 0 .5rem}
.ht-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.25rem;padding:.1875rem;border-radius:.625rem;background:rgba(0,0,0,.22)}
.ht-modes button{border:0;border-radius:.4375rem;background:transparent;color:var(--mat-ink);font:inherit;font-size:.8125rem;font-weight:600;padding:.375rem .25rem;cursor:pointer;min-width:0}
.ht-modes button.active{background:var(--mat-ink);color:var(--mat)}
.ht-modes button:focus-visible,.ht-pg:focus-visible,.ht-quick input:focus-visible{outline:2px solid var(--mat-ink);outline-offset:2px}
.ht-quick{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:.5rem;margin:0 0 .5rem}
.ht-quick label{display:flex;flex-direction:column;gap:.1875rem;font-size:.75rem;color:var(--mat-muted);min-width:0}
.ht-quick label[hidden]{display:none}
.ht-quick output{color:var(--mat-ink);font-family:var(--mono)}
.ht-quick input{width:100%;font:inherit;font-size:1rem;padding:.375rem .5rem;border-radius:.5rem;border:1px solid rgba(255,255,255,.4);background:rgba(0,0,0,.18);color:var(--mat-ink)}
.ht-quick input::placeholder{color:var(--mat-muted)}
.ht-dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.375rem}
.ht-dl .btn{padding-left:.375rem;padding-right:.375rem;font-size:.8125rem;min-width:0}
.ht-dl .btn:first-child{grid-column:1 / -1;font-size:.9375rem}
.ht-dl .btn:disabled{opacity:.55;cursor:not-allowed}
.ht-stage .btn.ghost{color:var(--mat-ink);border-color:rgba(255,255,255,.4);background:transparent}
.ht-summary{margin:.5rem 0 0;text-align:center;font-size:.8125rem;line-height:1.35;color:var(--mat-ink)}
.ht-msg{margin:.375rem 0 0;text-align:center;font-size:.8125rem;color:var(--mat-muted)}
.ht-msg:empty{display:none}

/* ---------- the form ---------- */
.ht-form-h{margin:0 0 .75rem;font-size:1.1875rem}
.ht-form [hidden]{display:none!important}
.ht-group>.field+.field,.ht-group+.field{margin-top:var(--field-gap,1rem)}
.ht-hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--muted);line-height:1.45}
.ht-hint:empty{display:none}
.ht-num{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.ht-num input{flex:0 0 7rem;min-width:0}
.ht-out{margin-left:auto;font-family:var(--mono);font-size:.875rem}
.ht-picks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.375rem;margin-top:.375rem}
.ht-picks button{display:flex;flex-direction:column;gap:.125rem;align-items:center;text-align:center;padding:.4375rem .25rem;border:1px solid var(--line);border-radius:.5rem;
  background:var(--surface-2);color:var(--ink);font:inherit;font-size:.8125rem;cursor:pointer;min-width:0}
.ht-picks b{font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.ht-picks span{font-size:.6875rem;color:var(--muted);line-height:1.3}
.ht-picks button:hover{border-color:var(--muted)}
.ht-picks button.active{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.ht-picks button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ht-designs{grid-template-columns:repeat(3,minmax(0,1fr))}
.ht-form textarea{width:100%;min-height:6rem}
.explainer table{border-collapse:collapse;width:100%;font-size:.875rem;margin:.5rem 0 1rem}
.explainer th,.explainer td{border-bottom:1px solid var(--line);padding:.375rem .5rem;text-align:left;vertical-align:top}
.explainer th{font-family:var(--mono);font-size:.75rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.ht-tablewrap{overflow-x:auto}

@media(min-width:920px){
  .duo.ht-duo{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);grid-template-areas:none}
  .duo.ht-duo>.pane-result,.duo.ht-duo>.pane-main{grid-area:auto}
  .ht-stage{position:sticky;top:1rem}
  .ht-row{grid-template-columns:minmax(0,1fr) minmax(0,9rem)}
  .ht-scene{height:22rem}
}
