:root {
  --bg: #08090e;
  --surface: #12141e;
  --surface-2: #191d2b;
  --surface-3: #22283a;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #fe2c55;
  --accent-2: #25f4ee;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
}

/* Top Bar */
.topbar {
  height: 58px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(12, 14, 22, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 30;
  flex-shrink: 0;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ff7a59);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.creator-select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  max-width: 185px;
  cursor: pointer;
}

.icon-pill {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.icon-pill:hover { color: var(--text); border-color: rgba(255,255,255,0.28); }

.nav-pills {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  background: var(--surface-3);
  color: var(--text);
}

.budget-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(37, 244, 238, 0.08);
  border: 1px solid rgba(37, 244, 238, 0.22);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Main stage */
.main-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ===== VERTICAL TIKTOK / SHORTS FEED ===== */
.feed-wrapper {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.feed-wrapper::-webkit-scrollbar { display: none; }

.feed-slide {
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  position: relative;
}

.reel-frame {
  position: relative;
  height: 100%;
  max-height: 860px;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.reel-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(circle at center, #1d2236, #0b0d14);
  padding: 24px;
  text-align: center;
}

.reel-top-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 6;
}

.reel-top-hud > * { pointer-events: auto; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.status-badge.approved, .status-badge.scheduled, .status-badge.published {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}
.status-badge.rejected, .status-badge.failed {
  background: rgba(239, 68, 68, 0.26);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}
.status-badge.generating, .status-badge.regenerating {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fcd34d;
}

.cost-badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  cursor: pointer;
}

/* Right-side TikTok/Shorts Action Rail */
.action-rail {
  position: absolute;
  right: 10px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: calc(100% - 76px);
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 5;
}
.action-rail::-webkit-scrollbar { display: none; }

.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.rail-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: rgba(12, 14, 22, 0.68);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.14s, background 0.14s, border-color 0.14s;
  position: relative;
}
.rail-btn:active .rail-circle { transform: scale(0.92); }
.rail-btn.active-approve .rail-circle {
  background: var(--green);
  border-color: #6ee7b7;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.55);
}
.rail-btn.active-reject .rail-circle {
  background: var(--red);
  border-color: #fca5a5;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.55);
}
.rail-btn span {
  font-size: 10.5px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.rail-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* Bottom-left Overlay (TikTok style) */
.reel-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 46px 68px 26px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.42) 60%, transparent 100%);
  pointer-events: none;
}
.reel-bottom > * { pointer-events: auto; }

/* Center Pause Indicator (TikTok style) */
.reel-pause-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.94);
  display: grid;
  place-items: center;
  font-size: 24px;
  padding-left: 4px;
  pointer-events: none;
  z-index: 6;
}
.reel-pause-badge.hidden { display: none; }

