/* ==========================================================================
   Snapra Studio: "Press night"
   --------------------------------------------------------------------------
   The photographer's desk as a broadcast control room. Black panels, white
   2px rules, square everything, condensed capitals for headers and big
   condensed numbers for anything that counts.

   Red is spent on exactly three things: the action to press, the ON AIR state,
   and the one number on a screen that matters most. When capture is live the
   head of the capture panel turns into a solid red ON AIR sign, sized to be
   read from across a ballroom.

   Built on ds.css tokens only (--black --white --red --fg --fg-2 --fg-3 --bg
   --panel --panel-2 --line --line-2 --rule --font). No radius, no shadow, no
   gradient, no blur.
   ========================================================================== */

:root {
  --side-w: 256px;
  --pad-x: clamp(20px, 3vw, 40px);
  --top-h: 96px;
}

html { scroll-padding-top: var(--top-h); }
body { min-height: 100vh; overflow-x: hidden; }
body.is-booting { overflow: hidden; }

/* Condensed caps: the header voice across Studio. */
.cond {
  font-stretch: 62%; font-weight: 900; text-transform: uppercase; letter-spacing: 0; line-height: 0.9;
}

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 5; }
.boot .spinner { width: 28px; height: 28px; }
.boot-msg { display: grid; justify-items: center; gap: 14px; color: var(--fg-3); font-size: 15px; }
.sm-spin { width: 14px; height: 14px; border-width: 2px; flex: none; }

/* A red line across the very top of the window, on every section, the whole
   time capture is running. Peripheral vision is enough to read it. */
body.is-live::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; background: var(--red);
}

.linkish { color: var(--fg-2); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.linkish:hover { color: var(--red); }
.bad-t { color: var(--red); font-weight: 700; }

/* ==========================================================================
   Gate: a press pass
   ========================================================================== */

.gate {
  min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; justify-items: center;
  padding: 0 20px 28px;
}
.gate-top {
  width: 100%; max-width: 1100px; display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 14px; border-bottom: var(--stroke) solid var(--rule);
}
.gate-card { width: min(440px, 100%); align-self: center; margin: 40px 0; padding: 34px 26px 24px; }
.gate-card .pass-tag { margin: 0 -26px 22px; font-size: 22px; padding: 8px 0; }
.gate-title { font-size: clamp(54px, 7vw, 76px); color: var(--black); }
.gate-lede { color: var(--fg-2); margin: 14px 0 24px; font-size: 16px; max-width: 34ch; }
.gate-form { display: grid; gap: 16px; }
.gate-form .btn { margin-top: 4px; }
.passcode { font: 800 30px/1 var(--font); letter-spacing: 0.4em; text-align: center; height: 62px; font-variant-numeric: tabular-nums; }
.gate-err {
  margin-top: 16px; padding: 12px 14px; background: var(--red); color: var(--white); font-weight: 700; font-size: 15px;
}
.gate-err[data-tone="info"] { background: var(--black); }
.gate-alt {
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px; border-top: var(--stroke) solid var(--black); font-size: 14px; color: var(--fg-3);
}
.gate-alt a { color: var(--black); font-weight: 700; }
.gate-alt .linkish { color: var(--black); }
.gate-proof {
  width: 100%; max-width: 1100px; padding-top: 14px; border-top: var(--stroke) solid var(--rule);
  font-size: 14px; color: var(--fg-3); text-align: left;
}
.gate-proof .mono { font-stretch: 62%; font-weight: 900; font-size: 22px; color: var(--fg); margin-right: 4px; }

/* ==========================================================================
   Shell
   ========================================================================== */

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 16px 14px;
  background: var(--bg);
  border-right: var(--stroke) solid var(--rule);
  scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 0 12px; border-bottom: var(--stroke) solid var(--rule); }
.side-brand a { text-decoration: none; color: var(--fg); }
.side-tag {
  font: 900 13px/1 var(--font); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--fg); color: var(--bg); padding: 4px 6px;
}

/* event switcher */
.evpick { position: relative; }
.ev-current {
  width: 100%; display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 0 8px;
  padding: 12px; background: var(--panel); border: var(--stroke) solid var(--line-2);
}
.ev-current:hover { border-color: var(--fg); }
.ev-label { grid-column: 1; font: 800 11px/1 var(--font); font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-3); margin-bottom: 8px; }
.ev-name {
  grid-column: 1; font: 900 24px/0.92 var(--font); font-stretch: 62%; text-transform: uppercase; color: var(--fg);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ev-meta { grid-column: 1; font-size: 13px; font-weight: 600; color: var(--fg-3); margin-top: 8px; font-variant-numeric: tabular-nums; }
.ev-chev { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 18px; height: 18px; color: var(--fg); }
.ev-current[aria-expanded="true"] { border-color: var(--red); }
.ev-current[aria-expanded="true"] .ev-chev { transform: rotate(180deg); }
.ev-menu {
  position: absolute; top: calc(100% - 2px); left: 0; width: 100%; z-index: 40;
  background: var(--bg); border: var(--stroke) solid var(--fg);
}
.ev-list { max-height: min(60vh, 440px); overflow-y: auto; display: grid; }
.ev-item {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; text-align: left;
  padding: 10px 12px; border-bottom: var(--stroke) solid var(--line);
}
.ev-item:hover, .ev-item:focus-visible { background: var(--panel-2); outline-offset: -3px; }
.ev-item[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.ev-item[aria-selected="true"] .ev-item-name, .ev-item[aria-selected="true"] .ev-item-meta { color: var(--bg); }
.ev-item-name { font-size: 14px; font-weight: 700; color: var(--fg); }
.ev-item-meta { grid-column: 1; font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.ev-item-on { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--red); }
.ev-item-on svg { width: 16px; height: 16px; }
.ev-empty { padding: 12px; color: var(--fg-3); font-size: 14px; }
.ev-new {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px;
  font: 800 13px/1 var(--font); font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.02em;
  background: var(--red); color: var(--white);
}
.ev-new:hover, .ev-new:focus-visible { background: var(--fg); color: var(--bg); }
.ev-new svg { width: 16px; height: 16px; }

/* ON AIR, in the sidebar, on every section while capture runs. */
.side-live {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; text-align: left;
  background: var(--red); color: var(--white);
}
.side-live .dot.live { background: var(--white); }
.side-live-word { font: 900 20px/1 var(--font); font-stretch: 62%; text-transform: uppercase; }
.side-live-n { margin-left: auto; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.nav { display: grid; border-top: var(--stroke) solid var(--rule); }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px;
  border-bottom: var(--stroke) solid var(--line);
  color: var(--fg-2); text-decoration: none;
  font: 800 15px/1 var(--font); font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.02em;
}
.nav a svg { width: 18px; height: 18px; color: var(--fg-3); }
.nav a:hover { background: var(--panel-2); color: var(--fg); }
.nav a.on { background: var(--fg); color: var(--bg); }
.nav a.on svg { color: var(--red); }
.nav kbd { margin-left: auto; font: 800 11px/1 var(--font); color: var(--fg-3); opacity: 0; }
.nav a.on kbd { color: var(--bg); }
.nav:hover kbd, .nav a:focus-visible kbd { opacity: 1; }
.nav-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center;
  background: var(--red); color: var(--white); font: 900 13px/1 var(--font); font-stretch: 75%;
}
.nav-count + kbd { margin-left: 8px; }

.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; }
.kbar {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border: var(--stroke) solid var(--line-2); color: var(--fg-2); font-size: 14px; font-weight: 600;
}
.kbar:hover { border-color: var(--fg); color: var(--fg); }
.kbar svg { width: 15px; height: 15px; }
.kbar kbd { margin-left: auto; font: 800 11px/1 var(--font); color: var(--fg-3); }
.health { display: grid; gap: 5px; padding: 10px 0; border-top: var(--stroke) solid var(--line); border-bottom: var(--stroke) solid var(--line); font-size: 13px; color: var(--fg); font-weight: 600; }
.health-row { display: flex; align-items: center; gap: 9px; }
.health-row.dim { color: var(--fg-3); padding-left: 18px; font-weight: 500; }
.health .mono { font-weight: 800; color: var(--fg-2); }
.acct { display: flex; align-items: center; gap: 10px; }
.acct-av {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  background: var(--fg); color: var(--bg); font: 900 20px/1 var(--font); font-stretch: 62%;
}
.acct-who { display: grid; gap: 2px; min-width: 0; flex: 1; }
.acct-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-sub { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-sub a { color: var(--red); font-weight: 700; }

/* main + masthead */
.main { min-width: 0; padding: 0 var(--pad-x) 80px; }
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 20px;
  margin: 0 calc(var(--pad-x) * -1) 0; padding: 0 var(--pad-x);
  background: var(--bg);
  border-bottom: 8px solid var(--rule);
}
.top-title { display: grid; gap: 8px; min-width: 0; }
.top-h { font-size: clamp(34px, 3.6vw, 52px); line-height: 0.86; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }
.stream { display: inline-flex; align-items: center; gap: 8px; font: 800 12px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-2); }

