/* Montserrat — bundled in /fonts (SIL Open Font License). Falls back to an installed copy. */
@font-face { font-family: "Montserrat"; src: url("/fonts/Montserrat-Variable.ttf") format("truetype"), local("Montserrat"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/fonts/Montserrat-Italic-Variable.ttf") format("truetype"), local("Montserrat Italic"); font-weight: 100 900; font-style: italic; font-display: swap; }

/* QBridge — styled after Apple's Human Interface Guidelines:
   system colours & materials, SF type, large titles, inset grouped lists,
   hairline separators, capsule buttons, segmented controls, popovers and alerts. */

:root {
  /* Montserrat everywhere; numbers use its tabular figures so times don't jiggle */
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --rounded: var(--font);
  --mono: var(--font);
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --sb-w: 248px; --tb-h: 52px;
  --fs: 1; /* per-viewer text size (set from the sidebar) */
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Light appearance */
  color-scheme: light;
  --bg: #f2f2f7;               /* systemGroupedBackground */
  --bg-2: #ffffff;             /* secondarySystemGroupedBackground */
  --bg-3: #f2f2f7;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .29);
  --sep-opaque: #c6c6c8;
  --fill: rgba(120, 120, 128, .2);
  --fill-2: rgba(120, 120, 128, .16);
  --fill-3: rgba(118, 118, 128, .12);
  --fill-4: rgba(116, 116, 128, .08);
  --bar: rgba(249, 249, 249, .78);
  --sidebar: rgba(236, 236, 241, .82);
  --material: rgba(255, 255, 255, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .12), 0 12px 40px rgba(0, 0, 0, .18);
  --c-red: #ff3b30; --c-orange: #ff9500; --c-yellow: #ffcc00; --c-green: #34c759; --c-teal: #30b0c7;
  --c-blue: #007aff; --c-purple: #af52de; --c-pink: #ff2d55; --c-gray: #8e8e93; --c-indigo: #5856d6;
  --tint-amt: 14%;
  --accent: var(--c-blue);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --bg-2: #1c1c1e; --bg-3: #2c2c2e;
    --label: #ffffff; --label-2: rgba(235, 235, 245, .6); --label-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .65); --sep-opaque: #38383a;
    --fill: rgba(120, 120, 128, .36); --fill-2: rgba(120, 120, 128, .32); --fill-3: rgba(118, 118, 128, .24); --fill-4: rgba(118, 118, 128, .18);
    --bar: rgba(22, 22, 24, .78); --sidebar: rgba(30, 30, 32, .78); --material: rgba(44, 44, 46, .86);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .1), 0 16px 48px rgba(0, 0, 0, .55);
    --c-red: #ff453a; --c-orange: #ff9f0a; --c-yellow: #ffd60a; --c-green: #30d158; --c-teal: #40c8e0;
    --c-blue: #0a84ff; --c-purple: #bf5af2; --c-pink: #ff375f; --c-gray: #8e8e93; --c-indigo: #5e5ce6;
    --tint-amt: 22%;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --bg-2: #1c1c1e; --bg-3: #2c2c2e;
  --label: #ffffff; --label-2: rgba(235, 235, 245, .6); --label-3: rgba(235, 235, 245, .3);
  --sep: rgba(84, 84, 88, .65); --sep-opaque: #38383a;
  --fill: rgba(120, 120, 128, .36); --fill-2: rgba(120, 120, 128, .32); --fill-3: rgba(118, 118, 128, .24); --fill-4: rgba(118, 118, 128, .18);
  --bar: rgba(22, 22, 24, .78); --sidebar: rgba(30, 30, 32, .78); --material: rgba(44, 44, 46, .86);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .1), 0 16px 48px rgba(0, 0, 0, .55);
  --c-red: #ff453a; --c-orange: #ff9f0a; --c-yellow: #ffd60a; --c-green: #30d158; --c-teal: #40c8e0;
  --c-blue: #0a84ff; --c-purple: #bf5af2; --c-pink: #ff375f; --c-gray: #8e8e93; --c-indigo: #5e5ce6;
  --tint-amt: 22%;
}
/* Row/column tints derived from the system colours */
:root {
  --tint-red: color-mix(in srgb, var(--c-red) var(--tint-amt), transparent);
  --tint-orange: color-mix(in srgb, var(--c-orange) var(--tint-amt), transparent);
  --tint-yellow: color-mix(in srgb, var(--c-yellow) var(--tint-amt), transparent);
  --tint-green: color-mix(in srgb, var(--c-green) var(--tint-amt), transparent);
  --tint-teal: color-mix(in srgb, var(--c-teal) var(--tint-amt), transparent);
  --tint-blue: color-mix(in srgb, var(--c-blue) var(--tint-amt), transparent);
  --tint-purple: color-mix(in srgb, var(--c-purple) var(--tint-amt), transparent);
  --tint-pink: color-mix(in srgb, var(--c-pink) var(--tint-amt), transparent);
  --tint-gray: color-mix(in srgb, var(--c-gray) var(--tint-amt), transparent);
  --current-bg: color-mix(in srgb, var(--c-red) 16%, transparent);
  --next-bg: color-mix(in srgb, var(--c-green) 9%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-variant-numeric: lining-nums; background: var(--bg); color: var(--label); font: calc(13px * var(--fs))/1.38 var(--font); letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; }
.secondary { color: var(--label-2); }
.tertiary { color: var(--label-3); }
.footnote { font-size: calc(12px * var(--fs)); }
.caption { font-size: calc(11px * var(--fs)); }
.hidden { display: none !important; }
.spacer { flex: 1; }
.icon-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex: none; }
::placeholder { color: var(--label-3); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }

