/* Prep flow. Scoped so the homepage rules stay put.
   Type, space, color, and controls live on .flow so a screen can stay
   quiet without a new stylesheet. Sticker art and the logo are not restyled. */
.flow {
  --ink: #f4f4f2;
  --muted: #a7a49e;
  --faint: #7d7a74;
  --line: rgba(255, 255, 255, 0.1);
  --card: #17171b;
  --bg: #0c0c0e;
  --bg-raise: #1a1a1f;
  --bg-sunken: #101013;
  --primary: #f4f4f2;
  --primary-ink: #121214;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --t-display: 34px;
  --t-title: 22px;
  --t-body: 17px;
  --t-ui: 17px;
  --t-label: 13px;
  --t-caption: 15px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --mla: #d62828;
  --mlb: #1f4fd1;
  --mlc: #c9a400;
  --mld: #2e9e2e;
  --mle: #8e3bbf;
  --mlf: #d6337f;
  --mlg: #1c9ccf;
  --mlh: #e8730c;
  --mla-light: #f9c9c9;
  --mlb-light: #c9d6f7;
  --mlc-light: #fff0a0;
  --mld-light: #cdefc4;
  --mle-light: #e3ccf2;
  --mlf-light: #f9cde4;
  --mlg-light: #c8ecf8;
  --mlh-light: #ffd9b0;
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 48% at 50% -12%, rgba(255, 255, 255, 0.055), transparent 52%),
    linear-gradient(180deg, #141418 0%, #0e0e11 42%, #0a0a0c 100%);
  color: var(--ink);
  color-scheme: dark;
  text-transform: none;
  letter-spacing: 0;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
}
body.in-flow { overflow: hidden; }
body.in-flow .scr { display: none !important; }
.flow * { letter-spacing: 0; }
.flow button, .flow input, .flow select, .flow textarea { font-family: inherit; text-transform: none; }
.flow-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding:
    calc(var(--s-4) + env(safe-area-inset-top, 0px))
    calc(var(--s-5) + env(safe-area-inset-right, 0px))
    calc(var(--s-6) + env(safe-area-inset-bottom, 0px))
    calc(var(--s-5) + env(safe-area-inset-left, 0px));
}
.flow-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.flow-brand { display: flex; align-items: center; gap: var(--s-3); min-width: 0; flex: 1; }
.flow-brand img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.flow-brand b { font-size: 22px; font-weight: 800; line-height: 1; }
.flow-brand span {
  display: block;
  color: var(--muted);
  font-size: var(--t-caption);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-head-acts { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.flow-back {
  appearance: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.flow-back span {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  margin-top: -2px;
}
.flow-back:active { background: rgba(255, 255, 255, 0.16); }
.flow-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #2a2a30;
  color: var(--ink);
  font-weight: 700;
  font-size: var(--t-ui);
  padding: 10px 16px;
  min-height: 48px;
  cursor: pointer;
  border-radius: 12px;
}
.flow-btn:active { background: #34343b; }
.flow-btn:disabled { opacity: .4; cursor: not-allowed; }
.flow-btn.solid { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.flow-btn.solid:active { background: #fff; }
.flow-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.flow-btn.ghost:active { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.flow-btn.tiny { min-height: 44px; font-size: 16px; padding: 8px 12px; }
.flow label.flow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  color: inherit;
  cursor: pointer;
}
.flow .btn.logout {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  letter-spacing: 0;
  text-transform: none;
  font-size: 16px;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
}
.flow-link {
  color: var(--muted);
  background: none;
  border: 0;
  font-weight: 700;
  font-size: var(--t-caption);
  cursor: pointer;
  min-height: 44px;
}
.flow h1 {
  font-size: var(--t-display);
  line-height: 1.05;
  font-weight: 800;
  margin: 0 0 var(--s-2);
}
.flow h2 { font-size: var(--t-title); line-height: 1.15; font-weight: 800; margin: 0 0 var(--s-2); }
.flow h3 { font-size: 18px; font-weight: 800; margin: var(--s-4) 0 var(--s-2); }
.flow .sub {
  font-size: var(--t-body) !important;
  line-height: 1.35;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 var(--s-4);
}
.voice-mic {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-1);
  width: 100%;
  text-align: left;
  background: var(--bg-raise);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--s-4);
  margin: 0 0 var(--s-4);
  min-height: 96px;
  cursor: pointer;
}
.voice-mic svg { display: block; margin-bottom: var(--s-1); }
.voice-mic b { font-size: var(--t-title); font-weight: 800; line-height: 1.1; }
.voice-mic .voice-said { display: block; font-size: var(--t-caption); color: var(--muted); font-weight: 650; line-height: 1.25; }
.voice-mic.listening { border-color: #ff5a5a; }
.voice-mic:disabled { opacity: .7; cursor: wait; }
.heard {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-left: 4px solid var(--mlg);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: var(--s-3);
}
.heard > b { display: block; font-size: 18px; margin-bottom: 6px; }
.heard-said { margin: 0 0 8px; font-size: var(--t-caption); font-weight: 700; }
.heard ul { margin: 0; padding-left: 18px; }
.heard li { font-size: var(--t-caption); font-weight: 700; margin: 2px 0; }
.flow-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.flow-card {
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)), var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--mla));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  min-height: 92px;
  cursor: pointer;
  font-weight: 700;
}
a.flow-card { display: block; text-decoration: none; color: inherit; box-sizing: border-box; }
.flow-card b { display: block; font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.flow-card span { display: block; font-size: var(--t-caption); color: var(--muted); font-weight: 600; line-height: 1.3; }
.flow-card:active { background: #202026; }
.stepper {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  margin: 0 0 var(--s-4);
  -webkit-overflow-scrolling: touch;
}
.stepper button {
  flex: 0 0 auto;
  background: var(--bg-sunken);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  min-height: 40px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.stepper button.on { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.flow-error, .flow-note {
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: var(--s-3);
  font-size: var(--t-caption);
  font-weight: 700;
  line-height: 1.35;
}
.flow-error { background: #3a1416; color: #ffd0d0; }
.flow-note { background: #14281a; color: #d7ffd6; }
.flow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-4); align-items: start; min-width: 0; }
.panel, .fx, .sheet-editor {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel { padding: var(--s-4); min-width: 0; max-width: 100%; }
.panel h2 { font-size: var(--t-title); margin-bottom: var(--s-2); }
.flow label { display: block; font-size: var(--t-label); font-weight: 700; color: var(--muted); margin: var(--s-3) 0 var(--s-1); }
.stock-combo { margin: var(--s-1, 4px) 0 var(--s-3, 12px); }
.stock-combo .stock-short { margin-top: 0; }
.stock-current {
  margin: 0 0 var(--s-2, 8px);
  color: var(--muted, #a7a49e);
  font-size: var(--t-caption, 15px);
  font-weight: 700;
}
.stock-combo .stock-more { margin-top: var(--s-2, 8px); }
.stock-combo .more-body input { margin-top: 0; }
.stock-combo .more-body .stock-list { margin-top: var(--s-2, 8px); }
.stock-sheet { margin: var(--s-3, 12px) 0 var(--s-1, 4px); }
.stock-sheet:empty { display: none; }
.stock-sheet svg {
  display: block;
  width: 100%;
  height: auto;
  background: #f3f0e8;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}
.stock-sheet text { font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 700; fill: #111; }
.stock-sheet-name {
  margin: 0 0 var(--s-2, 8px);
  font-size: var(--t-caption, 15px);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink, #f4f4f2);
}
.stock-sheet-note {
  margin: var(--s-2, 8px) 0 0;
  color: var(--muted, #a7a49e);
  font-size: var(--t-label, 13px);
  font-weight: 650;
  line-height: 1.35;
}
.stock-specs { margin: var(--s-2, 8px) 0 0; display: grid; gap: var(--s-1, 4px); }
.stock-specs div { display: grid; grid-template-columns: 8.6em minmax(0, 1fr); gap: var(--s-2, 8px); align-items: baseline; }
.stock-specs dt { color: var(--muted, #a7a49e); font-size: var(--t-label, 13px); font-weight: 700; }
.stock-specs dd { margin: 0; color: var(--ink, #f4f4f2); font-size: var(--t-caption, 15px); font-weight: 650; }
.stock-sheet-error { margin: var(--s-2, 8px) 0; color: #ffb4ae; font-size: var(--t-caption, 15px); font-weight: 700; }
.stock-list { display: flex; flex-direction: column; gap: var(--s-2, 8px); margin-top: var(--s-2, 8px); }
.stock-list button {
  min-height: 48px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font: inherit;
  font-size: var(--t-ui, 17px);
  font-weight: 700;
  background: var(--bg-sunken, #101013);
  color: var(--ink, #f4f4f2);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.stock-list button small {
  display: block;
  color: var(--muted, #a7a49e);
  font-size: var(--t-label, 13px);
  font-weight: 650;
  line-height: 1.3;
}
.stock-list button.on {
  background: var(--primary, #f4f4f2);
  color: var(--primary-ink, #121214);
  border-color: transparent;
}
.stock-list button.on small { color: #333; }
.flow input, .flow select, .flow textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  background: var(--bg-sunken);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 17px;
  font-weight: 650;
}
.flow input:focus, .flow select:focus, .flow textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}
.flow textarea { min-height: 96px; }
.drop {
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-4);
  text-align: center;
  font-size: var(--t-body);
  font-weight: 700;
  color: var(--muted);
  margin: var(--s-3) 0;
  background: rgba(255, 255, 255, 0.02);
  min-height: 88px;
}
.drop.hot { border-color: var(--ink); color: var(--ink); }
.row-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.flow-dock {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-4);
}
.flow-dock .flow-btn { flex: 1 1 120px; }
.studio {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 380px;
  gap: var(--s-3);
  align-items: start;
  min-width: 0;
  max-width: 100%;
}
.type-list { display: flex; flex-direction: column; gap: var(--s-2); }
.type-list button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
}
.type-list button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }
.checks { display: flex; flex-direction: column; gap: var(--s-2); }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-sunken);
  border-radius: 12px;
  padding: 12px;
  font-size: var(--t-body);
  font-weight: 700;
  min-height: 48px;
}
.check input { width: 22px; min-height: 22px; margin-top: 2px; }
.check small { display: block; color: var(--muted); font-weight: 600; font-size: var(--t-caption); line-height: 1.3; }
.fixture-list { display: flex; flex-direction: column; gap: var(--s-2); max-height: 62vh; overflow: auto; }
.fx { padding: 12px; }
.fx.head { display: flex; justify-content: space-between; gap: var(--s-2); align-items: center; }
.fx b { font-size: 18px; }
.flag { color: #ffd36a; font-size: var(--t-caption); font-weight: 700; line-height: 1.35; }
.chain { border-left: 4px solid var(--mlb); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
  padding: 6px 10px;
  margin: 4px 4px 0 0;
  font-weight: 800;
  min-height: 40px;
}
.preview-dock {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px;
  position: sticky;
  top: 12px;
}
.preview-dock img { width: 100%; height: auto; background: #fff; border-radius: 8px; display: block; }
.preview-dock .cap {
  color: var(--muted);
  font-size: var(--t-caption);
  font-weight: 700;
  margin-bottom: var(--s-2);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}
.preview-dock .preview-note { flex: 1 1 auto; min-width: 0; }
.preview-dock .close-preview { flex: 0 0 auto; margin-left: auto; }
.preview-dock .row-actions { color: var(--ink); align-items: center; }
.preview-dock .wait {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  background: var(--bg-sunken);
  border-radius: 8px;
}
.field-alert { margin: var(--s-2) 0; }
.sheet-tray-wrap { margin-top: var(--s-4); }
.sheet-tray {
  list-style: none;
  margin: var(--s-2) 0 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
  font-size: var(--t-body);
  font-weight: 700;
  color: var(--ink);
}
.sheet-tray li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
  padding: var(--s-2);
  background: var(--bg-sunken);
  border-radius: var(--r-sm);
}
.sheet-tray li.empty { display: block; background: transparent; color: var(--muted); padding: 0; }
.sheet-tray li span { flex: 1; min-width: 0; }
.sheet-tray li .flow-btn { min-height: 48px; flex: 0 0 auto; }
.sheet-tray li.editing { outline: 2px solid var(--ink); }
.lengths { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--s-2); }
.lengths button, .tabs button {
  background: var(--bg-sunken);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s-2); }
.tabs button.on, .lengths button.on { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.color-row { display: flex; gap: var(--s-2); align-items: center; max-width: 100%; min-width: 0; flex-wrap: wrap; }
.color-row input[type="color"] {
  width: 64px;
  min-width: 64px;
  flex: 0 0 64px;
  padding: 4px;
}
.color-row input:not([type="color"]) { flex: 1 1 auto; width: auto; min-width: 0; }
.color-row .flow-btn { flex: 0 0 auto; }
.line-act { display: flex; gap: var(--s-2); align-items: stretch; max-width: 100%; min-width: 0; }
.line-act input { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.line-act .flow-btn { flex: 0 0 auto; }
.tower-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-2) 0 var(--s-3); }
.drop-picks { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-2) 0; }
.drop-picks span { font-size: var(--t-label); font-weight: 800; color: var(--muted); width: 100%; }
.drop-picks .flow-btn { min-height: 44px; }
.load-box { margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--line); }
.pos-edit { margin: var(--s-2) 0; padding-top: var(--s-2); border-top: 1px solid var(--line); }
.viewport-shot { display: block; width: 100%; max-height: 240px; object-fit: contain; background: var(--bg-sunken); border-radius: 8px; margin: var(--s-2) 0; }
.stepper-qty { display: flex; align-items: center; gap: var(--s-2); min-height: 48px; font-size: var(--t-body); font-weight: 800; }
.stepper-qty b { min-width: 32px; text-align: center; font-size: 22px; }
.stepper-qty input { width: 72px; text-align: center; }
.more {
  margin: var(--s-3) 0;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.more summary {
  min-height: 48px;
  padding: 12px 14px;
  font-size: var(--t-ui);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before {
  content: "›";
  font-family: system-ui, -apple-system, sans-serif;
  display: inline-block;
  width: 16px;
  margin-right: 6px;
}
.more[open] summary::before { content: "⌄"; }
.more-body { padding: 0 14px 14px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.run-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.run-scroll { overflow: auto; max-height: 70vh; -webkit-overflow-scrolling: touch; }
.run-spacer { position: relative; }
.run-window { position: absolute; left: 0; right: 0; }
.run-row {
  display: grid;
  grid-template-columns: 36px repeat(6, minmax(64px, 1fr)) minmax(72px, auto);
  gap: 6px;
  align-items: center;
  min-height: 56px;
  margin-bottom: 6px;
  min-width: 640px;
}
.run-row input, .run-row select { min-height: 44px; }
.run-span { font-size: 15px; font-weight: 800; color: var(--muted); }
.bulk-bar { margin: var(--s-3) 0; }
@media (max-width: 1099px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .type-list { display: grid; grid-template-columns: 1fr 1fr; }
  .flow-grid { grid-template-columns: minmax(0, 1fr); }
  .flow { overflow: hidden; }
  .flow-wrap {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    height: auto;
    overflow: auto;
  }
  /* Action bar is fixed at the bottom. The sticker bar sits above it, and the
     sheet scrolls in the space above both, so a stock row cannot show through. */
  .flow.has-dock .flow-wrap {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 72px;
    scroll-padding-bottom: 72px;
  }
  .flow.has-dock:has(.preview-dock):not(.preview-open) .flow-wrap {
    bottom: calc(122px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 72px;
    scroll-padding-bottom: 72px;
  }
  .flow.has-dock.preview-open .flow-wrap {
    bottom: calc(46vh + 70px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 72px;
    scroll-padding-bottom: 72px;
  }
  .preview-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    max-height: 46vh;
    overflow: auto;
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
  .preview-dock::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.28);
    margin: 2px auto 8px;
  }
  .preview-dock.shut { max-height: 52px; overflow: hidden; }
  .preview-dock.shut::before { display: none; }
  .flow-dock {
    position: fixed;
    z-index: 36;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    flex-wrap: nowrap;
    padding:
      10px
      calc(var(--s-4) + env(safe-area-inset-right, 0px))
      calc(10px + env(safe-area-inset-bottom, 0px))
      calc(var(--s-4) + env(safe-area-inset-left, 0px));
    background: rgba(16, 16, 18, 0.94);
    border-top: 1px solid var(--line);
  }
  .flow-dock .flow-btn { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 720px) {
  .flow { --t-display: 32px; }
  .flow-cards { grid-template-columns: 1fr; }
  .flow-card { min-height: 76px; }
  .flow-wrap {
    padding:
      calc(var(--s-3) + env(safe-area-inset-top, 0px))
      calc(var(--s-4) + env(safe-area-inset-right, 0px))
      calc(var(--s-5) + env(safe-area-inset-bottom, 0px))
      calc(var(--s-4) + env(safe-area-inset-left, 0px));
  }
  .flow-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }
  .flow-brand { flex: 1 0 100%; order: 2; }
  .flow-back { order: 1; }
  .flow-head-acts { order: 1; margin-left: auto; width: auto; }
  .flow-brand img { width: 36px; height: 36px; }
  .flow-brand b { font-size: 22px; }
  .pair { grid-template-columns: 1fr; }
  .line-act { flex-wrap: wrap; }
  .line-act .flow-btn { flex: 1 1 100%; }
  .type-list {
    display: flex;
    flex-direction: row;
    gap: var(--s-2);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 4px 0 var(--s-2);
    background: linear-gradient(180deg, #121216 70%, rgba(12, 12, 14, 0));
  }
  .type-list button {
    flex: 0 0 auto;
    min-height: 44px;
    border-radius: var(--r-pill);
    padding: 8px 14px;
    white-space: nowrap;
  }
}
.swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 6px 0 var(--s-3); }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px #111; }
.pixel-room { font-size: var(--t-body); font-weight: 800; margin: var(--s-2) 0 var(--s-3); }
.pixel-room.over { color: #ff8d8d; }
.meter { margin: var(--s-3) 0 6px; font-weight: 800; }
.meter-bar { height: 8px; background: #2a2a2c; border-radius: 7px; overflow: hidden; margin: 4px 0; }
.meter-bar span { display: block; height: 100%; background: #2e9e2e; }
.meter.over .meter-bar span, .meter.over { color: #ff8d8d; }
.meter.over .meter-bar span { background: #d62828; }
.pixel-port { margin: var(--s-4) 0 6px; font-size: 18px; }
.live-label { border-radius: 8px; color: #111; padding: 8px 10px; margin: 0 0 8px; font-weight: 800; }
.live-label b, .live-label span { display: block; }
.pull { margin: 0 0 var(--s-3); padding-left: 18px; font-size: var(--t-body); font-weight: 700; }
.fill-goals { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0; }
.fill-goals .flow-btn { flex: 1 1 140px; min-height: 48px; }
.fill-note { color: var(--muted); font-size: var(--t-caption); font-weight: 700; line-height: 1.35; margin: var(--s-2) 0; }
.fill-result { font-size: var(--t-body); font-weight: 700; }
.fill-result b { font-size: 18px; }
.fill-actions { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.fill-actions .flow-btn { min-height: 48px; font-size: var(--t-ui); }
.pixel-sum { font-size: var(--t-body); font-weight: 800; margin: 0 0 var(--s-3); }
.hw-picks { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0 var(--s-3); }
.hw-picks .flow-btn { flex: 1 1 96px; min-height: 48px; }
.tape-read { margin-bottom: var(--s-3); }
.tape-shot { display: block; width: 100%; max-height: 200px; object-fit: contain; background: #111; border-radius: 8px; margin: var(--s-2) 0; }
.pixel-place { margin-top: var(--s-4); }
.pixel-run { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: var(--s-2) 0; }
.pixel-box, .pixel-flag, .pixel-cap {
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 4px;
  border: 2px solid #111;
}
.pixel-box { background: #111; color: #fff; }
.pixel-flag { background: #1f4fd1; color: #fff; }
.pixel-flag.end { background: #d62828; }
.pixel-cap { background: #f4f4f2; color: #111; }
.pixel-tube { width: 42px; height: 12px; border-radius: 6px; background: #d8d8d8; border: 2px solid #111; }
.pixel-line { width: 28px; height: 4px; background: #8a8a8a; border-radius: 2px; }
/* Sheet grid, when that screen is on the page. Layout stays with the grid; this is only the chrome. */
.flow .sheet-editor { padding: 12px; }
.flow .sheet-cell {
  min-height: 72px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
}
.flow .sheet-tabs button, .flow .sheet-tools .flow-btn, .flow .sheet-pages .flow-btn { min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}

/* Sheet grid. The sticker art stays the template; this is only the picker around it. */
.studio.has-sheet {
  grid-template-columns: 180px minmax(0, 1fr) minmax(220px, 300px);
  grid-template-areas:
    "types top dock"
    "types sheet sheet"
    "types rest rest";
}
.studio.has-sheet .type-list { grid-area: types; }
.studio.has-sheet .panel-top { grid-area: top; }
.studio.has-sheet .preview-dock { grid-area: dock; }
.studio.has-sheet .sheet-span { grid-area: sheet; min-width: 0; }
.studio.has-sheet .panel-rest { grid-area: rest; }
.sheet-editor { background: var(--card); border-radius: 14px; padding: 12px; }
.sheet-tools, .sheet-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sheet-pages { margin-top: 8px; }
.sheet-pages strong { font-size: 18px; }
.sheet-count { font-size: 18px; font-weight: 800; }
.sheet-tools .sheet-add.on {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: transparent;
}
.sheet-add-note {
  margin: var(--s-2) 0 0;
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 800;
}
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sheet-tabs button.on { background: #fff; color: #111; }
.sheet-scroll {
  touch-action: pan-y;
  margin: 10px 0;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 10px;
  background: #101012;
  color: var(--muted);
  font-weight: 700;
}
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 8px;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sheet-cell {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  min-height: 64px;
  padding: 6px;
  border-radius: 12px;
  border: 3px solid transparent;
  background: #101012;
  color: #fff;
  text-align: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.sheet-cell img,
.sheet-cell .sheet-name,
.sheet-cell .sheet-sub,
.sheet-cell .sheet-ph { pointer-events: none; }
.sheet-cell img { width: 100%; height: auto; background: #fff; border-radius: 4px; display: block; }
.sheet-ph {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-size: 28px;
  font-weight: 800;
}
.sheet-name { font-size: 16px; font-weight: 800; line-height: 1.1; }
.sheet-sub { font-size: 14px; font-weight: 800; color: #ffd36a; line-height: 1.1; }
.sheet-cell.on { border-color: #ffd36a; background: #2a2416; }
.sheet-cell.focus { z-index: 1; box-shadow: 0 0 0 3px #081018, 0 0 0 7px #3ec1ff; }
.sheet-grid.drawing { opacity: 0.72; }
@media (max-width: 1099px) {
  .studio.has-sheet {
    grid-template-columns: 1fr;
    grid-template-areas:
      "types"
      "top"
      "sheet"
      "rest";
  }
}
.fx { min-width: 0; max-width: 100%; }
.bar-board { margin: var(--s-3) 0; padding-top: var(--s-2); border-top: 1px solid var(--line); min-width: 0; max-width: 100%; }
.bar-board h3 { margin: 0 0 6px; font-size: var(--t-title); }
.bar-steps { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-2) 0; }
.bar-steps .stepper-qty span { font-size: var(--t-ui); color: var(--muted); }
.bar-swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 6px 0 var(--s-3); }
.bar-swatch { width: 44px; height: 44px; border-radius: var(--r-sm); border: 3px solid transparent; cursor: pointer; font-weight: 800; }
.bar-swatch.on { border-color: var(--primary); }
.ink-color { margin: var(--s-2) 0 14px; max-width: 100%; min-width: 0; }
.ink-color h3 { margin: 0 0 var(--s-2); font-size: var(--t-ui); }
.ink-scopes { display: flex; flex-wrap: wrap; gap: var(--s-2); max-width: 100%; }
.ink-scope.on { background: var(--primary); color: var(--primary-ink); }
.ink-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-2) 0; max-width: 100%; }
.ink-row span { flex: 1 0 100%; font-size: var(--t-label); color: var(--muted); font-weight: 700; }
.ink-swatch { flex: 0 0 44px; width: 44px; height: 44px; border-radius: var(--r-sm); border: 3px solid transparent; cursor: pointer; font-weight: 800; box-sizing: border-box; }
.ink-swatch.on { border-color: var(--primary); }
.bar-level { font-size: var(--t-caption); font-weight: 800; color: var(--muted); margin-top: var(--s-2); }
.bar-track-wrap { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 100%; min-width: 0; }
.bar-end { flex: 0 0 auto; font-size: var(--t-label); font-weight: 800; color: var(--muted); white-space: nowrap; }
.bar-scroll { flex: 1 1 auto; min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: var(--s-1) 0 var(--s-2); }
.bar-track { position: relative; height: 108px; }
.bar-line { position: absolute; left: var(--s-2); right: var(--s-2); top: 50%; height: 4px; margin-top: -2px; background: var(--ink); border-radius: 2px; }
.bar-slot, .bar-chip {
  position: absolute;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin: 0 0 0 -22px;
  padding: 0;
  border-radius: 22px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.bar-slot {
  top: 32px;
  border: 2px dashed var(--faint);
  background: transparent;
  padding: 0;
}
.bar-chip {
  border: 2px solid var(--mlb);
  background: var(--mlb-light);
  color: var(--primary-ink);
  font-weight: 800;
  font-size: 16px;
  padding: 0;
}
.bar-chip.is-stage { top: 0; }
.bar-chip.is-house { top: 60px; }
.bar-chip.is-on { top: 32px; }
.bar-chip.on { box-shadow: 0 0 0 3px var(--primary); }
.bar-chip.loose {
  position: static;
  width: auto;
  min-width: 44px;
  max-width: none;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin: 0;
  padding: 0 var(--s-3);
  transform: none;
}
.bar-tray { display: flex; flex-wrap: wrap; gap: var(--s-2); min-height: 44px; margin-bottom: var(--s-2); }
.bar-sides { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0; }
.bar-sides .flow-btn { flex: 1 1 120px; }
.bar-edit { margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--line); }
#bar-ghost {
  position: fixed;
  z-index: 80;
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--mlb-light);
  color: var(--primary-ink);
  border: 2px solid var(--mlb);
  font-weight: 800;
  font-size: var(--t-label);
  pointer-events: none;
}
@media (max-width: 720px) {
  .sheet-grid { gap: 6px; }
  .sheet-cell { padding: 4px; }
  .sheet-name { font-size: 15px; }
  .sheet-sub { font-size: 13px; }
}

.flow.is-creator { overflow: hidden; }
.flow.is-creator .flow-wrap { max-width: none; height: 100%; padding: 0; }
.creator-mount, .creator { height: 100%; }
.creator {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  height: 100dvh;
  overflow: auto;
  padding: calc(var(--s-2) + env(safe-area-inset-top, 0px)) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  color: var(--ink);
}
.creator-bar, .creator-tools, .creator-save, .creator-kinds, .creator-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.creator-bar b { font-size: var(--t-title); line-height: 1; font-weight: 800; }
.creator-bar span, .creator-read, .creator-status {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--t-caption);
}
.creator-stage {
  flex: 0 0 auto;
  width: 100%;
  overflow: visible;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  touch-action: none;
}
.creator-stage.zoomed {
  flex: 1 1 180px;
  min-height: 180px;
  overflow: auto;
}
.creator-sheet { position: relative; display: block; width: 100%; margin: 0; max-width: none; }
.creator-sheet img, .creator-grid, .creator-guides, .creator-els { position: absolute; inset: 0; }
.creator-sheet img { width: 100%; height: 100%; object-fit: contain; object-position: center; user-select: none; -webkit-user-drag: none; }
.creator-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
}
.creator-guides { pointer-events: none; }
.creator-safe { position: absolute; border: 1px dashed rgba(255,255,255,.75); box-sizing: border-box; }
.creator-guide { position: absolute; background: #7ec8ff; }
.creator-guide.v { top: 0; bottom: 0; width: 1px; }
.creator-guide.h { left: 0; right: 0; height: 1px; }
.creator-el {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid rgba(255,255,255,.9);
  background: rgba(12, 12, 13, .12);
  touch-action: pan-x pan-y;
}
.creator-mount.is-dragging .creator-el,
.creator-mount.is-dragging .knob { touch-action: none; }
.creator-el.on {
  border: 2px solid #7ec8ff;
  background: rgba(31, 79, 209, .16);
  box-shadow: 0 0 0 1px #0c0c0d, 0 0 0 3px #7ec8ff;
  z-index: 6;
}
.creator-el .nm {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  background: #1f4fd1;
  color: #fff;
  padding: 1px 4px;
  pointer-events: none;
}
.creator-el.on .nm { display: block; background: var(--primary); color: var(--primary-ink); }
.knob {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #7ec8ff;
  box-sizing: border-box;
  touch-action: none;
}
.knob.nw { left: -11px; top: -11px; }
.knob.ne { right: -11px; top: -11px; }
.knob.sw { left: -11px; bottom: -11px; }
.knob.se { right: -11px; bottom: -11px; }
.creator-chip, .creator-kind {
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  padding: 8px 12px;
  cursor: pointer;
}
.creator-chip.on, .creator-kind.on {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: transparent;
}
.creator-kind:disabled { opacity: .45; }
.creator-bg {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: 0;
  padding: var(--s-2) var(--s-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  background: var(--card);
}
.creator-bg legend {
  font-weight: 800;
  font-size: var(--t-label);
  color: var(--muted);
  padding: 0 var(--s-2);
}
.creator-bg label {
  display: flex;
  margin: 0;
  width: auto;
  font-size: var(--t-ui);
  font-weight: 700;
  color: var(--ink);
  gap: var(--s-2);
  align-items: center;
}
.creator input[type="radio"],
.creator input[type="checkbox"] {
  width: auto;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.creator input[type="color"] {
  width: 64px;
  min-width: 64px;
  flex: 0 0 64px;
  min-height: 44px;
  padding: 4px;
}
.creator-read { margin: 0; }
.creator.is-dragging, .creator-mount.is-dragging { cursor: grabbing; }

.hand-lead { margin: var(--s-4) 0 var(--s-2); }
.hand { max-width: 560px; }
.hand h1 { font-size: 28px; margin-bottom: 6px; }
.hand-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hand-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}
.hand label { margin: 4px 0 2px; }
.hand input { min-height: 44px; padding: 8px 10px; }
.hand-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hand-kinds { display: flex; flex-direction: column; gap: 8px; }
.hand-kind {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mla);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)), var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.hand-kind:nth-child(2) { border-left-color: var(--mlc); }
.hand-kind:nth-child(3) { border-left-color: var(--mlb); }
.hand-kind:nth-child(4) { border-left-color: var(--mle); }
.hand-kind:nth-child(5) { border-left-color: var(--mlh); }
.hand-kind b { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; }
.hand-kind span { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; font-weight: 650; }
.hand-kind.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }
.hand-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)), var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px 10px;
  margin: 0 0 8px;
}
.hand-card h2 { font-size: 16px; margin: 0 0 2px; }
.hand-add { width: 100%; margin-top: 4px; }
.hand label.hand-ask {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
}
.hand-ask input[type="checkbox"] {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.hand-ask span { font-size: 16px; font-weight: 800; line-height: 1.25; }
.hand-inks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 2px; }
.hand-inks input[type="color"] {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  flex: 0 0 auto;
}
.hand-inks .flow-btn { min-height: 44px; padding: 0 12px; }
.hand-fit { margin: 4px 0; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.3; }
.hand-warn {
  background: #3a1416;
  color: #ffd0d0;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.hand-warn p { margin: 0; }
.hand-warn .row-actions { margin-top: 8px; }
.hand-warn .flow-btn { min-height: 44px; }
.hand-units { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.hand-unit {
  background: var(--bg-sunken);
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.hand-sticker {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 168px;
  margin: 6px auto 0;
  background: #111;
  border-radius: 8px;
}
.hand-wait { margin: 8px 0; font-weight: 700; color: var(--muted); }
.hand-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.hand-pager span { font-weight: 800; font-size: 14px; }
.hand-again { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
@media (max-width: 1099px) {
  .flow.has-dock.hand-free .flow-wrap {
    bottom: 0;
    padding-bottom: calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 720px) {
  .hand-pair { grid-template-columns: 1fr 1fr; }
}
