/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --text: #f0f0f5;
  --text-muted: #8888a0;
  --text-dim: #555568;
  --accent: #7c3aed;
  --accent2: #a855f7;
  --accent-glow: rgba(124,58,237,0.3);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  width: 100%;
  padding: 13px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.logo-icon { font-size: 1.3rem; }
.logo-accent { color: var(--accent2); }
.nav-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.btn-login {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.82rem;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-login:hover { opacity: 0.85; transform: translateY(-1px); }

.hero {
  width: 100%;
  padding: 52px 80px 28px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--accent2);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, #a855f7, #7c3aed, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Main ── */
.main {
  width: 100%;
  padding: 0 40px 80px;
}

/* ── Card ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 24px;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent2);
  background: rgba(124,58,237,0.05);
}
.drop-icon { font-size: 2.5rem; margin-bottom: 10px; }
.drop-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.drop-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 14px;
  text-align: left;
}
.file-icon { font-size: 1.3rem; }
.file-name { font-weight: 500; font-size: 0.9rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}
.remove-btn:hover { color: var(--red); }

/* ── Meta Grid ── */
.meta-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.optional { font-weight: 400; color: var(--text-dim); }
.field input, .field select, .field textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent2);
}
.field select option { background: var(--bg3); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 14px;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── Progress ── */
.progress-card { text-align: center; padding: 48px 28px; }
.progress-animation { margin-bottom: 24px; }
.spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.progress-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
/* Progress Steps V2 (Vertical Timeline) */
.progress-steps-v2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  padding: 0 8px;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.step-v2 {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

/* Connecting vertical line between dots */
.step-v2::before {
  content: '';
  position: absolute;
  left: 10px; /* middle of 22px dot container */
  top: 22px;  /* start from bottom of dot */
  bottom: -22px; /* extend to top of next dot */
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 1;
  transition: background 0.3s ease;
}
.step-v2:last-child::before {
  display: none; /* no line after the last step */
}

/* When a step is completed, make the connecting line green */
.step-v2.done::before {
  background: var(--green);
}

.step-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2; /* keep above connecting line */
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-dot-v2 {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.step-text-v2 {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.3s ease;
}

/* Active State (Currently running) */
.step-v2.active .step-icon-wrap {
  background: rgba(168, 85, 247, 0.15); /* purplish glow */
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}
.step-v2.active .step-dot-v2 {
  background: #a855f7;
  animation: pulse-dot 1.5s infinite ease-in-out;
}
.step-v2.active .step-text-v2 {
  color: #fff;
  font-weight: 600;
}

/* Done State (Completed) */
.step-v2.done .step-icon-wrap {
  background: rgba(34, 197, 94, 0.15); /* green glow */
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}
.step-v2.done .step-dot-v2 {
  background: var(--green);
}
.step-v2.done .step-text-v2 {
  color: var(--green);
}

/* Step pulse animation */
@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Score Card ── */
.score-card {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.score-left { display: flex; align-items: center; gap: 20px; }
.score-ring { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 8; }
.ring-fill {
  fill: none;
  stroke: var(--accent2);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  /* transition removed — JS drives the animation via requestAnimationFrame */
  filter: drop-shadow(0 0 6px var(--accent2));
}
.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
}
.score-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.score-verdict { font-size: 1.3rem; font-weight: 700; }
.score-right { flex: 1; min-width: 200px; }
.perf-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.perf-viral { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.perf-above { background: rgba(124,58,237,0.15); color: var(--accent2); border: 1px solid rgba(124,58,237,0.3); }
.perf-average { background: rgba(234,179,8,0.15); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.perf-below { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.overall-summary { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

/* ── Two Col ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

/* ── Bullet Lists ── */
.bullet-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.bullet-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.wins-list li::before { background: var(--green); }
.fixes-list li::before { background: var(--orange); }

/* ── Breakdown Grid ── */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.breakdown-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.breakdown-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.breakdown-score-row { display: flex; align-items: center; gap: 10px; }
.breakdown-score {
  font-size: 1.4rem;
  font-weight: 800;
  min-width: 36px;
}
.breakdown-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.breakdown-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.score-high .breakdown-bar { background: var(--green); }
.score-mid .breakdown-bar { background: var(--yellow); }
.score-low .breakdown-bar { background: var(--red); }
.score-high .breakdown-score { color: var(--green); }
.score-mid .breakdown-score { color: var(--yellow); }
.score-low .breakdown-score { color: var(--red); }

/* ── Sub-scores ── */
.sub-scores { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.sub-score-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-muted); }
.sub-score-val { font-weight: 600; color: var(--text); }

/* ── Improvements / Strengths ── */
.detail-section { margin-top: 12px; }
.detail-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 6px; }
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.detail-list li { font-size: 0.82rem; color: var(--text-muted); padding-left: 12px; position: relative; }
.detail-list li::before { content: '·'; position: absolute; left: 0; }

/* ── Caption / Hashtag ── */
.analysis-score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.analysis-score-num { font-size: 2rem; font-weight: 800; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.tag.bad { border-color: rgba(239,68,68,0.3); color: var(--red); background: rgba(239,68,68,0.08); }
.tag.good { border-color: rgba(34,197,94,0.3); color: var(--green); background: rgba(34,197,94,0.08); }

/* ── Video Info ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.info-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.info-label { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.info-value { font-size: 0.95rem; font-weight: 600; }

/* ── Error ── */
.error-card { text-align: center; padding: 48px 28px; }
.error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.error-msg { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ── CTA Row ── */
.cta-row { text-align: center; margin-top: 8px; }
.cta-row .btn { max-width: 320px; margin: 0 auto; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-dim);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--accent2); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ── Video Summary ── */
.summary-card { border-left: 3px solid var(--accent2); }
.video-summary-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ── Suggestions ── */
.suggestions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 600px) { .suggestions-grid { grid-template-columns: 1fr; } }
.suggestion-col { display: flex; flex-direction: column; gap: 12px; }
.suggestion-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.caption-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.caption-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Suggestion label row ── */
.suggestion-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ── Scrollable containers ── */
.captions-scroll {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.captions-scroll::-webkit-scrollbar { width: 4px; }
.captions-scroll::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

.hashtags-scroll {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}
.hashtags-scroll::-webkit-scrollbar { width: 4px; }
.hashtags-scroll::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

/* ── Caption suggestion with copy ── */
.caption-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  transition: border-color 0.2s;
}
.caption-suggestion:hover { border-color: var(--border-hover); }
.caption-text { flex: 1; }

/* ── Copy buttons ── */
.copy-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }

.copy-all-btn {
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 999px;
  color: var(--accent2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 12px;
  transition: all 0.2s;
}
.copy-all-btn:hover { background: rgba(124,58,237,0.2); }
.copy-all-btn.copied { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.1); }

/* ── Copyable hashtag tags ── */
.copyable-tag {
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.copyable-tag:hover {
  background: rgba(34,197,94,0.2);
  border-color: var(--green);
  color: var(--green);
}

/* ── Sync Timeline ── */
.timeline-card { overflow: hidden; }
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.timeline-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 18px; }

.sync-score-badge {
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}
.sync-good { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.sync-mid  { background: rgba(234,179,8,0.15); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.sync-bad  { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* Legend */
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.legend-dot {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}
.legend-dot.ok           { background: #22c55e; }
.legend-dot.audio_issue  { background: #f97316; }
.legend-dot.text_issue   { background: #a855f7; }
.legend-dot.visual_issue { background: #ef4444; }
.legend-dot.scene_cut    { background: #fff; width: 2px; height: 14px; border-radius: 1px; }
.legend-dot.silence      { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); }

/* Timeline bar */
.timeline-wrap {
  position: relative;
  margin-bottom: 8px;
}
.timeline-bar {
  position: relative;
  height: 32px;
  background: var(--bg3);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.tl-segment {
  position: absolute;
  top: 0;
  height: 100%;
  transition: opacity 0.2s;
  cursor: pointer;
}
.tl-segment:hover { opacity: 1 !important; }
.tl-silence {
  position: absolute;
  top: 0;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.05),
    rgba(255,255,255,0.05) 3px,
    transparent 3px,
    transparent 8px
  );
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
}
.timeline-markers { position: relative; height: 12px; }
.tl-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}
.tl-marker.scene-cut {
  width: 2px;
  height: 10px;
  background: rgba(255,255,255,0.5);
  border-radius: 1px;
}
.timeline-timestamps {
  position: relative;
  height: 18px;
  margin-top: 2px;
}
.tl-timestamp {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Issues list */
.timeline-issues { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.tl-all-good {
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 14px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
}
.tl-issue {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}
.tl-issue-time {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
  font-size: 0.8rem;
}
.tl-issue-icon { font-size: 1rem; }
.tl-issue-label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 90px;
}
.tl-issue-label.audio_issue  { color: #f97316; }
.tl-issue-label.text_issue   { color: #a855f7; }
.tl-issue-label.visual_issue { color: #ef4444; }
.tl-issue-note { color: var(--text-muted); flex: 1; }

/* ── User menu ── */
.user-menu { position: relative; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(124,58,237,0.4);
}
.user-avatar:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(124,58,237,0.5); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  animation: fadeDown 0.2s ease;
}
.user-dropdown-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.user-dropdown-email { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.dropdown-item {
  width: 100%;
  background: none;
  border: none;
  color: var(--red, #ef4444);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 4px;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  transition: background 0.2s;
}
.dropdown-item:hover { background: rgba(239,68,68,0.1); }

/* ── Animated page background ── */
.page-bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 56px 56px;
}
.page-orb { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: 0; animation: pageOrbFloat ease-in-out infinite; }
.page-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%); top: -150px; left: -150px; animation-duration: 12s; }
.page-orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(99,102,241,0.1), transparent 70%); bottom: -100px; right: -100px; animation-duration: 16s; animation-delay: -6s; }
@keyframes pageOrbFloat { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,-30px)} }

/* ── Header upgrade ── */
.header { position: sticky; top: 0; z-index: 100; background: rgba(10,10,15,0.88); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
/* Logo LEFT, pill CENTER, avatar RIGHT — all with proper spacing */
.header-inner {
  width: 100%;
  padding: 13px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.header-center { display: flex; justify-content: center; }
#headerAuth { display: flex; justify-content: flex-end; align-items: center; }

/* Logo */
.logo-link-analyser { display: flex; align-items: center; gap: 9px; text-decoration: none; transition: transform 0.2s; justify-self: start; }
.logo-link-analyser:hover { transform: scale(1.04); }
.logo-mark-analyser { width: 32px; height: 32px; border-radius: 9px; overflow: hidden; box-shadow: 0 3px 12px rgba(124,58,237,0.4); }
.logo-name-analyser { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.logo-ai-analyser { background: linear-gradient(135deg, #a855f7, #6366f1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Nav pill */
.nav-pill { display: inline-flex; align-items: center; gap: 7px; background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.25); border-radius: 999px; padding: 5px 16px; font-size: 0.8rem; color: var(--accent2); font-weight: 600; white-space: nowrap; }
.nav-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); animation: navPulse 2s ease infinite; }
@keyframes navPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.7)} }

/* ── Hero — full width, centered text ── */
.hero { width: 100%; padding: 52px 80px 28px; text-align: center; position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.25); color: var(--accent2); border-radius: 999px; padding: 5px 16px; font-size: 0.78rem; font-weight: 600; margin-bottom: 18px; letter-spacing: 0.03em; animation: fadeDown 0.6s ease both; }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); animation: navPulse 2s ease infinite; }
@keyframes fadeDown { from{opacity:0;transform:translateY(-16px)} to{opacity:1;transform:translateY(0)} }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 14px; animation: fadeUp 0.7s ease 0.1s both; }
.gradient-text { background: linear-gradient(135deg, #c084fc, #a855f7, #818cf8, #a855f7); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: gradShift 4s linear infinite; }
@keyframes gradShift { 0%{background-position:0% center} 100%{background-position:200% center} }
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.hero-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 620px; margin: 0 auto; line-height: 1.75; animation: fadeUp 0.7s ease 0.2s both; }

/* ── Main — full width with generous padding ── */
.main { width: 100%; padding: 0 40px 80px; position: relative; z-index: 1; }

/* ── Credits bar ── */
.credits-bar {
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.credits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.credits-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.credits-count {
  font-size: 13px;
  color: var(--muted);
}
.credits-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.credits-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Upload card — centered, max width for readability ── */
.upload-card { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ── Results use wide 2-col layout on large screens ── */
.results-wide-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) { .results-wide-grid { grid-template-columns: 1fr; } }

/* ── Card upgrade ── */
.card { background: rgba(17,17,24,0.8); border: 1px solid var(--border); border-radius: 18px; padding: 28px; margin-bottom: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); backdrop-filter: blur(12px); transition: border-color 0.2s; animation: cardIn 0.5s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes cardIn { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.card:hover { border-color: rgba(168,85,247,0.2); }
.card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 18px; color: var(--text); }
.card-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }

/* ── Drop zone upgrade ── */
.drop-zone { border: 2px dashed rgba(168,85,247,0.25); border-radius: 14px; padding: 44px 20px; text-align: center; cursor: pointer; transition: border-color 0.25s, background 0.25s, transform 0.2s; margin-bottom: 20px; position: relative; overflow: hidden; }
.drop-zone::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(124,58,237,0.04), transparent 70%); opacity: 0; transition: opacity 0.3s; }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent2); background: rgba(124,58,237,0.04); transform: scale(1.005); }
.drop-zone:hover::before, .drop-zone.drag-over::before { opacity: 1; }
.drop-icon-wrap { width: 64px; height: 64px; background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.2); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: var(--accent2); transition: transform 0.2s, box-shadow 0.2s; }
.drop-zone:hover .drop-icon-wrap { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(124,58,237,0.25); }
.drop-svg-icon { transition: transform 0.2s; }
.drop-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.drop-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 18px; }

