/* PosseLab Studio — Sala de control.
   Paleta Grafito y arcilla: #141413 #2B2A27 #6B6A65 #CC785C #F5F4EE. Todo lo demás se mezcla de ahí. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/ui/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("/ui/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/ui/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("/ui/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("/ui/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/ui/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  --c-graphite: #141413;
  --c-iron: #2B2A27;
  --c-silk: #6B6A65;
  --c-clay: #CC785C;
  --c-cream: #F5F4EE;

  --ground: var(--c-graphite);
  --rack: color-mix(in oklab, var(--c-graphite) 64%, var(--c-iron));
  --panel: var(--c-iron);
  --panel-hi: color-mix(in oklab, var(--c-iron) 80%, var(--c-silk));
  --well: color-mix(in oklab, var(--c-graphite) 82%, black);
  --line: color-mix(in oklab, var(--c-iron) 52%, var(--c-silk));
  --line-soft: color-mix(in oklab, var(--c-graphite) 30%, var(--c-iron));
  --ink: var(--c-cream);
  --ink-2: color-mix(in oklab, var(--c-cream) 72%, var(--c-silk));
  --ink-3: color-mix(in oklab, var(--c-cream) 46%, var(--c-silk));
  --clay: var(--c-clay);
  --clay-hi: color-mix(in oklab, var(--c-clay) 84%, var(--c-cream));
  --clay-lo: color-mix(in oklab, var(--c-clay) 20%, var(--c-graphite));
  --clay-ink: var(--c-graphite);

  --f-ui: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --f-air: "Barlow", system-ui, sans-serif; /* same face the compositor burns in (assets/fonts) */

  --t-2xs: 0.6875rem;
  --t-xs: 0.75rem;
  --t-s: 0.8125rem;
  --t-m: 0.9375rem;
  --t-l: 1.0625rem;
  --t-xl: 1.3125rem;
  --t-2xl: 1.625rem;
  --t-3xl: 2.125rem;

  --r-s: 4px;
  --r: 6px;
  --r-l: 10px;
  --gap: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 160ms;
  --strip-h: 56px;
}

* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 var(--t-m)/1.5 var(--f-ui);
  font-variant-numeric: lining-nums;
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in oklab, var(--c-clay) 45%, var(--c-graphite)); color: var(--c-cream); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--clay); }
a { color: var(--ink); text-decoration-color: color-mix(in oklab, var(--c-cream) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--clay); }
a.key, a.iconbtn, a.choice, a.tile, a.srckey, a.kindbtn, a.saldo, .nav a, .mobile-nav a, .wordmark { text-decoration: none; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--ground); }
::-webkit-scrollbar-track { background: transparent; }
.num, .tc { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.s { width: 16px; height: 16px; }
.icon.l { width: 26px; height: 26px; stroke-width: 1.5; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- hardware label (rótulo) */
.label {
  font: 600 var(--t-xs)/1 var(--f-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- tally lamp */
.lamp {
  --lamp: var(--line);
  display: inline-block;
  width: 14px;
  height: 6px;
  border-radius: 2px;
  background: var(--lamp);
  flex: none;
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.lamp.on { --lamp: var(--clay); box-shadow: 0 0 10px 1px color-mix(in oklab, var(--c-clay) 55%, transparent); }
.lamp.rec { --lamp: var(--clay); animation: rec 1.6s ease-in-out infinite; }
.lamp.done { --lamp: var(--c-cream); }
@keyframes rec { 50% { opacity: 0.35; box-shadow: none; } }

/* ---------------------------------------------------------------- shell + strip */
.shell { min-height: 100dvh; display: grid; grid-template-rows: var(--strip-h) 1fr; }
.strip {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: var(--rack);
  border-bottom: 1px solid var(--line-soft);
}
.wordmark { display: flex; align-items: baseline; gap: 8px; text-decoration: none; white-space: nowrap; }
.wordmark b { font: 600 1.125rem/1 var(--f-label); letter-spacing: 0.16em; color: var(--ink); }
.wordmark span { font: 500 var(--t-m)/1 var(--f-ui); color: var(--ink-3); }
.nav { display: flex; gap: 2px; margin-right: auto; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--panel); color: var(--ink); }
.strip-right { display: flex; align-items: center; gap: 10px; }

.onair {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--ground);
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
}
.onair.live { color: var(--ink); border-color: color-mix(in oklab, var(--c-clay) 45%, var(--c-iron)); }
.onair .label { color: inherit; }

.saldo {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: var(--ground);
  text-decoration: none;
  color: var(--ink);
}
.saldo .label { grid-row: 1; }
.saldo .val { grid-row: 1 / span 2; grid-column: 2; font: 600 var(--t-l)/1 var(--f-ui); font-variant-numeric: tabular-nums; }
.saldo .bar { grid-row: 2; height: 3px; width: 92px; background: var(--panel); border-radius: 2px; overflow: hidden; }
.saldo .bar i { display: block; height: 100%; width: 100%; background: var(--c-cream); border-radius: 2px; transform-origin: left center; transform: scaleX(0); transition: transform 400ms var(--ease); }
.saldo.low .bar i { background: var(--clay); }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
}
.iconbtn:hover { background: var(--panel); color: var(--ink); }
.iconbtn[aria-current="page"] { background: var(--panel); color: var(--ink); }

/* on-air tray */
.tray {
  position: fixed;
  top: calc(var(--strip-h) + 6px);
  right: 16px;
  width: min(380px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  padding: 8px;
  background: var(--rack);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: 0 22px 50px -20px rgb(0 0 0 / 0.75);
  z-index: 30;
}
.tray[hidden] { display: none; }
.tray-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r); }
.tray-row + .tray-row { border-top: 1px solid var(--line-soft); }
.tray-row b { font-weight: 500; display: block; }
.tray-row small { color: var(--ink-3); font-size: var(--t-s); }
.tray-empty { padding: 18px 12px; color: var(--ink-3); }

main { min-width: 0; }

/* ---------------------------------------------------------------- keys (buttons) */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform 80ms;
}
.key:hover { background: var(--panel-hi); }
.key:active { transform: translateY(1px); }
.key[disabled], .key[aria-disabled="true"] { cursor: not-allowed; color: var(--ink-3); background: var(--panel); border-color: var(--line-soft); transform: none; }
.key.primary { background: var(--clay); border-color: var(--clay); color: var(--clay-ink); font-weight: 600; }
.key.primary:hover { background: var(--clay-hi); border-color: var(--clay-hi); }
.key.primary[disabled] { background: var(--panel); border-color: var(--line-soft); color: var(--ink-3); }
.key.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.key.ghost:hover { background: var(--panel); color: var(--ink); }
.key.big { min-height: 48px; padding: 0 22px; font-size: var(--t-l); }
.key.s { min-height: 32px; padding: 0 12px; font-size: var(--t-s); }
.key.busy { position: relative; color: transparent !important; }
.key.busy::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--ink-3) var(--ink-3) var(--ink-3) transparent;
  animation: spin 0.8s linear infinite;
}
.key.primary.busy::after { border-color: var(--clay-ink) var(--clay-ink) var(--clay-ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- fields */
.field { display: grid; gap: 7px; }
.field > span, .field > label, .legend { font-size: var(--t-s); font-weight: 500; color: var(--ink-2); }
.field small, .hint { font-size: var(--t-s); color: var(--ink-3); }
.input, .textarea, .select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
/* Focus and error must not look alike: focus is a ring, an error also tints the field. */
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-lo); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--clay); background: color-mix(in oklab, var(--c-clay) 8%, var(--well)); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.textarea.script { min-height: 220px; font-size: var(--t-l); line-height: 1.65; padding: 16px 18px; }
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9A79F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}
.select option { background: var(--c-iron); color: var(--c-cream); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
input[type="range"] { accent-color: var(--clay); width: 100%; }
input[type="color"] { width: 44px; height: 42px; padding: 4px; border-radius: var(--r); border: 1px solid var(--line); background: var(--well); cursor: pointer; }
input[type="checkbox"] { accent-color: var(--clay); width: 18px; height: 18px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink-2); }
.check:hover { color: var(--ink); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: calc(var(--r) + 3px); background: var(--well); border: 1px solid var(--line-soft); gap: 2px; flex-wrap: wrap; }
.seg button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel-hi); color: var(--ink); }

