/* =====================================================================
 * GigSplitter review — the whole stylesheet.
 *
 * The token block below is brand/tokens.css inlined verbatim. It is the
 * only place a hex value appears in this tool; every other colour in
 * this file, in index.html and in every JS module is a var().
 *
 * Layout note that matters more than it looks: the page is a flex
 * column and the job tray is a real layout SIBLING of the scrolling
 * content, not a fixed overlay. A fixed tray silently covers the piece
 * pane once more than a couple of jobs are queued. `min-height: 0` on
 * both the scroll area and the tray's inner list is load-bearing — a
 * flex item's default `min-height: auto` refuses to shrink, and
 * `overflow-y: auto` then never engages.
 * ===================================================================== */

:root {
  --gs-ink: #241f1a;
  --gs-paper: #f6f1e7;
  --gs-muted: #776b5d;
  --gs-line: #ddd2c0;

  --gs-key: #d9622b;
  --gs-key-warm: #a8442f;

  --gs-song: #273b49;
  --gs-talk: #895734;
  --gs-tuning: #af83af;
  --gs-applause: #e0c985;

  --gs-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gs-font-display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --gs-size-xs: 0.75rem;
  --gs-size-sm: 0.875rem;
  --gs-size-base: 1rem;
  --gs-size-lg: 1.25rem;
  --gs-size-xl: 1.75rem;
  --gs-size-display: 2.5rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gs-ink: #ece4d8;
    --gs-paper: #1a1613;
    --gs-muted: #a89a89;
    --gs-line: #3a332c;

    --gs-key: #ff9153;
    --gs-key-warm: #c96a4a;

    --gs-song: #2d485c;
    --gs-talk: #a06135;
    --gs-tuning: #c491c4;
    --gs-applause: #eddfb5;
  }
}
:root[data-theme="dark"] {
  --gs-ink: #ece4d8;
  --gs-paper: #1a1613;
  --gs-muted: #a89a89;
  --gs-line: #3a332c;

  --gs-key: #ff9153;
  --gs-key-warm: #c96a4a;

  --gs-song: #2d485c;
  --gs-talk: #a06135;
  --gs-tuning: #c491c4;
  --gs-applause: #eddfb5;
}

/* Text-on-colour aliases: the segment ladder runs dark → light in both
   themes, but which neutral is the light one flips with the theme. */
:root { --gs-on-dark: var(--gs-paper); --gs-on-light: var(--gs-ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --gs-on-dark: var(--gs-ink); --gs-on-light: var(--gs-paper); }
}
:root[data-theme="dark"] { --gs-on-dark: var(--gs-ink); --gs-on-light: var(--gs-paper); }

/* ---------------------------------- base ---------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--gs-paper); color: var(--gs-ink);
  font: var(--gs-size-sm)/1.45 var(--gs-font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gs-key); outline-offset: 1px; }
h2, h3 { font-family: var(--gs-font-display); font-weight: 600; margin: 0; }
h2 { font-size: var(--gs-size-base); }
h3 { font-size: var(--gs-size-sm); }
.muted { color: var(--gs-muted); }
.hint { color: var(--gs-muted); font-size: var(--gs-size-xs); }
.spacer { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.stack { display: grid; gap: .5rem; }

/* The scrolling half of the page. `min-height: 0` lets it actually
   shrink so the tray below always has its space. */
.scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
}
.wrap { max-width: 54rem; margin: 0 auto; padding: 1rem 1.25rem 1.5rem; }

/* --------------------------------- buttons -------------------------------- */
.btn {
  border: 1px solid var(--gs-line); background: transparent; color: var(--gs-ink);
  padding: .3rem .6rem; border-radius: 4px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--gs-line) 40%, transparent); }
