/* ClipForge AI — brand: #6C3BFF purple / #00C2FF neon / #0B0B0F near-black */
:root {
  --bg: #0B0B0F;
  --bg-2: #111117;
  --surface: #15151d;
  --surface-2: #1b1b26;
  --border: #26263a;
  --text: #f5f5fa;
  --text-dim: #a5a5b8;
  --text-mute: #6d6d82;
  --primary: #6C3BFF;
  --primary-2: #8b5fff;
  --accent: #00C2FF;
  --grad: linear-gradient(135deg, #6C3BFF 0%, #00C2FF 100%);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 24px 60px -20px rgba(108, 59, 255, 0.35);
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  backdrop-filter: blur(14px);
  background: rgba(11, 11, 15, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-text { font-size: 18px; letter-spacing: -0.01em; }
.brand-ai { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14.5px; color: var(--text-dim); }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 9px 16px; border-radius: 999px;
  background: var(--grad); color: #fff !important; font-weight: 600;
  box-shadow: 0 6px 20px -8px rgba(108,59,255,0.55);
}
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* Hero */
.hero { position: relative; padding: 90px 24px 70px; overflow: hidden; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.hero-glow {
  position: absolute; inset: -20% 0 auto 0; height: 620px;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(108,59,255,0.35), transparent 70%),
    radial-gradient(55% 50% at 75% 20%, rgba(0,194,255,0.25), transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}
.eyebrow {
  display: inline-block; font-size: 12.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
  padding: 6px 12px; border: 1px solid rgba(0,194,255,0.3); border-radius: 999px;
  background: rgba(0,194,255,0.06);
}
h1 {
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 1.03; letter-spacing: -0.025em;
  font-weight: 800; margin: 22px auto 18px; max-width: 16ch;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede {
  font-size: clamp(16.5px, 1.8vw, 19px); color: var(--text-dim);
  max-width: 58ch; margin: 0 auto 34px;
}

.waitlist {
  display: flex; gap: 10px; max-width: 480px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px; box-shadow: var(--shadow);
}
.waitlist input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  padding: 12px 18px; color: var(--text); font-size: 15px;
}
.waitlist input::placeholder { color: var(--text-mute); }
.waitlist button {
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; font-weight: 600; font-size: 14.5px;
  transition: transform .08s ease, box-shadow .2s ease;
  box-shadow: 0 6px 20px -8px rgba(108,59,255,0.6);
}
.waitlist button:hover { transform: translateY(-1px); }
.waitlist button:disabled { opacity: 0.6; cursor: default; }
.waitlist-msg {
  min-height: 1.4em; margin: 14px auto 0; font-size: 14px;
  color: var(--text-dim); text-align: center;
}
.waitlist-msg.ok { color: #5dd39e; }
.waitlist-msg.err { color: #ff6b8a; }

.hero-proof {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 36px;
  list-style: none; padding: 0; margin: 46px 0 0; color: var(--text-dim);
  font-size: 14.5px;
}
.hero-proof strong { color: var(--text); font-weight: 600; }

/* Sections */
section { padding: 90px 24px; }
.section-title {
  max-width: 22ch; margin: 0 auto 18px; text-align: center;
  font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -0.02em; line-height: 1.15;
}
.section-sub { text-align: center; color: var(--text-dim); margin: 0 auto 48px; max-width: 50ch; }

/* Features */
.features { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.feature-grid {
  max-width: var(--maxw); margin: 48px auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
  transition: transform .15s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(108,59,255,0.35); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(108,59,255,0.18), rgba(0,194,255,0.1));
  border: 1px solid rgba(108,59,255,0.3);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 18px;
}
.feature h3 { font-size: 18px; margin: 0 0 8px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* How it works */
.how-steps {
  max-width: var(--maxw); margin: 48px auto 0; padding: 0;
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.how-steps li {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  position: relative;
}
.step-num {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px; color: var(--accent); letter-spacing: 0.1em;
}
.how-steps h3 { margin: 10px 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.how-steps p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* Pricing */
.pricing { background: var(--bg-2); }
.price-grid {
  max-width: var(--maxw); margin: 48px auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; align-items: stretch;
}
.price {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  display: flex; flex-direction: column; position: relative;
}
.price.featured {
  border-color: rgba(108,59,255,0.55);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
  box-shadow: var(--shadow);
}
.ribbon {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: 11.5px;
  padding: 5px 11px; border-radius: 999px; font-weight: 600; letter-spacing: 0.04em;
}
.price h3 { margin: 0; font-size: 15px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.price-num { font-size: 44px; font-weight: 800; margin: 10px 0 4px; letter-spacing: -0.02em; }
.price-num span { font-size: 16px; font-weight: 500; color: var(--text-dim); }
.price-sub { color: var(--text-dim); margin: 0 0 18px; font-size: 14px; }
.price ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.price li { padding: 7px 0; border-top: 1px dashed rgba(255,255,255,0.06); font-size: 14.5px; color: var(--text-dim); }
.price li:first-child { border-top: 0; }
.price-cta {
  text-align: center; padding: 12px 18px; border-radius: 999px; font-weight: 600;
  font-size: 14.5px; background: var(--grad); color: #fff;
  transition: transform .08s ease;
}
.price-cta.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.price-cta:hover { transform: translateY(-1px); }

/* CTA */
.cta { padding: 110px 24px; }
.cta-inner {
  max-width: 720px; margin: 0 auto; text-align: center;
  background:
    radial-gradient(80% 100% at 0% 0%, rgba(108,59,255,0.18), transparent 60%),
    radial-gradient(80% 100% at 100% 100%, rgba(0,194,255,0.14), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 36px;
}
.cta h2 { font-size: clamp(28px, 3.6vw, 40px); margin: 0 0 10px; letter-spacing: -0.02em; }
.cta p { color: var(--text-dim); margin: 0 0 28px; }

/* Footer */
.footer { padding: 60px 24px 36px; border-top: 1px solid rgba(255,255,255,0.04); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between;
}
.footer-brand p { color: var(--text-dim); margin: 6px 0 0; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; color: var(--text-dim); font-size: 14.5px; }
.footer-links a:hover { color: var(--text); }
.copyright {
  max-width: var(--maxw); margin: 28px auto 0; color: var(--text-mute);
  font-size: 13px; text-align: center;
}

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 80px 24px; }
.legal h1 { font-size: 36px; margin-bottom: 8px; }
.legal p, .legal li { color: var(--text-dim); }
.legal h2 { margin-top: 32px; font-size: 20px; }
.legal a { color: var(--accent); text-decoration: underline; }

/* Hero CTA row */
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.btn-primary, .btn-ghost {
  display: inline-block; padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, box-shadow .2s ease;
  text-align: center;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(108,59,255,0.6); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: rgba(108,59,255,0.5); }
.btn-primary[disabled], .btn-ghost[disabled] { opacity: 0.55; cursor: default; }

/* Auth pages (signup / login) */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: radial-gradient(80% 60% at 50% 0%, rgba(108,59,255,0.18), transparent 60%), var(--bg); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px 30px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.015em; }
.auth-card .sub { color: var(--text-dim); font-size: 14.5px; margin: 0 0 26px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 6px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.auth-card input, .auth-card select {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 15px; outline: none;
  transition: border-color .15s ease;
}
.auth-card input:focus, .auth-card select:focus { border-color: rgba(108,59,255,0.6); }
.auth-card .row-link { text-align: center; font-size: 14px; color: var(--text-dim); margin-top: 8px; }
.auth-card .row-link a { color: var(--accent); }
.auth-msg { min-height: 1.2em; font-size: 13.5px; text-align: center; }
.auth-msg.ok { color: #5dd39e; }
.auth-msg.err { color: #ff6b8a; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-dim); margin-bottom: 18px; }
.back-link:hover { color: var(--text); }

/* OAuth (Google / Facebook) */
.oauth-row { display: grid; gap: 10px; margin-bottom: 18px; }
.btn-oauth {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.btn-oauth:hover { border-color: rgba(108,59,255,0.5); background: rgba(255,255,255,0.02); }
.btn-oauth svg { flex: 0 0 auto; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  margin: 4px 0 16px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* App shell */
.app-wrap { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.app-side {
  border-right: 1px solid var(--border); padding: 24px 18px; background: var(--bg-2);
  position: sticky; top: 0; align-self: start; height: 100vh; overflow: auto;
}
.app-side .brand { margin-bottom: 28px; }
.app-nav { display: grid; gap: 4px; }
.app-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: var(--text-dim); font-size: 14.5px;
}
.app-nav a.active, .app-nav a:hover { background: var(--surface); color: var(--text); }
.app-main { padding: 28px 32px 60px; max-width: 1100px; width: 100%; min-width: 0; }
.app-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.app-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }

/* Hamburger button — hidden on desktop, shown on mobile/tablet via media query below */
.app-burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer;
  padding: 0; margin-right: 4px;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.app-burger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.app-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.app-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.app-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Backdrop behind the open drawer */
.app-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 40; opacity: 0; transition: opacity 0.2s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.app-drawer-backdrop.open { opacity: 1; }

/* Bottom tab bar — hidden on desktop, shown below the breakpoint via media query. */
.app-tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) 4px;
  justify-content: space-around;
}
.app-tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px;
  color: var(--text-dim); font-size: 11px; font-weight: 500;
  text-decoration: none; border-radius: 8px;
  min-width: 0;
}
.app-tabbar a.active { color: var(--text); }
.app-tabbar a.active .tabbar-icon { transform: translateY(-1px); }
.tabbar-icon { font-size: 19px; line-height: 1; }
.tabbar-label { font-size: 10.5px; letter-spacing: 0.01em; }

/* Mobile / tablet: turn the sidebar into a slide-in drawer + show bottom bar */
@media (max-width: 820px) {
  .app-wrap { grid-template-columns: 1fr; }
  .app-side {
    position: fixed; top: 0; left: 0;
    width: 260px; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 50;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
  }
  .app-side.open { transform: translateX(0); }
  .app-burger { display: inline-flex !important; }
  .app-main { padding: 20px 16px 90px; } /* extra bottom space for tab bar */
  .app-head h2 { font-size: 19px; }
  .app-tabbar { display: flex; }
}
.plan-chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 6px 12px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-dim);
}
.plan-chip strong { color: var(--text); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 17px; letter-spacing: -0.01em; }

/* Uploader */
.uploader {
  border: 1.5px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px 24px; text-align: center; background: var(--bg-2);
  transition: border-color .15s ease, background .15s ease;
}
.uploader.drag { border-color: rgba(108,59,255,0.7); background: rgba(108,59,255,0.06); }
.uploader p { margin: 8px 0; color: var(--text-dim); font-size: 14.5px; }
.uploader .small { font-size: 12.5px; color: var(--text-mute); }

.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; justify-content: center; }
.controls label { font-size: 13px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 8px; }
.controls input[type=range] { accent-color: var(--primary); }

.progress { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress > span { display: block; height: 100%; width: 0%; background: var(--grad); transition: width .4s ease; }
.status-line { text-align: center; font-size: 13.5px; color: var(--text-dim); margin-top: 10px; }

/* Clips grid — pending-activity cards stay multi-column. Real .clip-row
   cards switch to a single-column list (overridden in the new ruleset below). */
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.clip-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.clip-thumb { aspect-ratio: 9/16; background: #000; display: grid; place-items: center; color: var(--text-mute); font-size: 12px; }
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.clip-body { padding: 14px; display: grid; gap: 8px; }
.clip-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.clip-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); }
.hook {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  padding: 3px 8px; border-radius: 999px; font-weight: 600;
  background: rgba(108,59,255,0.15); color: #c9b5ff; border: 1px solid rgba(108,59,255,0.35);
}
.clip-actions { display: flex; gap: 8px; margin-top: 6px; }
.clip-actions a, .clip-actions button {
  flex: 1; text-align: center; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.clip-actions a.primary { background: var(--grad); border-color: transparent; color: #fff; }

/* Billing */
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.billing-plan {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
.billing-plan.current { border-color: rgba(108,59,255,0.55); }
.billing-plan h4 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.billing-plan .amt { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.billing-plan button { margin-top: auto; padding: 10px; border-radius: 8px; border: 0; cursor: pointer; background: var(--grad); color: #fff; font-weight: 600; font-size: 13px; }
.billing-plan button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.billing-plan button[disabled] { opacity: 0.6; cursor: default; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--bg-2);
}

/* ---- Channels tab ---- */
.chan-count {
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  padding: 3px 10px; border-radius: 999px; background: var(--bg-2);
  border: 1px solid var(--border); margin-left: 8px; vertical-align: middle;
}
.connect-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.connect-row .btn-oauth { width: auto; min-width: 200px; }

/* paste-URL YouTube source add form */
.yt-add-form {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 10px; padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s ease;
}
.yt-add-form:focus-within { border-color: rgba(108,59,255,0.55); }
.yt-add-icon { display: flex; align-items: center; justify-content: center; width: 28px; }
.yt-add-input {
  width: 100%; background: transparent; border: 0; outline: 0;
  color: var(--text); font-size: 14px; padding: 8px 4px;
}
.yt-add-input::placeholder { color: var(--text-dim); }
.yt-add-btn { padding: 10px 18px; font-size: 14px; white-space: nowrap; }
@media (max-width: 560px) {
  .yt-add-form { grid-template-columns: 1fr; }
  .yt-add-icon { display: none; }
}
.status-line.ok  { color: #5dd39e; }
.status-line.err { color: #ff6b8a; }

/* post-mode + backfill options under the add-channel form */
.yt-add-options {
  margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg-2);
  display: grid; gap: 10px;
}
.yt-add-options-legend {
  padding: 0 6px; font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.yt-add-radio {
  display: grid; grid-template-columns: 18px 1fr; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  transition: background .15s ease;
}
.yt-add-radio:hover { background: rgba(255,255,255,0.03); }
.yt-add-radio input[type="radio"] { margin-top: 3px; accent-color: #6C3BFF; }
.yt-add-radio strong { display: block; font-size: 14px; font-weight: 600; }
.yt-add-radio small  { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.yt-add-backfill {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 13px; color: var(--text);
}
.yt-add-backfill small { color: var(--text-dim); font-size: 12px; flex-basis: 100%; }
.yt-add-backfill select {
  padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px;
}

/* post-mode chip on a channel row */
.mode-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.mode-chip:hover { border-color: rgba(108,59,255,0.6); color: var(--text); }
.mode-chip.auto   { color: #5dd39e; border-color: rgba(93,211,158,0.35); }
.mode-chip.review { color: #d9b94a; border-color: rgba(217,185,74,0.35); }

/* Post-now button on a clip card */
.clip-actions button.post-now {
  background: linear-gradient(135deg, #6C3BFF 0%, #00C2FF 100%);
  color: #fff; border: 0;
}
.clip-actions button.post-now:disabled { opacity: 0.55; cursor: default; }
.clip-badge-review {
  display: inline-block; margin-left: 6px;
  padding: 2px 6px; border-radius: 4px; background: rgba(217,185,74,0.15);
  color: #d9b94a; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clips-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 12px;
}
.clips-section-head:first-child { margin-top: 0; }
.clips-section-head .clips-section-title { margin: 0; }
.clips-section-title {
  margin: 20px 0 12px; font-size: 15px; font-weight: 600; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.clips-section-title:first-child { margin-top: 0; }
.btn-sm { font-size: 12px; padding: 4px 12px; }
.clips-count {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); color: var(--text-mute);
}
.pending-card { opacity: 0.95; }
.pending-thumb { font-size: 32px; background: linear-gradient(180deg, #1a1822 0%, #0f0e17 100%); }
.pending-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.pending-badge.pending-downloading { background: rgba(0,194,255,0.12); color: #00c2ff; }
.pending-badge.pending-failed      { background: rgba(255,92,92,0.15);  color: #ff8a8a; }
.pending-error {
  font-size: 12px; color: #ff8a8a; margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; max-height: 36px;
  line-height: 1.3;
}
.pending-yt-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.pending-yt-link:hover { text-decoration: underline; }

/* New compact clip list — single column, elegant rows. */
.clips-list {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
}
.clip-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb body  actions"
    "thumb meta  actions";
  align-items: center; column-gap: 16px; row-gap: 4px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .15s ease, background .15s ease;
  min-width: 0; /* allow children to shrink */
}
.clip-row:hover {
  border-color: rgba(108, 59, 255, 0.35);
  background: rgba(108, 59, 255, 0.03);
}
.clip-row .clip-thumb {
  grid-area: thumb;
  width: 64px; height: 64px; border-radius: 10px;
  background: linear-gradient(135deg, #1a1822 0%, #0f0e17 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  font-size: 24px; color: var(--text-dim);
}
.clip-row .clip-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.clip-row .clip-thumb-icon { color: var(--accent); }
.clip-row-body { grid-area: body; min-width: 0; }
.clip-row-title {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  line-height: 1.3;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clip-row-title > * { flex-shrink: 0; }
.clip-row-title > :first-child {
  flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.clip-row-sub {
  font-size: 12.5px; color: var(--accent); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Meta strip — time range + score bar + status badge, inline below the title. */
.clip-row-meta {
  grid-area: meta;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; min-width: 0;
  margin-top: 2px;
}
.clip-row-range {
  font-size: 12.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.clip-row-range::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-mute, #666); display: inline-block;
}
.clip-row-score {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 1 auto; min-width: 0;
}
.score-bar {
  width: 80px; height: 5px; background: var(--surface);
  border-radius: 999px; overflow: hidden; flex-shrink: 0;
}
.score-bar span { display: block; height: 100%; border-radius: inherit; transition: width .25s ease; }
.score-bar.score-hi  span { background: #2dd66d; }
.score-bar.score-mid span { background: #d9b94a; }
.score-bar.score-lo  span { background: #ff7575; }
.score-num {
  font-size: 11.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; min-width: 30px;
}
.clip-badge {
  display: inline-flex; align-items: center; height: 22px;
  padding: 0 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: lowercase;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border); white-space: nowrap;
}
.clip-badge-ready    { color: #00c2ff; border-color: rgba(0,194,255,0.3);   background: rgba(0,194,255,0.08); }
.clip-badge-posted   { color: #2dd66d; border-color: rgba(45,214,109,0.3);  background: rgba(45,214,109,0.08); }
.clip-badge-posting  { color: #d9b94a; border-color: rgba(217,185,74,0.3);  background: rgba(217,185,74,0.08); }
.clip-badge-failed   { color: #ff7575; border-color: rgba(255,117,117,0.3); background: rgba(255,117,117,0.08); }
.clip-badge-review   { color: #d9b94a; border-color: rgba(217,185,74,0.3);  background: rgba(217,185,74,0.08); }

/* Right-side action stack. */
.clip-row-actions {
  grid-area: actions;
  display: inline-flex; gap: 6px; align-items: center;
  flex-shrink: 0;
}
.btn-post {
  background: linear-gradient(180deg, #2dd66d 0%, #1fb259 100%);
  color: #fff; font-weight: 600; font-size: 12.5px;
  padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
  box-shadow: 0 2px 8px -2px rgba(45,214,109,0.4);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-post:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(45,214,109,0.5);
}
.btn-post:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn-trash {
  background: rgba(255,117,117,0.1);
  color: #ff7575;
  border: 1px solid rgba(255,117,117,0.18);
  width: 34px; height: 34px;
  border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; padding: 0;
  transition: background .12s ease, border-color .12s ease;
}
.btn-trash:hover {
  background: rgba(255,117,117,0.2);
  border-color: rgba(255,117,117,0.35);
}

/* Narrow viewports — stack the meta below the body, hide the score-num to save space */
@media (max-width: 560px) {
  .clip-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    padding: 10px 12px;
  }
  .clip-row .clip-thumb { width: 52px; height: 52px; }
  .clip-row-meta { gap: 10px; }
  .score-bar { width: 60px; }
  .btn-post { padding: 7px 10px; font-size: 12px; }
}

/* Quota bar (replaces plain "10 clips left" chip in app-head). */
.plan-chip.quota-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px;
}
.quota-bar {
  width: 90px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.quota-bar > span { display: block; height: 100%; background: var(--grad, linear-gradient(90deg, #6C3BFF, #00C2FF)); border-radius: inherit; }
.quota-chip.quota-warn .quota-bar > span { background: linear-gradient(90deg, #d9b94a, #ff9f43); }
.quota-chip.quota-full .quota-bar > span { background: linear-gradient(90deg, #ff7575, #ff4757); }
.quota-text { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.quota-plan { color: var(--text); }

/* Quota warning banner above the page content. */
.quota-banner {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px; padding: 12px 16px;
  border-radius: 12px; font-size: 13.5px; line-height: 1.4;
  border: 1px solid;
}
.quota-banner-warn { background: rgba(217,185,74,0.08); border-color: rgba(217,185,74,0.3); color: #f5d97a; }
.quota-banner-full { background: rgba(255,117,117,0.08); border-color: rgba(255,117,117,0.3); color: #ffb3b3; }
.quota-banner .banner-cta {
  margin-left: auto; padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.08); color: inherit; text-decoration: none; font-weight: 600;
}
.quota-banner .banner-cta:hover { background: rgba(255,255,255,0.16); }

/* Per-source-channel settings strip (max clips + destination routing). */
.channel-row.source-row,
.channel-row.destination-row { display: block; padding: 0; }
.channel-row.source-row .channel-row-main,
.channel-row.destination-row .channel-row-main {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px;
}
.src-settings {
  display: flex; flex-direction: column; gap: 16px;
  padding: 14px 16px 16px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.src-setting {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-dim); font-weight: 500;
}
.src-setting select {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 28px 5px 10px; font-size: 12.5px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
/* Max-clips control: prominent stepper + best-only shortcut. */
.src-clipctrl { width: 100%; }
.src-clipctrl-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.src-clipctrl-hint { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.clipnum-stepper {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
}
.clipnum-btn {
  width: 32px; height: 30px; border: 0; background: transparent;
  color: var(--text-dim); font-size: 13px; font-weight: 600;
  border-radius: 7px; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.clipnum-btn:hover { background: var(--surface); color: var(--text); }
.clipnum-btn.active {
  background: linear-gradient(135deg, #6C3BFF 0%, #00C2FF 100%);
  color: #fff; box-shadow: 0 2px 8px -2px rgba(108,59,255,0.5);
}
.best-only-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .12s ease;
}
.best-only-toggle:hover { border-color: rgba(255,215,0,0.4); color: var(--text); }
.best-only-toggle .best-only-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-mute, #555); transition: background .12s ease;
}
.best-only-toggle.on {
  background: rgba(255,215,0,0.1); color: #ffd866;
  border-color: rgba(255,215,0,0.4);
}
.best-only-toggle.on .best-only-dot {
  background: #ffd866; box-shadow: 0 0 6px rgba(255,215,0,0.6);
}

.src-route { flex: 1; min-width: 240px; }
.src-route summary {
  list-style: none; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 4px 0;
}
.src-route summary::-webkit-details-marker { display: none; }
.src-setting-label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.route-pill-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.route-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: rgba(108,59,255,0.14); color: #b6a4ff;
  border: 1px solid rgba(108,59,255,0.3);
  font-size: 11.5px; font-weight: 600;
}
.route-summary { font-size: 12px; color: var(--text-dim); }
.route-summary.route-all { color: #2dd66d; }
.route-summary.route-none { color: #ff8a8a; }
.route-options {
  display: grid; gap: 6px; padding: 12px 0 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.route-opt {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 7px 10px; border-radius: 8px; background: var(--bg-2);
  border: 1px solid var(--border); font-size: 13px; color: var(--text);
  transition: border-color .12s ease;
}
.route-opt:hover { border-color: rgba(108,59,255,0.3); }
.route-opt input { accent-color: #6C3BFF; }
.route-handle { color: var(--text-dim); font-style: normal; font-size: 12px; }
.route-empty { font-size: 12.5px; color: var(--text-dim); padding: 6px 0; }
.route-hint { font-size: 11.5px; color: var(--text-mute); margin: 4px 0 0; }

/* Per-destination caption template editor (collapsible). */
.dst-template {
  border-top: 1px solid var(--border);
  padding: 10px 16px 14px;
  background: rgba(255,255,255,0.015);
}
.dst-template > summary {
  list-style: none; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 4px 0;
}
.dst-template > summary::-webkit-details-marker { display: none; }
.dst-template-preview {
  font-size: 12px; color: var(--text-mute); font-style: italic;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tpl-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 12px;
}
.tpl-field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-dim); font-weight: 500;
  grid-column: span 1;
}
.tpl-field span { letter-spacing: 0.02em; }
.tpl-field textarea, .tpl-field input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 13px;
  resize: vertical;
}
.tpl-field textarea:focus, .tpl-field input:focus {
  outline: none; border-color: var(--accent, #6C3BFF);
}
.tpl-vars {
  grid-column: 1 / -1; font-size: 12px; color: var(--text-mute);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.tpl-var {
  background: var(--bg-2); color: #b6a4ff;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: 11.5px; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tpl-var:hover { border-color: rgba(108,59,255,0.4); }
.tpl-preview-box {
  grid-column: 1 / -1;
  background: var(--bg-2); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px 14px;
}
.tpl-preview-label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mute); margin-bottom: 4px;
}
.tpl-preview {
  font-size: 13px; color: var(--text); white-space: pre-wrap; line-height: 1.4;
}

@media (max-width: 720px) {
  .tpl-grid { grid-template-columns: 1fr; }
}

/* Tiny confirmation toast (used by autosaved per-channel settings). */
.cf-toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-12px);
  background: rgba(15,14,23,0.96); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  font-size: 13px; z-index: 9999; opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.cf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.channel-list { display: grid; gap: 10px; }
.channel-row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color .15s ease, opacity .15s ease;
}
.channel-row:hover { border-color: rgba(108,59,255,0.4); }
.channel-row.off { opacity: 0.5; }
.channel-icon { font-size: 22px; text-align: center; }
.channel-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.channel-platform {
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 4px; background: var(--surface); color: var(--text-dim);
}
.channel-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.channel-actions { display: flex; gap: 8px; }
.channel-actions button {
  padding: 7px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  transition: border-color .15s ease, background .15s ease;
}
.channel-actions button:hover { border-color: rgba(108,59,255,0.5); }
.channel-actions button.ghost { background: transparent; }
.channel-actions button.danger { color: #ff9db2; }
.channel-actions button.danger:hover { border-color: rgba(255,107,138,0.5); background: rgba(255,107,138,0.06); }

/* post-log list on Channels tab */
.log-list { display: grid; gap: 6px; }
.log-row {
  display: grid; grid-template-columns: 160px 1fr 110px 80px; align-items: center;
  gap: 12px; padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px;
}
.log-platform { font-weight: 600; }
.log-caption { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-status { font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
.log-time { color: var(--text-mute); text-align: right; font-size: 12px; }
@media (max-width: 640px) {
  .channel-row { grid-template-columns: 32px 1fr; }
  .channel-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .log-row { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .log-caption { grid-column: 1 / -1; }
  .log-time { text-align: left; }
}
.status-line.err { color: #ff6b8a; }