.sec { padding-top: 24px; }
.sec.enter { animation: ds-cut-in var(--dur-3) var(--ease) both; }
.sec-intro { color: var(--fg-2); font-size: 15px; max-width: 70ch; margin: -6px 0 22px; }

/* shared pieces */
.card { background: var(--panel); border: var(--stroke) solid var(--line-2); }
.card-head {
  display: flex; align-items: flex-end; gap: 16px; justify-content: space-between;
  padding: 16px 20px 14px; border-bottom: var(--stroke) solid var(--line-2);
}
.card-head.tight { align-items: center; }
.card-title { font: 900 28px/0.9 var(--font); font-stretch: 62%; text-transform: uppercase; color: var(--fg); }
.card.pad > .card-title { margin-bottom: 2px; }
.card-sub { font-size: 14px; color: var(--fg-3); margin-top: 6px; line-height: 1.45; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.row .input { flex: 1; min-width: 0; }
.row.end { justify-content: flex-end; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; min-height: 40px;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tb-count { font: 800 14px/1 var(--font); font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fg-2); display: inline-flex; align-items: baseline; gap: 8px; }
.tb-count b { font: 900 44px/0.8 var(--font); font-stretch: 62%; color: var(--fg); font-variant-numeric: tabular-nums; }
.tb-note { font-size: 14px; color: var(--fg-3); }
.seg { display: inline-flex; border: var(--stroke) solid var(--fg); }
.seg button {
  height: 32px; min-width: 36px; padding: 0 12px;
  font: 800 13px/1 var(--font); font-stretch: 80%; text-transform: uppercase; color: var(--fg-2);
}
.seg button + button { border-left: var(--stroke) solid var(--fg); }
.seg button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--fg-3); pointer-events: none; }
.search .input { height: 36px; padding-left: 34px; width: 220px; font-size: 14px; }
.warnbtn { border-color: var(--warn); color: var(--warn); }
.warnbtn:hover { background: var(--warn); color: var(--black); }
.btn.danger.solid { background: var(--red); color: var(--white); }

.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 64px 20px; color: var(--fg-2); }
.empty h3 { font: 900 44px/0.9 var(--font); font-stretch: 62%; text-transform: uppercase; color: var(--fg); }
.empty p { max-width: 46ch; font-size: 15px; }
.empty .btn { margin-top: 8px; }
.empty-ic { width: 52px; height: 52px; display: grid; place-items: center; border: var(--stroke) solid var(--fg); color: var(--fg); }
.empty-ic svg { width: 24px; height: 24px; }
.muted { color: var(--fg-3); font-size: 15px; }
.unnamed { color: var(--fg-3) !important; }

/* ==========================================================================
   Live
   ========================================================================== */

.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.live-main { display: grid; gap: 24px; min-width: 0; }
.live-side { display: grid; gap: 24px; min-width: 0; position: sticky; top: calc(var(--top-h) + 24px); }

/* the capture panel */
.cap { background: var(--panel); border: var(--stroke) solid var(--fg); }
.cap-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; padding: 24px;
  border-bottom: var(--stroke) solid var(--fg);
}
/* The lamp: a square, grey until it records. */
.cap-dot { display: grid; justify-items: center; gap: 6px; flex: none; }
.cap-dot i { display: block; width: 26px; height: 26px; background: var(--g-500); }
.cap-dot b { font: 900 14px/1 var(--font); font-stretch: 75%; letter-spacing: 0.06em; color: var(--fg-3); }
.cap-words { flex: 1 1 0%; min-width: min-content; }
.cap-state {
  font: 900 clamp(52px, 5.6vw, 96px)/0.82 var(--font); font-stretch: 62%; text-transform: uppercase;
  color: var(--fg); white-space: nowrap;
}
.cap-hint { margin-top: 12px; font-size: 16px; color: var(--fg-2); max-width: 56ch; font-weight: 500; }
.cap-go { flex: none; margin-left: auto; }
.cap-go svg { width: 20px; height: 20px; }

.cap[data-stage="ready"] .cap-dot i { background: var(--fg); }
.cap[data-stage="grant"] .cap-dot i { background: var(--warn); }
.cap[data-stage="grant"] .cap-state { color: var(--warn); }
.cap[data-stage="unsupported"] .cap-dot i { background: var(--red); }
.cap[data-stage="unsupported"] .cap-body { display: none; }
.cap[data-stage="unsupported"] .counters { opacity: 0.35; }

