/* dmx.css: Krank'd DMX tools. Layers on app.css (shared design tokens).
   Patch Studio (dmx.html) + standalone dip-switch calculator (dipswitch.html). */

/* ===================== base utils ===================== */
.cross-link { text-decoration: none; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-variant-ligatures: none; letter-spacing: .03em; }
.hidden { display: none !important; }
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { display: block; }

:where(button, a, input, select, [tabindex]):focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(155, 77, 255, .45); border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===================== Krank'd branding ===================== */
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
/* the monogram art is dark: invert to white for the dark UI + purple glow */
.brand-logo { width: 48px; height: 48px; flex: none; object-fit: contain;
  filter: invert(1) drop-shadow(0 3px 14px rgba(125, 40, 219, .6)); }
.brand .title { line-height: 1.12; }
.brand .title b { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -.015em; display: block; }
.brand .title small { color: var(--tx-dim); font-size: 12px; }

.kd-ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(125, 40, 219, .28), transparent 60%),
    radial-gradient(760px 460px at 92% 4%, rgba(155, 77, 255, .12), transparent 60%);
}
.shell { position: relative; z-index: 1; }

/* buttons (extend app.css .btn with icon support) */
.btn { display: inline-flex; align-items: center; gap: 7px; transition: background .15s, border-color .15s, transform .08s, color .15s; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--tx-dim); }
.btn.ghost:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.card-head .ic { color: var(--purple-xl); }
.card-head h2, .card-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--tx-dim); font-weight: 700; }
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--tx-dim); margin-bottom: 8px; letter-spacing: .02em; }
.hint { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--tx-faint); }
.hint .ic { color: var(--purple-xl); vertical-align: -1px; }

/* =====================================================================
   DECODER (standalone dipswitch.html): kept intact
   ===================================================================== */
.dmx-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
.dmx-grid > * { min-width: 0; }
/* minmax(0,1fr), never bare 1fr: 1fr = minmax(auto,1fr), and the 450px+ dip-switch bank's
   min-content would force the column (and the page) wider than a phone viewport */
@media (max-width: 1020px) { .dmx-grid { grid-template-columns: minmax(0, 1fr); } }

details.adv { margin: 16px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }
details.adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--tx-dim); font-size: 12.5px; font-weight: 600; user-select: none; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: '▸'; color: var(--purple-l); transition: transform .15s; font-size: 11px; }
details.adv[open] > summary::before { transform: rotate(90deg); }
details.adv > summary:hover { color: var(--tx); }
details.adv .adv-label { color: var(--tx); }

.addr-row { gap: 8px; }
.addr-box { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 26px; text-align: center; padding: 8px 10px; letter-spacing: .02em; }
.addr-box::-webkit-outer-spin-button, .addr-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.btn.step { font-size: 20px; line-height: 1; width: 46px; padding: 6px 0; flex: none; font-weight: 700; justify-content: center; }
.hero-card .result-hero .num { font-size: 64px; }

.bank-card { padding: 18px; }
/* margin:auto centres the bank when there is room; overflow-x scrolls it inside the card
   (never the page) when there is not, e.g. a 10-switch bank on a phone */