/* ── Progress upgrade ── */
.progress-card { text-align: center; padding: 52px 28px; }
.progress-ring-wrap { position: relative; width: 80px; height: 80px; margin: 0 auto 24px; }
.progress-ring-svg { width: 100%; height: 100%; animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-ring-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; animation: counterSpin 2s linear infinite; }
@keyframes counterSpin { to { transform: rotate(-360deg); } }
.progress-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; background: linear-gradient(135deg, #fff, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.progress-sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 28px; }


/* ── Score card upgrade ── */
.score-card { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(17,17,24,0.9), rgba(26,26,36,0.9)); border-color: rgba(168,85,247,0.2); }
.score-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 9; }
.ring-fill { fill: none; stroke: var(--accent2); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; filter: drop-shadow(0 0 8px var(--accent2)); }
.score-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 900; }
.score-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.score-verdict { font-size: 1.4rem; font-weight: 800; }
.score-right { flex: 1; min-width: 200px; }

/* ── Error upgrade ── */
.error-card { text-align: center; padding: 52px 28px; }
.error-icon-wrap { width: 64px; height: 64px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.error-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.error-msg { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ── Summary card ── */
.summary-card { border-left: 3px solid var(--accent2); }
.video-summary-text { color: var(--text-muted); font-size: 0.95rem; line-height: 1.75; }

/* ── Breakdown grid upgrade ── */
.breakdown-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.breakdown-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 16px; transition: border-color 0.2s, transform 0.2s; }
.breakdown-item:hover { border-color: rgba(168,85,247,0.3); transform: translateY(-2px); }
.breakdown-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.breakdown-score-row { display: flex; align-items: center; gap: 10px; }
.breakdown-score { font-size: 1.5rem; font-weight: 900; min-width: 40px; }
.breakdown-bar-wrap { flex: 1; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.breakdown-bar { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.score-high .breakdown-bar { background: linear-gradient(90deg, #16a34a, #22c55e); }
.score-mid .breakdown-bar { background: linear-gradient(90deg, #ca8a04, #eab308); }
.score-low .breakdown-bar { background: linear-gradient(90deg, #dc2626, #ef4444); }
.score-high .breakdown-score { color: var(--green); }
.score-mid .breakdown-score { color: var(--yellow); }
.score-low .breakdown-score { color: var(--red); }

/* ── Btn upgrade ── */
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; width: 100%; justify-content: center; font-size: 1rem; padding: 14px; box-shadow: 0 4px 24px rgba(124,58,237,0.4); border-radius: 12px; position: relative; overflow: hidden; }
.btn-primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent); opacity: 0; transition: opacity 0.2s; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,0.5); }
.btn-primary:hover:not(:disabled)::before { opacity: 1; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── User dropdown upgrade ── */
.user-dropdown-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: #fff;
  margin: 0 auto 10px;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}
.user-dropdown { text-align: center; }
.user-dropdown-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.user-dropdown-email { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item {
  width: 100%;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red, #ef4444);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dropdown-item:hover { background: rgba(239,68,68,0.15); }

/* ══════════════════════════════════════════════
   INPUT TABS  (Upload File / Instagram Link)
   ══════════════════════════════════════════════ */

.input-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 22px;
}

.input-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  /* min 44px touch target */
  padding: 11px 12px;
  min-height: 44px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.input-tab:hover:not(.active) {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.input-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 3px 12px rgba(124,58,237,0.35);
}

/* ── Instagram URL panel ── */
.insta-url-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.insta-url-wrap:focus-within {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}

.insta-url-icon {
  color: var(--accent2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.insta-url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  padding: 2px 0;
  min-width: 0;
  /* prevent iOS zoom on focus (font-size must be ≥ 16px on iOS) */
  font-size: max(16px, 0.9rem);
}

.insta-url-input::placeholder { color: var(--text-dim); }

.insta-paste-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.82rem;
  min-height: 36px;
}

.insta-url-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  padding-left: 2px;
}

.insta-url-hint strong { color: var(--text-muted); }

/* Prevent iOS zoom on all inputs/selects */
.field input,
.field select,
.field textarea {
  font-size: max(16px, 0.9rem);
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ══════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .header-inner { padding: 12px 24px; }
  .hero { padding: 44px 32px 24px; }
  .main { padding: 0 24px 64px; }
  .breakdown-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ── Small tablet / large phone (≤ 768px) ── */
@media (max-width: 768px) {
  /* Disable hover transforms on touch — they stick after tap */
  .drop-zone:hover { transform: none; }
  .breakdown-item:hover { transform: none; }
  .card:hover { border-color: var(--border); }

  /* Header — switch to flex, hide center pill */
  .header-inner { padding: 11px 16px; display: flex; }
  .header-center { display: none; }
  #headerAuth { margin-left: auto; }

  /* Hero */
  .hero { padding: 36px 16px 20px; }
  .hero-title { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .hero-sub { font-size: 0.92rem; }

  /* Main */
  .main { padding: 0 16px 60px; }
  .upload-card { max-width: 100%; }

  /* Cards */
  .card { padding: 20px; }

  /* Drop zone */
  .drop-zone { padding: 32px 16px; }
  .drop-icon-wrap { width: 52px; height: 52px; }

  /* Score card — stack vertically */
  .score-card { flex-direction: column; align-items: stretch; gap: 16px; }
  .score-left { flex-direction: row; align-items: center; gap: 16px; }
  .score-ring { width: 90px; height: 90px; }
  .score-number { font-size: 1.4rem; }
  .score-verdict { font-size: 1.1rem; }
  .score-right { min-width: unset; width: 100%; }

  /* Two-col → single col */
  .two-col { grid-template-columns: 1fr; gap: 16px; }

  /* Breakdown grid — 2 cols on tablet */
  .breakdown-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Suggestions */
  .suggestions-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Video info */
  .info-grid { grid-template-columns: repeat(2, 1fr); }

  /* Timeline */
  .timeline-legend { gap: 10px; }
  .legend-item { font-size: 0.72rem; }
  .timeline-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* User dropdown */
  .user-dropdown { right: 0; min-width: 180px; }

  /* CTA row */
  .cta-row .btn { max-width: 100%; width: 100%; }

  /* Progress card */
  .progress-card { padding: 36px 20px; }
  .progress-steps-v2 { max-width: 100%; }

  /* Input tabs — bigger touch targets */
  .input-tab { padding: 12px 10px; font-size: 0.85rem; }
}

/* ── Phone (≤ 480px) ── */
@media (max-width: 480px) {
  /* Header */
  .logo-mark-analyser { width: 26px; height: 26px; }
  .logo-name-analyser { font-size: 0.95rem; }
  .btn-login { font-size: 0.78rem; padding: 6px 14px; min-height: 36px; }

  /* Hero */
  .hero { padding: 28px 14px 18px; }
  .hero-badge { font-size: 0.72rem; padding: 4px 12px; }
  .hero-title { font-size: clamp(1.4rem, 7vw, 1.9rem); }
  .hero-sub { font-size: 0.87rem; }

  /* Main */
  .main { padding: 0 12px 52px; }

  /* Cards */
  .card { padding: 16px; border-radius: 14px; }

  /* Drop zone */
  .drop-zone { padding: 28px 12px; }
  .drop-title { font-size: 0.95rem; }
  .drop-sub { font-size: 0.8rem; }

  /* Browse button — full width on mobile */
  .drop-zone .btn-outline { width: 100%; justify-content: center; }

  /* Score card */
  .score-ring { width: 80px; height: 80px; }
  .score-number { font-size: 1.25rem; }
  .score-verdict { font-size: 1rem; }
  .score-label { font-size: 0.68rem; }

  /* Breakdown grid — single col on phone */
  .breakdown-grid { grid-template-columns: 1fr; gap: 10px; }
  .breakdown-score { font-size: 1.3rem; }

  /* Video info */
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .info-item { padding: 10px 12px; }
  .info-value { font-size: 0.88rem; }

  /* Timeline */
  .timeline-legend { gap: 8px; }
  .legend-item { font-size: 0.68rem; gap: 4px; }
  .tl-issue { flex-wrap: wrap; gap: 6px; }
  .tl-issue-label { min-width: unset; }
  .tl-issue-note { width: 100%; font-size: 0.8rem; }

  /* Captions scroll */
  .captions-scroll { max-height: 260px; }

  /* Bullet list */
  .bullet-list li { font-size: 0.85rem; }

  /* Card title */
  .card-title-row { gap: 6px; }
  .card-title { font-size: 0.9rem; }

  /* Overall summary */
  .overall-summary { font-size: 0.88rem; }

  /* Tags */
  .tag { font-size: 0.72rem; padding: 2px 8px; }

  /* File preview */
  .file-preview { flex-wrap: wrap; }
  .file-size { font-size: 0.75rem; }

  /* Remove btn — bigger tap target */
  .remove-btn { padding: 6px 10px; font-size: 1rem; }

  /* Progress */
  .progress-card { padding: 28px 14px; }
  .progress-title { font-size: 1.05rem; }
  .progress-sub { font-size: 0.83rem; }
  .step { font-size: 0.83rem; }

  /* Input tabs */
  .input-tab { font-size: 0.8rem; padding: 10px 8px; gap: 5px; }
  .input-tab svg { width: 13px; height: 13px; }

  /* Instagram URL */
  .insta-url-wrap { padding: 8px 12px; gap: 8px; }
  .insta-url-icon { display: none; } /* save space on small screens */
  .insta-paste-btn { padding: 7px 12px; font-size: 0.78rem; }
  .insta-url-hint { font-size: 0.75rem; }

  /* Niche select */
  .field select { padding: 12px 14px; }

  /* Submit button */
  .btn-primary { padding: 15px 14px; font-size: 0.95rem; }

  /* Error card */
  .error-card { padding: 36px 16px; }
  .error-icon-wrap { width: 52px; height: 52px; }
}

/* ── Tiny (≤ 360px) ── */
@media (max-width: 360px) {
  .hero-title { font-size: 1.3rem; }
  .main { padding: 0 10px 48px; }
  .card { padding: 14px; }
  .info-grid { grid-template-columns: 1fr; }
  .score-ring { width: 70px; height: 70px; }
  .score-left { gap: 12px; }
  /* Hide login text on tiny screens to prevent header overflow */
  .btn-login { font-size: 0.72rem; padding: 5px 10px; }
  .input-tab { font-size: 0.75rem; padding: 9px 6px; }
  .breakdown-grid { gap: 8px; }
}
/* ── History Section ── */
.history-card {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.history-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.history-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.history-item:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124,58,237,0.15);
}
.history-thumb {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  background: var(--bg);
  display: block;
}
.history-thumb-placeholder {
  width: 100%;
  aspect-ratio: 9/16;
  background: linear-gradient(135deg, var(--bg3), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.history-info {
  padding: 10px 12px;
}
.history-filename {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-score {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}
.history-score.high { background: rgba(34,197,94,0.15); color: var(--green); }
.history-score.mid { background: rgba(234,179,8,0.15); color: var(--yellow); }
.history-score.low { background: rgba(239,68,68,0.15); color: var(--red); }
.history-date {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.history-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.history-source-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.history-item { position: relative; }

@media (max-width: 480px) {
  .history-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 12px;
  transition: all 0.2s;
}
.bottom-nav-item.active {
  color: var(--accent2);
}
.bottom-nav-item.active svg {
  stroke: var(--accent2);
}
.nav-center {
  position: relative;
  top: -8px;
}
.nav-plus-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-center:hover .nav-plus-btn {
  transform: scale(1.08);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.nav-center svg { stroke: #fff; }
.nav-center span { margin-top: 4px; }

/* Add bottom padding to body so content isn't hidden behind nav */
body { padding-bottom: 80px; }

/* ── History Page ── */
.history-page {
  width: 100%;
  padding: 20px 20px 100px;
  max-width: 720px;
  margin: 0 auto;
}
.history-page-header {
  margin-bottom: 20px;
}
.history-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.history-page-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
}
.history-page-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.history-list-item:hover {
  border-color: var(--accent2);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(124,58,237,0.1);
}
.history-list-thumb {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}
.history-list-thumb-placeholder {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--bg3), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.history-list-info {
  flex: 1;
  min-width: 0;
}
.history-list-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.history-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.history-list-niche {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.68rem;
  text-transform: capitalize;
}
.history-list-score {
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}
.history-list-score.high { color: var(--green); }
.history-list-score.mid { color: var(--yellow); }
.history-list-score.low { color: var(--red); }
.history-page-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* ── Result Thumbnail ── */
.result-thumb-wrap {
  width: 60px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Left Sidebar (Desktop) ── */
.sidebar {
  display: none; /* Hidden on mobile */
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 200;
    padding: 20px 12px;
  }
  .sidebar-top {
    padding: 8px 12px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s;
  }
  .sidebar-logo:hover { transform: scale(1.02); }
  .sidebar-logo-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
  }
  .sidebar-logo-ai {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
  }
  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
  }
  .sidebar-item:hover {
    background: rgba(168,85,247,0.08);
    color: var(--text);
  }
  .sidebar-item.active {
    background: rgba(168,85,247,0.12);
    color: var(--accent2);
    border: 1px solid rgba(168,85,247,0.2);
  }
  .sidebar-item.active svg {
    stroke: var(--accent2);
  }
  .sidebar-bottom {
    padding: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
  }
  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s;
  }
  .sidebar-user:hover { background: rgba(255,255,255,0.04); }
  .sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
  }
  .sidebar-user-info {
    flex: 1;
    min-width: 0;
  }
  .sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-user-email {
    font-size: 0.7rem;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Shift main content to the right on desktop */
  .header {
    display: none; /* Hide top header on desktop — sidebar has the logo */
  }
  .hero {
    margin-left: 240px;
  }
  .main {
    margin-left: 240px;
  }
  .footer {
    margin-left: 240px;
  }
  .history-page {
    margin-left: 240px;
  }

  /* Hide bottom nav on desktop */
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }

  /* When sidebar is collapsed via body class */
  body.sidebar-collapsed .hero,
  body.sidebar-collapsed .main,
  body.sidebar-collapsed .footer,
  body.sidebar-collapsed .history-page {
    margin-left: 64px;
  }

  /* Transition for smooth collapse */
  .sidebar {
    transition: width 0.25s ease;
  }
  .hero, .main, .footer, .history-page {
    transition: margin-left 0.25s ease;
  }
}


/* ── Video Player in Timeline Card ── */
.video-player-wrap {
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  position: relative;
}
.video-player {
  width: 100%;
  max-height: 400px;
  display: block;
  object-fit: contain;
  background: #000;
}
.video-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.8);
}
.video-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.video-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.video-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ── Timeline Playhead ── */
.timeline-playhead {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
  z-index: 10;
  left: 0%;
  transition: left 0.1s linear;
  pointer-events: none;
}

/* Make timeline bar clickable for seeking */
.timeline-bar {
  cursor: pointer;
}

@media (max-width: 480px) {
  .video-player { max-height: 280px; }
}


/* ── Breakdown Scrollable Chips ── */
.breakdown-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.breakdown-scroll::-webkit-scrollbar { display: none; }

.breakdown-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
  padding: 12px 14px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.breakdown-chip:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.breakdown-chip.active {
  border-color: var(--accent2);
  background: rgba(168,85,247,0.08);
  box-shadow: 0 4px 16px rgba(168,85,247,0.15);
}
.breakdown-chip.score-high.active { border-color: var(--green); background: rgba(34,197,94,0.08); box-shadow: 0 4px 16px rgba(34,197,94,0.15); }
.breakdown-chip.score-mid.active { border-color: var(--yellow); background: rgba(234,179,8,0.08); box-shadow: 0 4px 16px rgba(234,179,8,0.15); }
.breakdown-chip.score-low.active { border-color: var(--red); background: rgba(239,68,68,0.08); box-shadow: 0 4px 16px rgba(239,68,68,0.15); }

.chip-icon { font-size: 1.2rem; }
.chip-score {
  font-size: 1.3rem;
  font-weight: 800;
}
.score-high .chip-score { color: var(--green); }
.score-mid .chip-score { color: var(--yellow); }
.score-low .chip-score { color: var(--red); }
.chip-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* ── Breakdown Detail Card ── */
.breakdown-detail {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-top: 4px;
  animation: cardIn 0.3s ease;
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-icon { font-size: 1.3rem; }
.detail-title {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
}
.detail-score {
  font-size: 1.2rem;
  font-weight: 800;
}
.detail-header.score-high .detail-score { color: var(--green); }
.detail-header.score-mid .detail-score { color: var(--yellow); }
.detail-header.score-low .detail-score { color: var(--red); }

.detail-bar-wrap {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.detail-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.detail-bar.score-high { background: var(--green); }
.detail-bar.score-mid { background: var(--yellow); }
.detail-bar.score-low { background: var(--red); }


/* ── Sidebar Toggle Button ── */
.sidebar-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(168,85,247,0.1);
  border-color: var(--accent2);
  color: var(--accent2);
}

@media (min-width: 1024px) {
  .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* ── Collapsed Sidebar ── */
  .sidebar.collapsed {
    width: 64px;
    padding: 20px 8px;
  }
  .sidebar.collapsed .sidebar-logo-text { display: none; }
  .sidebar.collapsed .sidebar-item span { display: none; }
  .sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 12px;
  }
  .sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
  }
  .sidebar.collapsed .sidebar-bottom { display: none; }
  .sidebar.collapsed .sidebar-logo {
    justify-content: center;
  }
}


/* ── History Failed Items ── */
.history-list-item.history-failed {
  border-color: rgba(239,68,68,0.2);
  opacity: 0.8;
}
.history-list-item.history-failed:hover {
  border-color: rgba(239,68,68,0.4);
}
.history-list-score.failed {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red);
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  padding: 2px 8px;
}
.history-list-error {
  font-size: 0.72rem;
  color: var(--red);
  margin-top: 4px;
  opacity: 0.8;
  line-height: 1.3;
}


/* ── Verdict Card (action-first) ── */
.verdict-card {
  background: linear-gradient(135deg, rgba(17,17,24,0.9), rgba(26,26,36,0.9));
  border-color: rgba(168,85,247,0.2);
}
.verdict-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.verdict-meta {
  flex: 1;
  min-width: 180px;
}
.verdict-meta .score-verdict {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.verdict-meta .overall-summary {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Fixes Card Full Width ── */
.fixes-card-full {
  border-left: 3px solid var(--orange);
}
.fixes-card-full .bullet-list li {
  font-size: 0.92rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.fixes-card-full .bullet-list li:last-child { border-bottom: none; }

/* ── Hook Rewrite Section ── */
.hook-rewrite-card {
  border-left: 3px solid var(--accent2);
}
.hook-rewrite-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.hook-rewrite-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.hook-rewrite-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.hook-rewrite-text { flex: 1; }


/* ── Premium Video Player V2 ── */
.timeline-card-v2 {
  padding: 0;
  overflow: hidden;
}
.player-wrap { position: relative; }
.player-container {
  position: relative;
  background: #000;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.player-video {
  width: 100%;
  max-height: 480px;
  display: block;
  object-fit: contain;
  background: #000;
}
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 1;
  transition: opacity 0.3s;
  cursor: pointer;
}
.player-overlay.hidden { opacity: 0; pointer-events: none; }
.player-big-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(168,85,247,0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(168,85,247,0.4);
  transition: transform 0.2s;
}
.player-big-play:hover { transform: scale(1.1); }

/* Player Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(17,17,24,0.95);
}
.player-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.player-btn:hover { color: var(--accent2); }
.player-time, .player-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

/* Scrubber */
.player-scrubber {
  flex: 1;
  padding: 8px 0;
  cursor: pointer;
  touch-action: none;
}
.scrubber-track {
  position: relative;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
}
.scrubber-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}
.scrubber-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: var(--accent2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(168,85,247,0.4);
  transition: left 0.1s linear, transform 0.15s;
}
.scrubber-thumb:hover, .player-scrubber:active .scrubber-thumb {
  transform: translate(-50%, -50%) scale(1.3);
}

/* ── Timeline V2 ── */
.tl2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.tl2-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
}
.tl2-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 4px 24px 16px;
}

/* Timeline Bar */
.tl2-bar-wrap {
  padding: 0 24px 12px;
}
.tl2-bar {
  position: relative;
  height: 40px;
  background: var(--bg3);
  border-radius: 8px;
  overflow: visible;
  border: 1px solid var(--border);
  cursor: pointer;
}
.tl2-playhead {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  z-index: 10;
  left: 0%;
  transition: left 0.1s linear;
  pointer-events: none;
}
.tl2-markers {
  position: relative;
  height: 28px;
  margin-top: 4px;
}
.tl2-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}
.tl2-marker:hover {
  transform: translateX(-50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tl2-marker.ok { background: rgba(34,197,94,0.2); border-color: var(--green); }
.tl2-marker.audio_issue { background: rgba(234,179,8,0.2); border-color: var(--yellow); }
.tl2-marker.text_issue { background: rgba(99,102,241,0.2); border-color: #6366f1; }
.tl2-marker.visual_issue { background: rgba(239,68,68,0.2); border-color: var(--red); }
.tl2-marker.slow { background: rgba(249,115,22,0.2); border-color: var(--orange); }
.tl2-marker.ending { background: rgba(168,85,247,0.2); border-color: var(--accent2); }

.tl2-timestamps {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Issue Cards */
.tl2-issues {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl2-issue-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.tl2-issue-card:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}
.tl2-issue-card.expanded {
  border-color: var(--accent2);
  background: rgba(168,85,247,0.04);
}
.tl2-issue-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl2-issue-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}
.tl2-issue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tl2-issue-dot.ok { background: var(--green); }
.tl2-issue-dot.audio_issue { background: var(--yellow); }
.tl2-issue-dot.text_issue { background: #6366f1; }
.tl2-issue-dot.visual_issue { background: var(--red); }
.tl2-issue-dot.slow { background: var(--orange); }
.tl2-issue-dot.ending { background: var(--accent2); }

.tl2-issue-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.tl2-issue-expand {
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: transform 0.2s;
}
.tl2-issue-card.expanded .tl2-issue-expand { transform: rotate(180deg); }

/* Expanded issue detail */
.tl2-issue-detail {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tl2-issue-card.expanded .tl2-issue-detail { display: block; }
.tl2-issue-reason {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.tl2-issue-fix {
  font-size: 0.82rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 12px;
}
.tl2-issue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tl2-action-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.tl2-action-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}
.tl2-action-btn.primary {
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.3);
  color: var(--accent2);
}

/* No issues state */
.tl2-all-good {
  text-align: center;
  padding: 20px;
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .player-video { max-height: 320px; }
  .tl2-header, .tl2-sub, .tl2-bar-wrap, .tl2-issues { padding-left: 16px; padding-right: 16px; }
}


/* ── Nav Profile Avatar ── */
.nav-profile-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent2);
}
#navProfileLabel {
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
}


/* ── Top Result Card ── */
.top-result-card {
  background: linear-gradient(135deg, rgba(17,17,24,0.95), rgba(26,26,36,0.95));
  border-color: rgba(168,85,247,0.2);
}
.top-result-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: start;
}
.top-result-thumb-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 9/16;
  background: var(--bg3);
}
.top-result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.top-result-niche {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--accent2);
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.top-result-info { display: flex; flex-direction: column; gap: 16px; }
.top-result-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Sub-score Grid (shown on top card) */
.sub-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.sub-score-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}
.sub-score-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.sub-score-value {
  font-size: 1.1rem;
  font-weight: 800;
}
.sub-score-value.high { color: var(--green); }
.sub-score-value.mid { color: var(--yellow); }
.sub-score-value.low { color: var(--red); }