/* choice tiles (presenter, brand, format) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 8px 8px 10px;
  border-radius: var(--r-l);
  border: 1px solid var(--line-soft);
  background: var(--rack);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.choice:hover { border-color: var(--line); background: var(--panel); }
.choice[aria-pressed="true"] { border-color: var(--clay); background: color-mix(in oklab, var(--c-clay) 7%, var(--rack)); }
.choice .thumb { aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--well); display: grid; place-items: center; }
.choice .thumb img { width: 100%; height: 100%; object-fit: cover; }
.choice .thumb.logo { padding: 12px; }
.choice .thumb.logo img { object-fit: contain; }
.choice .name { display: flex; align-items: center; gap: 8px; font-weight: 500; padding: 0 4px; }
.choice .name .lamp { margin-left: auto; }
.choice small { color: var(--ink-3); padding: 0 4px; font-size: var(--t-s); margin-top: -4px; }
.choice.add { place-items: center; align-content: center; min-height: 150px; color: var(--ink-2); border-style: dashed; }
.choice.add:hover { color: var(--ink); }

/* disclosure for settings */
details.adjust { border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.adjust > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 500;
  font-size: var(--t-s);
  padding: 4px 0;
}
details.adjust > summary::-webkit-details-marker { display: none; }
details.adjust > summary:hover { color: var(--ink); }
details.adjust > summary .icon.chev { transition: transform var(--fast) var(--ease); }
details.adjust[open] > summary .icon.chev { transform: rotate(90deg); }
details.adjust .adjust-body { display: grid; gap: 14px; padding-top: 14px; }

/* ---------------------------------------------------------------- program monitor */
.monitor {
  --w: 100%;
  width: var(--w);
  padding: 10px 10px 0;
  border-radius: var(--r-l);
  background: var(--panel);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 24px 48px -28px rgb(0 0 0 / 0.85);
  margin-inline: auto;
}
.monitor.v { --w: min(100%, calc((min(66vh, 720px)) * 9 / 16 + 20px)); }
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  background: var(--well);
  container-type: size;
  isolation: isolate;
}
.monitor.v .screen { aspect-ratio: 9 / 16; }
.screen > .media, .screen > .media > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen > .media img, .screen > .media video { object-fit: cover; background: var(--well); }
.screen > .media.contain img, .screen > .media.contain video { object-fit: contain; }

/* standby slate when there is no media */
.slate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2.4cqh;
  padding: 8cqh;
  text-align: center;
  color: var(--ink-3);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 16 - 1px), color-mix(in oklab, var(--c-iron) 55%, transparent) calc(100% / 16 - 1px) calc(100% / 16)),
    repeating-linear-gradient(0deg, transparent 0 calc(100% / 9 - 1px), color-mix(in oklab, var(--c-iron) 55%, transparent) calc(100% / 9 - 1px) calc(100% / 9)),
    var(--well);
}
.monitor.v .slate {
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / 9 - 1px), color-mix(in oklab, var(--c-iron) 55%, transparent) calc(100% / 9 - 1px) calc(100% / 9)),
    repeating-linear-gradient(0deg, transparent 0 calc(100% / 16 - 1px), color-mix(in oklab, var(--c-iron) 55%, transparent) calc(100% / 16 - 1px) calc(100% / 16)),
    var(--well);
}
.slate .icon { width: 9cqh; height: 9cqh; stroke-width: 1.2; color: var(--ink-3); }
.slate p { font: 500 max(13px, 3.6cqh)/1.35 var(--f-ui); max-width: 34ch; color: var(--ink-2); }
.slate .label { font-size: max(11px, 2.6cqh); }

