/* ============================================================
   AbobaClips — Redesign (overrides legacy style.css)
   Based on the design handoff:
     - sidebar + topbar shell
     - oklch purple accent + warm hot color
     - Live-Now hero, channel cards w/ sparkline
     - clip library w/ filter chips + mini-waveform
     - clip detail w/ waveform scrub + synced chat
     - settings tabs + threshold viz + emote weights + schedule heatmap
     - compilation builder 3-column
     - landing / auth / pricing / checkout
   ============================================================ */

:root {
  /* Surfaces */
  --bg-0: #0e0c12;
  --bg-1: #16131c;
  --bg-2: #1d1a26;
  --bg-3: #262232;
  --bg-4: #322c42;

  /* Text */
  --text-0: #f4f0ff;
  --text-1: #cfc7e0;
  --text-2: #948aac;
  --text-3: #635a78;

  /* Accent */
  --accent: oklch(0.72 0.18 295);
  --accent-soft: oklch(0.72 0.18 295 / 0.18);
  --accent-line: oklch(0.72 0.18 295 / 0.4);
  --accent-hi: oklch(0.84 0.14 295);

  /* Hot / good / warn */
  --hot: oklch(0.74 0.17 30);
  --hot-soft: oklch(0.74 0.17 30 / 0.18);
  --good: oklch(0.78 0.14 155);
  --good-soft: oklch(0.78 0.14 155 / 0.18);
  --warn: oklch(0.82 0.15 85);

  --hair: rgba(244, 240, 255, 0.07);
  --hair-2: rgba(244, 240, 255, 0.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter", -apple-system, sans-serif;

  /* Bridge to legacy variable names so old components keep working */
  --bg: var(--bg-0);
  --bg-card: var(--bg-1);
  --bg-card-solid: var(--bg-1);
  --bg-input: var(--bg-2);
  --bg-hover: var(--bg-3);
  --border: var(--hair);
  --border-hover: var(--hair-2);
  --text: var(--text-0);
  --text-muted: var(--text-2);
  --accent-hover: var(--accent-hi);
  --accent-glow: var(--accent-soft);
  --success: var(--good);
  --success-glow: var(--good-soft);
  --danger: var(--hot);
  --danger-glow: var(--hot-soft);
  --warning: var(--warn);
  --warning-glow: oklch(0.82 0.15 85 / 0.2);
  --laugh-bar: var(--accent);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius-xs: 5px;
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: 0px;
  --glass-border: 1px solid var(--hair);
  --font: var(--sans);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0) !important;
  color: var(--text-0);
  overflow-x: clip;
}

body {
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

/* Kill the legacy ambient gradient and old navbar — we use our own shell */
body::before { display: none !important; }

a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: var(--text-0); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-0);
  display: grid;
  grid-template-columns: 224px 1fr;
  font-size: 14px;
}

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--hair);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  text-decoration: none;
  color: var(--text-0);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, var(--accent-hi), var(--accent) 70%);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  background: var(--bg-1);
  clip-path: polygon(20% 0, 100% 50%, 20% 100%);
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.nav-section {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-0); }
.nav-item.active {
  background: var(--bg-2);
  color: var(--text-0);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item .ico {
  width: 14px;
  height: 14px;
  opacity: 0.8;
  flex-shrink: 0;
}
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px var(--good-soft);
}
.sidebar-footer .meta {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.3;
}
.sidebar-footer .meta b { color: var(--text-1); font-weight: 600; }

/* Main column */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 18px;
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 9;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
}
.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.crumbs a:hover { color: var(--text-0); }
.crumbs .sep { color: var(--text-3); }
.crumbs .now { color: var(--text-0); font-weight: 600; }

.topbar-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  width: 280px;
  color: var(--text-2);
  font-size: 13px;
}
.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  flex: 1;
  color: var(--text-0);
  font-size: 13px;
  font-family: inherit;
}
.topbar-search kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-3);
}
.topbar-search { position: relative; }
.topbar-search.open { border-color: var(--accent-line); }
.topbar-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7);
  max-height: 420px;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.ts-section {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding: 8px 10px 4px;
}
.ts-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-1);
  font-size: 13px;
}
.ts-item:hover {
  background: var(--bg-3);
  color: var(--text-0);
}
.ts-item .ts-icon {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  color: var(--accent-hi);
  font-size: 10px;
  flex-shrink: 0;
}
.ts-item .ts-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-item .ts-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}
.ts-empty {
  padding: 14px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  text-align: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--text-1);
  text-decoration: none;
}
.topbar-user:hover { background: var(--bg-3); color: var(--text-0); }
.topbar-user .ava {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent));
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.content {
  flex: 1;
  padding: 28px 28px 60px;
}

h1.page-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  color: var(--text-0);
}
.page-sub {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 24px;
}

/* Hide legacy navbar / container constraints when shell is active */
.app-shell .navbar { display: none; }
.app-shell .container {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ============================================================
   BUTTONS — re-skin
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
  cursor: pointer;
  font-family: inherit;
  background: var(--bg-3);
  color: var(--text-1);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: none;
  transform: none !important;
}
.btn:hover { background: var(--bg-4); color: var(--text-0); border-color: var(--hair-2); }
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent-hi); color: white; }
.btn-secondary {
  background: var(--bg-3);
  color: var(--text-1);
  border-color: var(--hair);
}
.btn-secondary:hover { background: var(--bg-4); color: var(--text-0); }
.btn-success {
  background: var(--good);
  color: var(--bg-0);
  border-color: transparent;
}
.btn-success:hover { background: oklch(0.84 0.14 155); color: var(--bg-0); }
.btn-danger {
  background: transparent;
  color: var(--hot);
  border-color: var(--hot-soft);
}
.btn-danger:hover { background: var(--hot-soft); color: var(--hot); }
.btn-warning {
  background: var(--warn);
  color: var(--bg-0);
  border-color: transparent;
}
.btn-warning:hover { background: oklch(0.88 0.13 85); color: var(--bg-0); }
.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text-0); }
.btn-sm { padding: 5px 9px; font-size: 11.5px; }