/* Description Card */
.desc-card { padding: 18px 24px; }
.reel-desc {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 14px;
}
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.why-item {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.why-item.why-viral {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.2);
}
.why-item.why-rework {
  background: rgba(249,115,22,0.06);
  border-color: rgba(249,115,22,0.2);
}
.why-label {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.why-viral .why-label { color: var(--green); }
.why-rework .why-label { color: var(--orange); }
.why-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Hashtags result card */
.hashtags-cloud-result {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hashtag-tag-result {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: var(--accent2);
  cursor: pointer;
  transition: all 0.15s;
}
.hashtag-tag-result:hover {
  border-color: var(--accent2);
  background: rgba(168,85,247,0.1);
}

@media (max-width: 600px) {
  .top-result-grid { grid-template-columns: 80px 1fr; }
  .top-result-niche { font-size: 0.6rem; padding: 2px 4px; }
}


/* ── Niche + Description Card ── */
.desc-card { padding: 16px 20px; }
.desc-top-row { margin-bottom: 8px; }
.niche-badge {
  display: inline-block;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--accent2);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.reel-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}


/* ── Niche Badge Overlay on Thumbnail ── */
.niche-badge-overlay {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.75);
  color: var(--accent2);
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.result-thumb-wrap { position: relative; }

/* ── Verdict Description + Why ── */
.verdict-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.verdict-why {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 8px;
  font-style: italic;
}


/* ── Results V3 — Reference Design ── */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 24px 0 8px;
  padding-left: 4px;
}