/* ---------- layout: sidebar + main ---------- */
.app { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .3s var(--ease); }
body.sb-collapsed .app { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: hidden auto; background: var(--sidebar); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-right: .5px solid var(--sep); padding: 14px 10px 12px; display: flex; flex-direction: column; gap: 2px; z-index: 30; }
body.sb-collapsed .sidebar { padding-left: 0; padding-right: 0; border-right: 0; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 700; font-size: calc(15px * var(--fs)); white-space: nowrap; }
.app-icon { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(#3a3a3c, #1c1c1e); display: grid; place-items: center; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .15); flex: none; }
.app-icon span { width: 12px; height: 12px; border-radius: 50%; background: #ff453a; box-shadow: 0 0 0 3px rgba(255, 69, 58, .3); }
.sb-section { font-size: calc(11px * var(--fs)); font-weight: 600; color: var(--label-2); padding: 14px 10px 4px; white-space: nowrap; }
.sb-item { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; color: var(--label); white-space: nowrap; cursor: default; font-size: calc(13px * var(--fs)); }
.sb-item .icon-svg { color: var(--accent); font-size: calc(16px * var(--fs)); }
.sb-item:hover { background: var(--fill-4); }
.sb-item.active { background: var(--fill-2); font-weight: 600; }
.sb-count { margin-left: auto; color: var(--label-2); font-size: calc(12px * var(--fs)); font-variant-numeric: tabular-nums; }
.sb-recent { padding: 4px 10px 4px 35px; font-size: calc(12px * var(--fs)); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; display: flex; gap: 6px; align-items: center; }
.sb-recent:hover { background: var(--fill-4); color: var(--label); }
.sb-recent.active { color: var(--label); background: var(--fill-3); }
.sb-recent .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-red); flex: none; }
.sb-foot { margin-top: auto; padding: 12px 6px 0; display: grid; gap: 10px; border-top: .5px solid var(--sep); }
.sb-who { display: flex; align-items: center; gap: 8px; font-size: calc(12px * var(--fs)); color: var(--label-2); white-space: nowrap; padding: 0 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-orange); flex: none; }
.status-dot.ok { background: var(--c-green); }
.status-dot.down { background: var(--c-red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.toolbar { position: sticky; top: 0; z-index: 20; height: var(--tb-h); display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); }
.tb-title { font-weight: 600; font-size: calc(13px * var(--fs)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tb-sub { color: var(--label-2); font-size: calc(11px * var(--fs)); }
.tb-titles { display: flex; flex-direction: column; min-width: 0; margin-left: 4px; }
body.offline #app { opacity: .55; }

/* ---------- controls ---------- */
.btn { appearance: none; border: 0; background: var(--fill-3); color: var(--label); border-radius: 999px; padding: 6px 14px; font-weight: 500; font-size: calc(13px * var(--fs)); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: default; white-space: nowrap; transition: transform .1s, background .15s, opacity .15s; }
.btn:hover:not(:disabled) { background: var(--fill-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .35; }
.btn-filled { background: var(--accent); color: #fff; }
.btn-filled:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-tinted { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.btn-tinted:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-destructive { color: var(--c-red); }
.btn-small { padding: 4px 11px; font-size: calc(12px * var(--fs)); }
.btn-large { padding: 11px 20px; font-size: calc(15px * var(--fs)); font-weight: 600; border-radius: 12px; }
.btn-plain { background: transparent; color: var(--accent); padding: 6px 8px; }
.btn-plain:hover:not(:disabled) { background: var(--fill-4); }
.tb-btn { appearance: none; border: 0; background: transparent; color: var(--label-2); width: 32px; height: 28px; border-radius: 7px; display: inline-grid; place-items: center; font-size: calc(17px * var(--fs)); cursor: default; }
.tb-btn:hover { background: var(--fill-4); color: var(--label); }
.tb-back { appearance: none; border: 0; background: transparent; color: var(--accent); display: inline-flex; align-items: center; gap: 2px; font-size: calc(13px * var(--fs)); padding: 4px 6px; border-radius: 7px; white-space: nowrap; }
.tb-back .icon-svg { font-size: calc(17px * var(--fs)); }
.tb-back:hover { background: var(--fill-4); }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--label-2); width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: calc(15px * var(--fs)); cursor: default; flex: none; }
.icon-btn:hover { background: var(--fill-3); color: var(--label); }
.icon-btn.go:hover { color: var(--c-green); }
.field { appearance: none; width: 100%; background: var(--bg-2); border: .5px solid var(--sep); border-radius: 8px; padding: 7px 10px; outline: none; transition: box-shadow .15s; }
.field:focus { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.search { position: relative; }
.search .icon-svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--label-2); }
.search input { appearance: none; width: 220px; border: 0; background: var(--fill-3); border-radius: 8px; padding: 5px 10px 5px 28px; outline: none; }
.search input:focus { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 35%, transparent); }
.toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--label-2); font-size: calc(12px * var(--fs)); white-space: nowrap; cursor: default; user-select: none; }
.switch { appearance: none; width: 32px; height: 19px; border-radius: 999px; background: var(--fill); position: relative; transition: background .2s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch:checked { background: var(--c-green); }
.switch:checked::after { transform: translateX(13px); }
.segmented { display: inline-flex; background: var(--fill-3); border-radius: 8px; padding: 2px; gap: 2px; }
.segmented button { appearance: none; border: 0; background: transparent; border-radius: 6px; padding: 3px 10px; font-size: calc(12px * var(--fs)); font-weight: 500; color: var(--label); flex: 1; white-space: nowrap; }
.segmented button.on { background: var(--bg-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .segmented button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button.on { background: #636366; } }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: calc(11px * var(--fs)); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill-3); color: var(--label-2); white-space: nowrap; }
.pill.live { background: var(--c-red); color: #fff; letter-spacing: .04em; }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.pill.target { background: color-mix(in srgb, var(--c-blue) 15%, transparent); color: var(--c-blue); }
.pill.archived { background: color-mix(in srgb, var(--c-orange) 16%, transparent); color: var(--c-orange); }

/* ---------- pages ---------- */
.page { max-width: 980px; margin: 0 auto; padding: 22px 24px 80px; }
.large-title { font-size: calc(30px * var(--fs)); font-weight: 700; letter-spacing: -.02em; margin: 6px 0 4px; }
.page-sub { color: var(--label-2); margin: 0 0 20px; font-size: calc(13px * var(--fs)); }
.group-header { font-size: calc(12px * var(--fs)); text-transform: uppercase; letter-spacing: .02em; color: var(--label-2); padding: 0 16px 6px; margin-top: 22px; }
.group-footer { font-size: calc(12px * var(--fs)); color: var(--label-2); padding: 6px 16px 0; }
.group { background: var(--bg-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.cell { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 16px; position: relative; min-height: 44px; }
.cell + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 60px; border-top: .5px solid var(--sep); }
.group.plain .cell + .cell::before { left: 16px; }
.cell.link { cursor: default; }
.cell.link:hover { background: var(--fill-4); }
.cell.link:active { background: var(--fill-3); }
.cell-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: calc(17px * var(--fs)); flex: none; background: var(--c-indigo); }
.cell-icon.live { background: var(--c-red); }
.cell-icon.archived { background: var(--c-gray); }
.cell-main { flex: 1; min-width: 0; }
.cell-title { font-size: calc(14px * var(--fs)); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: calc(12px * var(--fs)); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.cell .chev { color: var(--label-3); font-size: calc(14px * var(--fs)); }
.cell-label { width: 190px; flex: none; color: var(--label); }
.cell-value { flex: 1; min-width: 0; font-family: var(--mono); font-size: calc(12px * var(--fs)); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--label-2); }
.empty-state .big-icon { font-size: calc(44px * var(--fs)); color: var(--label-3); margin-bottom: 8px; }
.empty-state h2 { color: var(--label); font-size: calc(18px * var(--fs)); margin: 4px 0; }

/* ---------- rundown page ---------- */
.rd-page { padding: 18px 20px 90px; display: grid; gap: 14px; }
.rd-head { display: grid; gap: 8px; }
.rd-title { appearance: none; border: 0; background: transparent; font-size: calc(28px * var(--fs)); font-weight: 700; letter-spacing: -.02em; padding: 2px 6px; margin-left: -6px; border-radius: 8px; width: 100%; outline: none; }
.rd-title:hover:not([readonly]) { background: var(--fill-4); }
.rd-title:focus { background: var(--bg-2); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 35%, transparent); }
.rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.meta { display: inline-flex; align-items: center; gap: 8px; color: var(--label-2); font-size: calc(12px * var(--fs)); }
.meta input { appearance: none; border: 0; background: var(--fill-3); border-radius: 7px; padding: 4px 8px; color: var(--label); outline: none; }
.meta input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.meta input[readonly] { background: transparent; padding-left: 0; }
.rd-start { width: 92px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--c-orange) 13%, var(--bg-2)); color: var(--label); }
.banner .icon-svg { color: var(--c-orange); font-size: calc(18px * var(--fs)); }

.transport { background: var(--bg-2); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 16px 18px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; position: sticky; top: calc(var(--tb-h) + 8px); z-index: 10; transition: box-shadow .3s; }
body.is-live .transport { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c-red) 55%, transparent), var(--shadow); }
.now { display: grid; gap: 3px; min-width: 0; }
.now-top { display: flex; gap: 8px; align-items: center; }
.now-title { font-size: calc(22px * var(--fs)); font-weight: 600; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.now-title .num { color: var(--label-2); font-variant-numeric: tabular-nums; }
.now-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown { white-space: nowrap; min-width: 0; max-width: 100%; overflow: visible; font-family: var(--rounded); font-variant-numeric: tabular-nums; font-size: calc(clamp(52px, 7.5vw, 88px) * var(--fs)); font-weight: 600; line-height: 1; letter-spacing: -.03em; margin: 4px 0 2px; transition: color .3s; }
.countdown.warn { color: var(--c-orange); }
.countdown.over { color: var(--c-red); }
.progress { height: 5px; background: var(--fill-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--c-green); border-radius: 999px; transition: width .2s linear, background .3s; }
.progress-fill.warn { background: var(--c-orange); }
.progress-fill.over { background: var(--c-red); }
.now-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: calc(12px * var(--fs)); color: var(--label-2); margin-top: 4px; }
.now-meta b { color: var(--label); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; align-content: start; }
.stat { display: grid; gap: 1px; }
.stat-label { font-size: calc(11px * var(--fs)); color: var(--label-2); font-weight: 500; }
.stat-val { font-family: var(--rounded); font-variant-numeric: tabular-nums; font-size: calc(20px * var(--fs)); font-weight: 600; letter-spacing: -.01em; }
.stat-val.big { font-size: calc(26px * var(--fs)); }
.over { color: var(--c-red); }
.under { color: var(--c-teal); }
.transport-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: .5px solid var(--sep); flex-wrap: wrap; }
.tp-btn { appearance: none; border: 0; background: var(--fill-3); color: var(--label); height: 40px; min-width: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; font-size: calc(13px * var(--fs)); transition: transform .1s, background .15s, opacity .15s; }
.tp-btn .icon-svg { font-size: calc(15px * var(--fs)); }
.tp-btn:hover:not(:disabled) { background: var(--fill-2); }
.tp-btn:active:not(:disabled) { transform: scale(.95); }
.tp-btn:disabled { opacity: .3; }
.tp-btn.go { background: var(--c-green); color: #fff; height: 48px; padding: 0 30px; font-size: calc(17px * var(--fs)); box-shadow: 0 4px 14px color-mix(in srgb, var(--c-green) 35%, transparent); }
.tp-btn.go:hover:not(:disabled) { background: color-mix(in srgb, var(--c-green) 88%, #000); }
.tp-btn.stop { color: var(--c-red); }
.tp-sep { width: .5px; height: 24px; background: var(--sep); margin: 0 4px; }

/* table */
.sheet { position: relative; width: fit-content; max-width: 100%; background: var(--bg-2); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow-x: auto; }
.rd-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.rd-table th { position: relative; user-select: none; overflow: hidden; text-overflow: ellipsis; text-align: left; font-size: calc(11px * var(--fs)); font-weight: 600; color: var(--label-2); padding: 9px 6px 8px; border-bottom: .5px solid var(--sep); white-space: nowrap; background-color: var(--bg-2); background-image: linear-gradient(var(--col-tint, transparent), var(--col-tint, transparent)); }
.rd-table td { overflow: hidden; border-bottom: .5px solid var(--sep); padding: 4px 5px; vertical-align: top; background-color: var(--row-tint, var(--col-tint, transparent)); }
.rd-table tbody tr:last-child td { border-bottom: 0; }
.rd-table td.mono { padding-top: 10px; white-space: nowrap; text-overflow: ellipsis; font-size: calc(12px * var(--fs)); }
.rd-table td.c-handle { overflow: visible; border-left: 4px solid var(--sec, transparent); position: relative; padding: 4px 0 4px 2px; }
.rd-table tbody tr:hover td { background-image: linear-gradient(var(--fill-4), var(--fill-4)); }
.cellinput { appearance: none; display: block; width: 100%; border: 0; background: transparent; border-radius: 6px; padding: 5px 6px; outline: none; resize: none; overflow: hidden; min-height: 28px; line-height: 1.38; }
.cellinput:hover:not([readonly]) { background: var(--fill-4); }
.cellinput:focus { background: var(--bg-2); box-shadow: 0 0 0 2.5px var(--accent); }
.cellinput[readonly] { cursor: default; }
.cell-title-input { font-weight: 500; }
.dur { font-family: var(--mono); font-size: calc(12px * var(--fs)); }
.c-num { color: var(--label-2); }
.grip { display: inline-grid; place-items: center; width: 22px; height: 28px; color: var(--label-3); cursor: grab; user-select: none; font-size: calc(14px * var(--fs)); touch-action: none; border-radius: 5px; }
.grip:hover { background: var(--fill-4); }
.grip:active { cursor: grabbing; }
th.movable { cursor: grab; }
th.movable:active { cursor: grabbing; }
.col-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.col-resizer { position: absolute; top: 0; bottom: 0; right: -1px; width: 9px; cursor: col-resize; z-index: 2; touch-action: none; }
.col-resizer::after { content: ""; position: absolute; top: 22%; bottom: 22%; right: 3px; width: 1px; background: var(--sep); border-radius: 1px; transition: background .15s, width .15s; }
.col-resizer:hover::after, .col-resizer.active::after { background: var(--accent); width: 3px; right: 2px; top: 0; bottom: 0; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
th.col-dragging { opacity: .35; }
col.col-dragging { background: var(--fill-4); }
.drop-line-v { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--accent); border-radius: 2px; z-index: 6; pointer-events: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.drag-ghost { position: fixed; z-index: 95; pointer-events: none; display: inline-flex; align-items: center; gap: 7px; max-width: 280px; padding: 7px 12px; border-radius: 9px; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-pop); font-weight: 600; font-size: calc(12px * var(--fs)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translate(12px, -50%) rotate(-1.5deg); }
.drag-ghost .icon-svg { color: var(--accent); font-size: calc(14px * var(--fs)); }
.grip:hover { color: var(--label); }
.acts { display: flex; gap: 0; justify-content: flex-end; opacity: 0; transition: opacity .15s; padding-top: 2px; }
tr:hover .acts, tr:focus-within .acts, .acts.open { opacity: 1; }
.col-head { display: flex; align-items: center; gap: 2px; }
.al-center .col-head { justify-content: center; }
.al-right .col-head { justify-content: flex-end; }
.col-name { appearance: none; border: 0; background: transparent; color: var(--label-2); font-size: calc(11px * var(--fs)); font-weight: 600; padding: 2px 4px; border-radius: 5px; min-width: 50px; width: 100%; outline: none; }
.col-name:hover { background: var(--fill-4); }
.col-name:focus { background: var(--bg-2); color: var(--label); box-shadow: 0 0 0 2px var(--accent); }
.col-menu { width: 20px; height: 20px; font-size: calc(13px * var(--fs)); opacity: 0; }
th:hover .col-menu, .col-menu.open { opacity: 1; }
.al-left, .al-left .cellinput { text-align: left; }
.al-center, .al-center .cellinput { text-align: center; }
.al-right, .al-right .cellinput { text-align: right; }
.al-center .imgcell { justify-content: center; }
.al-right .imgcell { justify-content: flex-end; }
.nowrap textarea { white-space: pre; overflow: hidden; }
tr.fixed-h td { overflow: hidden; }
tr.fixed-h textarea { overflow-y: auto; }
/* spans exactly the table width (set from JS) so it never adds empty scroll space */
.row-resizer { position: absolute; left: 0; bottom: -3px; width: calc(var(--table-w, 100%) - 4px); height: 6px; cursor: row-resize; z-index: 3; }
.row-resizer:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); }
body.resizing { cursor: row-resize; user-select: none; }

.row-header td { background-color: var(--bg-3); background-image: linear-gradient(var(--hdr-tint, transparent), var(--hdr-tint, transparent)); }
.row-header td.c-handle { border-left-color: var(--hdr-solid, transparent); }
/* section label, cue count and time stay together and pinned left while scrolling sideways */
.hdr { display: flex; align-items: center; gap: 10px; position: sticky; left: 6px; width: max-content; max-width: min(100%, 760px); }
.hdr-title { flex: 0 1 auto; width: auto; min-width: 140px; field-sizing: content; font-weight: 700; font-size: calc(13px * var(--fs)); color: var(--hdr-solid, var(--label)); }
.hdr-time { color: var(--label-2); font-size: calc(11px * var(--fs)); white-space: nowrap; padding-right: 6px; }
.row-divider td { padding: 0 5px; height: 28px; vertical-align: middle; }
.divider { display: flex; align-items: center; gap: 10px; }
.divider .line { flex: 1; height: 2.5px; border-radius: 2px; background: var(--line-color, var(--sep-opaque)); }
.div-label { appearance: none; border: 0; background: transparent; outline: none; field-sizing: content; min-width: 30px; max-width: 320px; width: 160px; padding: 2px 8px; border-radius: 6px; text-align: center; font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--line-color, var(--label-2)); }
.div-label:focus { background: var(--bg-2); box-shadow: 0 0 0 2px var(--accent); }
.div-label:placeholder-shown:not(:focus) { width: 110px; }
body.readonly .div-label:placeholder-shown { display: none; }
.row-divider .grip { height: 20px; }
.row-divider .acts { padding-top: 0; }

.imgcell { position: relative; display: flex; align-items: center; min-height: 28px; padding: 2px; border-radius: 6px; outline: none; }
.imgcell:focus-visible, .imgcell.dragover { box-shadow: 0 0 0 2.5px var(--accent); }
.imgcell img { display: block; max-width: 100%; max-height: var(--img-max, 72px); border-radius: 6px; cursor: zoom-in; background: #000; box-shadow: 0 0 0 .5px var(--sep); }
.img-add { appearance: none; background: transparent; border: 1px dashed var(--label-3); color: var(--label-2); border-radius: 7px; padding: 4px 10px; font-size: calc(12px * var(--fs)); display: inline-flex; gap: 5px; align-items: center; }
.img-add:hover { border-color: var(--accent); color: var(--accent); }
.img-tools { position: absolute; top: 5px; right: 5px; display: none; gap: 2px; padding: 2px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 999px; }
.imgcell:hover .img-tools, .imgcell:focus-within .img-tools { display: flex; }
.img-tools .icon-btn { color: #fff; width: 22px; height: 22px; font-size: calc(12px * var(--fs)); }
.img-tools .icon-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 32px; cursor: zoom-out; animation: fade .2s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: pop .25s var(--ease); }

/* live states */
.st-current td { background-image: linear-gradient(var(--current-bg), var(--current-bg)) !important; }
.st-current td:first-child { box-shadow: inset 4px 0 0 var(--c-red); }
.st-current .cell-title-input { font-weight: 700; }
.st-next td:first-child { box-shadow: inset 4px 0 0 var(--c-green); }
body.is-live .st-next td { background-image: linear-gradient(var(--next-bg), var(--next-bg)); }
.st-done td, .st-done .cellinput, .st-skipped td, .st-skipped .cellinput { color: var(--label-2); }
.st-done .imgcell img, .st-skipped .imgcell img { opacity: .5; }
.st-skipped .cell-title-input { text-decoration: line-through; }
.is-actual { font-weight: 600; color: var(--label); }
.st-done .is-actual { color: var(--label-2); }
.is-late:not(.is-actual) { color: var(--c-orange); }
tr.dragging { opacity: .35; }
.drop-before td { box-shadow: inset 0 3px 0 var(--accent) !important; }
.drop-after td { box-shadow: inset 0 -3px 0 var(--accent) !important; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- popovers, alerts, HUD ---------- */
.pop { position: fixed; z-index: 50; width: 268px; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 13px; padding: 12px; box-shadow: var(--shadow-pop); display: grid; gap: 8px; animation: pop .18s var(--ease); transform-origin: top right; }
.pop-title { font-weight: 600; font-size: calc(13px * var(--fs)); }
.pop-label { font-size: calc(11px * var(--fs)); font-weight: 600; color: var(--label-2); margin-top: 4px; }
.pop-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-sep { height: .5px; background: var(--sep); margin: 4px -12px; }
.pop-check { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.pop-hint { font-size: calc(11px * var(--fs)); color: var(--label-2); }
.menu { display: grid; margin: -4px -6px; }
.menu-item { appearance: none; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; font-size: calc(13px * var(--fs)); color: var(--label); }
.menu-item .icon-svg { font-size: calc(15px * var(--fs)); color: var(--label-2); width: 18px; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item:hover .icon-svg { color: #fff; }
.menu-item.destructive { color: var(--c-red); }
.menu-item.destructive .icon-svg { color: var(--c-red); }
.menu-item.destructive:hover { background: var(--c-red); color: #fff; }
.menu-item.destructive:hover .icon-svg { color: #fff; }
.menu-sep { height: .5px; background: var(--sep); margin: 4px 8px; }
.swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.swatches button { appearance: none; aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--fill-3); color: var(--label-2); font-size: calc(10px * var(--fs)); padding: 0; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1); transition: transform .12s; }
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { box-shadow: 0 0 0 2px var(--material), 0 0 0 4px var(--label-2); }

.alert-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .28); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.alert { width: 280px; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 14px; box-shadow: var(--shadow-pop); text-align: center; overflow: hidden; animation: pop .22s var(--ease); }
.alert-body { padding: 20px 16px 16px; display: grid; gap: 6px; }
.alert-body .app-icon { margin: 0 auto 6px; width: 44px; height: 44px; border-radius: 11px; }
.alert-body .app-icon span { width: 18px; height: 18px; }
.alert h3 { margin: 0; font-size: calc(15px * var(--fs)); font-weight: 600; }
.alert p { margin: 0; font-size: calc(12px * var(--fs)); color: var(--label); opacity: .85; }
.alert .field { margin-top: 8px; text-align: left; }
.alert-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.alert-btns .btn { border-radius: 8px; padding: 7px 10px; }
.alert-btns .btn-destructive { background: var(--c-red); color: #fff; }

.hud { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px) scale(.98); background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-pop); padding: 10px 18px; border-radius: 999px; font-weight: 500; opacity: 0; pointer-events: none; transition: .25s var(--ease); z-index: 90; max-width: calc(100vw - 32px); }
.hud.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(340px, 100%); display: grid; gap: 12px; text-align: center; justify-items: center; }
.login-card .app-icon { width: 72px; height: 72px; border-radius: 17px; margin-bottom: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.login-card .app-icon span { width: 28px; height: 28px; box-shadow: 0 0 0 7px rgba(255, 69, 58, .3); }
.login-card h1 { margin: 0; font-size: calc(26px * var(--fs)); letter-spacing: -.02em; }
.login-card p { margin: 0 0 6px; }
.login-card .field, .login-card .btn { width: 100%; }
.login-card .field { padding: 11px 14px; font-size: calc(15px * var(--fs)); border-radius: 12px; }
.err { color: var(--c-red); margin: 0; min-height: 1.2em; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .app, body.sb-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); background: var(--material); padding: 14px 10px 12px !important; border-right: .5px solid var(--sep) !important; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .3); }
  .transport { position: static; }
  .tp-panes { flex-direction: column; gap: 14px; }
  .tp-split { display: none; }
  .tp-pane { flex: none !important; min-width: 0; }
  .page, .rd-page { padding-left: 16px; padding-right: 16px; }
  .search input { width: 140px; }
  .cell-label { width: 120px; }
  .rd-title { font-size: calc(22px * var(--fs)); }
  .tp-btn .lbl { display: none; }
  .tp-btn.go .lbl { display: inline; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* text size stepper (sidebar) */
.sb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; white-space: nowrap; font-size: calc(12px * var(--fs)); color: var(--label-2); }
.stepper { display: inline-flex; align-items: center; background: var(--fill-3); border-radius: 8px; padding: 2px; }
.stepper button { appearance: none; border: 0; background: transparent; color: var(--label); border-radius: 6px; padding: 2px 9px; font-weight: 600; line-height: 1.3; }
.stepper button:hover:not(:disabled) { background: var(--bg-2); }
.stepper button:disabled { opacity: .3; }
.stepper .a-small { font-size: calc(11px * var(--fs)); }
.stepper .a-big { font-size: calc(15px * var(--fs)); }
.stepper .val { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-size: calc(12px * var(--fs)); color: var(--label-2); font-weight: 500; }

/* custom colour (wheel + hex) */
.custom-color { display: flex; align-items: center; gap: 8px; }
.wheel { position: relative; width: 26px; height: 26px; border-radius: 50%; flex: none; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2); overflow: hidden; }
.wheel.on { box-shadow: 0 0 0 2px var(--material), 0 0 0 4px var(--label-2); }
.wheel input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.wheel .chip { position: absolute; inset: 6px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; pointer-events: none; }
.hex { appearance: none; width: 92px; border: 0; background: var(--fill-3); border-radius: 7px; padding: 4px 8px; font-family: var(--mono); font-size: calc(12px * var(--fs)); outline: none; text-transform: lowercase; }
.hex:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.hex.bad { box-shadow: 0 0 0 2px var(--c-red); }
.local-tz { font-size: calc(11px * var(--fs)); color: var(--label-2); font-weight: 500; margin-left: 4px; }

/* =====================================================================
   Fun & customizable layer — Notion-style covers/icons, monday-style
   status pills, playful motion. Built on the same system colours.
   ===================================================================== */

/* ---- rundown cover + icon ---- */
.rd-cover { position: relative; height: 168px; margin: -18px -20px 0; border-radius: 0; background-color: var(--fill-3); }
.rd-cover-tools { position: absolute; right: 16px; bottom: 12px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.rd-cover:hover .rd-cover-tools, .rd-cover:focus-within .rd-cover-tools { opacity: 1; }
.btn.glass { background: rgba(0, 0, 0, .42); color: #fff; -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
.btn.glass:hover:not(:disabled) { background: rgba(0, 0, 0, .58); }
.rd-icon { appearance: none; border: 0; background: transparent; font-size: calc(58px * var(--fs)); line-height: 1; width: max-content; padding: 4px 6px; margin-left: -6px; border-radius: 14px; cursor: default; transition: transform .15s var(--ease), background .15s; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font); color: inherit; }
.rd-icon:not(:disabled):hover { background: var(--fill-4); transform: scale(1.04) rotate(-3deg); }
.rd-icon:disabled { opacity: 1; }
.has-cover .rd-icon { margin-top: -46px; position: relative; z-index: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.rd-addbar:not(:has(.btn:not(.hidden))) { display: none; }
.rd-addbar { display: flex; gap: 2px; margin-left: -8px; opacity: 0; transition: opacity .2s; min-height: 26px; }
.rd-head:hover .rd-addbar, .rd-addbar:focus-within { opacity: 1; }
.rd-addbar .btn-plain { color: var(--label-2); }
.rd-addbar .btn-plain:hover { color: var(--label); }
@media (hover: none) { .rd-addbar, .rd-cover-tools { opacity: 1; } }

.pop-wide { width: 330px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 230px; overflow: auto; margin: 0 -4px; }
.emoji { appearance: none; border: 0; background: transparent; font-size: calc(22px * var(--fs)); aspect-ratio: 1; border-radius: 8px; padding: 0; transition: transform .1s, background .1s; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji:hover { background: var(--fill-3); transform: scale(1.18); }
.emoji.on { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.gradient-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gradient { appearance: none; border: 0; height: 40px; border-radius: 9px; transition: transform .12s; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.gradient:hover { transform: scale(1.05); }
.gradient.on { box-shadow: 0 0 0 2px var(--material), 0 0 0 4px var(--accent); }

/* ---- list: header + cards ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.view-toggle button { display: inline-flex; align-items: center; gap: 5px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.rd-card { background: var(--bg-2); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); cursor: default; transition: transform .2s var(--ease), box-shadow .2s var(--ease); animation: cardIn .45s var(--ease) both; outline: none; }
.rd-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 14px 32px rgba(0, 0, 0, .14); }
.rd-card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent); }
.rd-card:active { transform: translateY(-1px) scale(.99); }
.rd-card.live { box-shadow: 0 0 0 2px var(--c-red), var(--shadow); }
.rd-card-cover { height: 86px; position: relative; background-size: cover !important; }
.rd-card-tools { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; }
.rd-card:hover .rd-card-tools, .rd-card:focus-within .rd-card-tools { opacity: 1; }
.rd-card-tools .icon-btn { background: rgba(0, 0, 0, .45); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rd-card-body { padding: 0 16px 14px; display: grid; gap: 4px; }
.rd-card-icon { font-size: calc(38px * var(--fs)); line-height: 1; margin-top: -22px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25)); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.rd-card-title { font-size: calc(16px * var(--fs)); font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.rd-card-meta { font-size: calc(12px * var(--fs)); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-card-foot { display: flex; align-items: center; gap: 6px; min-height: 22px; margin-top: 4px; }
.emoji-tile { background: var(--fill-3) !important; font-size: calc(18px * var(--fs)); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji-tile[style] { background-size: cover !important; }
.sb-emoji { width: 18px; text-align: center; flex: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.sb-recent { padding-left: 12px; }
.sb-recent-title { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- friendly empty states ---- */
.empty-state.fun .empty-emoji { font-size: calc(54px * var(--fs)); margin-bottom: 6px; display: inline-block; animation: bob 3s ease-in-out infinite; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.empty-state.fun p { max-width: 380px; margin: 6px auto 16px; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* ---- column types ---- */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.type-chip { appearance: none; border: 0; background: var(--fill-3); color: var(--label); border-radius: 10px; padding: 9px 4px 7px; display: grid; justify-items: center; gap: 4px; font-size: calc(12px * var(--fs)); font-weight: 500; transition: background .12s, transform .1s; }
.type-chip .icon-svg { font-size: calc(18px * var(--fs)); color: var(--accent); }
.type-chip:hover { background: var(--fill-2); }
.type-chip:active { transform: scale(.96); }
.type-chip.on { background: var(--accent); color: #fff; }
.type-chip.on .icon-svg { color: #fff; }

/* status (monday-style full-cell pill) */
.rd-table td.c-status { padding: 3px; vertical-align: middle; }
.status-cell { appearance: none; border: 0; width: 100%; min-height: 30px; height: 100%; border-radius: 7px; color: #fff; font-weight: 600; font-size: calc(12px * var(--fs)); padding: 4px 8px; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: filter .15s, transform .1s; cursor: default; }
.status-cell.empty { background: var(--fill-4); color: var(--label-3); text-shadow: none; }
.status-cell.empty:not(:disabled):hover::after { content: "Set status"; }
.status-cell:not(:disabled):hover { filter: brightness(1.08); }
.status-cell:not(:disabled):active { transform: scale(.97); }
.status-cell:disabled { opacity: 1; }
.pop-status { width: 220px; }
.status-options { display: grid; gap: 5px; }
.status-option { appearance: none; border: 0; border-radius: 8px; padding: 8px 10px; color: #fff; font-weight: 600; font-size: calc(13px * var(--fs)); text-align: center; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); transition: transform .1s, filter .1s; }
.status-option:hover { transform: scale(1.03); filter: brightness(1.08); }
.status-option.on { box-shadow: 0 0 0 2px var(--material), 0 0 0 4px var(--label-2); }
.label-editor { display: grid; gap: 5px; }
.label-row { display: flex; align-items: center; gap: 6px; }
.label-dot { appearance: none; border: 0; width: 22px; height: 22px; border-radius: 6px; flex: none; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2); }
.label-name { appearance: none; flex: 1; min-width: 0; border: 0; background: var(--fill-3); border-radius: 7px; padding: 4px 8px; outline: none; }
.label-name:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.label-colors { padding: 6px 0 4px 28px; }

/* checkbox */
.rd-table td.c-checkbox { vertical-align: middle; }
.check-cell { appearance: none; border: 0; background: transparent; color: var(--label-3); font-size: calc(22px * var(--fs)); width: 34px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; cursor: default; transition: color .15s, transform .1s; }
.check-cell:not(:disabled):hover { background: var(--fill-4); color: var(--label-2); }
.check-cell.on { color: var(--c-green); }
.check-cell.on .icon-svg rect { fill: var(--c-green); stroke: var(--c-green); }
.check-cell.on .icon-svg path { stroke: #fff; stroke-width: 2.4; }
.check-cell:disabled { opacity: 1; }

/* person chips */
.person-cell { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 30px; padding: 2px 3px; border-radius: 6px; }
.person-cell.editable { cursor: text; }
.person-cell.editable:hover { background: var(--fill-4); }
.person-cell:focus-visible { box-shadow: 0 0 0 2.5px var(--accent); }
.person-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--fill-3); border-radius: 999px; padding: 2px 9px 2px 2px; max-width: 100%; }
.avatar { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: calc(10px * var(--fs)); font-weight: 700; display: inline-grid; place-items: center; flex: none; letter-spacing: .02em; }
.person-name { font-size: calc(12px * var(--fs)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-empty { display: inline-flex; gap: 5px; align-items: center; color: var(--label-3); font-size: calc(12px * var(--fs)); }

/* section summary */
.hdr-summary { font-size: calc(11px * var(--fs)); font-weight: 600; color: var(--label-2); background: var(--fill-3); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* slash menu */
.pop-slash { width: 280px; }
.menu-item.kb { background: var(--accent); color: #fff; }
.menu-item.kb .icon-svg, .menu-item.kb .menu-hint { color: #fff; }
.menu-hint { display: block; font-size: calc(11px * var(--fs)); color: var(--label-2); margin-top: 1px; }
.menu-item:hover .menu-hint { color: rgba(255, 255, 255, .8); }
.menu-item .spacer { text-align: left; }

/* motion */
.row-enter td { animation: rowIn .45s var(--ease); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); background-color: color-mix(in srgb, var(--accent) 18%, transparent); } }
.pop-in { animation: popIn .35s var(--ease); }
@keyframes popIn { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 120; }
.tp-btn.go:not(:disabled):hover { transform: translateY(-1px); }
.pill.live { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-red) 60%, transparent); animation: livePulse 2s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px transparent; } }
/* let the section label stick to the left edge while the table scrolls sideways */
.rd-table tr.row-header td, .rd-table tr.row-divider td { overflow: visible; }

/* ---- vMix Preview / Program monitors ---- */
.monitors { background: var(--bg-2); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 10px 14px 14px; }
.mon-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.mon-head .icon-svg { color: var(--accent); font-size: calc(16px * var(--fs)); }
.mon-status { color: var(--label-2); }
.mon-status.bad { color: var(--c-orange); }
.mon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; max-width: 1100px; }
.mon { margin: 0; display: grid; gap: 7px; }
.mon-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; cursor: zoom-in; box-shadow: 0 0 0 3px var(--mon-color), 0 6px 18px rgba(0, 0, 0, .18); }
.mon-preview { --mon-color: var(--c-green); }
.mon-program { --mon-color: var(--c-red); }
.mon-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mon-frame img:not([src]) { visibility: hidden; }
.mon-empty { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .5); font-size: calc(12px * var(--fs)); }
.mon-stale { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .65); color: #ffd60a; font-size: calc(11px * var(--fs)); font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.mon figcaption { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mon-tag { font-size: calc(11px * var(--fs)); font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--mon-color); border-radius: 6px; padding: 2px 8px; flex: none; }
.mon-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .mon-grid { grid-template-columns: 1fr; } }

/* ---- settings forms ---- */
.form-cell .cell-label { width: 260px; }
.form-control { display: flex; align-items: center; justify-content: flex-end; }
.inline-field { max-width: 360px; }
.vmix-status { display: flex; align-items: center; gap: 8px; color: var(--label-2); }
.vmix-status .status-dot:not(.ok):not(.down) { background: var(--label-3); }
@media (max-width: 820px) { .form-cell { flex-wrap: wrap; } .form-cell .cell-label { width: 100%; } .form-control { justify-content: flex-start; width: 100%; } }

/* ---- transport areas: Now · vMix · Stats, resizable per viewer ---- */
.tp-panes { display: flex; align-items: stretch; min-width: 0; }
.tp-pane { min-width: 170px; container-type: inline-size; display: flex; flex-direction: column; }
.tp-pane > * { min-width: 0; }
.pane-mon.collapsed { flex: 0 0 auto; min-width: 0; container-type: normal; width: max-content; padding-right: 4px; border-left: .5px solid var(--sep); padding-left: 14px; margin-left: 4px; }
.pane-mon.collapsed .mon-head { flex-direction: column; align-items: center; gap: 4px; }
.pane-mon.collapsed .mon-head .spacer { display: none; }
.pane-mon.collapsed .mon-status { display: none; }
.tp-split { flex: 0 0 22px; position: relative; cursor: col-resize; touch-action: none; outline: none; }
.tp-split::after { content: ""; position: absolute; top: 6%; bottom: 6%; left: 50%; width: 1px; transform: translateX(-50%); background: var(--sep); border-radius: 2px; transition: width .15s, background .15s; }
.tp-split:hover::after, .tp-split.active::after, .tp-split:focus-visible::after { width: 4px; background: var(--accent); }
.tp-split::before { content: ""; position: absolute; top: 50%; left: 50%; width: 6px; height: 28px; transform: translate(-50%, -50%); border-radius: 4px; background: var(--fill-2); opacity: 0; transition: opacity .15s; }
.tp-split:hover::before { opacity: 1; }
/* text scales with the width of its area (cqi = 1% of the area's width) */
.pane-now .countdown { font-size: calc(clamp(44px, 22cqi, 200px) * var(--fs)); }
.pane-now .now-title { font-size: calc(clamp(16px, 5cqi, 40px) * var(--fs)); }
.pane-stats .stat-val { font-size: calc(clamp(15px, 7.2cqi, 38px) * var(--fs)); }
.pane-stats .stat-val.big { font-size: calc(clamp(18px, 9cqi, 50px) * var(--fs)); }
.pane-stats .stat-label { font-size: calc(clamp(11px, 3.6cqi, 15px) * var(--fs)); }
@container (max-width: 250px) { .stats { grid-template-columns: 1fr; } }
/* vMix inside the transport */
.monitors.in-transport { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.monitors.in-transport .mon-head { min-height: 22px; }
.monitors.in-transport .mon-grid { max-width: none; gap: 12px; }
.monitors.in-transport .mon-frame { border-radius: 10px; box-shadow: 0 0 0 2.5px var(--mon-color); }
@container (max-width: 430px) { .monitors.in-transport .mon-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .rd-cover { margin: -18px -16px 0; } }

/* ---- reposition cover ---- */
.rd-cover.repositioning { cursor: grab; touch-action: none; }
.rd-cover.repositioning.grabbing { cursor: grabbing; }
.rd-cover.repositioning .rd-cover-tools { display: none; }
.repo-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; font-weight: 600; font-size: calc(13px * var(--fs)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); pointer-events: none; transition: opacity .2s; }
.rd-cover.grabbing .repo-hint { opacity: 0; }
.repo-bar { position: absolute; right: 16px; bottom: 12px; display: flex; gap: 6px; }

/* ---- update / restart notice ---- */
.version-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--c-orange) 18%, var(--bg-2)); border-bottom: .5px solid var(--sep); font-weight: 500; }
.version-banner .icon-svg { color: var(--c-orange); font-size: calc(17px * var(--fs)); flex: none; }

/* ---- accounts & people ---- */
.login-tabs { width: 100%; }
.login-tabs button { padding: 6px 10px; font-size: calc(13px * var(--fs)); }
.sb-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--c-red); color: #fff; font-size: calc(11px * var(--fs)); font-weight: 700; display: inline-grid; place-items: center; }
.sb-account { appearance: none; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 9px; text-align: left; color: var(--label); width: 100%; }
.sb-account:hover { background: var(--fill-4); }
.sb-account > .icon-svg { color: var(--label-2); margin-left: auto; }
.sb-account-text { display: grid; min-width: 0; line-height: 1.25; }
.sb-account-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.big { width: 34px; height: 34px; font-size: calc(13px * var(--fs)); }
.account-head { display: flex; gap: 10px; align-items: center; }
.account-head .avatar.big { width: 40px; height: 40px; }
.person-row { gap: 12px; }
.approve { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn-spacer { width: 26px; display: inline-block; }
.pill.you { margin-left: 6px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.temp-pw { display: block; margin-top: 10px; padding: 10px; border-radius: 9px; background: var(--fill-3); font-family: var(--mono); font-size: calc(16px * var(--fs)); font-weight: 600; letter-spacing: .02em; cursor: copy; user-select: all; }
.sheet-form { width: 320px; }
.sheet-form .field { margin-top: 6px; }
.sheet-form .err { font-size: calc(12px * var(--fs)); }
.alert-btns.single { grid-template-columns: 1fr; }
@media (max-width: 820px) { .person-row { flex-wrap: wrap; } .approve { width: 100%; justify-content: flex-start; padding-left: 46px; } }

/* ---------- projects (one per client) ---------- */
.proj-dot { width: .62em; height: .62em; border-radius: 50%; flex: none; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.sb-section-row { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.sb-add { appearance: none; border: 0; background: transparent; color: var(--label-2); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: calc(14px * var(--fs)); }
.sb-add:hover { background: var(--fill-3); color: var(--accent); }
.sb-proj .proj-dot { font-size: calc(18px * var(--fs)); margin: 0 1px; }
.sb-proj .icon-svg { color: var(--label-2) !important; }
.sb-proj .sb-recent-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-hint { appearance: none; border: 0; background: transparent; width: 100%; text-align: left; color: var(--label-2); font: inherit; font-size: calc(12px * var(--fs)); }
.proj-title { display: flex; align-items: center; gap: 12px; }
.proj-title .proj-dot { font-size: .7em; }
.proj-title .icon-svg { color: var(--label-2); font-size: .8em; }
.proj-title .icon-btn { font-size: calc(16px * var(--fs)); }
.proj-group + .proj-group { margin-top: 28px; }
.proj-head { display: inline-flex; align-items: center; gap: 9px; margin: 18px 4px 12px; font-weight: 700; font-size: calc(17px * var(--fs)); color: var(--label); letter-spacing: -.01em; border-radius: 8px; padding: 2px 6px 2px 2px; }
.proj-head:hover { background: var(--fill-4); }
.proj-head .proj-dot { font-size: calc(18px * var(--fs)); }
.proj-head .icon-svg { color: var(--label-3); font-size: calc(13px * var(--fs)); }
.proj-head .caption { font-weight: 500; }
.menu-item .proj-dot { font-size: calc(16px * var(--fs)); margin: 0 3px; }
.menu-check { margin-left: auto; color: var(--accent); font-weight: 700; }
.access-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: calc(12px * var(--fs)); color: var(--label-2); }
.access-line .icon-svg { color: var(--label-3); }
.access-line.none { color: var(--c-orange); }
.access-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--fill-4); color: var(--label); font-weight: 500; }
.access-chip .proj-dot { font-size: calc(14px * var(--fs)); }
.access-sheet { width: min(440px, calc(100vw - 32px)); text-align: left; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.access-sheet .alert-body { overflow-y: auto; text-align: left; }
.access-sheet h3, .access-sheet .alert-body > p { text-align: left; }
.access-sheet .pop-label { display: block; margin: 14px 0 6px; }
.access-role { display: grid; gap: 6px; justify-items: start; }
.access-list { display: grid; gap: 6px; }
.access-proj { border-radius: 10px; background: var(--fill-4); padding: 4px 10px; transition: background .15s; }
.access-proj.on { background: color-mix(in srgb, var(--accent) 10%, var(--bg-2)); }
.access-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; cursor: default; font-size: calc(14px * var(--fs)); }
.access-row.small { font-size: calc(13px * var(--fs)); padding: 4px 0; }
.access-row .proj-dot { font-size: calc(16px * var(--fs)); }
.access-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.access-sub { display: grid; gap: 8px; justify-items: start; padding: 2px 0 10px 27px; }
.access-rds { display: grid; width: 100%; }
.access-empty { text-align: center; padding: 8px 0; }
.chk { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }

/* ---------- drag a rundown onto a project ---------- */
.rd-card, .cell.link[data-rd] { -webkit-touch-callout: none; }
.rd-card[data-rd], .cell.link[data-rd] { -webkit-user-select: none; user-select: none; }
.rd-dragging { opacity: .4 !important; animation: none !important; transform: scale(.97) !important; transition: opacity .15s, transform .15s; }
.rd-ghost { gap: 8px; max-width: 340px; padding: 8px 12px; }
.rd-ghost .drag-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.drag-dest { font-weight: 500; color: var(--label-2); padding-left: 8px; border-left: 1px solid var(--sep); flex: none; }
.rd-ghost.has-target .drag-dest { color: var(--accent); font-weight: 700; }
body.rd-drag [data-drop-project] { transition: background .15s, box-shadow .15s; }
body.rd-drag .sb-proj { box-shadow: inset 0 0 0 1px var(--sep); }
.sb-proj.drop-target { background: color-mix(in srgb, var(--accent) 18%, transparent) !important; box-shadow: inset 0 0 0 2px var(--accent) !important; }
.proj-group { border-radius: 18px; padding: 0 10px 10px; margin: 0 -10px; }
.proj-group.drop-target { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
.drop-flash { animation: dropFlash .9s var(--ease); }
@keyframes dropFlash { 0% { background: color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .drop-flash { animation: none; } .rd-dragging { transform: none !important; } }

/* ---------- sub cues (4 → 4.1, 4.2) ---------- */
.row-group .cell-title-input { font-weight: 650; }
.row-group .dur[readonly] { color: var(--label-2); font-style: italic; }
.row-sub td.c-num { padding-left: 16px; font-size: calc(11px * var(--fs)); color: var(--label-3); }
.row-sub td.c-title { position: relative; padding-left: 30px; }
/* the little tree line linking a sub cue to its cue */
.row-sub td.c-title::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 1.5px; background: var(--sep-strong, var(--label-3)); opacity: .45; }
.row-sub td.c-title::after { content: ""; position: absolute; left: 13px; top: 18px; width: 10px; height: 1.5px; background: var(--sep-strong, var(--label-3)); opacity: .45; }
.row-sub + tr:not(.row-sub) td { border-top: 0; }
.row-sub .cell-title-input { font-weight: 450; }
.row-sub td { font-size: calc(13px * var(--fs)); }
.row-sub .cellinput { font-size: calc(13px * var(--fs)); }
.st-group-live td { background-image: linear-gradient(color-mix(in srgb, var(--c-red) 7%, transparent), color-mix(in srgb, var(--c-red) 7%, transparent)) !important; }
.st-group-live td:first-child { box-shadow: inset 4px 0 0 color-mix(in srgb, var(--c-red) 45%, transparent); }
.st-group-live .cell-title-input { font-weight: 700; }
.now-parent { font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--label-2); background: var(--fill-4); padding: 2px 9px; border-radius: 999px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-parent.over { color: var(--c-red); }
.drag-ghost .caption { font-weight: 500; margin-left: 4px; }

/* ---------- import from a spreadsheet ---------- */
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.imp-sheet { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; text-align: left; }
.imp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 4px; }
.imp-head h3 { margin: 0; font-size: calc(17px * var(--fs)); }
.imp-body { padding: 8px 18px 14px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.imp-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px 16px; border-top: .5px solid var(--sep); }
.imp-lead { margin: 0; }
.imp-drop { border: 2px dashed var(--sep); border-radius: 14px; padding: 26px 16px; display: grid; justify-items: center; gap: 4px; text-align: center; transition: background .15s, border-color .15s; }
.imp-drop:hover, .imp-drop:focus-visible, .imp-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); outline: none; }
.imp-drop-icon { font-size: calc(30px * var(--fs)); color: var(--c-green); }
.imp-or { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: calc(12px * var(--fs)); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.imp-or::before, .imp-or::after { content: ""; flex: 1; height: .5px; background: var(--sep); }
.imp-link { display: flex; gap: 8px; }
.imp-paste { resize: vertical; min-height: 64px; font-size: calc(12px * var(--fs)); }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 12px; }
.imp-field { display: grid; gap: 4px; }
.imp-field.wide { grid-column: span 2; }
.imp-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.imp-map { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs)); }
.imp-map th { text-align: left; font-size: calc(11px * var(--fs)); color: var(--label-2); font-weight: 600; padding: 4px 6px; border-bottom: .5px solid var(--sep); }
.imp-map td { padding: 5px 6px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.imp-map tr.off td { opacity: .5; }
.imp-src { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-sample { color: var(--label-2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(12px * var(--fs)); }
.imp-sel { padding: 4px 8px; min-width: 140px; }
.imp-opts { display: grid; gap: 6px; margin-top: 10px; }
.imp-opt { display: flex; gap: 8px; align-items: center; font-size: calc(13px * var(--fs)); }
.imp-summary { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: calc(12px * var(--fs)); color: var(--label-2); margin: 2px 0 8px; }
.imp-summary b { color: var(--label); }
.imp-summary .warn { color: var(--c-orange); }
.imp-preview { border: .5px solid var(--sep); border-radius: 10px; max-height: 360px; overflow-y: auto; background: var(--bg-2); }
.imp-pv-sec { padding: 6px 10px; font-weight: 700; font-size: calc(12px * var(--fs)); background: var(--fill-4); border-bottom: .5px solid var(--sep); }
.imp-pv-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; padding: 5px 10px; border-bottom: .5px solid var(--sep); font-size: calc(13px * var(--fs)); align-items: baseline; }
.imp-pv-row.group .imp-pv-title { font-weight: 650; }
.imp-pv-row.group .imp-pv-dur { font-style: italic; color: var(--label-2); }
.imp-pv-row.sub { padding-left: 26px; font-size: calc(12px * var(--fs)); }
.imp-pv-num { color: var(--label-2); text-align: right; font-variant-numeric: tabular-nums; }
.imp-pv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-pv-dur { color: var(--label-2); font-size: calc(12px * var(--fs)); }
.imp-more { padding: 8px 10px; }
@media (max-width: 760px) { .imp-cols { grid-template-columns: 1fr; } .imp-field.wide { grid-column: auto; } }

/* ---------- print preview ---------- */
.print-root { position: fixed; inset: 0; z-index: 90; background: var(--bg); overflow: auto; }
.pr-bar { position: sticky; top: 0; z-index: 2; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); padding: 10px 18px; display: grid; gap: 8px; }
.pr-bar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-bar-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.pr-bar-label { font-size: calc(12px * var(--fs)); color: var(--label-2); font-weight: 600; margin-right: 2px; }
.pr-chip { appearance: none; border: .5px solid var(--sep); background: transparent; color: var(--label-2); border-radius: 999px; padding: 3px 10px; font-size: calc(12px * var(--fs)); font-weight: 500; text-decoration: line-through; }
.pr-chip.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: transparent; color: var(--label); text-decoration: none; }
.pr-chip:disabled { opacity: 1; }
.pr-tip { font-size: calc(11px * var(--fs)); color: var(--label-2); }
.pr-sheet { padding: 24px; display: grid; justify-items: center; }
.print-page { background: #fff; color: #1d1d1f; width: min(100%, 1120px); padding: 28px 30px; border-radius: 6px; box-shadow: 0 4px 30px rgba(0, 0, 0, .18); font-family: var(--font); --pr-text: 10.5px; }
.print-root[data-size="s"] .print-page { --pr-text: 9px; }
.print-root[data-size="l"] .print-page { --pr-text: 12.5px; }
.pr-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #1d1d1f; }
.pr-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.pr-meta { grid-column: 1; font-size: 11px; color: #555; }
.pr-printed { grid-column: 2; grid-row: 1 / 3; align-self: end; font-size: 9px; color: #888; }
.pr-table { width: 100%; border-collapse: collapse; font-size: var(--pr-text); line-height: 1.35; }
.pr-table th { text-align: left; font-size: calc(var(--pr-text) * .85); text-transform: uppercase; letter-spacing: .03em; color: #555; border-bottom: 1px solid #1d1d1f; padding: 4px 6px; white-space: nowrap; }
.pr-table td { padding: 4px 6px; border-bottom: .5px solid #d2d2d7; vertical-align: top; white-space: pre-wrap; background: var(--pr-fill, transparent); }
.pr-table thead { display: table-header-group; }
.pr-table tr { break-inside: avoid; page-break-inside: avoid; }
.pr-table td.k-num, .pr-table td.k-dur, .pr-table td.k-start, .pr-table td.k-end, .pr-table td.k-actual, .pr-table td.k-ou { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr-table td.k-num { color: #666; }
.pr-table td.k-title { font-weight: 600; }
.pr-group td.k-title { font-weight: 750; }
.pr-group td.k-dur { font-style: italic; color: #555; }
.pr-sub td { font-size: calc(var(--pr-text) * .95); }
.pr-sub td.k-title { padding-left: 22px; font-weight: 450; position: relative; }
.pr-sub td.k-title::before { content: "↳"; position: absolute; left: 8px; color: #999; }
.pr-sub td.k-num { padding-left: 12px; color: #999; }
.pr-section td { background: var(--pr-fill, #ececf0); font-weight: 700; font-size: calc(var(--pr-text) * 1.05); padding: 6px; border-bottom: 1px solid #b0b0b8; break-after: avoid; page-break-after: avoid; }
.pr-section .pr-sec-time { float: right; font-weight: 500; color: #555; font-variant-numeric: tabular-nums; }
.pr-divider td { background: transparent; text-align: center; color: #666; font-weight: 600; border-bottom: 1px dashed #999; }
.pr-table td.t-image img { max-width: 120px; max-height: 68px; border-radius: 3px; display: block; }
.no-colours .pr-table td { --pr-fill: transparent; }
.no-colours .pr-section td { background: #ececf0; }

@media print {
  body.printing > *:not(.print-root) { display: none !important; }
  :root, html { color-scheme: light !important; background: #fff !important; }
  html, body.printing { background: #fff !important; }
  .print-root { position: static; overflow: visible; background: #fff; }
  .pr-bar { display: none !important; }
  .pr-sheet { padding: 0; display: block; }
  .print-page { width: auto; padding: 0; box-shadow: none; border-radius: 0; }
  .print-page, .pr-table td, .pr-section td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- presence: who's in this rundown ---------- */
.presence { display: inline-flex; align-items: center; padding: 3px 8px 3px 4px; border-radius: 999px; gap: 0; cursor: default; margin-right: 4px; }
.presence:hover, .presence.open { background: var(--fill-4); }
.presence:empty { display: none; }
.presence .avatar { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--bg); margin-left: -3px; font-size: calc(10px * var(--fs)); }
.presence .avatar:first-child { margin-left: 0; }
.presence .avatar.me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); margin-left: 2px; }
.presence .avatar.more { background: var(--fill-2); color: var(--label); }
.presence-count { margin-left: 8px; font-size: calc(12px * var(--fs)); color: var(--label-2); font-weight: 500; white-space: nowrap; }
.presence.solo .avatar.me { outline: none; }
.avatar.away { opacity: .45; filter: grayscale(.4); }
.avatar.tiny { width: 20px; height: 20px; font-size: calc(8.5px * var(--fs)); }
.presence-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.presence-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.presence-row .avatar.big { width: 32px; height: 32px; }
.presence-main { flex: 1; min-width: 0; }
.presence-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.presence-main .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence-since { white-space: nowrap; }
/* someone else typing in a row */
.has-typing td:first-child { box-shadow: inset 4px 0 0 var(--typing, var(--accent)); }
.rd-table td.c-title { position: relative; }
.has-typing td.c-title { padding-right: 104px; }
.typing { position: absolute; top: 5px; right: 4px; max-width: 98px; overflow: hidden; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 2px; border-radius: 999px; background: var(--material); box-shadow: var(--shadow); font-size: calc(10px * var(--fs)); font-weight: 600; color: var(--label-2); pointer-events: none; animation: fade .2s; z-index: 2; }
.typing .avatar { margin-left: -4px; box-shadow: 0 0 0 1.5px var(--bg-2); }
.typing .avatar:first-child { margin-left: 0; }
.rd-presence { display: inline-flex; align-items: center; margin-left: 6px; }
.rd-presence .avatar { margin-left: -2px; box-shadow: 0 0 0 1.5px var(--bg-2); }
.rd-presence .avatar:first-child { margin-left: 0; }
.cell .rd-presence { margin-right: 6px; }

/* ---------- always-reachable sideways scrollbar for wide rundowns (drawn by QBridge) ---------- */
.hbar { position: sticky; bottom: 0; z-index: 6; height: 16px; margin-top: -16px; padding: 3px; box-sizing: border-box; border-radius: 0 0 var(--r-lg) var(--r-lg); background: color-mix(in srgb, var(--bg-2) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: default; touch-action: none; }
.hbar-thumb { height: 10px; border-radius: 99px; background: var(--label-3); transition: background .15s; touch-action: none; }
.hbar:hover .hbar-thumb, .hbar.dragging-bar .hbar-thumb { background: var(--label-2); }
.sheet.has-hbar { scrollbar-width: none; padding-bottom: 16px; }
.sheet.has-hbar::-webkit-scrollbar { display: none; }
.sheet-wrap { min-width: 0; max-width: 100%; }
.vmix-help { margin: 10px 4px 0; font-size: calc(13px * var(--fs)); }
.vmix-help summary { cursor: default; color: var(--accent); font-weight: 600; }
.vmix-help ol { padding-left: 20px; display: grid; gap: 6px; margin: 10px 0; }
.vmix-help code { font-family: var(--mono); font-size: .92em; background: var(--fill-4); padding: 1px 5px; border-radius: 5px; }

/* ---------- vMix Input column + Follow vMix ---------- */
.vmix-cell { appearance: none; border: 0; background: var(--fill-4); color: var(--label); border-radius: 8px; padding: 4px 8px 4px 4px; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; font-size: calc(12.5px * var(--fs)); font-weight: 500; text-align: left; margin-top: 2px; transition: background .2s, box-shadow .2s; }
.vmix-cell:not(:disabled):hover { background: var(--fill-3); }
.vmix-cell.empty { background: transparent; color: var(--label-3); padding-left: 6px; }
.vmix-cell.empty .vx-num { display: none; }
.vmix-cell.missing { box-shadow: inset 0 0 0 1.5px var(--c-orange); }
.vx-num { min-width: 22px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--fill-2); display: inline-grid; place-items: center; font-weight: 700; font-size: calc(11px * var(--fs)); font-variant-numeric: tabular-nums; color: var(--label); flex: none; }
.vx-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vmix-cell.pgm { box-shadow: inset 0 0 0 2px var(--c-red); background: color-mix(in srgb, var(--c-red) 14%, transparent); }
.vmix-cell.pgm .vx-num, .vx-num.pgm { background: var(--c-red); color: #fff; }
.vmix-cell.pvw { box-shadow: inset 0 0 0 2px var(--c-green); }
.vmix-cell.pvw .vx-num, .vx-num.pvw { background: var(--c-green); color: #fff; }
.vx-list { max-height: 300px; overflow-y: auto; }
.vx-item { gap: 9px; }
.vx-item:hover .vx-num { background: rgba(255, 255, 255, .25); color: #fff; }
.follow-toggle { color: var(--label); font-weight: 600; font-size: calc(13px * var(--fs)); }
.follow-toggle.offline { color: var(--c-orange); }
.follow-badge { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.follow-badge.offline { background: color-mix(in srgb, var(--c-orange) 16%, transparent); color: var(--c-orange); }
.follow-badge .icon-svg { font-size: 1.1em; }

/* ---------- columns each person can hide ---------- */
.rd-table th.c-actions { overflow: visible; text-align: center; }
.hidden-cols { appearance: none; border: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-radius: 999px; padding: 2px 7px; font-size: calc(11px * var(--fs)); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.hidden-cols:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.cols-btn { position: relative; }
.tb-badge { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; }
.cols-list { display: grid; gap: 1px; max-height: 340px; overflow-y: auto; }
.cols-item { display: flex; align-items: center; gap: 9px; padding: 6px 4px; border-radius: 7px; font-size: calc(13px * var(--fs)); }
.cols-item:hover { background: var(--fill-4); }
.cols-item.locked { color: var(--label-2); }