.btn:active:not(:disabled) { background: color-mix(in srgb, var(--gs-line) 65%, transparent); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-sm { padding: .14rem .42rem; font-size: var(--gs-size-xs); }
.btn-key {
  border-color: var(--gs-key); background: var(--gs-key);
  color: var(--gs-on-dark); font-weight: 600;
}
.btn-key:hover:not(:disabled) { background: var(--gs-key-warm); border-color: var(--gs-key-warm); }

.pick { display: flex; flex-wrap: wrap; gap: .25rem; }
.pick button {
  border: 1px solid var(--gs-line); background: transparent; border-radius: 4px;
  padding: .22rem .5rem; font-size: var(--gs-size-xs);
  display: inline-flex; align-items: center; gap: .35rem;
}
.pick button:hover:not(:disabled) { background: color-mix(in srgb, var(--gs-line) 40%, transparent); }
.pick button:disabled { opacity: .35; cursor: not-allowed; }
.pick button[aria-pressed="true"] {
  border-color: var(--gs-key); color: var(--gs-key);
  background: color-mix(in srgb, var(--gs-key) 12%, transparent); font-weight: 600;
}
.pick .sw { width: .65rem; height: .65rem; border-radius: 2px; background: var(--c, var(--gs-line)); }
.pick .sub { color: var(--gs-muted); font-weight: 400; }
.pick button[aria-pressed="true"] .sub { color: inherit; opacity: .8; }

.field {
  background: transparent; border: 1px solid var(--gs-line);
  border-radius: 3px; padding: .22rem .4rem;
}
.field:focus { border-color: var(--gs-key); outline: none; }
.card {
  border: 1px solid var(--gs-line); border-radius: 5px;
  padding: .6rem .7rem; display: grid; gap: .5rem; align-content: start;
}
.card > header { display: flex; align-items: baseline; gap: .5rem; }

/* -------------------------------- masthead -------------------------------- */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.masthead h1 {
  font-family: var(--gs-font-display); font-size: var(--gs-size-lg);
  font-weight: 600; margin: 0;
}
.masthead .gig { color: var(--gs-muted); font-size: var(--gs-size-sm); margin: .15rem 0 0; }
.mast-actions { display: flex; align-items: center; gap: .4rem; flex: none; }
.icon-btn {
  width: 1.75rem; height: 1.75rem; border-radius: 6px; border: 1px solid var(--gs-line);
  background: transparent; color: var(--gs-muted); font-size: var(--gs-size-sm);
  display: grid; place-items: center; flex: none; padding: 0;
}
.icon-btn.round { border-radius: 50%; }
.icon-btn:hover:not(:disabled) { border-color: var(--gs-muted); color: var(--gs-ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn[aria-expanded="true"] { border-color: var(--gs-key); color: var(--gs-key); }

/* --------------------------------- notices -------------------------------- */
.notices { margin-bottom: .5rem; }
.notice {
  margin: .4rem 0; padding: .35rem .6rem; border-left: 2px solid var(--gs-key);
  background: color-mix(in srgb, var(--gs-key) 8%, transparent);
  font-size: var(--gs-size-xs); display: flex; gap: .6rem; align-items: baseline;
}
.notice.warn {
  border-left-color: var(--gs-key-warm);
  background: color-mix(in srgb, var(--gs-key-warm) 10%, transparent);
}

/* ---------------------------------- video --------------------------------- */
.viewport { position: relative; line-height: 0; }
video {
  width: 100%; max-height: 46vh; background: var(--gs-song);
  border: 1px solid var(--gs-line); border-radius: 6px; display: block;
}
.no-video {
  display: none; padding: 1.2rem; text-align: center;
  border: 1px dashed var(--gs-line); border-radius: 4px; color: var(--gs-muted);
}
.transport { display: flex; align-items: center; gap: .6rem; margin: .45rem 0 .9rem; }
.clock { font-size: var(--gs-size-lg); font-family: var(--gs-font-display); }
.clock .of { color: var(--gs-muted); font-size: var(--gs-size-sm); }
.source-line { font-size: var(--gs-size-xs); color: var(--gs-muted); }
.source-line b { color: var(--gs-ink); font-weight: 500; }

/* ------------------------------- crop window ------------------------------ */
/* The overlay is sized to the *picture* inside the video element, not to the
   element, because the picture is letterboxed in there. Nothing in the
   overlay takes the pointer except the grab strips.
   `.cb`'s own top/left/width/height are no longer fixed here — at zoom a
   window is smaller than the full picture and can sit anywhere in it, so
   `framing.js`'s `place()` sets all four inline, every time. Likewise
   `.cb-grab`'s `bottom` is not fixed at 46px any more: `place()` computes
   it per box, anchored to the *picture's* own bottom edge (not the box's),
   so a short zoomed-in box does not lose its whole hit area to a strip
   meant to keep the video's native controls clickable underneath. */
.cropbox { position: absolute; pointer-events: none; z-index: 2; overflow: hidden; }
.cb { position: absolute; }
.cb-grab {
  position: absolute; inset: 0 0 0 0;
  background: transparent; border: 0; padding: 0;
  pointer-events: auto; cursor: grab; touch-action: none;
}
.cb-grab:active { cursor: grabbing; }
.cb-now {
  border: 2px solid var(--gs-key);
  box-shadow: 0 0 0 3000px color-mix(in srgb, var(--gs-ink) 55%, transparent);
}
.cb-now.ghosting { border-style: dashed; }
.cb-now.ghosting .cb-grab { pointer-events: none; cursor: default; }
.cb-ghost { border: 1px solid var(--gs-paper); outline: 1px solid var(--gs-ink); }
.cb-tag {
  position: absolute; top: 4px; left: 4px;
  background: var(--gs-key); color: var(--gs-on-dark);
  font-size: var(--gs-size-xs); line-height: 1.5;
  padding: 0 .35em; border-radius: 3px; white-space: nowrap;
}
.cb-late .cb-tag { top: 26px; background: var(--gs-key-warm); }
.cb-grab:focus-visible { outline: 2px solid var(--gs-key); outline-offset: -2px; }

/* The zoom control on the framing wizard step — same shape as .field-row,
   the range input just needs a bit more breathing room next to its label.
   Doubled-up selector (rather than just `.zoom-row`) so this reliably
   overrides `.field-row`'s own `flex-direction` regardless of which rule
   the cascade sees last. */
.field-row.zoom-row { flex-direction: row; align-items: center; gap: .6rem; }
.zoom-row label { flex: 0 0 auto; white-space: nowrap; }
.zoom-row input[type=range] { flex: 1 1 auto; accent-color: var(--gs-key); }

/* The bar that appears while the wizard is stood aside to let the crop
   box be dragged on the real picture. */
.crop-adjust {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  border: 1px solid var(--gs-key); border-radius: 5px;
  background: color-mix(in srgb, var(--gs-key) 10%, var(--gs-paper));
  padding: .45rem .6rem; margin: .5rem 0; line-height: 1.45;
}
.crop-adjust p { margin: 0; font-size: var(--gs-size-xs); flex: 1 1 16rem; }
.pan-line { display: flex; align-items: center; gap: .4rem; font-size: var(--gs-size-xs); }
.pan-line input { accent-color: var(--gs-key); }

/* -------------------------------- the map --------------------------------- */
.map-label {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .6rem; margin-bottom: .35rem; flex-wrap: wrap;
}
.map-label .hint { letter-spacing: .03em; }
.strip {
  position: relative; overflow-x: auto; overflow-y: hidden;
  border: 1px solid var(--gs-line); border-radius: 6px;
  background: color-mix(in srgb, var(--gs-line) 18%, transparent);
}
.strip-inner { position: relative; height: 82px; }
.ruler {
  position: absolute; inset: 0 0 auto 0; height: 18px;
  border-bottom: 1px solid var(--gs-line); cursor: crosshair; touch-action: none;
}
.tick {
  position: absolute; top: 0; height: 100%; border-left: 1px solid var(--gs-line);
  padding-left: 3px; font-size: var(--gs-size-xs); color: var(--gs-muted);
  line-height: 18px; white-space: nowrap; pointer-events: none;
}
.map { position: absolute; inset: 18px 0 0 0; touch-action: none; cursor: crosshair; }
.block {
  position: absolute; top: 5px; bottom: 5px;
  background: var(--c); color: var(--on);
  border: 0; border-radius: 2px; overflow: hidden;
  padding: 3px 5px; text-align: left; font-size: var(--gs-size-xs); line-height: 1.2;
}
.block .bl-t { font-weight: 600; white-space: nowrap; }
.block .bl-d { opacity: .85; white-space: nowrap; }
.block.cur { box-shadow: inset 0 0 0 1px var(--gs-paper); }

.scrim-band {
  position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 2;
  background: color-mix(in srgb, var(--gs-paper) 42%, transparent);
}
.sel-band {
  position: absolute; top: 0; bottom: 0; z-index: 3; pointer-events: none;
  border-left: 2px solid var(--gs-key); border-right: 2px solid var(--gs-key);
  background: color-mix(in srgb, var(--gs-key) 9%, transparent);
}
.sel-band::before, .sel-band::after {
  content: ""; position: absolute; left: -2px; right: -2px; height: 2px; background: var(--gs-key);
}
.sel-band::before { top: 0; }
.sel-band::after { bottom: 0; }
.grip {
  position: absolute; top: 0; bottom: 0; width: 16px; margin-left: -8px;
  z-index: 4; background: transparent; border: 0; padding: 0;
  cursor: ew-resize; touch-action: none;
}
.grip::before {
  content: ""; position: absolute; left: 6px; top: 50%; margin-top: -11px;
  width: 4px; height: 22px; border-radius: 2px; background: var(--gs-key);
}
.grip:hover::before { height: 100%; top: 0; margin-top: 0; border-radius: 0; }
.playhead {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--gs-ink); z-index: 5; pointer-events: none;
}
.playhead::before {
  content: ""; position: absolute; top: 0; left: -3px;
  border: 3.5px solid transparent; border-top: 6px solid var(--gs-ink);
}

.t-song { --c: var(--gs-song); --on: var(--gs-on-dark); }
.t-talk { --c: var(--gs-talk); --on: var(--gs-on-dark); }
.t-tuning { --c: var(--gs-tuning); --on: var(--gs-on-light); }
.t-applause { --c: var(--gs-applause); --on: var(--gs-on-light); }
.t-other { --c: var(--gs-line); --on: var(--gs-ink); }

/* ------------------------------- piece pane ------------------------------- */
.piece-pane {
  margin-top: .9rem; border: 1px solid var(--gs-line); border-radius: 10px;
  padding: .85rem 1rem; display: flex; flex-direction: column; gap: .7rem;
}
.pane-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pane-row.split { justify-content: space-between; }
.type-pill {
  font: inherit; font-size: var(--gs-size-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; border: 1px solid transparent; border-radius: 999px;
  padding: .25rem .6rem; background: var(--c); color: var(--on); flex: none;
}
.type-pill:hover { filter: brightness(1.1); }
.name-field {
  flex: 1 1 12rem; font: inherit; font-size: var(--gs-size-base); color: var(--gs-ink);
  background: transparent; border: 0; border-bottom: 1.5px dashed var(--gs-line);
  padding: .1rem 0; min-width: 0;
}
.name-field:focus { outline: none; border-bottom-color: var(--gs-key); }
.times { display: flex; align-items: center; gap: .35rem; color: var(--gs-muted); }
.times input {
  width: 6.5ch; background: transparent; color: var(--gs-ink); font: inherit;
  font-weight: 600; border: 0; border-bottom: 1px dashed transparent; padding: .1rem 0;
  text-align: center;
}
.times input:hover { border-bottom-color: var(--gs-line); }
.times input:focus { border-bottom-color: var(--gs-key); outline: none; }
.times .dur { color: var(--gs-ink); font-weight: 600; }
.pane-note { font-size: var(--gs-size-xs); color: var(--gs-muted); margin: 0; }
.pane-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.btn-export {
  font: inherit; font-weight: 600; font-size: var(--gs-size-base);
  color: var(--gs-on-dark); background: var(--gs-key); border: 1px solid var(--gs-key);
  border-radius: 8px; padding: .6rem 1.4rem; flex: none;
}
.btn-export:hover:not(:disabled) { background: var(--gs-key-warm); border-color: var(--gs-key-warm); }
.btn-export:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------------------- detail / fix the map ------------------------ */
.detail {
  margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--gs-line);
  display: grid; gap: .8rem;
  grid-template-columns: minmax(360px, 1.5fr) minmax(280px, 1fr);
  align-items: start;
}
.detail .full { grid-column: 1 / -1; }
.tools-body { display: grid; gap: .45rem; }
.tools-body .lbl { color: var(--gs-muted); font-size: var(--gs-size-xs); min-width: 8.5em; }
.badge {
  display: inline-flex; align-items: center; gap: .4rem; font-size: var(--gs-size-xs);
  border: 1px solid var(--gs-line); border-radius: 3px; padding: .15rem .45rem;
}
.badge .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--gs-song); }
.badge.bad { border-color: var(--gs-key-warm); color: var(--gs-key-warm); }
.badge.bad .dot { background: var(--gs-key-warm); }

