:root {
  --bg: #faf9f7;
  --bg-subtle: #f5f3f0;
  --surface: rgba(255,255,255,0.72);
  --surface-solid: #ffffff;
  --surface-2: rgba(245,243,240,0.7);
  --surface-elevated: rgba(255,255,255,0.88);
  --border: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.12);
  --border-active: rgba(249,115,22,0.35);
  --text: #111111;
  --text-secondary: #444444;
  --text-dim: #6b7280;
  --text-muted: #9ca3af;
  --accent: #f97316;
  --accent-2: #fb923c;
  --accent-glow: rgba(249,115,22,0.15);
  --accent-soft: rgba(249,115,22,0.06);
  --green: #10b981;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
  --teal: #14b8a6;
  --pink: #ec4899;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.05);
  --shadow-glow: 0 8px 32px rgba(249,115,22,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 20% -20%, rgba(249,115,22,0.08), transparent 60%),
    radial-gradient(ellipse 80% 60% at 90% 100%, rgba(236,72,153,0.06), transparent 50%),
    radial-gradient(ellipse 60% 50% at 0% 60%, rgba(20,184,166,0.05), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 16px 24px 60px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header {
  text-align: center;
  padding: 48px 24px 32px;
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #14b8a6 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.8px;
  line-height: 1.2;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

header p {
  color: var(--text-dim);
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 400;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 940px;
  margin: 0 auto;
  gap: 20px;
}
.header-row > div:first-child { text-align: left; }

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0,0,0,0.06);
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}
.user-avatar:hover { border-color: var(--accent); transform: scale(1.05); }
.user-name {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}
.logout-btn {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.25s;
  font-weight: 500;
}
.logout-btn:hover {
  border-color: rgba(239,68,68,0.3);
  color: var(--red);
  background: rgba(239,68,68,0.04);
}

/* ── Nav ── */
.nav {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--surface-solid);
  border-radius: 14px;
  padding: 4px;
  border: 1px solid var(--border);
  width: fit-content;
  box-shadow: var(--shadow-sm);
}
.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 22px;
  border-radius: 11px;
  transition: all 0.25s;
  position: relative;
}
.nav a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}
.nav a.active {
  background: var(--text);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ── Credits Bar ── */
.credits-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1);
  width: fit-content;
  box-shadow: var(--shadow-sm);
}
.credits-text {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.credits-text strong {
  color: var(--text);
  font-weight: 700;
}
.buy-credits-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-left: 16px;
  padding: 5px 16px;
  border-radius: 20px;
  border: 1px solid rgba(249,115,22,0.2);
  background: var(--accent-soft);
  transition: all 0.25s;
}
.buy-credits-link:hover {
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.35);
  transform: translateY(-1px);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed rgba(0,0,0,0.1);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  background: var(--surface-elevated);
  backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(255,255,255,0.95);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(249,115,22,0.06);
}

.upload-zone .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(249,115,22,0.08), rgba(236,72,153,0.06));
  border-radius: 20px;
  transition: all 0.4s;
}

.upload-zone:hover .icon {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(236,72,153,0.1));
}

.upload-zone .icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-zone .label {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 600;
}

.upload-zone .hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

/* ── File Info ── */
.file-info {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  border: 1px solid var(--border);
  animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: var(--shadow-sm);
}

.file-info.visible { display: flex; }

.file-info .name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.file-info .size { color: var(--text-dim); font-size: 0.82rem; }

.file-info .remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.file-info .remove:hover { background: rgba(239,68,68,0.08); color: var(--red); }

/* ── Language Picker ── */
.language-picker {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 20px;
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: var(--shadow-sm);
}

.language-picker.visible { display: flex; }

.language-picker label {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
}

.language-picker select {
  flex: 1;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
}

.language-picker select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Analyze Button ── */
.analyze-btn {
  display: none;
  width: 100%;
  padding: 16px;
  margin-top: 14px;
  background: linear-gradient(135deg, #f97316, #e8497b);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(249,115,22,0.2);
}

.analyze-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.analyze-btn:hover::before { transform: translateX(100%); }

.analyze-btn.visible { display: block; }
.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(249,115,22,0.28);
}
.analyze-btn:active { transform: translateY(0); box-shadow: 0 4px 16px rgba(249,115,22,0.2); }
.analyze-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Loading ── */
.loading {
  display: none;
  text-align: center;
  padding: 64px 16px;
}

.loading.visible { display: block; animation: fadeIn 0.4s ease; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0,0,0,0.06);
  border-top-color: var(--accent);
  border-right-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 24px;
  filter: drop-shadow(0 0 8px rgba(249,115,22,0.15));
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading p {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
}

