/* =========================================================
   VIRALCUT AI — App Styles
   Comprehensive SaaS dashboard
========================================================= */

:root {
  --bg: #07070b;
  --bg-2: #0c0c14;
  --bg-3: #11111c;
  --bg-4: #161624;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-3: rgba(255, 255, 255, 0.2);
  --text: #f5f5fb;
  --text-dim: #a8a8c0;
  --text-mute: #6b6b85;
  --purple: #7c3aed;
  --purple-2: #a855f7;
  --cyan: #00d4ff;
  --pink: #ec4899;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
  --orange: #fb923c;
  --grad: linear-gradient(135deg, #7c3aed 0%, #00d4ff 100%);
  --grad-2: linear-gradient(135deg, #ec4899 0%, #7c3aed 50%, #00d4ff 100%);
  --grad-warm: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --grad-cool: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --shadow-glow: 0 20px 60px -20px rgba(124, 58, 237, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 8px;
  font-weight: 600;
}

/* Aurora */
.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 58, 237, 0.15), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(0, 212, 255, 0.08), transparent 60%),
    var(--bg);
}
.aurora__blob {
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 18s ease-in-out infinite;
}
.aurora__blob--purple { background: #7c3aed; top: -150px; left: -100px; }
.aurora__blob--cyan { background: #00d4ff; bottom: -200px; right: -150px; animation-delay: -6s; }
.aurora__noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: overlay;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn--lg { padding: 14px 22px; font-size: 14px; border-radius: 12px; }
.btn--sm { padding: 7px 12px; font-size: 12px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--grad); color: white; box-shadow: 0 8px 24px -8px rgba(124, 58, 237, 0.6); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(124, 58, 237, 0.8); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-3); }
.btn--danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }

/* ===========================
   APP LAYOUT
=========================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: rgba(7, 7, 11, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; letter-spacing: 0.04em; padding: 6px 8px; margin-bottom: 18px; }
.brand__mark { display: inline-flex; }
.brand__name { font-size: 16px; }
.brand__name-ai { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav__label { font-size: 10px; letter-spacing: 0.14em; color: var(--text-mute); padding: 14px 10px 4px; font-weight: 700; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.side-nav a:hover { background: var(--surface); color: var(--text); }
.side-nav a.is-active { background: linear-gradient(90deg, rgba(124,58,237,0.18), rgba(0,212,255,0.06)); color: var(--text); box-shadow: inset 2px 0 0 var(--purple-2); }
.side-nav a span { width: 18px; text-align: center; font-size: 14px; }

.sidebar__upload {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--grad);
  border-radius: 12px;
  color: white;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 12px 30px -10px rgba(124, 58, 237, 0.6);
  transition: transform 0.15s;
}
.sidebar__upload:hover { transform: translateY(-1px); }
.sidebar__upload span { font-size: 16px; }

.sidebar__profile {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  color: white;
  flex-shrink: 0;
}
.sidebar__profile-info { flex: 1; min-width: 0; }
.sidebar__profile-name { font-size: 12px; font-weight: 600; }
.sidebar__profile-plan { font-size: 10px; color: var(--text-mute); }

.sidebar__storage { padding: 8px 10px 12px; }
.sidebar__storage-info { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-mute); margin-bottom: 6px; }
.sidebar__storage-info b { color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.storage-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.storage-bar span { display: block; height: 100%; background: var(--grad); }

/* MAIN */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 7, 11, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 16px;
}
.topbar__crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-mute); min-width: 180px; }
.topbar__crumbs span:last-child { color: var(--text); font-weight: 500; }
.topbar__search {
  flex: 1; max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text-mute);
}
.topbar__search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 13px; }
.topbar__search input::placeholder { color: var(--text-mute); }
.topbar__search kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; padding: 2px 6px;
  background: rgba(255,255,255,0.06); border-radius: 4px;
  color: var(--text-dim);
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim);
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot-badge {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--bg);
}

.view { padding: 28px; min-height: calc(100vh - var(--topbar-h)); }
.view-header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-header h1 { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.view-header p { color: var(--text-dim); margin: 4px 0 0; font-size: 13px; }
.view-header__actions { display: flex; gap: 8px; }

/* ===========================
   HOME
=========================== */
.home-hero {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(0,212,255,0.06));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; top: -50%; right: -10%; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.3), transparent 70%);
  filter: blur(60px);
}
.home-hero__greeting { font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.home-hero h2 { font-family: 'Space Grotesk', sans-serif; font-size: 36px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; position: relative; }
.home-hero p { color: var(--text-dim); margin: 0 0 22px; position: relative; }
.home-hero__actions { display: flex; gap: 10px; position: relative; }
.home-youtube-import {
  display:grid; grid-template-columns:auto minmax(220px,.8fr) minmax(360px,1.4fr); align-items:center; gap:14px 18px;
  margin-top:26px; padding:16px; border:1px solid rgba(255,255,255,.12); border-radius:14px;
  background:rgba(6,7,13,.46); backdrop-filter:blur(10px); position:relative;
}
.home-youtube-import__icon { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:#ff2638; color:#fff; box-shadow:0 8px 22px rgba(255,38,56,.22); }
.home-youtube-import label { display:flex; flex-direction:column; gap:4px; }
.home-youtube-import label b { color:var(--text); font-size:14px; }
.home-youtube-import label span,.home-youtube-import small { color:var(--text-dim); font-size:11px; line-height:1.4; }
.home-youtube-import__control { display:flex; gap:8px; min-width:0; }
.home-youtube-import__control input { flex:1; min-width:0; padding:11px 13px; border:1px solid var(--border-2); border-radius:10px; outline:none; background:var(--bg-3); color:var(--text); }
.home-youtube-import__control input:focus { border-color:var(--purple-2); box-shadow:0 0 0 3px rgba(124,58,237,.12); }
.home-youtube-import__control .btn { white-space:nowrap; }
.home-youtube-import small { grid-column:2/-1; margin-top:-8px; }
@media(max-width:1100px){.home-youtube-import{grid-template-columns:auto 1fr}.home-youtube-import__control{grid-column:1/-1}.home-youtube-import small{grid-column:1/-1;margin-top:0}}
@media(max-width:680px){.home-youtube-import{grid-template-columns:1fr}.home-youtube-import__icon{display:none}.home-youtube-import__control{grid-column:auto;flex-direction:column}.home-youtube-import small{grid-column:auto}.home-youtube-import__control .btn{width:100%}}

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 32px 0 14px;
}
.section-title h3 { font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 600; margin: 0; }
.section-title a { font-size: 12px; color: var(--text-dim); }
.section-title a:hover { color: var(--text); }

/* ===========================
   COMMAND CENTER
=========================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi:hover { border-color: var(--border-3); transform: translateY(-2px); }
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad); opacity: 0.5;
}
.kpi--green::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.kpi--purple::before { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.kpi--cyan::before { background: linear-gradient(90deg, var(--cyan), var(--purple-2)); }
.kpi--warm::before { background: linear-gradient(90deg, var(--orange), var(--pink)); }
.kpi__label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi__icon { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; }
.kpi__value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px; font-weight: 700; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi__value--white { color: var(--text); -webkit-text-fill-color: var(--text); }
.kpi__delta { font-size: 11px; margin-top: 6px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.kpi__delta--down { color: var(--red); }

.cc-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.cc-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card__title { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; margin: 0; }
.card__sub { font-size: 11px; color: var(--text-mute); }

/* Score trend chart */
.chart-container { height: 220px; position: relative; }

/* Best opportunity highlight */
.best-opp {
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(236,72,153,0.08));
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: var(--radius); padding: 18px;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 14px; align-items: center;
}
.best-opp__ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: conic-gradient(var(--grad-2) 96%, rgba(255,255,255,0.06) 0);
  display: grid; place-items: center;
  position: relative;
}
.best-opp__ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg); }
.best-opp__ring span { position: relative; font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.best-opp__hook { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.best-opp__meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap; }

/* ===========================
   OPPORTUNITIES FEED
=========================== */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.filter-bar__search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; min-width: 200px;
}
.filter-bar__search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 12px; }
.filter-bar__search svg { color: var(--text-mute); }
.filter-chip {
  padding: 6px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-2); }
.filter-chip.is-active { background: var(--grad); color: white; border-color: transparent; }