/* ============================================================
   STATUS PILLS / status-badge legacy
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
}
.pill.live, .pill.active {
  background: var(--hot-soft);
  color: var(--hot);
}
.pill.live::before, .pill.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hot);
  animation: pulse 1.6s ease-in-out infinite;
}
.pill.watching { background: var(--good-soft); color: var(--good); }
.pill.paused, .pill.off { background: var(--bg-3); color: var(--text-2); }
.pill.offline { background: var(--bg-3); color: var(--text-3); }
.pill.starting { background: var(--accent-soft); color: var(--accent-hi); }

/* legacy status-badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: none !important;
}
.status-active {
  background: var(--hot-soft);
  color: var(--hot);
}
.status-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hot);
  animation: pulse 1.6s ease-in-out infinite;
}
.status-starting { background: var(--accent-soft); color: var(--accent-hi); }
.status-paused, .status-off { background: var(--bg-3); color: var(--text-2); }
.status-offline { background: var(--bg-3); color: var(--text-3); }
.status-error { background: var(--hot-soft); color: var(--hot); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--hot-soft); }
  60% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.live-strip {
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(260px, auto) 1fr auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.live-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at 90% 50%, var(--accent-soft), transparent 60%);
  pointer-events: none;
}
.live-strip-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-strip-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 4px var(--hot-soft);
}
.live-strip-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -0.02em;
}
.live-strip-stats {
  display: flex;
  gap: 36px;
  align-items: baseline;
  z-index: 1;
}
.live-strip-stat .num {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: block;
  line-height: 1;
}
.live-strip-stat .lbl {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 6px;
  display: block;
}
.live-strip-actions {
  display: flex;
  gap: 8px;
  z-index: 1;
}

/* Section header */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 32px 0 14px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.015em;
}
.section-head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}
.section-head .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.tab-row {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-2);
  border-radius: 7px;
}
.tab-row a, .tab-row span {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
}
.tab-row .on, .tab-row a.on { background: var(--bg-4); color: var(--text-0); }

/* Channel grid (override legacy) */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 14px !important;
}
.channel-card {
  background: var(--bg-1) !important;
  backdrop-filter: none !important;
  border: 1px solid var(--hair) !important;
  border-radius: var(--radius) !important;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  position: relative !important;
  transform: none !important;
  box-shadow: none !important;
}
.channel-card::before { display: none !important; }
.channel-card:hover {
  border-color: var(--hair-2) !important;
  transform: none !important;
  box-shadow: none !important;
}
.channel-card.live {
  border-color: var(--accent-line) !important;
}
.channel-card.live::before {
  display: block !important;
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-soft), transparent 50%);
  opacity: 0.6;
  pointer-events: none;
  -webkit-mask: none;
  mask: none;
  padding: 0;
}

.cc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.cc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-3);
  flex-shrink: 0;
  overflow: hidden;
  font-family: var(--display);
  font-weight: 700;
  display: grid;
  place-items: center;
  color: var(--text-1);
  font-size: 15px;
  border: 1px solid var(--hair-2);
  text-transform: uppercase;
}
.cc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cc-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-0);
  text-decoration: none;
}
a.cc-name:hover { color: var(--accent-hi); }
.cc-game {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.cc-status { margin-left: auto; }

/* Laughmeter (compact) */
.lm { position: relative; z-index: 1; }
.lm-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.lm-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  border-radius: 3px;
  transform-origin: left;
  width: 0%;
}
.lm-fill.hot {
  background: linear-gradient(90deg, var(--accent), var(--hot));
}
.lm-threshold {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text-1);
  opacity: 0.4;
  right: 0;
}
.lm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-2);
  font-family: var(--mono);
}
.lm-row b { color: var(--text-0); font-weight: 600; }

/* Sparkline */
.spark {
  width: 100%;
  height: 28px;
  position: relative;
  z-index: 1;
}

.cc-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-2);
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--hair);
  padding-top: 10px;
  font-family: var(--mono);
}
.cc-foot b { color: var(--text-0); font-weight: 600; }
.cc-foot .sep { width: 1px; height: 10px; background: var(--hair); }
.cc-foot .ctrls {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-0); }
.icon-btn.warn { color: var(--hot); }
.icon-btn.warn:hover { background: var(--hot-soft); }

/* Recent clips strip */
.clip-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.clip-card {
  background: var(--bg-1) !important;
  backdrop-filter: none !important;
  border: 1px solid var(--hair) !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: border-color 0.15s !important;
  transform: none !important;
  box-shadow: none !important;
}
.clip-card:hover {
  border-color: var(--hair-2) !important;
  transform: none !important;
  box-shadow: none !important;
}
.clip-card .clip-thumb-wrap,
.clip-thumb-shell {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a2336, #1a1622);
  position: relative;
  overflow: hidden;
}
.clip-thumb-shell::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.5;
  width: 60%;
  height: 80%;
  background: var(--accent);
  top: -10%;
  left: -10%;
}
.clip-thumb-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.5;
  width: 50%;
  height: 60%;
  background: var(--hot);
  bottom: -10%;
  right: -10%;
}
.clip-thumb-shell img.clip-thumb {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.laugh-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: var(--text-0);
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 2;
}
.dur-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: var(--text-0);
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 2;
}
.clip-info {
  display: block !important;
  padding: 10px 12px 4px !important;
}
.clip-channel {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--text-0) !important;
}
.clip-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: 6px;
}
.clip-meta, .clip-meta-row {
  display: flex !important;
  gap: 10px !important;
  margin-top: 6px !important;
  padding: 0 12px 12px !important;
  font-size: 11px !important;
  color: var(--text-2) !important;
  font-family: var(--mono);
}

/* ============================================================
   CHANNEL DETAIL — Live monitor
   ============================================================ */
.cd-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.cd-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, var(--accent-hi), var(--accent) 70%);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  color: white;
  overflow: hidden;
  text-transform: uppercase;
}
.cd-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cd-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cd-meta {
  margin-top: 4px;
  display: flex;
  gap: 14px;
  color: var(--text-2);
  font-size: 13px;
  flex-wrap: wrap;
}
.cd-meta b { color: var(--text-1); font-weight: 600; }
.cd-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cd-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}
@media (max-width: 1100px) {
  .cd-grid { grid-template-columns: 1fr; }
}

.monitor {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 760px;
  min-height: 0;
  overflow: hidden;
}
.mon-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mon-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.mon-head .right {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.big-meter {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.big-meter-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.big-meter-num {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--text-0);
}
.big-meter-num .of {
  color: var(--text-3);
  font-size: 22px;
}
.big-meter-lbl {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.big-meter-lbl b { color: var(--accent-hi); }
.big-meter .lm-track { height: 8px; background: var(--bg-3); }
.big-meter-side {
  margin-left: auto;
  text-align: right;
}
.big-meter-side .lbl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.big-meter-side .num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hot);
}

/* Waveform */
.wave {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  height: 110px;
  overflow: hidden;
}
.wave-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wave-svg {
  position: absolute;
  inset: 28px 14px 12px;
  width: calc(100% - 28px);
  height: calc(100% - 40px);
}
.wave-threshold-line {
  stroke: var(--text-2);
  stroke-dasharray: 3 3;
  stroke-width: 1;
  opacity: 0.4;
}
.wave-bar {
  fill: var(--accent);
}
.wave-bar.over {
  fill: var(--hot);
}
.wave-clip-marker {
  position: absolute;
  width: 2px;
  background: var(--hot);
  top: 28px;
  bottom: 12px;
}
.wave-clip-marker::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -3px;
  width: 8px;
  height: 8px;
  background: var(--hot);
  border-radius: 50%;
}

