/* QR Code Merch shirt editor. Mobile first; every control is at least 44px to tap. */
@font-face{font-family:"QM Inter";src:url(/fonts/inter.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Anton";src:url(/fonts/anton.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Bebas";src:url(/fonts/bebas.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Oswald";src:url(/fonts/oswald.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Stencil";src:url(/fonts/stencil.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Bangers";src:url(/fonts/bangers.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Marker";src:url(/fonts/marker.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Pacifico";src:url(/fonts/pacifico.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Lobster";src:url(/fonts/lobster.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Playfair";src:url(/fonts/playfair.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Slab";src:url(/fonts/slab.woff2) format("woff2");font-display:swap}
@font-face{font-family:"QM Pixel";src:url(/fonts/pixel.woff2) format("woff2");font-display:swap}
/* 494 KB, so it only downloads once someone actually types an emoji (unicode-range). Digits, # and * stay in the text font. */
@font-face{font-family:"QM Emoji";src:url(/fonts/emoji.woff2) format("woff2");font-display:swap;unicode-range:U+00A9,U+00AE,U+203C,U+2049,U+2122,U+2139,U+2194-21AA,U+231A-23FF,U+24C2,U+25AA-25FE,U+2600-27BF,U+2934-2935,U+2B05-2B55,U+3030,U+303D,U+3297,U+3299,U+FE0F,U+1F000-1FAFF}

.ed{--ed-bg:var(--card,#fff);--ed-fg:var(--fg,#121214);--ed-mut:var(--mut,#5d5e66);--ed-line:var(--line,#dcdbd3);--ed-acc:var(--acc,#ffd60a);--ed-chip:var(--bg,#f6f5f1);
  display:flex;flex-direction:column;gap:8px;min-width:0;position:relative;-webkit-user-select:none;user-select:none}
.ed *{box-sizing:border-box}
.ed button{font:inherit;color:inherit}
.ed-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}
.ed-sides{display:inline-flex;background:var(--ed-chip);border:1.5px solid var(--ed-line);border-radius:12px;padding:3px}
.ed-sides button{border:0;background:none;padding:8px 16px;border-radius:9px;font-weight:800;cursor:pointer;min-height:38px;position:relative;touch-action:manipulation}
.ed-sides button[aria-selected=true]{background:var(--ed-acc);color:#0d0d10}
.ed-sides button.has:after{content:"";position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.6}
.ed-hist{display:flex;gap:6px}

.ed-hist button,.ed-done{border:1.5px solid var(--ed-line);background:var(--ed-chip);border-radius:12px;min-width:44px;height:44px;font-size:1.25rem;line-height:1;cursor:pointer;touch-action:manipulation}
.ed-hist button:disabled{opacity:.35;cursor:default}
.ed-done{font-size:1rem;font-weight:800;padding:0 16px;background:var(--ed-acc);color:#0d0d10;border-color:transparent}
.ed-stage{position:relative;aspect-ratio:1/1.08;width:100%;border-radius:14px;overflow:hidden;touch-action:none;outline:none;
  background:radial-gradient(circle at 50% 35%,var(--bg2,#ecebe5),var(--bg,#f6f5f1));border:1px solid var(--ed-line)}
.ed-stage:focus-visible{box-shadow:0 0 0 3px var(--ed-acc)}
.ed-stage.drop{box-shadow:inset 0 0 0 3px var(--ed-acc)}
.ed-svg{display:block;width:100%;height:100%;cursor:default}
.ed-layer{cursor:move}
.ed-h{cursor:pointer}
.ed-h[data-h=nw],.ed-h[data-h=se]{cursor:nwse-resize}.ed-h[data-h=ne],.ed-h[data-h=sw]{cursor:nesw-resize}.ed-h[data-h=e],.ed-h[data-h=w]{cursor:ew-resize}.ed-h[data-h=rot]{cursor:grab}
.ed-tap{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:flex-end;padding:10px;pointer-events:none}
.ed-tap span{background:rgba(13,13,16,.82);color:#fff;font-weight:800;padding:7px 13px;border-radius:999px;font-size:.82rem;box-shadow:0 6px 18px rgba(0,0,0,.25)}
.ed-inline{position:absolute;inset:0;pointer-events:none}
.ed-wrap{position:absolute;width:0;height:0;pointer-events:auto}
.ed-ta{position:absolute;margin:0;padding:0 2px;border:0;outline:1.5px dashed #2f8cff;outline-offset:2px;background:rgba(47,140,255,.06);resize:none;overflow:hidden;
  white-space:pre-wrap;overflow-wrap:break-word;transform-origin:0 0;-webkit-user-select:text;user-select:text;caret-color:#2f8cff;border-radius:2px;font-kerning:normal}
.ed-ta.halo{text-shadow:0 0 1px rgba(127,127,127,.6)}
.ed-ta-done{position:absolute;right:10px;top:10px;pointer-events:auto;background:var(--ed-acc);color:#0d0d10;border:0;border-radius:999px;padding:9px 16px;font-weight:800;box-shadow:0 4px 14px rgba(0,0,0,.2);cursor:pointer}
.ed-msg{min-height:1.4em;font-size:.88rem;line-height:1.35;padding:0 2px}
.ed-msg .ed-fix{margin:2px 0 0 6px;font:inherit;font-size:.82rem;font-weight:800;padding:4px 11px;border-radius:999px;border:0;background:var(--ed-acc);color:#0d0d10;cursor:pointer}
.ed-msg .bad{color:var(--err,#b3261e);font-weight:700}.ed-msg .warn{color:#b26a00;font-weight:700}.ed-msg .mut{color:var(--ed-mut)}
@media(prefers-color-scheme:dark){.ed-msg .warn{color:#ffb547}}
.ed-tools{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px 0 4px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.ed-tools::-webkit-scrollbar{display:none}
.ed-t{flex:1 0 auto;min-width:64px;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1.5px solid var(--ed-line);background:var(--ed-chip);
  border-radius:12px;padding:6px 8px;cursor:pointer;font-size:.75rem;font-weight:700;scroll-snap-align:start;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.ed .ed-t svg{width:22px;height:22px;max-width:none}
.ed-t[data-primary]{background:var(--ed-acc);color:#0d0d10;border-color:transparent}
.ed-t[aria-pressed=true]{border-color:var(--ed-fg)}
.ed-t:disabled{opacity:.4;cursor:default}
.ed-sub{background:var(--ed-bg);border:1.5px solid var(--ed-line);border-radius:14px;padding:10px;max-height:40vh;overflow:auto}
.ed-fonts{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:6px}
.ed-font{border:1.5px solid var(--ed-line);background:var(--ed-chip);border-radius:10px;padding:8px 6px;cursor:pointer;min-height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;touch-action:manipulation}
.ed-font b{font-weight:400;font-size:1.25rem;line-height:1.15;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ed-font small{font-family:Inter,system-ui,sans-serif;font-size:.68rem;color:var(--ed-mut);font-weight:600}
.ed-font[aria-pressed=true]{border-color:var(--ed-acc);box-shadow:0 0 0 2px var(--ed-acc)}
.ed-colors{display:flex;flex-wrap:wrap;gap:8px}
.ed-sw{width:40px;height:40px;border-radius:50%;background:var(--c);border:2px solid var(--ed-line);box-shadow:inset 0 0 0 3px var(--ed-bg);cursor:pointer;padding:0;position:relative;touch-action:manipulation}
.ed-sw[aria-pressed=true]{border-color:var(--ed-fg);box-shadow:inset 0 0 0 3px var(--ed-bg),0 0 0 2px var(--ed-acc)}
.ed-custom{background:conic-gradient(red,yellow,lime,cyan,blue,magenta,red);display:grid;place-items:center;overflow:hidden}
.ed-custom input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
.ed-custom span{font-weight:900;color:#fff;text-shadow:0 1px 2px #000;pointer-events:none}
.ed-row{display:flex;flex-wrap:wrap;gap:6px}
.ed-chip{border:1.5px solid var(--ed-line);background:var(--ed-chip);border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer;min-height:44px;touch-action:manipulation}
.ed-chip[aria-pressed=true]{background:var(--ed-acc);color:#0d0d10;border-color:transparent}
.ed-slide{display:grid;grid-template-columns:auto 1fr 64px;align-items:center;gap:10px;font-size:.85rem;font-weight:700;padding:4px 0}
.ed-slide input{width:100%;height:36px;accent-color:var(--ed-acc)}
.ed-slide output{text-align:right;font-variant-numeric:tabular-nums;color:var(--ed-mut)}
.ed.busy .ed-stage:after{content:"";position:absolute;inset:0;background:rgba(255,255,255,.35);animation:edpulse 1s ease-in-out infinite alternate}
@keyframes edpulse{from{opacity:.2}to{opacity:.7}}

/* Phones: full-screen editor. The stage gets every pixel it can; tools sit where thumbs are. */
html.ed-lock,html.ed-lock body{overflow:hidden;overscroll-behavior:none}
.ed.ed-full{position:fixed;left:0;right:0;top:0;height:100vh;height:100dvh;z-index:1000;background:var(--bg,#f6f5f1);
  padding:calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));gap:6px}
.ed.ed-full .ed-stage{flex:1 1 auto;aspect-ratio:auto;min-height:0;border-radius:12px}
.ed.ed-full .ed-tools{flex:none}
.ed.ed-full .ed-sub{flex:none;max-height:34vh}
.ed.ed-full.typing .ed-tools,.ed.ed-full.typing .ed-sub,.ed.ed-full.typing .ed-msg{display:none}
@media(max-width:820px){
  .ed-t{min-width:60px;font-size:.72rem}
  /* compact pickers so the shirt stays big: fonts and colours scroll sideways */
  .ed-sub{padding:8px}
  .ed-fonts{grid-auto-flow:column;grid-template-columns:none;grid-template-rows:repeat(2,52px);grid-auto-columns:98px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
  .ed-fonts::-webkit-scrollbar,.ed-colors::-webkit-scrollbar{display:none}
  .ed-font{min-height:0;padding:4px}
  .ed-font b{font-size:1.1rem}
  .ed-colors{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:2px}
  .ed-sw{flex:none}
  .ed-row{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .ed-chip{flex:none}
  .ed-hist .ed-zoom{display:none}
  .ed.ed-full .ed-hist .ed-zoom{display:inline-block}
}
@media(min-width:821px){
  .ed-stage{aspect-ratio:1/1.02}
  .ed-t{flex:0 0 auto}
}
@media(max-width:400px){
  .ed-bar{gap:4px}.ed-sides button{padding:8px 10px}.ed-hist{gap:4px}.ed-hist button{min-width:40px;height:42px}
  .ed .ed-done{padding:0 10px;min-width:0}
  .ed.ed-full .ed-hist .ed-zoom{display:none}
}
@media(prefers-reduced-motion:reduce){.ed.busy .ed-stage:after{animation:none}}

/* Phones: four tools fit across instead of cutting the last one off; longer rows still
   scroll sideways, with a fade hinting there's more. */
@media(max-width:820px){
  .ed-tools:not(:has(>.ed-t:nth-child(5))) .ed-t{flex:1 1 0;min-width:0}
  .ed-tools:has(>.ed-t:nth-child(5)){-webkit-mask-image:linear-gradient(90deg,#000 86%,transparent);mask-image:linear-gradient(90deg,#000 86%,transparent)}
  .ed-tools:has(>.ed-t:nth-child(5))::after{content:"";flex:0 0 28px}
}
/* While typing, the typing box's own Done is the only Done on screen. */
.ed.typing .ed-done{visibility:hidden}
/* "+ Add your words here" target on an empty shirt */
.ed-ghost{cursor:pointer}
.ed-ghost:hover rect{fill:rgba(255,214,10,.24)}
