:root {
  --bg: #0a0612;
  --bg-2: #12081f;
  --fg: #f4f0ff;
  --muted: #a89bb8;
  --line: rgba(255, 80, 200, 0.22);
  --magenta: #ff2d95;
  --cyan: #2de2ff;
  --yellow: #ffe566;
  --purple: #9b5cff;
  --accent: var(--magenta);
  --card: rgba(22, 12, 40, 0.55);
  --glass: rgba(255, 255, 255, 0.04);
  --max: 1100px;
  --pad: clamp(1.25rem, 4vw, 2rem);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 15% 10%, rgba(255, 45, 149, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(45, 226, 255, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 80%, rgba(155, 92, 255, 0.12), transparent 55%),
    var(--bg);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(45, 226, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 30% 70%, rgba(255, 45, 149, 0.6), transparent),
    radial-gradient(1px 1px at 50% 30%, rgba(255, 229, 102, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 70% 50%, rgba(45, 226, 255, 0.5), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255, 45, 149, 0.55), transparent),
    radial-gradient(1px 1px at 20% 90%, rgba(155, 92, 255, 0.5), transparent);
  opacity: 0.5;
  animation: drift 28s linear infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .particles { animation: none; }
  html { scroll-behavior: auto; }
  .btn, .card, .dropzone { transition: none !important; }
}

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

.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--pad);
  background: rgba(10, 6, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(45, 226, 255, 0.15);
  box-shadow: 0 0 40px rgba(255, 45, 149, 0.08);
}

.logo-img {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(45, 226, 255, 0.35));
}

.nav-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  flex: 1;
}

.tool-name {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tool-tag {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.65rem;
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 45, 149, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 32px rgba(255, 45, 149, 0.5); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.75rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(45, 226, 255, 0.35);
  color: var(--fg);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(45, 226, 255, 0.2);
}
.btn-neon {
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: #0a0612;
  box-shadow: 0 0 28px rgba(45, 226, 255, 0.35);
}

/* Hero */
.hero { padding: 2.5rem 0 1.5rem; }
.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.hero h1 span { display: block; }
.glow-cyan {
  color: var(--cyan);
  text-shadow: 0 0 28px rgba(45, 226, 255, 0.45);
}
.glow-magenta {
  color: var(--magenta);
  text-shadow: 0 0 28px rgba(255, 45, 149, 0.45);
}
.lede {
  margin: 0 0 1rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.honest-note {
  margin: 0;
  max-width: 42rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--magenta);
  background: var(--glass);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.honest-note strong { color: var(--fg); }

/* Upload */
.workspace { padding-bottom: 4rem; }

.dropzone {
  border: 1.5px dashed rgba(45, 226, 255, 0.4);
  border-radius: 1.1rem;
  background: var(--card);
  backdrop-filter: blur(12px);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--magenta);
  box-shadow: 0 0 40px rgba(255, 45, 149, 0.2), inset 0 0 40px rgba(45, 226, 255, 0.05);
  outline: none;
}
.drop-icon {
  font-size: 2.2rem;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(45, 226, 255, 0.6);
  margin-bottom: 0.5rem;
}
.dropzone h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dropzone p { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.95rem; }

.preview-block { margin-top: 0; }
.video-shell {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 0 40px rgba(155, 92, 255, 0.15);
}
#preview {
  width: 100%;
  max-height: 420px;
  display: block;
  background: #000;
}
.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(18, 8, 31, 0.95);
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid rgba(45, 226, 255, 0.12);
}
.video-meta strong { color: var(--cyan); font-weight: 600; }

.analyze-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 1.25rem;
  padding: 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 132px;
}
.field.grow { flex: 1; min-width: 160px; }
.analyze-bar .field select { max-width: 220px; }
.results-brand-note .muted { color: var(--muted); font-weight: 500; }
.field span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field select, .field input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 45, 149, 0.3);
  border-radius: 0.5rem;
  color: var(--fg);
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
}
.field select:focus, .field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(45, 226, 255, 0.2);
}