/* Live chat (channel detail) */
.chat {
  flex: 1 1 0;
  background: var(--bg-2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.chat-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chat-head .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}
.chat-head .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  color: var(--text-2);
  font-size: 11.5px;
  align-items: center;
}
.chat-stream, .chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--sans) !important;
  background: transparent !important;
}
.msg {
  display: flex;
  gap: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  align-items: baseline;
}
.msg .t {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  flex-shrink: 0;
  width: 42px;
}
.msg .u {
  font-weight: 600;
  flex-shrink: 0;
}
.msg .x {
  color: var(--text-1);
  word-break: break-word;
}
.msg.laugh {
  background: var(--accent-soft);
}
.msg.laugh .x { color: var(--text-0); }
.msg.laugh .badge {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--accent);
  color: white;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 700;
  flex-shrink: 0;
}
.msg.spike {
  background: var(--hot-soft);
  border-left: 2px solid var(--hot);
  padding-left: 10px;
}
/* legacy chat-msg compat — used by clip_detail.html chat-context-messages */
.chat-msg {
  padding: 3px 6px;
  border-radius: 4px;
  background: transparent !important;
  display: block;
}
.chat-msg:hover { background: var(--bg-3) !important; }
.chat-time { color: var(--text-3); margin-right: 8px; font-family: var(--mono); font-size: 11px; }
.chat-user { color: var(--accent-hi); font-weight: 600; margin-right: 6px; }
.chat-user::after { content: ""; }
.chat-text { color: var(--text-1); word-break: break-word; }

.user-c1 { color: #f0a3d8; }
.user-c2 { color: #ffb38a; }
.user-c3 { color: #a8e0b3; }
.user-c4 { color: #91cfff; }
.user-c5 { color: #d9b3ff; }
.user-c6 { color: #ffd082; }

/* Right rail (channel detail) */
.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 14px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 .small {
  margin-left: auto;
  color: var(--text-3);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
}

.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  font-size: 12.5px;
  margin: 0;
}
.kv dt {
  color: var(--text-2);
  margin: 0;
}
.kv dd {
  color: var(--text-0);
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  text-align: right;
}

.emote-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.emote {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-3);
  color: var(--text-1);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--hair);
}
.emote.custom {
  border-color: var(--accent-line);
  color: var(--accent-hi);
  cursor: pointer;
}
.emote.custom:hover {
  background: var(--hot-soft);
  border-color: var(--hot);
  color: var(--hot);
}

.streamlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: -4px;
}
.streamlist a {
  display: flex;
  align-items: center;
  padding: 7px 8px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--text-1);
  text-decoration: none;
  gap: 10px;
}
.streamlist a:hover { background: var(--bg-2); }
.streamlist .date {
  font-family: var(--mono);
  color: var(--text-2);
  font-size: 11.5px;
}
.streamlist .clips {
  margin-left: auto;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
}
.streamlist .live-tag {
  color: var(--hot);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 10.5px;
}

/* ============================================================
   CLIPS LIBRARY
   ============================================================ */
.lib-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--hair-2);
  background: var(--bg-2);
  cursor: pointer;
  color: var(--text-1);
  text-decoration: none;
}
.filter-chip.on {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-hi);
}
.lib-toolbar .sep {
  width: 1px;
  height: 22px;
  background: var(--hair);
}
.lib-toolbar .right {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.lib-search {
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-0);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  width: 200px;
}
.lib-search:focus { border-color: var(--accent-line); }
.lib-toolbar select.toolbar-select {
  background: var(--bg-2) !important;
  border-color: var(--hair) !important;
  color: var(--text-0) !important;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.lib-clip {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.lib-clip:hover { border-color: var(--hair-2); }
.lib-clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.lib-clip .check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 3;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
}
.lib-clip .check input,
.lib-clip .check input[type="checkbox"] {
  display: none !important;
}
.lib-clip.selected .check {
  background: var(--accent);
  border-color: var(--accent);
}
.lib-clip .check svg {
  color: white;
  opacity: 0;
}
.lib-clip.selected .check svg { opacity: 1; }

.lib-clip .clip-thumb-shell {
  aspect-ratio: 16 / 9;
}

.mini-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  display: flex;
  align-items: flex-end;
  padding: 0 6px 2px;
  gap: 1px;
  z-index: 1;
}
.mini-wave .b {
  flex: 1;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
  min-height: 2px;
}
.mini-wave .b.peak { background: var(--accent-hi); }

.lib-clip-info {
  padding: 10px 12px 12px;
}
.lib-clip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}
.lib-clip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-2);
}
.lib-clip-meta .laughs { color: var(--accent-hi); }
.compilation-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  background: var(--accent);
  color: white;
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 2;
  font-weight: 700;
}
.clip-loudness {
  font-family: var(--mono);
  padding: 1px 5px;
  border-radius: 3px;
}
.clip-loudness.hi { color: var(--hot); background: var(--hot-soft); }
.clip-loudness.mid { color: var(--warn); background: oklch(0.82 0.15 85 / 0.15); }
.clip-loudness.low { color: var(--good); background: var(--good-soft); }
.clip-game {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
}

/* Compile bar (sticky) */
.compile-bar {
  position: sticky;
  bottom: 16px;
  margin-top: 20px;
  background: var(--bg-3);
  border: 1px solid var(--accent-line);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--accent-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  flex-wrap: wrap;
}
.compile-bar .count {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-0);
}
.compile-bar .count b {
  color: var(--accent-hi);
  font-family: var(--mono);
}
.compile-bar .right {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 24px 0;
  padding: 0;
}
.page-info {
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--mono);
}

/* ============================================================
   CLIP DETAIL — player + synced chat
   ============================================================ */
.cdv-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}
@media (max-width: 1100px) {
  .cdv-grid { grid-template-columns: 1fr; }
  /* Below video on mobile: drop fixed height + internal scroll so the chat
     flows with page scroll. Internal scroll under a fixed-height panel
     bubbles touches to <body> and hides the video. */
  .sync-chat, .chat-context-panel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .chat-context-messages {
    overflow: visible !important;
    flex: none !important;
  }
}
/* Defensive: even on desktop don't let inner-chat scroll chain to <body>. */
.chat-context-messages { overscroll-behavior: contain; }
.cdv-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-shell {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.player-shell .video-wrap,
.player-shell .clip-player {
  display: block;
}
.player-shell video.clip-player {
  width: 100%;
  max-height: 68vh;
  background: #000;
}

.player-controls-wrap {
  background: var(--bg-1) !important;
  backdrop-filter: none !important;
  border-top: 1px solid var(--hair) !important;
  padding: 14px 16px !important;
}
.player-timeline {
  position: relative;
  height: 38px;
  cursor: pointer;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.player-timeline::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  pointer-events: none;
}
.tl-filled {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  border-radius: 3px;
  pointer-events: none;
  transition: width 0.05s linear;
}
.tl-trim-region {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: var(--hot-soft);
  border-left: 2px solid var(--hot);
  border-right: 2px solid var(--hot);
  pointer-events: none;
}
.tl-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 28px;
  background: var(--hot);
  border-radius: 4px;
  cursor: ew-resize;
  z-index: 3;
  transition: height 0.15s;
  box-shadow: none;
}
.tl-handle:hover {
  background: var(--accent-hi);
  height: 32px;
  box-shadow: none;
}
.tl-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--text-0);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
  border-radius: 1px;
}
.tl-playhead::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: var(--text-0);
  border-radius: 50%;
}
.tl-loud-marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 12px;
  background: var(--accent-soft);
  border-radius: 2px;
  pointer-events: none;
}