.opp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.opp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.opp-card:hover { transform: translateY(-3px); border-color: rgba(124,58,237,0.4); }
.opp-card__thumb {
  position: relative; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e1b4b, #7c3aed);
  overflow: hidden;
}
.opp-card__thumb--a { background: linear-gradient(135deg, #4c1d95, #ec4899); }
.opp-card__thumb--b { background: linear-gradient(135deg, #1e1b4b, #7c3aed); }
.opp-card__thumb--c { background: linear-gradient(135deg, #0c4a6e, #00d4ff); }
.opp-card__thumb--d { background: linear-gradient(135deg, #7c2d12, #f97316); }
.opp-card__thumb--e { background: linear-gradient(135deg, #831843, #ec4899); }
.opp-card__thumb--f { background: linear-gradient(135deg, #064e3b, #22c55e); }
.opp-card__thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85));
  padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.opp-card__time-row { display: flex; justify-content: space-between; align-items: center; }
.opp-card__time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; padding: 3px 7px; border-radius: 4px;
  background: rgba(0,0,0,0.6);
}
.opp-card__duration { font-size: 11px; color: var(--text); }
.opp-card__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.95); color: black;
  display: grid; place-items: center;
  font-size: 14px; padding-left: 3px;
}
.opp-card__body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.opp-card__hook { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.35; }
.opp-card__why { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; flex: 1; }
.opp-card__tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }

.tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px; padding: 3px 7px; border-radius: 4px;
  font-weight: 700; letter-spacing: 0.05em;
  background: rgba(124,58,237,0.15); color: #c4b5fd;
}
.tag--purple { background: rgba(124,58,237,0.18); color: #c4b5fd; }
.tag--cyan { background: rgba(0,212,255,0.15); color: #67e8f9; }
.tag--pink { background: rgba(236,72,153,0.18); color: #f9a8d4; }
.tag--green { background: rgba(34,197,94,0.18); color: #86efac; }
.tag--yellow { background: rgba(250,204,21,0.18); color: #fde68a; }
.tag--red { background: rgba(239,68,68,0.18); color: #fca5a5; }
.tag--orange { background: rgba(251,146,60,0.18); color: #fdba74; }
.tag--score { background: var(--grad); color: white; }
.tag--blue { background: rgba(59,130,246,0.18); color: #93c5fd; }

.opp-card__score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.score-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.score-bar span { display: block; height: 100%; background: var(--grad); border-radius: 3px; transition: width 1.4s cubic-bezier(.2,.7,.2,1); }
.score-bar--green span { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.score-bar--yellow span { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.score-bar--red span { background: linear-gradient(90deg, var(--red), var(--orange)); }
.score-num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; min-width: 36px; text-align: right; }
.score-num--green { color: var(--green); }
.score-num--yellow { color: var(--yellow); }
.score-num--red { color: var(--red); }

.opp-card__actions { display: flex; gap: 6px; }
.opp-card__action {
  flex: 1; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.opp-card__action:hover { background: var(--surface-3); color: var(--text); }
.opp-card__action--primary { background: var(--grad); color: white; border-color: transparent; }
.opp-card__action--primary:hover { box-shadow: 0 6px 18px -6px rgba(124,58,237,0.6); }

/* ===========================
   PROJECT / VIDEO DETAIL
=========================== */
.project-header {
  display: flex; gap: 18px; align-items: center;
  padding: 18px;
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(0,212,255,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.project-header__thumb {
  width: 120px; aspect-ratio: 16/9;
  border-radius: 10px;
  background: linear-gradient(135deg, #4c1d95, #ec4899);
  flex-shrink: 0;
}
.project-header__info h1 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; margin: 0; }
.project-header__meta { display: flex; gap: 16px; margin-top: 6px; color: var(--text-dim); font-size: 12px; flex-wrap: wrap; }
.project-header__meta b { color: var(--text); font-weight: 600; }

.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  padding: 10px 14px;
  font-size: 13px; color: var(--text-dim);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--purple-2); }

/* SMART TIMELINE */
.timeline-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.timeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.timeline-header h3 { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; margin: 0; }
.timeline-legend { display: flex; gap: 12px; font-size: 10px; color: var(--text-mute); }
.timeline-legend span { display: flex; align-items: center; gap: 4px; }
.timeline-legend span::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: 0.7; }

.timeline-row { margin-bottom: 12px; }
.timeline-row__label { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; display: flex; justify-content: space-between; }
.timeline-track { height: 36px; background: var(--bg-3); border-radius: 6px; position: relative; overflow: hidden; }
.timeline-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; }
.timeline-marker {
  position: absolute; top: 0; bottom: 0; width: 4px;
  border-radius: 2px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.timeline-marker__tip {
  position: absolute; bottom: 100%; transform: translateX(-50%) translateY(-4px);
  background: var(--bg-4); border: 1px solid var(--border-2);
  border-radius: 6px; padding: 6px 8px; font-size: 11px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.timeline-marker:hover .timeline-marker__tip { opacity: 1; }

.waveform { display: flex; align-items: center; height: 36px; gap: 1px; padding: 0 2px; }
.waveform span { flex: 1; background: linear-gradient(180deg, var(--purple-2), var(--cyan)); border-radius: 1px; opacity: 0.6; }

.heatmap-bar { display: flex; align-items: end; gap: 1px; height: 50px; padding: 0 2px; }
.heatmap-bar span { flex: 1; background: var(--grad); border-radius: 1px 1px 0 0; min-height: 4px; transition: opacity 0.2s; cursor: pointer; }
.heatmap-bar span:hover { opacity: 1 !important; }

.timeline-transcript {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  max-height: 280px; overflow-y: auto;
  font-size: 13px; line-height: 1.7;
}
.timeline-transcript p { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; transition: background 0.15s; }
.timeline-transcript p:hover { background: var(--surface-2); }
.timeline-transcript .ts { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-mute); margin-right: 10px; }
.timeline-transcript mark { background: rgba(124,58,237,0.25); color: #c4b5fd; padding: 1px 3px; border-radius: 3px; }

/* ===========================
   CLIP DETAIL (MODAL)
=========================== */
.clip-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.clip-modal__close {
  position: fixed; top: 20px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-2);
  font-size: 24px; color: var(--text);
  display: grid; place-items: center;
  z-index: 110;
}
.clip-modal__close:hover { background: var(--surface-3); }

.clip-detail {
  width: 100%; max-width: 1200px;
  display: grid; grid-template-columns: 360px 1fr; gap: 28px;
  margin-top: 20px;
}
.clip-preview {
  position: sticky; top: 20px;
  background: linear-gradient(180deg, #0a0a14, #1a0a2a);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-glow);
}
.clip-preview__phone {
  aspect-ratio: 9/16;
  background: linear-gradient(135deg, #1e1b4b, #7c3aed, #ec4899);
  border-radius: 22px;
  position: relative; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(124,58,237,0.7);
}
.clip-preview__face {
  position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%);
  width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
  border-radius: 50%;
}
.clip-preview__caption {
  position: absolute; bottom: 14%; left: 8%; right: 8%;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px; font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.clip-preview__caption .hi { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 22px; }
.clip-preview__progress {
  position: absolute; bottom: 8%; left: 8%; right: 8%;
  height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px;
}
.clip-preview__progress span { display: block; height: 100%; width: 32%; background: white; border-radius: 2px; }

.clip-info { display: flex; flex-direction: column; gap: 18px; }
.clip-score-hero {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(236,72,153,0.06));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--radius); padding: 20px;
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
}
.clip-score-hero__ring {
  width: 110px; height: 110px; border-radius: 50%;
  background: conic-gradient(var(--grad-2) var(--p, 90%), rgba(255,255,255,0.06) 0);
  display: grid; place-items: center;
  position: relative;
}
.clip-score-hero__ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-2); }
.clip-score-hero__ring-inner {
  position: relative; text-align: center;
}
.clip-score-hero__ring-inner b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 700; line-height: 1; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.clip-score-hero__ring-inner small { font-size: 10px; color: var(--text-mute); letter-spacing: 0.1em; }
.clip-score-hero h2 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.clip-score-hero__sub { color: var(--text-dim); font-size: 13px; }

.score-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px;
}
.score-row b { font-family: 'JetBrains Mono', monospace; color: var(--purple-2); }
.score-row__bar { width: 60px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.score-row__bar span { display: block; height: 100%; background: var(--grad); }

.why-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.why-list li {
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
}
.why-list li span { font-size: 16px; }

.hook-box {
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(124,58,237,0.06));
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: var(--radius); padding: 16px;
}
.hook-box__label { font-size: 10px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin-bottom: 6px; }
.hook-box__text { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 600; line-height: 1.3; }

.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.platform-card {
  padding: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; text-align: center;
}
.platform-card__icon { font-size: 20px; margin-bottom: 4px; }
.platform-card__name { font-size: 11px; font-weight: 600; }
.platform-card__fit { font-size: 10px; color: var(--green); margin-top: 2px; }

.clip-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.clip-actions .btn { flex: 1; min-width: 130px; }

/* ===========================
   HOOK LAB
=========================== */
.hook-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hook-lab__group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.hook-lab__group h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  margin: 0 0 12px; color: var(--text-mute);
  display: flex; align-items: center; gap: 6px;
}
.hook-option {
  padding: 12px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  font-size: 13px; line-height: 1.4;
}
.hook-option:hover { border-color: var(--purple-2); background: var(--bg-4); }
.hook-option.is-selected { border-color: var(--purple-2); background: rgba(124,58,237,0.1); box-shadow: inset 0 0 0 1px var(--purple-2); }
.hook-option__badge { font-size: 9px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; font-weight: 700; }

/* ===========================
   EDITOR
=========================== */
.editor {
  display: grid; grid-template-columns: 280px 1fr 320px; gap: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  min-height: 600px;
}
.editor__panel {
  background: var(--bg-3);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
}
.editor__panel:last-child { border-right: none; border-left: 1px solid var(--border); }
.editor__center {
  background: linear-gradient(180deg, #0a0a14, #050509);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 30px;
  position: relative;
}
.editor__phone-frame {
  width: 270px; aspect-ratio: 9/16;
  background: #000;
  border-radius: 22px;
  border: 4px solid #2a2a3a;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(124,58,237,0.5);
}
.editor__phone-video {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1e1b4b, #7c3aed, #ec4899);
  display: flex; align-items: center; justify-content: center;
}
.editor__face {
  width: 65%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 70%);
  border-radius: 50%;
}
.editor__caption {
  position: absolute; bottom: 16%; left: 5%; right: 5%;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  line-height: 1.2;
}
.editor__caption .w { display: inline; }
.editor__caption .w--hl { color: var(--cyan); background: rgba(0,212,255,0.15); padding: 0 3px; border-radius: 2px; }
.editor__progress { position: absolute; bottom: 8%; left: 5%; right: 5%; height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px; }
.editor__progress span { display: block; height: 100%; width: 38%; background: white; border-radius: 2px; }

.editor__controls { display: flex; gap: 8px; margin-top: 18px; }
.editor__play {
  width: 48px; height: 48px; border-radius: 50%;
  background: white; color: black;
  display: grid; place-items: center; font-size: 14px;
}

.editor__timeline {
  height: 90px; background: var(--bg-3);
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.editor__time-ruler { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-mute); }
.editor__track { flex: 1; background: var(--bg-4); border-radius: 4px; position: relative; }
.editor__clip {
  position: absolute; top: 4px; bottom: 4px; left: 4%; width: 50%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 3px;
  display: flex; align-items: center; padding: 0 8px;
  font-size: 10px; color: white; font-weight: 600;
}
.editor__playhead {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--cyan); left: 28%;
  box-shadow: 0 0 8px var(--cyan);
}
.editor__playhead::before { content: ''; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; background: var(--cyan); border-radius: 50%; }

.panel-section { margin-bottom: 22px; }
.panel-section h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  margin: 0 0 10px; color: var(--text-mute);
}
.panel-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.panel-row:last-child { border-bottom: none; }
.panel-row label { color: var(--text-dim); }
.panel-row select, .panel-row input[type="text"] {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; font-size: 11px; color: var(--text); outline: none;
}
.toggle { position: relative; width: 34px; height: 18px; background: var(--bg-4); border-radius: 9px; cursor: pointer; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--text-dim); border-radius: 50%; transition: all 0.2s; }
.toggle.is-on { background: var(--grad); }
.toggle.is-on::after { left: 18px; background: white; }

.caption-style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.caption-style {
  padding: 10px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; text-align: center; font-size: 10px; font-weight: 700;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.05em;
}
.caption-style:hover { border-color: var(--border-2); }
.caption-style.is-active { border-color: var(--purple-2); color: var(--purple-2); }

/* ===========================
   PIPELINE (KANBAN)
=========================== */
.kanban {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  min-height: 500px;
}
.kanban-col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column;
}
.kanban-col__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
.kanban-col__title { font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 6px; }
.kanban-col__count { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-mute); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px; cursor: grab;
  transition: transform 0.15s, border-color 0.15s;
}
.kanban-card:hover { transform: translateY(-2px); border-color: var(--border-2); }
.kanban-card__thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, #4c1d95, #ec4899); border-radius: 6px; margin-bottom: 8px; position: relative; overflow: hidden; }
.kanban-card__thumb--b { background: linear-gradient(135deg, #1e1b4b, #7c3aed); }
.kanban-card__thumb--c { background: linear-gradient(135deg, #0c4a6e, #00d4ff); }
.kanban-card__thumb--d { background: linear-gradient(135deg, #7c2d12, #f97316); }
.kanban-card__score { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.7); color: white; font-family: 'Space Grotesk', sans-serif; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.kanban-card__hook { font-size: 12px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.kanban-card__meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-mute); }

/* ===========================
   CONTENT DNA
=========================== */
.dna-hero {
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(124,58,237,0.08));
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.dna-hero::before {
  content: '🧬';
  position: absolute; top: 10px; right: 20px;
  font-size: 80px; opacity: 0.15;
}
.dna-hero h2 { font-family: 'Space Grotesk', sans-serif; font-size: 22px; margin: 0 0 8px; font-weight: 700; }
.dna-hero p { color: var(--text-dim); margin: 0; max-width: 70%; font-size: 13px; }

.dna-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dna-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.dna-stat__head { display: flex; justify-content: space-between; align-items: center; }
.dna-stat__title { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.dna-stat__value { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 700; }
.dna-stat__bar { height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.dna-stat__bar span { display: block; height: 100%; background: var(--grad); border-radius: 4px; }

/* ===========================
   AI STRATEGIST CHAT
=========================== */
.strategist-context-bar {
  display:grid; grid-template-columns:minmax(220px,.8fr) minmax(320px,1.6fr) auto; align-items:end; gap:16px;
  margin-bottom:14px; padding:16px 18px; border:1px solid rgba(124,58,237,.32); border-radius:var(--radius);
  background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(0,212,255,.05));
}
.strategist-context-bar label { display:flex; flex-direction:column; gap:5px; }
.strategist-context-bar .project-select { margin:0; min-height:44px; font-size:13px; }
.strategist-context-status { display:flex; align-items:center; gap:8px; min-height:44px; color:var(--green); font-size:12px; white-space:nowrap; }
.strategist-context-status i { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px rgba(23,213,118,.12); }
.chat-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 14px;
  min-height: 600px;
}
.chat-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.chat-history { list-style: none; padding: 0; margin: 12px 0 0; }
.chat-history li { padding: 8px 10px; border-radius: 8px; font-size: 12px; color: var(--text-dim); cursor: pointer; transition: background 0.15s; margin-bottom: 2px; }
.chat-history li:hover { background: var(--surface-2); color: var(--text); }
.chat-history li.is-active { background: var(--surface-2); color: var(--text); }
.chat-history li small { display: block; font-size: 10px; color: var(--text-mute); margin-top: 2px; }
.strategy-project-summary { display:flex; flex-direction:column; gap:5px; margin:12px 0; padding:12px; border:1px solid var(--border); border-radius:9px; background:var(--bg-3); }
.strategy-project-summary b { font-size:12px; line-height:1.4; }
.strategy-project-summary span { color:var(--text-mute); font-size:10px; line-height:1.45; }
.strategy-answer-project { display:block; margin-bottom:9px; color:var(--cyan); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }

.chat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
}
.chat__head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.chat__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  font-size: 18px;
}
.chat__title { font-weight: 600; }
.chat__sub { font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.chat__sub::before { content: ''; width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 6px var(--green); }
.chat__msgs { flex: 1; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 75%; }
.msg--user { align-self: flex-end; }
.msg--ai { align-self: flex-start; }
.msg__bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.5;
}
.msg--user .msg__bubble { background: var(--grad); color: white; border-bottom-right-radius: 4px; }
.msg--ai .msg__bubble { background: var(--bg-3); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg__suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg__suggestions button {
  padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 11px; color: var(--text-dim);
}
.msg__suggestions button:hover { color: var(--text); border-color: var(--border-2); }
.chat__input { padding: 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat__input input {
  flex: 1; padding: 10px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 13px; outline: none;
}
.chat__input input:focus { border-color: var(--purple-2); }
.chat__send {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--grad); display: grid; place-items: center; color: white;
}

/* ===========================
   ANALYTICS
=========================== */
.analytics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.analytics-chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.bar-chart { display: flex; align-items: end; gap: 6px; height: 180px; padding: 0 4px; }
.bar-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart__bar {
  width: 100%; background: var(--grad); border-radius: 4px 4px 0 0;
  min-height: 4px; transition: opacity 0.2s; cursor: pointer; position: relative;
}
.bar-chart__bar:hover { opacity: 0.8; }
.bar-chart__bar:hover::after {
  content: attr(data-val); position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text); background: var(--bg-4); padding: 2px 6px; border-radius: 4px;
  white-space: nowrap;
}
.bar-chart__label { font-size: 10px; color: var(--text-mute); }

.pva-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pva-table th, .pva-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.pva-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); font-weight: 600; }
.pva-table tr:hover td { background: var(--surface-2); }
.pva-score { font-family: 'Space Grotesk', sans-serif; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===========================
   COMPARATOR
=========================== */
.comparator-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 18px;
}
.comp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: border-color 0.2s;
}
.comp-card.is-selected { border-color: var(--purple-2); box-shadow: 0 0 0 1px var(--purple-2); }
.comp-card__thumb { aspect-ratio: 9/16; max-width: 100px; margin: 0 auto 10px; border-radius: 10px; background: linear-gradient(135deg, #4c1d95, #ec4899); }
.comp-card__thumb--b { background: linear-gradient(135deg, #1e1b4b, #7c3aed); }
.comp-card__thumb--c { background: linear-gradient(135deg, #0c4a6e, #00d4ff); }
.comp-card__thumb--d { background: linear-gradient(135deg, #7c2d12, #f97316); }
.comp-card__score { text-align: center; font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.comp-card__name { text-align: center; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.compare-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.compare-table table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); font-weight: 600; }
.compare-table td:not(:first-child) { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.compare-table .best { background: rgba(34,197,94,0.08); color: var(--green); }

.verdict {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(236,72,153,0.08));
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: var(--radius); padding: 18px;
  margin-top: 14px;
}
.verdict h4 { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.verdict p { font-size: 13px; color: var(--text-dim); margin: 0; }

/* ===========================
   TEMPLATES
=========================== */
.templates-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.template-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  transition: border-color 0.2s, transform 0.2s; cursor: pointer;
}
.template-card:hover { transform: translateY(-2px); border-color: var(--border-2); }
.template-card__thumb { aspect-ratio: 9/16; border-radius: 10px; background: linear-gradient(135deg, #4c1d95, #ec4899); margin-bottom: 10px; }
.template-card__thumb--b { background: linear-gradient(135deg, #1e1b4b, #00d4ff); }
.template-card__thumb--c { background: linear-gradient(135deg, #831843, #f97316); }
.template-card__thumb--d { background: linear-gradient(135deg, #064e3b, #22c55e); }
.template-card__title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.template-card__meta { font-size: 11px; color: var(--text-mute); }

/* ===========================
   MODALS (onboarding, upload)
=========================== */
.onboarding, .upload-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  animation: fadeIn 0.3s ease;
}
.onboarding__panel {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); padding: 32px;
  width: 100%; max-width: 560px;
  position: relative;
  box-shadow: var(--shadow-glow);
}
.onboarding__close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 22px; color: var(--text); display: grid; place-items: center;
}
.onboarding__close:hover { background: var(--surface-3); }
.onboarding__progress { display: flex; gap: 6px; margin-bottom: 18px; }
.onboarding__progress span { flex: 1; height: 3px; background: var(--surface-2); border-radius: 2px; transition: background 0.3s; }
.onboarding__progress span.is-active { background: var(--grad); }
.onboarding__step h2 { font-family: 'Space Grotesk', sans-serif; font-size: 26px; margin: 0 0 6px; font-weight: 700; }
.onboarding__step p { color: var(--text-dim); margin: 0 0 18px; font-size: 13px; }
.onboarding__nav { display: flex; justify-content: space-between; margin-top: 22px; }

.chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chip-option {
  padding: 14px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; font-weight: 500;
  text-align: left; transition: border-color 0.15s, background 0.15s;
}
.chip-option:hover { border-color: var(--purple-2); background: var(--surface-3); }

.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius); padding: 32px;
  text-align: center;
  background: var(--bg-3);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--purple-2); background: rgba(124,58,237,0.05); }
.dropzone--lg { padding: 50px 30px; }
.dropzone__icon { font-size: 36px; color: var(--purple-2); margin-bottom: 8px; }
.dropzone__title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.dropzone__sub { font-size: 12px; color: var(--text-mute); }

.onboarding__alt, .upload-modal__alt { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.upload-modal__alt { font-size: 12px; color: var(--text-mute); }
.upload-modal__alt span { width: 100%; margin-bottom: 4px; }

/* Upload modal */
.upload-modal__panel {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); padding: 28px;
  width: 100%; max-width: 640px;
  position: relative;
}
.upload-modal__head h2 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; margin: 0 0 4px; font-weight: 700; }
.upload-modal__head p { color: var(--text-dim); margin: 0 0 18px; font-size: 13px; }

/* Processing */
.processing { margin-top: 22px; padding: 16px; background: var(--bg-3); border-radius: 12px; border: 1px solid var(--border); }
.processing__title { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--purple-2); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing__steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12px; }
.processing__steps li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--text-mute); }
.processing__steps li.is-active { color: var(--text); background: var(--surface); }
.processing__steps li.is-done { color: var(--green); }
.processing__check { color: var(--text-mute); }
.processing__steps li.is-done .processing__check { color: var(--green); }
.processing__steps li.is-active .processing__check { color: var(--purple-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.processing__found { margin-top: 12px; padding: 10px 12px; background: var(--grad); border-radius: 8px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.processing__found-num { font-family: 'Space Grotesk', sans-serif; font-size: 22px; }

/* ===========================
   TOAST
=========================== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-4); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-glow);
  z-index: 200;
  animation: slideIn 0.4s cubic-bezier(.2,.7,.2,1);
  max-width: 360px;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast__icon { font-size: 24px; }
.toast__title { font-weight: 600; font-size: 13px; }
.toast__sub { font-size: 11px; color: var(--text-dim); }

.download-task{position:fixed;z-index:260;right:24px;bottom:24px;width:min(420px,calc(100vw - 32px));display:flex;align-items:flex-start;gap:13px;padding:16px 17px;border:1px solid rgba(168,85,247,.42);border-radius:15px;background:rgba(14,14,23,.96);box-shadow:0 20px 70px rgba(0,0,0,.65),0 0 34px rgba(168,85,247,.2);backdrop-filter:blur(18px);animation:slideIn .35s ease}
.download-task__spinner{width:21px;height:21px;flex:0 0 auto;margin-top:1px}
.download-task__content{min-width:0;flex:1;display:grid;gap:5px}.download-task__content strong{font-size:14px}.download-task__content>span{font-size:12px;color:var(--text-dim);line-height:1.4}
.download-task__track{height:5px;margin-top:4px;overflow:hidden;border-radius:99px;background:rgba(255,255,255,.1)}.download-task__track span{display:block;width:32%;height:100%;border-radius:inherit;background:var(--grad);animation:downloadTask 1.2s ease-in-out infinite}
.download-task.is-progress .download-task__track span{animation:none}.download-task.is-done{border-color:rgba(34,197,94,.42)}.download-task.is-done .download-task__spinner{animation:none;border-color:var(--green);position:relative}.download-task.is-done .download-task__spinner:after{content:'✓';position:absolute;inset:-5px;display:grid;place-items:center;color:var(--green);font-weight:800}.download-task.is-error{border-color:rgba(239,68,68,.5)}.download-task.is-error .download-task__spinner{animation:none;border-color:var(--red)}
@keyframes downloadTask{0%{transform:translateX(-110%)}50%{transform:translateX(120%)}100%{transform:translateX(310%)}}
@media(max-width:640px){.download-task{right:8px;bottom:8px;width:calc(100vw - 16px)}}

/* ===========================
   EMPTY STATE
=========================== */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-mute);
}
.empty__icon { font-size: 56px; margin-bottom: 14px; opacity: 0.5; }
.empty__title { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 600; margin-bottom: 6px; color: var(--text); }

/* ===========================
   BADGES
=========================== */
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(0,212,255,0.08));
  border: 1px solid var(--border-2);
  border-radius: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  font-family: 'Space Grotesk', sans-serif;
  display: flex; align-items: center; gap: 6px;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .opp-grid { grid-template-columns: repeat(2, 1fr); }
  .editor { grid-template-columns: 1fr; }
  .editor__panel { max-height: 300px; }
  .kanban { grid-template-columns: repeat(3, 1fr); }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
  .comparator-grid { grid-template-columns: repeat(2, 1fr); }
  .dna-grid { grid-template-columns: 1fr; }
  .cc-row, .cc-row--3 { grid-template-columns: 1fr; }
  .clip-detail { grid-template-columns: 1fr; }
  .clip-preview { position: relative; }
  .hook-lab { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0; }
  .sidebar { display: none; }
  .view { padding: 18px; }
  .view-header h1 { font-size: 22px; }
  .opp-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .topbar__search { display: none; }
  .home-hero { padding: 24px; }
  .home-hero h2 { font-size: 24px; }
  .kanban { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
}

.processing__status { margin: 12px 2px 0; color: var(--text-dim); font-size: 12px; }

/* Interactive clip player and export editor */
.clip-modal__inner { width: 100%; }
.clip-workspace {
  width: min(1320px, 100%);
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  background: rgba(12,12,20,.96);
  border: 1px solid var(--border-2);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}
.clip-player-panel { min-width: 0; }
.clip-video-wrap {
  min-height: 420px;
  background: #020204;
  display: grid;
  place-items: center;
  position: relative;
}
.clip-video-wrap video {
  width: 100%;
  max-height: 64vh;
  display: block;
  background: #000;
}
.clip-video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-dim);
  background: rgba(2,2,4,.82);
  pointer-events: none;
}
.clip-player-info { padding: 22px 24px 26px; }
.clip-player-info h2 { font: 700 24px/1.25 'Space Grotesk',sans-serif; margin: 0 0 8px; }
.clip-player-info p { color: var(--text-dim); }
.clip-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.clip-export-status { color: var(--text-dim); font-size: 12px; }
.clip-editor-panel {
  padding: 24px;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg,rgba(124,58,237,.08),rgba(0,212,255,.025));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.clip-editor-panel h3 { margin: -3px 0 4px; font: 700 20px 'Space Grotesk',sans-serif; }
.editor-field { display: grid; gap: 6px; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.editor-field select {
  width: 100%;
  padding: 10px 11px;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  outline: none;
}
.editor-field select:focus { border-color: var(--purple-2); }
.editor-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}
.editor-check input { accent-color: var(--purple-2); width: 16px; height: 16px; }
.editor-caption-preview {
  padding: 12px;
  border-radius: 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
}
.editor-caption-preview small { color: var(--text-mute); letter-spacing: .1em; }
.editor-caption-preview p { margin: 6px 0 0; color: var(--text); font-size: 12px; }
#renderClip:disabled { opacity: .65; cursor: wait; }
@media (max-width: 900px) {
  .clip-workspace { grid-template-columns: 1fr; }
  .clip-editor-panel { border-left: 0; border-top: 1px solid var(--border); }
  .clip-video-wrap { min-height: 260px; }
}

/* Live clip preview, lower-third captions and real thumbnails */
.opp-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.opp-card__thumb-overlay { z-index: 2; }
.opp-card__play { z-index: 3; }
.clip-video-wrap.preview-vertical video { max-width: min(360px,100%); aspect-ratio: 9/16; object-fit: contain; }
.clip-video-wrap.preview-square video { max-width: min(560px,100%); aspect-ratio: 1; object-fit: contain; }
.clip-video-wrap.preview-landscape video { aspect-ratio: 16/9; object-fit: contain; }
.clip-video.effect-vivid { filter: contrast(1.12) saturate(1.28) brightness(1.02); }
.clip-video.effect-warm { filter: sepia(.18) saturate(1.13) hue-rotate(-8deg); }
.clip-video.effect-bw { filter: grayscale(1); }
.clip-video.effect-cinematic { filter: contrast(1.15) saturate(.88) brightness(.975); }
.live-caption-overlay {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 11%;
  z-index: 4;
  max-height: 2.35em;
  overflow: hidden;
  color: #fff;
  text-align: center;
  font-family: 'Inter',sans-serif;
  font-size: clamp(16px,2vw,24px);
  font-weight: 800;
  line-height: 1.12;
  text-shadow: 0 2px 3px #000,0 0 5px #000;
  pointer-events: none;
}
.live-caption-overlay.caption-classic { font-size: clamp(15px,1.7vw,21px); font-weight: 600; }
.live-caption-overlay.caption-minimal {
  left: 15%; right: 15%; bottom: 9%;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(0,0,0,.64);
  font-size: clamp(14px,1.5vw,19px);
  font-weight: 500;
  text-shadow: none;
}
.editor-auto-note {
  display: flex; align-items: center; gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  background: rgba(0,0,0,.2);
}
.editor-auto-note b,.editor-auto-note small { display: block; }
.editor-auto-note b { color: var(--text); font-size: 12px; }
.editor-auto-note small { margin-top: 2px; font-size: 10px; line-height: 1.35; }
.spinner--small { width: 13px; height: 13px; flex: 0 0 auto; }

/* Caption frame scoped to the selected export aspect */
.clip-video-wrap { overflow: hidden; }
.clip-video-frame {
  position: relative;
  width: 100%;
  max-height: 64vh;
  display: grid;
  place-items: center;
  container-type: inline-size;
}
.clip-video-wrap.preview-vertical .clip-video-frame {
  width: auto;
  height: min(60vh, 540px);
  max-width: 100%;
  max-height: calc(100vh - 180px);
  aspect-ratio: 9/16;
}
.clip-video-wrap.preview-square .clip-video-frame {
  width: auto;
  height: min(60vh, 540px);
  max-width: 100%;
  aspect-ratio: 1;
}
.clip-video-wrap.preview-landscape .clip-video-frame { width: min(100%,900px); aspect-ratio: 16/9; }
.clip-video-wrap.preview-vertical .clip-video-frame video,
.clip-video-wrap.preview-square .clip-video-frame video,
.clip-video-wrap.preview-landscape .clip-video-frame video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.clip-video-frame .live-caption-overlay {
  left: 8%;
  right: 8%;
  bottom: 9%;
  width: auto;
  font-size: clamp(15px,5cqw,24px);
}
.preview-vertical .clip-video-frame .live-caption-overlay {
  left: 9%;
  right: 9%;
  bottom: 10%;
  max-height: 3.5em;
  font-size: clamp(15px,5.5cqw,21px);
}
.preview-square .clip-video-frame .live-caption-overlay {
  left: 8%;
  right: 8%;
  bottom: 9%;
  font-size: clamp(15px,4.5cqw,23px);
}
.preview-landscape .clip-video-frame .live-caption-overlay {
  left: 7%;
  right: 7%;
  bottom: 8%;
  font-size: clamp(15px,3.2cqw,24px);
}
.preview-vertical .clip-video-frame .caption-minimal,
.preview-square .clip-video-frame .caption-minimal,
.preview-landscape .clip-video-frame .caption-minimal { left: 11%; right: 11%; }
/* Original media orientation and caption safe area */
.editor-hint {
  display: block;
  margin: -8px 4px 0;
  color: var(--text-mute);
  font-size: 10px;
  line-height: 1.4;
}
.clip-video-wrap.preview-original.source-vertical .clip-video-frame {
  width: auto;
  height: min(60vh, 540px);
  max-width: 100%;
  aspect-ratio: 9/16;
}
.clip-video-wrap.preview-original.source-square .clip-video-frame {
  width: auto;
  height: min(60vh, 540px);
  max-width: 100%;
  aspect-ratio: 1;
}
.clip-video-wrap.preview-original.source-vertical .clip-video-frame video,
.clip-video-wrap.preview-original.source-square .clip-video-frame video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}
/* Persistent video controls */
.clip-custom-controls {
  position: absolute;
  z-index: 8;
  left: 12px;
  right: 12px;
  bottom: 8px;
  display: grid;
  grid-template-columns: 34px auto minmax(70px,1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: #fff;
  background: rgba(2,2,5,.78);
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: background .2s;
}
.clip-custom-controls:hover { background: rgba(2,2,5,.92); }
.clip-custom-controls button {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: rgba(255,255,255,.12);
  cursor: pointer;
  font-size: 14px;
}
.clip-custom-controls button:hover { background: rgba(124,58,237,.8); }
.clip-custom-controls span { min-width: 32px; font-size: 11px; font-variant-numeric: tabular-nums; }
.clip-custom-controls input { width: 100%; accent-color: var(--purple-2); cursor: pointer; }
.clip-video-frame:fullscreen .clip-custom-controls { bottom: 18px; left: 18px; right: 18px; }
/* Dynamic project dashboards */
.project-grid,.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.project-card { display:flex; flex-direction:column; gap:10px; }
.project-card h3,.project-card p { margin:0; }
.project-card p { color:var(--text-dim); font-size:12px; line-height:1.5; }
.project-card--interactive { cursor:pointer; transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
.project-card--interactive:hover,.project-card--interactive:focus-visible { transform:translateY(-3px); border-color:var(--purple-2); box-shadow:0 14px 32px rgba(84,39,180,.18); outline:none; }
.project-card__footer { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:auto; padding-top:12px; border-top:1px solid var(--border); }
.project-card__footer b { color:var(--text); }
.project-card__footer span { color:var(--cyan); font-weight:700; white-space:nowrap; }
.project-series-head { display:flex; align-items:center; gap:18px; margin:-4px 0 16px; padding:16px 18px; border:1px solid var(--border); border-radius:var(--radius); background:rgba(124,58,237,.06); }
.project-series-head h2,.project-series-head p { margin:0; }
.project-series-head h2 { margin-top:3px; font-size:20px; }
.project-series-head p { margin-top:4px; color:var(--text-dim); font-size:12px; }
.project-series-empty { grid-column:1/-1; }
.project-list { display:grid; gap:8px; }
.project-row {
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:12px 14px; border:1px solid var(--border); border-radius:10px;
  color:var(--text); background:var(--bg-3); text-align:left; cursor:pointer;
}
.project-row:hover { border-color:var(--purple-2); }
.project-row span,.project-row small { display:block; }
.project-row small { margin-top:4px; color:var(--text-mute); }
.project-row strong { color:var(--cyan); white-space:nowrap; }
.project-select { width:100%; margin-top:10px; padding:10px; color:var(--text); background:var(--bg-3); border:1px solid var(--border-2); border-radius:9px; }
.metric-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); color:var(--text-dim); }
.metric-row b { color:var(--text); }
.rank-list { display:grid; gap:10px; }
.rank-list > div { position:relative; display:flex; justify-content:space-between; gap:10px; padding-bottom:7px; overflow:hidden; }
.rank-list i { position:absolute; left:0; bottom:0; height:3px; border-radius:3px; background:var(--grad); }
.settings-form { display:grid; gap:14px; }
.settings-model-card { grid-column:1/-1; }
.settings-model-card .card__title { margin:6px 0 8px; }
.settings-model-copy { max-width:860px; margin:0 0 18px; color:var(--text-dim); font-size:13px; line-height:1.55; }
.settings-model-card .editor-field { max-width:760px; }
.model-selection-info { display:flex; align-items:flex-start; flex-direction:column; gap:4px; max-width:760px; margin-top:12px; padding:12px 14px; border:1px solid rgba(124,58,237,.3); border-radius:10px; background:rgba(124,58,237,.07); color:var(--text); }
.model-selection-info span { color:var(--text-dim); font-size:12px; line-height:1.45; }
.settings-save { grid-column:1/-1; display:flex; justify-content:flex-end; }
.settings-save .btn { min-width:260px; }
.kanban { grid-template-columns:repeat(4,minmax(0,1fr)); }
.kanban-card__thumb img,.template-card__thumb img { width:100%; height:100%; object-fit:cover; display:block; border-radius:inherit; }
.pva-table tr[data-clip] { cursor:pointer; }
.pva-table tr[data-clip]:hover td { background:rgba(124,58,237,.08); }
@media (max-width:1100px){.kanban{grid-template-columns:repeat(2,minmax(0,1fr));}.project-grid,.settings-grid{grid-template-columns:1fr;}}
@media (max-width:1100px){.strategist-context-bar{grid-template-columns:1fr 1.5fr}.strategist-context-status{grid-column:1/-1}}
@media (max-width:680px){.kanban{grid-template-columns:1fr}.analytics-chart-grid{grid-template-columns:1fr}.chat-layout{grid-template-columns:1fr}.templates-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:680px){.strategist-context-bar{grid-template-columns:1fr}.strategist-context-status{grid-column:auto;white-space:normal}.chat-layout{min-height:0}.chat-sidebar{order:0}.chat{min-height:520px}}
@media (max-width:680px){.project-series-head{align-items:flex-start;flex-direction:column}.project-card__footer{align-items:flex-start;flex-direction:column;gap:6px}}
/* draggable crop editor */
.clip-video-wrap.preview-fill .clip-video-frame video{width:100%!important;height:100%!important;object-fit:cover!important}
.clip-video-wrap.preview-fill .clip-video-frame{cursor:grab;touch-action:none;user-select:none}
.clip-video-wrap.preview-fill .clip-video-frame.is-cropping{cursor:grabbing}
.crop-drag-hint{position:absolute;z-index:8;top:14px;left:50%;transform:translateX(-50%);padding:8px 12px;border:1px solid rgba(255,255,255,.2);border-radius:999px;background:rgba(8,8,14,.76);color:#fff;font-size:12px;font-weight:700;pointer-events:none;backdrop-filter:blur(8px);white-space:nowrap}
.crop-position-panel{margin:-2px 0 16px;padding:14px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.025)}
.crop-position-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;color:#f2f1f8;font-size:13px}
.crop-position-title button{border:0;background:transparent;color:#b968ff;font-weight:700;cursor:pointer}
.crop-position-panel label{display:grid;grid-template-columns:72px 1fr;gap:10px;align-items:center;margin:8px 0;color:#aaa8bc;font-size:12px}
.crop-position-panel input{width:100%;accent-color:#ad4df5}
.crop-position-panel small{display:block;margin-top:10px;color:#77758c;line-height:1.35}
/* responsive clip workspace v2 */
.clip-modal{
  display:block;
  padding:20px 72px 20px 20px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.clip-modal__inner{
  min-height:100%;
  display:flex;
  align-items:flex-start;
}
.clip-workspace{
  margin:0 auto;
  max-height:calc(100dvh - 40px);
  min-height:0;
}
.clip-player-panel,.clip-editor-panel{min-height:0;scrollbar-width:thin;scrollbar-color:rgba(181,76,255,.55) transparent}
.clip-player-panel{overflow-y:auto;overscroll-behavior:contain}
.clip-editor-panel{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
.clip-player-panel::-webkit-scrollbar,.clip-editor-panel::-webkit-scrollbar{width:7px}
.clip-player-panel::-webkit-scrollbar-thumb,.clip-editor-panel::-webkit-scrollbar-thumb{background:rgba(181,76,255,.45);border-radius:999px}
.clip-modal__close{top:16px;right:16px}

@media (min-width:1051px) and (max-height:760px){
  .clip-modal{padding:12px 64px 12px 12px}
  .clip-workspace,.clip-editor-panel{max-height:calc(100dvh - 24px)}
  .clip-video-wrap{min-height:300px}
  .clip-video-wrap.preview-vertical .clip-video-frame,
  .clip-video-wrap.preview-square .clip-video-frame,
  .clip-video-wrap.preview-original.source-vertical .clip-video-frame,
  .clip-video-wrap.preview-original.source-square .clip-video-frame{height:min(52dvh,400px);max-height:calc(100dvh - 120px)}
  .clip-player-info{padding:16px 20px 18px}
  .clip-player-info h2{font-size:21px}
}

@media (max-width:1050px){
  .clip-modal{padding:58px 14px 20px}
  .clip-modal__inner{display:block;min-height:0}
  .clip-workspace{grid-template-columns:minmax(0,1fr);max-height:none;margin:0 auto;overflow:hidden}
  .clip-player-panel,.clip-editor-panel{max-height:none;overflow:visible}
  .clip-editor-panel{border-left:0;border-top:1px solid var(--border)}
  .clip-video-wrap{min-height:260px}
  .clip-video-frame{max-height:70dvh}
  .clip-video-wrap.preview-vertical .clip-video-frame,
  .clip-video-wrap.preview-square .clip-video-frame,
  .clip-video-wrap.preview-original.source-vertical .clip-video-frame,
  .clip-video-wrap.preview-original.source-square .clip-video-frame{height:min(68dvh,620px);max-height:calc(100dvh - 90px)}
  .clip-modal__close{position:absolute;top:10px;right:12px}
}

@media (max-width:640px){
  .clip-modal{padding:52px 0 0}
  .clip-workspace{width:100%;border-left:0;border-right:0;border-bottom:0;border-radius:16px 16px 0 0}
  .clip-player-info{padding:18px 16px 20px}
  .clip-player-info h2{font-size:20px}
  .clip-player-info p{font-size:13px;line-height:1.55}
  .clip-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .clip-actions .btn,.clip-export-status{width:100%;min-width:0;text-align:center}
  .clip-editor-panel{padding:18px 16px 28px}
  .clip-video-wrap{min-height:220px}
  .clip-video-wrap.preview-vertical .clip-video-frame,
  .clip-video-wrap.preview-square .clip-video-frame,
  .clip-video-wrap.preview-original.source-vertical .clip-video-frame,
  .clip-video-wrap.preview-original.source-square .clip-video-frame{height:min(64dvh,560px);max-height:calc(100dvh - 76px)}
  .clip-custom-controls{left:7px;right:7px;bottom:6px;grid-template-columns:32px auto minmax(54px,1fr) auto;gap:5px;padding:6px}
  .clip-custom-controls span{min-width:28px;font-size:10px}
  .crop-drag-hint{top:8px;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis}
}
/* natural-height clip workspace v3 */
.clip-modal{
  padding:20px 64px 44px 20px;
  overflow-y:auto;
}
.clip-modal__inner{
  display:block;
  min-height:0;
}
.clip-workspace{
  width:min(1680px,100%);
  margin:0 auto;
  max-height:none;
  grid-template-columns:minmax(0,1fr) 380px;
}
.clip-player-panel,
.clip-editor-panel{
  max-height:none;
  overflow:visible;
}
.clip-video-wrap video,
.clip-video-frame{max-height:72dvh}
.clip-video-wrap.preview-vertical .clip-video-frame,
.clip-video-wrap.preview-square .clip-video-frame,
.clip-video-wrap.preview-original.source-vertical .clip-video-frame,
.clip-video-wrap.preview-original.source-square .clip-video-frame{
  height:min(70dvh,720px);
  max-height:none;
}

@media (max-width:1050px){
  .clip-modal{padding:58px 14px 32px}
  .clip-workspace{width:100%;grid-template-columns:minmax(0,1fr)}
  .clip-video-wrap video,
  .clip-video-frame{max-height:78dvh}
}

@media (max-width:640px){
  .clip-modal{padding:52px 0 24px}
  .clip-video-wrap video,
  .clip-video-frame{max-height:76dvh}
}
/* expanded editor controls v4 */
.clip-modal{padding-left:16px;padding-right:40px}
.clip-workspace{
  width:min(1900px,calc(100vw - 56px));
  grid-template-columns:minmax(0,1fr) clamp(440px,29vw,520px);
}
.clip-editor-panel{
  padding:30px;
  gap:18px;
}
.clip-editor-panel>.kicker{font-size:12px;letter-spacing:.17em}
.clip-editor-panel h3{font-size:25px;margin:0 0 2px}
.clip-editor-panel .editor-field{gap:9px;font-size:13px;letter-spacing:.09em}
.clip-editor-panel .editor-field select{
  min-height:50px;
  padding:13px 15px;
  border-radius:12px;
  font-size:15px;
}
.clip-editor-panel .editor-check{
  min-height:58px;
  padding:15px 17px;
  border-radius:12px;
  font-size:15px;
  line-height:1.35;
}
.clip-editor-panel .editor-check input{width:20px;height:20px;flex:0 0 20px}
.clip-editor-panel .editor-hint{margin-top:-10px;font-size:12px;line-height:1.5}
.clip-editor-panel .editor-auto-note{padding:16px;border-radius:12px}
.clip-editor-panel .editor-auto-note b{font-size:14px}
.clip-editor-panel .editor-auto-note small{font-size:12px;line-height:1.45}
.clip-editor-panel .crop-position-panel{padding:18px;margin-bottom:2px}
.clip-editor-panel .crop-position-title{font-size:15px;margin-bottom:13px}
.clip-editor-panel .crop-position-panel label{grid-template-columns:88px 1fr;font-size:13px;margin:12px 0}
.clip-editor-panel .crop-position-panel input{min-height:22px}
.clip-editor-panel .crop-position-panel small{font-size:12px}

@media (max-width:1200px) and (min-width:1051px){
  .clip-workspace{grid-template-columns:minmax(0,1fr) 420px}
  .clip-editor-panel{padding:24px}
}

@media (max-width:1050px){
  .clip-modal{padding-left:14px;padding-right:14px}
  .clip-workspace{width:100%;grid-template-columns:minmax(0,1fr)}
  .clip-editor-panel{padding:24px}
}

@media (max-width:640px){
  .clip-modal{padding-left:0;padding-right:0}
  .clip-editor-panel{padding:20px 16px 30px}
  .clip-editor-panel h3{font-size:23px}
  .clip-editor-panel .editor-field select{font-size:16px}
}
/* enlarged bottom clip actions v5 */
.clip-player-info .clip-actions{
  display:grid;
  grid-template-columns:minmax(280px,1fr) minmax(180px,auto);
  align-items:center;
  gap:16px;
  margin-top:22px;
  padding-top:18px;
}
.clip-player-info .clip-actions .btn{
  width:100%;
  min-width:0;
  min-height:58px;
  padding:15px 26px;
  border-radius:13px;
  font-size:16px;
  font-weight:750;
  line-height:1.2;
}
.clip-player-info .clip-export-status{
  max-width:190px;
  font-size:13px;
  line-height:1.4;
}
@media (max-width:900px){
  .clip-player-info .clip-actions{grid-template-columns:1fr 1fr}
  .clip-player-info .clip-export-status{grid-column:1/-1;max-width:none;text-align:center}
}
@media (max-width:640px){
  .clip-player-info .clip-actions{grid-template-columns:1fr;gap:11px}
  .clip-player-info .clip-actions .btn{min-height:56px;font-size:15px}
  .clip-player-info .clip-export-status{grid-column:auto}
}
/* Supabase authentication */
.auth-modal{position:fixed;inset:0;z-index:300;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.78);backdrop-filter:blur(18px)}
.auth-card{position:relative;width:min(440px,100%);display:grid;gap:15px;padding:30px;border:1px solid var(--border-2);border-radius:20px;background:#11111a;box-shadow:0 30px 100px rgba(0,0,0,.65)}
.auth-card h2{margin:0;font:700 27px 'Space Grotesk',sans-serif}.auth-card p{margin:-7px 0 3px;color:var(--text-dim);font-size:13px;line-height:1.5}.auth-card label{display:grid;gap:7px;color:var(--text-dim);font-size:12px;font-weight:700}.auth-card input{width:100%;height:48px;padding:0 13px;border:1px solid var(--border-2);border-radius:11px;background:var(--surface);color:var(--text);font-size:15px;outline:none}.auth-card input:focus{border-color:var(--purple-2)}.auth-card .btn{min-height:50px}.auth-card__close{position:absolute;top:14px;right:14px;width:34px;height:34px;border:1px solid var(--border-2);border-radius:50%;background:var(--surface-2);color:var(--text);font-size:20px;cursor:pointer}.auth-switch{border:0;background:none;color:#bb70ff;font-weight:700;cursor:pointer}.auth-error{padding:10px 12px;border:1px solid rgba(239,68,68,.35);border-radius:9px;background:rgba(239,68,68,.1);color:#fca5a5;font-size:12px}
/* 100-percent zoom recalibration v6 */
.clip-modal{padding:22px 48px 40px 22px}
.clip-workspace{
  width:min(1600px,calc(100vw - 92px));
  grid-template-columns:minmax(0,1fr) clamp(390px,25vw,430px);
}
.clip-editor-panel{padding:24px;gap:14px}
.clip-editor-panel>.kicker{font-size:10px}
.clip-editor-panel h3{font-size:21px;margin:-2px 0 3px}
.clip-editor-panel .editor-field{gap:7px;font-size:11px}
.clip-editor-panel .editor-field select{min-height:44px;padding:10px 12px;border-radius:10px;font-size:14px}
.clip-editor-panel .editor-check{min-height:50px;padding:12px 14px;border-radius:10px;font-size:14px}
.clip-editor-panel .editor-check input{width:18px;height:18px;flex-basis:18px}
.clip-editor-panel .editor-hint{font-size:10px}
.clip-editor-panel .editor-auto-note{padding:13px}
.clip-editor-panel .editor-auto-note b{font-size:12px}
.clip-editor-panel .editor-auto-note small{font-size:10px}
.clip-editor-panel .crop-position-panel{padding:14px}
.clip-editor-panel .crop-position-title{font-size:13px;margin-bottom:10px}
.clip-editor-panel .crop-position-panel label{grid-template-columns:72px 1fr;font-size:12px;margin:9px 0}
.clip-player-info{padding:20px 22px 22px}
.clip-player-info h2{font-size:22px}
.clip-player-info p{font-size:13px;line-height:1.55}
.clip-player-info .clip-actions{gap:12px;margin-top:18px;padding-top:14px}
.clip-player-info .clip-actions .btn{min-height:50px;padding:12px 20px;border-radius:11px;font-size:14px}
.clip-player-info .clip-actions .clip-export-status{flex-basis:100%;text-align:left}
.clip-player-info .clip-export-status{font-size:11px;max-width:170px}
.clip-video-wrap video,.clip-video-frame{max-height:68dvh}
@media (max-width:1200px) and (min-width:1051px){.clip-workspace{width:min(1120px,calc(100vw - 64px));grid-template-columns:minmax(0,1fr) 370px}.clip-editor-panel{padding:20px}}
@media (max-width:1050px){.clip-modal{padding:56px 14px 30px}.clip-workspace{width:100%;grid-template-columns:1fr}.clip-editor-panel{padding:22px}.clip-video-wrap video,.clip-video-frame{max-height:74dvh}}
@media (max-width:640px){.clip-modal{padding:52px 0 22px}.clip-editor-panel{padding:18px 16px 28px}.clip-editor-panel h3{font-size:21px}.clip-player-info{padding:17px 15px 20px}.clip-player-info .clip-actions .btn{min-height:50px;font-size:14px}}
/* Persistent clip audio player */
.mini-player{position:fixed;z-index:240;left:50%;bottom:18px;transform:translateX(-50%);width:min(760px,calc(100vw - 32px));display:grid;grid-template-columns:48px minmax(0,1fr) auto 36px;align-items:center;gap:12px;padding:12px 14px;border:1px solid rgba(255,255,255,.16);border-radius:16px;background:rgba(14,14,23,.94);box-shadow:0 20px 70px rgba(0,0,0,.6),0 0 32px rgba(168,85,247,.16);backdrop-filter:blur(20px)}
.mini-player__play,.mini-player__close{display:grid;place-items:center;border:1px solid var(--border-2);background:var(--surface-2);color:var(--text);cursor:pointer}
.mini-player__play{width:48px;height:48px;border-radius:50%;font-size:17px}
.mini-player__close{width:34px;height:34px;border-radius:50%;font-size:22px;line-height:1}
.mini-player__content{min-width:0;display:grid;gap:7px}.mini-player__content strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.mini-player__timeline{display:grid;grid-template-columns:auto minmax(80px,1fr) auto;align-items:center;gap:9px;color:var(--text-dim);font-size:11px;font-variant-numeric:tabular-nums}.mini-player__timeline input{width:100%;accent-color:var(--purple-2);cursor:pointer}
.mini-player__open{min-height:38px;padding:0 14px;border:1px solid var(--border-2);border-radius:10px;background:var(--surface-2);color:var(--text);font-weight:700;white-space:nowrap;cursor:pointer}.mini-player__open:hover,.mini-player__play:hover{border-color:var(--purple-2)}
@media (max-width:640px){.mini-player{bottom:8px;width:calc(100vw - 16px);grid-template-columns:44px minmax(0,1fr) 32px;gap:9px;padding:9px 10px}.mini-player__play{width:44px;height:44px}.mini-player__open{grid-column:2;min-height:32px;font-size:12px}.mini-player__close{grid-column:3;grid-row:1}.mini-player__content strong{font-size:13px}}
/* Scrollable upload analysis modal v9 */
.upload-modal{
  display:block;
  height:100vh;
  height:100dvh;
  overflow-x:hidden;
  overflow-y:scroll;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  padding:24px 20px 64px;
  scrollbar-gutter:stable;
}
.upload-modal__panel{
  height:auto;
  min-height:0;
  max-height:none;
  margin:0 auto;
  overflow:visible;
}
.upload-modal .processing{
  max-height:none;
  overflow:visible;
  margin-bottom:12px;
}
@media (max-width:640px){
  .upload-modal{padding:12px 10px 48px}
  .upload-modal__panel{padding:22px 16px}
  .upload-modal .dropzone--lg{padding:34px 16px}
}
.hook-mode{border:0;margin:0 0 18px;padding:0}.hook-mode legend{margin-bottom:10px;color:var(--text);font-size:14px;font-weight:700}.hook-mode__options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hook-mode__option{display:flex;gap:10px;align-items:flex-start;padding:14px;border:1px solid var(--border);border-radius:12px;background:rgba(255,255,255,.025);cursor:pointer;transition:.2s}.hook-mode__option:has(input:checked){border-color:var(--purple-2);background:rgba(124,58,237,.12);box-shadow:0 0 0 1px rgba(168,85,247,.12)}.hook-mode__option input{margin-top:3px;accent-color:var(--purple-2)}.hook-mode__option span{display:grid;gap:4px}.hook-mode__option b{font-size:13px}.hook-mode__option small{color:var(--muted);font-size:11px;line-height:1.45}@media(max-width:680px){.hook-mode__options{grid-template-columns:1fr}}
/* side-by-side upload workflow v10 */.upload-modal__panel{width:min(1280px,calc(100vw - 40px));max-width:1280px;padding:30px}.upload-modal__layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(340px,.85fr);gap:26px;align-items:start}.upload-modal__main{min-width:0}.upload-modal__side{min-width:0;min-height:100%;padding-left:26px;border-left:1px solid var(--border)}.upload-modal__side .processing{position:sticky;top:0;margin:0;min-height:500px}.upload-modal__side:has(.processing[hidden]){display:grid;place-items:center;min-height:500px;border:1px dashed var(--border-2);border-radius:16px;padding:28px;background:rgba(255,255,255,.015)}.upload-modal__side:has(.processing[hidden])::before{content:"O andamento da análise aparecerá aqui após selecionar o vídeo.";max-width:250px;color:var(--text-mute);font-size:13px;line-height:1.6;text-align:center}.upload-modal__main .dropzone--lg{min-height:300px}.upload-modal__main .hook-mode__options{grid-template-columns:1fr 1fr}@media(max-width:1000px){.upload-modal__panel{width:min(780px,calc(100vw - 28px));padding:26px}.upload-modal__layout{grid-template-columns:1fr}.upload-modal__side{padding:22px 0 0;border-left:0;border-top:1px solid var(--border)}.upload-modal__side:has(.processing[hidden]){display:none}.upload-modal__side .processing{position:static;min-height:0}.upload-modal__main .dropzone--lg{min-height:260px}}@media(max-width:640px){.upload-modal__panel{width:100%;padding:22px 16px}.upload-modal__main .hook-mode__options{grid-template-columns:1fr}.upload-modal__layout{gap:18px}}
