/* Superr Reels — one hand-written stylesheet. A warm paper studio: ink-black actions, one marker-yellow accent,
   Fredoka for display (the face the reels' titles use), the system face for everything else. Light and dark. */

@font-face {
  font-family: "Fredoka";
  src: url("/static/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f3f0ea;
  --surface-3: #e9e5dc;
  --line: #e7e2d8;
  --line-strong: #d7d0c3;
  --text: #1a1918;
  --text-2: #57534c;
  --text-3: #8b867c;
  --ink: #1a1918;
  --on-ink: #ffffff;

  --accent: #ffd43b;   --accent-soft: #fff4c4;  --accent-ink: #6b5200;
  --marker: #ffd43b;
  --live: #2f6feb;     --live-soft: #e8efff;    --live-ink: #1d4fb8;
  --good: #16a34a;     --good-soft: #e2f5e8;    --good-ink: #136b35;
  --warn: #d48806;     --warn-soft: #fff1d4;    --warn-ink: #8a5a00;
  --bad: #dc3d3d;      --bad-soft: #fde8e8;     --bad-ink: #a32a2a;

  --shadow-sm: 0 1px 2px rgba(26, 25, 24, 0.05);
  --shadow: 0 1px 2px rgba(26, 25, 24, 0.04), 0 6px 20px rgba(26, 25, 24, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Fredoka", var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Dark: chosen with the theme switch (data-theme="dark"), or the Mac is dark and Light was not chosen. */
:root[data-theme="dark"] {
    --bg: #121110;
    --surface: #1b1a18;
    --surface-2: #24221f;
    --surface-3: #2e2b27;
    --line: #2d2b27;
    --line-strong: #3d3a34;
    --text: #f3f1ec;
    --text-2: #bbb6ac;
    --text-3: #8b867c;
    --ink: #f3f1ec;
    --on-ink: #121110;

    --accent-soft: rgba(255, 212, 59, 0.14);  --accent-ink: #ffd96a;
    --marker: rgba(255, 212, 59, 0.42);
    --live: #5b8cff;  --live-soft: rgba(91, 140, 255, 0.16);  --live-ink: #a3bdff;
    --good: #3ecf72;  --good-soft: rgba(62, 207, 114, 0.14);  --good-ink: #86e4a8;
    --warn: #f0a52a;  --warn-soft: rgba(240, 165, 42, 0.15);  --warn-ink: #f6c777;
    --bad: #ff6464;   --bad-soft: rgba(255, 100, 100, 0.14);  --bad-ink: #ff9d9d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110;
    --surface: #1b1a18;
    --surface-2: #24221f;
    --surface-3: #2e2b27;
    --line: #2d2b27;
    --line-strong: #3d3a34;
    --text: #f3f1ec;
    --text-2: #bbb6ac;
    --text-3: #8b867c;
    --ink: #f3f1ec;
    --on-ink: #121110;

    --accent-soft: rgba(255, 212, 59, 0.14);  --accent-ink: #ffd96a;
    --marker: rgba(255, 212, 59, 0.42);
    --live: #5b8cff;  --live-soft: rgba(91, 140, 255, 0.16);  --live-ink: #a3bdff;
    --good: #3ecf72;  --good-soft: rgba(62, 207, 114, 0.14);  --good-ink: #86e4a8;
    --warn: #f0a52a;  --warn-soft: rgba(240, 165, 42, 0.15);  --warn-ink: #f6c777;
    --bad: #ff6464;   --bad-soft: rgba(255, 100, 100, 0.14);  --bad-ink: #ff9d9d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img, video, svg { max-width: 100%; }
code, pre { font-family: var(--mono); }
.icon { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; border-radius: 6px; }
.small { font-size: 13px; }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.foot { margin-top: 24px; }

/* ── shell ─────────────────────────────────────────────────────────────────────────────────────────────── */
.shell {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh;
  /* The sidebar's column stays filled however long the page runs. */
  background: linear-gradient(to right, var(--surface) 0 231px, var(--line) 231px 232px, transparent 232px);
}

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px 16px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 22px; text-decoration: none; color: var(--text);
  font: 600 19px/1 var(--display); letter-spacing: -0.01em;
}
.logo-mark { width: 30px; height: 30px; flex: none; display: block; }   /* Superr's mark (SuperrWebsite favicon.svg) */

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--surface-3); color: var(--text); font-weight: 600; }

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-label {
  padding: 0 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3);
}
.line-switch { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 10px; }
.line-switch:hover { background: var(--surface-2); }
.line-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.line-dot.is-paused { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.line-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.line-text strong { font-weight: 600; }
.line-text span { color: var(--text-3); font-size: 12px; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.whoami { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 6px 0 8px; border-top: 1px solid var(--line); }
.avatar-sm {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #1a1918; font-size: 12px; font-weight: 700;
}
.whoami-email { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; }
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 32px; font-size: 14px;
  background: var(--warn-soft); color: var(--warn-ink); border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}
.page { max-width: 1160px; margin: 0 auto; padding: 32px 32px 72px; }

/* ── type + page head ──────────────────────────────────────────────────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.eyebrow { margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.display { font: 600 34px/1.1 var(--display); letter-spacing: -0.01em; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px;
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500;
}
.back:hover { color: var(--text); }

.section { margin-bottom: 30px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2, .panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; line-height: 1.3; }
.more { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.more:hover { color: var(--text); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.count-bad { background: var(--bad); color: #fff; }

.panel {
  min-width: 0; margin-bottom: 18px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-note { font-size: 12.5px; color: var(--text-3); }

/* ── buttons, chips, meters ────────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink); opacity: 0.86; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); opacity: 0.88; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-text { color: var(--bad-ink); }
.btn-danger-text:hover { background: var(--bad-soft); color: var(--bad-ink); }
.btn-link { height: auto; padding: 0; border: 0; background: none; color: var(--text-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { background: none; color: var(--text); }
.btn-lg { height: 42px; padding: 0 18px; border-radius: 12px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.btn-icon { width: 36px; padding: 0; color: var(--text-2); }
.btn-icon:hover { color: var(--text); }
.btn-icon-danger:hover { background: var(--bad-soft); border-color: transparent; color: var(--bad-ink); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.chip-good { background: var(--good-soft); color: var(--good-ink); }
.chip-warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip-bad { background: var(--bad-soft); color: var(--bad-ink); }
.chip-live { background: var(--live-soft); color: var(--live-ink); }
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-link { text-decoration: none; }
.chip-link:hover { background: var(--line); color: var(--text); }

.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live);
  opacity: 0; animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.5); opacity: 0.7; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 4px var(--live-soft); } 50% { box-shadow: 0 0 0 8px var(--live-soft); } }

.meter { display: block; height: 6px; margin: 8px 0 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.meter-warn > span { background: var(--warn); }
.meter-bad > span { background: var(--bad); }

/* ── KPIs ──────────────────────────────────────────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none;
}
.kpi-link { transition: border-color 0.15s, box-shadow 0.15s; }
.kpi-link:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi-value { font: 600 30px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.kpi-hero { font-size: 38px; }
.kpi-note { font-size: 12.5px; color: var(--text-3); }

/* ── needs you ─────────────────────────────────────────────────────────────────────────────────────────── */
.needs { display: flex; flex-direction: column; gap: 10px; }
.need {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--bad) 28%, var(--line));
  border-left: 3px solid var(--bad); border-radius: var(--radius-sm);
}
.need-icon { color: var(--bad); margin-top: 2px; }
.need-body { flex: 1; min-width: 0; }
.need-topic { font-weight: 600; text-decoration: none; }
.need-topic:hover { text-decoration: underline; }
.need-why { margin-top: 3px; font-size: 14px; color: var(--text-2); }
.need-meta { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.need-act { display: flex; align-items: center; gap: 8px; }
.need-act form { margin: 0; }

/* ── production ────────────────────────────────────────────────────────────────────────────────────────── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.prod-grid .prod { height: 100%; background: var(--surface); box-shadow: var(--shadow-sm); }
.idle-bar {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.idle-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--text-2); }
.idle-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.idle-text span { font-size: 13px; color: var(--text-3); }
.team-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.mate {
  min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.mate.is-busy { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); background: color-mix(in srgb, var(--live) 5%, var(--surface)); }
.mate-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mate-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.mate.is-busy .mate-icon { background: var(--live-soft); color: var(--live-ink); }
.mate-name { font-size: 13.5px; font-weight: 650; }
.mate-now {
  font-size: 12px; line-height: 1.35; color: var(--text-3); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
a.mate-now { color: var(--live-ink); font-weight: 500; }
a.mate-now:hover { text-decoration: underline; }
.mate-when { margin-top: 4px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mate.is-busy .mate-when { color: var(--text-2); font-weight: 500; }
.bottom { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.bottom > .panel { margin-bottom: 0; }
.prod-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.prod {
  display: block; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: inherit; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.prod:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.prod.is-working { border-color: color-mix(in srgb, var(--live) 35%, var(--line)); }
.prod-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.prod-topic { font-size: 15px; font-weight: 600; line-height: 1.35; }
.prod-foot { display: flex; align-items: baseline; gap: 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.prod-now { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prod-step { font-size: 13.5px; font-weight: 600; }
.prod-last, .prod-why { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-why { color: var(--warn-ink); }
.prod-facts { flex: none; font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The steps: dots evenly spaced from the left edge to the right edge (the first under the title's first letter), one
   track behind them inked up to the step the job has reached (--reached, 0–1, set by the pipe macro). Each step is a
   zero-width point the dot is centred on, so the spacing never depends on how long a step's name is. */
.pipe {
  --r: 13px; position: relative; list-style: none; margin: 0; padding: 0 var(--r);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.pipe::before, .pipe::after {
  content: ""; position: absolute; top: calc(var(--r) - 1px); left: var(--r); height: 2px; border-radius: 1px;
}
.pipe::before { right: var(--r); background: var(--line); }
.pipe::after { width: calc((100% - 2 * var(--r)) * var(--reached, 0)); background: var(--ink); }
.pipe-step { position: relative; z-index: 1; width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pipe-step:first-child .pipe-name { align-self: flex-start; margin-left: calc(-1 * var(--r)); }
.pipe-step:last-child .pipe-name { align-self: flex-end; margin-right: calc(-1 * var(--r)); }
.pipe-dot {
  position: relative; flex: none; width: calc(2 * var(--r)); height: calc(2 * var(--r)); border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--text-3);
}
.pipe-name { font-size: 11px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.is-done .pipe-dot { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.is-done .pipe-name { color: var(--text-2); }
.is-current .pipe-dot { background: var(--live); border-color: var(--live); color: #fff; animation: breathe 2.2s ease-in-out infinite; }
.is-current .pipe-name { color: var(--live-ink); font-weight: 650; }
.is-stopped .pipe-dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.is-stopped .pipe-name { color: var(--bad-ink); font-weight: 650; }
.is-skipped .pipe-dot { border-style: dashed; opacity: 0.55; }
.is-skipped .pipe-name { text-decoration: line-through; opacity: 0.7; }
.pipe-big { --r: 19px; }
.pipe-big .pipe-name { font-size: 12.5px; }

/* ── team + system ─────────────────────────────────────────────────────────────────────────────────────── */
.sys-icon, .feed-icon {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}

.sys-row { display: flex; gap: 12px; padding: 10px 0; }
.sys-row + .sys-row { border-top: 1px solid var(--line); }
.sys-row:first-of-type { padding-top: 0; }
.sys-icon.is-good { background: var(--good-soft); color: var(--good-ink); }
.sys-icon.is-warn { background: var(--warn-soft); color: var(--warn-ink); }
.sys-icon.is-bad { background: var(--bad-soft); color: var(--bad-ink); }
.sys-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.sys-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sys-note { font-size: 12.5px; color: var(--text-3); }
.sys-bad { color: var(--bad-ink); }
.sys-warn { color: var(--warn-ink); }

/* ── activity feed ─────────────────────────────────────────────────────────────────────────────────────── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item {
  display: flex; align-items: center; gap: 12px; margin: 0 -8px; padding: 8px; border-radius: 10px;
  color: inherit; text-decoration: none; font-size: 13.5px;
}
a.feed-item:hover { background: var(--surface-2); }
.feed li + li { border-top: 1px solid var(--line); }
.feed-icon { width: 26px; height: 26px; border-radius: 8px; }
.feed-item.is-alert .feed-icon { background: var(--bad-soft); color: var(--bad-ink); }
.feed-item.is-alert .feed-msg { color: var(--bad-ink); }
.feed-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.feed-msg, .feed-topic { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-topic { font-size: 12px; color: var(--text-3); }
.feed-times { margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.feed-when { min-width: 72px; text-align: right; font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ── reels ─────────────────────────────────────────────────────────────────────────────────────────────── */
.reel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 24px 18px; }
.reel { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.reel-thumb {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 16px;
  background: var(--surface-3); box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.reel:hover .reel-thumb { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(26, 25, 24, 0.16); }
.reel-thumb img, .reel-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-preview { opacity: 0; transition: opacity 0.2s; }
.reel.is-playing .reel-preview { opacity: 1; }
.reel-blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.reel-status { position: absolute; bottom: 10px; left: 10px; z-index: 2; }
.reel-status .chip { background: rgba(20, 19, 18, 0.74); color: #fff; backdrop-filter: blur(6px); }
.reel-status .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #aaa; }
.reel-status .chip-good::before { background: #3ecf72; }
.reel-status .chip-accent::before { background: #ffd43b; }
.reel-status .chip-warn::before { background: #f0a52a; }
.reel-dur {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; padding: 2px 7px; border-radius: 6px;
  background: rgba(20, 19, 18, 0.74); color: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.reel-play { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; opacity: 0; transition: opacity 0.2s; }
.reel-play .icon { box-sizing: content-box; padding: 14px 13px 14px 15px; border-radius: 50%; background: rgba(20, 19, 18, 0.5); color: #fff; fill: #fff; backdrop-filter: blur(4px); }
.reel:hover .reel-play { opacity: 1; }
.reel.is-playing .reel-play { opacity: 0; }
.reel-title {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reel-meta { margin-top: 2px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tabs {
  display: inline-flex; gap: 2px; max-width: 100%; overflow-x: auto; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; scrollbar-width: none;
}
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.tab span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ── one reel ──────────────────────────────────────────────────────────────────────────────────────────── */
.reel-page { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 44px; align-items: start; }
.reel-stage { position: sticky; top: 24px; }
.phone {
  aspect-ratio: 9 / 16; overflow: hidden; border-radius: 34px; border: 9px solid #141312; background: #000;
  box-shadow: 0 24px 60px rgba(26, 25, 24, 0.22), 0 0 0 1px var(--line);
}
.phone video, .phone img { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.phone-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #8b867c; font-size: 13px; }
.reel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.reel-how { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500;
  color: var(--text-2); text-decoration: none; }
.reel-how:hover { color: var(--text); }
.reel-h { margin-bottom: 16px; font: 600 30px/1.18 var(--display); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 20px; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.actions form { display: contents; }
.caption { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }

.callout { display: flex; gap: 12px; margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.callout .icon { margin-top: 2px; }
.callout > div { min-width: 0; flex: 1; }
.callout-title { font-weight: 650; margin-bottom: 2px; }
.callout-bad { background: var(--bad-soft); color: var(--bad-ink); }
.callout-warn { background: var(--warn-soft); color: var(--warn-ink); }
.callout details.fold { border-color: color-mix(in srgb, currentColor 20%, transparent); }
.callout details.fold > summary { color: inherit; }
.reel-info > .callout { margin: 0 0 18px; }

.verdicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.verdict { display: flex; flex-direction: column; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.verdict-score { font: 600 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.verdict-score small { margin-left: 2px; font-size: 15px; color: var(--text-3); }
.verdict-name { margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.learned {
  margin-bottom: 16px; padding: 10px 14px; font-size: 14px;
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
.learned span { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-ink); }
.scores { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.scores li { display: grid; grid-template-columns: minmax(0, 1fr) 96px 22px; gap: 12px; align-items: center; font-size: 13px; }
.score-line { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.score-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.score-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--good); }
.score-bar > span.is-low { background: var(--warn); }
.score-num { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.notes { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.notes li + li { margin-top: 6px; }
.script { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; font-size: 14.5px; line-height: 1.55; }
.script li::marker { color: var(--text-3); font-weight: 600; }
.sources { list-style: none; margin: 0; padding: 0; }
.sources li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; color: var(--text-3); }
.sources li + li { border-top: 1px solid var(--line); }
.sources .icon { margin-top: 3px; }
.sources a { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none; }
.sources a span { font-size: 14px; font-weight: 500; }
.sources a small { font-size: 12px; color: var(--text-3); }
.sources a:hover span { text-decoration: underline; }

/* ── generate ──────────────────────────────────────────────────────────────────────────────────────────── */
.create { max-width: 720px; margin: 28px auto 44px; text-align: center; }
.create-h { margin-bottom: 10px; font-size: 46px; }
mark {
  padding: 0 0.06em; color: inherit;
  background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
}
.create-sub { max-width: 520px; margin: 0 auto 28px; font-size: 15.5px; color: var(--text-2); }
.create-card {
  padding: 10px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 2px 4px rgba(26, 25, 24, 0.03), 0 14px 44px rgba(26, 25, 24, 0.08);
  transition: border-color 0.15s;
}
.create-card:focus-within { border-color: var(--line-strong); }
.create-card .form-error { margin: 6px 6px 0; }
.create-input {
  width: 100%; padding: 14px 14px 12px; border: 0; outline: none; background: transparent;
  color: var(--text); font: 500 20px/1.4 var(--font);
}
.create-input::placeholder { color: var(--text-3); }
.tpl-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 10px; border: 0; }
.tpl { position: relative; }
.tpl input, .toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tpl span {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer;
}
.tpl input:checked + span { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent-ink); font-weight: 600; }
.tpl input:focus-visible + span, .toggle input:focus-visible + .toggle-track { outline: 2px solid var(--live); outline-offset: 2px; }
.create-notes { padding: 8px 10px 0; }
.create-notes > summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; list-style: none; cursor: pointer;
  color: var(--text-3); font-size: 13px; font-weight: 500;
}
.create-notes > summary::-webkit-details-marker { display: none; }
.create-notes > summary:hover { color: var(--text-2); }
.create-notes textarea { margin-top: 8px; }
.create-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding: 12px 6px 4px 10px; border-top: 1px solid var(--line);
}
.toggle { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; cursor: pointer; }
.toggle-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--surface-3); transition: background 0.15s; }
.toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.toggle input:checked + .toggle-track { background: var(--good); }
.toggle input:checked + .toggle-track::after { transform: translateX(14px); }
.examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; }
.examples > span { font-size: 12.5px; color: var(--text-3); }
.example {
  padding: 5px 12px; border-radius: 99px; border: 1px dashed var(--line-strong); background: transparent;
  color: var(--text-2); font: 500 13px var(--font); cursor: pointer;
}
.example:hover { border-style: solid; background: var(--surface); color: var(--text); }

.create-recent { max-width: 880px; margin: 0 auto; }
.req-list { list-style: none; margin: 0; padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.req-list li + li { border-top: 1px solid var(--line); }
.req { display: flex; align-items: center; gap: 18px; padding: 14px 18px; color: inherit; text-decoration: none; }
.req:hover { background: var(--surface-2); }
.req-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.req-topic { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-meta { font-size: 12.5px; color: var(--text-3); }
.req-why { font-size: 12.5px; color: var(--bad-ink); }
.req .pipe { width: 196px; flex: none; }
.req .pipe-name { display: none; }
.req .pipe { --r: 10px; }
.req .pipe-dot .icon { width: 11px; height: 11px; }

/* ── job ───────────────────────────────────────────────────────────────────────────────────────────────── */
.job-h { margin: 4px 0 6px; font: 600 30px/1.2 var(--display); }
.job-meta { font-size: 13.5px; color: var(--text-3); }
.job-notes {
  display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-2); font-size: 14px; white-space: pre-wrap;
}
.job-notes .icon { margin-top: 3px; }
.status-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.status-act { display: flex; flex-wrap: wrap; gap: 8px; }
.status-act form { margin: 0; }
.status-panel .callout { margin-top: 22px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.shot { position: relative; display: block; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.shot img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.shot > span {
  position: absolute; bottom: 6px; left: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(20, 19, 18, 0.72); color: #fff; font-size: 11px; font-weight: 600;
}
.shot-missing { display: grid; place-items: center; aspect-ratio: 3 / 4; padding: 8px; border-style: dashed; text-align: center; font-size: 12.5px; color: var(--text-3); }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow: auto; }
.tl { display: grid; grid-template-columns: 64px 88px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 0; font-size: 13.5px; }
.tl + .tl { border-top: 1px solid var(--line); }
.tl-time { font: 12px var(--mono); color: var(--text-3); }
.tl-role { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tl-state .tl-role { color: var(--live-ink); }
.tl-msg { white-space: pre-wrap; }
.tl-alert .tl-msg { color: var(--bad-ink); }
details.tl-msg > summary { cursor: pointer; white-space: normal; }
details.tl-msg pre, pre.code, pre.error {
  margin: 10px 0 0; padding: 12px 14px; max-height: 420px; overflow: auto; border-radius: 10px;
  background: var(--surface-2); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
pre.error { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); color: var(--bad-ink); }
.made { display: flex; align-items: center; gap: 22px; }
.made .eyebrow { margin-bottom: 6px; }
.made-thumb { flex: none; width: 150px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 14px; background: #000; }
.made-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.made-body h2 { margin-bottom: 8px; font: 600 21px/1.25 var(--display); }
.made-body p { margin-bottom: 14px; }

details.fold { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
details.fold > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
details.fold > summary:hover { color: var(--text); }
.panel > details.fold:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.fold-panel > summary { display: flex; justify-content: space-between; align-items: center; list-style: none; cursor: pointer; }
.fold-panel > summary::-webkit-details-marker { display: none; }
.fold-panel > summary h2 { font-size: 16px; font-weight: 650; }
.fold-panel > summary::after { content: "Show"; font-size: 13px; color: var(--text-3); }
.fold-panel[open] > summary { margin-bottom: 14px; }
.fold-panel[open] > summary::after { content: "Hide"; }

/* ── usage ─────────────────────────────────────────────────────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.hbar-name { font-weight: 600; }
.hbar-val { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar { height: 8px; margin: 6px 0 4px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.hbar > span { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.hbar-bad > span { background: var(--bad); }
.hbar-note { font-size: 12px; color: var(--text-3); }
.cost-list { list-style: none; margin: 0; padding: 0; }
.cost-list li + li { border-top: 1px solid var(--line); }
.cost-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; color: inherit; text-decoration: none; }
.cost-row:hover { background: var(--surface-2); }
.cost-thumb { flex: none; width: 32px; height: 56px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--surface-3); color: var(--text-3); }
.cost-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cost-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cost-title span { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-title small { font-size: 12px; color: var(--text-3); }
.cost-val { min-width: 64px; text-align: right; font: 600 16px var(--display); font-variant-numeric: tabular-nums; }
.tally { list-style: none; margin: 0; padding: 0; }
.tally li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13.5px; }
.tally li + li { border-top: 1px solid var(--line); }
.tally code { padding: 2px 7px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.tally > li > span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; }
.tally-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.fail-sum { margin-bottom: 14px; font-size: 14px; color: var(--text-2); }
.fail-sum strong { font: 600 22px var(--display); color: var(--text); margin-right: 2px; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.mini-value { font: 600 22px var(--display); font-variant-numeric: tabular-nums; }
.mini-label { font-size: 12.5px; color: var(--text-3); }

svg.chart { display: block; width: 100%; height: auto; margin: 4px 0 8px; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .gridline.baseline { stroke: var(--line-strong); }
.chart .tick { fill: var(--text-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .col { fill: var(--ink); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .col { fill: var(--live); }
.chart .bar-g:hover .hit { fill: var(--surface-2); }
.chart .cap { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .cap-label { fill: var(--bad-ink); font-size: 11px; font-weight: 600; font-family: var(--font); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; overflow-wrap: normal; }
.data th { padding: 6px 10px; border-bottom: 1px solid var(--line-strong); text-align: left; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text-3); }
.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── empty states, forms, dialog, error ────────────────────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; text-align: center; }
.empty-icon { width: 46px; height: 46px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--text-2); }
.empty-title { font-size: 15px; font-weight: 600; }
.empty-text { max-width: 400px; margin-bottom: 10px; font-size: 13.5px; color: var(--text-3); }

.input {
  width: 100%; min-width: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 400 14.5px/1.4 var(--font); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }
.input-sm { width: auto; padding: 6px 10px; font-size: 13.5px; }
textarea.input { resize: vertical; }
[hidden] { display: none !important; }   /* a class's display (.field is flex) must never undo the hidden attribute */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-size: 13.5px; font-weight: 600; }
.form-error {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--bad-soft); color: var(--bad-ink); font-size: 14px; font-weight: 500;
}

.dialog {
  width: min(420px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.dialog::backdrop { background: rgba(20, 18, 15, 0.38); backdrop-filter: blur(2px); }
.dialog h2 { margin-bottom: 6px; font: 600 20px/1.25 var(--display); }
.dialog p { margin-bottom: 16px; font-size: 14.5px; color: var(--text-2); }
.dialog .field { margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.error-page { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 520px; margin: 12vh auto 0; text-align: center; }
.error-page .display { margin-bottom: 18px; font-size: 30px; }

/* ── sign in ───────────────────────────────────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
}
.auth-card {
  width: min(400px, 100%); padding: 32px 28px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 2px 4px rgba(26, 25, 24, 0.03), 0 24px 64px rgba(26, 25, 24, 0.1);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font: 600 18px/1 var(--display); color: var(--text); text-decoration: none; }
.auth-title { margin-bottom: 6px; font: 600 27px/1.2 var(--display); }
.auth-sub { margin-bottom: 22px; font-size: 14.5px; color: var(--text-2); }
.auth-card .input { height: 44px; font-size: 15px; }
.auth-card .btn-primary { width: 100%; height: 44px; margin-top: 4px; font-size: 15px; }
.auth-card .btn-link { display: inline-block; margin-top: 16px; font-size: 13.5px; }

/* ── motion + small screens ────────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1240px) {
  .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .bottom > .panel + .panel { margin-top: 0; }
}
@media (max-width: 860px) {
  .shell { display: block; background: none; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .logo { padding: 0; }
  .logo-text { display: none; }
  /* The pages move to a tab bar along the bottom, like an app. */
  .side-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    flex-direction: row; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .nav-item { flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; color: var(--text-3); }
  .nav-item span { white-space: nowrap; }   /* six tabs on a 360 px phone: a label never breaks mid-word */
  .nav-item:hover { background: none; }
  .nav-item.on { background: none; color: var(--text); }
  .side-foot { flex-direction: row; align-items: center; gap: 6px; margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-label, .whoami-email, .line-text span { display: none; }
  .line-switch { gap: 8px; padding: 3px 3px 3px 10px; border: 1px solid var(--line); }
  .whoami { margin: 0; padding: 0; border: 0; }
  .whoami .avatar-sm { display: none; }
  .page { padding-bottom: 96px; }
  .banner { padding: 10px 16px; }
  .page { padding: 22px 16px 96px; }
  .display { font-size: 28px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .reel-page { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .reel-stage { position: static; width: min(300px, 100%); margin: 0 auto; }
  .reel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .create-h { font-size: 32px; }
  .kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .req { flex-wrap: wrap; }
  .req .pipe { width: 100%; order: 3; }
  .tl { grid-template-columns: 58px minmax(0, 1fr); }
  .tl-role { display: none; }
  .made { flex-direction: column; align-items: flex-start; }
  .need { flex-wrap: wrap; }
  .need-act { width: 100%; justify-content: flex-end; }
  .idle-bar { flex-wrap: wrap; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idle-bar .btn { width: 100%; }
}
@media (max-width: 520px) {
  .pipe:not(.pipe-big) .pipe-name { display: none; }
  .pipe-big { --r: 15px; }
  .pipe-big .pipe-name { display: none; font-size: 11px; }      /* eight names don't fit a phone: the one it is on */
  .pipe-big .is-current .pipe-name, .pipe-big .is-stopped .pipe-name { display: block; }
  .kpi-value { font-size: 26px; }
  .kpi-hero { font-size: 32px; }
  .feed-when { min-width: 0; }
}

/* ── schedules and accounts ─────────────────────────────────────────────────────────────────────────────── */
.callout-good { background: var(--good-soft); color: var(--good-ink); }
.avatar { position: relative; flex: none; display: inline-grid; width: 22px; height: 22px; }
.avatar img, .avatar .avatar-letter { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar img { border: 1px solid var(--line); background: var(--surface); }
.avatar-letter { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font: 600 11px/1 var(--display); }
.av-22 { width: 22px; height: 22px; }
.av-40 { width: 40px; height: 40px; }
.av-40 .avatar-letter { font-size: 17px; }
.av-52 { width: 52px; height: 52px; }
.av-52 .avatar-letter { font-size: 22px; }
.avatar-badge {
  position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 7px; background: var(--surface); box-shadow: 0 0 0 1.5px var(--surface), var(--shadow-sm);
}
/* Platform marks (Simple Icons, CC0 — static/brand/README.md), drawn through a mask so they take a colour. */
.brand { display: inline-block; flex: none; vertical-align: -2px; background: currentColor;
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
.brand-instagram { --mark: url("/static/brand/instagram.svg");
  background: linear-gradient(45deg, #f58529 10%, #dd2a7b 50%, #8134af 75%, #515bd4 100%); }
.brand-tiktok { --mark: url("/static/brand/tiktok.svg"); }
.brand-youtube { --mark: url("/static/brand/youtube.svg"); }
.soon .brand, .soon-card .brand { opacity: 0.7; }
.acct-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 4px; border-radius: 99px;
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
}


/* the list */
.sched-list { display: flex; flex-direction: column; gap: 16px; }
.sched-card {
  display: flex; flex-direction: column; gap: 18px; padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.sched-card.is-paused { background: var(--surface-2); box-shadow: none; }
.sched-card.is-paused .stat-value, .sched-card.is-paused .strip { opacity: 0.55; }
.sched-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sched-id { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.sched-icon {
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.sched-card.is-paused .sched-icon { background: var(--surface-3); color: var(--text-3); }
.sched-card.is-paused .strip-bar, .sched-card.is-paused .stat { background: var(--surface-3); }
.sched-card.is-paused .stat-hero { color: var(--text-2); }
.sched-card.is-paused .stat-hero .stat-label, .sched-card.is-paused .stat-hero .stat-note { color: var(--text-3); }
.sched-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sched-name { font: 600 20px/1.2 var(--display); }
.sched-id:hover .sched-name { text-decoration: underline; text-underline-offset: 3px; }
.sched-sub { font-size: 13.5px; color: var(--text-3); }
.sched-stats { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.stat-hero { background: var(--ink); color: var(--on-ink); }
.stat-hero .stat-label, .stat-hero .stat-note { color: color-mix(in srgb, var(--on-ink) 70%, transparent); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.stat-value { font: 600 28px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.stat-value-sm { display: block; font: 600 22px/1.2 var(--display); }
.stat-note { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.sched-accounts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.sched-note { margin-top: 14px; }
.sched-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 620px; margin: 9vh auto 0; text-align: center; }
.sched-hero-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 4px;
}

/* the on/off switch (a real button: one press, one change) */
.switch {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px 0 8px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 600 13.5px var(--font); cursor: pointer;
}
.switch .switch-track { position: relative; width: 36px; height: 22px; border-radius: 99px; background: var(--surface-3); transition: background 0.15s; }
.switch .switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s;
}
.switch.is-on { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.switch.is-on .switch-track { background: var(--good); }
.switch.is-on .switch-track::after { transform: translateX(14px); }

/* the day strip */
.strip { display: flex; flex-direction: column; gap: 8px; }
.strip-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.strip-label { font-weight: 600; color: var(--text-2); }
.strip-times { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.strip-bar { position: relative; height: 30px; border-radius: 10px; background: var(--surface-2); }
.strip-window {
  position: absolute; top: 0; bottom: 0; border-radius: 10px;
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 6px, color-mix(in srgb, var(--accent) 22%, var(--surface)) 6px 12px);
}
.strip-dot {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 2.5px solid var(--ink); box-sizing: border-box;
}
.strip-dot.is-posted { background: var(--good); border-color: var(--good); }
.strip-dot.is-planned { background: var(--ink); }
.strip-dot.is-missed { border-color: var(--text-3); border-style: dashed; opacity: 0.7; }
.strip-now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--live); }
.strip-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* the form */
.sched-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sched-steps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step { padding: 20px 22px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step-head h2 { flex: 1; font: 600 18px/1.2 var(--display); }
.step-n {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); font: 600 14px/1 var(--display);
}
.input-lg { padding: 12px 14px; font-size: 16px; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field legend { padding: 0 0 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + span { outline: 2px solid var(--live); outline-offset: 1px; }
.seg input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.seg-sm span { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.topic-list, .end-date { display: none; margin-top: 10px; }
.sched-form:has(input[name="topics"][value="list"]:checked) .topic-list { display: block; }
.sched-form:has(input[name="end"][value="date"]:checked) .end-date { display: block; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pick {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface); cursor: pointer;
}
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 14.5px; }
.pick-main .small, .acct-card-titles .small { display: inline-flex; align-items: center; gap: 5px; }
.pick-check {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); color: transparent;
}
.pick:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px var(--surface-3); }
.pick:has(input:checked) .pick-check { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pick:has(input:focus-visible) { outline: 2px solid var(--live); outline-offset: 2px; }
.pick.is-off { opacity: 0.55; cursor: not-allowed; border-style: dashed; }
.soon-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.soon { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px dashed var(--line-strong); color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.when-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.row-inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 400; }
.stepper { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 4px; border: 1px solid var(--line-strong); border-radius: 14px; }
.stepper .icon-btn { width: 36px; height: 36px; border: 0; background: var(--surface-2); border-radius: 10px; }
.stepper-value {
  width: 52px; border: 0; background: transparent; text-align: center; color: var(--text);
  font: 600 22px/1 var(--display); -moz-appearance: textfield;
}
.stepper-value::-webkit-outer-spin-button, .stepper-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sched-summary {
  position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 2px 4px rgba(26, 25, 24, 0.03), 0 14px 44px rgba(26, 25, 24, 0.08);
}
.summary-line { font: 600 19px/1.35 var(--display); }
.summary-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; }
.summary-list dt { color: var(--text-3); }
.summary-list dd { margin: 0; font-weight: 600; text-align: right; }
.btn-block { width: 100%; justify-content: center; }

/* accounts */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; margin-bottom: 32px; }
.acct-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.acct-card.needs-login { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.acct-card-top { display: flex; align-items: center; gap: 14px; }
.acct-card-titles { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.acct-card-handle { font: 600 19px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; }

.acct-card-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.acct-card-stats > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.login-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--warn-soft); color: var(--warn-ink); }
.cmd { display: flex; align-items: center; gap: 8px; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--text); font: 12px var(--mono); }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.soon-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--text-2); }
.soon-card .sched-icon { background: var(--surface-2); color: var(--text-3); }
.soon-card .sched-name { font-size: 16px; }

@media (max-width: 980px) {
  .sched-form { grid-template-columns: minmax(0, 1fr); }
  .sched-summary { position: static; }
}
@media (max-width: 640px) {
  .sched-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-hero { grid-column: 1 / -1; }
  .when-grid { grid-template-columns: minmax(0, 1fr); }
  .sched-card, .step { padding: 16px; }
    .seg { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .seg span { justify-content: center; width: 100%; }
}

/* Usage: the time range, opposite the heading */
.range-pick {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); color: var(--text-2);
}
.range-pick select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--text);
  font: 600 14.5px var(--font); padding: 0 28px 0 2px; height: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 18px, calc(100% - 9px) 18px; background-size: 5px 5px; background-repeat: no-repeat;
}
.range-pick select:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; border-radius: 8px; }

/* The theme switch, in the sidebar footer: System · Light · Dark */
.theme-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }   /* apart from the automation switches */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); width: 100%; }
.theme-pick button {
  width: 100%; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-3);
}
.theme-pick button:hover { color: var(--text); }
.theme-pick button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-sm); }   /* clear in both themes */
.theme-pick button:focus-visible { outline: 2px solid var(--live); outline-offset: 1px; }
@media (max-width: 760px) { .theme-row { margin: 0; padding: 0; border: 0; } .theme-pick { width: auto; grid-template-columns: repeat(3, 32px); } }
