/* =====================================================================
   Shorts Dashboard · design system
   1 tokens · 2 base · 3 shell · 4 primitives · 5 overlays · 6 data display
   7 pages · 8 run now, runs, settings · 9 StakesClips · 10 Reel Minute · 11 sign-in · 12 small screens
   The scripts use these token names in inline styles: --card --track --good --faint --line --c. Keep them.
   ===================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7; --bg2: #ececf0; --card: #ffffff; --card2: #f7f7f9;
  --text: #0c0d10; --muted: #5b5f69; --faint: #696d78; --line: #e7e7eb; --line2: #d6d7dd;
  --good: #0a7a40; --good-bg: #e3f6ec; --warn: #9a5a00; --warn-bg: #fdf0d5; --bad: #c9271d; --bad-bg: #fde8e6;
  --info: #3355cc; --info-bg: #e9eefc;
  --track: #e8e8ed;
  --ink: #101114; --on-ink: #ffffff;
  --brand-a: #ff5a3d; --brand-b: #ff2d55; --brand-c: #e8257d;
  --ring: rgba(12, 13, 16, .14);
  --hover: rgba(12, 13, 16, .05);
  --glass: rgba(245, 245, 247, .8);
  --glow: 6%;
  --shadow-sm: 0 1px 2px rgba(16, 17, 24, .05);
  --shadow: 0 1px 2px rgba(16, 17, 24, .04), 0 8px 24px -12px rgba(16, 17, 24, .10);
  --shadow-lg: 0 2px 6px rgba(16, 17, 24, .06), 0 28px 64px -20px rgba(16, 17, 24, .26);
  --side-w: 256px; --top-h: 56px; --pad: 32px;
  --r-sm: 8px; --r: 10px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --bg2: #101013; --card: #131316; --card2: #1a1a1e;
    --text: #f3f3f5; --muted: #a1a4ae; --faint: #8a8d98; --line: #222227; --line2: #303037;
    --good: #3dd68c; --good-bg: #0e2a1c; --warn: #f1b443; --warn-bg: #2d220d; --bad: #ff6b61; --bad-bg: #341513;
    --info: #8aa4ff; --info-bg: #161d38;
    --track: #25252b;
    --ink: #f3f3f5; --on-ink: #0b0b0d;
    --ring: rgba(255, 255, 255, .2);
    --hover: rgba(255, 255, 255, .06);
    --glass: rgba(9, 9, 11, .74);
    --glow: 9%;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 10px 28px -14px rgba(0, 0, 0, .7);
    --shadow-lg: inset 0 1px 0 rgba(255, 255, 255, .05), 0 32px 72px -20px rgba(0, 0, 0, .85);
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --bg2: #101013; --card: #131316; --card2: #1a1a1e;
  --text: #f3f3f5; --muted: #a1a4ae; --faint: #8a8d98; --line: #222227; --line2: #303037;
  --good: #3dd68c; --good-bg: #0e2a1c; --warn: #f1b443; --warn-bg: #2d220d; --bad: #ff6b61; --bad-bg: #341513;
  --info: #8aa4ff; --info-bg: #161d38;
  --track: #25252b;
  --ink: #f3f3f5; --on-ink: #0b0b0d;
  --ring: rgba(255, 255, 255, .2);
  --hover: rgba(255, 255, 255, .06);
  --glass: rgba(9, 9, 11, .74);
  --glow: 9%;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 10px 28px -14px rgba(0, 0, 0, .7);
  --shadow-lg: inset 0 1px 0 rgba(255, 255, 255, .05), 0 32px 72px -20px rgba(0, 0, 0, .85);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 64px); }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 88% -12%, color-mix(in srgb, var(--brand-b) var(--glow), transparent), transparent 62%),
    radial-gradient(900px 420px at 8% -18%, color-mix(in srgb, var(--brand-a) calc(var(--glow) * .6), transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 var(--font);
  letter-spacing: -.003em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
button, select, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; }
b, strong { font-weight: 600; }
img, svg, video { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--brand-b) 22%, transparent); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.faded { opacity: .55; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slide-in { from { transform: translateX(28px); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(36px); opacity: 0; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: .4; } }

/* ---------- 3. shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.logo {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b) 58%, var(--brand-c));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 12px -3px color-mix(in srgb, var(--brand-b) 55%, transparent);
}
.logo svg { width: 12px; height: 12px; margin-left: 1px; }
.brand { font-weight: 650; font-size: 15px; letter-spacing: -.02em; line-height: 1.1; min-width: 0; white-space: nowrap; }

/* sidebar (desktop) */
.side { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; text-decoration: none; color: inherit; border-radius: var(--r); }
.side-nav, .side-chs { display: flex; flex-direction: column; gap: 2px; }
.nav-link, .side-ch {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 9px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; min-width: 0;
  transition: background .15s, color .15s;
}
.nav-link .ico { width: 18px; height: 18px; flex: none; }
.nav-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .nav-link:hover, .side-ch:hover { background: var(--hover); color: var(--text); }
.side .nav-link.active, .side-ch.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.side .nav-link .badge { margin-left: auto; }
.side-ch .nav-t { flex: 1; }
.side-ch .avatar { flex: none; }
.side-ch.other { color: var(--muted); }
.side-h { font-size: 12px; color: var(--faint); font-weight: 600; padding: 20px 10px 6px; letter-spacing: .01em; }
.side-none { padding: 4px 10px; font-size: 13px; color: var(--faint); }
.side-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.sys { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-md); background: var(--hover); font-size: 12.5px; color: var(--muted); }
.sys .stamp { color: var(--faint); }
.sys .live { color: var(--text); font-weight: 500; white-space: normal; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--good); animation: pulse 2s infinite; box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.sdot.good { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.sdot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.sdot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.sdot.off { background: var(--faint); }
.side-tools, .top-tools { display: flex; align-items: center; gap: 6px; }
.side-tools { flex-direction: column; align-items: stretch; }

/* account button: a user card in the sidebar, an avatar in the phone top bar */
.acct {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; text-align: left;
  background: transparent; border: 1px solid transparent; color: var(--text); transition: background .15s, border-color .15s;
}
.acct:hover { background: var(--hover); }
.acct-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 650;
  color: #fff; background: linear-gradient(135deg, #3a3d46, #14151a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.acct-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.acct-n { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-r { font-size: 12px; color: var(--faint); }
.acct .ico { width: 16px; height: 16px; color: var(--faint); flex: none; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 14px;
  background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumb { display: none; color: var(--muted); text-decoration: none; white-space: nowrap; }
.crumb:hover { color: var(--text); }
.crumb-sep { display: none; color: var(--faint); }
.title { font-size: 17px; font-weight: 650; letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .live { padding: 0 4px; }
.topbar .live .dot:not(.on) { display: none; }
.live-link { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.live-link:hover .live-t { text-decoration: underline; text-underline-offset: 3px; }   /* on a phone the dot only shows while the loop is running */
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }

/* main column */
main { padding: 16px 16px calc(104px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 720px; }
main.enter > * { animation: rise .4s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .03s; }
main.enter > *:nth-child(3) { animation-delay: .06s; }
main.enter > *:nth-child(4) { animation-delay: .09s; }
main.enter > *:nth-child(n+5) { animation-delay: .12s; }

/* bottom bar (phones) */
.bottombar {
  position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 62px; padding: 0 4px; border-radius: 22px;
  background: color-mix(in srgb, var(--card) 84%, transparent); backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.bottombar .nav-link { flex-direction: column; justify-content: center; gap: 3px; padding: 0; min-height: 0; font-size: 10.5px; font-weight: 600; color: var(--faint); border-radius: 16px; }
.bottombar .nav-link .ico { width: 21px; height: 21px; }
.bottombar .nav-link.active { color: var(--text); }
.bottombar .nav-link.active::before { content: ""; position: absolute; top: 6px; left: 50%; width: 46px; height: 30px; transform: translateX(-50%); border-radius: 12px; background: var(--hover); }
.bottombar .nav-link > * { position: relative; }
.bottombar .badge { position: absolute; top: 5px; left: calc(50% + 6px); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
/* dark theme: text on the red badge and red tile pill */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge, :root:not([data-theme="light"]) .tile .top .pill.bad { color: #1a0605; } }
:root[data-theme="dark"] .badge, :root[data-theme="dark"] .tile .top .pill.bad { color: #1a0605; }
.badge[hidden] { display: none; }

@media (min-width: 900px) {
  .bottombar, .topbar .logo, .topbar #live-dot { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); z-index: 40;
    padding: 12px 12px 12px; overflow-y: auto; scrollbar-width: thin;
    background: color-mix(in srgb, var(--bg2) 55%, var(--bg)); border-right: 1px solid var(--line);
  }
  .topbar { margin-left: var(--side-w); padding: 0 max(var(--pad), calc((100vw - var(--side-w) - 1220px) / 2)); gap: 6px; }
  .crumb, .crumb-sep { display: inline; }
  .title { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
  main { margin-left: var(--side-w); max-width: none; padding: 28px max(var(--pad), calc((100vw - var(--side-w) - 1220px) / 2)) 72px; }
}

/* ---------- 4. primitives ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.card-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-ht { flex: 1; min-width: 0; }
.card-ht b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 760px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid + .grid { margin-top: 14px; }

/* page and section heads */
.page-head { display: none; }
.page-head h1 { font-size: 28px; line-height: 1.15; font-weight: 650; letter-spacing: -.03em; }
.page-sub { margin-top: 6px; font-size: 14px; color: var(--muted); }
.page-head.hello { display: block; margin: 4px 0 4px; }
.page-head.hello h1 { font-size: 24px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; min-height: 36px; margin: -4px 0 4px -4px; }
.back-link .ico { width: 18px; height: 18px; }
.sec-title { display: flex; align-items: flex-end; gap: 12px; margin: 34px 0 12px; }
.sec-title:first-child { margin-top: 0; }
.sec-t { flex: 1; min-width: 0; }
.sec-title h2 { font-size: 17px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
.sec-desc { margin-top: 2px; font-size: 13px; color: var(--muted); }
.sec-title .aside { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; font-size: 13px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.sec-title a.aside:hover { color: var(--text); }
.sec-sub { color: var(--muted); font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.aside-btns { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.foot { text-align: center; font-size: 12px; color: var(--faint); margin-top: 40px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid transparent; background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--shadow-sm); transition: transform .12s var(--ease), background .15s, border-color .15s, opacity .15s, box-shadow .15s;
}
.btn:hover { opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line2); min-height: 32px; padding: 0 12px; font-size: 13px; font-weight: 550; box-shadow: var(--shadow-sm); }
.btn.ghost:hover { opacity: 1; background: var(--card2); border-color: color-mix(in srgb, var(--text) 26%, var(--line2)); }
.btn.danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #1a0605; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #1a0605; } }
.btn.wide { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.link-btn { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.link-btn:hover { text-decoration-color: currentColor; }
/* small text links get a finger-sized hit area without changing the layout */
.link-btn, .card-link, .all-runs, .gate-link, .sec-title .aside a { position: relative; }
.link-btn::after, .card-link::after, .all-runs::after, .gate-link::after, .sec-title .aside a::after { content: ""; position: absolute; inset: -11px -6px; }
.x { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; padding: 0; background: none; color: var(--faint); border-radius: var(--r-sm); cursor: pointer; font-size: 18px; line-height: 1; transition: background .15s, color .15s; }
.x:hover { background: var(--hover); color: var(--text); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg2); color: var(--muted); white-space: nowrap; line-height: 1.3; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill .dot { width: 6px; height: 6px; background: currentColor; animation: none; box-shadow: none; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pills .pill { white-space: normal; border-radius: 12px; }

/* fields */
.field {
  display: block; width: 100%; min-width: 0; height: 40px; padding: 0 12px; margin: 0 0 10px; border-radius: var(--r);
  border: 1px solid var(--line2); background: var(--card); color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--faint); }
.field:hover { border-color: color-mix(in srgb, var(--text) 26%, var(--line2)); }
.field:focus, .gate-in:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
select.field {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8f99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
select.field option { background: var(--card); color: var(--text); }
.msg { font-size: 13px; margin-top: 8px; min-height: 1em; color: var(--muted); }
.msg:empty { display: none; }
.msg.bad { color: var(--bad); } .msg.good { color: var(--good); }

/* segmented control */
.seg { display: inline-flex; background: var(--bg2); border-radius: var(--r); padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; min-height: 28px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }

/* switch */
.switch { position: relative; width: 40px; height: 24px; border-radius: 12px; border: 0; padding: 0; background: color-mix(in srgb, var(--muted) 70%, var(--card)); cursor: pointer; flex: none; transition: background .2s; }
.switch::before { content: ""; position: absolute; inset: -8px -4px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* avatars */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #111; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.ring { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }

/* feedback blocks */
.err { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); color: var(--bad); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; }
.empty { text-align: center; padding: 34px 18px; color: var(--muted); font-size: 14px; }
.empty b { color: var(--text); display: block; margin-bottom: 4px; font-size: 15px; font-weight: 650; }
.skel { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--card) 0%, var(--card2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); margin-bottom: 14px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); text-decoration: none; font-size: 14px; margin: 0 0 14px; border: 1px solid var(--line); background: var(--card2); color: var(--muted); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.banner.good { background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.banner b { font-weight: 650; }
.banner .t { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner.wrap .t { white-space: normal; }
.banner .btn.ghost { color: var(--text); }
.notice { margin-bottom: 14px; font-size: 14px; color: var(--muted); }

/* alerts */
.alert-list { display: grid; gap: 8px; }
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); font-size: 14px; box-shadow: var(--shadow-sm); }
.alert > div { flex: 1; min-width: 0; padding-top: 2px; }
.alert .ic { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--track); color: var(--muted); font-size: 12px; font-weight: 700; }
.alert .ic .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.alert.warn .ic { background: var(--warn-bg); color: var(--warn); }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 28%, var(--line)); }
.alert.bad .ic { background: var(--bad-bg); color: var(--bad); }
.alert.good .ic { background: var(--good-bg); color: var(--good); }
.alert.info { box-shadow: none; background: transparent; color: var(--muted); }
.alert.info .who { color: var(--text); }
.alert .who { font-weight: 650; }
.alert .x { margin: -2px -4px -2px 0; }
.alert-go { flex: none; display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.alert-go:hover { background: var(--card2); }
.alert-restore { margin-left: auto; align-self: center; }
.dismissed-line { color: var(--muted); font-size: 13px; padding: 4px 2px; }

/* folds */
details.fold { margin-top: 14px; }
details.fold > summary, .rm-details > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 600; list-style: none; padding: 8px 2px; border-radius: var(--r-sm); width: fit-content; }
details.fold > summary::-webkit-details-marker, .rm-details > summary::-webkit-details-marker { display: none; }
details.fold > summary::before, .rm-details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .18s var(--ease); margin: 0 3px 0 2px; flex: none; }
details.fold[open] > summary::before, .rm-details[open] > summary::before { transform: rotate(45deg); }
details.fold > summary:hover, .rm-details > summary:hover { color: var(--text); }
details.fold > summary + * { margin-top: 6px; }
pre.lines { white-space: pre-wrap; word-break: break-word; background: var(--card2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin: 4px 0 0; max-height: 280px; overflow: auto; }

/* hover x: a round button laid over a tile, card or queue clip; shown on hover or focus, always on touch screens */
.tile-wrap, .qtile-wrap { position: relative; min-width: 0; }
.hover-x {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .68); color: #fff; font: inherit; font-size: 17px; line-height: 1; cursor: pointer; opacity: 0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .15s, background .15s;
}
.hover-x::after { content: ""; position: absolute; inset: -9px; }
.hover-x:hover { background: var(--bad); }
.tile-wrap:hover > .hover-x, .tile-wrap:focus-within > .hover-x, .qtile-wrap:hover > .hover-x, .qtile-wrap:focus-within > .hover-x,
.bcard:hover > .hover-x, .bcard:focus-within > .hover-x, .hover-x:focus-visible { opacity: 1; }
@media (hover: none) { .hover-x { opacity: .85; } }
.drag-ghost .hover-x { display: none; }

/* tabs (channel page) */
.tabs { display: flex; gap: 2px; margin: 0 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 42px; padding: 0 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--ink); }
.tabpanel { min-width: 0; }
.tabpanel:focus-visible { outline-offset: 6px; }
.tabpanel > * + * { margin-top: 14px; }
.tabpanel > .sec-title { margin-bottom: 0; }

/* header chips (Home) */
.hchip { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 11px; border-radius: 999px; background: var(--bg2); color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hchip.good { background: var(--good-bg); color: var(--good); }
.hchip.bad { background: var(--bad-bg); color: var(--bad); }
.hchip.loop { background: var(--card); border: 1px solid var(--line); max-width: 38ch; overflow: hidden; text-overflow: ellipsis; }
a.hchip:hover { filter: brightness(.97); }

/* ---------- 5. overlays ---------- */
.toast {
  position: fixed; z-index: 90; left: 12px; right: 12px; margin-inline: auto; width: fit-content; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: min(calc(100vw - 24px), 480px);
  display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 16px; border-radius: 14px; background: var(--ink); color: var(--on-ink);
  font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease);
}
.toast[hidden] { display: none; }
.toast-act { border: 0; border-radius: var(--r-sm); background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: inherit; font: inherit; font-weight: 650; cursor: pointer; padding: 5px 10px; }
.toast-act:hover { background: color-mix(in srgb, var(--on-ink) 26%, transparent); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

.drawer-wrap { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; align-items: flex-end; }
.drawer-wrap[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(6, 6, 10, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease; }
.drawer { position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--card); border-radius: 22px 22px 0 0; border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: sheet-up .28s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
.drawer::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--line2); margin: 8px auto -2px; flex: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; min-width: 0; padding-top: 5px; font-weight: 650; font-size: 16px; letter-spacing: -.015em; line-height: 1.3; overflow-wrap: anywhere; }
.drawer-body { overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.drawer-body > * { flex-shrink: 0; }   /* the body scrolls; its blocks never squash */
.drawer-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.drawer-line b { color: var(--text); }
.drawer-links { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--card); font-size: 13px; font-weight: 550; text-decoration: none; }
.drawer-links a:hover { background: var(--card2); }
.drawer-end { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.drawer-end:empty { display: none; }
@media (min-width: 900px) {
  .drawer-wrap { align-items: stretch; padding: 10px; }
  .drawer { width: min(480px, 100vw); max-height: none; height: 100%; border-radius: 20px; animation: slide-in .28s var(--ease); }
  .drawer::before { display: none; }
}
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.kv:empty { display: none; }
.kv-i { min-width: 0; background: var(--card); padding: 10px 12px; }
.kv-i:last-child:nth-child(odd) { grid-column: 1 / -1; }
.kv-l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kv-v { font-weight: 650; font-size: 15px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kv-v a { font-weight: 600; font-size: 14px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--muted); }
.player { width: 100%; aspect-ratio: 9 / 16; max-height: 62vh; background: #000; border-radius: var(--r-lg); display: block; margin: 0 auto; }
.player-box { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 62vh; margin: 0 auto; background: var(--c, #000); border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; }
.player-box img.th { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-note { position: relative; color: #fff; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 999px; font-size: 13px; font-weight: 550; text-align: center; padding: 7px 14px; }

dialog { color: var(--text); }
.acct-dlg, .ask-dlg { border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--text); padding: 0; width: min(440px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); box-shadow: var(--shadow-lg); }
.acct-dlg[open], .ask-dlg[open] { animation: pop .22s var(--ease); }
.acct-dlg::backdrop, .ask-dlg::backdrop { background: rgba(6, 6, 10, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dlg-body { padding: 22px; margin: 0; }
.dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.dlg-head h3 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.dlg-head .x { margin-left: auto; }
.dlg-h { font-size: 12px; color: var(--faint); font-weight: 600; margin: 18px 0 6px; }
.dlg-pw { margin-top: 16px; }
.dlg-pw .field { margin-top: 8px; margin-bottom: 0; }
.dlg-pw .btn { margin-top: 10px; }
.dlg-foot { display: flex; gap: 8px; margin-top: 20px; }
.dlg-foot .btn { flex: 1; }
.acct-list { display: flex; flex-direction: column; }
.acct-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.acct-row:first-child { border-top: 0; }
.acct-row-t { flex: 1 1 120px; min-width: 0; }
.ask-dlg { width: min(400px, calc(100vw - 28px)); }
.ask-body { padding: 22px; margin: 0; }
.ask-title { font-size: 17px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.ask-text { margin-top: 8px; font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.ask-btns .btn { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* ---------- 6. data display ---------- */
/* headline numbers */
.stat { position: relative; min-width: 0; padding: 16px 18px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.stat .v { font-size: 34px; font-weight: 650; letter-spacing: -.04em; line-height: 1.1; margin-top: 6px; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s.up { color: var(--good); font-weight: 600; }
.stat svg.spark { display: block; width: 100%; height: 34px; margin-top: 10px; }

/* charts */
.chart-card { padding: 16px 18px 12px; }
.chart-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
/* a chart is drawn at the exact size of its box (core.js fitChart) and redrawn when the box changes */
.chart-wrap { position: relative; width: 100%; height: 260px; }
.chart-wrap.tall { height: 300px; }
svg.chart { position: absolute; inset: 0; display: block; overflow: visible; touch-action: pan-y; }
svg.chart text { fill: var(--faint); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
svg.chart .grid-l { stroke: var(--line); stroke-width: 1; }
@media (max-width: 640px) { .chart-wrap { height: 210px; } .chart-wrap.tall { height: 250px; } }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--on-ink); font-size: 12px; padding: 7px 10px; border-radius: var(--r-sm); white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; z-index: 2; box-shadow: var(--shadow-lg); }
.tip.on { opacity: 1; }
.tip.wrap { white-space: normal; width: max-content; max-width: 220px; text-align: center; line-height: 1.35; }
.tip b { display: block; font-weight: 600; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; font-size: 13px; }
.bar-row .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.bar-row .v { color: var(--muted); text-align: right; white-space: nowrap; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--text)); }
.ins-h { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 14px; }

/* channel cards */
.ch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 4px; }
.ch-stats .v { font-size: 22px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.ch-stats .l { font-size: 12.5px; color: var(--muted); }

/* Short tiles (9:16) */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1680px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; margin: -4px -2px 0; scrollbar-width: thin; }
@media (min-width: 600px) { .strip { grid-auto-columns: 28%; } }
@media (min-width: 1000px) { .strip { grid-auto-columns: calc((100% - 48px) / 5); } }
@media (min-width: 1500px) { .strip { grid-auto-columns: calc((100% - 60px) / 6); } }
.strip > * { scroll-snap-align: start; }
.tile { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-lg); overflow: hidden; background: var(--c); display: block; text-decoration: none; color: #fff; box-shadow: var(--shadow); isolation: isolate; transition: transform .25s var(--ease), box-shadow .25s; }
button.tile { border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; width: 100%; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile img.th { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .5s var(--ease); }
.tile:hover img.th { transform: scale(1.05); }
/* no picture yet: a dark card lit in the channel's colour, with its initials */
.tile .ini { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 18%; font-weight: 650; font-size: 30px; letter-spacing: -.02em; color: rgba(255, 255, 255, .22); z-index: -2; background: radial-gradient(130% 70% at 50% 0%, color-mix(in srgb, var(--c) 62%, #15151a), #15151a 78%); }
.tile::after { content: ""; position: absolute; inset: 42% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .88)); z-index: -1; }
.tile .top { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; align-items: center; gap: 6px; }
.tile .top .avatar { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.tile .top .pill { margin-left: auto; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tile .top .pill.warn { color: #ffd27a; }
.tile .top .pill.bad { background: var(--bad); color: #fff; }
.tile .rank { font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 2px 8px; border-radius: 999px; }
.tile .bot { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.tile .tt { font-size: 13px; font-weight: 600; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.tile .nums { display: flex; gap: 10px; margin-top: 7px; font-size: 12px; font-weight: 500; align-items: center; color: rgba(255, 255, 255, .82); }
.tile .nums b { font-size: 16px; font-weight: 650; color: #fff; letter-spacing: -.02em; }
.tile .keep { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.tile .keep i { display: block; height: 100%; background: #fff; }
.tile .keep-gap { flex: 1; }
.tile .len { font-size: 10.5px; font-weight: 650; background: rgba(0, 0, 0, .6); padding: 1px 6px; border-radius: 5px; color: #fff; }

/* tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card2); }
table.list th:first-child { border-top-left-radius: var(--r-lg); } table.list th:last-child { border-top-right-radius: var(--r-lg); }
table.list td { padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.list tr:first-child td { border-top: 0; }
table.list tr.clickable { cursor: pointer; transition: background .12s; }
table.list tr.clickable:hover td, table.list tr.clickable:focus-visible td { background: var(--card2); }
table.list .r { text-align: right; }
.t-thumb { position: relative; width: 34px; height: 54px; border-radius: 7px; overflow: hidden; background: var(--c, var(--card2)); }
.t-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.t-thumb:empty { background: radial-gradient(130% 80% at 50% 0%, color-mix(in srgb, var(--c, #888) 62%, #15151a), #15151a 82%); }
.t-title { min-width: 200px; max-width: 440px; font-weight: 550; }
.t-title .run-dot { display: inline-block; margin-right: 8px; vertical-align: middle; }
.t-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
td .pill + .pill { margin-left: 4px; }

/* schedule board (board.js): one column per day, cards sorted by time */
.board { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.board-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); align-items: start; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: thin; }
.board-col { scroll-snap-align: start; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card2); position: relative; transition: background .12s, border-color .12s; }
.col-h { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 8px; font-size: 13px; }
.col-cards { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.col-none { padding: 6px 4px; }
.bcard { position: relative; display: flex; flex: none; min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-sm); transition: opacity .15s, box-shadow .15s, border-color .15s; }
.bopen { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 6px; border: 0; border-radius: var(--r); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
div.bopen { cursor: default; }
button.bopen:hover .bt-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.bthumb { position: relative; flex: none; width: 38px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--c, var(--track)); }
.bthumb:empty { background: radial-gradient(130% 80% at 50% 0%, color-mix(in srgb, var(--c, #888) 62%, #15151a), #15151a 82%); }
.bthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.btx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.bt-time { font-size: 12px; font-weight: 650; color: var(--text); }
.bt-title { font-size: 12.5px; line-height: 1.28; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bt-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.bbadge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 11px; font-weight: 650; line-height: 1.5; }
.bbadge.clash { white-space: nowrap; background: var(--bad-bg); color: var(--bad); }
.bcard.empty { align-items: center; gap: 8px; min-width: 0; padding: 10px; border-style: dashed; border-color: var(--line2); background: transparent; box-shadow: none; color: var(--faint); font-size: 12.5px; font-weight: 500; }
.bcard.posted { opacity: .62; }
.bcard.pending { border-color: var(--warn); }
.bcard.movable { cursor: grab; }
.bcard.movable, .qtile-wrap.movable { -webkit-user-select: none; user-select: none; }
.bcard.movable:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.compact .bthumb { width: 30px; }
.compact .bopen { padding: 5px; gap: 8px; }
.compact .bt-title { -webkit-line-clamp: 1; }
.compact .col-h { padding-bottom: 6px; }
/* dragging */
body.is-dragging, body.is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.drag-src { opacity: .35; }
.holding { box-shadow: 0 0 0 2px var(--info), var(--shadow); }
.bcard.dim { opacity: .4; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 95; width: var(--w); margin: 0; transform: translate(var(--x, 0), var(--y, 0)) rotate(1.5deg); pointer-events: none; box-shadow: var(--shadow-lg); opacity: .95; }
.drop-on { outline: 2px solid var(--info); outline-offset: -2px; background: var(--info-bg); }
.board-col.drop-on > .col-h { color: var(--info); }
.drop-on::after { content: attr(data-drop); position: absolute; z-index: 4; right: 6px; top: 6px; max-width: calc(100% - 12px); padding: 2px 9px; border-radius: 999px; background: var(--info); color: var(--on-ink); font-size: 11.5px; font-weight: 650; line-height: 1.5; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-bin.drop-on::after, .qgrid.drop-on::after { display: none; }
/* the bin is a small pill fixed at the bottom centre of the window, so it never lies over a column of cards */
.board-bin { display: none; position: fixed; z-index: 60; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(300px, calc(100vw - 32px)); min-height: 48px; align-items: center; justify-content: center; border: 2px dashed var(--bad); border-radius: 999px; background: var(--bad-bg); color: var(--bad); font-weight: 650; font-size: 14px; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.25)); }
.board.dragging .board-bin { display: flex; }
.board-bin.drop-on { background: var(--bad); color: #fff; outline: 0; }
:root[data-theme="dark"] .board-bin.drop-on { color: #1a0605; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board-bin.drop-on { color: #1a0605; } }
.qtile-wrap.movable { cursor: grab; }
.qtile-wrap.ins-before .qtile { box-shadow: inset 4px 0 0 var(--info); }
.qtile-wrap.ins-after .qtile { box-shadow: inset -4px 0 0 var(--info); }
.qtile-wrap.is-next .qb.lay { top: 28px; } .qtile-wrap.is-next .qb.tw { top: 50px; }
.qb.nx { left: 6px; top: 6px; background: var(--good); color: #fff; }
:root[data-theme="dark"] .qb.nx { color: #0b1a12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qb.nx { color: #0b1a12; } }
.q-hint { margin-left: auto; }
.sched-box { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.sched-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar.sched-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sched-card { padding: 14px; }

/* ---------- 7. pages ---------- */
/* home */
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }

/* one channel */
.ch-hero {
  position: relative; display: grid; gap: 18px; padding: 22px; margin: 0 0 14px; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background:
    radial-gradient(520px 220px at 0% 0%, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%),
    radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--c) 8%, transparent), transparent 70%),
    var(--card);
}
.ch-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.ch-hero-t { min-width: 0; }
.ch-hero h1 { font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -.03em; overflow-wrap: anywhere; }
.ch-owner { margin-top: 3px; font-size: 13px; color: var(--muted); }
.ch-hero .pills { margin-top: 8px; }
.ch-hero .pill:not(.good):not(.warn):not(.bad) { background: color-mix(in srgb, var(--text) 7%, transparent); }
.ch-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.ch-stats.four > div { background: color-mix(in srgb, var(--card) 92%, transparent); padding: 12px 16px; min-width: 0; }
.ch-stats.four .v { font-size: 24px; }
@media (min-width: 760px) { .ch-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .ch-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; padding: 26px 28px; }
}
.stale { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.ch-hero + .stale { margin: -6px 2px 12px; }
.mt { margin-top: 20px; }
.fold-line { margin: 4px 0; }
.card.empty.first { margin-top: 14px; }
.chart-t { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin-right: 4px; }
.card-link { flex: none; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; padding-top: 2px; }
.card-link:hover { color: var(--text); }
.sec-title .aside a { color: inherit; text-decoration: none; }
.sec-title .aside a:hover { color: var(--text); }
.t-clamp .run-dot { display: inline-block; margin-right: 8px; vertical-align: 1px; }


/* queue */
.q-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.q-head b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.q-note { margin-bottom: 10px; }
/* a film strip: one row that scrolls sideways inside its card */
.qgrid { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: 132px; overflow-x: auto; scroll-snap-type: x proximity; padding: 3px 2px 10px; margin: -3px -2px -6px; scrollbar-width: thin; }
.qgrid > * { scroll-snap-align: start; }
.qtile { position: relative; display: block; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-md); overflow: hidden; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; min-width: 0; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.qtile:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: var(--shadow); }
.qthumb { position: relative; aspect-ratio: 9 / 16; background: var(--c, var(--card2)); display: block; overflow: hidden; }
.qthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qb { position: absolute; top: 6px; font-size: 10.5px; font-weight: 650; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; }
.qb.lay { left: 6px; } .qb.tw { left: 6px; top: 28px; } .qb.len { top: auto; bottom: 6px; right: 6px; }
.qt { padding: 9px 10px 2px; font-size: 13px; font-weight: 600; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qs { display: block; padding: 0 10px 9px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.rm-t { flex: 1; min-width: 0; }
.rm-n { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* shorts */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .field { width: auto; margin: 0; }
.toolbar .field.search {
  flex: 1 1 240px; padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8f99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z'/%3E%3Cpath d='M20 20l-3.8-3.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 16px;
}
.tb-count { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* activity */
.task { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task-t { min-width: 0; }
.task .n { font-weight: 600; font-size: 14px; }
.task .d { font-size: 12.5px; color: var(--muted); }
.task .r { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.task .r-sub { margin-top: 4px; }
.task .act { margin-top: 3px; font-size: 13px; color: var(--good); font-weight: 600; }
.task .act small { display: block; color: var(--faint); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.ev { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev-t { min-width: 0; }
.ev .mk { width: 8px; height: 8px; border-radius: 50%; margin: 6px 5px 0; background: var(--faint); }
.ev.good .mk { background: var(--good); } .ev.bad .mk { background: var(--bad); } .ev.warn .mk { background: var(--warn); }
.ev .what { font-size: 14px; font-weight: 600; }
.ev .what span { font-weight: 500; }
.ev .when, .ev .why { font-size: 12.5px; color: var(--muted); word-break: break-word; }

/* home: header row, numbers, board and channels, top Shorts. On a big screen it fills the window exactly (see section 12). */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.home-hello { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; min-width: 0; }
.home-hello h1 { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.03em; }
.home-date { font-size: 13.5px; }
.home-chips { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.home-stats { display: inline-flex; align-items: center; gap: 8px; }
.stats-now { font-size: 13px; font-weight: 600; color: var(--warn); }
.home-needs { display: grid; gap: 6px; }
.home-needs .alert-list { gap: 6px; }
.home-needs .alerts { gap: 6px; }
.home-needs .alert { align-items: center; padding: 6px 12px; }
.home-needs .alert > div { padding-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-link { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; justify-self: start; }
.more-link:hover { color: var(--text); }
.home-nums { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-nums .stat { padding: 9px 14px 8px; }
.home-nums .stat .v { font-size: 24px; margin-top: 2px; }
.home-nums .stat svg.spark { height: 16px; margin-top: 3px; }
.home-nums .stat .s { margin-top: 2px; }
button.stat { display: block; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
button.stat:hover { border-color: var(--line2); }
.home-main { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .home-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.home-board { padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.home-board .card-h { margin-bottom: 8px; align-items: center; }
.aside-row { display: flex; align-items: center; gap: 12px; }
.home-board-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; }
.home-board-body > .board { flex: 1 1 auto; }
.board.compact .col-cards { max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
.home-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.home-chs { padding: 10px 14px 8px; flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.home-chs .card-h { margin-bottom: 6px; }
.home-chs-list { display: flex; flex-direction: column; }
.ch-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 38px; padding: 4px 6px; margin: 0 -6px; border-radius: var(--r); color: inherit; text-decoration: none; transition: background .15s; }
.ch-row:hover { background: var(--hover); }
.ch-row-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ch-row-n { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row-s { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.ch-row-st { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row-nums { display: flex; flex-direction: column; align-items: flex-end; font-size: 11.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.ch-row-nums b { color: var(--text); font-weight: 650; }
.ch-row.other { min-height: 32px; }
.ch-row.other .ch-row-n { font-weight: 550; font-size: 13px; color: var(--muted); }
.home-other-h { margin: 8px 0 2px; font-weight: 600; }
.home-chart { display: flex; flex-direction: column; padding: 12px 14px 8px; min-height: 0; }
.home-chart.gone { display: none; }
.home-chart .chart-head { margin-bottom: 6px; }
.home-top .sec-title { margin: 0 0 8px; }
.home-top .strip { margin-top: 0; }
.strip.sm { grid-auto-columns: 96px; gap: 10px; padding: 2px 2px 6px; }
.tile-wrap.sm .tile { border-radius: var(--r-md); }
.tile-wrap.sm .tile .top { top: 6px; left: 6px; right: 6px; }
.tile-wrap.sm .tile .top .avatar { display: none; }
.tile-wrap.sm .tile .bot { left: 8px; right: 8px; bottom: 8px; }
.tile-wrap.sm .tile .tt { font-size: 11px; line-height: 1.25; }
.tile-wrap.sm .tile .nums { margin-top: 3px; font-size: 10.5px; }
.tile-wrap.sm .tile .nums b { font-size: 12.5px; }
.tile-wrap.sm .tile .nums .keep, .tile-wrap.sm .tile .nums .keep-gap, .tile-wrap.sm .tile .len { display: none; }

/* channel page, Overview */
.ov-board .card-h { margin-bottom: 10px; }
.mt-s { margin-top: 14px; }
.ov-row .sec-title { margin-top: 0; }
.ov-col { min-width: 0; }

/* activity: the "Right now" card */
.now-card { display: flex; gap: 16px 24px; align-items: flex-start; flex-wrap: wrap; }
.now-main { flex: 1 1 320px; min-width: 0; }
.now-loop { display: flex; align-items: center; gap: 12px; font-size: 20px; line-height: 1.3; font-weight: 650; letter-spacing: -.02em; }
.now-list { display: flex; flex-direction: column; margin-top: 12px; }
.now-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.now-t { flex: 1; min-width: 0; font-size: 14px; }
.now-row-wrap .run-log { margin: 0 0 10px; }
.now-ctl { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.now-sw { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.now-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.system-fold > summary + * { margin-top: 6px; }
.system-fold > .card { margin-bottom: 10px; }

/* ---------- 8. run now, runs, settings ---------- */
.run-card { display: flex; flex-direction: column; }
.run-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.run-head b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.run-head .small { flex: 1; min-width: 0; }
.act-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.act-t { flex: 1; min-width: 0; }
.act-l { font-weight: 600; font-size: 14px; }
.act-row .btn { flex: none; }
.run-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.run-ch { display: flex; align-items: center; gap: 10px; flex: 1 1 160px; min-width: 0; }
.run-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.runs { overflow: hidden; }
.run-item { padding: 12px 18px; border-top: 1px solid var(--line); }
.run-item:first-child { border-top: 0; }
.runs-inline .run-item { padding: 10px 0; }
.run { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.run-main { flex: 1 1 110px; min-width: 0; }
.run-label { font-weight: 600; font-size: 14px; }
.run-log { margin: 10px 0 0; max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--card2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.all-runs { display: inline-block; margin-top: 10px; color: var(--muted); font-weight: 500; text-decoration: none; }
.all-runs:hover { color: var(--text); }
.settings { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.settings > .set-row:first-of-type { border-top: 0; padding-top: 2px; }
.set-l { flex: 1 1 160px; min-width: 0; font-weight: 600; font-size: 14px; color: var(--text); }
.set-block { padding: 12px 0 2px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.set-block .set-l { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line2); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.chip-x { border: 0; background: none; color: var(--faint); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: 15px; line-height: 1; }
.chip-x:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); }
.chip-x:disabled { opacity: .4; cursor: not-allowed; }
.time-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.field.time-in { width: auto; margin: 0; height: 36px; }
.time-save { display: flex; gap: 6px; align-items: center; }

/* ---------- 9. StakesClips ---------- */
.newjob .field.link { margin: 0; height: 46px; font-size: 15px; }
.opts { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-end; margin-top: 16px; }
.opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt > .ol { font-size: 12px; font-weight: 600; color: var(--muted); }
.opt-in { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.count { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 550; }
.count .field { width: 76px; margin: 0; height: 36px; padding: 0 10px; }
.count input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.len-range { font-size: 13px; font-weight: 500; color: var(--muted); }
.opt-wide { flex: 1 1 260px; }
.field.title-in { margin: 0; height: 36px; }
details.fold.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
details.fold.more .opts { margin-top: 8px; }
.more-note { font-weight: 500; color: var(--faint); margin-left: 4px; }
.more-help { margin-top: 12px; }
.go-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.go-row .summary { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.go-row .btn { min-height: 40px; padding: 0 18px; }
.review-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-bg) 55%, var(--card)); }
.review-banner .rb-t { flex: 1; min-width: 180px; font-weight: 650; }
.review-banner .rb-t small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.rv { grid-column: 1 / -1; display: flex; gap: 14px; align-items: flex-start; padding: 4px 0 6px; }
.rv video { width: 150px; aspect-ratio: 9 / 16; max-height: 266px; border-radius: var(--r-md); background: #000; flex: none; }
.rv .novid { width: 150px; aspect-ratio: 9 / 16; border-radius: var(--r-md); background: var(--track); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--muted); padding: 8px; flex: none; }
.rv-act { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; align-items: flex-start; }
.rv-act .btn { min-height: 36px; min-width: 150px; font-size: 14px; }
.job { margin-bottom: 12px; }
.job-head { display: flex; gap: 10px; align-items: flex-start; }
.job-head-t { flex: 1; min-width: 0; }
.job-head .tt { font-weight: 650; font-size: 16px; line-height: 1.3; letter-spacing: -.015em; word-break: break-word; }
.job-head .sub { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 16px 0 6px; }
.steps i { height: 5px; border-radius: 3px; background: var(--track); }
.steps i.on { background: var(--text); }
.steps i.now { background: var(--text); animation: blink 1.2s ease-in-out infinite; }
.steps i.bad { background: var(--bad); }
.step-label { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.job-note { margin-top: 12px; }
.job .err { margin: 12px 0 0; }
.job .err .mono { margin-top: 6px; }
.job-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.job-parts { margin-top: 12px; }
.job-more { margin-top: 6px; }
.job-end { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; }
.job-min { padding: 0; overflow: hidden; display: flex; align-items: center; }
.job-line { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border: 0; background: transparent; padding: 13px 18px; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: background .15s; }
.job-line:hover { background: var(--card2); }
.job-line .tt { font-weight: 600; font-size: 14px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.job-line .sum { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-line .chev { width: 7px; height: 7px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-45deg); flex: none; font-size: 0; margin-right: 4px; }
.job-min-act { padding: 0 14px 0 0; display: flex; flex: none; }
.part { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.part-t { min-width: 0; }
.part .pn { font-weight: 650; font-size: 13px; }
.part .pn small { display: block; font-weight: 500; color: var(--faint); font-size: 11.5px; }
.part .pt { font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part .pw, .rv-act .pw { font-size: 12.5px; color: var(--muted); }
.part .pr { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.part .pr a { font-size: 12.5px; font-weight: 600; }

/* ---------- 10. Reel Minute section (reelminute.js) ---------- */
.rm-wrap { margin-top: 8px; }
.rm-card { padding: 18px 20px; }
.rm-bars { display: grid; gap: 18px; }
@media (min-width: 760px) { .rm-bars { grid-template-columns: 1fr 1fr; gap: 28px; } }
.rm-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.rm-bar-head .rm-val { color: var(--text); font-weight: 650; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rm-track { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.rm-fill { display: block; height: 100%; min-width: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--brand-a), var(--brand-b)); }
.rm-note { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.rm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rm-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rm-table td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.rm-table tr:first-child td { border-top: 0; }
.rm-table td.rm-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rm-table td.rm-nowrap { white-space: nowrap; color: var(--muted); }
.rm-table th.r { text-align: right; }
.rm-table a { color: var(--text); font-weight: 600; text-underline-offset: 3px; text-decoration-color: var(--line2); }
.rm-log { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.rm-card > .rm-md { max-height: 440px; overflow-y: auto; scrollbar-width: thin; padding-right: 6px; }   /* long notes scroll inside their card */
.rm-md { max-width: 86ch; color: var(--muted); }
.rm-md strong { color: var(--text); }
.rm-md h1, .rm-md h2, .rm-md h3 { margin: 18px 0 6px; line-height: 1.3; color: var(--text); font-weight: 650; letter-spacing: -.015em; }
.rm-md h1 { font-size: 17px; } .rm-md h2 { font-size: 15px; } .rm-md h3 { font-size: 14px; }
.rm-md > :first-child { margin-top: 0; }
.rm-md p { margin: 6px 0; font-size: 14px; }
.rm-md ul, .rm-md ol { margin: 6px 0; padding-left: 20px; font-size: 14px; }
.rm-md li { margin: 3px 0; }
.rm-md li::marker { color: var(--faint); }
.rm-md code { font-family: var(--mono); font-size: 12px; background: var(--bg2); color: var(--text); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.rm-md table { border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.rm-md th, .rm-md td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.rm-md th { background: var(--card2); color: var(--text); }
.rm-md .rm-scroll { margin: 8px 0; }
.rm-details { margin-top: 16px; }
.rm-details ul { margin: 6px 0; padding-left: 20px; font-size: 13px; color: var(--muted); }

/* ---------- 11. sign-in ---------- */
body.gated .app, body.gated .bottombar, body.gated .drawer-wrap { display: none !important; }
.gate {
  width: 100%; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background:
    radial-gradient(640px 420px at 50% 22%, color-mix(in srgb, var(--brand-b) calc(var(--glow) * 2), transparent), transparent 65%),
    radial-gradient(520px 360px at 30% 12%, color-mix(in srgb, var(--brand-a) var(--glow), transparent), transparent 65%);
}
.gate[hidden] { display: none; }
.gate-col { width: min(384px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; text-align: center; animation: rise .5s var(--ease) both; }
.gate .logo { width: 48px; height: 48px; border-radius: 14px; }
.gate .logo svg { width: 19px; height: 19px; margin-left: 2px; }
.gate-title { margin-top: 18px; font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.gate-sub { margin-top: 6px; font-size: 14px; color: var(--muted); }
.gate-card { margin-top: 28px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow-lg); }
.gate-l { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.gate-in { display: block; width: 100%; min-width: 0; height: 44px; padding: 0 12px; margin-bottom: 14px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--card); color: var(--text); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.gate-card .btn.wide { margin-top: 4px; min-height: 44px; font-size: 15px; }
.gate-h { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.gate-link { display: block; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; margin: 2px 0 16px; }
.gate-p { margin: 8px 0 16px; font-size: 14px; color: var(--muted); }
.gate-err { margin-top: 12px; background: var(--bad-bg); color: var(--bad); border-radius: var(--r); padding: 10px 12px; font-size: 13px; }
.gate-err:empty { display: none; }
.gate-foot { margin-top: 22px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- 12. small screens, touch, motion ---------- */
@media (min-width: 900px) {
  .page-head { display: block; margin: 0 0 22px; }
  .page-head.hello { margin: 2px 0 6px; }
  .page-head.hello h1 { font-size: 28px; }
  .back-bar, .back-link { display: none; }
  .pad { padding: 20px 22px; }
}
@media (max-width: 899px) {
  body { font-size: 15px; }
  .acct { width: auto; padding: 0; border-radius: 50%; }
  .acct-meta, .acct .ico { display: none; }
  .acct-av { width: 32px; height: 32px; }
  .btn, .field, .toolbar .field { min-height: 44px; }
  .btn.ghost { min-height: 40px; }
  .field { font-size: 16px; }
  .icon-btn { width: 40px; height: 40px; }
  .icon-btn svg { width: 19px; height: 19px; }
  html { scroll-padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .seg button { min-height: 38px; }
  .acct { min-width: 40px; min-height: 40px; display: grid; place-items: center; }
  .sec-title .sec-t { flex: 1 1 200px; }
  .page-head:not(.hello) { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .switch { height: 28px; width: 48px; border-radius: 14px; }
  .switch::after { width: 24px; height: 24px; }
  .switch[aria-checked="true"]::after { transform: translateX(20px); }
  .x { width: 40px; height: 40px; }
  .alert .x { margin: -8px -10px -8px -4px; }
  .run .x { margin: -6px -8px -6px -4px; }
  .chip { min-height: 36px; } .chip-x { width: 30px; height: 30px; }
  .field.time-in, .count .field, .field.title-in { height: 44px; }
  .sec-title { margin-top: 30px; flex-wrap: wrap; }
  .ch-hero { padding: 18px; }
  .ch-hero h1 { font-size: 22px; }
  .avatar.xl { width: 54px; height: 54px; }
  .toolbar .field.search { flex-basis: 100%; }
  .tb-row .seg { flex: 0 1 auto; }
}
@media (max-width: 640px) {
  .stat { padding: 14px 14px 12px; }
  .stat .v { font-size: 28px; }
  .legend { margin-left: 0; width: 100%; }
  .act-row { gap: 10px; }
  .job-min { flex-wrap: wrap; }
  .job-line { flex-wrap: wrap; flex-basis: 100%; }
  .job-line .tt { max-width: 100%; flex-basis: 100%; white-space: normal; }
  .job-line .sum { flex-basis: 60%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .job-min-act { padding: 0 14px 12px; margin-left: auto; }
}
@media (max-width: 560px) {
  .opts { flex-direction: column; align-items: stretch; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); padding: 2px 12px; }
  .opt { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
  .opt + .opt { border-top: 1px solid var(--line); }
  .go-row { flex-direction: column; align-items: stretch; border-top: 0; padding-top: 0; }
  .go-row .btn { width: 100%; }
  .opt-wide { flex-basis: auto; } .opt-wide .field.title-in { flex: 1 1 100%; }
  .newjob .opt-in { flex-wrap: wrap; row-gap: 6px; } .newjob .count, .len-range { white-space: nowrap; }
  .rv video, .rv .novid { width: 128px; }
  .rv-act .btn { min-width: 0; width: 100%; }
}
/* Home on a big screen: the page is exactly one window tall; the board and the channel list scroll inside their cards */
@media (min-width: 1100px) and (min-height: 680px) {
  main[data-page="home"][data-fit="1"] { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--top-h)); padding-top: 14px; padding-bottom: 14px; overflow: hidden; }
  main[data-page="home"][data-fit="1"] > * { flex: none; min-width: 0; margin-top: 0; margin-bottom: 0; }
  main[data-page="home"][data-fit="1"] > .home-main { flex: 1 1 0; min-height: 0; }
  .home-main { grid-template-rows: minmax(0, 1fr); }
  .home-board-body > .board { display: flex; flex-direction: column; }
  .board.compact .board-cols { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .board.compact .board-col { display: flex; flex-direction: column; height: 100%; }
  .board.compact .col-cards { flex: 1 1 0; max-height: none; overflow-y: auto; scrollbar-width: thin; }
  .home-chart .chart-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
  .home-chart { flex: 1 1 0; }
}
@media (max-width: 899px) {
  .board-cols { grid-auto-columns: 78%; }
  .tab { min-height: 46px; }
  .now-ctl { align-items: stretch; width: 100%; }
  .now-btns { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .home-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-hello h1 { font-size: 21px; }
  .now-loop { font-size: 17px; }
  .now-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
