/* Flag Studio — customer screens. Phone first (375 x 667), works 320 -> 1440; desktop >= 1024 puts
   the flag left and the controls right. Brand: dark UI, purple pill buttons, mint only for things
   you can tap / selection / focus, gold for stars, red only for real problems. */

@font-face { font-family: "Michroma"; src: url("../fonts/Michroma-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url("../fonts/IBMPlexSansCondensed-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url("../fonts/IBMPlexSansCondensed-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #121316;
  --panel: #1A1B20;
  --panel-2: #22232A;
  --line: #2A2B33;
  --text: #E5E7F3;
  --muted: #9AA0B4;
  --purple: #5333B2;
  --grad-a: #6A46E0;
  --grad-b: #4A2BB8;
  --mint: #06EDC3;
  --gold: #F5B700;
  --red: #FF5A5F;
  --green: #3DDC84;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 170ms;
  --ui: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --head: "Michroma", "IBM Plex Sans Condensed", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--ui); font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.ico { width: 22px; height: 22px; flex: none; }

/* ------------------------------------------------------------------ type */
.title, .brand, .sheet-title, .group-label, .checklist h3, .back-choice legend {
  font-family: var(--head); text-transform: uppercase; letter-spacing: .05em; font-weight: 400;
}
.title { font-size: 20px; line-height: 1.3; margin: 0 0 6px; }
.tagline { color: var(--muted); margin: 0 0 18px; }
.fine { color: var(--muted); font-size: 14px; margin: 6px 0; }
.lead { font-size: 18px; margin: 4px 0 8px; }
.group-label { font-size: 11px; color: var(--muted); margin: 18px 0 8px; }
.trust { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 14px; margin: 18px 0 8px; }
.trust .ico { color: var(--gold); width: 18px; height: 18px; }
.trust.small { font-size: 12px; margin: 6px 0 0; }
.promise { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 15px; margin: 14px 0; }
.promise .ico { color: var(--gold); width: 18px; height: 18px; margin-top: 2px; }

/* ------------------------------------------------------------------ app frame */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 8px 0 14px;
  padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.is-embed .topbar { padding-left: 4px; }
.brand { font-size: 13px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 12px; color: var(--text);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t);
}
.icon-btn:hover:not(:disabled) { background: var(--panel-2); }
.icon-btn:disabled { opacity: .35; }
.save-pill { font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.save-pill.warn { color: var(--gold); border-color: rgba(245, 183, 0, .45); }
.save-pill.muted { opacity: .8; }

.product-bar {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%;
  min-height: 52px; padding: 7px 16px; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: var(--panel); transition: background var(--t);
}
.product-bar:hover { background: var(--panel-2); }
.product-main { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.product-main .chev { color: var(--mint); display: inline-flex; }
.product-main .chev .ico { width: 18px; height: 18px; }
.product-sub { font-size: 12px; color: var(--muted); }

.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen-start, .screen-designers, .screen-review, .screen-error { padding: 20px 16px 32px; }
.screen-loading, .screen-error { align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 14px; }
.loader { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--mint); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; font-weight: 700;
  box-shadow: 0 6px 18px rgba(83, 51, 178, .35);
  transition: transform var(--t) var(--ease), filter var(--t), opacity var(--t), box-shadow var(--t);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; box-shadow: none; }
.btn-primary.is-disabled { opacity: .6; }
.btn-primary.is-busy { opacity: .75; pointer-events: none; }
.btn-primary.block { display: flex; width: 100%; margin-top: 16px; }
.btn-primary.big { min-height: 54px; font-size: 17px; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: border-color var(--t), background var(--t);
}
.btn-ghost:hover { border-color: var(--mint); }
.btn-ghost.danger, .mini-btn.danger, .menu-item.danger { color: var(--red); }
.link-btn { border: 0; background: none; color: var(--mint); padding: 10px 4px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.back-link { text-decoration: none; margin: -8px 0 8px -4px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 16px; }

/* ------------------------------------------------------------------ inputs */
.input {
  width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); transition: border-color var(--t);
}
.input:focus { border-color: var(--mint); outline: none; }
.input.big { font-size: 20px; padding: 14px 16px; }
textarea.input { resize: vertical; min-height: 72px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }
.field-mic { position: relative; display: flex; gap: 6px; align-items: flex-start; }
.field-mic .input { flex: 1; }
.mic.listening { color: var(--red); background: rgba(255, 90, 95, .12); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 90, 95, .15); } }
.tick { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 700; }
.tick input { width: 24px; height: 24px; accent-color: var(--mint); flex: none; }
.tick.radio { font-weight: 400; }
.form-error { color: var(--red); font-weight: 700; margin: 12px 0 0; }