.progress-wrap { margin-top: 1rem; }
.progress-label {
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}
.progress-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.5);
  transition: width 0.25s ease;
}

/* Results */
.results { margin-top: 2.5rem; }
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.results-head h2 {
  margin: 0;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.export-actions { display: flex; gap: 0.5rem; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 800px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-sub {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px currentColor;
}
.dot.risk { background: var(--magenta); color: var(--magenta); }
.dot.cyan { background: var(--cyan); color: var(--cyan); }
.dot.magenta { background: var(--magenta); color: var(--magenta); }
.dot.yellow { background: var(--yellow); color: var(--yellow); }
.dot.purple { background: var(--purple); color: var(--purple); }

.copy-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(45, 226, 255, 0.25);
  color: var(--cyan);
  border-radius: 0.4rem;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy-btn:hover {
  background: rgba(45, 226, 255, 0.1);
  box-shadow: 0 0 12px rgba(45, 226, 255, 0.25);
}

.cut-list, .ost-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.cut-item, .ost-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  padding: 0.7rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.cut-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(255, 45, 149, 0.4);
  white-space: nowrap;
}
.cut-reason { margin: 0; font-size: 0.9rem; }
.cut-reason .tag {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 45, 149, 0.15);
  color: var(--magenta);
  border: 1px solid rgba(255, 45, 149, 0.3);
}
.cut-action {
  grid-column: 2;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

#energy-canvas {
  width: 100%;
  height: 72px;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(45, 226, 255, 0.15);
}

.hook-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.65rem;
}
.hook-list li {
  padding-left: 0.25rem;
  font-size: 0.98rem;
  font-weight: 600;
}
.hook-list li::marker { color: var(--cyan); }

.script-block {
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0.65rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.script-block .beat {
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timing-primary {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(255, 229, 102, 0.35);
  margin: 0.25rem 0 0.5rem;
}
.timing-alt { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.9rem; }
.timing-why { margin: 0; font-size: 0.88rem; color: var(--muted); }

.caption-text {
  white-space: pre-wrap;
  font-size: 0.92rem;
  margin: 0 0 0.75rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.85rem;
  border-radius: 0.65rem;
}
.hashtags {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cyan);
  word-break: break-word;
}

.ost-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--purple);
  font-weight: 700;
  white-space: nowrap;
}
.ost-text { margin: 0; font-weight: 600; font-size: 0.95rem; }