.scroller { max-height: 30vh; overflow: auto; overscroll-behavior: contain; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 2; text-align: left;
  background: var(--gs-paper); border-bottom: 1px solid var(--gs-line);
  font-size: var(--gs-size-xs); text-transform: uppercase; letter-spacing: .06em;
  color: var(--gs-muted); font-weight: 500; padding: .2rem .4rem; white-space: nowrap;
}
tbody td { border-bottom: 1px solid color-mix(in srgb, var(--gs-line) 55%, transparent); padding: .12rem .4rem; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: color-mix(in srgb, var(--gs-line) 30%, transparent); }
tbody tr.inSel { background: color-mix(in srgb, var(--gs-key) 13%, transparent); }
tbody tr.inSel td:first-child { box-shadow: inset 2px 0 0 var(--gs-key); }
td.n, td.num { text-align: right; white-space: nowrap; width: 1%; }
td.n { color: var(--gs-muted); }
td.ty { width: 1%; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--gs-size-xs); }
.chip .sw { width: .65rem; height: .65rem; border-radius: 2px; background: var(--c); flex: none; }
td.name input {
  width: 100%; background: transparent; border: 0;
  border-bottom: 1px dashed transparent; padding: .08rem 0;
}
td.name input:hover { border-bottom-color: var(--gs-line); }
td.name input:focus { border-bottom-color: var(--gs-key); outline: none; }
.long-flag { color: var(--gs-key); font-size: var(--gs-size-xs); }