/* ------------------------------------------------------------------ start screen */
.start-hero { text-align: center; margin: 6px 0 18px; }
.doors { display: flex; flex-direction: column; gap: 12px; }
.door {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 14px 16px;
  text-align: left; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
  transition: border-color var(--t), transform var(--t) var(--ease), background var(--t);
}
.door:hover { border-color: rgba(6, 237, 195, .6); }
.door:active { transform: scale(.99); }
.door[aria-expanded="true"] { border-color: var(--mint); }
.door-ico {
  width: 46px; height: 46px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(106, 70, 224, .35), rgba(74, 43, 184, .25)); color: var(--mint);
}
.door-ico.small { width: 38px; height: 38px; }
.door-text { display: flex; flex-direction: column; }
.door-text strong { font-size: 17px; }
.door-sub { color: var(--muted); font-size: 14px; display: block; }
.door-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 6px; animation: rise var(--t) var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.ideas { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ideas::-webkit-scrollbar { display: none; }
.idea {
  flex: 0 0 auto; width: 92px; min-height: 92px; scroll-snap-align: start; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); padding: 10px 6px; transition: border-color var(--t), transform var(--t) var(--ease);
}
.idea:hover { border-color: rgba(6, 237, 195, .6); }
.idea:active { transform: scale(.97); }
.idea-ico { color: var(--mint); }
.idea-label { font-size: 14px; font-weight: 700; text-align: center; }
.designers-door {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 12px 14px; min-height: 60px;
  text-align: left; border: 1px dashed var(--line); border-radius: var(--radius); background: transparent;
}
.designers-door:hover { border-color: var(--mint); }
.designers-door strong { display: block; font-size: 15px; }