.footer-note {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-note a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.tiny { font-size: 0.8rem; }
.muted { color: var(--muted); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 0.7rem 1.2rem;
  background: rgba(18, 8, 31, 0.95);
  border: 1px solid var(--cyan);
  border-radius: 99px;
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 0 30px rgba(45, 226, 255, 0.3);
  pointer-events: none;
}
.toast[hidden] { display: none !important; }

@media (max-width: 600px) {
  .nav .btn-sm { display: none; }
  .analyze-bar .btn { width: 100%; }
}

/* —— v2: Viral score —— */
.viral-score-wrap { margin-top: 0.5rem; }
.viral-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin-bottom: 1.25rem;
}
.viral-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 3px solid var(--magenta);
  box-shadow: 0 0 28px rgba(255, 45, 149, 0.35), inset 0 0 20px rgba(45, 226, 255, 0.08);
  flex-shrink: 0;
}
.viral-ring.score-hot {
  border-color: var(--cyan);
  box-shadow: 0 0 32px rgba(45, 226, 255, 0.45);
}
.viral-ring.score-good { border-color: var(--yellow); box-shadow: 0 0 28px rgba(255, 229, 102, 0.35); }
.viral-ring.score-mid { border-color: var(--purple); }
.viral-ring.score-low { border-color: var(--magenta); }
.viral-num {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.viral-max {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.viral-meta { flex: 1; min-width: 200px; }
.viral-band {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.viral-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 700px) {
  .viral-breakdown { grid-template-columns: 1fr 1fr; }
}
.viral-breakdown li {
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.vb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.vb-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.vb-score {
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.vb-score.score-hot, .score-hot { color: var(--cyan); }
.vb-score.score-good, .score-good { color: var(--yellow); }
.vb-score.score-mid, .score-mid { color: var(--purple); }
.vb-score.score-low, .score-low { color: var(--magenta); }
.vb-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.vb-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}
.vb-fill.score-hot { background: linear-gradient(90deg, var(--cyan), #5cffb0); }
.vb-fill.score-good { background: linear-gradient(90deg, var(--yellow), var(--cyan)); }
.vb-fill.score-mid { background: linear-gradient(90deg, var(--purple), var(--magenta)); }
.vb-fill.score-low { background: linear-gradient(90deg, var(--magenta), #ff6b4a); }
.vb-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* —— v2: CTAs —— */
.cta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.cta-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.cta-vibe {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  background: rgba(255, 229, 102, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(255, 229, 102, 0.3);
  white-space: nowrap;
}
.cta-line { margin: 0; font-size: 0.92rem; font-weight: 600; }

/* —— v2: OST tips + caption labels —— */
.ost-tip {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.caption-label {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
}
.caption-label:first-child { margin-top: 0; }
.caption-short {
  font-weight: 600;
  color: var(--fg);
}

/* —— v2: 15/30/60 edit plans —— */
.edit-plans {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .edit-plans { grid-template-columns: 1fr 1fr 1fr; }
}
.edit-plan {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0.75rem;
  border: 1px solid rgba(45, 226, 255, 0.15);
}
.edit-plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.edit-plan-head h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.edit-target {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yellow);
  white-space: nowrap;
}
.edit-runtime {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.edit-keep-label {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--magenta);
}
.edit-keep {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.edit-keep li {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.35rem 0.5rem;
  background: rgba(255, 45, 149, 0.06);
  border-radius: 0.4rem;
  border-left: 2px solid var(--magenta);
}
.edit-keep strong { color: var(--magenta); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.edit-beats {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}
.edit-beats li {
  font-size: 0.85rem;
  padding-left: 0.15rem;
}
.edit-beats .beat {
  display: block;
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}
.edit-beats li::marker { color: var(--cyan); }

/* —— Paywall / unlock gate —— */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.unlock-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 226, 255, 0.45);
  background: rgba(45, 226, 255, 0.1);
  box-shadow: 0 0 16px rgba(45, 226, 255, 0.25);
}

.workspace {
  position: relative;
  min-height: 28rem;
}

.paywall-gate {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1.5rem;
}

.paywall-gate[hidden] {
  display: none !important;
}

.paywall-card {
  width: min(100%, 560px);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(145deg, rgba(255, 45, 149, 0.12), rgba(45, 226, 255, 0.06)),
    rgba(18, 8, 32, 0.92);
  border: 1px solid rgba(255, 45, 149, 0.35);
  box-shadow:
    0 0 0 1px rgba(45, 226, 255, 0.08),
    0 0 48px rgba(255, 45, 149, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.paywall-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--magenta);
  text-shadow: 0 0 18px rgba(255, 45, 149, 0.5);
}

.paywall-card h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.paywall-per {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.2rem;
  letter-spacing: 0.02em;
}

.paywall-lede {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.paywall-perks {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.paywall-perks li {
  position: relative;
  padding: 0.65rem 0.85rem 0.65rem 2rem;
  font-size: 0.9rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(45, 226, 255, 0.12);
}

.paywall-perks li::before {
  content: "◈";
  position: absolute;
  left: 0.7rem;
  top: 0.65rem;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(45, 226, 255, 0.6);
}

.paywall-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.paywall-ctas .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.paywall-wa {
  opacity: 0.85;
}

.paywall-code-block {
  padding: 1rem;
  border-radius: 0.85rem;
  border: 1px dashed rgba(45, 226, 255, 0.35);
  background: rgba(45, 226, 255, 0.05);
  margin-bottom: 0.85rem;
}

.paywall-code-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
}

.unlock-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}

.unlock-form .field {
  flex: 1 1 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.unlock-form .field span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.unlock-form input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 45, 149, 0.35);
  background: rgba(10, 6, 18, 0.85);
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.unlock-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(45, 226, 255, 0.2);
}

.unlock-form .btn {
  flex: 0 0 auto;
}

.paywall-code-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--yellow);
}

.paywall-code-hint.is-error {
  color: #ff6b9d;
}

.paywall-code-hint.is-ok {
  color: var(--cyan);
}

.paywall-code-hint[hidden] {
  display: none !important;
}

.paywall-contact {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.paywall-contact a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.workspace-body {
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.workspace-body.is-locked {
  filter: blur(5px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.workspace-body.is-locked[inert] {
  /* inert + CSS double-lock */
}

@media (max-width: 640px) {
  .nav-actions .btn-sm:not(#lock-again-btn) {
    display: none;
  }
  .paywall-card {
    padding: 1.35rem 1.1rem 1.2rem;
  }
  .unlock-form .btn {
    width: 100%;
  }
}


/* —— Strength diagnostics dashboard —— */
.diagnostics-card {
  border-color: rgba(45, 226, 255, 0.35);
  box-shadow: 0 0 40px rgba(45, 226, 255, 0.08), 0 0 60px rgba(255, 45, 149, 0.06);
}
.diagnostics-wrap { margin-top: 0.35rem; }
.diagnostics-summary {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fg);
  line-height: 1.45;
}
.diagnostics-disclaimer { margin: 0 0 1rem; }
.diagnostics-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .diagnostics-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .diagnostics-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.diag-card {
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}
.diag-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--magenta));
  opacity: 0.85;
}
.diag-card.score-hot {
  border-color: rgba(45, 226, 255, 0.28);
  box-shadow: inset 0 0 24px rgba(45, 226, 255, 0.06);
}
.diag-card.score-good {
  border-color: rgba(255, 229, 102, 0.22);
}
.diag-card.score-mid {
  border-color: rgba(155, 92, 255, 0.25);
}
.diag-card.score-low {
  border-color: rgba(255, 45, 149, 0.3);
  box-shadow: inset 0 0 24px rgba(255, 45, 149, 0.06);
}
.diag-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.diag-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
}
.diag-strength {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.diag-strength.score-hot {
  color: var(--cyan);
  border-color: rgba(45, 226, 255, 0.35);
  box-shadow: 0 0 12px rgba(45, 226, 255, 0.2);
}
.diag-strength.score-good {
  color: var(--yellow);
  border-color: rgba(255, 229, 102, 0.35);
}
.diag-strength.score-mid {
  color: var(--purple);
  border-color: rgba(155, 92, 255, 0.35);
}
.diag-strength.score-low {
  color: var(--magenta);
  border-color: rgba(255, 45, 149, 0.4);
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.2);
}
.diag-score-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.diag-score {
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  min-width: 2rem;
}
.diag-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.diag-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}
.diag-fill.score-hot { background: linear-gradient(90deg, var(--cyan), #5cffb0); }
.diag-fill.score-good { background: linear-gradient(90deg, var(--yellow), var(--cyan)); }
.diag-fill.score-mid { background: linear-gradient(90deg, var(--purple), var(--magenta)); }
.diag-fill.score-low { background: linear-gradient(90deg, var(--magenta), #ff6b4a); }
.diag-improvements {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.diag-improvements li {
  position: relative;
  padding-left: 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.diag-improvements li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 0.7rem;
  top: 0.1rem;
}
.diag-card.score-low .diag-improvements li::before { color: var(--magenta); }

/* —— Brand Lock —— */
.brand-lock-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--magenta);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 45, 149, 0.5);
  background: rgba(255, 45, 149, 0.12);
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.3);
  white-space: nowrap;
}

.brand-lock-panel {
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 45, 149, 0.1), rgba(45, 226, 255, 0.05)),
    var(--card);
  border: 1px solid rgba(255, 45, 149, 0.35);
  box-shadow: 0 0 36px rgba(255, 45, 149, 0.12);
}

.brand-lock-panel[hidden] {
  display: none !important;
}

.brand-lock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand-lock-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-lock-lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 48rem;
}

.brand-lock-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .brand-lock-grid {
    grid-template-columns: 1fr 1fr;
  }
  .brand-lock-grid .span-2 {
    grid-column: 1 / -1;
  }
}