.player-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.player-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.player-btn:hover { background: var(--accent-hi); }
.player-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-1);
}
.player-sep {
  width: 1px;
  height: 18px;
  background: var(--hair);
}
.volume-slider {
  width: 80px;
  accent-color: var(--accent);
}
.trim-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}
.trim-label code {
  color: var(--text-0);
  background: var(--bg-2);
  padding: 2px 5px;
  border-radius: 3px;
}
.trim-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--good);
}

.clip-meta-strip {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.cms-stat .num {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
}
.cms-stat .lbl {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.clip-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 14px;
}

/* Chat context (clip detail) */
.sync-chat, .chat-context-panel {
  background: var(--bg-1) !important;
  backdrop-filter: none !important;
  border: 1px solid var(--hair) !important;
  border-radius: var(--radius-lg) !important;
  display: flex !important;
  flex-direction: column !important;
  /* Lock height so the inner messages list can actually scroll.
     Was min-height:600 + max-height:none → container grew unbounded. */
  height: min(70vh, 720px) !important;
  max-height: 720px !important;
  overflow: hidden !important;
  padding: 0 !important;
}
.sync-chat-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sync-chat-head .row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}
.sync-chat-head .row .right {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}
.sync-chat-head .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.sync-density {
  display: flex;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-2);
  position: relative;
  gap: 1px;
}
.sync-density .seg {
  flex: 1;
  background: var(--bg-3);
}
.sync-density .now {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text-0);
  border-radius: 1px;
}
.chat-context-panel h3 {
  padding: 12px 14px 8px;
  margin: 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}
.chat-context-messages {
  padding: 8px 12px !important;
  overflow-y: auto;
  flex: 1;
  font-family: var(--sans) !important;
  font-size: 12.5px !important;
  line-height: 1.55;
}
.chat-context-messages .chat-msg {
  display: grid;
  grid-template-columns: 50px auto 1fr;
  gap: 6px;
  padding: 3px 8px !important;
  border-radius: 4px;
  align-items: baseline;
}

.trim-card {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 14px;
}

/* Field input */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.field input,
.field select,
.field textarea {
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 5px;
  padding: 7px 10px;
  color: var(--text-0);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}
.field input:focus { border-color: var(--accent-line); }

/* ============================================================
   FORMS — re-skin (channel_form)
   ============================================================ */
.form-card {
  background: var(--bg-1) !important;
  backdrop-filter: none !important;
  border: 1px solid var(--hair) !important;
  border-radius: var(--radius) !important;
  padding: 22px !important;
  max-width: 720px !important;
}
.form-section {
  border: 1px solid var(--hair) !important;
  border-radius: var(--radius-sm) !important;
  padding: 14px 16px 4px !important;
  margin-bottom: 14px !important;
  background: var(--bg-2) !important;
}
.form-section legend {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding: 0 6px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-3) !important;
  border: 1px solid var(--hair) !important;
  border-radius: 6px !important;
  padding: 8px 10px !important;
  color: var(--text-0) !important;
  font-family: var(--mono) !important;
  font-size: 13px !important;
  outline: none !important;
  box-shadow: none !important;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-line) !important;
}
.form-group small {
  display: block;
  color: var(--text-3);
  font-size: 11.5px;
  margin-top: 4px;
  line-height: 1.5;
}
.form-group .error {
  color: var(--hot);
  font-size: 12px;
  margin-top: 4px;
}
.form-group-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-group-check label {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
}
.form-group-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.form-group-check small { width: 100%; margin-top: 0; }
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.form-danger-zone {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--hot-soft);
  max-width: 720px;
}
.input-with-btn {
  display: flex;
  gap: 6px;
}
.input-with-btn input { flex: 1; }

/* ============================================================
   SETTINGS PAGE (Layout 11) — extends form-card with tabs
   ============================================================ */
.settings-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.settings-tabs span,
.settings-tabs a {
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  color: inherit;
}
.settings-tabs span.on,
.settings-tabs a.on {
  color: var(--text-0);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.settings-card {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 22px;
}
.settings-card.span-2 { grid-column: span 2; }
.settings-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.settings-card-head h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}
.settings-card-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-threshold {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.settings-threshold-num .num {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  display: block;
  color: var(--accent-hi);
}
.settings-threshold-num .lbl {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--mono);
  margin-top: 6px;
  display: block;
}
.settings-threshold-preview {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  position: relative;
  padding: 0 4px;
}
.settings-threshold-preview > div {
  flex: 1;
  border-radius: 2px;
  min-height: 6px;
}
.settings-threshold-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--hot);
  pointer-events: none;
}
.settings-threshold-line span {
  position: absolute;
  right: 0;
  top: -16px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--hot);
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
  cursor: pointer;
}
.settings-toggle-row.compact { padding: 8px 0; font-size: 12.5px; }
.settings-toggle-row > div b {
  font-size: 13px;
  display: block;
  margin-bottom: 2px;
}
.settings-toggle-row > div span {
  font-size: 11.5px;
  color: var(--text-3);
}
.switch {
  width: 32px;
  height: 18px;
  background: var(--bg-3);
  border-radius: 100px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
  display: inline-block;
}
.switch.on { background: var(--accent); }
.switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: left 0.15s;
}
.switch.on span { left: 16px; }

.settings-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.settings-window-viz {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg-2);
  border-radius: 8px;
}
.settings-window-viz .row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
}
.settings-window-viz .bar {
  display: block;
  height: 14px;
  border-radius: 3px;
}
.settings-window-viz .r-before .bar { background: var(--accent-soft); }
.settings-window-viz .r-spike .bar { background: var(--hot); }
.settings-window-viz .r-after .bar { background: var(--bg-3); }
.settings-window-viz .lbl { color: var(--text-2); }

.settings-emote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.settings-emote {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 8px;
}
.settings-emote.hot {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--bg-2), var(--accent-soft) 200%);
}
.settings-emote-img {
  width: 32px;
  height: 32px;
  background: var(--bg-3);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  text-transform: none;
}
.settings-emote-name {
  font-size: 12.5px;
  color: var(--text-0);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-emote-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}
.settings-emote-weight {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-hi);
  margin-left: auto;
}

.settings-schedule {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 14px;
}
.settings-schedule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.settings-schedule-row .day {
  width: 22px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.settings-schedule-row .hours {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
}
.settings-schedule-row .hours > div {
  height: 16px;
  background: var(--bg-3);
  border-radius: 2px;
  cursor: pointer;
}
.settings-schedule-row .hours > div.on { background: var(--accent); }
.settings-schedule-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  margin-left: 34px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
}