/* brand overlays: same geometry as src/media/captions.ts + compositor.ts */
.ov { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ov-logo { position: absolute; display: grid; place-items: center; }
.ov-logo img { width: 100%; height: auto; display: block; }
.ov-lt { position: absolute; left: 6cqw; top: 78cqh; display: grid; grid-template-columns: auto auto; font-family: var(--f-air); line-height: 1; opacity: 1; transition: opacity 250ms; }
.monitor.v .ov-lt { top: 70cqh; }
.ov-lt .bar { grid-row: 1 / span 2; width: 1.1cqh; background: var(--b-accent); }
.ov-lt .t { background: var(--b-primary); color: var(--b-text); font-weight: 700; font-size: 5cqh; height: 6.75cqh; padding: 0.75cqh 2.5cqh 0 2.5cqh; white-space: nowrap; }
.ov-lt .s { background: var(--b-text); color: var(--b-primary); font-size: 3.1cqh; height: 4.75cqh; padding: 0.6cqh 2.5cqh 0 2.5cqh; white-space: nowrap; }
.ov-cap {
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  bottom: 8cqh;
  text-align: center;
  font: 700 6cqh/1.15 var(--f-air);
  text-transform: uppercase;
  color: var(--b-text);
  -webkit-text-stroke: 0.7cqh var(--b-primary);
  paint-order: stroke fill;
  text-wrap: balance;
}
.monitor.v .ov-cap { bottom: 22cqh; font-size: 4.5cqh; }
.ov-cap em { font-style: normal; color: var(--b-accent); }
.ov-guides { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.ov-guides::before, .ov-guides::after { content: ""; position: absolute; border: 1px dashed color-mix(in oklab, var(--c-cream) 45%, transparent); border-radius: 2px; }
.ov-guides::before { inset: 5%; }
.ov-guides::after { inset: 10%; border-color: color-mix(in oklab, var(--c-clay) 60%, transparent); }
.ov-guides .gl { position: absolute; font: 600 max(9px, 1.8cqh)/1 var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; color: color-mix(in oklab, var(--c-cream) 65%, transparent); }

/* busy veil over the screen while generating */
.veil {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2cqh;
  background: color-mix(in oklab, var(--c-graphite) 62%, transparent);
  backdrop-filter: blur(2px) saturate(0.7);
  text-align: center;
  padding: 6cqh;
}
.veil[hidden] { display: none; }
.veil .tc { font: 600 max(22px, 9cqh)/1 var(--f-label); letter-spacing: 0.04em; color: var(--ink); }
.veil p { font: 500 max(13px, 3.4cqh)/1.35 var(--f-ui); color: var(--ink-2); max-width: 36ch; }
.veil .label { color: var(--clay-hi); font-size: max(11px, 2.4cqh); display: inline-flex; gap: 1cqh; align-items: center; }

/* under-monitor display */
.umd { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 4px; }
.umd .label { color: var(--ink-2); white-space: nowrap; }
.umd .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: var(--t-s); }
.umd .tc { margin-left: auto; font: 600 var(--t-m)/1 var(--f-label); letter-spacing: 0.06em; color: var(--ink-2); }
.umd .tools { display: flex; gap: 2px; margin-left: 4px; }
.umd .tools .iconbtn { width: 32px; height: 32px; }
.umd .tools .iconbtn[aria-pressed="true"] { color: var(--clay); background: var(--rack); }
.umd .seg { padding: 2px; flex-wrap: nowrap; }
.monitor.v .umd { flex-wrap: wrap; row-gap: 2px; padding-bottom: 6px; }
.monitor.v .umd .tools { order: 5; width: 100%; margin-left: 0; justify-content: space-between; }
.umd .seg button { min-height: 26px; padding: 0 10px; font: 600 var(--t-xs)/1 var(--f-label); letter-spacing: 0.08em; }

/* ---------------------------------------------------------------- desk (wizard layout) */
.desk { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: calc(100dvh - var(--strip-h)); }
.rundown {
  position: sticky;
  top: var(--strip-h);
  align-self: start;
  height: calc(100dvh - var(--strip-h));
  overflow: auto;
  padding: 28px 16px 24px 20px;
  background: var(--rack);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.rundown h1 { font-size: var(--t-xl); line-height: 1.2; }
.rundown .lede { color: var(--ink-3); font-size: var(--t-s); margin-top: 6px; }
.cues { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: cue; }
.cue {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 2px 10px;
  align-items: start;
  width: 100%;
  padding: 10px 10px 11px;
  border-radius: var(--r);
  border: 0;
  background: transparent;
  color: var(--ink-3);
  text-align: left;
  cursor: pointer;
}
.cue:hover:not([disabled]) { background: var(--panel); color: var(--ink-2); }
.cue[disabled] { cursor: default; }
.cue .n { font: 600 var(--t-s)/1.45 var(--f-label); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.cue .what { font-weight: 500; line-height: 1.45; }
.cue .sum { grid-column: 2; font-size: var(--t-s); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cue.done { color: var(--ink-2); }
.cue.done .n { color: var(--ink-2); }
.cue.current { background: var(--panel); color: var(--ink); }
.cue.current .n { color: var(--clay-hi); }
.cue .lampwrap { grid-row: 1; grid-column: 1; display: flex; align-items: center; height: 22px; }
.rundown .foot { margin-top: auto; display: grid; gap: 10px; }

/* OBS-like desk (Noticia): the rundown on the left, the step being filled in the center, the scene (Programa) on the right. */
.desk.obs { grid-template-columns: 264px minmax(400px, 1fr) minmax(0, 1.25fr); grid-template-areas: "cues panel mon"; }
.desk.obs .rundown { grid-area: cues; }
.desk.obs .obs-panel { grid-area: panel; padding: 28px 28px 56px; min-width: 0; }
.desk.obs .obs-mon { grid-area: mon; position: sticky; top: var(--strip-h); align-self: start; padding: 28px 32px 28px 0; min-width: 0; }
.desk.obs .obs-mon .monitor.v { --w: min(100%, calc(min(74vh, 760px) * 9 / 16 + 20px)); }
@media (max-width: 1279px) {
  .desk.obs { grid-template-columns: 232px minmax(360px, 1fr) minmax(0, 1.1fr); }
  .desk.obs .obs-panel { padding: 24px 20px 56px; }
  .desk.obs .obs-mon { padding: 24px 24px 24px 0; }
}
@media (max-width: 1079px) {
  .desk.obs { grid-template-columns: 232px minmax(0, 1fr); grid-template-areas: "cues mon" "cues panel"; }
  .desk.obs .obs-mon { position: static; padding: 24px 24px 0 28px; }
  .desk.obs .obs-mon .monitor:not(.v) { --w: min(100%, calc(48vh * 16 / 9 + 20px)); }
  .desk.obs .obs-mon .monitor.v { --w: min(100%, calc(56vh * 9 / 16 + 20px)); }
  .desk.obs .obs-panel { padding: 22px 24px 56px 28px; }
}
.rundown .foot .hint { line-height: 1.45; }

.stage { padding: 28px 32px 56px; min-width: 0; display: grid; gap: 22px; align-content: start; }
.stage-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; max-width: 1180px; width: 100%; margin-inline: auto; }
.stage-cols.duo { max-width: 1440px; }
.mon-col { display: grid; gap: 12px; min-width: 0; }
@media (min-width: 1280px) {
  .stage-cols.duo { grid-template-columns: minmax(0, 1fr) minmax(400px, 460px); }
  .stage-cols.duo .mon-col { position: sticky; top: calc(var(--strip-h) + 28px); }
  .stage-cols.duo .monitor.v { --w: min(100%, calc(min(74vh, 760px) * 9 / 16 + 20px)); }
}
@media (max-width: 1279px) {
  .stage-cols.duo .monitor:not(.v) { --w: min(100%, calc(52vh * 16 / 9 + 20px)); }
  .stage-cols.duo .monitor.v { --w: min(100%, calc(56vh * 9 / 16 + 20px)); }
}
.panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: var(--r-l);
  background: var(--rack);
  border: 1px solid var(--line-soft);
  align-content: start;
}
.panel h2 { font-size: var(--t-xl); line-height: 1.25; }
.panel .sub { color: var(--ink-3); margin-top: -10px; }
.panel .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.panel .actions .spacer { flex: 1; }
.meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-3); font-size: var(--t-s); }
.meta b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }

/* spend gate (inline confirmation) */
.gate {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-l);
  border: 1px solid color-mix(in oklab, var(--c-clay) 55%, var(--c-iron));
  background: var(--clay-lo);
  animation: rise 220ms var(--ease);
}
.gate p { color: var(--ink); }
.gate small { color: var(--ink-2); display: block; font-size: var(--t-s); margin-top: 2px; }
.gate .row { flex-wrap: nowrap; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink-2);
  font-size: var(--t-s);
  line-height: 1.5;
}
.note .icon { color: var(--ink-3); margin-top: 1px; }
.note.err { background: var(--clay-lo); color: var(--ink); }
.note.err .icon { color: var(--clay); }
.note a { color: var(--ink); }

/* audio strip */
.tape { display: grid; gap: 8px; }
.tape-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r); background: var(--panel); }
.tape-row p { font-size: var(--t-s); color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tape-row .tc { font: 600 var(--t-s)/1 var(--f-label); letter-spacing: 0.06em; color: var(--ink-3); }
.playbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--rack); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.playbtn:hover { border-color: var(--clay); color: var(--clay); }
.playbtn.on { background: var(--clay); color: var(--clay-ink); border-color: var(--clay); }
audio.native { width: 100%; height: 40px; color-scheme: dark; }

/* ---------------------------------------------------------------- home */
.home { max-width: 1320px; margin-inline: auto; padding: 32px 32px 64px; display: grid; gap: 40px; }
.home-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
.home-top .monitor { width: 100%; }
.sources { display: grid; gap: 10px; align-content: start; }
.sources h1 { font-size: var(--t-2xl); line-height: 1.15; margin-bottom: 4px; }
.sources .lede { color: var(--ink-3); margin-bottom: 10px; }
.srckeys { display: grid; gap: 8px; margin-top: 4px; }
.srckey {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 12px;
  padding: 16px 18px 15px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.05) inset;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}
.srckey .cap { font: 600 1.375rem/1 var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; }
.srckey p { grid-column: 2; color: var(--ink-3); font-size: var(--t-s); line-height: 1.4; }
.srckey .lamp { width: 18px; height: 8px; }
.srckey.hot { background: var(--clay); border-color: var(--clay); color: var(--clay-ink); }
.srckey.hot p { color: var(--clay-ink); }
.srckey.hot .lamp { --lamp: var(--c-graphite); box-shadow: none; }
.srckey:focus-visible { outline-color: var(--ink); }
.setup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: start;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: var(--rack);
  color: var(--ink-2);
  font-size: var(--t-s);
  line-height: 1.45;
}
.setup .icon { margin-top: 2px; color: var(--ink-3); }
.setup b { color: var(--ink); font-weight: 500; }
.setup .key { grid-column: 2; justify-self: start; }

