/* StockClip design system
   Professional financial-media aesthetic: navy + signal blue on near-white,
   dense type, hairline rules, no decorative imagery. */

:root {
  --navy: #0d1b2f;
  --navy-soft: #16294a;
  --navy-line: #24395c;
  --blue: #1560d4;
  --blue-hover: #1250b4;
  --blue-soft: #eaf1fd;
  --blue-line: #b9d1f7;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-mute: #f1f3f6;
  --line: #e2e6ec;
  --line-strong: #cfd6e0;

  --text: #0f1b2d;
  --muted: #5c6a7e;
  --faint: #8b97a8;

  --up: #0f8a5f;
  --down: #cf2f45;
  --danger: #cf2f45;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 18px 44px rgba(15, 27, 45, 0.1);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

/* Component display rules (flex/grid) otherwise beat the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.022em;
  line-height: 1.15;
  font-weight: 800;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 247, 249, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  color: var(--navy);
}

.brand-text {
  line-height: 1;
}

.brand-badge {
  margin-left: 2px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-legacy {
  color: var(--faint);
}

.page-kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}

/* ---------- Mobile nav ----------
   The toggle is injected by nav.js, and every rule below is scoped to
   [data-collapsible], which that script sets. So a page without JavaScript
   keeps the nav it always had — a wrapped row of links — instead of links
   collapsed behind a button that cannot open. */

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.nav-toggle svg path {
  transform-origin: center;
  transition: transform 0.18s ease, opacity 0.12s ease;
}

.nav-open .nav-toggle .nav-bar-top {
  transform: translateY(5px) rotate(45deg);
}

.nav-open .nav-toggle .nav-bar-mid {
  opacity: 0;
}

.nav-open .nav-toggle .nav-bar-bot {
  transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 760px) {
  .nav[data-collapsible] .nav-toggle {
    display: inline-flex;
  }

  .nav[data-collapsible] .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 8px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(13, 27, 47, 0.1);
  }

  .nav[data-collapsible].nav-open .nav-links {
    display: flex;
  }

  /* Tap targets, not text links. */
  .nav[data-collapsible] .nav-link {
    padding: 13px 2px;
    font-size: 16px;
  }

  /* Rules go *between* items rather than under each one, so there is never a
     trailing hairline under the last row — and a hidden child (the empty Clerk
     mount) takes its rule with it. */
  .nav[data-collapsible] .nav-links > * + * {
    border-top: 1px solid var(--line);
  }

  /* The desktop active state is an underline, which reads as a stray rule in a
     stacked list. */
  .nav[data-collapsible] .nav-link.active {
    border-bottom: none;
    color: var(--blue);
  }

  .nav[data-collapsible] .auth-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav[data-collapsible] .auth-links[hidden] {
    display: none;
  }

  .nav[data-collapsible] .nav-links .btn {
    width: 100%;
    margin-top: 12px;
  }

  .nav[data-collapsible] .user-button {
    margin-top: 12px;
  }

}

/* Clerk mounts into .user-button. Until it does — signed out, or the script
   still loading — the div is empty, and in the stacked mobile panel an empty
   div with a margin reads as a gap someone forgot to fill. */
.user-button:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle svg path {
    transition: none;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-dark {
  background: var(--navy);
  color: #fff;
}

.btn-dark:hover {
  background: #16294a;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
}

.btn-blue:hover {
  background: var(--blue-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--navy);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Ticker band ---------- */

.ticker-band {
  background: var(--navy);
  border-block: 1px solid var(--navy-line);
  overflow: hidden;
  position: relative;
  /* Keep the track on its own compositor layer; empty-then-fill
     animations otherwise stall on iOS Safari / Chrome. */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 44px;
  padding: 11px 0;
  will-change: transform;
  /* Animation is attached after quotes render — see ticker.js.
     Applying it in CSS on an empty track is what freezes mobile. */
}

.ticker-track.is-scrolling {
  animation: ticker-scroll 42s linear infinite;
}

/* Pause only on devices that truly hover; sticky :hover on touch
   otherwise leaves the marquee permanently paused. */
@media (hover: hover) {
  .ticker-band:hover .ticker-track.is-scrolling {
    animation-play-state: paused;
  }
}

@keyframes ticker-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    /* Track holds two identical runs, so -50% loops seamlessly. */
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-band {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ticker-track.is-scrolling {
    animation: none;
  }

  .ticker-note {
    display: none;
  }
}

.ticker-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ticker-symbol {
  color: #ffffff;
  font-weight: 600;
}

.ticker-price {
  color: #9fb0c9;
}

.ticker-change.up {
  color: #4ade9a;
}

.ticker-change.down {
  color: #ff7a8c;
}

.ticker-note {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 14px 0 34px;
  background: linear-gradient(90deg, rgba(13, 27, 47, 0), var(--navy) 34%);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f819c;
}

/* ---------- Page headers ---------- */

.page-head {
  padding: 44px 0 26px;
}

.page-head h1 {
  font-size: clamp(30px, 4vw, 40px);
}

.page-head p {
  margin-top: 10px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card + .card {
  margin-top: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  padding: 2px 6px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}

/* ---------- Forms ---------- */

.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 96, 212, 0.14);
}

input::placeholder {
  color: var(--faint);
}

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.note {
  font-size: 13px;
  color: var(--muted);
}

.audio-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-mute);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.audio-toggle input {
  margin-top: 2px;
  accent-color: var(--blue);
  flex-shrink: 0;
}