/* ============================================================
   COMPILATION BUILDER (Layout 12)
   ============================================================ */
.cb-layout {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 18px;
  height: calc(100vh - 60px - 56px);
}
.cb-side {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cb-side-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cb-side-head h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.cb-side-head span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}
.cb-side-filter {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hair);
  flex-wrap: wrap;
}
.cb-filter {
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 100px;
  padding: 5px 11px;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.cb-filter.on {
  background: var(--bg-3);
  border-color: var(--accent);
  color: var(--text-0);
}

.cb-clips {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cb-clip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: grab;
  background: transparent;
  border: 1px solid transparent;
}
.cb-clip:hover { background: var(--bg-2); }
.cb-clip.added { background: var(--accent-soft); border-color: var(--accent-line); }
.cb-clip-thumb {
  width: 60px;
  height: 38px;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-3);
  overflow: hidden;
}
.cb-clip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-clip-dur {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-family: var(--mono);
  font-size: 9px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 1px 4px;
  border-radius: 2px;
}
.cb-clip-info {
  flex: 1;
  min-width: 0;
}
.cb-clip-title {
  font-size: 12.5px;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.cb-clip-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}
.cb-clip-add {
  width: 26px;
  height: 26px;
  background: var(--bg-3);
  border: 1px solid var(--hair-2);
  border-radius: 6px;
  color: var(--text-1);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
}
.cb-clip.added .cb-clip-add {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.cb-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.cb-preview {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 18px;
}
.cb-preview-frame {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.cb-preview-content {
  width: 220px;
  height: 392px;
  background: black;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.cb-preview-content video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
}
.cb-preview-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.cb-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cb-controls button {
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  color: var(--text-1);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.cb-controls .play {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  width: 40px;
  height: 40px;
}
.cb-controls .time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  margin-left: 8px;
}

.cb-timeline {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cb-timeline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cb-timeline-head h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}
.cb-timeline-head > span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.cb-track {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.cb-track-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.cb-track-content {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 6px;
  border-radius: 6px;
  min-height: 44px;
  align-items: center;
  overflow-x: auto;
}
.cb-track-block {
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
  flex-shrink: 0;
  cursor: grab;
  white-space: nowrap;
}
.cb-track-block .dur {
  font-family: var(--mono);
  font-size: 9.5px;
  opacity: 0.75;
}
.cb-track-block.intro { background: oklch(0.55 0.16 60); }
.cb-track-block.music { background: oklch(0.5 0.13 200); width: 100%; }
.cb-track-block.subs { background: oklch(0.45 0.05 280); }

.cb-export-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hair);
}
.cb-export-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.cb-export-formats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cb-format {
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
}
.cb-format.on {
  background: var(--bg-3);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.cb-format-frame {
  background: var(--bg-3);
  margin: 0 auto 8px;
  border-radius: 3px;
}
.cb-format.on .cb-format-frame { background: var(--accent); }
.v9-16 { width: 18px; height: 28px; }
.v16-9 { width: 32px; height: 18px; }
.v1-1 { width: 24px; height: 24px; }
.cb-format b {
  display: block;
  font-size: 12px;
  font-family: var(--display);
  margin-bottom: 2px;
}
.cb-format span {
  font-size: 10px;
  color: var(--text-3);
}
.cb-quality {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: 8px;
}
.cb-quality span {
  flex: 1;
  text-align: center;
  padding: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  border-radius: 5px;
  cursor: pointer;
}
.cb-quality span.on {
  background: var(--bg-3);
  color: var(--text-0);
  box-shadow: 0 0 0 1px var(--accent);
}
.cb-export-meta {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--hair);
}
.cb-export-meta > div {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}
.cb-export-meta span { color: var(--text-3); }
.cb-export-meta b {
  font-family: var(--display);
  font-weight: 600;
  color: var(--text-0);
}

/* ============================================================
   LANDING PAGE / MARKETING
   ============================================================ */
.lp {
  background: var(--bg-0);
  color: var(--text-0);
  width: 100%;
  min-height: 100vh;
  font-family: var(--sans);
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}
.lp > .lp-footer { margin-top: auto; }
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 60px;
  border-bottom: 1px solid var(--hair);
  position: sticky;
  top: 0;
  background: rgba(14, 12, 18, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.lp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-0);
}
.lp-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, var(--accent-hi), var(--accent) 70%);
  position: relative;
  flex-shrink: 0;
}
.lp-logo-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--bg-0);
  clip-path: polygon(20% 0, 100% 50%, 20% 100%);
}
.lp-logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-0);
}
.lp-nav-menu {
  display: contents;
}
.lp-nav-links {
  display: flex;
  gap: 28px;
  font-size: 13.5px;
  color: var(--text-2);
}
.lp-nav-links a {
  cursor: pointer;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}
.lp-nav-links a:hover, .lp-nav-links a.active {
  color: var(--text-0);
}
.lp-nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lp-nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.lp-nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-0);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.lp-nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.lp-nav-burger.open span:nth-child(2) { opacity: 0; }
.lp-nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .lp-nav { padding: 16px 20px; }
  .lp-nav-burger { display: flex; }
  .lp-nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 22px;
    padding: 22px 24px 28px;
    background: rgba(14, 12, 18, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hair);
  }
  .lp-nav-menu.open { display: flex; }
  .lp-nav-links {
    flex-direction: column;
    gap: 18px;
    font-size: 16px;
  }
  .lp-nav-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .lp-nav-cta .btn { text-align: center; justify-content: center; }
}
body.lp-nav-locked { overflow: hidden; }