.brand-lock-form .field textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 45, 149, 0.3);
  border-radius: 0.5rem;
  color: var(--fg);
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 2.75rem;
  width: 100%;
}

.brand-lock-form .field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(45, 226, 255, 0.2);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-row input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.15rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 45, 149, 0.35);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.color-row input[type="text"] {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 45, 149, 0.3);
  border-radius: 0.5rem;
  color: var(--fg);
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.color-row input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(45, 226, 255, 0.2);
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.logo-preview {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0.4rem;
  border: 1px solid rgba(45, 226, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
}

.brand-lock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 45, 149, 0.2);
}

.brand-lock-hint {
  margin: 0;
  flex: 1 1 100%;
  color: var(--cyan);
}

.brand-lock-hint.is-error { color: #ff6b9d; }

/* Applied brand colors when Brand Lock is active */
body.brand-lock-active {
  --magenta: var(--bl-primary, #ff2d95);
  --cyan: var(--bl-secondary, #2de2ff);
  --accent: var(--bl-primary, #ff2d95);
}

.results-brand-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 45, 149, 0.35);
  background: rgba(255, 45, 149, 0.08);
  font-size: 0.82rem;
  color: var(--muted);
}

.results-brand-note strong {
  color: var(--magenta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .nav-actions #brand-settings-btn {
    display: none;
  }
}


/* —— Pattern interrupts / B-roll / pacing timeline —— */
.pacing-summary {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pacing-disclaimer { margin: 0 0 0.85rem; }
.pacing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.pacing-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid rgba(255, 229, 102, 0.45);
}
.pacing-item.kind-interrupt { border-left-color: var(--magenta); }
.pacing-item.kind-broll { border-left-color: var(--cyan); }
.pacing-item.kind-pacing { border-left-color: var(--yellow); }
.pacing-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 229, 102, 0.35);
  white-space: nowrap;
}
.pacing-main { min-width: 0; }
.pacing-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.3rem;
}
.pacing-kind {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.pacing-kind.kind-interrupt {
  background: rgba(255, 45, 149, 0.15);
  color: var(--magenta);
  border-color: rgba(255, 45, 149, 0.3);
}
.pacing-kind.kind-broll {
  background: rgba(45, 226, 255, 0.12);
  color: var(--cyan);
  border-color: rgba(45, 226, 255, 0.3);
}
.pacing-kind.kind-pacing {
  background: rgba(255, 229, 102, 0.12);
  color: var(--yellow);
  border-color: rgba(255, 229, 102, 0.3);
}
.pacing-action {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
}
.pacing-tip {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.pacing-why {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* —— CHA MAGIC —— */
.btn-magic {
  background: linear-gradient(135deg, #ff2d95 0%, #a855f7 45%, #2de2ff 100%);
  color: #0a0612;
  box-shadow: 0 0 32px rgba(255, 45, 149, 0.45), 0 0 48px rgba(45, 226, 255, 0.25);
  letter-spacing: 0.08em;
  font-weight: 800;
  position: relative;
  overflow: hidden;
}
.btn-magic::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: magic-sheen 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes magic-sheen {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.btn-magic:hover {
  box-shadow: 0 0 40px rgba(255, 45, 149, 0.6), 0 0 56px rgba(45, 226, 255, 0.35);
  transform: translateY(-1px);
}
.btn-magic:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-magic:disabled::before { animation: none; }

.dot.magic {
  background: linear-gradient(135deg, var(--magenta), var(--cyan));
  box-shadow: 0 0 10px rgba(255, 45, 149, 0.7);
}

.magic-card {
  border: 1px solid rgba(255, 45, 149, 0.35);
  background:
    radial-gradient(ellipse at top right, rgba(255, 45, 149, 0.12), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(45, 226, 255, 0.08), transparent 50%),
    var(--card);
  box-shadow: 0 0 40px rgba(255, 45, 149, 0.12);
}
.magic-honest {
  border-left: 3px solid var(--magenta);
  padding-left: 0.75rem;
}
.magic-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 0 1rem;
}
.magic-lock-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(45, 226, 255, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(45, 226, 255, 0.4);
}

.magic-section {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: rgba(10, 6, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.magic-section h4 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
}
.magic-section h4.magenta { color: var(--magenta); }
.magic-section h4.yellow { color: var(--yellow); }
.magic-hook-hero {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 0.4rem;
  color: var(--fg);
}
.magic-story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.magic-story-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.65rem;
  align-items: start;
}
.magic-beat-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--magenta);
  padding-top: 0.15rem;
}
.magic-cut-mini {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.magic-cut-mini li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.5rem;
  font-size: 0.88rem;
}
.magic-cut-mini .t { font-weight: 700; color: var(--yellow); font-variant-numeric: tabular-nums; }
.magic-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.magic-checklist li {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
}
.magic-checklist .before { color: var(--muted); }
.magic-checklist .after { color: var(--fg); font-weight: 600; }
.magic-checklist .before::before {
  content: "Original · ";
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.85;
}
.magic-checklist .after::before {
  content: "Cha Magic · ";
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--magenta);
}
.magic-ost-mini, .magic-interrupt-mini {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.magic-ost-mini li, .magic-interrupt-mini li {
  font-size: 0.88rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.magic-ost-mini li:last-child, .magic-interrupt-mini li:last-child { border-bottom: none; }
.magic-caption-block {
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin: 0 0 0.5rem;
}
.magic-hashtags {
  font-size: 0.82rem;
  color: var(--cyan);
  margin: 0;
}

.magic-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.magic-choices .btn { flex: 1 1 8rem; }

.magic-tweak-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(45, 226, 255, 0.35);
  background: rgba(45, 226, 255, 0.05);
}
.magic-tweak-lede {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.magic-tweak-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.magic-tweak-grid .field { min-width: 10rem; }
.magic-tweak-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.magic-card.is-locked {
  border-color: rgba(45, 226, 255, 0.45);
  box-shadow: 0 0 36px rgba(45, 226, 255, 0.15);
}
.magic-card.is-locked .magic-choices #magic-remix-btn,
.magic-card.is-locked .magic-choices #magic-tweak-btn {
  opacity: 0.55;
}

@media (max-width: 640px) {
  .magic-story-list li,
  .magic-checklist li {
    grid-template-columns: 1fr;
  }
  .magic-choices .btn { flex: 1 1 100%; }
}

/* —— Safe-Zone Preview (TikTok UI chrome guide) —— */
.video-stage {
  position: relative;
  background: #000;
}
.video-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  background: rgba(18, 8, 31, 0.95);
  border-top: 1px solid rgba(45, 226, 255, 0.12);
  padding-right: 0.85rem;
}
.video-meta-row .video-meta {
  border-top: none;
  background: transparent;
  flex: 1;
  min-width: 12rem;
}
.safe-zone-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  cursor: pointer;
  user-select: none;
  padding: 0.35rem 0;
  white-space: nowrap;
}
.safe-zone-toggle input {
  accent-color: var(--magenta);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}