ol.clips { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
ol.clips li {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: .4rem; align-items: center;
  border: 1px solid var(--gs-line); border-radius: 4px; padding: .25rem .4rem;
  background: var(--gs-paper);
}
ol.clips li.dragging { opacity: .4; }
ol.clips li.over { border-color: var(--gs-key); }
ol.clips .handle { cursor: grab; color: var(--gs-muted); font-size: var(--gs-size-xs); user-select: none; }
ol.clips .lbl { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed transparent; }
ol.clips .lbl:hover { border-bottom-color: var(--gs-line); }
ol.clips .lbl:focus { border-bottom-color: var(--gs-key); outline: none; }
ol.clips .when { color: var(--gs-muted); font-size: var(--gs-size-xs); white-space: nowrap; }
.empty-note {
  border: 1px dashed var(--gs-line); border-radius: 4px;
  padding: .6rem; text-align: center; color: var(--gs-muted); font-size: var(--gs-size-xs);
}

/* ------------------------------- shortcuts -------------------------------- */
.shortcuts-panel {
  position: fixed; top: 3.5rem; right: 1.25rem; width: 20rem; z-index: 40;
  background: var(--gs-paper); border: 1px solid var(--gs-line); border-radius: 10px;
  padding: 1rem 1.1rem; font-size: var(--gs-size-sm);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--gs-ink) 22%, transparent);
}
.shortcuts-panel h3 { margin: 0 0 .6rem; font-size: var(--gs-size-base); }
.shortcuts-panel dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .7rem; margin: 0; }
.shortcuts-panel dt {
  font-family: ui-monospace, monospace; font-size: .72rem;
  background: color-mix(in srgb, var(--gs-ink) 6%, var(--gs-paper));
  border: 1px solid var(--gs-line); border-radius: 4px; padding: 0 .35rem;
  align-self: start; white-space: nowrap;
}
.shortcuts-panel dd { margin: 0; color: var(--gs-muted); }