.audio-toggle-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.audio-toggle-hint code {
  font-family: var(--mono);
  font-size: 11px;
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--up);
}

/* ---------- Ticker autocomplete ---------- */

.autocomplete {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, 82vw);
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}

.suggestion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.suggestion:hover,
.suggestion.active {
  background: var(--blue-soft);
}

.suggestion-symbol {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  min-width: 58px;
  color: var(--blue);
}

.suggestion-name {
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suggestion-exchange {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.suggestions-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Article picker ---------- */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.news-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.news-card:hover {
  border-color: var(--line-strong);
}

.news-card.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.news-body {
  flex: 1;
  min-width: 0;
}

.news-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
}

/* Why an article is likely to disappoint, said on the card rather than after a
   failed job. Only problems are marked — a clean card is a good article. */
.news-flag {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid currentColor;
  color: var(--faint);
}
.news-flag.is-blocked { color: var(--down); }

.news-mark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.news-card.selected .news-mark {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ---------- Style picker (text only) ---------- */

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

.style-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.style-card:hover {
  border-color: var(--line-strong);
}

.style-card.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.style-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.style-card span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.generate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

/* ---------- Workspace layout ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 60px;
}

.rail {
  position: sticky;
  top: 80px;
}

/* ---------- Preview panel ---------- */

.preview {
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 18px;
  color: #fff;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.preview-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: #8ea3c2;
}

.stage {
  border: 1px dashed var(--navy-line);
  border-radius: var(--radius-sm);
  background: #0a1526;
  aspect-ratio: 9 / 16;
  max-height: 62vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 20px;
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.stage-empty {
  font-size: 13.5px;
  font-weight: 600;
  color: #b7c6dc;
}

.stage-empty span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #6f819c;
}

.preview-meta {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #b7c6dc;
}

.preview-meta strong {
  color: #fff;
}

.preview-actions {
  margin-top: 14px;
}

.preview-actions .btn-ghost {
  background: transparent;
  border-color: var(--navy-line);
  color: #fff;
}

.preview-actions .btn-ghost:hover {
  border-color: #3d5580;
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Progress ---------- */

.progress {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--navy-line);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.progress-percent {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: #8ea3c2;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: #1d3153;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.4s ease;
}

.progress-fill.is-error {
  background: var(--down);
}

.progress-steps {
  display: flex;
  gap: 16px;
  margin-top: 11px;
  flex-wrap: wrap;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6f819c;
}

.progress-step::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2b4269;
}

.progress-step.active {
  color: #fff;
}

.progress-step.active::before,
.progress-step.complete::before {
  background: var(--blue);
}

/* ---------- Landing ---------- */

.hero {
  padding: 76px 0 64px;
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 20px auto 0;
  max-width: 18ch;
  font-size: clamp(34px, 5.2vw, 54px);
}

.hero p {
  margin: 16px auto 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 16px;
}

.hero-note {
  margin: 18px auto 0;
  max-width: 52ch;
  font-size: 13.5px;
  color: var(--faint);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.band {
  background: var(--surface-mute);
  border-block: 1px solid var(--line);
  padding: 56px 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.step-kicker i {
  width: 22px;
  height: 1px;
  background: var(--blue-line);
}

.step h3 {
  font-size: 17px;
}

.step p {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.section {
  padding: 64px 0;
}

.section-tight {
  padding-top: 24px;
}

.section-head {
  text-align: center;
  margin-bottom: 34px;
}

.section-head-left {
  text-align: left;
  max-width: 62ch;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.section-head p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.workflow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.workflow-steps > li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 100%;
}

.workflow-steps-home > li {
  flex-direction: row;
}

.workflow-steps-home strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.workflow-steps-home p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}

.workflow-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.workflow-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.audience-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.audience-list li {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.audience-list li:last-child {
  border-bottom: 0;
}

/* ---------- Studio shell ---------- */

.studio-body {
  min-height: 100vh;
}

.studio-signin {
  max-width: 420px;
  margin: 48px auto;
  padding: 0 24px;
}

.studio-auth-status {
  max-width: 520px;
  margin: 48px auto;
  padding: 0 24px;
}

.studio-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 64px;
  align-items: start;
}

.studio-side {
  position: sticky;
  top: 76px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.studio-side-label {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.studio-side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.studio-nav-item:hover {
  background: var(--surface-mute);
  color: var(--text);
  text-decoration: none;
}

.studio-nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.studio-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.studio-workflow {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.studio-title {
  font-size: clamp(26px, 3vw, 34px);
}

.studio-lede {
  margin-top: 10px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
}

.studio-workflow .workflow-steps {
  margin-top: 22px;
}

.studio-panel {
  padding: 22px 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.studio-panel-head h2 {
  font-size: 22px;
}

.studio-panel-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

.empty-state {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.empty-state h3 {
  font-size: 17px;
}

.empty-state p {
  margin-top: 8px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 14.5px;
}

.empty-state .btn {
  margin-top: 16px;
}

.empty-state code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
}

@media (max-width: 900px) {
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-side {
    position: static;
  }

  .studio-side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .studio-nav-item {
    padding: 8px 12px;
  }
}

.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.plan.featured {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan.featured .plan-name {
  color: #8ea3c2;
}

.plan-price {
  margin-top: 12px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-price span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.plan.featured .plan-price span {
  color: #8ea3c2;
}

.plan-for {
  margin-top: 10px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.plan.featured .plan-for {
  color: #b7c6dc;
}

.plan ul {
  list-style: none;
  margin: 20px 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan li {
  display: flex;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text);
}

.plan.featured li {
  color: #dbe5f2;
}

.plan li::before {
  content: "✓";
  color: var(--blue);
  font-weight: 800;
  flex-shrink: 0;
}

.plan.featured li::before {
  color: #6ea4f5;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.footer-brand .brand-mark {
  color: var(--navy);
}

.footer-copy {
  margin-top: 2px;
  font-size: 12px;
  color: var(--faint);
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 13px;
}

.footer-links a {
  color: var(--muted);
}

.plan button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.user-button {
  min-width: 36px;
  min-height: 36px;
}

.auth-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-shell {
  max-width: 440px;
  margin: 0 auto;
}

.auth-mount {
  min-height: 320px;
  margin: 18px 0;
}

.auth-switch {
  text-align: center;
}

.auth-switch a {
  color: var(--blue);
}

.promo-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.promo-box input {
  width: 100%;
  margin-top: 8px;
}

.auth-shell .promo-box {
  margin-top: 8px;
}

.quota-note {
  margin-top: 6px;
}

.quota-note a {
  color: var(--blue);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.dash-stat {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quota-meter {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-mute);
  overflow: hidden;
  border: 1px solid var(--line);
}

.quota-meter-fill {
  height: 100%;
  width: 0;
  background: var(--blue);
}

.pro-test {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.recent-row strong {
  display: block;
}

.recent-row span {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }

  .steps,
  .pricing,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stage {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 32px);
  }

  .field-row,
  .style-grid {
    grid-template-columns: 1fr;
  }

  .generate-row {
    flex-direction: column;
    align-items: stretch;
  }
}


/* ---------- Legal pages ---------- */
.legal-doc {
  max-width: 760px;
  padding: 8px 0 24px;
}
.legal-doc h1 {
  font-size: 34px;
  margin: 0 0 6px;
}
.legal-doc h2 {
  font-size: 17px;
  margin: 30px 0 8px;
}
.legal-doc p,
.legal-doc li {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
}
.legal-doc ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.legal-doc li {
  margin-bottom: 6px;
}
.legal-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--faint);
}
.legal-review {
  border: 1px solid var(--line);
  border-left: 3px solid var(--down);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 26px;
  font-size: 13.5px;
}

/* Theme picker preview.
   A 9:16 pane beside the dropdown. It shows a colour swatch immediately and is
   replaced by the rendered still from `npm run theme:previews` once that image
   loads, so the control is never blank waiting on a build step. */
.theme-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.theme-fields {
  flex: 1;
  min-width: 0;
}

.theme-preview {
  flex: 0 0 auto;
  width: 54px;
  height: 96px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 7px;
}

.theme-preview.has-shot {
  padding: 0;
  gap: 0;
}

.theme-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-swatch-ink {
  display: block;
  height: 6px;
  border-radius: 3px;
}

.theme-swatch-accent {
  display: block;
  height: 6px;
  width: 60%;
  border-radius: 3px;
}

/* Own-source panel and its consent step.
   Collapsed by default: most clips come from the feed, and an always-open
   textarea would make supplying your own look like the expected path. */
.own-source > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.own-source > summary::-webkit-details-marker { display: none; }

.own-source > summary::before {
  content: "+ ";
  color: var(--blue);
}

.own-source[open] > summary::before { content: "− "; }

.own-source textarea {
  width: 100%;
  min-height: 120px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}

.own-source textarea:focus,
.own-source input[type="date"]:focus { outline: none; border-color: var(--blue); }

.own-source input[type="file"] { font-size: 12.5px; color: var(--muted); }

.own-source input[type="date"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.consent {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