.bank-stage { display: flex; overflow-x: auto; padding: 22px 10px 10px; border-radius: 14px;
  background: radial-gradient(120% 90% at 50% -10%, rgba(155,77,255,.10), transparent 60%), linear-gradient(180deg, #0e1120, #0a0c16); border: 1px solid var(--line); }
.bank-stage .dipbank { margin: 0 auto; }
.bank-hint { text-align: center; margin: 12px 0 0; }
.dipbank { display: inline-flex; gap: 6px; padding: 14px 14px 10px; border-radius: 12px;
  background: linear-gradient(180deg, #2b3666 0%, #202a52 40%, #1a2244 100%); border: 1px solid #3a478a;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.10), inset 0 -3px 8px rgba(0,0,0,.5), 0 10px 28px -10px rgba(0,0,0,.8); }
.dipsw { appearance: none; border: 0; background: transparent; cursor: default; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 42px; color: var(--tx); }
.dipbank button.dipsw { cursor: pointer; }
button.dipsw:focus-visible { outline: none; box-shadow: none; }
button.dipsw:focus-visible .dip-track { box-shadow: 0 0 0 2px var(--purple-l), inset 0 2px 6px rgba(0,0,0,.7); }
.dip-on { font-size: 9px; font-weight: 700; letter-spacing: .12em; color: #6f7aa8; transition: color .18s; }
.dip-track { position: relative; width: 26px; height: 82px; border-radius: 6px; background: linear-gradient(180deg, #07090f, #0c1020); box-shadow: inset 0 2px 7px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.03); overflow: hidden; }
.dip-rocker { position: absolute; left: 3px; right: 3px; top: 3px; height: 40px; border-radius: 4px;
  background: linear-gradient(180deg, #fdfbf4 0%, #ece6d4 55%, #cfc8b4 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.9), inset 0 -2px 3px rgba(0,0,0,.18);
  transform: translateY(36px); transition: transform .18s cubic-bezier(.34,1.4,.5,1), background .18s; }
.dip-rocker::after { content: ''; position: absolute; left: 5px; right: 5px; top: 50%; height: 9px; transform: translateY(-50%); border-radius: 2px; background: repeating-linear-gradient(180deg, rgba(0,0,0,.16) 0 1.5px, transparent 1.5px 3px); }
.dipsw.on .dip-rocker { transform: translateY(0); background: linear-gradient(180deg, #ffffff 0%, #f3eefd 55%, #d9ccff 100%); }
.dipsw.on .dip-track { box-shadow: inset 0 2px 7px rgba(0,0,0,.8), inset 0 0 14px rgba(155,77,255,.55), inset 0 0 0 1px rgba(155,77,255,.5); }
.dipsw.on .dip-on { color: var(--purple-xl); }
.dipsw.hl .dip-track { animation: dip-pop .5s ease; }
@keyframes dip-pop { 0%,100% { } 30% { box-shadow: inset 0 2px 7px rgba(0,0,0,.8), inset 0 0 20px rgba(155,77,255,.9), inset 0 0 0 1px rgba(155,77,255,.8); } }
button.dipsw:hover .dip-track { box-shadow: inset 0 2px 7px rgba(0,0,0,.8), inset 0 0 0 1px rgba(155,77,255,.35); }
.dip-num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 14px; line-height: 1; }
.dip-wt { font-size: 10px; color: var(--tx-faint); font-variant-numeric: tabular-nums; }
.sumline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-family: 'Poppins', sans-serif; }
.sum-eq { font-weight: 800; font-size: 30px; color: #fff; }
.sum-eq::after { content: '='; margin-left: 9px; color: var(--tx-faint); font-weight: 600; }
.sum-op { color: var(--tx-faint); font-weight: 700; font-size: 18px; }
.sum-chip { display: inline-flex; padding: 5px 12px; border-radius: 9px; font-weight: 700; font-size: 16px; background: #1a1430; color: var(--purple-xl); border: 1px solid #3a2a66; font-variant-numeric: tabular-nums; }
.copied-note { margin-left: 4px; }

/* =====================================================================
   PATCH STUDIO (dmx.html)
   ===================================================================== */
.studio-grid { display: grid; gap: 20px; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr); align-items: start; }
.studio-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 18px; min-width: 0; }
.studio-main { min-width: 0; }
/* 1080, not 980: the 9-column sheet's floor is ~690px, which a two-column layout can't
   honor below ~1080. Single column gives the patch sheet: the artefact: full width. */
@media (max-width: 1080px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } .studio-side { position: static; } }

/* patch header (show / venue / date / LD) */
.meta-card { display: grid; grid-template-columns: 1.5fr 1.5fr .9fr 1.1fr; gap: 16px; padding: 16px 18px; margin-bottom: 18px; }
@media (max-width: 760px) { .meta-card { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .meta-card { grid-template-columns: 1fr; } }
.meta-field { display: flex; flex-direction: column; gap: 6px; }
.meta-field > span { font-size: 11px; font-weight: 600; color: var(--tx-faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---- add card ---- */
.add-card .field { margin-bottom: 18px; }
.add-card .field:last-child { margin-bottom: 0; }
.pos-input { font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx-dim);
  transition: all .14s; }
.chip:hover { color: var(--tx); border-color: var(--purple-l); }
.chip.active { background: linear-gradient(145deg, var(--purple-l), var(--purple)); border-color: transparent; color: #fff; box-shadow: 0 3px 12px -4px rgba(125,40,219,.8); }

/* searchable fixture combobox */
.combo { position: relative; }
.combo-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx-faint); pointer-events: none; display: inline-flex; }
/* element+class selector beats app.css `input[type='text']` so the search icon never overlaps the text */
.combo input.combo-input { width: 100%; padding-left: 38px; }
.combo-panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: 320px; overflow-y: auto;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.combo-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--tx-faint); padding: 9px 10px 4px; font-weight: 700; }
.combo-opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-opt:hover { background: var(--el-2); }
.combo-opt .co-name { font-weight: 600; font-size: 13.5px; }
.combo-opt.custom { border-top: 1px solid var(--line); margin-top: 4px; }
.combo-opt.custom .co-name { color: var(--purple-xl); }
.ch-in { width: 90px; text-align: center; }
.chan-add-in { width: 110px; text-align: left; }
/* duplicate fixture IDs get an amber outline on the sheet (screen-only editing aid) */
.chan-edit.dup { outline: 2px solid var(--warn, #ffb454); outline-offset: -2px; border-radius: 6px; }
.custom-wrap { margin-top: 10px; }

/* mode pills */
.mode-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-pill { appearance: none; cursor: pointer; font: inherit; text-align: left; display: flex; flex-direction: column; gap: 1px;
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx); transition: all .14s; }
.mode-pill:hover { border-color: var(--purple-l); }
.mode-pill.active { border-color: var(--purple-l); background: linear-gradient(180deg, #241640, var(--el)); box-shadow: inset 0 0 0 1px rgba(155,77,255,.4); }
.mode-pill b { font-weight: 600; font-size: 13px; }
.mode-pill small { color: var(--tx-dim); font-size: 11px; }

/* qty stepper + add */
.qty-add { display: flex; align-items: center; gap: 12px; }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px; flex: none; }
.step-btn { appearance: none; cursor: pointer; border: 0; background: transparent; color: var(--tx-dim); width: 34px; height: 34px; flex: none; padding: 0; display: grid; place-items: center; border-radius: 8px; transition: all .14s; }
.step-btn:hover { color: #fff; background: var(--el-2); }
/* input.qty-in, not .qty-in: app.css `input[type='text']` is (0,1,1) and would stretch the count to
   100% width, squashing the Add button beside it (the 006b5ea regression) */
input.qty-in { min-width: 34px; width: 52px; text-align: center; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; background: none; border: 0; color: inherit; padding: 0; }
input.qty-in:focus-visible { outline: 2px solid var(--purple-l, #9b4dff); outline-offset: 2px; border-radius: 6px; }
.add-btn { flex: 1; justify-content: center; font-size: 14.5px; padding: 11px 16px; }

/* settings */
.settings-card .field { margin-bottom: 16px; }
.settings-card .field:last-child { margin-bottom: 0; }

/* ---- Standard vs Advanced mode ---- */
.adv-hint { display: none; }
body.advanced .adv-hint { display: block; }
body.advanced .std-only { display: none; }     /* reflow ignores the auto-fill flow control */
body.advanced .pin-ctl { display: none !important; }  /* locks replace per-bar universe pins */

/* lock buttons (universe + fixture) */
.lock-btn { appearance: none; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx-dim); transition: all .14s; }
.lock-btn:hover { color: var(--tx); border-color: var(--purple-l); }
.lock-btn.on { background: linear-gradient(145deg, var(--purple-l), var(--purple)); border-color: transparent; color: #fff; }
.fx-lock.on { color: var(--purple-xl); }
.fx-lock.on:hover { color: #fff; background: var(--purple); border-color: var(--purple); }

/* locked styling */
.universe-row.locked .universe-track { outline: 2px solid var(--purple-l); outline-offset: 1px; }
.fx-row.locked td { background: linear-gradient(90deg, rgba(155,77,255,.08), transparent) !important; }
.fx-row.locked .addr-num { background: linear-gradient(160deg, #fff, var(--purple-l)); -webkit-background-clip: text; background-clip: text; }
.fx-row.unplaced td { background: rgba(252,165,165,.08) !important; }
.fx-row.unplaced .addr-num { -webkit-text-fill-color: var(--bad); }

/* tour-mode hint above the sheet */
.sheet-adv-hint { display: flex; align-items: center; gap: 9px; margin: 10px 0 2px; padding: 10px 13px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(155,77,255,.12), transparent); border: 1px solid var(--line-2); border-left: 3px solid var(--purple-l);
  border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: var(--tx-dim); }
.sheet-adv-hint > .ic { color: var(--purple-xl); flex: none; }
.sheet-adv-hint > span { flex: 1; min-width: 200px; }
.sheet-adv-hint span.ic { color: var(--purple-xl); vertical-align: -1px; }
.sheet-adv-hint b { color: var(--tx); font-weight: 700; }
.sheet-adv-hint .btn { flex: none; }

/* Standard-mode discoverability: advertise Tour-mode locking right in the sheet */
.sheet-std-cta { display: flex; align-items: center; gap: 11px; margin: 10px 0 2px; padding: 11px 14px;
  background: linear-gradient(90deg, rgba(155,77,255,.14), rgba(155,77,255,.04)); border: 1px solid var(--line-2); border-radius: 11px; font-size: 12.5px; line-height: 1.45; color: var(--tx-dim); flex-wrap: wrap; }
.sheet-std-cta > .ic { color: var(--purple-xl); flex: none; }
.sheet-std-cta b { color: var(--tx); font-weight: 700; }
.sheet-std-cta > span { flex: 1; min-width: 160px; }
.sheet-std-cta .btn { flex: none; }

/* Advanced/tour row: typed universe (a "U" chip you type a number into) + editable address
   with a prominent lock (element+class selectors: app.css input rules must not win) */
.uni-edit-wrap { display: inline-flex; align-items: center; gap: 1px; padding: 3px 3px 3px 8px; background: #1a1430; border: 1px solid #3a2a66;
  border-radius: 7px; color: var(--purple-xl); font-family: 'Poppins', sans-serif; transition: border-color .14s; }
.uni-edit-wrap > b { font-size: 11.5px; font-weight: 700; }
.uni-edit-wrap:hover, .uni-edit-wrap:focus-within { border-color: var(--purple-l); }
input.uni-edit { width: 30px; padding: 0 2px; font-size: 12.5px; font-weight: 700; text-align: left; color: var(--purple-xl);
  background: transparent; border: 0; border-radius: 0; font-family: 'Poppins', sans-serif; font-variant-numeric: tabular-nums; }
input.uni-edit:focus-visible { outline: none; box-shadow: none; }
input.uni-edit::-webkit-outer-spin-button, input.uni-edit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.addr-static { display: inline-flex; align-items: baseline; gap: 6px; }
/* input + lock are an atomic .addr-main group the table can never split; the state pill
   (clash / no fit) wraps onto its own line under it rather than bleeding sideways */
.addr-edit-wrap { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; row-gap: 4px; max-width: 112px; justify-content: flex-end; }
.addr-edit-wrap > * { flex: none; }
.addr-main { display: inline-flex; align-items: center; gap: 7px; flex: none; }
input.addr-edit { width: 56px; padding: 6px 6px; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 17px; text-align: center;
  color: var(--purple-xl); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; font-variant-numeric: tabular-nums; transition: border-color .14s; }
input.addr-edit::-webkit-outer-spin-button, input.addr-edit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.addr-edit:hover, input.addr-edit:focus { border-color: var(--purple-l); }
.addr-lock { appearance: none; cursor: pointer; flex: none; width: 33px; height: 33px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx-faint); transition: all .14s; }
.addr-lock:hover { color: #fff; border-color: var(--purple-l); }
.addr-lock.on { background: linear-gradient(145deg, var(--purple-l), var(--purple)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px -4px rgba(125,40,219,.9); }
.fx-row.locked .addr-edit { border-color: var(--purple-l); background: linear-gradient(160deg, #241640, var(--bg)); }
.pos-lock { flex: none; }

/* ---- summary card ---- */
.summary-card { padding: 20px 22px; }
.stats { display: flex; gap: 30px; flex-wrap: wrap; }
.stats .stat { display: flex; flex-direction: column; line-height: 1.05; }
.stats .stat b { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 34px;
  background: linear-gradient(160deg, #fff, var(--purple-xl)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stats .stat span { font-size: 12px; color: var(--tx-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; }

/* universe selector tabs */
.uni-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.uni-tab { appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx-dim); transition: all .14s; }
.uni-tab:hover { color: var(--tx); border-color: var(--purple-l); }
.uni-tab.active { background: linear-gradient(145deg, var(--purple-l), var(--purple)); border-color: transparent; color: #fff; box-shadow: 0 3px 12px -4px rgba(125,40,219,.8); }
.uni-tab .ic { opacity: .85; }
.uni-tab .dot-u { width: 8px; height: 8px; border-radius: 50%; }
.uni-tab-pct { font-variant-numeric: tabular-nums; opacity: .85; font-size: 11px; } /* .7 measured 3.64:1 at 11px; 4.5 needed */
.uni-tab.active .uni-tab-pct { opacity: 1; }

/* per-universe fill bars */
.universe-row { margin-top: 16px; }
.uni-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.uni-row-head b { font-family: 'Poppins', sans-serif; font-weight: 700; }
.universe-track { position: relative; height: 32px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-2);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px calc(100%/32)), var(--bg); }
.universe-bar { position: absolute; inset: 0; }
.uni-seg { position: absolute; top: 0; bottom: 0; border-right: 1px solid rgba(0,0,0,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); transition: width .2s ease; }

/* ---- sheet card ---- */
/* overflow-x: a 9-column sheet on a narrow window scrolls inside its card, never the page */
.sheet-card { padding: 20px 22px; overflow-x: auto; }
/* 1081-1170 window band: two columns only fit if the side rail is pinned to its minimum.
   min-width bound so the 1080px single-column collapse below still wins */
@media (min-width: 1081px) and (max-width: 1170px) {
  .studio-grid { grid-template-columns: 280px minmax(0, 1fr); }
}
.sheet-card .card-head { margin-bottom: 6px; }
.tag-filter { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--purple-xl); background: #1a1430; border: 1px solid #3a2a66; padding: 3px 10px; border-radius: 999px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 40px 20px; color: var(--tx-dim); }
.empty .ic { color: var(--purple-l); opacity: .8; }
.empty p { margin: 4px 0 0; font-weight: 600; color: var(--tx); }

.patch-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.patch-table thead th { text-align: left; color: var(--tx-faint); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.patch-table th.c-n, .patch-table td.c-n { width: 44px; text-align: center; color: var(--tx-faint); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.patch-table th.c-chan, .patch-table td.c-chan { width: 76px; text-align: center; }
.patch-table th.c-gel, .patch-table td.c-gel { width: 72px; }
.patch-table th.c-mode, .patch-table td.c-mode { white-space: nowrap; }
.patch-table th.c-uni, .patch-table td.c-uni { width: 52px; text-align: center; }
.patch-table th.c-addr, .patch-table td.c-addr { text-align: right; white-space: nowrap; }
.patch-table th.c-ch, .patch-table td.c-ch { text-align: right; white-space: nowrap; color: var(--tx-dim); font-variant-numeric: tabular-nums; }
.patch-table th.c-x, .patch-table td.c-x { width: 30px; text-align: right; }
.patch-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.patch-table .fx-row { transition: background .12s; }
.patch-table .fx-row:hover td { background: rgba(155,77,255,.05); }
.patch-table .fx-row td b { font-weight: 600; }
.patch-table .fx-row.over td { background: rgba(252,165,165,.06); }
.uni-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #1a1430; color: var(--purple-xl); border: 1px solid #3a2a66; font-family: 'Poppins', sans-serif; font-variant-numeric: tabular-nums; }
.addr-num { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums;
  background: linear-gradient(160deg, #fff, var(--purple-xl)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.pos-row td { padding: 0; border-bottom: 0; }
.pos-head-inner { display: flex; align-items: center; gap: 10px; margin: 20px 0 4px; padding: 0 4px 8px; border-bottom: 1px solid var(--line-2); }
.pos-group:first-child .pos-head-inner { margin-top: 6px; }
.pos-head-inner .dot { width: 11px; height: 11px; border-radius: 3px; box-shadow: 0 0 0 3px rgba(255,255,255,.06); flex: none; }
/* colour dot is a real button opening a swatch popover; padding buys the 24px+ hit area */
.dot-wrap { position: relative; display: inline-flex; flex: none; }
.dot-btn { border: 0; padding: 7px; margin: -7px; background-clip: content-box !important; cursor: pointer; box-sizing: content-box; }
.dot-btn:hover, .dot-btn:focus-visible { box-shadow: 0 0 0 3px rgba(255,255,255,.22); outline: none; }
.dot-pop { position: absolute; z-index: 30; top: calc(100% + 8px); left: -6px; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; background: var(--el, #1d1430); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0,0,0,.45); min-width: 196px; }
.dot-pop-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dot-swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.dot-swatch:hover, .dot-swatch:focus-visible { border-color: rgba(255,255,255,.7); outline: none; }
.dot-swatch.active { border-color: #fff; }
.dot-pop-row { display: flex; gap: 8px; }
.dot-pop-row .btn { flex: 1; justify-content: center; }
.dot-custom-lbl { position: relative; overflow: hidden; cursor: pointer; }
.dot-custom-in { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.print-only-dot { display: none; }
.pos-head-inner .pos-name { font-family: 'Poppins', sans-serif; font-size: 15.5px; font-weight: 700; }
.pos-spacer { flex: 1; }
.reorder { display: inline-flex; gap: 2px; }

.icon-btn { appearance: none; cursor: pointer; border: 1px solid transparent; background: transparent; color: var(--tx-faint);
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; transition: all .14s; }
.icon-btn:hover:not(:disabled) { color: #fff; background: var(--el-2); border-color: var(--line-2); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
/* chunked action groups: export / files / danger read as three clusters, not 8 flat pills */
.act-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-group + .act-group { padding-left: 14px; border-left: 1px solid var(--line-2); }
.act-group .exp-beta { margin-left: 6px; }
.exp-beta-note { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; color: var(--tx);
  background: var(--el); border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); border-radius: var(--radius-sm); }
.exp-beta-note .ic { color: var(--warn); flex: none; }

/* conflict / clash signalling: a doubled-up address is allowed, but it reads RED everywhere */
.stats .stat.conflict b { background: none; -webkit-text-fill-color: var(--bad); color: var(--bad); }
.fx-row.clash td { background: rgba(248,113,113,.10) !important; }
.fx-row.clash td:first-child { box-shadow: inset 3px 0 0 0 var(--bad); }
.fx-row.clash .addr-num { background: none; -webkit-text-fill-color: var(--bad); color: var(--bad); }
.fx-row.clash .addr-edit { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.fx-row.clash .uni-tag, .fx-row.clash .uni-edit-wrap { border-color: #5a1f25; color: var(--bad); background: var(--bad-bg); }
.fx-row.clash input.uni-edit { color: var(--bad); }
.uni-seg.clash { outline: 1px solid #fff; outline-offset: -1px; }

/* optional hand-placement on add: typed universe number + typed start address */
.addr-add-row { display: flex; align-items: center; gap: 8px; }
/* pro fields (fixture ID + placement) fold behind a disclosure; summary mirrors live values */
.adv-fields { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); }
.adv-sum { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--tx); user-select: none; }
.adv-sum::-webkit-details-marker { display: none; }
.adv-sum::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--tx-3, #888); border-bottom: 2px solid var(--tx-3, #888);
  transform: rotate(45deg); margin-left: auto; transition: transform .15s ease; flex: none; }
.adv-fields[open] .adv-sum::after { transform: rotate(-135deg); }
.adv-sum .ic { color: var(--purple-l); flex: none; }
.adv-sum-val { margin-left: 4px; font-size: 12px; color: var(--tx-3, #999); font-variant-numeric: tabular-nums; }
.adv-fields > .field { padding: 0 12px 12px; }
.adv-fields .hint { margin-top: 6px; }
.uni-add-wrap { display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 12px; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 11px; color: var(--purple-xl); font-family: 'Poppins', sans-serif; transition: opacity .14s, border-color .14s; cursor: text; }
.uni-add-wrap > b { font-size: 13px; font-weight: 700; }
.uni-add-wrap.dim { opacity: .45; }
.uni-add-wrap:focus-within { border-color: var(--purple-l); }
input.uni-add { width: 42px; padding: 9px 4px; font-size: 13px; font-weight: 700; font-family: 'Poppins', sans-serif; color: var(--purple-xl);
  background: transparent; border: 0; text-align: left; font-variant-numeric: tabular-nums; }
input.uni-add:focus-visible { outline: none; box-shadow: none; }
input.uni-add::-webkit-outer-spin-button, input.uni-add::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.addr-add-in { width: 100px; }
.same-addr-lbl { margin-top: 8px; }
.same-addr-lbl span { line-height: 1.4; }

/* per-position pin control (manual addressing) */
.pin-ctl { display: inline-flex; align-items: center; gap: 6px; }
.pin-lbl { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--tx-faint); font-weight: 600; }
.pin-lbl .ic { color: var(--tx-faint); }
input.pin-uni { width: 64px; padding: 4px 8px; font-size: 12px; font-weight: 600; text-align: center; }
.pin-addr { width: 64px; padding: 4px 8px; font-size: 12px; text-align: center; }

/* inline mode select on a row (blends in until focused) */
.mode-select { appearance: none; background: transparent; border: 1px solid transparent; color: var(--tx-dim); font: inherit; font-size: 12.5px;
  padding: 3px 22px 3px 7px; border-radius: 7px; cursor: pointer; max-width: 100%; min-width: 58px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0b4' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; }
.mode-select:hover { border-color: var(--line-2); color: var(--tx); }
.mode-select:focus { border-color: var(--purple-l); color: var(--tx); }

/* paperwork columns: Unit # (assigns the order), console Channel, Gel colour.
   element+class selectors so they beat app.css `input[type='number']` (the specificity trap) */
input.unit-edit { width: 40px; font: inherit; font-size: 12.5px; font-weight: 700; text-align: center; color: var(--tx-dim); font-variant-numeric: tabular-nums;
  background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 2px; transition: all .14s; }
input.unit-edit:hover { border-color: var(--line-2); color: var(--tx); }
input.unit-edit:focus { border-color: var(--purple-l); color: var(--tx); background: var(--bg); }
input.unit-edit::-webkit-outer-spin-button, input.unit-edit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* channel + gel read as paper form fields: a dashed "write here" underline until filled */
input.chan-edit { width: 48px; text-align: center; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
input.gel-edit { width: 66px; font: inherit; font-size: 12.5px; }
input.chan-edit, input.gel-edit { color: var(--tx); background: transparent; border: 1px solid transparent; border-bottom: 1px dashed var(--line-2); border-radius: 0; padding: 4px 5px; transition: all .14s; }
input.chan-edit:hover, input.gel-edit:hover { border-bottom-color: var(--purple-l); }
input.chan-edit:focus, input.gel-edit:focus { border-color: var(--purple-l); border-bottom-style: solid; border-radius: 7px; background: var(--bg); }
input.chan-edit::-webkit-outer-spin-button, input.chan-edit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* visible rename pencil beside each position name */
.rename-btn { width: 24px; height: 24px; min-width: 24px; min-height: 24px; margin-left: -4px; }

/* inline rename input */
.rename-in { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 15.5px; padding: 2px 8px; width: 180px; }

/* undo / status toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  display: flex; align-items: center; gap: 16px; padding: 11px 16px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line-2); box-shadow: 0 14px 40px -10px rgba(0,0,0,.8); font-size: 13.5px; }
.toast-undo { appearance: none; cursor: pointer; border: 0; background: transparent; color: var(--purple-xl); font: inherit; font-weight: 700; }
.toast-undo:hover { text-decoration: underline; }

/* help button + guided tour */
.help-btn { display: inline-flex; align-items: center; gap: 5px; appearance: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx-dim); transition: all .14s; }
.help-btn:hover { color: #fff; border-color: var(--purple-l); }
.help-btn .ic { color: var(--purple-xl); }

.tour-overlay { position: fixed; inset: 0; z-index: 300; }
.tour-spot { position: fixed; display: none; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8, 8, 14, .66), 0 0 0 2px var(--purple-l), 0 0 24px 4px rgba(155, 77, 255, .5);
  transition: top .25s cubic-bezier(.4,0,.2,1), left .25s cubic-bezier(.4,0,.2,1), width .25s, height .25s; }
.tour-card { position: fixed; width: 330px; max-width: calc(100vw - 28px); z-index: 301; padding: 18px;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px -12px rgba(0,0,0,.85); }
.tour-card:focus { outline: none; }
.tour-step { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--purple-xl); }
.tour-card h2, .tour-card h4 { margin: 7px 0 6px; font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.tour-card p { margin: 0; color: var(--tx-dim); font-size: 13.5px; line-height: 1.55; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

@media (max-width: 700px) { .pin-lbl { display: none; } }

/* mid widths (tablet portrait through small desktop): slim the sheet's paddings so the
   9-column table (Tour mode needs ~720px at full padding) always fits without scrolling.
   AFTER the base .patch-table rules: equal specificity, so source order decides. */
@media (min-width: 741px) and (max-width: 1170px) {
  .sheet-card, .summary-card { padding: 16px 10px; }
  .patch-table thead th { padding: 8px 6px; }
  .patch-table td { padding: 10px 6px; }
}

/* ===================== phones: proper mobile layout =====================
   740px, not 560: with the Unit/Channel/Gel columns the full table needs ~700px
   incl. card padding, so everything below iPad-portrait (768) reads as cards */
@media (max-width: 740px) {
  /* 16px inputs so iOS doesn't zoom the page on focus (match app.css attribute-selector specificity) */
  input[type='text'], input[type='number'], input[type='date'], select { font-size: 16px; }
  .addr-box { font-size: 26px; }

  .summary-card, .sheet-card, .add-card, .settings-card, .meta-card { padding: 16px 14px; }
  .studio-grid { gap: 14px; }
  .stats { gap: 18px; }
  .stats .stat b { font-size: 28px; }

  /* ≥44px touch targets (Apple HIG / Material). min-* defeats flex min-content shrink. */
  .icon-btn { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
  .reorder { gap: 4px; }
  .step-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  input.qty-in { min-width: 30px; width: 44px; }
  .chip { padding: 10px 15px; }
  .mode-pill { padding: 10px 14px; }
  .uni-tab { padding: 10px 14px; }
  .seg button { padding: 10px 14px; }
  .combo-opt { padding: 12px 10px; }
  .combo-panel { max-height: 52vh; }
  .btn { padding: 12px 16px; }
  /* .btn.sm / .seg.sm button carry (0,2,0)/(0,2,1) base rules in app.css, so the plain .btn and
     .seg button bumps above never reached them: 34px and 29px tall on a phone. Same for the row
     inputs, the mode select and the colour dot (a 25px hit area on an 11px swatch). */
  .btn.sm { padding: 10px 14px; font-size: 13.5px; min-height: 42px; }
  .seg.sm button { padding: 10px 14px; font-size: 13.5px; }
  .help-btn { padding: 11px 14px; }
  /* the swatch's ring is a box-shadow, so widen the hit area with a pseudo-element, not padding */
  .dot-btn { position: relative; }
  .dot-btn::after { content: ''; position: absolute; inset: -9px; }
  input.unit-edit, input.chan-edit, input.gel-edit { padding: 9px 6px; }
  .mode-select { padding: 10px 26px 10px 9px; font-size: 13.5px; background-position: right 8px center; }
  /* the count field fills its 52px stepper so a tap anywhere between the arrows focuses it */
  input.qty-in { height: 44px; }
  /* click-to-rename position name: pad the hit area without moving the text */
  .pos-head-inner .pos-name { padding: 9px 6px; margin: -9px -6px; }
  .show-bar-inner .show-switch { padding: 9px 11px 9px 13px; } /* (0,2,0): the base rule sits after this block */
  .pin-uni, .pin-addr { padding: 9px 10px; }

  /* patch sheet: table -> stacked cards (no horizontal scroll, no cramped columns).
     Actions sit top-right beside the name; universe/address/channels share row two;
     a multi-mode fixture gets its mode picker on a third row. */
  .patch-table, .patch-table tbody, .pos-group { display: block; min-width: 0; }
  .patch-table thead { display: none; }
  .pos-row, .pos-row > td { display: block; padding: 0; border: 0; }
  .fx-row { display: grid; align-items: center; column-gap: 10px; row-gap: 8px;
    grid-template-columns: max-content max-content minmax(0, 1fr);
    grid-template-areas: "name name name" "uni addr ch" "unit chan gel" "mode mode mode";
    border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; }
  .fx-row td { padding: 0; border: 0; min-width: 0; }
  /* the table's fixed column widths (td.c-uni 52px, td.c-x 30px, ...) are (0,2,1) rules for the desktop
     table; on cards they clipped the unit input into the ID label and pushed the delete button out of
     the card. Same specificity, later in the file, so this wins. */
  .patch-table .fx-row td { width: auto; }
  /* Tour mode: the address + lock cluster needs the room, so the DMX range takes its own line */
  body.advanced .fx-row { grid-template-areas: "name name name" "uni addr addr" "ch ch ch" "unit chan gel" "mode mode mode"; }
  /* name and actions share the top row: the buttons no longer own a fourth column (which starved
     the paperwork columns and let a long name run under the icons); the padding keeps them apart */
  .fx-row .c-fx { grid-area: name; padding-right: 100px; min-height: 42px; display: flex; align-items: center; }
  .fx-row .c-fx b { font-size: 15px; }
  .fx-row .c-uni { grid-area: uni; }
  .fx-row .c-addr { grid-area: addr; display: flex; align-items: center; gap: 6px; }
  .fx-row .c-addr::before { content: 'Addr'; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tx-faint); }
  body.advanced .fx-row .c-addr::before { display: none; } /* tour mode: the input + lock speak for themselves */
  .fx-row .c-ch { grid-area: ch; justify-self: end; }
  .fx-row .c-ch::before { content: 'DMX '; color: var(--tx-faint); }
  /* paperwork row: unit # + console channel + gel colour, each with a tiny label */
  .fx-row .c-n, .fx-row .c-chan, .fx-row .c-gel { display: flex; align-items: center; gap: 6px; width: auto; }
  .fx-row .c-n::before, .fx-row .c-chan::before, .fx-row .c-gel::before {
    font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tx-faint); }
  .fx-row .c-n { grid-area: unit; }
  .fx-row .c-n::before { content: 'Unit'; }
  .fx-row .c-chan { grid-area: chan; }
  .fx-row .c-chan::before { content: 'ID'; }
  .fx-row .c-gel { grid-area: gel; min-width: 0; }
  .fx-row .c-gel::before { content: 'Gel'; }
  .fx-row .c-gel input.gel-edit { flex: 1; min-width: 36px; width: auto; } /* 72px pushed the row through the card padding at 320 */
  /* no hover on touch: give the unit number the same "editable" dashed cue as CH/GEL */
  input.unit-edit { width: 48px; flex: none; border-radius: 0; border-bottom: 1px dashed var(--line-2); }
  .fx-row .c-gel { min-width: 0; }
  input.chan-edit { width: 58px; flex: none; }
  input.uni-edit { width: 40px; }
  input.pin-uni { padding: 9px 10px; }
  .fx-row .c-x { grid-area: name; justify-self: end; align-self: start; display: flex; gap: 8px; }
  /* Tour mode targets */
  .addr-lock { width: 40px; height: 40px; }
  input.addr-edit { padding: 8px 6px; }
  input.uni-edit { padding: 7px 2px; }
  .lock-btn { padding: 10px 12px; min-height: 40px; }
  /* single-mode fixtures hide the mode cell; multi-mode ones keep their picker on the card */
  .fx-row .c-mode, .patch-table thead .c-mode { display: none; }
  /* solid, not dashed: the unit/ch/gel underlines above are already dashed "write here" cues, and two dashed rules 16px apart read as a mistake */
  .fx-row .c-mode:has(.mode-select) { display: block; grid-area: mode; border-top: 1px solid var(--line); padding-top: 8px; }
  .patch-table .fx-row:hover td { background: none; } /* sticky touch hover would leave grey cells behind after a tap */
  .fx-row.clash { border-color: var(--bad); }
  .fx-row.clash td { background: none !important; }
  .fx-row.clash td:first-child { box-shadow: none; } /* the red edge stripe belongs to the table layout */
  /* state reads on the whole card on phones, never as per-cell stripes */
  .fx-row.locked { border-color: var(--purple-l); background: linear-gradient(180deg, rgba(155,77,255,.07), transparent); }
  .fx-row.locked td { background: none !important; }
  .fx-row.unplaced { border-color: var(--bad); background: rgba(252,165,165,.05); }
  .fx-row.unplaced td { background: none !important; }

  /* universe summary rows: title + lock on line one, the used/free meta on its own line */
  .uni-row-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 3px; }
  .uni-row-head b { grid-column: 1; grid-row: 1; white-space: nowrap; }
  .uni-row-head > .muted { grid-column: 1 / -1; grid-row: 2; }
  .uni-row-head .pos-spacer { display: none; }
  .uni-row-head .lock-btn { grid-column: 2; grid-row: 1; justify-self: end; }

  /* position header: drop the controls to their own line so they never overflow */
  .pos-head-inner { flex-wrap: wrap; row-gap: 10px; }
  .pos-spacer { flex-basis: 100%; height: 0; }
  .pin-ctl { flex-wrap: wrap; }

  /* toast clears the home-indicator / notch safe areas */
  .toast { left: 14px; right: 14px; transform: none; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .actions { gap: 8px; }
}

/* =====================================================================
   SHOW BAR: saved shows (a touring rig book)
   ===================================================================== */
.show-bar { margin-bottom: 14px; }
.show-bar-inner { display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2); border-radius: 13px; padding: 9px 12px; }
.show-bar-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tx-faint); }
.show-bar-lbl .ic { color: var(--purple-xl); }
.show-switch-wrap { position: relative; }
.show-switch { appearance: none; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 11px 7px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx); transition: all .14s; max-width: min(60vw, 360px); }
.show-switch:hover { border-color: var(--purple-l); }
.show-switch.open { border-color: var(--purple-l); box-shadow: inset 0 0 0 1px rgba(155,77,255,.35); }
.show-switch b { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-switch-meta { flex: none; padding: 1px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.show-switch .ic { color: var(--tx-dim); flex: none; }
.show-rename { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 14.5px; padding: 6px 11px; width: min(60vw, 300px); }
.new-show-btn { flex: none; }

.show-menu { position: absolute; top: calc(100% + 7px); left: 0; z-index: 60; width: 320px; max-width: calc(100vw - 32px);
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 13px; box-shadow: 0 20px 56px -14px rgba(0,0,0,.85); overflow: hidden; }
.show-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.show-item { width: 100%; appearance: none; cursor: pointer; font: inherit; text-align: left; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--tx); transition: background .12s; }
.show-item:hover { background: var(--el); }
.show-item.active { background: linear-gradient(90deg, rgba(155,77,255,.14), transparent); }
.show-item-check { display: inline-flex; justify-content: center; color: var(--purple-xl); }
.show-item-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-item-meta { flex: none; font-variant-numeric: tabular-nums; }
.show-menu-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 7px; border-top: 1px solid var(--line); background: var(--card); }
.show-act { appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--tx-dim); transition: all .12s; }
.show-act:hover { background: var(--el); color: var(--tx); }
.show-act .ic { color: var(--tx-faint); }
.show-act:hover .ic { color: var(--purple-xl); }
.show-act.danger:hover { background: var(--bad-bg); color: var(--bad); }
.show-act.danger:hover .ic { color: var(--bad); }

/* custom-fixture quick-save toggle + browse button */
.save-custom-lbl { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; font-size: 12.5px; color: var(--tx-dim); }
.save-custom-lbl input { width: 16px; height: 16px; accent-color: var(--purple-l); cursor: pointer; }
.browse-lib-btn { margin-top: 10px; width: 100%; justify-content: center; color: var(--tx-dim); }
.browse-lib-btn:hover { color: #fff; }
/* Hire fleet: the mark that says whose fixtures these are, and the action that turns a patch into a quote. */
.fleet-chip { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--purple-xl); background: rgba(125, 40, 219, .18); border: 1px solid rgba(155, 77, 255, .55); vertical-align: 2px; white-space: nowrap; }
.fleet-link { font-size: 12.5px; color: var(--purple-xl); text-decoration: underline; text-underline-offset: 3px; align-self: center; margin-left: 4px; }
.btn.hire { border-color: rgba(155, 77, 255, .7); color: var(--purple-xl); }
.btn.hire:hover:not([disabled]) { background: rgba(125, 40, 219, .22); border-color: var(--purple-l); }
.btn.hire[disabled] { opacity: .45; cursor: not-allowed; }
.combo-opt.request { border-top: 1px solid var(--line); margin-top: 4px; text-decoration: none; color: inherit; }
.combo-opt.request .co-name { color: var(--purple-xl); }
.combo-opt.browse { border-top: 1px solid var(--line); margin-top: 4px; }
.combo-opt.browse .co-name { display: inline-flex; align-items: center; gap: 7px; color: var(--purple-xl); font-weight: 600; }
.combo-opt.browse .co-name .ic { color: var(--purple-xl); }

/* =====================================================================
   FIXTURE LIBRARY MODAL: console-style browse-by-brand
   ===================================================================== */
.lib-modal { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; }
.lib-backdrop { position: fixed; inset: 0; background: rgba(6,6,12,.74); backdrop-filter: blur(3px); }
.lib-panel { position: relative; z-index: 1; width: min(1080px, 100%); height: min(86vh, 820px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 100px -24px rgba(0,0,0,.85); overflow: hidden; }
.toast { z-index: 400; }
body.lib-open { overflow: hidden; }

.lib-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.lib-title { display: flex; align-items: center; gap: 9px; flex: 1; }
.lib-title .ic { color: var(--purple-xl); }
.lib-title b { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; }
.lib-count { margin-left: 4px; }
.lib-close { flex: none; }

.lib-tools { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lib-search { position: relative; flex: 1; min-width: 220px; }
.lib-search .combo-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--tx-faint); pointer-events: none; display: inline-flex; }
.lib-search input.lib-search-input { width: 100%; padding-left: 40px; }
.lib-source { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 11px; padding: 4px; }
.lib-src-btn { appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 8px; border: 0; background: transparent; color: var(--tx-dim); transition: all .14s; white-space: nowrap; }
.lib-src-btn:hover { color: var(--tx); }
.lib-src-btn.active { background: linear-gradient(145deg, var(--purple-l), var(--purple)); color: #fff; box-shadow: 0 3px 12px -5px rgba(125,40,219,.9); }

.lib-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 216px 1fr; }
.lib-brands { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.lib-brands.hidden { display: none; }
.lib-brands.hidden + .lib-list { grid-column: 1 / -1; }
.lib-brand { appearance: none; cursor: pointer; font: inherit; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border-radius: 9px; border: 0; background: transparent; color: var(--tx-dim); font-size: 13px; font-weight: 500; transition: all .12s; }
.lib-brand:hover { background: var(--el); color: var(--tx); }
.lib-brand.active { background: linear-gradient(90deg, rgba(155,77,255,.16), transparent); color: #fff; font-weight: 600; }
.lib-brand-n { flex: none; font-size: 11px; color: var(--tx-faint); font-variant-numeric: tabular-nums; }
.lib-brand.active .lib-brand-n { color: var(--purple-xl); }

.lib-list { overflow-y: auto; padding: 16px 18px; }
/* align-items:start keeps each card its natural height, so mode chips sit right under the
   fixture name instead of being pushed to the bottom of the tallest card in the row */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; align-items: start; }
.lib-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px; display: flex; flex-direction: column; gap: 10px; transition: border-color .14s; }
.lib-card:hover { border-color: var(--line-2); }
.lib-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lib-card-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lib-card-brand { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-faint); font-weight: 700; }
.lib-card-name b { font-weight: 600; font-size: 14px; line-height: 1.25; }
.lib-card-acts { display: inline-flex; gap: 2px; flex: none; }
.lib-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.lib-mode { appearance: none; cursor: pointer; font: inherit; text-align: left; display: inline-flex; flex-direction: column; gap: 0;
  padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--el); color: var(--tx); transition: all .12s; }
.lib-mode:hover { border-color: var(--purple-l); background: linear-gradient(180deg, #241640, var(--el)); }
.lib-mode b { font-weight: 600; font-size: 12.5px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-mode small { color: var(--tx-dim); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.lib-mode.added { border-color: var(--good, #7CFFB2); background: rgba(124,255,178,.16); animation: lib-pop .3s ease; }
@keyframes lib-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

.lib-custom-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.lib-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 56px 20px; color: var(--tx-dim); }
.lib-empty .ic { color: var(--purple-l); opacity: .7; }
.lib-empty p { margin: 4px 0 0; font-weight: 600; color: var(--tx); }
.lib-trunc { margin-top: 14px; text-align: center; }

/* custom-fixture editor */
.lib-editor { max-width: 560px; }
.lib-editor h4 { margin: 0 0 16px; font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; }
.lib-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.lib-edit-row label { display: flex; flex-direction: column; gap: 6px; }
.lib-edit-modes { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.lib-edit-mode { display: flex; align-items: center; gap: 8px; }
.lib-edit-mode input[type='text'] { flex: 1; }
.lib-edit-actions { display: flex; gap: 10px; margin-top: 20px; }

/* export show-file modal (shares the lib-modal shell) */
.exp-panel { width: min(760px, 100%); height: auto; max-height: min(86vh, 820px); }
.exp-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.exp-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  background: var(--el); border: 1px solid var(--line-2); border-radius: var(--radius-sm); flex-wrap: wrap; }
.exp-renum { display: flex; align-items: center; gap: 8px; }
.exp-start-in { width: 64px; }
.exp-warnings { display: flex; flex-direction: column; gap: 8px; }
.exp-warnings:empty { display: none; }
.exp-warn { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; font-size: 13px;
  background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: var(--radius-sm); color: var(--tx); }
.exp-warn .ic { color: var(--warn); flex: none; margin-top: 1px; }
.exp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exp-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--el);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.exp-card.primary { border-color: var(--purple-l); box-shadow: var(--glow); }
.exp-card p { margin: 0; flex: 1; }
.exp-card .btn { align-self: flex-start; }
.exp-card-head { display: flex; align-items: center; gap: 8px; }
.exp-card-head b { font-family: 'Poppins', sans-serif; font-size: 14.5px; }
.exp-ext { margin-left: auto; font-size: 11px; color: var(--tx-faint); font-family: ui-monospace, monospace; }
.exp-beta { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--warn); border: 1px solid var(--warn);
  border-radius: 5px; padding: 1px 5px; }
.exp-share { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }

/* restored-from-QR banner */
.restore-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding: 12px 14px;
  background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: var(--radius-sm); }
.restore-banner > .ic { color: var(--ok); flex: none; }
.restore-banner .restore-msg { flex: 1 1 240px; font-size: 13.5px; }

@media (max-width: 720px) {
  .lib-modal { padding: 0; }
  .lib-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .exp-panel { height: auto; max-height: 100%; }
  .exp-cards { grid-template-columns: 1fr; }
  .lib-tools { gap: 10px; }
  .lib-source { width: 100%; }
  .lib-src-btn { flex: 1; text-align: center; padding: 10px 13px; }
  .lib-brand { padding: 10px 12px; min-height: 42px; }
  .lib-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lib-brands { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); gap: 6px; }
  .lib-brands.hidden + .lib-list { grid-row: 1 / -1; }
  .lib-brand { flex: none; }
  .lib-grid { grid-template-columns: 1fr; }
  .lib-mode b { max-width: none; }
}

/* =====================================================================
   branded print patch sheet
   ===================================================================== */
.print-only { display: none; }
.print-header { align-items: center; gap: 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid #111; }
.print-header .print-logo { width: 56px; height: 56px; object-fit: contain; }
.print-header .print-title { flex: 1; }
.print-header .print-title b { font-family: 'Poppins', sans-serif; font-size: 21px; font-weight: 800; display: block; }
.print-header .print-meta { font-size: 12px; color: #444; margin-top: 3px; }
.print-header .print-brand { text-align: right; line-height: 1.15; }
.print-header .print-brand b { font-family: 'Poppins', sans-serif; font-size: 15px; letter-spacing: .04em; display: block; }
.print-header .print-brand span { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: .12em; }
/* scan-to-reopen QR: physical mm so print scaling can't shrink it below scannable size */
.print-qr { display: flex; flex-direction: column; align-items: center; gap: 1mm; margin-left: 6mm; }
.print-qr:empty { display: none; }
.print-qr svg { width: 22mm; height: 22mm; }
.print-qr.dense svg { width: 30mm; height: 30mm; } /* full state-in-URL fallback: denser code, print larger */
.print-qr .print-qr-cap { font-size: 7.5px; color: #666; max-width: 30mm; text-align: center; overflow-wrap: anywhere; }
.print-footer { margin-top: 16px; padding-top: 10px; border-top: 1px solid #ccc; font-size: 10px; color: #666; text-align: center; }

@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; color: #111; }
  .kd-ambient, .topbar, .meta-card, .studio-side, .actions, .uni-tabs, .footer-note, .no-print, .tour-overlay, .toast, .lib-modal, .show-bar { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .studio-grid { grid-template-columns: 1fr; gap: 0; }
  .print-only { display: flex; }
  .print-footer { display: block; }
  .card { box-shadow: none; border: 0; background: #fff; color: #111; padding: 0; margin: 0 0 12px; }
  /* break-inside on a card only helps when the card can fit a page; the sheet card is
     many pages tall, so the rule lives on the summary card alone */
  .summary-card { break-inside: avoid; }
  /* ---- page fragmentation (support matrix, verified 2026-08) ----
     .patch-table tr { break-inside: avoid }  rows never split: Chromium + Firefox
     thead { display: table-header-group }    header repeats per page: Chromium + Firefox;
                                              Safari may print it on page 1 only
     .pos-row td { break-after: avoid-page }  position header glued to its first row:
                                              Chromium only; Firefox/Safari ignore it
     Safari may still split rows: that degrades to the pre-compaction behaviour. Do NOT
     "fix" Safari by removing these rules, and keep borders on td/th (never tbody):
     WebKit mishandles collapsed borders across page fragments.
     Deliberately NOT break-inside: avoid on tbody.pos-group: a bar taller than one page
     would force a blank gap and then split anyway. */
  .patch-table thead { display: table-header-group; }
  .patch-table tr { break-inside: avoid; }
  .pos-row td { break-after: avoid-page; }
  /* ---- density: the ask is more fixtures per page; hierarchy: address + universe are
     THE numbers read at the rack, so they stay a step bolder while everything else
     absorbs the compaction ---- */
  .patch-table { font-size: 10.5px; }
  .patch-table td { padding: 3px 6px; }
  .patch-table thead th { padding: 3px 6px; font-size: 9px; }
  .pos-head-inner { margin: 10px 0 2px; padding: 0 2px 4px; gap: 8px; }
  .pos-head-inner b.pos-name { font-size: 11.5px; }
  .print-header { margin-bottom: 8px; padding-bottom: 6px; }
  /* each row carries its bar name in the unit cell ("LX2-7") so a position spanning a
     page break keeps its identity, the way real patch sheets do */
  td.c-n::before { content: attr(data-pos) '-'; font-size: 7.5px; color: #888; letter-spacing: .02em; }
  .card-head .ic, .card-head h2, .card-head h3 { color: #333; }
  .stats .stat b, .addr-num { color: #111 !important; -webkit-text-fill-color: #111; background: none; }
  .stats .stat span { color: #555; }
  .uni-tag { background: #eee; color: #333; border-color: #ccc; }
  .patch-table thead th, .pos-head-inner { border-color: #999; color: #333; }
  .patch-table td { border-color: #ddd; }
  .patch-table .fx-row:hover td { background: none; }
  .universe-track { border-color: #bbb; background: #f4f4f7; }
  .uni-row-head b { color: #111; }
  /* printers strip background colours by default; keep the position colour coding */
  .uni-seg, .pos-head-inner .dot, .universe-track { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only-dot { display: inline-block; }
  /* duplicate-channel outline is a screen editing aid, not part of the document */
  .chan-edit.dup { outline: none; }
  /* lift the light-grey on-screen text to print-legible ink */
  .muted, .patch-table td.c-ch, .patch-table td.c-mode span { color: #444; }
  .patch-table thead th.c-ch, .patch-table thead th.c-n { color: #333; }
  .patch-table td.c-n { color: #666; }
  /* lock/clash state is an on-screen editing aid, not part of the printed document */
  .fx-row.locked td, .fx-row.clash td, .fx-row.unplaced td { background: none !important; }
  .fx-row.clash td:first-child { box-shadow: none; }
  .fx-row.clash .addr-num { -webkit-text-fill-color: #111; }
  .fx-row.clash .uni-tag { background: #eee; color: #333; border-color: #ccc; }
  .c-mode { display: table-cell; }
  .mode-select { -webkit-appearance: none; appearance: none; background: none; border: 0; color: #333; padding: 0; }
  /* editable tour-mode controls print as plain values */
  .uni-edit-wrap { background: none !important; border: 0 !important; padding: 0; color: #111; }
  .uni-edit-wrap > b { font-size: 13px; }
  input.uni-edit, input.addr-edit { -webkit-appearance: none; appearance: none; background: none !important; border: 0 !important; padding: 0; color: #111 !important; -webkit-text-fill-color: #111; font-family: 'Poppins', sans-serif; }
  input.uni-edit { font-size: 11px; font-weight: 700; text-align: left; width: 22px; }
  input.addr-edit { font-size: 12.5px; font-weight: 800; text-align: left; width: auto; }
  .addr-num { font-size: 12.5px; font-weight: 800; }
  .uni-tag { font-size: 11px; font-weight: 700; }
  /* paperwork fields (unit # / channel / gel) print as plain ink too */
  input.unit-edit, input.chan-edit, input.gel-edit { -webkit-appearance: none; appearance: none; background: none !important; border: 0 !important; padding: 0; color: #111 !important; -webkit-text-fill-color: #111; font-size: 10px; }
  input.unit-edit { color: #666 !important; -webkit-text-fill-color: #666; text-align: center; width: 30px; }
  input.chan-edit { font-weight: 700; text-align: center; }
}

/* =====================================================================
   public topbar (2026-09-08): the studio is linked from the site nav now,
   so the title is a real h1, the monogram alone is the home link, and a
   small nav pairs "All tools" with the cross-link to the other tool.
   ===================================================================== */
.brand-home { display: inline-flex; flex: none; line-height: 0; border-radius: 12px; }
.brand-home:focus-visible { outline: 2px solid var(--purple-l); outline-offset: 3px; }
.brand .title h1 {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 18px; line-height: 1.1;
  margin: 0; letter-spacing: -0.01em; color: var(--tx);
}
.topbar-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-nav .btn { white-space: nowrap; }
.btn.topbar-link { background: transparent; border-color: transparent; color: var(--tx-dim); }
.btn.topbar-link:hover { color: var(--tx); border-color: var(--line-2); text-decoration: none; }
.footer-note a { color: var(--tx-dim); text-decoration: underline; text-underline-offset: 2px; }
.footer-note a:hover { color: var(--purple-xl); }
@media (max-width: 480px) {
  /* show bar: drop the SHOW caption so the show name stops truncating to "My …" beside New show */
  .show-bar-lbl { display: none; }
  .show-switch-wrap { flex: 1; min-width: 0; }
  .show-bar-inner > span:not([class]) { display: none; } /* the flex spacer: it would split the room 50/50 with the switch */
  .show-switch { width: 100%; max-width: none; }
  .show-switch b { flex: 1; min-width: 0; text-align: left; }
  .topbar { gap: 12px; }
  .topbar .spacer { display: none; }
  .topbar-nav { width: 100%; justify-content: space-between; }
  .topbar-nav .btn { flex: 1; justify-content: center; }
  /* the ghost "All tools" link floats beside a real button at this width; give both the same pill */
  .topbar-nav .btn.topbar-link { background: var(--el); border-color: var(--line-2); color: var(--tx); }

  /* export actions: three bordered clusters wrap raggedly at phone width (a 14px indent on the
     second row only, singletons on their own line). One 2-up grid instead: PDF full width on top,
     then pairs by intent (CSV/Print, Share/Console file, Save/Load) and Clear alone at the bottom. */
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
  .act-group { display: contents; }
  .actions > span:not([class]) { display: none; } /* the flex spacer */
  .actions .btn { justify-content: center; min-height: 44px; }
  .actions .btn.primary { grid-column: 1 / -1; }
  .actions .btn.hire { grid-column: 1 / -1; order: -1; }
  .act-group:nth-child(2) .btn { order: 1; }
  .actions .btn.ghost { order: 2; grid-column: 1 / -1; }
  /* the export modal's own banner carries the beta warning; the badge is what wrapped "Console file" onto two lines here */
  .actions .exp-beta { display: none; }
  .actions .btn { padding-left: 8px; padding-right: 8px; gap: 7px; white-space: nowrap; }

  /* dip bank: at 42px a switch, a 9-bank was 454px wide and scrolled sideways with no cue, so switches
     7 to 9 were simply off screen. Divide the width evenly instead; a 10-bank still fits at 360. */
  .bank-stage { padding: 16px 6px 8px; }
  .bank-stage .dipbank { display: flex; width: 100%; margin: 0; gap: 2px; padding: 12px 5px 8px; }
  .dipsw { flex: 1 1 0; width: auto; min-width: 0; gap: 4px; }
  .dip-track { width: 18px; height: 64px; }
  .dip-on { font-size: 9px; letter-spacing: .04em; }
  .dip-wt { font-size: 10px; }
}
@media (max-width: 340px) {
  /* 320 px phones: the fixture count badge is what truncates the show name to "My …"; the count is in the stats card anyway */
  .show-switch-meta { display: none; }
  /* position head: the delete button wrapped onto its own line under Auto / arrows / copy */
  .pos-head-inner { gap: 6px; }
  .pin-ctl { gap: 3px; }
}

/* Provenance in the fixture search (2026-09-08): every group and row says where its chart
   came from, so a community chart from the Open Fixture Library is never mistaken for a
   Krank'd verified one. The PWA banners reuse the restore-banner look. */
.combo-group .co-src { float: right; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--tx-faint); }
.combo-group .co-src.community { color: #d7b56d; }
.fleet-chip.community { color: #e6c98a; background: rgba(215, 181, 109, .14); border-color: rgba(215, 181, 109, .5); }
.src-note { display: block; width: 100%; margin-top: 6px; color: var(--tx-faint); }
main > .pwa-banner { margin: 0 0 14px; }
.pwa-banner .icon-btn { font-size: 18px; line-height: 1; }
/* install and update are purple (brand, an offer); offline is amber (a state, not an error) */
.pwa-banner.pwa-install, .pwa-banner.pwa-update { background: color-mix(in srgb, var(--purple-l) 12%, #0A0A0F);
  border-color: color-mix(in srgb, var(--purple-l) 45%, transparent); }
.pwa-banner.pwa-offline { background: var(--warn-bg); border-color: #5a4118; }
.pwa-banner.pwa-offline b { color: var(--warn); }