/* ── Progress Bar ── */
.progress-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px;
  background: var(--surface-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: scaleIn 0.4s cubic-bezier(0.16,1,0.3,1);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.progress-step {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.progress-pct {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f97316, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f97316, #ec4899, #14b8a6);
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  animation: progressShimmer 2s ease infinite;
}

@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.progress-eta {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
}

.progress-elapsed {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Results ── */
.results {
  display: none;
  margin-top: 40px;
}

.results.visible { display: block; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.anim-slide-up {
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

.anim-fade-in {
  animation: fadeIn 0.5s ease both;
}

.anim-scale-in {
  animation: scaleIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

/* ── Virality Hero ── */
.virality-hero {
  text-align: center;
  padding: 52px 32px;
  background: var(--surface-elevated);
  backdrop-filter: blur(24px);
  border-radius: var(--radius);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.virality-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center top, rgba(249,115,22,0.06), transparent 65%);
  pointer-events: none;
}

.score-ring {
  width: 176px;
  height: 176px;
  margin: 0 auto 24px;
  position: relative;
  filter: drop-shadow(0 0 24px var(--accent-glow));
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring .track {
  fill: none;
  stroke: rgba(0,0,0,0.04);
  stroke-width: 6;
}

.score-ring .progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 2s cubic-bezier(0.16,1,0.3,1);
  filter: drop-shadow(0 0 8px currentColor);
}

.score-ring .value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -2px;
}

.viral-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.overall-summary {
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  font-size: 0.92rem;
  line-height: 1.7;
}

.short-plot {
  color: var(--text);
  max-width: 580px;
  margin: 16px auto 0;
  font-size: 0.86rem;
  line-height: 1.6;
  padding: 14px 20px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Metadata Bar ── */
.metadata-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.meta-chip {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-subtle);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  font-weight: 500;
}

.meta-chip:hover { border-color: var(--border-hover); background: var(--surface-solid); }
.meta-chip strong { color: var(--text); font-weight: 700; }

/* ── Score Cards ── */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.score-card {
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: var(--shadow-sm);
}

.score-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.score-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.score-card .card-title {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.2px;
}

.score-card .card-score {
  font-weight: 800;
  font-size: 1.2rem;
}

.score-bar {
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.score-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 0 8px currentColor;
}

.card-faults, .card-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.card-faults:last-child, .card-suggestions:last-child { margin-bottom: 0; }

.fault-tag {
  font-size: 0.76rem;
  background: rgba(239,68,68,0.06);
  color: #dc2626;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(239,68,68,0.12);
  font-weight: 500;
}

.suggestion-tag {
  font-size: 0.76rem;
  background: rgba(16,185,129,0.06);
  color: #059669;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(16,185,129,0.12);
  font-weight: 500;
}

/* ── Section Titles ── */
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 40px 0 16px;
  letter-spacing: -0.4px;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: -12px;
  margin-bottom: 24px;
  font-weight: 400;
}

/* ── Scene Notes ── */
.frame-notes-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
}

.fn-card {
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.fn-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }

.fn-frame-label {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  letter-spacing: 0.3px;
}

.fn-thumbs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.fn-thumbs::-webkit-scrollbar { height: 4px; }
.fn-thumbs::-webkit-scrollbar-track { background: transparent; }
.fn-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.fn-frame-img {
  width: 180px;
  height: 102px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all 0.3s;
  cursor: pointer;
}

.fn-frame-img:hover {
  transform: scale(1.04);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.fn-issues-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.fn-issue {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  transition: transform 0.2s;
}

.fn-issue:hover { transform: translateX(4px); }

.fn-critical { border-left-color: #ef4444; background: rgba(239,68,68,0.04); }
.fn-major { border-left-color: #f97316; background: rgba(249,115,22,0.04); }
.fn-minor { border-left-color: #eab308; background: rgba(234,179,8,0.04); }

.fn-issue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.fn-type {
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.fn-severity {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 10px;
  border-radius: 6px;
}

.fn-critical .fn-severity { color: #dc2626; background: rgba(239,68,68,0.08); }
.fn-major .fn-severity { color: #ea580c; background: rgba(249,115,22,0.08); }
.fn-minor .fn-severity { color: #ca8a04; background: rgba(234,179,8,0.08); }

.fn-problem {
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.5;
}

.fn-fix {
  font-size: 0.8rem;
  color: #059669;
}
.fn-fix::before { content: "Fix: "; font-weight: 600; }

@media (max-width: 600px) {
  .fn-frame-img { width: 140px; height: 79px; }
  .fn-issues-list { grid-template-columns: 1fr; }
}

/* ── Storyboard ── */
.storyboard { margin-bottom: 48px; }

.storyboard-scene {
  display: flex;
  gap: 16px;
}

.scene-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
  flex-shrink: 0;
}

.scene-number {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316, #e8497b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(249,115,22,0.2);
}

.scene-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, rgba(249,115,22,0.2), transparent);
  min-height: 20px;
}

.scene-content {
  flex: 1;
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.scene-content:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.scene-time {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.scene-desc {
  font-size: 0.92rem;
  margin-bottom: 10px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.scene-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.scene-tag {
  font-size: 0.72rem;
  padding: 3px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.scene-tag.shot {
  background: rgba(249,115,22,0.06);
  color: #ea580c;
  border: 1px solid rgba(249,115,22,0.12);
}

.scene-tag.transition {
  background: rgba(236,72,153,0.06);
  color: #db2777;
  border: 1px solid rgba(236,72,153,0.12);
}

.scene-tag.audio {
  background: rgba(20,184,166,0.06);
  color: #0d9488;
  border: 1px solid rgba(20,184,166,0.12);
}

.scene-overlay {
  font-size: 0.83rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

/* ── Viral Insights ── */
.viral-insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

@media (max-width: 600px) { .viral-insights-grid { grid-template-columns: 1fr; } }

.viral-insights-card {
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}
.viral-insights-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }

.viral-insights-card h4 {
  font-size: 0.88rem;
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 700;
}

.viral-insight-item {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
  transition: color 0.2s;
}

.viral-insight-item:hover { color: var(--text); }
.viral-insight-item:last-child { border-bottom: none; }
.viral-insight-item.improve { padding-left: 12px; border-left: 2px solid var(--green); }
.viral-insight-item.steal { padding-left: 12px; border-left: 2px solid var(--accent); }
.viral-insight-item strong { color: var(--text); font-weight: 600; }

/* ── Error ── */
.error-msg {
  display: none;
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.15);
  color: #dc2626;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideUp 0.3s ease;
}

.error-msg.visible { display: block; }

/* ── Legacy styles ── */
.strengths-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.strengths-list li { background: var(--surface-elevated); padding: 14px 16px; border-radius: var(--radius); border-left: 3px solid var(--green); font-size: 0.95rem; }
.improvements-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.improvement-card { background: var(--surface-elevated); border-radius: var(--radius); padding: 20px; border-left: 3px solid var(--accent); }
.improvement-card .imp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.improvement-card .imp-title { font-weight: 600; font-size: 0.95rem; }
.impact-badge { font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.impact-badge.high { background: var(--red); color: white; }
.impact-badge.medium { background: var(--orange); color: white; }
.impact-badge.low { background: var(--text-dim); color: white; }
.improvement-card .imp-desc { font-size: 0.88rem; color: var(--text-dim); line-height: 1.5; }
.similar-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.similar-card { background: var(--surface-elevated); border-radius: var(--radius); padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; border-left: 3px solid var(--accent); }
.similar-rank { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.78rem; flex-shrink: 0; }
.similar-sim { font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; flex-shrink: 0; }
.similar-sim.high { background: rgba(52,211,153,0.15); color: var(--green); }
.similar-sim.med { background: rgba(251,191,36,0.15); color: var(--yellow); }
.similar-sim.low { background: rgba(248,113,113,0.15); color: var(--red); }
.similar-info { flex: 1; }
.similar-cat { font-size: 0.78rem; font-weight: 600; text-transform: capitalize; margin-bottom: 2px; }
.similar-doc { font-size: 0.78rem; color: var(--text-dim); line-height: 1.4; }

/* ── Transcript ── */
.transcript-section { margin-bottom: 8px; }
.transcript-box {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

/* ── Footer ── */
.page-footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 0.78rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}
.page-footer a {
  color: var(--text-dim);
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.2s;
}
.page-footer a:hover { color: var(--text); }
.page-footer .footer-brand {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  background: linear-gradient(135deg, #f97316, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  header { padding: 36px 16px 24px; }
  header h1 { font-size: 1.8rem; }
  .container { padding: 12px 16px 48px; }
  .header-row { flex-direction: column; gap: 16px; }
  .header-row > div:first-child { text-align: center; }
  .user-info { justify-content: center; }
  .nav { width: 100%; justify-content: center; }
  .credits-bar { width: 100%; }
  .upload-zone { padding: 48px 20px; }
  .scores-grid { grid-template-columns: 1fr; }
}


/* Brand mark, beside the page heading (static/logo.svg). */
.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 11px;
  /* lifts the tile off the near-white page background */
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.18);
}

@media (max-width: 560px) {
  .brand-logo { width: 38px; height: 38px; border-radius: 9px; }
  .brand-block { gap: 10px; }
}