/* ---------------------------------------------------------------- multiviewer */
.section-head { display: flex; align-items: end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: var(--t-xl); }
.section-head .spacer { flex: 1; }
.mv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; padding: 4px; background: var(--well); border-radius: var(--r); }
.tile { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 0; border-radius: 2px; background: var(--panel); padding: 0; text-align: left; border: 1px solid var(--line-soft); color: var(--ink); cursor: pointer; overflow: hidden; transition: border-color var(--fast) var(--ease); }
.tile:hover { border-color: var(--line); }
.tile[aria-pressed="true"], .tile.newest { border-color: var(--clay); }
.tile .scr { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--well); display: grid; place-items: center; }
/* Absolute so a tall poster can never stretch the 16:9 frame (aspect-ratio yields to content otherwise). */
.tile .scr img, .tile .scr video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tile .scr img.bg { object-fit: cover; filter: blur(14px) brightness(0.55); transform: scale(1.15); }
.tile .scr .icon { width: 32px; height: 32px; color: var(--ink-3); stroke-width: 1.3; }
.tile .scr .kind { position: absolute; left: 6px; top: 6px; padding: 3px 6px; border-radius: 3px; background: color-mix(in oklab, var(--c-graphite) 78%, transparent); }
.tile .scr .kind .label { color: var(--ink-2); font-size: var(--t-2xs); }
.tile .tu { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; }
.tile .tu span:not(.lamp) { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--t-s); color: var(--ink-2); }
.tile .tu time { font: 600 var(--t-xs)/1 var(--f-label); letter-spacing: 0.06em; color: var(--ink-3); white-space: nowrap; }
.empty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-radius: var(--r-l);
  border: 1px dashed var(--line);
  color: var(--ink-2);
}
.empty .icon { width: 30px; height: 30px; color: var(--ink-3); }
.empty b { color: var(--ink); font-weight: 500; display: block; margin-bottom: 2px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-hi) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--r-l); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- page (library, brands, admin) */
.page { max-width: 1320px; margin-inline: auto; padding: 32px 32px 64px; display: grid; gap: 36px; align-content: start; }
.page-head { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--t-2xl); line-height: 1.15; }
.page-head p { color: var(--ink-3); margin-top: 6px; max-width: 60ch; }
.page-head .spacer { flex: 1; }
.viewer { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.facts { display: grid; gap: 10px; margin: 0; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: var(--t-s); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink-2); word-break: break-word; }

.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.kit { display: grid; gap: 0; border-radius: var(--r-l); background: var(--panel); padding: 8px 8px 0; }
.kit .monitor { padding: 0; box-shadow: none; background: transparent; }
.kit .umd { padding: 0 2px; }
.badge { font: 600 var(--t-2xs)/1 var(--f-label); letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 6px; border-radius: 3px; background: var(--rack); color: var(--ink-3); }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 14px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08) inset; }
.colorrow { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.positions { display: grid; grid-template-columns: repeat(2, 72px); gap: 6px; }
.positions button { height: 44px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--well); cursor: pointer; position: relative; }
.positions button::after { content: ""; position: absolute; width: 18px; height: 8px; border-radius: 2px; background: var(--ink-3); }
.positions button[data-p="top-left"]::after { left: 6px; top: 6px; }
.positions button[data-p="top-right"]::after { right: 6px; top: 6px; }
.positions button[data-p="bottom-left"]::after { left: 6px; bottom: 6px; }
.positions button[data-p="bottom-right"]::after { right: 6px; bottom: 6px; }
.positions button[aria-pressed="true"] { border-color: var(--clay); }
.positions button[aria-pressed="true"]::after { background: var(--clay); }
.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border-radius: var(--r-l);
  border: 1px dashed var(--line);
  background: var(--well);
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: var(--clay); background: color-mix(in oklab, var(--c-clay) 6%, var(--well)); }
.dropzone img { max-height: 90px; width: auto; }
.dropzone small { color: var(--ink-3); }

.voices { display: grid; gap: 6px; max-height: 320px; overflow: auto; padding-right: 4px; }
.voice { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r); border: 1px solid transparent; background: var(--panel); cursor: pointer; text-align: left; color: var(--ink); }
.voice:hover { border-color: var(--line); }
.voice[aria-pressed="true"] { border-color: var(--clay); }
.voice b { font-weight: 500; display: block; }
.voice small { color: var(--ink-3); font-size: var(--t-s); }

/* tables (admin) */
.table-wrap { overflow: auto; border-radius: var(--r-l); border: 1px solid var(--line-soft); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th { font: 600 var(--t-xs)/1 var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); background: var(--rack); position: sticky; top: 0; }
table.data td { color: var(--ink-2); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
.gauge { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px 16px; max-width: 760px; }
.gauge b { font: 600 var(--t-xl)/1 var(--f-ui); }
.gauge .bar { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; }
.gauge .bar i { display: block; height: 100%; width: 100%; background: var(--c-cream); transform-origin: left center; }
.gauge .hint { grid-column: 1 / -1; }
.settings { display: grid; gap: 0; border-radius: var(--r-l); border: 1px solid var(--line-soft); background: var(--rack); }
.setting { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; }
.setting + .setting { border-top: 1px solid var(--line-soft); }
.setting b { font-weight: 500; display: block; }
.setting small { color: var(--ink-3); font-size: var(--t-s); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--panel-hi); transition: background var(--fast) var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-2); transition: transform var(--fast) var(--ease), background var(--fast) var(--ease); }
.switch input:checked + span { background: var(--clay); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--clay-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--clay); outline-offset: 2px; }
pre.code { margin: 0; padding: 14px; border-radius: var(--r); background: var(--well); color: var(--ink-2); font: 400 var(--t-s)/1.5 ui-monospace, "SF Mono", Menlo, monospace; overflow: auto; max-height: 260px; white-space: pre-wrap; }

