:root {
  --bg: #0c0c0f;
  --sunk: #08080a;
  --surface: #131317;
  --raised: #1a1a20;
  --hover: #212128;
  --line: #24242c;
  --line-2: #33333d;
  --text: #efeff1;
  --soft: #c2c2cb;
  --muted: #8d8d98;
  --faint: #5f5f6a;

  --twitch: #9146ff;
  --twitch-hi: #b085ff;
  --twitch-wash: rgba(145, 70, 255, 0.14);
  --youtube: #ff0033;
  --youtube-hi: #ff5370;
  --youtube-wash: rgba(255, 0, 51, 0.13);

  --ok: #3fd18b;
  --ok-wash: rgba(63, 209, 139, 0.12);
  --warn: #f3b23e;
  --warn-wash: rgba(243, 178, 62, 0.12);
  --bad: #ff7b4a;
  --bad-wash: rgba(255, 123, 74, 0.12);

  --both-stripe: linear-gradient(180deg, var(--twitch) 0 50%, var(--youtube) 50% 100%);
  --both-band: linear-gradient(90deg, var(--twitch) 0 50%, var(--youtube) 50% 100%);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 6px;
  --r-sm: 4px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
::selection { background: var(--twitch); color: #fff; }

:focus-visible {
  outline: 2px solid var(--twitch-hi);
  outline-offset: 2px;
}

/* ── Type helpers ─────────────────────────────────────── */

.label {
  font-stretch: 75%;
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  font-stretch: 118%;
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
code, .mono {
  font-family: var(--mono);
  font-stretch: 85%;
  font-size: 0.8em;
}
code {
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0.05rem 0.32rem;
  color: var(--text);
  white-space: nowrap;
}

/* ── Brand + top bar ──────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 12, 15, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-stretch: 112%;
  font-weight: 760;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; }
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.92rem;
}
.topbar-nav a { color: var(--soft); text-decoration: none; white-space: nowrap; }
.topbar-nav a:hover { color: var(--text); }
.topbar-nav .btn { color: var(--text); }

.who {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--text);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line-2);
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  overflow: hidden;
  object-fit: cover;
}

.plan {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.plan-premium {
  color: var(--twitch-hi);
  border-color: rgba(145, 70, 255, 0.45);
  background: var(--twitch-wash);
}

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--text);
  color: #0c0c0f;
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { background: #ffffff; }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-lg { min-height: 48px; padding: 0 1.25rem; font-size: 1rem; }
.btn-sm { min-height: 32px; padding: 0 0.7rem; font-size: 0.84rem; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--hover); border-color: #44444f; }

.btn-twitch { background: var(--twitch); color: #fff; }
.btn-twitch:hover { background: #a065ff; }
.btn-youtube { background: var(--youtube); color: #fff; }
.btn-youtube:hover { background: #ff2a52; }

.btn-quiet {
  background: transparent;
  border: 0;
  min-height: 28px;
  padding: 0 0.35rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.84rem;
}
.btn-quiet:hover { background: transparent; color: var(--bad); text-decoration: underline; }

.btn[disabled], .btn.is-locked {
  background: transparent;
  color: var(--faint);
  border-color: var(--line);
  cursor: not-allowed;
}
.btn.is-locked { cursor: pointer; }
.btn.is-locked:hover { color: var(--soft); border-color: var(--line-2); }

/* ── Platform marks ───────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  background: var(--raised);
  color: var(--soft);
}
.pill svg { width: 13px; height: 13px; }
.pill-twitch { background: var(--twitch-wash); color: var(--twitch-hi); }
.pill-youtube { background: var(--youtube-wash); color: var(--youtube-hi); }
.pills { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }

.glyph {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--soft);
}
.glyph svg { width: 18px; height: 18px; }
.glyph-twitch { background: var(--twitch); border-color: var(--twitch); color: #fff; }
.glyph-youtube { background: var(--youtube); border-color: var(--youtube); color: #fff; }
.glyph.is-off { background: var(--raised); border-color: var(--line-2); color: var(--muted); }

/* ── Status (tally lights) ────────────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-stretch: 80%;
  font-weight: 650;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--faint);
}
.status-ready::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--soft); }
.status-ok { color: var(--ok); }
.status-ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); }
.status-idle { color: var(--muted); }
.status-warn { color: var(--warn); }
.status-warn::before { background: var(--warn); }
.status-bad { color: var(--bad); }
.status-bad::before { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash); }

/* ── Alerts ───────────────────────────────────────────── */

.alert {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.75rem 0.95rem;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  margin: 0 0 1rem;
  font-size: 0.93rem;
}
.alert::before {
  content: "";
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--soft);
  flex-shrink: 0;
}
.alert-ok::before { background: var(--ok); }
.alert-bad::before { background: var(--bad); }
.alert-bad { border-color: rgba(255, 123, 74, 0.35); }
.alert strong { font-weight: 650; }
.alert-body > div + div { margin-top: 0.3rem; }

/* ── Layout shell ─────────────────────────────────────── */

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.card-head h2 {
  margin: 0;
  font-stretch: 112%;
  font-weight: 720;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.card-body { padding: 1rem 1.1rem 1.15rem; }
.card-note { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.9rem; }

/* ── Dashboard: deck ──────────────────────────────────── */

.deck {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.ondeck {
  position: relative;
  padding: 1.25rem 1.35rem 1.1rem;
  overflow: hidden;
}
.ondeck::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--line-2);
}
.ondeck.dest-twitch::before { background: var(--twitch); }
.ondeck.dest-youtube::before { background: var(--youtube); }
.ondeck.dest-both::before { background: var(--both-stripe); }
.ondeck-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.ondeck-title {
  margin: 0.55rem 0 0.4rem;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  overflow-wrap: anywhere;
}
.ondeck-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  color: var(--soft);
  font-size: 0.93rem;
}
.ondeck-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.countdown { text-align: right; flex-shrink: 0; }
.countdown-value {
  display: block;
  font-family: var(--mono);
  font-stretch: 80%;
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.countdown-value small { font-size: 0.55em; color: var(--muted); margin: 0 0.4em 0 0.08em; }
.countdown-value small:last-child { margin-right: 0; }
.ondeck-empty { color: var(--soft); margin: 0.6rem 0 0; max-width: 34rem; }

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 1.2rem;
}
.week-day {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.5rem 0.5rem;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-day.is-today { border-color: var(--line-2); background: var(--raised); }
.week-day .label { font-size: 0.7rem; display: flex; justify-content: space-between; }
.week-day.is-today .label { color: var(--text); }
.week-slot {
  height: 6px;
  border-radius: 2px;
  background: var(--soft);
}
.week-slot.dest-twitch { background: var(--twitch); }
.week-slot.dest-youtube { background: var(--youtube); }
.week-slot.dest-both { background: var(--both-band); }
.week-more { font-size: 0.7rem; color: var(--muted); }

.controls { padding: 1.15rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.controls-row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.facts { display: grid; gap: 0.55rem; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 0.4rem; }
.meter i { width: 14px; height: 6px; border-radius: 1px; background: var(--line-2); }
.meter i.on { background: var(--text); }
.controls-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: auto; }
.controls-actions form { display: contents; }
.upsell { font-size: 0.85rem; color: var(--muted); margin: 0; }
.upsell a { color: var(--twitch-hi); }

/* ── Dashboard: signal chain ──────────────────────────── */

.chain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) 40px minmax(0, 1.1fr);
  align-items: stretch;
  margin-bottom: 1.5rem;
}
.node {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.8rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.node.needs { border-style: dashed; border-color: var(--line-2); }
.node-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.node-value { font-weight: 650; font-size: 0.95rem; overflow-wrap: anywhere; }
.node-value.dim { color: var(--muted); font-weight: 500; }
.node a.node-link { font-size: 0.84rem; color: var(--soft); }
.node a.node-link:hover { color: var(--text); }
.node-outs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.node-out {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 28px;
  padding: 0 0.6rem 0 0.4rem;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.node-out svg { width: 14px; height: 14px; }
.node-out.on-twitch { background: var(--twitch-wash); border-color: rgba(145, 70, 255, 0.5); color: var(--twitch-hi); }
.node-out.on-youtube { background: var(--youtube-wash); border-color: rgba(255, 0, 51, 0.45); color: var(--youtube-hi); }
a.node-out:hover { color: var(--text); border-color: #4a4a55; }
.wire {
  position: relative;
  align-self: center;
  height: 2px;
  margin: 0 4px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 5px, transparent 5px 9px);
}
.wire::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--line-2);
  border-right: 2px solid var(--line-2);
  transform: translateY(-50%) rotate(45deg);
}
.wire.live { background: var(--soft); }
.wire.live::after { border-color: var(--soft); }