/* TikTok / Shorts Bottom Scrubber Bar */
.reel-scrubber {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  display: flex;
  align-items: flex-end;
  padding: 0 0 2px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  z-index: 8;
}
.reel-scrub-track {
  position: relative;
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 0.14s ease, background 0.14s ease;
}
.reel-scrubber:hover .reel-scrub-track,
.reel-scrubber.scrubbing .reel-scrub-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.38);
}
.reel-scrub-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #25f4ee);
  pointer-events: none;
}
.reel-scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0.85;
  transition: transform 0.14s ease, opacity 0.14s ease;
  pointer-events: none;
}
.reel-scrubber:hover .reel-scrub-thumb,
.reel-scrubber.scrubbing .reel-scrub-thumb {
  transform: translate(-50%, -50%) scale(1.25);
  opacity: 1;
}
.reel-scrub-time {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 14, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.reel-scrubber.scrubbing .reel-scrub-time {
  opacity: 1;
}

.reel-handle {
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attempt-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.reel-title {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 700;
}

.reel-caption {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-sched-line {
  margin-top: 6px;
  font-size: 11.5px;
  color: #93c5fd;
  font-weight: 600;
}

.feed-nav-hint {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 15;
}

.feed-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.feed-arrow:hover { background: var(--surface-3); }

/* ===== SCROLLABLE PAGES (Create / List / Schedule / Analytics) ===== */
.page-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 18px 16px 86px;
}

.container {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.page-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.stat-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.stat-val { font-size: 20px; font-weight: 800; margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Inputs & Buttons */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-muted); }

.input, .textarea, .select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
}
.textarea { min-height: 82px; resize: vertical; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: filter 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.success { background: var(--green); color: #042f2e; }
.btn.danger { background: var(--red); color: #fff; }
.btn.secondary { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.count-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.count-pill {
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.count-pill.active {
  background: rgba(254, 44, 85, 0.18);
  border-color: var(--accent);
  color: #fff;
}

/* Feedback Chips */
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.chip.selected {
  background: rgba(254, 44, 85, 0.22);
  border-color: var(--accent);
  color: #fff;
}
.chip.ai-badge {
  border-color: rgba(37, 244, 238, 0.4);
}
.chip-count {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Bars & Progress */
.bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}
.bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #fb923c);
}
.bar-fill.teal {
  background: linear-gradient(90deg, #06b6d4, var(--accent-2));
}

/* Insight Card */
.insight-item {
  background: var(--surface-2);
  border: 1px solid rgba(37, 244, 238, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.insight-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.impact-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  white-space: nowrap;
}

/* Table / List */
.video-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.video-row-main { min-width: 220px; flex: 1; }
.video-row-title { font-weight: 700; font-size: 14px; }
.video-row-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.video-row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Platform cards */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.platform-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.platform-card.enabled { border-color: rgba(16, 185, 129, 0.45); }
.platform-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cred-ok { color: #6ee7b7; font-size: 11.5px; font-weight: 700; }
.cred-miss { color: #fbbf24; font-size: 11px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet-backdrop.hidden { display: none; }
.sheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: 84dvh;
  overflow-y: auto;
  background: var(--surface);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--border);
  padding: 18px 18px 26px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sheet-close {
  background: var(--surface-3);
  border: none;
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
}

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 80;
}
.toast.hidden { display: none; }

/* Mobile Nav */
.mobile-nav {
  display: none;
  height: 60px;
  background: rgba(12, 14, 22, 0.96);
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(5, 1fr);
  flex-shrink: 0;
  z-index: 30;
}
.mobile-nav.has-admin {
  grid-template-columns: repeat(6, 1fr);
}
.mnav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 18px;
  cursor: pointer;
}
.mnav-btn small { font-size: 10px; font-weight: 700; }
.mnav-btn.active { color: #fff; }

.hidden { display: none !important; }

/* Topbar right & Account pill */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-pill {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.account-pill:hover {
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Auth Screen */
.auth-screen {
  height: 100dvh;
  width: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 18% 15%, rgba(254, 44, 85, 0.16), transparent 42%),
    radial-gradient(circle at 82% 85%, rgba(37, 244, 238, 0.12), transparent 45%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.auth-brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #ff7a59);
  display: grid;
  place-items: center;
  font-size: 21px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--surface-3);
  color: var(--text);
}
.auth-error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.demo-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(37, 244, 238, 0.06);
  border: 1px dashed rgba(37, 244, 238, 0.32);
  font-size: 12px;
}

/* Connections & Guides */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 13px;
}
.alert-banner.ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.38);
}

.conn-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.conn-card.connected {
  border-color: rgba(16, 185, 129, 0.45);
}
.conn-card.highlight {
  box-shadow: 0 0 0 2px var(--accent-2);
}
.conn-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.conn-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pill-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.pill-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.38);
}
.pill-diff {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.guide-box {
  background: rgba(8, 9, 14, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}
.guide-box summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-2);
  user-select: none;
}
.guide-steps {
  margin: 8px 0 10px;
  padding-left: 18px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.ext-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.42);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.ext-link-btn:hover {
  background: rgba(59, 130, 246, 0.26);
  color: #fff;
}

.conn-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.oauth-btn {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  text-decoration: none;
}
.oauth-btn.muted {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.copy-uri {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  overflow-x: auto;
}
.copy-uri.invalid {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.08);
  opacity: 0.85;
}
.oauth-origin-banner {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.oauth-origin-banner.invalid {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.09);
}
.oauth-origin-banner.valid {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.yt-summary-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.yt-sched-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.yt-sched-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.yt-sched-item.is-scheduled {
  border-color: rgba(59, 130, 246, 0.38);
  background: rgba(59, 130, 246, 0.06);
}
.yt-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}
.yt-thumb-empty {
  display: grid;
  place-items: center;
  font-size: 22px;
}
.yt-sched-main {
  flex: 1;
  min-width: 0;
}
.yt-sched-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  word-break: break-word;
}
.yt-sched-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.yt-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}
.yt-badge.sf {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}
.yt-badge.manual {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.yt-inline-link {
  color: #93c5fd;
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}
.yt-inline-link:hover {
  text-decoration: underline;
}

.yt-thumb-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}
.yt-thumb-btn .yt-thumb {
  display: block;
}
.yt-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  transition: background 0.15s ease;
}
.yt-thumb-btn:hover .yt-thumb-play,
.yt-thumb-btn:active .yt-thumb-play {
  background: rgba(0, 0, 0, 0.48);
}
.yt-title-play-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.yt-title-play-btn:hover {
  color: #93c5fd;
}
.preview-player-wrap {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  max-height: 62vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview-player-video,
.preview-player-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  display: block;
}
.preview-private-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.preview-private-img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.vm-catalog-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vm-card {
  border-radius: 11px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.vm-card.active {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.08);
}
.vm-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.vm-card-title {
  font-size: 13.5px;
  font-weight: 800;
}
.vm-card-id {
  font-size: 10.5px;
  color: var(--text-muted);
}
.vm-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.vm-card-caps {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 4px;
}
.vm-res-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.vm-res-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.vm-res-pill:hover {
  border-color: rgba(139, 92, 246, 0.55);
}
.vm-res-pill.active {
  border-color: #a78bfa;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(59, 130, 246, 0.25));
}
.vm-res-name {
  font-size: 12px;
  font-weight: 800;
}
.vm-res-rate {
  font-size: 11px;
  color: #93c5fd;
  font-weight: 600;
}
.vm-res-total {
  font-size: 10.5px;
  color: var(--text-muted);
}