/* piece picker (single pieces) */
details.adjust.more { margin-top: 4px; }
details.adjust.more > summary { padding: 8px 10px; }
.kinds { display: grid; gap: 2px; }
.kinds .label { padding: 14px 10px 6px; }
.kindbtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: var(--r); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-align: left; font-weight: 500; }
.kindbtn:hover { background: var(--panel); color: var(--ink); }
.kindbtn[aria-current="true"] { background: var(--panel); color: var(--ink); }
.kindbtn[aria-current="true"] .icon { color: var(--clay); }
.kindbtn .icon { color: var(--ink-3); }

/* ---------------------------------------------------------------- connect (first run) */
.connect { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; }
.connect-card { width: min(560px, 100%); display: grid; gap: 22px; }
.connect-card .monitor { width: 100%; }
.connect-card .slate b { font: 600 max(18px, 7cqh)/1 var(--f-label); letter-spacing: 0.16em; color: var(--ink); }
.connect-card h1 { font-size: var(--t-2xl); }
.connect-card form { display: grid; gap: 14px; }

/* ---------------------------------------------------------------- sign-in gates */
.gate-lede { color: var(--ink-3); margin-top: 6px; }
.gate-form { display: grid; gap: 16px; }
.gate-form .hint { line-height: 1.5; }
.secret { position: relative; }
.secret .input { padding-right: 48px; }
.secret .peek { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; }
.secret .peek[aria-pressed="true"] { color: var(--ink); }