.safe-zone-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  /* leave room for native video controls at bottom */
  bottom: 2.4rem;
}
.safe-zone-overlay .sz-region {
  position: absolute;
  border: 1.5px dashed rgba(255, 45, 149, 0.75);
  background: rgba(255, 45, 149, 0.12);
  border-radius: 0.35rem;
  box-sizing: border-box;
}
.safe-zone-overlay .sz-region::after {
  content: attr(data-label);
  position: absolute;
  left: 0.35rem;
  top: 0.25rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe8f4;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  max-width: calc(100% - 0.5rem);
  line-height: 1.2;
}
.sz-top {
  top: 2%;
  left: 4%;
  right: 4%;
  height: 7%;
  border-color: rgba(45, 226, 255, 0.55) !important;
  background: rgba(45, 226, 255, 0.1) !important;
}
.sz-username {
  left: 4%;
  bottom: 22%;
  width: 58%;
  height: 7%;
}
.sz-caption {
  left: 4%;
  bottom: 6%;
  width: 58%;
  height: 14%;
}
.sz-buttons {
  right: 2.5%;
  bottom: 18%;
  width: 14%;
  max-width: 3.4rem;
  height: 48%;
  border-color: rgba(255, 229, 102, 0.7) !important;
  background: rgba(255, 229, 102, 0.1) !important;
}
.sz-nav {
  left: 0;
  right: 0;
  bottom: 0;
  height: 5.5%;
  border-radius: 0;
  border-color: rgba(155, 92, 255, 0.55) !important;
  background: rgba(155, 92, 255, 0.12) !important;
}
.sz-legend {
  position: absolute;
  top: 11%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.35rem 0.65rem;
  max-width: 72%;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(45, 226, 255, 0.35);
  border-radius: 999px;
  line-height: 1.3;
}
.video-shell.safe-zone-on .safe-zone-overlay { display: block; }