/* ── Dashboard: main grid ─────────────────────────────── */

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.side { display: flex; flex-direction: column; gap: 1rem; }

.tally { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line); }
.tally span { font-size: 0.85rem; color: var(--muted); }
.tally b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 0.2rem; }

.notes { margin: 0; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line); list-style: none; display: grid; gap: 0.35rem; }
.notes li { position: relative; padding-left: 1rem; font-size: 0.88rem; color: var(--soft); }
.notes li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 1px; background: var(--warn); }
.errors { margin: 0.9rem 1.1rem 0; }

.day-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem 0.4rem;
}
.day-head .label { color: var(--text); }
.day-head .rel { font-size: 0.8rem; color: var(--muted); }
.slot {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: center;
  margin: 0 0.6rem;
  padding: 0.75rem 0.6rem 0.75rem 0.95rem;
  border-radius: var(--r-sm);
}
.slot + .slot { border-top: 1px solid var(--line); }
.slot:hover { background: var(--raised); }
.slot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 3px;
  border-radius: 2px;
  background: var(--line-2);
}
.slot.dest-twitch::before { background: var(--twitch); }
.slot.dest-youtube::before { background: var(--youtube); }
.slot.dest-both::before { background: var(--both-stripe); }
.slot.is-muted { opacity: 0.6; }
.slot-time { line-height: 1.1; }
.slot-time b {
  display: block;
  font-stretch: 78%;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.slot-time span { font-stretch: 78%; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.slot-title { font-weight: 650; overflow-wrap: anywhere; }
.slot-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; color: var(--muted); font-size: 0.83rem; margin-top: 0.1rem; }
.slot-meta .game { color: var(--soft); }
.slot-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.rundown-foot { padding: 0.9rem 1.1rem 1rem; }

.empty-state {
  padding: 2.2rem 1.5rem 2.4rem;
  text-align: center;
  color: var(--soft);
}
.empty-state h3 { margin: 0 0 0.35rem; font-stretch: 112%; font-weight: 720; font-size: 1.1rem; color: var(--text); }
.empty-state p { margin: 0 auto; max-width: 30rem; font-size: 0.92rem; }
.empty-art { display: flex; justify-content: center; gap: 4px; margin-bottom: 1.1rem; }
.empty-art i { width: 26px; height: 8px; border-radius: 2px; background: var(--line-2); }
.empty-art i:nth-child(2) { background: var(--twitch); width: 40px; }
.empty-art i:nth-child(4) { background: var(--youtube); width: 34px; }

/* ── Connections ──────────────────────────────────────── */

.conn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.1rem;
}
.conn + .conn { border-top: 1px solid var(--line); }
.conn-text { flex: 1; min-width: 0; }
.conn-text strong { display: block; font-weight: 650; font-size: 0.95rem; }
.conn-text small { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.conn-act { display: flex; align-items: center; gap: 0.2rem; flex-shrink: 0; }
.conn-act form { margin: 0; }
.conn-stack { flex-direction: column; align-items: flex-end; gap: 0.05rem; }
.conn-stack .btn-quiet { min-height: 0; padding: 0; line-height: 1.2; }
.on-air {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-stretch: 80%;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ok);
}
.on-air::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); }