@media (max-width: 780px) {
  .nav-pills, .feed-nav-hint, .hide-mobile { display: none !important; }
  .mobile-nav { display: grid; }
  .grid-2, .grid-4, .conn-grid { grid-template-columns: 1fr; }
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .brand-area {
    flex: 1;
    min-width: 0;
    gap: 6px;
  }
  .brand-logo {
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 8px;
  }
  .creator-select {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 6px 8px;
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .icon-pill {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.28);
    background: var(--surface-2);
  }
  .topbar-right {
    flex-shrink: 0;
    gap: 6px;
  }
  .budget-pill {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .account-pill {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }
  .feed-slide { padding: 0; }
  .reel-frame {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    aspect-ratio: auto;
  }
  .action-rail {
    right: 8px;
    bottom: 24px;
    gap: 7px;
    max-height: calc(100% - 76px);
  }
  .rail-circle {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
  .rail-btn span {
    font-size: 9.5px;
  }
  .reel-bottom {
    padding: 36px 64px 24px 12px;
  }
}

/* ===== LIVE BACKGROUND JOBS BANNER & QUEUE CARDS ===== */
.jobs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(37, 244, 238, 0.12));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12px;
  flex-shrink: 0;
  z-index: 25;
}
.jobs-bar.hidden { display: none; }
.jobs-bar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.jobs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.85);
  animation: sfPulse 1.2s ease-in-out infinite;
}
.jobs-bar-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fef3c7;
  font-weight: 600;
}
.job-queue-card {
  border: 1px solid rgba(245, 158, 11, 0.38);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.65));
}
.job-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}
.job-item:last-child { margin-bottom: 0; }
.job-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.job-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.job-item-stage {
  font-size: 12px;
  color: #fcd34d;
  margin-top: 4px;
  font-weight: 600;
}
.job-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 8px;
}
.job-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #25f4ee);
  transition: width 0.5s ease;
}
@keyframes sfPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

@media (max-width: 430px) {
  .budget-pill { display: none; }
}

@media (max-width: 360px) {
  .brand-logo { display: none; }
}