/* —— Story Builder —— */
.story-summary {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--fg);
}
.story-order-chip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0 0 0.85rem;
}
.story-order-chip span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 45, 149, 0.15);
  border: 1px solid rgba(255, 45, 149, 0.35);
  color: var(--magenta);
}
.story-order-chip .arrow {
  color: var(--muted);
  font-weight: 700;
  padding: 0;
  border: none;
  background: none;
}
.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.story-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.story-beat-badge {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 5.5rem;
}
.story-beat-badge .n {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}
.story-beat-badge .name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--magenta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.story-beat-badge .t {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}
.story-beat-copy p {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}
.story-beat-copy .tiny { margin: 0; }
.story-move {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.story-move button {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(45, 226, 255, 0.3);
  color: var(--cyan);
  border-radius: 0.4rem;
  width: 2rem;
  height: 1.65rem;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}
.story-move button:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(45, 226, 255, 0.15);
}
.story-move button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.story-draft-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* —— CTA Placement —— */
.cta-place-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.cta-place-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.cta-place-kind {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cta-place-kind .kind {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}
.cta-place-kind .kind.shop { color: var(--magenta); }
.cta-place-kind .kind.follow { color: var(--purple); }
.cta-place-kind .kind.save { color: var(--yellow); }
.cta-place-kind .kind.comment { color: var(--cyan); }
.cta-place-kind .t {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}
.cta-place-copy p {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}
.cta-place-copy .tiny { margin: 0; }
.cta-place-hero {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 45, 149, 0.35);
  background: rgba(255, 45, 149, 0.08);
}
.cta-place-hero strong { color: var(--magenta); }