details.drawer { border-top: 1px solid var(--line); }
details.drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--soft);
  display: flex;
  justify-content: space-between;
}
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer > summary::after { content: "+"; color: var(--muted); font-weight: 500; }
details.drawer[open] > summary::after { content: "–"; }
details.drawer > summary:hover { color: var(--text); }
.drawer-body { padding: 0 1.1rem 1.1rem; }

/* ── Forms ────────────────────────────────────────────── */

.field { display: block; margin: 0 0 1rem; }
.fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 0.45rem; }
.field > .label { display: block; margin-bottom: 0.45rem; }
.hint { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.35rem; }
.hint a { color: var(--soft); }
input[type="text"], input[type="url"], input[type="password"], select {
  width: 100%;
  height: 40px;
  background: var(--sunk);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 0 0.7rem;
  font-size: 0.92rem;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--twitch); outline: none; box-shadow: 0 0 0 3px var(--twitch-wash); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.chip span::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid var(--faint);
}
.chip input:checked + span { color: var(--text); border-color: var(--soft); background: var(--raised); }
.chip input:checked + span::before { background: var(--text); border-color: var(--text); box-shadow: inset 0 0 0 2px var(--raised); }
.chip input:focus-visible + span { outline: 2px solid var(--twitch-hi); outline-offset: 2px; }