/* ON AIR. The head becomes a solid red sign with a blinking REC lamp. */
.cap[data-stage="live"] { border-color: var(--red); }
.cap[data-stage="live"] .cap-head { background: var(--red); border-bottom-color: var(--red); padding: 28px 24px; }
.cap[data-stage="live"] .cap-state { color: var(--white); font-size: clamp(76px, 8.6vw, 150px); }
.cap[data-stage="live"] .cap-hint { color: var(--white); font-weight: 600; }
.cap[data-stage="live"] .cap-dot i { background: var(--white); animation: ds-rec 1s steps(2, jump-none) infinite; }
.cap[data-stage="live"] .cap-dot b { color: var(--white); }
.btn.stopbtn { background: var(--red); border-color: var(--white); color: var(--white); }
.btn.stopbtn:hover { background: var(--white); color: var(--red); }
.btn.stopbtn[data-arming] { background: var(--white); color: var(--red); border-color: var(--white); }

.cap-unsupported {
  display: flex; gap: 16px; margin: 20px 24px 4px; padding: 18px 20px;
  border: var(--stroke) solid var(--red);
}
.cap-unsupported strong { display: block; font: 900 30px/0.95 var(--font); font-stretch: 62%; text-transform: uppercase; margin-bottom: 8px; }
.cap-unsupported p { color: var(--fg-2); font-size: 15px; max-width: 62ch; }
.un-ic { color: var(--red); flex: none; padding-top: 2px; }
.un-ic svg { width: 24px; height: 24px; }
.getrow { display: flex; gap: 10px; margin-top: 14px; }

