/* ==========================================================================
   Design tokens — Loopipe's design-token system: a committed dark, violet-accented
   identity (not a light/dark toggle — matches the reference direction,
   which was dark-only), shared with the public landing page
   (webapp/templates/landing.html) so the whole product reads as one brand
   from the marketing site through to daily use. Single source of truth for
   color/radius/shadow/spacing/type across every page (auth screens, the
   app shell, and every template under webapp/templates/). pipeline/
   dashboard.py's analytics report is a separate standalone document (its
   own <style>) but mirrors these same token values.
   ========================================================================== */
:root {
  color-scheme: dark;

  --bg: #0B0A12;
  --surface: #17141F;
  --surface-sunken: #1C1828;       /* for inputs/rows nested inside a card — one step brighter than surface */

  --text-primary: #F5F3FF;
  --text-secondary: #9B96AE;
  --text-muted: #6B6580;

  --border: #2A2438;
  --border-strong: #383049;

  --accent: #8B5CF6;
  --accent-hover: #7C3AED;
  --accent-soft: #2D2250;
  --accent-soft-border: #4C3B7A;
  --accent-ink: #C4B5FD;           /* text-on-soft-accent */

  /* Secondary brand accent (blue) — used sparingly in the app shell (a
     status dot, a small highlight), never as a stand-in for --accent. */
  --accent-2: #3B82F6;
  --accent-2-soft: #1E2A4A;
  --accent-2-ink: #93C5FD;

  --success: #22C55E;
  --success-soft: #16311F;
  --success-ink: #4ADE80;
  --warning: #F59E0B;
  --warning-soft: #3A2A0E;
  --warning-ink: #FBBF24;
  --error: #EF4444;
  --error-soft: #3A1418;
  --error-ink: #FCA5A5;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.50);

  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 40px;

  --sidebar-w: 240px;
  --topbar-h: 60px;
  --content-max: 860px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--accent); }

/* ==========================================================================
   App shell — sidebar (desktop) / top bar + slide-in drawer (mobile)
   ========================================================================== */
.layout { display: flex; min-height: 100vh; align-items: stretch; }

.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }

.mobile-topbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  align-items: center; justify-content: space-between;
  height: var(--topbar-h); padding: 0 var(--space-4);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.mobile-topbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }

.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; display: block;
}
.nav-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer;
}
.nav-toggle-btn:hover { background: var(--bg); }
.nav-toggle-btn svg { width: 20px; height: 20px; }

.nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(24, 24, 27, 0.32);
  z-index: 39; opacity: 0; pointer-events: none; transition: opacity .18s ease;
}

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--space-6) 0 var(--space-5);
}
.sidebar .brand {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  padding: 0 var(--space-5) var(--space-6); color: var(--text-primary);
  display: flex; align-items: center; gap: 9px;
}

.channel-switcher { padding: 0 var(--space-5) var(--space-5); }
.channel-switcher-head { margin-bottom: 6px; }
.channel-switcher-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.channel-switcher-empty { width: 100%; justify-content: center; font-size: 12px; padding: 7px 10px; }

/* Custom dropdown (not a native <select> — its popup can't be restyled to
   match the site in any browser, only the closed control can). */