.options { display: grid; gap: 0.4rem; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; }
.option-box {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 0.15rem 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.option-box::before {
  content: "";
  grid-row: span 2;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
}
.option-box b { font-weight: 650; font-size: 0.92rem; }
.option-box small { color: var(--muted); font-size: 0.82rem; grid-column: 2; }
.option input:checked + .option-box { border-color: var(--soft); background: var(--raised); }
.option input:checked + .option-box::before { border-color: var(--text); background: radial-gradient(circle, var(--text) 0 4px, transparent 4.5px); }
.option input:focus-visible + .option-box { outline: 2px solid var(--twitch-hi); outline-offset: 2px; }

.switch { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; margin: 0 0 1rem; }
.switch input { position: absolute; opacity: 0; }
.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--line-2);
  transition: background-color 0.15s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--soft);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--twitch); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--twitch-hi); outline-offset: 2px; }
.switch-text b { display: block; font-weight: 650; font-size: 0.92rem; }
.switch-text small { color: var(--muted); font-size: 0.82rem; }

.form-foot { display: flex; justify-content: flex-end; }

.cheats { display: grid; gap: 0.7rem; margin: 0; }
.cheats div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.6rem; font-size: 0.87rem; }
.cheats dt { color: var(--muted); }
.cheats dd { margin: 0; color: var(--soft); }

/* ── Landing ──────────────────────────────────────────── */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
  gap: 3.5rem;
  align-items: center;
}
.hero h1 {
  margin: 1rem 0 1.15rem;
  font-size: clamp(2.4rem, 4.6vw, 3.55rem);
}
.hero h1 .tw { color: var(--twitch-hi); }
.hero h1 .yt { color: var(--youtube-hi); }
.lede { font-size: 1.12rem; color: var(--soft); max-width: 33rem; margin: 0 0 1.8rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.fine { color: var(--muted); font-size: 0.86rem; margin: 1rem 0 0; max-width: 32rem; }
.label-twitch { color: var(--twitch-hi); }
.eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; }
.eyebrow i { width: 18px; height: 6px; border-radius: 1px; background: var(--both-band); }