@media (max-width: 640px) {
  .story-list li {
    grid-template-columns: 1fr auto;
  }
  .story-beat-badge {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
  }
  .cta-place-list li {
    grid-template-columns: 1fr;
  }
  .sz-buttons { width: 18%; max-width: 2.8rem; }
  .sz-username, .sz-caption { width: 55%; }
}

/* —— v2.5 · Comment-to-Video · Batch Editor · Series Builder —— */
.tools-panel {
  margin: 0 0 1.25rem;
  padding: 1.15rem 1.25rem 1.35rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(10px);
}
.tools-panel .panel-head { margin-bottom: 0.85rem; }
.tools-panel .panel-lede {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 62ch;
}
.tools-panel .eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
}
.comment-field textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(45, 226, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fg);
  font: inherit;
  line-height: 1.45;
}
.comment-field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(45, 226, 255, 0.2);
}
.comment-ideas-actions,
.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.75rem 0 0.5rem;
}
.comment-ideas-body { margin-top: 0.85rem; }
.comment-idea-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.comment-idea-list li {
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(45, 226, 255, 0.22);
  background: rgba(45, 226, 255, 0.06);
}
.comment-idea-list .ci-src {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.45rem;
  font-style: italic;
}
.comment-idea-list .ci-hook {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--cyan);
}
.comment-idea-list .ci-script {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
}
.comment-idea-list .ci-cta {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--magenta);
}
.comment-ideas-summary {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.batch-panel .batch-dropzone {
  border: 1.5px dashed rgba(255, 45, 149, 0.35);
  border-radius: 0.85rem;
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 45, 149, 0.04);
  transition: border-color 0.15s, background 0.15s;
}
.batch-panel .batch-dropzone:hover,
.batch-panel .batch-dropzone.dragover {
  border-color: var(--magenta);
  background: rgba(255, 45, 149, 0.1);
}
.batch-drop-inner p { margin: 0.35rem 0 0.65rem; color: var(--muted); }
.batch-queue {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.batch-queue li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.88rem;
}
.batch-queue .bq-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-queue .bq-meta { color: var(--muted); font-size: 0.78rem; }
.batch-queue .bq-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yellow);
}
.batch-queue .bq-status.done { color: var(--cyan); }
.batch-queue .bq-status.err { color: var(--magenta); }
.batch-queue .bq-remove {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.15rem 0.35rem;
}
.batch-queue .bq-remove:hover { color: var(--magenta); }