.channel-switcher-dd { position: relative; }
.channel-switcher-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: inherit; background: var(--surface-sunken);
  border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left;
}
.channel-switcher-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-switcher-trigger svg { width: 14px; height: 14px; color: var(--text-muted); flex: 0 0 auto; transition: transform .15s; }
.channel-switcher-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.channel-switcher-trigger:hover {
  /* background explicit here, not just border-color: without it the
     generic `button:hover { background: var(--accent-hover) }` rule wins
     the cascade for that ONE property (this class's :hover never set it,
     so nothing here outranks the generic rule for it specifically) — a
     real bug, caught via a real click leaving the cursor hovering. */
  border-color: var(--border-strong); background: var(--surface-sunken);
}
.channel-switcher-trigger:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.channel-switcher-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 45;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 6px; max-height: 260px; overflow-y: auto;
}
.channel-switcher-option {
  display: block; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 500; color: var(--text-primary);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.channel-switcher-option:hover { background: var(--bg); }
.channel-switcher-option.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.channel-switcher-divider { height: 1px; background: var(--border); margin: 6px 2px; }
.channel-switcher-option-add { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.channel-switcher-option-add svg { width: 14px; height: 14px; flex: 0 0 auto; }
.channel-switcher-option-add:hover { background: var(--accent-soft); }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 0 var(--space-3); }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  padding: 9px 12px; border-radius: var(--radius-sm);
}
.sidebar nav a svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: 0.85; }
.sidebar nav a:hover { color: var(--text-primary); background: var(--bg); }
.sidebar nav a.active { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.sidebar nav a.active svg { opacity: 1; }

.lang-switch {
  display: flex; align-items: center; gap: 6px; margin: var(--space-3) var(--space-5) 0;
  color: var(--text-muted); text-decoration: none; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.02em; width: fit-content; padding: 4px 8px; border-radius: var(--radius-sm);
}
.lang-switch:hover { color: var(--text-primary); background: var(--bg); }

.sidebar .user-box {
  padding: var(--space-4) var(--space-5) 0; margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.sidebar .user-email {
  color: var(--text-secondary); font-size: 11.5px; line-height: 1.5; margin-bottom: var(--space-3);
  overflow-wrap: anywhere;
}
.sidebar .user-box button { width: 100%; padding: 7px 10px; font-size: 12.5px; }

main { flex: 1; min-width: 0; padding: var(--space-7) var(--space-8); }
main > h1 { font-size: 21px; margin: 0 0 4px; }
main > p.page-subtitle,
main > p.empty:first-of-type { margin-top: 0; }

@media (max-width: 880px) {
  .layout { flex-direction: column; }
  .mobile-topbar { display: flex; }
  .nav-backdrop { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 40;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-md); width: 78vw; max-width: 300px;
  }
  .nav-toggle-input:checked ~ .nav-backdrop { opacity: 1; pointer-events: auto; }
  .nav-toggle-input:checked ~ .layout .sidebar { transform: translateX(0); }
  main { padding: var(--space-5) var(--space-4) var(--space-7); }
}

/* ==========================================================================
   Typography helpers / generic text utilities
   ========================================================================== */
.empty { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin: 0 0 var(--space-6); max-width: 62ch; }
.text-error { color: var(--error-ink); }
.text-success { color: var(--success-ink); }

/* ==========================================================================
   Cards — the base surface every section/panel sits on
   ========================================================================== */
.channel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}
.channel-card + .channel-card { margin-top: var(--space-5); }
.channel-card h2 {
  font-size: 14.5px; margin: 0 0 var(--space-4); color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-section-note { color: var(--text-secondary); font-size: 12.5px; line-height: 1.6; margin: -6px 0 var(--space-4); }
.field-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin: var(--space-6) 0 var(--space-3); padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.field-group-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.channels {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
  gap: var(--space-4); margin-bottom: var(--space-7);
}
.channel-stats { display: flex; gap: var(--space-5); margin: var(--space-4) 0; font-size: 12px; color: var(--text-secondary); }
.channel-stats b { display: block; font-size: 19px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.channel-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.channel-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.channel-head h2, .channel-head h1 { margin: 0; }
.channel-id { min-width: 0; }
.channel-meta { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; overflow: hidden;
  background: linear-gradient(155deg, var(--accent), var(--accent-hover));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   Buttons
   ========================================================================== */
button, .btn {
  font-family: inherit;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 9px 16px; font-size: 13.5px;
  font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; transition: background .12s ease, box-shadow .12s ease;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button.secondary, .btn.secondary {
  background: var(--surface); color: var(--text-primary); border: 1px solid var(--border-strong);
}
button.secondary:hover, .btn.secondary:hover { background: var(--bg); }
button.danger, .btn.danger { background: var(--error-soft); color: var(--error-ink); }
button.danger:hover, .btn.danger:hover { background: #f9dbdb; }
button[disabled] { opacity: 0.55; cursor: not-allowed; }

label.inline { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
form.inline { display: inline; }

/* ==========================================================================
   Forms — inputs, selects, textareas, toggles, field hints
   ========================================================================== */
.field { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-4); }
.field input[type=text], .field input[type=password], .field input[type=time], .field select, .field textarea {
  font-family: inherit;
  display: block; width: 100%; margin-top: 6px;
  background: var(--surface-sunken); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px; font-weight: 400;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { appearance: auto; }
.field textarea { font-family: var(--font-mono); font-size: 12.5px; resize: vertical; }
.field-hint { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.55; color: var(--text-muted); font-weight: 400; }
.field-row { display: flex; gap: var(--space-3); }
.field-row > * { flex: 1; min-width: 0; }

input[type=text] {
  font-family: inherit; background: var(--surface-sunken); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px;
}

/* Toggle switch — used for anything that reads as a real on/off setting. */
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  flex: 0 0 auto; width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--border-strong);
  position: relative; transition: background .15s;
}
.toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .15s;
}
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.field-disabled { opacity: 0.6; }
.field-disabled-badge {
  font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 1px 8px; margin-left: 6px; vertical-align: 1px;
}

.generate-form { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* Video Üret's pipeline switcher — reuses the sidebar's .channel-switcher-dd
   classes verbatim (same dropdown pattern, different id/max-width — see
   channel_generate.html) so it doesn't stretch to the card's full width. */
.pipeline-picker { display: flex; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--border); }
.pipeline-picker .channel-switcher-dd { width: 100%; max-width: 320px; }
.pipeline-edit-link { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; padding-bottom: 8px; }
.pipeline-edit-link:hover { text-decoration: underline; }

.paste-script-details summary {
  font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer;
  list-style: none; display: inline-flex; align-items: center; gap: 4px;
}
.paste-script-details summary::-webkit-details-marker { display: none; }
.paste-script-details summary::before {
  content: "▸"; font-size: 10px; color: var(--text-muted); transition: transform .15s;
}
.paste-script-details[open] summary::before { transform: rotate(90deg); }
.paste-script-details summary:hover { text-decoration: underline; }

.key-row { display: flex; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-4); }
.key-row:last-child { margin-bottom: 0; }
.key-row form.key-form { flex: 1; margin: 0; }
.key-row button.delete-key { padding: 9px 12px; font-size: 12px; }

/* ==========================================================================
   Status badges / pills (job status, connection state)
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill);
}
.badge.success, .job-status.done { background: var(--success-soft); color: var(--success-ink); }
.badge.warning { background: var(--warning-soft); color: var(--warning-ink); }
.badge.error, .job-status.failed { background: var(--error-soft); color: var(--error-ink); }
.badge.neutral, .job-status.queued { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.job-status.running { background: var(--accent-soft); color: var(--accent-ink); }

.job-status { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }

.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); margin-bottom: var(--space-3); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.status-dot.on { background: var(--success); }
.status-dot.off { background: var(--text-muted); }

/* ==========================================================================
   Jobs list
   ========================================================================== */
.jobs { margin-top: var(--space-6); }
.jobs h2 { font-size: 13px; color: var(--text-secondary); font-weight: 600; margin: 0 0 var(--space-3); }
.job-row {
  display: flex; align-items: center; gap: var(--space-3); font-size: 12.5px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.job-row:last-child { border-bottom: none; }
.job-row a { color: var(--text-primary); text-decoration: none; font-weight: 500; }
.job-row a:hover { color: var(--accent); }
.job-row .job-meta { color: var(--text-muted); }
.job-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.job-actions a { color: var(--accent) !important; font-weight: 600 !important; }
.job-actions a:hover { text-decoration: underline; }
.link-btn {
  background: none; border: none; padding: 0; margin: 0; font: inherit;
  color: var(--accent); font-weight: 600; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; background: none; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 460px; }
.table-wrap table { border: none; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
th { color: var(--text-secondary); font-weight: 600; font-size: 11.5px; background: var(--surface-sunken); }
td.used { color: var(--text-muted); }
tr.used td { color: var(--text-muted); }
.topic-cell { white-space: normal; min-width: 220px; }

.topic-form { display: flex; gap: var(--space-3); margin: var(--space-4) 0; flex-wrap: wrap; }
.topic-form input { flex: 1; min-width: 140px; }

/* ==========================================================================
   Video history — a horizontally-scrolling row of poster cards
   ("Üretilen videolar"), one per produced video. Was a plain row list;
   redesigned to read like an actual shorts shelf — full-bleed thumbnail,
   a play glyph, the category as a corner tag, title+status burned into a
   bottom scrim over the image — closer to how the videos themselves will
   actually look than a text row ever could.
   ========================================================================== */
.video-history {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}
.video-history::-webkit-scrollbar { height: 6px; }
.video-history::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
.video-history::-webkit-scrollbar-track { background: transparent; }

.video-card {
  flex: 0 0 auto; width: 146px; scroll-snap-align: start;
  text-decoration: none; color: inherit; display: block;
}
.video-card.no-link { cursor: default; }
.video-card-thumb {
  position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: var(--radius-md);
  overflow: hidden; background: var(--surface-sunken); border: 1px solid var(--border);
  transition: transform .18s ease, border-color .18s ease;
}
.video-card:not(.no-link):hover .video-card-thumb,
.video-card:not(.no-link):focus-visible .video-card-thumb {
  transform: translateY(-3px); border-color: var(--border-strong);
}
.video-card:focus-visible { outline: none; }
.video-card:focus-visible .video-card-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card-thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.video-card-thumb-fallback svg { width: 26px; height: 26px; }
.video-card-play {
  position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(245, 243, 255, 0.92); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.video-card-play svg { width: 15px; height: 15px; color: var(--bg); margin-left: 1.5px; }
.video-card-tag {
  position: absolute; top: 8px; right: 8px; font-size: 9.5px; font-weight: 600;
  color: #fff; background: rgba(11, 10, 18, 0.55); backdrop-filter: blur(2px);
  padding: 3px 8px; border-radius: var(--radius-pill); text-transform: capitalize;
}
.video-card-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 9px 9px;
  background: linear-gradient(180deg, transparent, rgba(6, 5, 11, 0.88) 55%, rgba(6, 5, 11, 0.94));
}
.video-card-title {
  font-weight: 600; font-size: 12px; color: #fff; line-height: 1.32;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.video-card-meta {
  display: flex; align-items: center; gap: 5px; font-size: 10.5px;
  color: rgba(245, 243, 255, 0.7); margin-top: 4px; white-space: nowrap;
}
.video-card-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.video-card-dot.success { background: var(--success); }
.video-card-dot.error { background: var(--error); }
.video-card-dot.neutral { background: var(--text-muted); }

/* ==========================================================================
   Auth screens (login / signup)
   ========================================================================== */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: var(--space-5);
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  padding: var(--space-8) var(--space-7); width: 100%; max-width: 380px;
}
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: var(--space-6);
}
.auth-brand .brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: block;
}
.auth-brand span { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.auth-card h1 { font-size: 18px; margin: 0 0 var(--space-6); text-align: center; font-weight: 600; }
.auth-card label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin: var(--space-4) 0 6px; }
.auth-card label:first-of-type { margin-top: 0; }
.auth-card input {
  width: 100%; background: var(--surface-sunken); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px;
  font-family: inherit;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card button { width: 100%; justify-content: center; margin-top: var(--space-6); padding: 11px; font-size: 14px; }
.auth-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.auth-error {
  background: var(--error-soft); color: var(--error-ink); font-size: 12.5px;
  padding: 9px 12px; border-radius: var(--radius-sm); margin-top: var(--space-4);
}
.auth-switch { text-align: center; margin-top: var(--space-5); font-size: 13px; color: var(--text-secondary); }
.auth-switch a { font-weight: 500; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .channel-head { gap: var(--space-3); }
  .channel-head .btn { margin-left: 0 !important; width: 100%; justify-content: center; }
  .field-row { flex-direction: column; gap: var(--space-2); }
  .key-row { flex-direction: column; align-items: stretch; }
  .key-row button.delete-key { width: 100%; justify-content: center; }
  .generate-form { flex-direction: column; align-items: stretch; }
  .generate-form button { width: 100%; justify-content: center; }
  .pipeline-picker { flex-direction: column; align-items: stretch; }
  .pipeline-picker .channel-switcher-dd { max-width: none; }
  .topic-form { flex-direction: column; }
  .auth-card { padding: var(--space-6) var(--space-5); }
}