/* ------------------------------------------------------------------ editor */
.screen-editor { position: relative; }
.stage-wrap {
  position: relative; flex: 1 1 auto; min-height: 46vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(120, 112, 170, .22), rgba(18, 19, 22, 0) 70%), var(--bg);
  overflow: hidden;
}
.stage {
  position: relative; width: 300px; height: 180px; touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4); background: #fff; outline-offset: 6px;
}
.flag-svg, .svg-buffer { position: absolute; inset: 0; }
.svg-buffer > svg { display: block; width: 100%; height: 100%; }
.flag-svg [id$="-guides"] { opacity: .45; transition: opacity var(--t); }
.stage.dragging .flag-svg [id$="-guides"] { opacity: 1; }
.pole {
  position: absolute; left: -11px; top: -14px; bottom: -22%; width: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #5B6068, #D9DCE2 45%, #6B7078); opacity: .75; pointer-events: none;
}
.pole::before { content: ""; position: absolute; left: -3px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #F4F5F8, #7C818A); }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.sel-box { position: absolute; border: 2px dashed var(--mint); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.sel-handle {
  position: absolute; width: 44px; height: 44px; transform: translate(-50%, -50%); pointer-events: auto; cursor: nwse-resize; touch-action: none;
}
.sel-handle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--mint); border: 3px solid var(--bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.ph-pill {
  position: absolute; transform: translate(-50%, -50%); max-width: 90%; padding: 5px 12px; border-radius: 999px;
  border: 1.5px dashed var(--mint); background: rgba(18, 19, 22, .82); color: var(--text); font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.qdot {
  position: absolute; width: 44px; height: 44px; min-width: 44px; min-height: 44px; transform: translate(-50%, -50%); border: 0; padding: 0;
  background: transparent; pointer-events: auto; box-sizing: border-box;
}
.qdot::after, .qdot-mark {
  content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.qdot::after { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.q-sharp.qdot::after, .q-sharp .qdot-mark { background: var(--green); }
.q-ok.qdot::after, .q-ok .qdot-mark { background: var(--gold); }
.q-blurry.qdot::after, .q-blurry .qdot-mark { background: var(--red); }
.snap-v, .snap-h { position: absolute; background: var(--mint); opacity: .8; pointer-events: none; }
.snap-v { top: 0; bottom: 0; width: 1px; }
.snap-h { left: 0; right: 0; height: 1px; }
.safe-label {
  position: absolute; transform: translateY(-100%); padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: #00B8D9; color: #04121A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.upload-ring {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--mint) var(--p, 0deg), rgba(255, 255, 255, .18) 0); box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.upload-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: rgba(18, 19, 22, .9); }
.upload-pct { position: relative; font-weight: 700; font-size: 15px; }
.busy {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(18, 19, 22, .72); text-align: center; padding: 20px; z-index: 5;
}

.controls { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.chips, .minibar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .minibar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(6, 237, 195, .5); background: var(--panel); color: var(--text); font-weight: 700; font-size: 15px;
  white-space: nowrap; transition: border-color var(--t), background var(--t);
}
.chip .ico { width: 18px; height: 18px; color: var(--mint); }
.chip:hover { border-color: var(--mint); background: var(--panel-2); }
.chip-fun .ico { color: var(--gold); }
.mini-btn {
  flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 64px; min-height: 54px; padding: 4px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  font-size: 12px; font-weight: 700; transition: border-color var(--t);
}
.mini-btn:hover { border-color: var(--mint); }
.mini-btn .ico { width: 20px; height: 20px; }
.mini-btn.done { border-color: rgba(6, 237, 195, .5); color: var(--mint); }
.bottom-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.askbar {
  flex: 1 1 260px; display: flex; align-items: center; gap: 2px; min-height: 50px; padding: 3px 4px 3px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); transition: border-color var(--t);
}
.askbar:focus-within { border-color: var(--mint); }
.ask-input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 16px; padding: 8px 0; outline: none; }
.ask-input::placeholder { color: var(--muted); }
.askbar .send { color: var(--mint); }
.looks-good { flex: 1 0 auto; }

/* ------------------------------------------------------------------ sheets */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity var(--t); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
  padding: 6px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 200ms var(--ease);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
}
.sheet-root.open .sheet { transform: none; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-tall { min-height: 60vh; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 8px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; position: sticky; top: -6px; background: var(--panel); padding: 6px 0 4px; z-index: 1; }
.sheet-title { font-size: 15px; margin: 10px 0 2px; }
.sheet-sub { color: var(--muted); font-size: 14px; margin: 2px 0 6px; }
.sheet-close { flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; margin-right: -8px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 10px; }
.swatches.small { margin-top: 10px; }
.swatches.more { margin-top: 10px; }
.swatch {
  position: relative; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--sw, #fff);
  padding: 0; transition: transform var(--t) var(--ease), border-color var(--t); justify-self: center;
}
.swatch:hover { transform: scale(1.06); }
.swatch[aria-pressed="true"] { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(6, 237, 195, .35); }
.swatch.custom { display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(#D0021B, #FFD100, #1E8C3A, #1F4FB4, #5B2A86, #D0021B); overflow: hidden; cursor: pointer; }
.color-input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.swatches.maroon { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.swatch.big { width: 76px; height: 76px; border-radius: 16px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.swatch-name { font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 48px; padding: 6px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg); text-align: left; transition: border-color var(--t), background var(--t);
}
.choice:hover { border-color: rgba(6, 237, 195, .6); }
.choice.selected { border-color: var(--mint); background: rgba(6, 237, 195, .08); }
.choice-main { font-weight: 700; }
.choice-sub { font-size: 12px; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.thumbs.looks { grid-template-columns: 1fr; }
.thumb {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  transition: border-color var(--t), transform var(--t) var(--ease);
}
.thumb:hover { border-color: rgba(6, 237, 195, .6); }
.thumb.selected { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(6, 237, 195, .3); }
.thumb-art { display: block; width: 100%; background: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); overflow: hidden; }
.thumb-art > svg { display: block; width: 100%; height: 100%; }
.thumb-label { font-size: 13px; font-weight: 700; text-align: center; }
.font-list { display: flex; flex-direction: column; gap: 8px; }
.font-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 8px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg); text-align: left; transition: border-color var(--t);
}
.font-btn:hover { border-color: rgba(6, 237, 195, .6); }
.font-btn.selected { border-color: var(--mint); background: rgba(6, 237, 195, .08); }
.font-sample { font-size: 26px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.font-name { font-size: 12px; color: var(--muted); flex: none; }
.pantone-list { list-style: none; padding: 0; margin: 10px 0 0; }
.pantone-list li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.menu { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 16px; }
.menu-item .ico { color: var(--mint); }
.menu-item.danger .ico { color: var(--red); }
.quality-head { display: flex; gap: 10px; align-items: flex-start; }
.quality-head p { margin: 0; }
.quality-head .qdot-mark { margin-top: 4px; flex: none; }
.edit-form { display: flex; flex-direction: column; gap: 6px; }
.sheet-wave .wave-box, .wave-box { width: 100%; height: min(56vh, 520px); }
.wave-box > svg, .preview-box > svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ toasts */
/* Bot run 2026-11-04: a toast lay over the review screen's "Use this design" on a 375 px phone and
   ate the tap. Toasts sit at the top, under the top bar, on every screen and at every width; toast.js
   moves them to the bottom (.toasts-bottom, end of this file) when a main button is under them there.
   And a toast never catches a tap meant for what is under it: only its own buttons take taps. */
.toasts { position: fixed; left: 0; right: 0; top: calc(60px + env(safe-area-inset-top)); bottom: auto; display: flex; justify-content: center; pointer-events: none; z-index: 60; padding: 0 12px; }
.toast {
  pointer-events: none; display: flex; align-items: center; gap: 8px; max-width: 520px; padding: 10px 6px 10px 16px; border-radius: 16px;
  background: #24252C; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 15px;
  opacity: 0; transform: translateY(8px); transition: opacity var(--t), transform var(--t) var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-ok { border-color: rgba(6, 237, 195, .4); }
.toast-warn { border-color: rgba(245, 183, 0, .5); }
.toast-bad { border-color: rgba(255, 90, 95, .6); }
.toast-text { flex: 1; }
.toast-action { flex: none; border: 0; border-radius: 999px; min-width: 44px; min-height: 44px; padding: 0 14px; background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; font-weight: 700; white-space: nowrap; }
.toast-x { flex: none; border: 0; background: none; color: var(--muted); width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; }

/* ------------------------------------------------------------------ review */
.review-grid { display: flex; flex-direction: column; gap: 18px; }
.review-preview { display: flex; flex-direction: column; gap: 10px; }
.preview-stage {
  display: flex; align-items: center; justify-content: center; padding: 18px 10px;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(120, 112, 170, .22), rgba(18, 19, 22, 0) 70%);
}
.preview-box { width: 100%; max-width: 640px; background: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); transition: opacity var(--t); }
.preview-box.is-mirror > svg { transform: scaleX(-1); }
.preview-box.is-mirror { opacity: .8; }
.preview-box.waving { background: transparent; box-shadow: none; height: min(52vh, 460px); }
.preview-box.waving.is-mirror > svg { transform: none; }
.toggles { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-weight: 700; transition: border-color var(--t), background var(--t);
}
.toggle .ico { width: 18px; height: 18px; color: var(--mint); }
.toggle[aria-pressed="true"] { border-color: var(--mint); background: rgba(6, 237, 195, .1); }
.back-note { text-align: center; color: var(--muted); font-size: 14px; margin: 0; }
.checklist { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.check { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); transition: border-color var(--t), box-shadow var(--t); }
.check h3 { font-size: 11px; color: var(--muted); margin: 2px 0 8px; display: flex; align-items: center; gap: 6px; }
.check.done h3 { color: var(--text); }
.check.done h3 .ico { color: var(--mint); width: 18px; height: 18px; }
.check.blocking { border-color: rgba(245, 183, 0, .5); }
.check.attention { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 90, 95, .25); }
.words-proof { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.proof-word { font-size: 28px; line-height: 1.2; margin: 0; word-break: break-word; }
.quality-note { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 15px; }
.quality-note .qdot-mark { margin-top: 4px; flex: none; }
.ph-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ph-sample { flex: 1 1 100%; font-weight: 700; border: 1.5px dashed var(--mint); border-radius: 999px; padding: 4px 12px; width: fit-content; }
.back-choice { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.back-choice legend { font-size: 11px; color: var(--muted); padding: 0 4px; }
.notes-label { display: block; font-weight: 700; margin: 12px 0 6px; }
.pantone-review { border: 1.5px solid var(--gold); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; background: var(--panel); }
.pantone-review .group-label { margin: 0 0 6px; }
.pantone-sent { font-size: 20px; font-weight: 700; margin: 0; word-break: break-word; }
.saved-line { color: var(--muted); font-size: 14px; text-align: center; margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------ designers door */
.narrow { max-width: 560px; margin: 0 auto; width: 100%; }
.upload-zone {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1.5px dashed rgba(6, 237, 195, .6);
  background: var(--panel); cursor: pointer; min-height: 76px;
}
.upload-zone:hover { border-color: var(--mint); }
.upload-zone strong { display: block; }
.file-list { list-style: none; padding: 0; margin: 8px 0; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ small phones */
@media (max-width: 359px) {
  .brand { font-size: 11px; }
  .chip { padding: 0 11px; font-size: 14px; }
  .door { min-height: 68px; }
  .door-ico { width: 40px; height: 40px; }
  .stage-wrap { min-height: 40vh; }
}

/* ------------------------------------------------------------------ tablet / desktop */
@media (min-width: 640px) {
  .screen-start, .screen-designers, .screen-review { padding: 28px 24px 40px; }
  .screen-start > * { max-width: 620px; margin-left: auto; margin-right: auto; width: 100%; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .thumbs.looks { grid-template-columns: repeat(3, 1fr); }
  .sheet { left: 50%; right: auto; width: min(640px, 100%); transform: translate(-50%, 100%); }
  .sheet-root.open .sheet { transform: translate(-50%, 0); }
}
@media (min-width: 1024px) {
  .screen-editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
  .stage-wrap { min-height: 0; height: auto; }
  .controls { border-top: 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; }
  .chips, .minibar { flex-wrap: wrap; overflow: visible; }
  .bottom-row { flex-direction: column; align-items: stretch; margin-top: auto; }
  .askbar { flex: 0 0 auto; }
  .review-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr); align-items: start; gap: 28px; }
  .review-preview { position: sticky; top: 72px; }
  .sheet { left: auto; right: 0; top: 0; bottom: 0; width: 420px; max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); transform: translateX(100%); }
  .sheet-root.open .sheet { transform: none; }
  .toasts { justify-content: flex-start; padding-left: 24px; }
  .app { height: 100vh; height: 100dvh; }
  .main { overflow: auto; }
}
@media (min-width: 1024px) and (min-height: 0) {
  [data-screen="editor"] .main { overflow: hidden; }
}

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-iteration-count: 1 !important; }
  .toast { transform: none; }
  .sheet { transition: none; }
}

/* glyph warning under words the font cannot print (screen only) */
.glyph-warn {
  position: absolute; transform: translateX(-50%); max-width: 92%; padding: 4px 10px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; white-space: normal; text-align: center;
}

/* chips row: right-edge fade + "›" hint while more chips are off screen */
.chips-wrap { position: relative; }
.chips-wrap.has-more .chips { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
.chips-next {
  display: none; position: absolute; right: 0; top: 4px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(6, 237, 195, .5); background: var(--panel); color: var(--mint); font-size: 24px; line-height: 1;
}
.chips-wrap.has-more .chips-next { display: inline-flex; align-items: center; justify-content: center; }
.chips-wrap:has(.chips[hidden]) .chips-next { display: none; }
@media (min-width: 1024px) { .chips-wrap.has-more .chips { -webkit-mask-image: none; mask-image: none; } .chips-wrap.has-more .chips-next { display: none; } }

/* touch targets >= 44 px */
.keep-note { border: 1px solid rgba(6, 237, 195, .4); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }

/* a second toast choice ("No, keep it as a colour") */
.toast { flex-wrap: wrap; }
.toast-action.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }

/* the customer-confirmed words box ("Which words go on your flag?") */
.toast.toast-words { flex-direction: column; align-items: stretch; gap: 6px; width: min(520px, 100%); padding: 12px 14px; }
.words-q { font-weight: 700; font-size: 16px; }
.words-sentence { margin: 0; color: var(--muted); font-size: 14px; word-break: break-word; }
.words-input { font-size: 18px; min-height: 48px; }
.toast-words .row-btns { margin-top: 4px; }
.toast-words .fine { margin: 0; }

/* S2: background = one choice (Colour · Pattern · My photo · Paint one) */
.seg { display: flex; gap: 4px; padding: 4px; margin: 6px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.seg-btn {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background var(--t), color var(--t);
}
.seg-btn.selected { background: rgba(6, 237, 195, .14); color: var(--text); box-shadow: inset 0 0 0 1px var(--mint); }
.seg-panel, .seg-section { display: flex; flex-direction: column; gap: 4px; }

/* S2: one colour picker everywhere — swatches, "Any colour", "I have a Pantone number" */
.colour-picker { display: flex; flex-direction: column; gap: 6px; }
.any-colour {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 16px 6px 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 700; width: fit-content;
}
.any-colour:hover, .any-colour.selected { border-color: var(--mint); }
.any-colour-dot {
  width: 42px; height: 42px; border-radius: 50%; flex: none; border: 2px solid var(--line);
  background: conic-gradient(#D0021B, #FFD100, #1E8C3A, #1F4FB4, #5B2A86, #D0021B);
}
.any-colour.selected .any-colour-dot { background: var(--sw, #fff); }
.pantone-link { align-self: flex-start; }

/* S2: limits where they bite */
.counter { display: inline-block; width: fit-content; margin: 4px 0; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.counter.over { color: var(--red); border-color: rgba(255, 90, 95, .6); }
.limit-note { border: 1px solid rgba(245, 183, 0, .5); border-radius: 12px; padding: 10px 12px; margin: 6px 0; }

/* S3/S4: the doors — "Make my flag" is the big, primary one */
.door.door-main {
  min-height: 96px; border-color: rgba(6, 237, 195, .55);
  background: linear-gradient(135deg, rgba(106, 70, 224, .38), rgba(74, 43, 184, .22)), var(--panel);
  box-shadow: 0 8px 24px rgba(83, 51, 178, .3);
}
.door.door-main strong { font-size: 20px; }
.door.door-main .door-ico { width: 54px; height: 54px; color: var(--gold); }
.ideas-strip { padding: 2px 0 6px; }
.ideas-strip .group-label { margin-top: 4px; }
.ideas-guided { padding-top: 2px; }

/* S3/S4: the guided door ("Make my flag") — phone first, one thumb, big targets */
.screen-guided { padding: 16px 16px 32px; }
.guided { display: flex; flex-direction: column; gap: 4px; }
.g-step { margin: 0; color: var(--mint); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.g-block { display: flex; flex-direction: column; gap: 6px; }
.g-progress { font-weight: 700; color: var(--mint); margin: 10px 0; }
.g-logo-card { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.g-logo-img { width: 72px; height: 72px; object-fit: contain; flex: none; border-radius: 10px; background: repeating-conic-gradient(#3A3B44 0 25%, #2A2B33 0 50%) 0 0 / 16px 16px; }
.g-logo-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g-logo-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-logo-colours { display: flex; gap: 6px; flex-wrap: wrap; }
.g-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--sw, #fff); }
.g-logo-btns { justify-content: flex-start; margin-top: 8px; }
.g-words { font-size: 20px; min-height: 96px; }
.g-looks { grid-template-columns: repeat(2, 1fr); margin-top: 6px; }
.g-look { min-height: 44px; }
/* held while "Remove the white box" runs (FES-89 F1) */
.g-looks .thumb:disabled, .guided .back-link:disabled { opacity: .55; cursor: progress; }
.g-paint { align-items: center; justify-content: center; min-height: 110px; border-style: dashed; border-color: rgba(6, 237, 195, .6); }
.g-paint-art { color: var(--gold); display: inline-flex; }
.g-paint-art .ico { width: 34px; height: 34px; }
.g-more { justify-content: center; }
.g-preview-wrap { position: relative; }
.g-preview { margin: 0 auto; }
.g-preview [id$="-guides"] { opacity: .45; }
.g-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.g-big {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 8px;
  border-radius: var(--radius); border: 1px solid rgba(6, 237, 195, .5); background: var(--panel); font-weight: 700; font-size: 16px;
  transition: border-color var(--t), transform var(--t) var(--ease), opacity var(--t);
}
.g-big .ico { width: 26px; height: 26px; color: var(--mint); }
.g-big:active:not(:disabled) { transform: scale(.98); }
.g-big:disabled { opacity: .4; }
.g-big[data-paint] { grid-column: 1 / -1; min-height: 60px; flex-direction: row; }
.g-askbar { flex: 0 0 auto; margin: 2px 0; }
.g-looks-good { margin-top: 10px; }
.g-edit-myself { align-self: center; }
.g-word-colours { display: flex; gap: 8px; flex-wrap: wrap; }
.g-word-colour { flex-direction: row; align-items: center; gap: 10px; min-width: 96px; }
.g-chip-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--sw, #fff); flex: none; }
/* the guided door's toasts sit at the top, under the sticky top bar: at the bottom one covered
   "Looks good" on a phone until it faded (audit 2026-10-09) */
[data-screen="guided"] .toasts { top: calc(60px + env(safe-area-inset-top)); bottom: auto; }
@media (min-width: 640px) {
  .screen-guided { padding: 24px 24px 40px; }
  .g-looks { grid-template-columns: repeat(3, 1fr); }
  .g-actions { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}

/* S5a (Todd 2026-11-13: "for the web, it's hard to see everything without scrolling down. All the
   buttons should be available to the person while still seeing the flag here."): on a computer
   (>= 900 px wide) each step of "Make my flag" fits one screen at 1280 x 720 and up. Step 1: the logo
   and the words side by side. Step 2: the six looks in three columns of cards sized to two rows
   (--ar = the flag's width / height, set by guided.js) + "Show me more". Step 3: the flag on the
   left (it stays in view) and every control on the right. A phone keeps one column. */
.g-one-logo, .g-one-words { display: flex; flex-direction: column; min-width: 0; }
.g-make-controls { display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 900px) {
  .screen-guided { padding: 10px 24px 16px; }
  .narrow.guided { max-width: 1180px; }
  .guided .back-link { margin: -4px 0 0 -4px; min-height: 36px; }
  .guided .title { margin: 0 0 2px; }
  .guided .tagline { margin: 0 0 8px; }
  .guided .trust { margin: 10px 0 0; }
  .g-one { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .g-one-logo .group-label { margin-top: 12px; }
  .g-one-words .notes-label { margin-top: 12px; }
  .g-looks {
    --g2-row: calc((100dvh - 440px) / 2); /* S5c: room for the logo size row and the stitching note */
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px auto 0; width: 100%;
    max-width: min(100%, calc(3 * max(100px, var(--g2-row) - 50px) * var(--ar, 1.667) + 3 * 22px + 20px));
  }
  .g-looks .thumb { padding: 8px; gap: 4px; }
  .g-looks .thumb-label { font-size: 12px; }
  .g-more { margin-top: 6px; }
  .g-more .btn-ghost { min-height: 44px; }
  .g-make { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 28px; align-items: start; }
  .g-make-flag { position: sticky; top: 8px; min-width: 0; }
  .g-make .g-preview { width: min(100%, calc((100dvh - 210px) * var(--ar, 1.667))); }
  .g-make-controls .g-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; margin: 0 0 8px; }
  .g-make-controls .g-big { min-height: 52px; flex-direction: row; font-size: 15px; padding: 8px; }
  .g-make-controls .g-big .ico { width: 22px; height: 22px; }
  .g-make-controls .g-looks-good { margin-top: 8px; }
  .g-make-controls .g-glow-slot { margin: 0 0 8px; }
}

/* S4: simple by default — two doors, the trimmed "Make it yours", "Simple view" in the editor */
.door.door-designers { border-style: solid; }
.door.door-designers .door-ico { color: var(--mint); }
.simple-btn {
  flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 12px 0 6px;
  border-radius: 999px; border: 1px solid rgba(6, 237, 195, .7); background: var(--panel); color: var(--text);
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.simple-btn .ico { width: 20px; height: 20px; color: var(--mint); }
.simple-btn:hover { background: var(--panel-2); }
/* The top bar always fits (audit S4: at 375 px in the embed, with the close button, "Not saved yet —
   retrying" pushed Redo and ⋯ off the screen). Everything but the save pill keeps its size; the
   pill and the brand give way (ellipsis; the pill's full words stay in its text and title). On a
   phone (< 480 px) the pill hangs just under the bar instead of taking room in it, so the Simple
   view button keeps its words; under 360 px the button says just "Simple". */
.topbar > .brand { min-width: 0; }
.topbar-actions { min-width: 0; flex: 0 1 auto; }
.topbar-actions .save-pill { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 479px) {
  /* Second audit S4: the hanging pill covered the right end of the product bar's text. It now hangs
     in a room kept for it at the right of the product bar's FIRST line (an empty float as wide as
     the pill can be: the product words wrap round it, the lines under it keep the full width), and
     it is short enough (22 px, 2 px under the bar) to end above the second line (21 px lines start
     7 px into the bar). Taps still pass through it. Longer pill words end in "…" (title + text whole). */
  :root { --pill-room: 148px; }
  .topbar-actions .save-pill {
    position: absolute; top: calc(100% + 2px); right: 8px; max-width: var(--pill-room);
    padding: 2px 10px; line-height: 16px;
    background: var(--bg); pointer-events: none; z-index: 1;
  }
  .product-bar { display: block; }
  .product-bar::before { content: ""; float: right; width: calc(var(--pill-room) - 2px); height: 1px; }
  .product-main { display: inline; line-height: 21px; }
  .product-main .chev { vertical-align: middle; margin-left: 6px; }
  .product-sub { display: block; }
}
@media (max-width: 359px) {
  .simple-btn .simple-more { display: none; }
}
@media (max-width: 639px) {
  /* an odd last big button (3 of them without a picture) takes the whole row */
  .g-actions .g-big:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 60px; flex-direction: row; }
}
.g-big[data-remake="asked"] { border-color: var(--gold); }
.g-hint { margin: 2px 0 6px; }
.g-hint[hidden] { display: none; }
.g-blurry, .g-remake-on {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; padding: 10px 12px;
  border-radius: 12px; border: 1px solid rgba(245, 183, 0, .5); background: var(--panel); font-size: 15px;
}
.g-remake-on { border-color: rgba(6, 237, 195, .5); flex-wrap: nowrap; align-items: flex-start; }
.g-remake-on span { flex: 1; }
.g-remake-on .ico { width: 18px; height: 18px; color: var(--mint); flex: none; }
/* a photo of a drawing (FES-89 S5d-2b, paper.js): the offer "Clean up my drawing", then Keep it / Use my
   original photo (two equal buttons: nothing pre-selected) and Rotate, right under the flag */
.g-paper-hint {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0 0 6px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid rgba(6, 237, 195, .5); background: var(--panel); font-size: 15px;
}
.g-paper-hint p { margin: 0; }
.g-paper-btns, .g-drawing-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.g-paper-btns > button, .g-drawing-btns > button { flex: 1 1 140px; min-height: 44px; }
.g-paper-btns .ico, .g-drawing-btns .ico, .g-drawing-clean .ico { width: 18px; height: 18px; }
.g-paper-btns .btn-ghost .ico, .g-drawing-btns .btn-ghost .ico { color: var(--mint); }
.g-paper-rotate, .g-drawing-keep, .g-drawing-original, .g-drawing-clean { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.g-drawing { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; }
.g-drawing p { margin: 0; }
.g-drawing-seen { font-weight: 600; }
.g-more-options { align-self: center; }
/* the External white glow under the flag (glow.js, FES-89 S4): its question once, else its switch */
.g-glow-slot { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.g-glow-slot[hidden] { display: none; }
.g-glow-ask {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
}
.g-glow-ask-text { margin: 0; flex: 1 1 100%; font-size: 15px; }
.g-glow-btns { flex: 1 1 100%; margin: 0; }
.g-glow-btns .btn-primary, .g-glow-btns .btn-ghost { flex: 1 1 140px; min-height: 48px; }
.g-glow-toggle { display: flex; align-items: center; gap: 8px; min-height: 48px; width: 100%; justify-content: flex-start; }
.g-glow-toggle .ico { width: 20px; height: 20px; }
.g-glow-state { margin-left: auto; font-weight: 700; }
.g-glow-toggle[aria-pressed="true"] { border-color: var(--mint); }
.g-glow-toggle[aria-pressed="true"] .g-glow-state { color: var(--mint); }
.mini-glow[aria-pressed="true"] { border-color: var(--mint); }
.g-size-btns { justify-content: center; margin: 8px 0 12px; }
.g-size-btns .btn-ghost { min-width: 128px; }
.g-words-edit { font-size: 18px; }
.g-paint-instead { width: 100%; margin: 16px 0 6px; }
.swatch-groups { display: flex; flex-direction: column; gap: 8px; }
.swatches.swatches-first { grid-template-columns: repeat(4, minmax(64px, 1fr)); }
.swatches.swatches-first .swatch.big { width: 100%; max-width: 76px; justify-self: center; }
.swatch-group-label { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
/* S5b: the store's Flag Backgrounds on "Colours": the pattern, its name under it */
.store-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.store-pick {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 48px; padding: 4px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--bg); text-align: center;
  transition: border-color var(--t), box-shadow var(--t);
}
.store-pick:hover { border-color: rgba(6, 237, 195, .6); }
.store-pick[aria-pressed="true"] { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(6, 237, 195, .35); }
.store-pick-art { display: block; aspect-ratio: 3 / 2; border-radius: 10px; background-size: cover; background-position: center; }
.store-pick-name { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--text, inherit); padding: 0 2px 2px; }

/* Bot run 2026-11-04: toasts never cover a main button and never eat a tap (toast.js place()).
   Moved to the bottom when a main button sits under the top band (beats the guided rule above). */
[data-screen] .toasts.toasts-bottom, .toasts.toasts-bottom { top: auto; bottom: calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  [data-screen] .toasts.toasts-bottom, .toasts.toasts-bottom { bottom: 24px; }
}
/* only the toast's own buttons (Undo, ×, a choice) and the words box take taps */
.toast-action, .toast-x, .toast.toast-words { pointer-events: auto; }
/* Bigger / Smaller greyed out when they can't change anything, with the reason under them */
.btn-ghost:disabled { opacity: .4; cursor: default; }
.btn-ghost:disabled:hover { border-color: var(--line); }
.g-size-note { text-align: center; margin: -4px 0 10px; }

/* S5c (Todd 2026-11-14): Logo Small · Logo Medium · Logo Large on "Pick a look" (all six looks) and on
   "Make it yours" (the flag), and the stitching colour note under the looks (small, never over anything) */
.g-logo-size { margin: 2px 0 8px; }
.g-logo-size .seg-btn { font-size: 14px; padding: 0 6px; min-height: 44px; }
.g-logo-size .seg-btn:disabled { opacity: .55; cursor: progress; }
.g-logo-size-slot[hidden] { display: none; }
.g-logo-size-slot .g-logo-size { margin: 0 0 10px; }
.g-stitch-note { margin: 8px 0 0; text-align: center; font-size: 13px; line-height: 1.35; }
@media (min-width: 900px) {
  .guided[data-step="2"] .g-logo-size { width: min(100%, 460px); margin: 0 auto 6px; }
  .g-stitch-note { margin: 6px 0 0; }
  .g-make-controls .g-logo-size-slot .g-logo-size { margin: 0 0 8px; }
}

/* ------------------------------------------------------------------ AI clean-up (S6, cleanup.js) */
.sheet-cleanup .field-label { display: block; font-weight: 700; margin: 4px 0 6px; }
.sheet-cleanup .notice { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.sheet-cleanup .cleanup-error { border-color: rgba(255, 90, 95, .6); color: var(--text); }
.cleanup-busy { position: static; background: transparent; min-height: 180px; }
.cleanup-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 6px; }
.cleanup-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cleanup-fig img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 12px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#2a2b33 0 25%, #1f2026 0 50%) 0 0 / 16px 16px;
  -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none;
}
.cleanup-fig-new img { border-color: var(--mint); }
.cleanup-fig figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.cleanup-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.cleanup-tab { min-height: 40px; }
.cleanup-btns { justify-content: stretch; }
.cleanup-btns > button { flex: 1 1 140px; min-height: 48px; }
.cleanup-left { text-align: right; margin-top: 8px; }
.cleanup-list { display: grid; gap: 8px; margin: 8px 0; }
.cleanup-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-align: left; }
.cleanup-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--panel-2); }
.review-addon { font-weight: 700; color: var(--mint); margin: 12px 0 0; text-align: center; }