.batch-results {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}
.batch-card {
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 45, 149, 0.28);
  background: rgba(22, 12, 40, 0.65);
}
.batch-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-card .bc-score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-weight: 800;
  font-size: 1.45rem;
  margin: 0.25rem 0 0.55rem;
}
.batch-card .bc-score .bc-max {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.batch-card .bc-cuts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.batch-card .bc-cuts li {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}
.batch-card .bc-cuts strong { color: var(--yellow); font-weight: 700; }
.batch-card .bc-meta {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.batch-summary-bar {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.series-summary {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.series-verdict {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.series-verdict.split {
  background: rgba(255, 45, 149, 0.18);
  color: var(--magenta);
  border: 1px solid rgba(255, 45, 149, 0.4);
}
.series-verdict.ok {
  background: rgba(45, 226, 255, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(45, 226, 255, 0.35);
}
.series-parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.series-parts li {
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(155, 92, 255, 0.35);
  background: rgba(155, 92, 255, 0.08);
}
.series-part-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}
.series-part-head .sp-label {
  font-weight: 800;
  color: var(--purple);
  letter-spacing: 0.04em;
}
.series-part-head .sp-win {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}
.series-part-head .sp-beats {
  font-size: 0.75rem;
  color: var(--muted);
}
.series-parts .sp-hook {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.series-parts .sp-cta {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--magenta);
}
.series-parts .sp-tip {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.series-posting {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .batch-queue li {
    grid-template-columns: 1fr auto;
  }
  .batch-queue .bq-meta { grid-column: 1 / -1; }
}

.shared-settings-panel .shared-analyze-bar {
  margin-top: 0.35rem;
}
.analyze-actions-bar {
  align-items: center;
}
.analyze-settings-hint {
  margin: 0;
  flex: 1 1 100%;
}
@media (min-width: 720px) {
  .analyze-settings-hint { flex: 1 1 auto; }
}
