.hero{border-radius:var(--r);padding:4px 2px}
.hero h2{margin:6px 0;font-size:24px}
.hero p{margin:0;color:var(--mute)}
.stage{display:grid;place-items:center;padding:4px 0}
/* The studio fills the screen: the preview stays put and only the tool panel scrolls. */
#view.studio{display:flex;flex-direction:column;gap:4px;padding-bottom:0;height:calc(100dvh - 135px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
#view.studio>*{flex:0 0 auto;min-width:0}
#view.studio>.panel{flex:1 1 0;min-height:120px;overflow-y:auto;overscroll-behavior:contain;align-content:start}
.stage canvas{max-width:100%;max-height:34dvh;border-radius:14px;box-shadow:0 8px 30px #0003;touch-action:none;background:repeating-conic-gradient(#ddd 0 25%,#fff 0 50%) 0 0/20px 20px}
.panel{display:grid;gap:10px;padding:8px 0}
.panel label{display:grid;grid-template-columns:110px 1fr;align-items:center;gap:8px;font-size:14px}
.swatch{width:38px;height:38px;min-height:38px;padding:0;border-radius:50%}
.pad{width:100%;aspect-ratio:3/4;max-height:66dvh;background:#fff;border-radius:var(--r);touch-action:none;display:block;margin:auto}
.letters{display:grid;grid-template-columns:repeat(auto-fill,minmax(62px,1fr));gap:8px}
.letters button{font-size:28px;aspect-ratio:1}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px;align-items:start}
.thumb{padding:4px;display:grid;gap:4px;min-width:0}
.thumb img,.thumb canvas{width:100%;height:auto;border-radius:9px;display:block}
.words{display:flex;flex-wrap:wrap;gap:6px}
.words button.styled{border-style:dashed;border-color:var(--brand2)}
.gallery>p{grid-column:1/-1}
@media (max-height:750px){
  .stage canvas{max-height:27dvh}
  #view.studio button{min-height:36px;padding-block:4px}
}