/* Exports and bumpers reuse the shortcuts panel's chrome — same floating
   card, same corner — with a header row for a title plus a close button. */
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .5rem; }
.panel-head h3 { margin: 0; }
.exports-panel .clips, .bumpers-panel .clips { max-height: 16rem; overflow-y: auto; margin-bottom: .5rem; }
.bumpers-panel input[type=file] { flex: 1 1 auto; font-size: var(--gs-size-xs); }

/* --------------------------------- wizard --------------------------------- */
.veil {
  position: fixed; inset: 0; z-index: 60; padding: 1rem;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--gs-ink) 45%, transparent);
}
.wizard {
  width: 100%; max-width: 28rem; max-height: 90dvh; overflow-y: auto;
  background: var(--gs-paper); border: 1px solid var(--gs-line); border-radius: 14px;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--gs-ink) 35%, transparent);
}
.wizard-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem .5rem;
}
.wizard-step-count { font-size: var(--gs-size-xs); color: var(--gs-muted); }
.wizard-close {
  border: 0; background: transparent; color: var(--gs-muted); font-size: 1.1rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
}
.wizard-close:hover { background: color-mix(in srgb, var(--gs-ink) 8%, transparent); color: var(--gs-ink); }
.wizard-body { padding: .2rem 1.3rem 1.3rem; }
.wizard-body h2 {
  font-family: var(--gs-font-display); font-weight: 600; font-size: var(--gs-size-xl);
  margin: 0 0 .3rem; text-wrap: balance;
}
.wizard-body .sub { color: var(--gs-muted); font-size: var(--gs-size-sm); margin: 0 0 1rem; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1.1rem; }
.choice-grid.single { grid-template-columns: 1fr; }
.choice-card {
  border: 1.5px solid var(--gs-line); border-radius: 10px; padding: .75rem;
  background: var(--gs-paper); text-align: left; font: inherit; color: var(--gs-ink);
  display: flex; flex-direction: column; gap: .45rem;
}
.choice-card:hover:not(:disabled) { border-color: var(--gs-muted); }
.choice-card:disabled { opacity: .45; cursor: not-allowed; }
.choice-card.picked { border-color: var(--gs-key); background: color-mix(in srgb, var(--gs-key) 6%, var(--gs-paper)); }
.choice-card .label { font-weight: 600; }
.choice-card .meta { font-size: var(--gs-size-xs); color: var(--gs-muted); }