.lp-hero {
  padding: 80px 60px 60px;
  position: relative;
  overflow: hidden;
}
@media (max-width: 720px) {
  .lp-hero { padding: 50px 24px 40px; }
  .lp-hero::before { display: none; }
}
.lp-hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent-soft), transparent 60%);
  pointer-events: none;
  opacity: 0.5;
}
.lp-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .lp-hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  background: var(--bg-1);
  border: 1px solid var(--hair);
  padding: 7px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.lp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.lp-h1 {
  font-family: var(--display);
  font-size: 62px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
}
@media (max-width: 720px) {
  .lp-h1 { font-size: 40px; }
}
.lp-h1-accent {
  background: linear-gradient(135deg, var(--accent-hi), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lp-sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 520px;
}
.lp-hero-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.lp-hero-actions .btn { padding: 11px 20px; font-size: 14px; }
.lp-hero-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 12.5px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.lp-hero-stats > div b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.lp-hero-stats .sep {
  width: 1px;
  height: 32px;
  background: var(--hair);
}

.lp-monitor {
  background: var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--hair);
  position: relative;
}
.lp-monitor-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 16px;
}
.lp-monitor-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
  animation: pulse-dot 2s infinite;
}
.lp-monitor-meter {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}
.lp-monitor-num {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--hot);
  line-height: 1;
}
.lp-monitor-num span {
  font-size: 22px;
  color: var(--text-3);
  font-weight: 500;
  margin-left: 4px;
}
.lp-monitor-meter-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.lp-monitor-meter-bar > div {
  width: 110%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--hot));
}
.lp-monitor-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  margin-bottom: 16px;
  padding: 0 4px;
}
.lp-monitor-wave > div {
  flex: 1;
  border-radius: 2px;
  min-height: 6px;
  opacity: 0.85;
}
.lp-monitor-chat {
  background: var(--bg-0);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
}
.lp-monitor-chat > div {
  display: grid;
  grid-template-columns: 44px 110px 1fr;
  gap: 8px;
  color: var(--text-1);
}
.lp-monitor-chat .t { color: var(--text-3); }
.lp-monitor-chat .u { font-weight: 600; }
.lp-monitor-chat .lh > span:last-child { color: var(--text-0); }
.lp-monitor-chat .hot {
  background: rgba(220, 38, 38, 0.08);
  margin: 4px -8px -2px;
  padding: 2px 8px;
  border-radius: 4px;
}
.lp-monitor-chat .hot > span:last-child { color: var(--hot); font-weight: 600; }
.lp-monitor-toast {
  position: absolute;
  right: -24px;
  bottom: 24px;
  background: var(--bg-2);
  border: 1px solid var(--hair-2);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
  font-size: 12.5px;
}
.lp-toast-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hi);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.lp-monitor-toast b {
  display: block;
  color: var(--text-0);
  margin-bottom: 2px;
}
.lp-monitor-toast span {
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
}
@media (max-width: 720px) {
  .lp-monitor-toast {
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
  }
}

.lp-trusted {
  padding: 40px 60px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  text-align: center;
}
.lp-trusted-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
  margin-bottom: 18px;
}
.lp-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
  flex-wrap: wrap;
}
.lp-logos span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-2);
  opacity: 0.6;
  letter-spacing: 0.02em;
}

.lp-section {
  padding: 100px 60px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .lp-section { padding: 60px 24px; }
}
.lp-section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.lp-section-head .lp-eyebrow { margin-bottom: 18px; }
.lp-h2 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  line-height: 1.05;
}
@media (max-width: 720px) {
  .lp-h2 { font-size: 28px; }
}
.lp-section-sub {
  font-size: 16px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
}
.lp-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 960px) {
  .lp-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .lp-features { grid-template-columns: 1fr; }
}
.lp-feat {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 28px 24px;
  transition: border-color 0.2s;
}
.lp-feat:hover { border-color: var(--hair-2); }
.lp-feat-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  display: grid;
  place-items: center;
  font-size: 18px;
  margin-bottom: 18px;
}
.lp-feat h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.lp-feat p {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.55;
}

.lp-how {
  background: var(--bg-1);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  margin: 0;
  max-width: none;
}
.lp-how-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}
@media (max-width: 800px) {
  .lp-steps { grid-template-columns: 1fr; }
}
.lp-step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-hi);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-weight: 600;
}
.lp-step h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.lp-step p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}

.lp-cta {
  padding: 80px 60px;
  max-width: 1280px;
  margin: 0 auto;
}
.lp-cta-card {
  background:
    radial-gradient(ellipse at top right, var(--accent-soft), transparent 60%),
    var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: 20px;
  padding: 60px;
  text-align: center;
}
.lp-cta-card p {
  font-size: 15px;
  color: var(--text-2);
  margin: 8px 0 26px;
}

.lp-footer {
  padding: 36px 60px;
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  font-size: 12.5px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.lp-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
}
.lp-footer-links a {
  color: var(--text-2);
  text-decoration: none;
}
.lp-footer-links a:hover { color: var(--text-0); }

/* Pricing */
.lp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 100px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-2);
}
.lp-toggle b { color: var(--accent-hi); font-weight: 600; }
.lp-toggle-switch {
  width: 32px;
  height: 18px;
  background: var(--bg-3);
  border-radius: 100px;
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}
.lp-toggle-switch.on { background: var(--accent); }
.lp-toggle-switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: left 0.2s;
}
.lp-toggle-switch.on span { left: 16px; }

.lp-pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .lp-pricing { grid-template-columns: 1fr; gap: 24px; }
}
.lp-tier {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 32px 28px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.lp-tier.featured {
  background: var(--bg-2);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 20px 40px -20px var(--accent-soft);
  transform: translateY(-8px);
}
.lp-tier-tag {
  position: absolute;
  top: -10px;
  left: 28px;
  background: var(--accent);
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 700;
}
.lp-tier-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.lp-tier-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.lp-tier-price .amount {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}
.lp-tier-price .period {
  font-size: 13px;
  color: var(--text-3);
}
.lp-tier-desc {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 22px;
  line-height: 1.5;
  min-height: 38px;
}
.lp-tier-feats {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-top: 1px solid var(--hair);
  padding-top: 22px;
}
.lp-tier-feats li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-1);
}
.lp-tier-feats li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.lp-faq {
  margin-top: 100px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
.lp-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}
@media (max-width: 720px) {
  .lp-faq-grid { grid-template-columns: 1fr; }
}
.lp-faq-item h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.lp-faq-item p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}

/* ============================================================
   AUTH (sign in / sign up)
   ============================================================ */
.auth-shell {
  display: grid;
  grid-template-columns: 480px 1fr;
  width: 100%;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-0);
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
.auth-side {
  background:
    radial-gradient(ellipse at bottom left, var(--accent-soft), transparent 65%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-right: 1px solid var(--hair);
  padding: 40px;
  display: flex;
  flex-direction: column;
}
.auth-side-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 360px;
}
.auth-side-quote {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 28px;
}
.auth-side-cite {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-side-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}
.auth-side-cite b { display: block; font-size: 14px; }
.auth-side-cite span { font-size: 12px; color: var(--text-2); }
.auth-side-meta {
  display: flex;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-main {
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
}
.auth-main-top {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-2);
}
.auth-main-top a {
  color: var(--accent-hi);
  font-weight: 600;
  text-decoration: none;
}
.auth-card {
  max-width: 400px;
  margin: auto;
  width: 100%;
}
.auth-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.auth-sub {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 28px;
}
.auth-twitch-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  background: #9146FF;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.auth-twitch-btn:hover { background: #7d2fff; color: white; }

.auth-twitch-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 22px;
  background: rgba(145, 70, 255, 0.08);
  border: 1px solid rgba(145, 70, 255, 0.25);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.5;
}
.auth-twitch-note svg {
  color: #9146FF;
  flex-shrink: 0;
}
.auth-twitch-note b { color: var(--text-0); font-weight: 600; }
.auth-divider {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin: 22px 0 18px;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: var(--mono);
}
.auth-divider::before, .auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 36px);
  height: 1px;
  background: var(--hair);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-card .field { margin-bottom: 12px; }