/* Top Score Card */
.result-top-card { padding: 20px; }
.result-top-grid { display: grid; grid-template-columns: 100px 1fr; gap: 16px; }
.result-top-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg3);
  aspect-ratio: 9/16;
}
.result-top-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-duration {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 600;
}
.result-top-info { display: flex; flex-direction: column; gap: 12px; }
.result-top-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.niche-pill {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--green);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.perf-pill {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.perf-pill.viral { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3); color: var(--green); }
.perf-pill.above { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.3); color: var(--accent2); }
.perf-pill.average { background: rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.3); color: var(--yellow); }

.result-overall-row { display: flex; align-items: center; gap: 12px; }
.score-ring-sm { width: 48px; height: 48px; position: relative; flex-shrink: 0; }
.score-ring-sm svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-sm .score-number { font-size: 0.9rem; font-weight: 800; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.result-overall-label { font-size: 0.82rem; font-weight: 700; }
.result-overall-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Sub-scores row */
.sub-scores-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sub-score-col { text-align: center; }
.sub-score-num { font-size: 1.2rem; font-weight: 800; }
.sub-score-num.high { color: var(--green); }
.sub-score-num.mid { color: var(--yellow); }
.sub-score-num.low { color: var(--red); }
.sub-score-bar { height: 3px; border-radius: 2px; margin: 4px auto; width: 80%; }
.sub-score-bar.high { background: var(--green); }
.sub-score-bar.mid { background: var(--yellow); }
.sub-score-bar.low { background: var(--red); }
.sub-score-name { font-size: 0.65rem; color: var(--text-dim); text-transform: capitalize; }

/* Verdict Text Card */
.verdict-text-card { padding: 20px 24px; }
.verdict-text-card .section-title { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.verdict-paragraph { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.verdict-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.verdict-tag {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
}
.verdict-tag.green { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.verdict-tag.orange { background: rgba(249,115,22,0.12); color: var(--orange); border: 1px solid rgba(249,115,22,0.3); }
.verdict-tag.red { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* Fixes V2 */
.fixes-card-v2 { padding: 16px 20px; }
.fix-item-v2 { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); transition: background 0.2s; border-radius: 6px; }
.fix-item-v2:last-child { border-bottom: none; }
.fix-item-v2.clickable-fix:hover { background: rgba(255,255,255,0.03); padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; }
.fix-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.fix-num.high { background: var(--red); }
.fix-num.medium { background: var(--orange); }
.fix-num.low { background: var(--text-dim); }
.fix-content { flex: 1; }
.fix-title { font-size: 0.88rem; font-weight: 500; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fix-impact { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.fix-impact.high { background: rgba(239,68,68,0.15); color: var(--red); }
.fix-impact.medium { background: rgba(249,115,22,0.15); color: var(--orange); }
.fix-impact.low { background: rgba(136,136,160,0.15); color: var(--text-muted); }
.fix-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; font-weight: 400; }

/* Wins V2 */
.wins-card-v2 { padding: 16px 20px; }
.win-item-v2 { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.win-item-v2:last-child { border-bottom: none; }
.win-icon { color: var(--green); font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.win-content { flex: 1; }
.win-title { font-size: 0.88rem; font-weight: 500; color: var(--green); margin-bottom: 4px; }
.win-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; font-weight: 400; }

/* Timeline V3 */
.tl-layout { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 20px; }
.tl-video-side { position: relative; border-radius: 10px; overflow: hidden; background: #000; max-width: 160px; }
.tl-video { width: 100%; display: block; }
.tl-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); color: #fff; font-size: 2rem; border: none; cursor: pointer; }
.tl-time-badge { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 0.7rem; }
.tl-hint { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.4; }
.tl-legend-inline { color: var(--text-dim); }
.tl-bar-wrap { margin-bottom: 8px; }
.tl-bar { position: relative; height: 36px; border-radius: 6px; overflow: hidden; cursor: pointer; display: flex; }
.tl-segment-v3 { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.9); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 4px; }
.tl-segment-v3.red { background: #dc2626; }
.tl-segment-v3.amber { background: #b45309; }
.tl-segment-v3.green { background: #15803d; }
.tl-segment-v3.yellow { background: #a16207; }
.tl-playhead { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px rgba(255,255,255,0.5); z-index: 10; left: 0%; pointer-events: none; }
.tl-timestamps { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-dim); padding: 2px 0; }
.tl-legend-row { display: flex; gap: 14px; margin: 8px 0 14px; }
.tl-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--text-muted); }
.tl-dot { width: 10px; height: 10px; border-radius: 2px; }
.tl-dot.red { background: #dc2626; }
.tl-dot.amber { background: #b45309; }
.tl-dot.green { background: #15803d; }

/* Scrollable chronological issues with custom scrollbar */
.tl-issues-list { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  max-height: 140px; 
  overflow-y: auto; 
  padding-right: 6px; 
}
.tl-issues-list::-webkit-scrollbar {
  width: 6px;
}
.tl-issues-list::-webkit-scrollbar-track {
  background: transparent;
}
.tl-issues-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
.tl-issues-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tl-issue-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: 0.82rem; color: rgba(255,255,255,0.9); transition: background 0.15s; }
.tl-issue-row:hover { background: rgba(255,255,255,0.03); }
.tl-issue-row.red { background: rgba(220,38,38,0.12); border-left: 3px solid #dc2626; }
.tl-issue-row.amber { background: rgba(180,83,9,0.12); border-left: 3px solid #b45309; }
.tl-issue-row.green { background: rgba(21,128,61,0.12); border-left: 3px solid #15803d; }
.tl-issue-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Floating Ask AI Button */
.floating-ask-ai-btn {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 16px);
  right: 20px;
  z-index: 999;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4), inset 0 1px rgba(255,255,255,0.2);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(10px);
}
@media (min-width: 1024px) {
  .floating-ask-ai-btn {
    bottom: 24px;
    right: 24px;
  }
}
.floating-ask-ai-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.5), inset 0 1px rgba(255,255,255,0.3);
}
.floating-ask-ai-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Captions V2 */
.captions-card-v2 { padding: 16px 20px; }
.caption-item-v2 { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.caption-item-v2:last-child { border-bottom: none; }
.caption-num-v2 { color: var(--text-dim); font-weight: 600; min-width: 20px; }

/* Hashtags V2 */
.hashtags-card-v2 { padding: 16px 20px; }
.hashtags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.hashtag-pill {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  color: #818cf8;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.hashtag-pill:hover { background: rgba(99,102,241,0.2); border-color: #818cf8; }

@media (max-width: 600px) {
  .result-top-grid { grid-template-columns: 80px 1fr; gap: 12px; }
  .sub-scores-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}


/* ── Caption copy button ── */
.caption-text-v2 { flex: 1; }
.copy-btn-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.copy-btn-sm:hover { border-color: var(--accent2); color: var(--accent2); }
.copy-btn-sm.copied { border-color: var(--green); color: var(--green); }


/* ── Video Full Width (mobile-first) ── */
.tl-video-full {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.tl-video-player {
  width: 100%;
  max-height: 400px;
  display: block;
  object-fit: contain;
  background: #000;
}
.tl-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(168,85,247,0.85);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.3s;
  box-shadow: 0 4px 20px rgba(168,85,247,0.4);
}
.tl-play-btn.hidden { opacity: 0; pointer-events: none; }
.tl-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); }
.tl-time-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Timeline bar — NO text inside, just colors */
.tl-bar {
  position: relative;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  background: var(--bg3);
}
.tl-segment-v3 {
  height: 100%;
  font-size: 0;  /* NO text */
  overflow: hidden;
}

/* Thumbnail in score card — cover and clickable */
.result-top-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg3);
  aspect-ratio: 9/16;
  cursor: pointer;
}
.result-top-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Only show issues (not ok frames) in issue list */
.tl-issues-list { margin-top: 12px; }

@media (max-width: 480px) {
  .tl-video-player { max-height: 320px; }
}


/* ── Reel Scores — Horizontal Scrollable Cards ── */
.reel-scores-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.reel-scores-scroll::-webkit-scrollbar { display: none; }

.reel-score-card {
  min-width: 180px;
  max-width: 200px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 14px;
  text-align: center;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.reel-score-card:hover { border-color: var(--border-hover); }

.reel-score-ring {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
}
.reel-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.reel-score-ring .ring-bg-sm {
  fill: none;
  stroke: var(--bg3);
  stroke-width: 8;
}
.reel-score-ring .ring-fill-sm {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 188; /* 2 * π * 30 */
  stroke-dashoffset: 188;
  transition: stroke-dashoffset 0.8s ease;
}
.reel-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
}
.reel-score-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.reel-score-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.reel-score-badge.strong { background: rgba(34,197,94,0.15); color: var(--green); }
.reel-score-badge.average { background: rgba(234,179,8,0.15); color: var(--yellow); }
.reel-score-badge.weak { background: rgba(239,68,68,0.15); color: var(--red); }
.reel-score-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}


/* ── Wins V2 — Clean simple list ── */
.win-item-v2 { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.win-item-v2:last-child { border-bottom: none; }
.win-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.win-text { font-size: 0.88rem; color: var(--text); line-height: 1.5; font-weight: 500; }


/* ── Top Card V3 — Enlarged score, verdict below divider ── */
.score-ring-sm { width: 56px; height: 56px; }
.score-ring-sm .score-number { font-size: 1.1rem; }
.niche-pill { font-size: 0.78rem; padding: 4px 12px; }
.perf-pill { font-size: 0.78rem; padding: 4px 12px; }
.result-overall-row { gap: 14px; }
.result-overall-label { font-size: 0.9rem; font-weight: 700; color: var(--text); }

.result-verdict-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.result-verdict-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}


/* ── Top Card V4 — Wireframe layout ── */
.result-top-grid-v2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.result-left-col { display: flex; flex-direction: column; gap: 10px; }
.result-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.result-short-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.score-ring-sm { width: 64px; height: 64px; }
.score-ring-sm .score-number { font-size: 1.3rem; font-weight: 900; }
.niche-pill { font-size: 0.8rem; padding: 4px 14px; font-weight: 700; }
.perf-pill { font-size: 0.8rem; padding: 4px 14px; font-weight: 700; }


/* ── Score Card V5 — Confirmed wireframe ── */
.score-card-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.score-card-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg3);
  aspect-ratio: 9/16;
  cursor: pointer;
}
.score-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.score-card-right {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.score-card-ring-area {
  flex: 4; /* 80% */
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-card-niche-area {
  flex: 1; /* 20% */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.score-ring-sm { width: 64px; height: 64px; }
.score-ring-sm .score-number { font-size: 1.4rem; font-weight: 900; }
.score-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Verdict Card V2 — Separate */
.verdict-card-v2 { padding: 18px 22px; }
.verdict-header {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}
.verdict-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}


/* ── Score X/10 format ── */
.score-denom { font-size: 0.55em; color: var(--text-dim); font-weight: 500; }
.score-ring-sm { width: 80px; height: 80px; }
.score-ring-sm .score-number { font-size: 1.3rem; }

/* ── Reel Score Points (2 bullets) ── */
.reel-score-points { margin-top: 8px; text-align: left; }
.reel-score-point {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
}


/* ── Reel Score Card — Full text, no truncation ── */
.reel-score-card {
  min-width: 180px;
  max-width: 200px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  flex-shrink: 0;
}
.reel-score-points {
  margin-top: 8px;
  text-align: left;
}
.reel-score-point {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Score ring enlarged in top card - Trigger redeploy */
.score-ring-sm { width: 130px; height: 130px; }
.score-ring-sm .score-number { font-size: 2.5rem; font-weight: 900; }

/* History Skeleton Loading */
.history-skeleton-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.history-skeleton-thumb {
  width: 48px;
  height: 80px;
  border-radius: 8px;
  background: var(--bg3);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.history-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-skeleton-line {
  height: 14px;
  background: var(--bg3);
  border-radius: 4px;
  width: 75%;
  position: relative;
  overflow: hidden;
}
.history-skeleton-line.short {
  width: 35%;
}
.history-skeleton-score {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Pulsing Animation */
.history-skeleton-thumb::after,
.history-skeleton-line::after,
.history-skeleton-score::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: pulse-shimmer 1.6s infinite ease-in-out;
}

@keyframes pulse-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* AI Contextual Trigger Buttons */
.ask-ai-trigger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent1) 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.ask-ai-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
  opacity: 0.95;
}
.ask-ai-trigger-btn:active {
  transform: translateY(0);
}

.ask-ai-caption-btn-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.ask-ai-caption-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  color: #c084fc;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.ask-ai-caption-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #c084fc;
  color: #fff;
  transform: translateY(-1px);
}

/* ── History CTA Card ── */
.history-cta-card {
  margin-bottom: 24px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(25, 20, 48, 0.7), rgba(15, 12, 30, 0.8));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.history-cta-card-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.history-cta-card-icon {
  font-size: 1.4rem;
  background: rgba(168, 85, 247, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(168, 85, 247, 0.2);
  flex-shrink: 0;
}
.history-cta-card-text h4 {
  margin: 0 0 2px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.history-cta-card-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim, #94a3b8);
  line-height: 1.4;
}
.history-cta-card .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 10px;
  flex-shrink: 0;
  cursor: pointer;
}
@media (max-width: 600px) {
  .history-cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 20px;
  }
  .history-cta-card-content {
    flex-direction: column;
    gap: 10px;
  }
  .history-cta-card-icon {
    margin: 0 auto;
  }
  .history-cta-card .btn {
    width: 100%;
    justify-content: center;
  }
}