.shape-swatch { height: 3.6rem; display: grid; place-items: center; }
.shape-swatch .box {
  border-radius: 3px; background: color-mix(in srgb, var(--gs-song) 70%, var(--gs-line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gs-ink) 20%, transparent);
}
.shape-9x16 .box { width: 1.7rem; height: 3.4rem; }
.shape-1x1 .box { width: 3rem; height: 3rem; }
.shape-16x9 .box, .shape-orig .box { width: 3.8rem; height: 2.15rem; }

.filetype-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.filetype-row button {
  flex: 1; font: inherit; font-size: var(--gs-size-sm); padding: .55rem; border-radius: 7px;
  border: 1.5px solid var(--gs-line); background: var(--gs-paper); color: var(--gs-ink);
}
.filetype-row button.picked { border-color: var(--gs-key); background: color-mix(in srgb, var(--gs-key) 8%, var(--gs-paper)); }
.field-row { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field-row label { font-size: var(--gs-size-sm); color: var(--gs-muted); }
.field-row input[type=text] {
  font: inherit; font-size: var(--gs-size-base); padding: .55rem .7rem; border-radius: 7px;
  border: 1.5px solid var(--gs-line); background: var(--gs-paper); color: var(--gs-ink);
}
.bumper-row {
  flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: .6rem;
}
.bumper-row > div { display: flex; flex-direction: column; gap: .3rem; flex: 1 1 8rem; }
.bumper-row label { font-size: var(--gs-size-sm); color: var(--gs-muted); }
.bumper-row select {
  font: inherit; font-size: var(--gs-size-sm); padding: .45rem .5rem; border-radius: 7px;
  border: 1.5px solid var(--gs-line); background: var(--gs-paper); color: var(--gs-ink);
}

.pipeline { display: grid; gap: .55rem; margin: 1rem 0 1rem; }
.pipeline .step { display: flex; align-items: center; gap: .6rem; font-size: var(--gs-size-sm); }
.pipeline .step .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--gs-key); flex: none; }
.estimate {
  background: color-mix(in srgb, var(--gs-ink) 5%, var(--gs-paper)); border-radius: 8px;
  padding: .7rem .9rem; font-size: var(--gs-size-sm); color: var(--gs-muted); margin-bottom: 1.1rem;
}
.estimate b { color: var(--gs-ink); }
.estimate p { margin: .35rem 0 0; font-size: var(--gs-size-xs); }