.auth-card .field input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-0);
  font-family: var(--sans);
  font-size: 13.5px;
  outline: none;
}
.auth-card .field input:focus { border-color: var(--accent-line); }
.auth-card .form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 16px;
  font-size: 12.5px;
  color: var(--text-2);
  flex-wrap: wrap;
  gap: 8px;
}
.auth-card .form-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.auth-card .form-row a {
  color: var(--accent-hi);
  text-decoration: none;
}
.auth-card .errors {
  background: var(--hot-soft);
  color: var(--hot);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 12.5px;
}
.auth-card .errors ul { margin: 0; padding-left: 18px; }
.auth-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout-shell {
  display: grid;
  grid-template-columns: 1fr 380px;
  width: 100%;
  background: var(--bg-0);
  color: var(--text-0);
  align-items: start;
}
@media (max-width: 900px) {
  .checkout-shell { grid-template-columns: 1fr; }
}
.checkout-main {
  padding: 50px 60px 80px;
  max-width: 720px;
  margin-left: auto;
  width: 100%;
}
.checkout-back {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 22px;
}
.checkout-back a { color: var(--text-2); text-decoration: none; }
.checkout-back a:hover { color: var(--text-0); }
.checkout-section {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: 12px;
}
.checkout-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.checkout-section-head .num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--display);
}
.checkout-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.checkout-tab {
  padding: 9px 14px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkout-tab.on {
  background: var(--bg-3);
  border-color: var(--accent);
  color: var(--text-0);
  box-shadow: 0 0 0 1px var(--accent);
}
.checkout-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.checkout-side {
  background: var(--bg-1);
  border-left: 1px solid var(--hair);
  padding: 50px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  align-self: start;
}
.checkout-summary {
  background: var(--bg-2);
  border: 1px solid var(--hair-2);
  border-radius: 12px;
  padding: 24px;
}
.checkout-summary-head {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
  margin-bottom: 18px;
}
.checkout-tier {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}
.checkout-tier > div:first-child b {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  display: block;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.checkout-tier > div:first-child span {
  font-size: 11.5px;
  color: var(--text-2);
}
.checkout-tier-price { text-align: right; }
.checkout-tier-price b {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: block;
}
.checkout-tier-price span {
  font-size: 11px;
  color: var(--text-3);
}
.checkout-perks {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hair);
}
.checkout-perks > div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-1);
}
.checkout-perks > div::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
}
.checkout-promo {
  display: flex;
  gap: 8px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hair);
}
.checkout-promo input {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-0);
  font-family: var(--mono);
  outline: none;
}
.checkout-total-rows {
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
}
.checkout-total-rows > div {
  display: flex;
  justify-content: space-between;
  color: var(--text-2);
}
.checkout-total-rows b { color: var(--text-0); font-weight: 600; }
.checkout-total {
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}
.checkout-total > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.checkout-total span {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
}
.checkout-total b {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.checkout-trial {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--good);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.checkout-trial .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}
.checkout-trust {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   MISC: legacy element overrides
   ============================================================ */
select {
  background-color: var(--bg-2);
  color: var(--text-0);
  border-color: var(--hair);
}
select option { background-color: var(--bg-2); color: var(--text-0); }
.search-input {
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-0);
  font-family: var(--sans);
  font-size: 13px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--accent-line); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
}
.modal-card {
  background: var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hair);
}
.modal-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
}
.modal-body { padding: 16px 20px; }
.follows-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
}
.follows-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  gap: 10px;
}
.follows-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-1);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-1);
  border: 1px dashed var(--hair-2);
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}
.empty-state p {
  color: var(--text-2);
  margin-bottom: 14px;
}

.text-muted { color: var(--text-2); }
.text-danger { color: var(--hot); }
.text-success { color: var(--good); }

/* Compilation editor legacy support — minimal, lets existing comp-* classes show on the new dark surface */
.comp-editor { padding: 0; }
.comp-settings, .comp-preview, .comp-segments, .comp-workspace__player, .comp-workspace__segments {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.comp-settings { padding: 18px; margin-bottom: 14px; }
.comp-settings__title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.comp-input {
  background: var(--bg-2) !important;
  border: 1px solid var(--hair) !important;
  border-radius: 6px !important;
  padding: 7px 10px !important;
  color: var(--text-0) !important;
  font-family: var(--mono) !important;
  font-size: 13px !important;
}
.comp-input:focus { border-color: var(--accent-line) !important; }

/* ============================================================
   MOBILE / RESPONSIVE — app shell, dashboard, library, etc.
   ============================================================ */

/* Hamburger toggle (hidden on desktop) */
.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-0);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.app-shell.sidebar-open .sidebar-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.app-shell.sidebar-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
.app-shell.sidebar-open .sidebar-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Sidebar backdrop (hidden on desktop) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 19;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

/* Search trigger icon (hidden on desktop) */
.topbar-search-trigger {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 8px;
  color: var(--text-1);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.topbar-search-trigger:hover { background: var(--bg-2); color: var(--text-0); }

body.sidebar-locked { overflow: hidden; }

/* ---------------- Tablet / small laptop (≤ 960px) ---------------- */
@media (max-width: 960px) {
  /* Shell becomes single column; sidebar slides in as drawer */
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 268px;
    max-width: 82vw;
    height: 100dvh;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.22s ease-out;
    box-shadow: 0 16px 60px -12px rgba(0, 0, 0, 0.7);
    padding: 18px 14px;
  }
  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .sidebar-toggle { display: inline-flex; }
  .nav-item.active::before { left: -10px; }

  /* Topbar */
  .topbar {
    padding: 0 14px;
    gap: 10px;
    height: 56px;
  }
  .crumbs { font-size: 13px; min-width: 0; }
  .crumbs a, .crumbs .now {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 38vw;
  }
  .topbar-search { width: 200px; }

  .content {
    padding: 18px 16px 60px;
  }

  h1.page-title { font-size: 22px; }
  .page-sub { font-size: 13px; margin-bottom: 18px; }

  /* Dashboard live strip stacks */
  .live-strip {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .live-strip-title { font-size: 18px; margin-top: 6px; }
  .live-strip-stats { gap: 22px; }
  .live-strip-stat .num { font-size: 24px; }
  .live-strip-actions { flex-wrap: wrap; }
  .live-strip-actions .btn { flex: 1 1 auto; min-width: 130px; }

  /* Channel grid */
  .channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  }

  /* Clip rail: 2 columns */
  .clip-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Section heads wrap nicely */
  .section-head { flex-wrap: wrap; row-gap: 6px; margin-top: 26px; }
  .section-head .right { margin-left: auto; }

  /* Library toolbar */
  .lib-toolbar { padding: 10px; gap: 8px; }
  .lib-toolbar .right { margin-left: 0; flex-wrap: wrap; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

  /* Channel detail */
  .cd-hero {
    grid-template-columns: auto 1fr;
    grid-template-areas: "ava title" "actions actions";
    gap: 14px;
  }
  .cd-avatar { grid-area: ava; width: 56px; height: 56px; font-size: 22px; border-radius: 14px; }
  .cd-title { grid-area: title; font-size: 22px; flex-wrap: wrap; }
  .cd-actions { grid-area: actions; }
  .monitor { height: auto; max-height: 70vh; }

  /* Clip detail player */
  .cdv-grid { gap: 14px; }

  /* Compilation builder collapses */
  .cb-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 14px;
  }
  .cb-side { min-height: 320px; }

  /* Settings (account, channel form) */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .settings-card.span-2 { grid-column: auto; }
  .settings-card { padding: 16px; }
  .settings-fields-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  }
  .settings-threshold { grid-template-columns: 1fr; gap: 8px; }
  .settings-tabs { gap: 14px; font-size: 13px; }

  /* Modal padding for small screens */
  .modal-overlay { padding: 24px 12px; align-items: center; }

  /* Tables that overflow get a scroll wrapper at the source level if any */
  table { max-width: 100%; }
}