/* account chip + menu in the strip */
.userchip {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.userchip:hover, .userchip[aria-expanded="true"] { border-color: var(--clay); }
.userchip .initials { font: 600 var(--t-s)/1 var(--f-label); letter-spacing: 0.06em; }
.usermenu {
  position: fixed;
  top: calc(var(--strip-h) + 6px);
  right: 16px;
  width: min(300px, calc(100vw - 32px));
  padding: 6px;
  background: var(--rack);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: 0 22px 50px -20px rgb(0 0 0 / 0.75);
  z-index: 30;
  display: grid;
  gap: 2px;
}
.usermenu[hidden] { display: none; }
.usermenu .who { display: grid; gap: 2px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.usermenu .who b { font-weight: 600; }
.usermenu .who small { color: var(--ink-3); font-size: var(--t-s); overflow-wrap: anywhere; }
.usermenu .who .badge { justify-self: start; margin-top: 6px; }
.menuitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r);
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.menuitem:hover { background: var(--panel); color: var(--ink); }

/* people (admin) */
.people-add { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1fr) auto auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.reveal {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: var(--r-l);
  border: 1px solid color-mix(in oklab, var(--c-clay) 55%, var(--c-iron));
  background: var(--clay-lo);
}
.reveal p { color: var(--ink); }
.reveal small { display: block; color: var(--ink-2); font-size: var(--t-s); margin-top: 4px; }
.reveal .temp {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: var(--r);
  background: var(--well);
  color: var(--ink);
  font: 600 var(--t-l)/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  user-select: all;
}
table.data.people td { white-space: normal; vertical-align: middle; }
table.data.people .person { display: block; color: var(--ink); font-weight: 500; }
table.data.people .mail { color: var(--ink-3); font-size: var(--t-s); }
table.data.people .seg { padding: 2px; }
table.data.people .seg button { min-height: 28px; padding: 0 10px; font-size: var(--t-s); }
table.data.people tr.off td { color: var(--ink-3); }
table.data.people tr.off .person { color: var(--ink-3); }
table.data.people .state { font-size: var(--t-s); color: var(--ink-2); }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-l);
  background: var(--rack);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.8);
  animation: rise 220ms var(--ease);
}
.toast p { font-size: var(--t-s); color: var(--ink); }
.toast.err { border-color: color-mix(in oklab, var(--c-clay) 60%, var(--c-iron)); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .home-top { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; }
  .nav a span { display: none; }
  .nav a { padding: 0 10px; }
}
@media (max-width: 900px) {
  :root { --strip-h: 56px; }
  .strip { gap: 10px; padding: 0 12px; }
  .wordmark span { display: none; }
  .saldo .bar { display: none; }
  .saldo { row-gap: 0; }
  .saldo .val { grid-row: 1; font-size: var(--t-m); }
  .onair:not(.live) { display: none; }
  .onair .label { display: none; }
  .desk, .desk.obs { grid-template-columns: 1fr; }
  .desk.obs { grid-template-areas: "cues" "mon" "panel"; }
  .desk.obs .obs-mon { padding: 18px 16px 0; }
  .desk.obs .obs-panel { padding: 18px 16px 48px; }
  .rundown { position: static; height: auto; padding: 18px 16px 14px; border-right: 0; border-bottom: 1px solid var(--line-soft); gap: 12px; }
  .rundown .lede, .rundown .foot { display: none; }
  .cues { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 4px; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .cues li { scroll-snap-align: start; }
  .cue { grid-template-columns: auto auto; padding: 8px 12px; }
  .cue .what { white-space: nowrap; }
  .cue .sum { display: none; }
  .stage { padding: 18px 16px 48px; }
  .home, .page { padding: 20px 16px 56px; gap: 28px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .monitor.v { --w: min(100%, calc(62vh * 9 / 16 + 20px)); }
  .gate { grid-template-columns: 1fr; }
  .people-add { grid-template-columns: 1fr; }
  .reveal { grid-template-columns: 1fr; }
  .setup { grid-template-columns: auto 1fr; }
  .setup .key { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .nav { display: none; }
  .strip-right { margin-left: auto; }
  .mv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .srckey { padding: 14px 14px 13px; }
  .panel { padding: 16px; }
  .umd .title { display: none; }
}
.mobile-nav { display: none; }
@media (max-width: 560px) {
  .shell { grid-template-rows: var(--strip-h) 1fr auto; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: var(--rack);
    border-top: 1px solid var(--line-soft);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border-radius: var(--r); color: var(--ink-3); text-decoration: none; font-size: var(--t-2xs); font-weight: 500; }
  .mobile-nav a[aria-current="page"] { color: var(--ink); background: var(--panel); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .lamp.rec { animation: none; }
}

/* ---------------------------------------------------------------- design review (phase 7) */
/* 7.4 Nothing in the strip may push the page wider than the phone. */
.shell > * { min-width: 0; }
.strip { min-width: 0; overflow: hidden; }
.strip-right { min-width: 0; }
.saldo, .onair { flex: none; }

/* 7.5 Brand cards keep their column: long names ellipsize instead of widening the card. */
/* The card's own column must be allowed to shrink below the long name's width. */
.kit { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.kit .monitor { width: 100%; max-width: 100%; min-width: 0; }
.kit .umd { min-width: 0; }
.kit .umd .label { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }

/* 7.6 Active brand: a chip like "En curso" and "Saldo", with its own menu. */
.brand-pick { position: relative; }
.brandchip { display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 220px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--ground); color: var(--ink); cursor: pointer; flex: none; }
.brandchip img { height: 18px; width: auto; max-width: 64px; object-fit: contain; }
.brandchip .label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.brandchip .icon.chev { transform: rotate(90deg); color: var(--ink-3); }
.tray.brands { right: auto; }
.tray-row.pick { cursor: pointer; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); }
.tray-row.pick:hover, .tray-row.pick[aria-current="true"] { background: var(--panel); }
.tray-row.pick img { height: 22px; width: 44px; object-fit: contain; }
@media (max-width: 900px) { .brand-pick { display: none; } }

/* 7.9 A select that sits among segmented filters measures like one. */
.select.s { width: auto; min-height: 34px; padding-block: 4px; font-size: var(--t-s); }
.section-head .hint { margin-top: 4px; }

/* 7.8 One empty treatment: nothing to list = the dashed box alone, outside the well. */
.mv.is-empty { display: block; padding: 0; background: none; }

/* 7.7 A monitor with nothing to show yet shows the brand's closing card. */
.slate.brand { background: color-mix(in oklab, var(--b-primary, var(--c-graphite)) 85%, black); }
.screen > .media .slate.brand img { width: 28cqw; height: auto; opacity: 0.95; background: none; object-fit: contain; }
.slate.brand small { color: var(--ink-3); font-size: max(11px, 2.4cqh); }
.monitor.standby-brand .ov-logo { display: none; } /* the card already shows the logo */

/* ---------------------------------------------------------------- companies (workspaces) */
/* The company this tab works in: first thing after the wordmark, like the name on a studio door. */
.wschip { display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 260px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--ground); color: var(--ink); flex: none; min-width: 0; }
button.wschip { cursor: pointer; }
button.wschip:hover, button.wschip[aria-expanded="true"] { border-color: var(--line); background: var(--panel); }
.wschip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wschip .wsstate { font: 600 var(--t-2xs)/1 var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.wschip .icon.chev { transform: rotate(90deg); color: var(--ink-3); flex: none; }
.tray.wsmenu { right: auto; width: min(340px, calc(100vw - 32px)); }
.tray.wsmenu .tray-row.pick { grid-template-columns: auto 1fr auto; text-decoration: none; }
.tray.wsmenu .tray-row.pick b { font-weight: 500; }
.tray.wsmenu .tray-row.pick small { display: block; color: var(--ink-3); font-size: var(--t-s); }
.tray.wsmenu .tray-row.pick .icon { color: var(--ink-3); }
@media (max-width: 900px) { .wschip { max-width: 150px; } .wschip .wsstate { display: none; } }
@media (max-width: 560px) { .wschip { max-width: 120px; padding: 0 8px; } }

/* PosseLab inside a client's company. */
.supportbar { display: flex; align-items: center; gap: 10px; padding: 8px 32px; background: var(--clay-lo); border-bottom: 1px solid color-mix(in oklab, var(--c-clay) 45%, var(--c-iron)); font-size: var(--t-s); color: var(--ink); }
.supportbar .icon { color: var(--clay); flex: none; }
.supportbar span { flex: 1; min-width: 0; }
@media (max-width: 900px) { .supportbar { padding: 8px 16px; } }

/* Company list on the gates (choose, paused, trial over). */
.wslist { display: grid; gap: 6px; }
.wsrow { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--rack); color: var(--ink); text-align: left; cursor: pointer; }
.wsrow:hover { background: var(--panel); border-color: var(--line); }
.wsrow b { font-weight: 500; display: block; }
.wsrow small { color: var(--ink-3); font-size: var(--t-s); }
.wsrow .icon { color: var(--ink-3); }
.wsrow[disabled] { cursor: not-allowed; opacity: 0.6; }

/* ---------------------------------------------------------------- PosseLab console */
/* Figures across the top: label as silkscreen, value in tabular figures. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-l); overflow: hidden; }
.kpi { display: grid; gap: 6px; align-content: start; padding: 16px 18px; background: var(--rack); }
.kpi b { font: 600 var(--t-2xl)/1.1 var(--f-ui); font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi small { color: var(--ink-3); font-size: var(--t-s); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }

/* A company's state: lamp + silkscreen word. Clay only lights what needs a look. */
.wsbadge { display: inline-flex; align-items: center; gap: 8px; font: 600 var(--t-xs)/1 var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.wsbadge[data-state="trial_ended"], .wsbadge[data-state="suspended"] { color: var(--clay); }
.wsbadge[data-state="closed"] { color: var(--ink-3); }
.wsbadge.big { vertical-align: middle; margin-left: 6px; padding: 5px 8px; border-radius: 3px; background: var(--rack); border: 1px solid var(--line-soft); }
table.data.companies a.person { text-decoration: none; }
table.data.companies a.person:hover { text-decoration: underline; text-decoration-color: var(--clay); }
table.data.companies td { white-space: nowrap; }
table.data.companies td:first-child { white-space: normal; min-width: 200px; }

/* New company: an inline sheet under the page head. */
.panel.sheet { max-width: 880px; }
.panel.sheet[hidden] { display: none; }
.setting.inline { padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--ground); }
.people-add.two { grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1fr) auto; }

/* Company page tabs: links that read like the segmented control, one per section. */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: calc(var(--r) + 3px); background: var(--well); border: 1px solid var(--line-soft); justify-self: start; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: var(--r); color: var(--ink-2); font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--panel-hi); color: var(--ink); }
.tabbody { display: grid; gap: 22px; align-content: start; }
.key.back { justify-self: start; margin-left: -8px; }
.grid2.top, .grid3.top { align-items: start; }