.wizard-nav { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.nav-btn {
  font: inherit; font-size: var(--gs-size-sm); padding: .6rem 1.1rem; border-radius: 7px;
  border: 1.5px solid var(--gs-line); background: transparent; color: var(--gs-ink);
}
.nav-btn.primary {
  background: var(--gs-key); color: var(--gs-on-dark);
  border-color: var(--gs-key); font-weight: 600;
}
.nav-btn.primary:hover:not(:disabled) { background: var(--gs-key-warm); border-color: var(--gs-key-warm); }
.nav-btn:disabled { opacity: .35; cursor: default; }

/* -------------------------------- job tray -------------------------------- */
/* A real layout sibling of .scroll-area, never an overlay. */
.tray { flex: none; display: flex; justify-content: center; padding: 0 1.25rem; min-height: 0; }
.tray:has(.job) { padding-bottom: 1rem; border-top: 1px solid var(--gs-line); padding-top: .6rem; }
.tray-inner {
  width: 100%; max-width: 54rem; min-height: 0;
  display: flex; flex-direction: column; gap: .5rem;
  max-height: min(45vh, 18rem); overflow-y: auto;
}
.job {
  display: flex; align-items: center; gap: .7rem; font-size: var(--gs-size-sm);
  background: var(--gs-paper); border: 1px solid var(--gs-line); border-radius: 10px;
  padding: .5rem .75rem;
  animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.job .icon { width: 1.4rem; height: 1.4rem; flex: none; display: grid; place-items: center; }
.job .ring {
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2px solid var(--gs-line); border-top-color: var(--gs-key);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.job .dot-queued { width: .55rem; height: .55rem; border-radius: 50%; border: 1.5px solid var(--gs-muted); }
.job .check { color: var(--gs-ink); font-size: 1rem; line-height: 1; }
.job .warn { color: var(--gs-key-warm); font-size: 1rem; line-height: 1; }
.job .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .status { color: var(--gs-muted); flex: none; }
.job .act {
  color: var(--gs-key); font: inherit; font-weight: 600; background: none;
  border: 0; padding: 0; text-decoration: none; flex: none;
}
.job .act:hover { text-decoration: underline; }
.job .act.retry { color: var(--gs-key-warm); }

@media (prefers-reduced-motion: reduce) {
  .job, .job .ring { animation: none; }
  video, .btn { transition: none; }
}

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .shortcuts-panel { left: 1rem; right: 1rem; width: auto; }
}

/* ------------------------------------------------------------------
 * The sign-in screen. Deliberately the plainest surface in the tool:
 * a name, a sentence, one button. It is what Daven sees first.
 * ------------------------------------------------------------------ */
/* Until the gate opens, the tool is not merely hidden — it is not in
   the document's flow at all, so nothing behind it can be scrolled to
   or tabbed into. */
body.locked { overflow: hidden; }
body.locked > *:not(.signin) { display: none !important; }
.signin {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 2rem;
  background: var(--gs-paper);
}
.signin[hidden] { display: none; }
.signin-card { width: min(30rem, 100%); text-align: center; }
.signin-card h1 {
  font-family: var(--gs-font-display); font-size: var(--gs-size-display); margin: 0 0 .25rem;
}
.signin-card .tagline { color: var(--gs-muted); margin: 0 0 2rem; }
.signin-card p.lede { font-size: var(--gs-size-lg); line-height: 1.5; margin: 0 0 1.75rem; }
.signin-card .btn { width: auto; padding: .6rem 1.4rem; font-size: var(--gs-size-base); }
.signin-card .status {
  min-height: 1.5rem; margin: 1.25rem 0 0;
  color: var(--gs-key-warm); font-size: var(--gs-size-sm);
}
.signin-card .fineprint { margin: 2.5rem 0 0; color: var(--gs-muted); font-size: var(--gs-size-xs); }