/* ---------------- Phone (≤ 640px) ---------------- */
@media (max-width: 640px) {
  /* Topbar — hide breadcrumb link prefix, show only current page */
  .crumbs a { display: none; }
  .crumbs .sep { display: none; }
  .crumbs .now {
    font-size: 14px;
    max-width: 50vw;
  }

  /* Hide desktop search by default; show via trigger button */
  .topbar-search-trigger { display: inline-flex; }
  .topbar-search {
    display: none;
    position: absolute;
    top: 100%;
    left: 8px;
    right: 8px;
    width: auto;
    margin: 6px 0 0;
    z-index: 11;
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6);
  }
  .topbar-search.mobile-open { display: flex; }
  .topbar-search kbd { display: none; }
  .topbar-search-results { left: 0; right: 0; }
  /* When search trigger is shown, the user button collapses to avatar only */
  .topbar-user span:not(.ava) { display: none; }
  .topbar-user { padding: 3px; }

  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-right { gap: 6px; }

  /* Content side padding */
  .content { padding: 14px 12px 60px; }
  h1.page-title { font-size: 20px; line-height: 1.2; }
  .page-sub { font-size: 12.5px; margin-bottom: 14px; }

  /* Live strip — vertical, looser */
  .live-strip {
    padding: 14px;
    border-radius: 12px;
    gap: 12px;
  }
  .live-strip::after { background: radial-gradient(400px circle at 80% 20%, var(--accent-soft), transparent 60%); }
  .live-strip-title { font-size: 16px; margin-top: 4px; }
  .live-strip-stats {
    gap: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--hair);
    padding-top: 12px;
  }
  .live-strip-stat .num { font-size: 22px; }
  .live-strip-stat .lbl { font-size: 10.5px; margin-top: 2px; }
  .live-strip-actions { width: 100%; }
  .live-strip-actions .btn { flex: 1 1 calc(50% - 4px); justify-content: center; padding: 9px 12px; font-size: 13px; }

  /* Section heads: full row layout */
  .section-head { gap: 10px; margin: 22px 0 12px; }
  .section-head h2 { font-size: 16px; }
  .section-head .right { width: 100%; margin-left: 0; }
  .section-head .right .btn { flex: 1; justify-content: center; }

  /* Channel grid — single column */
  .channel-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .channel-card { padding: 12px !important; gap: 10px !important; }
  .cc-game { max-width: 130px; }
  .cc-foot { gap: 10px; flex-wrap: wrap; }
  .cc-foot .ctrls { margin-left: auto; }

  /* Clips rail — 2 columns, tighter */
  .clip-rail { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .clip-info { padding: 8px 10px 2px !important; }
  .clip-channel { font-size: 12px !important; }
  .clip-time { font-size: 10.5px; margin-left: 4px; }
  .clip-meta { padding: 0 10px 10px !important; gap: 8px !important; font-size: 10.5px !important; }

  /* Library: 2 columns max, smaller cards */
  .lib-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  /* backdrop-filter is expensive on mobile GPUs and re-paints on every scroll
     frame — drop it for the checkbox chip on phones. */
  .lib-clip .check { backdrop-filter: none; background: rgba(0, 0, 0, 0.7); }
  .lib-clip-info { padding: 8px 10px 10px; }
  .lib-clip-title { font-size: 12px; }
  .lib-clip-meta { font-size: 10px; gap: 4px 8px; }
  .lib-toolbar { gap: 6px; padding: 8px; }
  .lib-toolbar .sep { display: none; }
  .lib-toolbar .right {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
    border-top: 1px solid var(--hair);
    padding-top: 8px;
  }
  .lib-toolbar .toolbar-select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filter-chip { font-size: 11px; padding: 5px 8px; }

  /* Pagination & compile bar */
  .pagination { gap: 8px; flex-wrap: wrap; }
  .compile-bar {
    bottom: 8px;
    margin-left: -4px;
    margin-right: -4px;
    padding: 10px;
  }
  .compile-bar .right { width: 100%; margin-left: 0; flex-wrap: wrap; gap: 6px; }
  .compile-bar .right .btn { flex: 1 1 auto; justify-content: center; }

  /* Channel detail: hero stacks */
  .cd-hero {
    grid-template-columns: 1fr;
    grid-template-areas: "ava" "title" "actions";
    text-align: left;
    gap: 10px;
  }
  .cd-title { font-size: 20px; }
  .cd-actions .btn { padding: 8px 12px; font-size: 12.5px; }
  .monitor { padding: 12px; max-height: none; }

  /* Clip detail: side panel below player */
  .cdv-grid { grid-template-columns: 1fr; gap: 12px; }
  .player-shell video.clip-player { max-height: 56vh; }
  .player-controls-wrap { padding: 10px 12px !important; }

  /* Modal becomes near-full-screen */
  .modal-overlay { padding: 16px 8px; }
  .modal-card { max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-body { overflow-y: auto; padding: 12px 14px; }
  .modal-header { padding: 12px 14px; }
  .modal-header h2 { font-size: 16px; }

  /* Sidebar drawer: slightly wider on phone for tap targets */
  .sidebar { width: 280px; padding: 16px 12px; }
  .sidebar .nav-item { padding: 10px 12px; font-size: 14px; }
  .sidebar .brand { padding: 4px 8px 18px; }
  .nav-section { padding: 12px 8px 4px; }

  /* Forms & inputs — prevent iOS zoom-on-focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="date"],
  textarea,
  select {
    font-size: 16px;
  }
  .topbar-search input { font-size: 16px; }

  /* Hide ⌘K kbd everywhere on phone */
  .topbar-search kbd { display: none; }

  /* Tab rows wrap */
  .tab-row { flex-wrap: wrap; }

  /* Auth shell etc. */
  .auth-shell { grid-template-columns: 1fr; }
}

/* ---------------- Very narrow (≤ 380px) ---------------- */
@media (max-width: 380px) {
  .clip-rail,
  .lib-grid {
    grid-template-columns: 1fr;
  }
  .live-strip-stats { gap: 8px; }
  .live-strip-stat .num { font-size: 20px; }
  h1.page-title { font-size: 18px; }
}