/* Thin meters: trial days, limits, shares. Cream fill; clay when a limit is nearly used. */
.meter { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: var(--ink-2); transform-origin: left center; }
.meter.hot i { background: var(--clay); }
.capuse { display: grid; gap: 6px; margin-top: 10px; }
.capuse small, .grid3 > div > small { color: var(--ink-3); font-size: var(--t-s); }
.grid3 > div > small { display: block; margin-top: 10px; }

/* Day by day: one bar per day, quiet days as a hairline. */
.daychart { display: grid; gap: 6px; padding: 16px 16px 10px; border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--rack); }
.daychart-plot svg { display: block; width: 100%; height: 150px; }
.daychart-plot rect.on { fill: var(--ink-2); }
.daychart-plot rect.on:hover { fill: var(--c-cream); }
.daychart-plot rect.off { fill: var(--line); }
.daychart-axis { display: flex; justify-content: space-between; font: 600 var(--t-xs)/1 var(--f-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Breakdowns: label, amount, share and a meter. */
.shares { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 14px; border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--rack); }
.shares li { display: grid; gap: 6px; }
.shares-top { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; }
.shares-top span { color: var(--ink); overflow-wrap: anywhere; }
.shares-top b { font-weight: 600; font-variant-numeric: tabular-nums; }
.shares-top small, .shares li > small { color: var(--ink-3); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.analysis { display: grid; gap: 28px; }

/* How to charge: three offers side by side. */
.proposal { display: grid; gap: 14px; }
.offer { display: grid; gap: 10px; align-content: start; padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--rack); }
.offer .price { font: 600 var(--t-3xl)/1 var(--f-ui); font-variant-numeric: tabular-nums; color: var(--ink); }
.offer .price small { font-size: var(--t-m); font-weight: 500; color: var(--ink-3); }
.offer p { color: var(--ink-2); font-size: var(--t-s); }
.offer ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: var(--t-s); display: grid; gap: 4px; }
.offer ul.prices { list-style: none; padding: 0; gap: 10px; }
.offer ul.prices li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.offer ul.prices b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.offer ul.prices small { grid-column: 1 / -1; color: var(--ink-3); }
.offer .key { justify-self: start; }

/* History: when, who, what. */
.events { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--rack); overflow: hidden; }
.events li { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 16px; font-size: var(--t-s); color: var(--ink-2); }
.events li + li { border-top: 1px solid var(--line-soft); }
.events time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.events b { color: var(--ink); font-weight: 500; }
@media (max-width: 900px) {
  .events li { grid-template-columns: 1fr; gap: 2px; }
  .people-add.two { grid-template-columns: 1fr; }
  .offer .price { font-size: var(--t-2xl); }
}
.trialrow { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; }
@media (max-width: 560px) { .trialrow { grid-template-columns: 1fr; gap: 6px; } }
.nav a { white-space: nowrap; }
.nav .short { display: none; }
@media (max-width: 1360px) {
  .nav .long { display: none; }
  .nav .short { display: inline; }
}
@media (max-width: 1200px) { .wschip .wsstate { display: none; } }
/* The support bar takes its own row; the page keeps the stretching one. */
.shell:has(> .supportbar) { grid-template-rows: var(--strip-h) auto 1fr; }
@media (max-width: 560px) { .shell:has(> .supportbar) { grid-template-rows: var(--strip-h) auto 1fr auto; } }
/* Pages are one column that may shrink: wide tables scroll inside their frame instead of widening the page. */
.page { grid-template-columns: minmax(0, 1fr); }
.page > *, .tabbody > *, .analysis > * { min-width: 0; }
@media (max-width: 560px) {
  .supportbar { flex-wrap: wrap; }
  .tabs { justify-self: stretch; }
}
@media (max-width: 560px) {
  /* Console and team are also in the account menu: on a phone the account chip wins the space. */
  .strip-right a.iconbtn[data-route] { display: none; }
  .strip:has(.wschip) .saldo .label { display: none; }
}
.grid2 > *, .grid3 > * { min-width: 0; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