.cap-body { display: grid; gap: 14px; padding: 20px 24px 4px; }
.cap-folder {
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 12px;
  border: var(--stroke) solid var(--line-2); background: var(--bg);
}
.cap-folder-ic { width: 38px; height: 38px; display: grid; place-items: center; background: var(--fg); color: var(--bg); flex: none; }
.cap-folder-ic svg { width: 19px; height: 19px; }
.cap-folder-txt { display: grid; gap: 5px; flex: 1; min-width: 0; }
.cap-k { font: 800 11px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); }
.cap-folder-name { font-size: 16px; font-weight: 700; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-folder-name.none { color: var(--fg-3); font-weight: 500; }
.cap-opts { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cap-src { display: grid; gap: 7px; }
.sm-input { height: 40px; width: 220px; font-size: 15px; }

.counters {
  display: grid; grid-template-columns: 1.5fr repeat(5, minmax(0, 1fr));
  margin: 20px 24px 0; border-top: 8px solid var(--rule); border-bottom: var(--stroke) solid var(--rule);
}
.ctr { display: grid; align-content: end; gap: 6px; padding: 14px 8px 12px 14px; border-left: var(--stroke) solid var(--line-2); min-width: 0; }
.ctr:first-child { border-left: 0; padding-left: 0; }
.ctr-v {
  font: 900 clamp(32px, 2.8vw, 52px)/0.85 var(--font); font-stretch: 62%; font-variant-numeric: tabular-nums;
  color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ctr-k { font: 800 12px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-2); }
.ctr-sent .ctr-v { font-size: clamp(52px, 5vw, 84px); }
.ctr.bad .ctr-v, .ctr.bad .ctr-k { color: var(--red); }
.ctr.warn .ctr-v { color: var(--warn); }
.ctr.pop .ctr-v { animation: ctr-pop 420ms steps(1, end); }
@keyframes ctr-pop { 0% { background: var(--white); color: var(--black); } }

.cap-notices { display: grid; gap: 10px; padding: 0 24px; }
.cap-notices:not(:empty) { padding-top: 18px; }
.alarm {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px;
  background: var(--red); color: var(--white); animation: ds-rec 1.2s steps(2, jump-none) 3;
}
.alarm strong { display: block; font: 900 34px/0.92 var(--font); font-stretch: 62%; text-transform: uppercase; }
.alarm p { margin-top: 6px; font-weight: 600; }
.alarm .btn { margin-left: auto; flex: none; }
.alarm-ic svg { width: 32px; height: 32px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; font-size: 15px; font-weight: 600; }
.notice svg { width: 18px; height: 18px; margin-top: 1px; }
.notice.bad { border: var(--stroke) solid var(--red); color: var(--fg); }
.notice.bad svg { color: var(--red); }
.notice.warn { background: var(--warn); color: var(--black); }
.cap-foot { padding: 18px 24px 22px; color: var(--fg-3); font-size: 14px; max-width: 86ch; }

/* contact sheet */
.rate { display: flex; align-items: flex-end; gap: 14px; flex: none; }
.spark { width: 150px; height: 40px; }
.spark.idle { opacity: 0.5; }
.rate-txt { display: grid; gap: 4px; justify-items: end; }
.rate-v { font: 900 40px/0.85 var(--font); font-stretch: 62%; font-variant-numeric: tabular-nums; color: var(--fg); }
.rate-k { font: 800 11px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); }
.sheet {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px 20px;
  max-height: calc(3 * 162px + 2 * 8px + 36px); overflow: hidden;
}
.frame {
  display: flex; flex-direction: column; height: 162px; width: calc(132px * var(--ar, 1.5)); flex: 1 0 auto; max-width: 260px;
  border: var(--stroke) solid var(--fg); background: var(--black); text-align: left;
}
.frame-img { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--panel-2); }
.frame-img img { width: 100%; height: 100%; object-fit: cover; }
.frame:hover { border-color: var(--red); }
/* The caption strip: camera, time, faces. */
.frame-cap {
  display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 7px; flex: none;
  background: var(--black); color: var(--white); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.frame-src { font-weight: 800; text-transform: uppercase; font-stretch: 80%; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.frame-t { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.frame-faces { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.frame-faces svg { width: 12px; height: 12px; }
/* A frame from a different camera than the rest: a warn-yellow tag, and its
   camera name in the same colour, so a second shooter pointed at the wrong
   event is obvious the moment it lands. */
.frame-odd {
  display: none; position: absolute; left: 0; top: 0; padding: 4px 6px;
  background: var(--warn); color: var(--black); font: 900 12px/1 var(--font); font-stretch: 75%; text-transform: uppercase;
}
.frame.odd .frame-odd { display: block; }
.frame.odd .frame-src { color: var(--warn); }
/* A new frame arrives with the strobe: one hard white hit, then the photo. */
.frame.fresh { animation: ds-slam 360ms cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.frame.fresh .frame-img::after {
  content: ""; position: absolute; inset: 0; background: var(--white); pointer-events: none;
  animation: frame-strobe 300ms linear both;
}
.frame.fresh .frame-cap::before {
  content: "Just in"; background: var(--red); color: var(--white); padding: 2px 5px; margin-left: -4px;
  font: 900 11px/1 var(--font); font-stretch: 75%; text-transform: uppercase;
}
@keyframes frame-strobe { 0%, 25% { opacity: 1; } 100% { opacity: 0; } }
.sheet-empty { display: flex; align-items: center; gap: 12px; width: 100%; padding: 28px 4px; color: var(--fg-2); font-size: 15px; }
.sheet-empty svg { width: 22px; height: 22px; color: var(--fg-3); }

.logcard summary {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; cursor: pointer; list-style: none;
  font: 900 22px/1 var(--font); font-stretch: 62%; text-transform: uppercase;
}
.logcard summary::-webkit-details-marker { display: none; }
.logcard summary svg { width: 18px; height: 18px; margin-left: auto; flex: none; }
.logcard[open] summary { border-bottom: var(--stroke) solid var(--line-2); }
.logcard[open] summary svg { transform: rotate(180deg); }
.log-last { font: 500 13px/1.2 var(--font); text-transform: none; font-stretch: 100%; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.log-last.bad { color: var(--warn); }
.log { max-height: 280px; overflow-y: auto; padding: 4px 20px 16px; font-size: 13px; }
.log-row { display: flex; gap: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); color: var(--fg-2); }
.log-row time { color: var(--fg-3); flex: none; font-variant-numeric: tabular-nums; }
.log-row.bad span { color: var(--warn); }

/* side: QR + guests */
.qr-card { padding: 16px; display: grid; gap: 14px; }
.qr-mini-wrap { background: var(--white); padding: 10px; aspect-ratio: 1; }
.qr-mini { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-mini-meta { display: grid; gap: 8px; }
.qr-mini-url { font-size: 18px; font-weight: 800; color: var(--fg); word-break: break-all; }
.qr-mini-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.live-side .card-title { font-size: 24px; }
.card-head .badge { flex: none; white-space: nowrap; }
.pulse { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: var(--stroke) solid var(--line-2); }
.pz { display: grid; gap: 6px; min-width: 0; padding: 12px 10px; border-left: var(--stroke) solid var(--line-2); }
.pz:first-child { border-left: 0; }
.pz-v { font: 900 30px/0.85 var(--font); font-stretch: 62%; font-variant-numeric: tabular-nums; color: var(--fg); }
.pz-k { font: 800 11px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); }
.pz.pop { animation: pz-pop 500ms steps(1, end); }
@keyframes pz-pop { 0% { background: var(--red); } }
.pz.pop .pz-v, .pz.pop .pz-k { animation: pz-pop-t 500ms steps(1, end); }
@keyframes pz-pop-t { 0% { color: var(--white); } }
.ticker { list-style: none; margin: 0; padding: 0; display: grid; }
.tick { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: var(--stroke) solid var(--line); font-size: 14px; font-weight: 600; animation: ds-cut-in var(--dur-2) var(--ease) both; }
.tick-ic { width: 26px; height: 26px; display: grid; place-items: center; border: var(--stroke) solid var(--fg-3); color: var(--fg-2); flex: none; }
.tick-ic svg { width: 14px; height: 14px; }
.tick[data-a="scan"] .tick-ic { background: var(--red); border-color: var(--red); color: var(--white); }
.tick-txt { flex: 1; min-width: 0; color: var(--fg); }
.tick-t { font-size: 12px; color: var(--fg-3); text-transform: uppercase; font-weight: 700; }
.ticker-empty { padding: 14px; font-size: 14px; color: var(--fg-3); }

/* ==========================================================================
   Photos
   ========================================================================== */

.jgrid { position: relative; width: 100%; }
.ph { position: absolute; overflow: hidden; background: var(--panel-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph:hover { outline: var(--stroke) solid var(--fg); outline-offset: -2px; z-index: 1; }
.ph:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; z-index: 2; }
.ph-faces {
  position: absolute; left: 0; bottom: 0; display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 7px; background: var(--black); color: var(--white); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ph-faces svg { width: 12px; height: 12px; }
.ph-flag {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 7px; background: var(--warn); color: var(--black);
  font: 900 12px/1 var(--font); font-stretch: 75%; text-transform: uppercase;
}
.ph-flag svg { width: 12px; height: 12px; }
.ph.unproc { outline: 3px solid var(--warn); outline-offset: -3px; }
.ph.fresh { animation: ds-slam 360ms cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.more { display: grid; place-items: center; padding: 40px 0; }

#selectBtn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.ph-check {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  display: none; place-items: center; background: var(--black); border: var(--stroke) solid var(--white); color: transparent;
}
.ph-check svg { width: 14px; height: 14px; }
.jgrid.selecting .ph-check { display: grid; }
.ph.sel .ph-check { display: grid; background: var(--red); border-color: var(--red); color: var(--white); }
.ph.sel { outline: 4px solid var(--red); outline-offset: -4px; }
.ph.sel img { opacity: 0.75; }

.selbar {
  position: fixed; left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); bottom: 24px; transform: translateX(-50%);
  z-index: 45; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px;
  background: var(--white); color: var(--black); border: var(--stroke) solid var(--black);
  animation: ds-cut-in var(--dur-2) var(--ease) both;
}
.selbar .btn { --fg: var(--black); --bg: var(--white); --panel-2: #e8e5de; }
.selbar .btn.primary { --fg: var(--black); }
.sel-n { font: 900 22px/1 var(--font); font-stretch: 62%; text-transform: uppercase; margin-right: 10px; white-space: nowrap; }

/* possibly misfiled */
.misfile {
  display: flex; align-items: center; gap: 14px; margin: -4px 0 18px; padding: 12px 12px 12px 14px;
  background: var(--warn); color: var(--black); font-size: 15px; font-weight: 500;
}
.misfile p { flex: 1; min-width: 0; }
.misfile b { font-weight: 800; }
.misfile .btn { --fg: var(--black); --bg: var(--warn); }
.mf-ic { display: inline-flex; flex: none; }
.mf-ic svg { width: 20px; height: 20px; }
.misfile.open { display: grid; gap: 0; padding: 0; background: var(--panel); color: var(--fg); border: var(--stroke) solid var(--warn); }
.misfile.open .btn { --fg: var(--white); --bg: var(--black); }
.misfile.open .btn.primary { --fg: var(--white); }
.mf-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: var(--warn); color: var(--black); }
.mf-head .btn { --fg: var(--black) !important; --bg: var(--warn) !important; }
.mf-head p { flex: 1; }
.mf-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 14px; border-top: var(--stroke) solid var(--line); }
.mf-row.on { background: var(--panel-2); }
.mf-strip { display: flex; gap: 2px; }
.mf-strip img { width: 44px; height: 44px; object-fit: cover; }
.mf-what { display: grid; gap: 3px; min-width: 0; }
.mf-what b { font: 900 22px/0.95 var(--font); font-stretch: 62%; text-transform: uppercase; }
.mf-what span { font-size: 13px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mf-acts .btn svg { width: 15px; height: 15px; }

/* ==========================================================================
   Viewer
   ========================================================================== */

dialog.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--black); color: var(--fg);
}
dialog.viewer::backdrop { background: var(--black); }
.vw { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100%; }
.vw-stage { position: relative; display: grid; place-items: center; padding: 28px 76px; min-height: 0; }
.vw-stage img { max-width: 100%; max-height: calc(100vh - 56px); object-fit: contain; border: var(--stroke) solid var(--white); }
.vw-stage img.loading { opacity: 0.3; }
.vw-spin { position: absolute; }
.vw-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; display: grid; place-items: center;
  background: var(--black); border: var(--stroke) solid var(--white); color: var(--white);
}
.vw-nav:hover { background: var(--white); color: var(--black); }
.vw-nav:disabled { opacity: 0.2; pointer-events: none; }
.vw-nav svg { width: 22px; height: 22px; }
.vw-nav.prev { left: 14px; }
.vw-nav.next { right: 14px; }
.vw-side { border-left: var(--stroke) solid var(--white); background: var(--bg); padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.vw-top { display: flex; align-items: center; justify-content: space-between; }
.vw-name { font: 900 34px/0.9 var(--font); font-stretch: 62%; text-transform: uppercase; word-break: break-all; }
.vw-meta { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; font-size: 15px; border-top: var(--stroke) solid var(--white); }
.vw-meta dt, .vw-meta dd { padding: 9px 0; border-bottom: 1px solid var(--line); }
.vw-meta dt { color: var(--fg-3); font: 800 12px/1.6 var(--font); font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.04em; }
.vw-meta dd { margin: 0; color: var(--fg); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.vw-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.vw-hint { line-height: 1.5; }
.vw-keys { margin-top: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   Guests report: a results page
   ========================================================================== */

.report-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.report-head .lede { font-size: 17px; }
.report-head .lede b { color: var(--fg); font-weight: 800; }
.report-acts { display: flex; gap: 8px; }

.kpis {
  display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 26px;
  border-top: 8px solid var(--rule); border-bottom: var(--stroke) solid var(--rule);
}
.kpi { display: grid; align-content: start; gap: 8px; padding: 18px 18px 20px; min-height: 170px; border-left: var(--stroke) solid var(--line-2); }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi.skeleton { margin: 10px; min-height: 150px; border: 0; }
.kpi-k { font: 800 13px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); }
.kpi-v { font: 900 clamp(56px, 5.2vw, 88px)/0.82 var(--font); font-stretch: 62%; font-variant-numeric: tabular-nums; color: var(--fg); }
.kpi-n { font-size: 14px; color: var(--fg-3); line-height: 1.4; }
.kpi.hero .kpi-v { font-size: clamp(100px, 10vw, 170px); color: var(--red); line-height: 0.9; margin-bottom: 22px; }
.kpi.hero .kpi-n { color: var(--fg-2); max-width: 34ch; font-weight: 600; }

.chart-card { margin-bottom: 26px; }
.chart-card .card-head { flex-wrap: wrap; align-items: center; }
#chRange { margin-left: auto; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lg {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border: var(--stroke) solid var(--fg); font: 800 13px/1 var(--font); font-stretch: 80%; text-transform: uppercase; color: var(--fg);
}
.lg-sw { display: inline-flex; }
.lg[aria-pressed="false"] { opacity: 0.35; border-color: var(--line-2); }
.lg:hover { background: var(--panel-2); }
.chart { position: relative; padding: 14px 16px 4px; min-height: 200px; }
.ch-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-grid.base { stroke: var(--white); stroke-width: 2; }
.ch-y, .ch-x { fill: var(--fg-3); font: 700 12px var(--font); font-variant-numeric: tabular-nums; }
.ch-y { text-anchor: end; }
.ch-lbl { fill: var(--fg); font: 800 12px var(--font); font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.04em; }
.ch-bar { fill: var(--g-300); }
.ch-cross { stroke: var(--white); stroke-width: 1; }
.ch-hit { cursor: crosshair; }
.ch-tip {
  position: absolute; min-width: 190px; padding: 10px 12px; pointer-events: none; z-index: 3;
  background: var(--white); color: var(--black); border: var(--stroke) solid var(--black);
  display: grid; gap: 5px; font-size: 14px; font-weight: 600;
}
.ch-tip b { font: 900 20px/1 var(--font); font-stretch: 62%; text-transform: uppercase; margin-bottom: 3px; }
.ch-tip span { display: flex; align-items: center; gap: 8px; }
.ch-tip svg line[stroke="#ffffff"] { stroke: var(--black); }
.ch-tip i.bar { display: inline-block; width: 22px; height: 8px; background: var(--g-500); }
.ch-tip em { margin-left: auto; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-skel { height: 340px; margin-bottom: 16px; }
.chart-table { padding: 0 20px 16px; }
.chart-table summary { cursor: pointer; font: 800 13px/1 var(--font); font-stretch: 85%; text-transform: uppercase; color: var(--fg-2); padding: 8px 0; }
.chart-table summary:hover { color: var(--fg); }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.chart-table th:first-child { text-align: left; font-weight: 600; color: var(--fg-2); }
.chart-table thead th { font: 800 12px/1 var(--font); font-stretch: 85%; text-transform: uppercase; color: var(--fg); border-bottom: var(--stroke) solid var(--white); }

.acts { padding: 0 20px 8px; }
.act {
  display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(120px, 2fr) 100px 150px 80px; gap: 20px; align-items: center;
  padding: 14px 0; border-bottom: var(--stroke) solid var(--line);
}
.act:last-child { border-bottom: 0; }
.act-l { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; }
.act-l b { font: 900 26px/0.9 var(--font); font-stretch: 62%; text-transform: uppercase; }
.act-l span:last-child { grid-column: 2; font-size: 13px; color: var(--fg-3); }
.act-sw { width: 12px; height: 12px; }
.act-bar { height: 18px; background: var(--panel-2); }
.act-bar span { display: block; height: 100%; }
.act-n { font: 900 40px/0.85 var(--font); font-stretch: 62%; font-variant-numeric: tabular-nums; text-align: right; }
.act-g, .act-p { font-size: 14px; color: var(--fg-3); }
.act-g .mono, .act-p .mono { color: var(--fg); font-weight: 800; }

/* ==========================================================================
   People: square crops, caption strips
   ========================================================================== */

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pp { display: grid; min-width: 0; border: var(--stroke) solid var(--fg); background: var(--black); }
.pp.skeleton { aspect-ratio: 1 / 1.25; border: 0; }
.pp-face { width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--panel-2); display: block; }
.pp-face img { width: 100%; height: 100%; object-fit: cover; }
.pp:hover { border-color: var(--red); }
.face-none { display: grid; place-items: center; width: 100%; height: 100%; color: var(--fg-3); }
.face-none svg { width: 40%; height: 40%; }
.pp-name { padding: 6px 6px 0; min-width: 0; border-top: var(--stroke) solid var(--fg); }
.pp-sub { padding: 0 8px 8px; font-size: 12px; color: var(--fg-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.dw-name { width: 100%; min-width: 0; }
.name-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 2px;
  font: 900 20px/1 var(--font); font-stretch: 62%; text-transform: uppercase; color: var(--fg); text-align: left;
}
.name-btn:hover { color: var(--red); }
.name-btn > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-pen { opacity: 0; color: var(--fg-3); display: inline-flex; }
.name-pen svg { width: 13px; height: 13px; }
.name-btn:hover .name-pen, .name-btn:focus-visible .name-pen { opacity: 1; }
.name-in { height: 32px; padding: 0 8px; font-size: 14px; }

/* the person drawer */
dialog.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: none; width: min(560px, 100vw); max-width: none;
  padding: 0; border: 0; border-left: var(--stroke) solid var(--white); background: var(--bg); color: var(--fg);
}
.dw { display: flex; flex-direction: column; height: 100%; }
.dw-head { display: flex; align-items: center; gap: 16px; padding: 20px; border-bottom: 8px solid var(--rule); }
.dw-av { width: 84px; height: 84px; overflow: hidden; flex: none; background: var(--panel-2); border: var(--stroke) solid var(--white); }
.dw-av img { width: 100%; height: 100%; object-fit: cover; }
.dw-who { flex: 1; min-width: 0; display: grid; gap: 6px; }
.dw-name .name-btn { font-size: 44px; line-height: 0.88; }
.dw-name .name-pen svg { width: 16px; height: 16px; }
.dw-name .name-in { height: 44px; font-size: 20px; }
.dw-sub { font-size: 13px; font-weight: 700; color: var(--fg-3); }
.dw-body { flex: 1; overflow-y: auto; padding: 4px 20px 28px; }
.dw-h { font: 900 26px/1 var(--font); font-stretch: 62%; text-transform: uppercase; margin: 22px 0 10px; padding-bottom: 8px; border-bottom: var(--stroke) solid var(--white); }
.dw-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.dw-ph { aspect-ratio: 1; overflow: hidden; background: var(--panel-2); }
.dw-ph img { width: 100%; height: 100%; object-fit: cover; }
.dw-ph:hover { outline: var(--stroke) solid var(--red); outline-offset: -2px; }
.dw-more { grid-column: 1 / -1; margin-top: 8px; justify-self: start; }
.dw-skel { grid-column: 1 / -1; height: 220px; }
.dw-conn { display: grid; margin-bottom: 12px; }
.conn { display: grid; grid-template-columns: 46px minmax(0, 1fr) 130px 18px; gap: 14px; align-items: center; padding: 8px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.conn.skeleton { height: 60px; margin-bottom: 4px; }
.conn:hover { background: var(--panel-2); }
.conn-av { width: 46px; height: 46px; overflow: hidden; background: var(--panel-2); }
.conn-av img { width: 100%; height: 100%; object-fit: cover; }
.conn-who { display: grid; gap: 3px; min-width: 0; }
.conn-who b { font: 900 20px/1 var(--font); font-stretch: 62%; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-who span { font-size: 13px; color: var(--fg-3); }
.conn-str { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--fg-2); }
.conn-bar { height: 6px; background: var(--panel-2); }
.conn-bar i { display: block; height: 100%; background: var(--fg); }
.conn-go svg { width: 16px; height: 16px; color: var(--fg-3); }

/* ==========================================================================
   Share
   ========================================================================== */

.share-grid { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.share-qr { display: grid; justify-items: center; text-align: center; gap: 12px; }
.qr-plate { width: 100%; aspect-ratio: 1; background: var(--white); padding: 18px; border: var(--stroke) solid var(--white); }
.qr-plate img { width: 100%; height: 100%; image-rendering: pixelated; }
.share-name { font-size: clamp(34px, 3.4vw, 52px); margin-top: 12px; }
.share-url { font-size: 20px; font-weight: 800; color: var(--red); word-break: break-all; }
.share-acts { display: flex; gap: 10px; margin-top: 8px; }
.share-qr .hint { max-width: 36ch; margin-top: 4px; }
.share-tools { display: grid; gap: 0; border-top: 8px solid var(--rule); }
.tool {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: start;
  padding: 18px 4px; border-bottom: var(--stroke) solid var(--line-2); text-decoration: none; color: var(--fg);
}
a.tool:hover { background: var(--panel); color: var(--fg); }
a.tool:hover .tool-go { color: var(--red); }
.tool-ic { width: 48px; height: 48px; display: grid; place-items: center; background: var(--fg); color: var(--bg); }
.tool-ic svg { width: 22px; height: 22px; }
.tool-txt { display: grid; gap: 4px; }
.tool-txt b { font: 900 30px/0.9 var(--font); font-stretch: 62%; text-transform: uppercase; }
.tool-txt > span { color: var(--fg-2); font-size: 15px; }
.tool-go { width: 20px; height: 20px; color: var(--fg); margin-top: 4px; }
.tv-modes { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.tvm { display: grid; gap: 4px; padding: 10px 12px; text-decoration: none; border: var(--stroke) solid var(--line-2); color: var(--fg); }
.tvm:hover { border-color: var(--red); color: var(--fg); }
.tvm b { font: 900 22px/1 var(--font); font-stretch: 62%; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; }
.tvm b::after { content: "↗"; color: var(--fg-3); font-weight: 700; font-stretch: 100%; font-size: 15px; }
.tvm-def { font: 900 11px/1 var(--font); font-style: normal; text-transform: uppercase; background: var(--red); color: var(--white); padding: 3px 5px; margin-left: 8px; margin-right: auto; }
.tvm span { font-size: 13px; color: var(--fg-3); line-height: 1.4; }
.howto { margin-top: 26px; padding-top: 16px; border-top: var(--stroke) solid var(--rule); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.steps li, .ne-next li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.step-n {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--red); color: var(--white); font: 900 28px/1 var(--font); font-stretch: 62%;
}
.steps b, .ne-next b { display: block; font: 900 22px/0.95 var(--font); font-stretch: 62%; text-transform: uppercase; margin-bottom: 5px; }
.steps span:not(.step-n), .ne-next li span:not(.step-n) { font-size: 14px; color: var(--fg-2); }

/* ==========================================================================
   Branding
   ========================================================================== */

.brand-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.brand-form { display: grid; gap: 18px; }
.drop {
  position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; margin-top: 16px;
  padding: 30px 20px; border: var(--stroke) dashed var(--fg-3); background: var(--bg); cursor: pointer;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 26px; height: 26px; color: var(--fg); margin-bottom: 4px; }
.drop:hover, .drop.over { border-color: var(--red); border-style: solid; }
.drop.has { border-style: solid; border-color: var(--fg); }
.drop:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.drop-main { font-weight: 700; font-size: 15px; }
.drop-sub { font-size: 13px; color: var(--fg-3); }
.note-card { display: flex; gap: 14px; padding: 14px 16px; border-left: 8px solid var(--rule); background: var(--panel); color: var(--fg-2); font-size: 14px; line-height: 1.55; }
.note-card svg { width: 18px; height: 18px; color: var(--fg); flex: none; margin-top: 2px; }
.brand-preview { margin: 0; position: sticky; top: calc(var(--top-h) + 24px); }
.bp-frame { position: relative; display: grid; place-items: center; min-height: 360px; background: var(--black); border: var(--stroke) solid var(--white); }
.bp-frame img { width: 100%; max-height: calc(100vh - 230px); object-fit: contain; }
.bp-frame.loading img { opacity: 0.3; }
.bp-frame.loading::after { content: ""; position: absolute; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--red); animation: ds-spin 0.7s linear infinite; }
.bp-frame.none img { display: none; }
.brand-preview figcaption {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--white); color: var(--black);
  font-size: 13px; font-weight: 600;
}
.brand-preview figcaption::before { content: "Preview"; background: var(--red); color: var(--white); padding: 3px 6px; font: 900 12px/1 var(--font); font-stretch: 75%; text-transform: uppercase; }

/* ==========================================================================
   Settings
   ========================================================================== */

.sec-settings { display: grid; gap: 0; max-width: 1080px; }
.sec-settings .card { border: 0; border-bottom: var(--stroke) solid var(--line-2); background: transparent; padding: 22px 0; }
.set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 28px; align-items: center; }
.set:has(.ids) { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
.set .row { margin-top: 0; justify-content: flex-end; }
.set-txt .card-sub { max-width: 52ch; }
.ids { display: grid; margin: 0; border-top: var(--stroke) solid var(--white); }
.ids > div { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; gap: 10px; align-items: center; min-height: 38px; border-bottom: 1px solid var(--line); }
.ids dt { font: 800 12px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); }
.ids dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--fg); word-break: break-all; }
.danger-zone .card-title { color: var(--red); }

/* ==========================================================================
   Leads: a typed list
   ========================================================================== */

.leads { display: grid; border-top: 8px solid var(--rule); }
.lead {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 16px 0;
  border-bottom: var(--stroke) solid var(--line-2);
}
.lead.skeleton { height: 110px; margin-top: 6px; border: 0; }
.lead-main { display: grid; gap: 6px; min-width: 0; }
.lead-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-name { font: 900 30px/0.9 var(--font); font-stretch: 62%; text-transform: uppercase; }
.lead-co { color: var(--fg-2); font-size: 15px; font-weight: 600; }
.lead-t { margin-left: auto; font-size: 13px; color: var(--fg-3); font-weight: 600; }
.lead-mail { font-size: 15px; font-weight: 700; color: var(--fg); justify-self: start; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.lead-mail:hover { color: var(--red); }
.lead-facts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.lead-facts span { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); font-weight: 600; }
.lead-facts svg { width: 14px; height: 14px; color: var(--fg-3); }
.lead-msg { font-size: 15px; color: var(--fg-2); line-height: 1.55; white-space: pre-wrap; max-width: 80ch; padding-left: 12px; border-left: var(--stroke) solid var(--line-2); }
.lead-side { display: grid; gap: 10px; justify-items: end; align-content: start; }
.status-seg { display: inline-flex; border: var(--stroke) solid var(--fg); }
.status-seg button { height: 30px; padding: 0 12px; font: 800 13px/1 var(--font); font-stretch: 80%; text-transform: uppercase; color: var(--fg-2); }
.status-seg button + button { border-left: var(--stroke) solid var(--fg); }
.status-seg button:hover { background: var(--panel-2); color: var(--fg); }
.status-seg button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.status-seg button[aria-checked="true"][data-s="new"] { background: var(--red); color: var(--white); }
.status-seg button[aria-checked="true"][data-s="booked"] { background: var(--ok); color: var(--black); }

/* ==========================================================================
   No event
   ========================================================================== */

.noev { display: grid; justify-items: start; gap: 22px; padding: 10vh 0; max-width: 820px; }
.noev .lede { max-width: 48ch; }
.noev-ic { width: 64px; height: 64px; display: grid; place-items: center; background: var(--red); color: var(--white); }
.noev-ic svg { width: 30px; height: 30px; }

/* ==========================================================================
   Dialogs
   ========================================================================== */

.dlg { padding: 26px; display: grid; gap: 0; }
.dlg .kicker { margin-bottom: 14px; }
.dlg-title { font-size: clamp(40px, 4vw, 56px); line-height: 0.88; }
.dlg-sub { color: var(--fg-2); margin: 12px 0 20px; font-size: 15px; line-height: 1.55; }
.dlg-sub b { color: var(--fg); font-weight: 800; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: var(--stroke) solid var(--line-2); }
.dlg-err { margin-top: 14px; padding: 12px 14px; background: var(--red); color: var(--white); font-size: 15px; font-weight: 600; line-height: 1.5; }
.dlg-err a { color: var(--white); margin-left: 4px; font-weight: 800; }
.dlg-err b { font-weight: 800; }
.lg-input { height: 60px; font-size: 20px; font-weight: 700; }
.newev { width: min(94vw, 580px); }
.ne-next { list-style: none; padding: 0; margin: 0; display: grid; border-top: var(--stroke) solid var(--white); }
.ne-next li { grid-template-columns: auto 1fr auto; align-items: center; padding: 14px 0; border-bottom: var(--stroke) solid var(--line-2); }
.confirm { width: min(94vw, 520px); }
.confirm .field { margin-bottom: 4px; }
.confirm .field span b { color: var(--red); }

.movedlg { width: min(94vw, 580px); }
.mv-list { display: grid; max-height: min(46vh, 380px); overflow-y: auto; border-top: var(--stroke) solid var(--white); }
.mv-opt { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-bottom: var(--stroke) solid var(--line-2); cursor: pointer; }
.mv-opt:hover { background: var(--panel); }
.mv-opt:has(input:checked) { background: var(--fg); color: var(--bg); }
.mv-opt:has(input:checked) .mv-txt span { color: var(--bg); }
.mv-opt input { accent-color: var(--red); width: 18px; height: 18px; flex: none; }
.mv-txt { display: grid; gap: 3px; flex: 1; min-width: 0; }
.mv-txt b { font: 900 24px/0.95 var(--font); font-stretch: 62%; text-transform: uppercase; }
.mv-txt span { font-size: 13px; color: var(--fg-3); font-weight: 600; }
.mv-likely:empty { display: none; }
.mv-txt .mv-likely.badge { justify-self: start; margin-top: 4px; color: var(--white); }
.mv-note { margin-top: 14px; line-height: 1.5; }
#mvGo { white-space: normal; text-align: center; height: auto; min-height: 48px; padding-top: 10px; padding-bottom: 10px; line-height: 1.15; }

dialog.palette { margin: 12vh auto auto; width: min(94vw, 620px); padding: 0; background: var(--bg); border: var(--stroke) solid var(--white); color: var(--fg); }
.pl-in { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: var(--stroke) solid var(--white); }
.pl-in svg { width: 18px; height: 18px; color: var(--fg-2); }
.pl-in input { flex: 1; height: 60px; background: none; border: 0; outline: none; font-size: 18px; font-weight: 600; color: var(--fg); }
.pl-in input::placeholder { color: var(--fg-3); }
.pl-list { max-height: min(52vh, 460px); overflow-y: auto; padding: 4px 0; }
.pl-group { padding: 12px 16px 6px; font: 800 12px/1 var(--font); font-stretch: 85%; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); }
.pl-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 16px; text-align: left; font-size: 15px; font-weight: 600; }
.pl-item[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.pl-item[aria-selected="true"] .pl-ic { color: var(--red); }
.pl-item[aria-selected="true"] .pl-hint { color: var(--bg); }
.pl-ic { color: var(--fg-3); display: inline-flex; }
.pl-ic svg { width: 16px; height: 16px; }
.pl-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-hint { font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.pl-empty { padding: 22px; color: var(--fg-3); text-align: center; }
.pl-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: var(--stroke) solid var(--line-2); font-size: 13px; color: var(--fg-3); }
.pl-foot > span { display: inline-flex; gap: 4px; align-items: center; }

/* ==========================================================================
   Narrower windows
   ========================================================================== */

@media (max-width: 1360px) {
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ctr:nth-child(4) { border-left: 0; padding-left: 0; }
  .ctr:nth-child(n+4) { border-top: var(--stroke) solid var(--line-2); }
  .ctr-v { font-size: 44px; }
  .ctr-sent .ctr-v { font-size: 64px; }
  .live-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .cap-go { --h: 60px; padding: 0 24px; font-size: 19px; min-width: 0; }
  .pz { padding: 11px 8px; }
  .pz-v { font-size: 26px; }
}
@media (max-width: 1240px) {
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .live-side { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qr-card { grid-template-columns: 170px minmax(0, 1fr); align-items: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; padding-left: 0; }
  .kpi:nth-child(n+3) { border-top: var(--stroke) solid var(--line-2); }
  .act { grid-template-columns: minmax(180px, 1.4fr) minmax(80px, 1.4fr) 90px 140px; }
  .act-p { display: none; }
}
@media (max-width: 1100px) {
  :root { --side-w: 228px; }
  .share-grid, .brand-grid { grid-template-columns: minmax(0, 1fr); }
  .share-qr { max-width: 420px; margin: 0 auto; }
  .brand-preview { position: static; }
  .set, .set:has(.ids) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .set .row { justify-content: flex-start; }
  .steps { grid-template-columns: 1fr; }
  .vw { grid-template-columns: minmax(0, 1fr) 290px; }
  .vw-stage { padding: 24px 64px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: var(--stroke) solid var(--rule); }
  .side-foot { margin-top: 12px; }
  .live-side { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { border-left: 0; padding-left: 0; border-top: var(--stroke) solid var(--line-2); }
  .act { grid-template-columns: minmax(0, 1fr) 70px; }
  .act-bar, .act-g { display: none; }
  .vw { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .vw-side { border-left: 0; border-top: var(--stroke) solid var(--white); max-height: 45vh; }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead-side { justify-items: start; }
  .selbar { left: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .frame.fresh .frame-img::after { display: none; }
}

/* Narrow portrait frames: keep the camera name, drop the time. */
.frame { min-width: 132px; container-type: inline-size; }
@container (max-width: 170px) { .frame-t { display: none; } }
/* Quiet buttons on light strips need dark text. */
.selbar, .mf-head { --fg-2: var(--black); --fg-3: #333333; }

/* Links wrap only at the <wbr> between host and path, never inside the code. */
#liveUrl, #shareUrl { overflow-wrap: normal; word-break: normal; }

/* --- second shooters ------------------------------------------------------------ */
.crew-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.crew-add .input { flex: 1 1 220px; height: 36px; font-size: 14px; }
.crew-list { display: grid; gap: 6px; margin-top: 12px; }
.crew-row { display: flex; align-items: center; gap: 8px; border-top: var(--stroke) solid var(--line); padding-top: 8px; }
.crew-who { flex: 1; display: grid; gap: 2px; min-width: 0; }
.crew-who span { font-size: 12px; color: var(--fg-3); }
.toggle-row { display: flex; align-items: center; gap: 12px; font-weight: 800; text-transform: uppercase; font-size: 13px; }

/* --- accounts (operator) ----------------------------------------------------------- */
.acc-intro { margin-bottom: 18px; max-width: 70ch; }
.accs { display: grid; gap: 0; border-top: 8px solid var(--white); }
.acc { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: var(--stroke) solid var(--line); }
.acc-who { display: grid; gap: 3px; min-width: 0; }
.acc-who b { font-size: 16px; }
.acc-who span { font-size: 13px; color: var(--fg-3); }
.acc-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* --- a second shooter's Studio: capture for one event, nothing else --------------- */
.is-shooter #nav a:not([data-section="live"]),
.is-shooter .ev-chev, .is-shooter #kbarBtn, .is-shooter #evNew, .is-shooter .ev-menu,
.is-shooter .pulse-card, .is-shooter #topGuestLink { display: none !important; }
.is-shooter #evBtn { pointer-events: none; }
.is-shooter :is(label, div):has(> #sourceLabel) { display: none !important; }
