/* wrap.css — page layer for /wrapping-paper-maker/. The shell (header, controls, buttons,
   explainer, footer) is /assets/polyatic.css; this adds the cutting-mat stage with the
   printed sheet on it, the pattern and colour pickers and the box-size helper.
   The sheet is the printed object, so it keeps its own colours in both themes. */
@font-face{font-family:"WPM Serif";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/classic.woff2) format("woff2")}
@font-face{font-family:"WPM Script";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/handwritten.woff2) format("woff2")}

.wp-noscript{margin:1rem;padding:.875rem 1rem;border:1px solid var(--line);border-left:.25rem solid var(--accent);border-radius:.625rem;background:var(--surface)}
.wp-head h1{margin-bottom:.25rem}
.wp-head .sub{margin-bottom:.875rem}

/* ---------- the stage ---------- */
.duo.wp-duo>.pane-result{position:static}
.wp-stage{background:radial-gradient(120% 80% at 50% 0%,rgba(255,196,120,.16),transparent 60%),linear-gradient(180deg,var(--mat),var(--mat-2));
  color:var(--mat-ink);border-radius:var(--r);padding:.75rem .875rem 1rem;box-shadow:var(--shadow);min-width:0}
.wp-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 .5rem;text-align:center}
.wp-paper{display:flex;justify-content:center;line-height:0}
.wp-paper canvas{display:block;max-width:100%;max-height:min(50vh,40rem);width:auto;height:auto;border-radius:2px;
  box-shadow:0 1px 0 rgba(0,0,0,.1),0 18px 40px -16px rgba(0,0,0,.6)}
.wp-summary{margin:.5rem 0;text-align:center;font-size:.875rem;color:var(--mat-ink)}
.wp-dl{display:flex;flex-wrap:wrap;gap:.5rem;max-width:30rem;margin:0 auto}
.wp-dl .btn{flex:1 1 11rem}
.wp-dl .btn:disabled{opacity:.6;cursor:progress}
.wp-stage .btn.ghost{color:var(--mat-ink);border-color:rgba(255,255,255,.4);background:transparent}
.wp-msg{margin:.5rem 0 0;text-align:center;font-size:.8125rem;color:var(--mat-muted)}
.wp-msg:empty{display:none}

/* ---------- the form ---------- */
.wp-form-h{margin:0 0 .75rem;font-size:1.1875rem}
.wp-hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--muted);line-height:1.45}
.wp-pats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.375rem}
.wp-pat{display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.3125rem .25rem;border:1px solid var(--line);border-radius:.5rem;
  background:var(--surface-2);color:var(--ink);font:inherit;font-size:.6875rem;font-weight:600;line-height:1.15;cursor:pointer;min-width:0}
.wp-pat img{display:block;width:100%;aspect-ratio:1;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.1)}
.wp-pat span{text-align:center}
.wp-pat:hover,.wp-theme:hover{border-color:var(--muted)}
.wp-pat.active,.wp-theme.active{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.wp-pat:focus-visible,.wp-theme:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.wp-themes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.375rem}
.wp-theme{display:flex;align-items:center;gap:.375rem;padding:.3125rem .375rem;border:1px solid var(--line);border-radius:.5rem;background:var(--surface-2);
  color:var(--ink);font:inherit;font-size:.6875rem;font-weight:600;line-height:1.15;text-align:left;cursor:pointer;min-width:0}
.wp-sw{flex:none;width:1.625rem;height:1.625rem;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.18);display:grid;place-items:center}
.wp-sw i{display:block;width:.5rem;height:.5rem;border-radius:50%}
.wp-fonts{max-width:14rem;margin-top:.5rem}
.wp-photo{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.wp-file{position:relative;cursor:pointer}
.wp-file input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.wp-file:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.wp-photo canvas{border-radius:50%;width:2.75rem;height:2.75rem}
.wp-photo [hidden]{display:none}
.wp-linkbtn{border:0;background:none;padding:0;font:inherit;font-size:.875rem;color:var(--accent);text-decoration:underline;cursor:pointer}
.wp-check{display:flex;gap:.5rem;align-items:flex-start;font-size:.875rem;line-height:1.4;cursor:pointer}
.wp-check input{margin-top:.2rem;flex:none;width:1.05rem;height:1.05rem;accent-color:var(--accent)}
.wp-marks{align-self:end}
.wp-form input[type=number]{max-width:8rem}

/* ---------- box-size helper ---------- */
.wp-box{margin-top:1.25rem}
.wp-box h2{margin:0 0 .25rem;font-size:1.1875rem}
.wp-box-in{display:flex;flex-wrap:wrap;align-items:end;gap:.5rem;margin:.75rem 0 .5rem}
.wp-box-in label{display:flex;flex-direction:column;gap:.25rem;font-family:var(--mono);font-size:.75rem;color:var(--muted)}
.wp-box-in input{width:5.25rem}
.wp-box-in>span{padding-bottom:.6rem;color:var(--muted)}
.wp-unit{width:6.5rem}
.wp-box-out{margin:.5rem 0;font-size:1rem;line-height:1.5}
.wp-box-out b{font-family:var(--mono)}
.wp-box .btn{margin:.25rem 0 .25rem}
.wp-box [hidden]{display:none}

@media(min-width:920px){
  .duo.wp-duo{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:none}
  .duo.wp-duo>.pane-result,.duo.wp-duo>.pane-main{grid-area:auto}
  .wp-stage{position:sticky;top:1rem}
  .wp-paper canvas{max-height:min(64vh,44rem)}
}
@media(max-width:360px){.wp-pats{grid-template-columns:repeat(4,minmax(0,1fr))}.wp-themes{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.wp-themes{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---------- pattern groups, birthday quick start (2026-10-19) ---------- */
.wp-patgroups{display:flex;flex-direction:column;gap:.375rem}
.wp-group{margin:.25rem 0 0;font-family:var(--mono);font-size:.6875rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.wp-bday-row{display:flex;flex-wrap:wrap;gap:.5rem}
.wp-bday-row input{flex:1 1 10rem;min-width:0}
.wp-bday-row .btn{flex:0 1 auto}