.guide {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.guide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}
.guide-head strong { font-stretch: 112%; font-weight: 720; font-size: 0.98rem; }
.legend { display: flex; gap: 0.9rem; font-size: 0.78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.legend .l-tw { background: var(--twitch); }
.legend .l-yt { background: var(--youtube); }
.legend .l-both { background: var(--both-band); }
.guide-grid {
  display: grid;
  grid-template-columns: 44px repeat(7, minmax(0, 1fr));
  position: relative;
}
.guide-col {
  position: relative;
  height: 340px;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px 25%);
}
.guide-col.is-today { background-color: rgba(255, 255, 255, 0.03); }
.guide-day {
  grid-column: span 1;
  padding: 0.5rem 0.45rem;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.guide-day b { display: block; font-size: 1.05rem; color: var(--text); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.guide-day.is-today b { color: var(--twitch-hi); }
.guide-corner { border-bottom: 1px solid var(--line); }
.guide-hours { position: relative; height: 340px; }
.guide-hours span {
  position: absolute;
  right: 6px;
  margin-top: 4px;
  font-family: var(--mono);
  font-stretch: 75%;
  font-size: 0.6rem;
  color: var(--faint);
  white-space: nowrap;
}
.block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 3px;
  padding: 0.3rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 650;
  color: #fff;
  overflow: hidden;
}
.block small { display: block; font-weight: 500; opacity: 0.8; }
.block-tw { background: var(--twitch); }
.block-yt { background: var(--youtube); }
.block-both { background: linear-gradient(90deg, var(--twitch) 0 50%, var(--youtube) 50% 100%); }
.guide-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  z-index: 2;
}
.guide-now::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
}
.guide-foot {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.band { border-top: 1px solid var(--line); }
.band-inner { max-width: var(--max); margin: 0 auto; padding: 4rem 1.25rem; }
.band-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.band-head h2 { margin: 0.6rem 0 0; font-size: clamp(1.8rem, 3.2vw, 2.5rem); max-width: 30rem; }
.band-head p { margin: 0; color: var(--soft); max-width: 26rem; }

.ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.way { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.way h3 { margin: 0; font-size: 0.98rem; font-weight: 700; }
.way p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.event {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.7rem;
  font-size: 0.86rem;
}
.event-k { display: block; font-stretch: 75%; font-weight: 650; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.2rem; }
.event mark { background: none; color: var(--twitch-hi); font-weight: 700; }
.event mark.yt { color: var(--youtube-hi); }
.swatches { display: flex; flex-direction: column; gap: 0.35rem; }
.swatches span { display: flex; align-items: center; gap: 0.45rem; }
.swatches i { width: 12px; height: 12px; border-radius: 50%; }
.way-out { margin-top: auto; display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); }

.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.flow-step { padding: 1.4rem 1.3rem; background: var(--surface); }
.flow-step + .flow-step { border-left: 1px solid var(--line); }
.flow-step .num { font-family: var(--mono); font-stretch: 75%; font-size: 0.78rem; color: var(--faint); }
.flow-step h3 { margin: 0.6rem 0 0.4rem; font-stretch: 112%; font-weight: 720; font-size: 1.15rem; }
.flow-step p { margin: 0; color: var(--soft); font-size: 0.92rem; }
.diff { margin-top: 1rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.diff .bar { height: 8px; border-radius: 2px; width: 42px; background: var(--line-2); }
.diff .bar.tw { background: var(--twitch); }
.diff .bar.both { background: var(--both-band); }
.diff .bar.ghost { background: transparent; border: 1.5px dashed var(--faint); height: 10px; }
.diff .bar.moved { width: 64px; margin-left: 12px; }
.diff .arrow { color: var(--faint); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.plan-card { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; }
.plan-card.featured { border-color: rgba(145, 70, 255, 0.55); box-shadow: inset 0 3px 0 var(--twitch); }
.plan-card h3 { margin: 0.6rem 0 0.25rem; font-stretch: 118%; font-weight: 760; font-size: 1.6rem; letter-spacing: -0.02em; }
.plan-card > p { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.9rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: 0.55rem; }
.ticks li { position: relative; padding-left: 1.5rem; font-size: 0.93rem; color: var(--soft); }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.35em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(-45deg);
}
.featured .ticks li::before { border-color: var(--twitch-hi); }
.plan-card .btn { margin-top: auto; align-self: flex-start; }

.closing { text-align: center; }
.closing h2 { margin: 0.6rem auto 1.4rem; font-size: clamp(1.8rem, 3.2vw, 2.5rem); max-width: 34rem; }
.closing .cta { justify-content: center; }

/* ── Footer ───────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer nav { display: flex; gap: 1.25rem; }
.footer a { color: var(--soft); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ── Legal pages ──────────────────────────────────────── */

.legal .container { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.legal .back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.legal .back-link:hover { color: var(--text); }
.legal h1 { font-stretch: 118%; font-weight: 760; letter-spacing: -0.025em; font-size: 2.6rem; line-height: 1.05; margin: 1.5rem 0 1rem; }
.legal h2 { font-stretch: 112%; font-weight: 720; font-size: 1.25rem; margin: 2.4rem 0 0.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.legal h3 { font-size: 1rem; font-weight: 650; margin: 1.3rem 0 0.4rem; }
.legal p, .legal li { color: var(--soft); }
.legal li { margin: 0.25rem 0; }
.legal strong { color: var(--text); font-weight: 650; }
.legal a { color: var(--twitch-hi); }
.legal .contact-info {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.legal .footer { margin-top: 2.5rem; padding-top: 1rem; color: var(--muted); font-size: 0.88rem; }
.legal .footer a { color: var(--soft); }

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 1000px) {
  .ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 2.5rem; }
  .deck, .board { grid-template-columns: 1fr; }
  .chain { grid-template-columns: 1fr; gap: 0; }
  .wire { width: 2px; height: 18px; margin: 0 0 0 1.4rem; background: repeating-linear-gradient(180deg, var(--line-2) 0 4px, transparent 4px 7px); }
  .wire.live { background: var(--soft); }
  .wire::after { display: none; }
  .flow { grid-template-columns: 1fr; }
  .flow-step + .flow-step { border-left: 0; border-top: 1px solid var(--line); }
  .band-head { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .topbar-nav .hide-sm { display: none; }
  .ways, .plans { grid-template-columns: 1fr; }
  .slot { grid-template-columns: 62px minmax(0, 1fr); }
  .slot-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
  .ondeck-top { flex-direction: column; }
  .countdown { text-align: left; }
  .week-day { min-height: 54px; padding: 0.35rem; }
  .week-day .label span:last-child { display: none; }
  .guide-col, .guide-hours { height: 240px; }
  .block span, .block small { display: none; }
  .cta .btn { flex: 1 1 100%; }
  .controls-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Settings tabs ────────────────────────────────────── */

.tabs { scroll-margin-top: 76px; }
.tablist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.tabs:not(.is-ready) .tablist { display: none; }
.tab {
  position: relative;
  height: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 0.4rem;
  vertical-align: 2px;
  border-radius: 50%;
  background: var(--warn);
}
.tabpanel { display: flex; flex-direction: column; gap: 1rem; }
.tabpanel[hidden] { display: none; }

/* ── Toasts ───────────────────────────────────────────── */

.toasts {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(460px, calc(100vw - 2rem));
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  margin: 0;
  align-items: center;
  background: var(--raised);
  border-color: var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast .alert-body { flex: 1; }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); }
.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
}
.toast-close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ── Setup step tints ─────────────────────────────────── */

.node-cal { background: #17181d; }
.node-filter { background: #111114; border-color: #202027; }
.node-out-step {
  background:
    linear-gradient(100deg, rgba(145, 70, 255, 0.09), rgba(255, 0, 51, 0.07)),
    var(--surface);
}
.node.needs { background: transparent; }
