/* ─── Earth & Ink editorial design system ─────────────────────────── */
:root {
  --surface: #fef9ef;
  --surface-low: #f8f3ea;
  --surface-container: #f3ede4;
  --surface-high: #ede8df;
  --ink: #1d1c16;
  --ink-soft: #53433e;
  --outline: #86736d;
  --outline-soft: #d9c1bb;
  --primary: #884531;
  --primary-strong: #6f3323;
  --primary-container: #a65d47;
  --on-primary: #fff4f1;
  --sage: #506350;
  --sage-container: #d0e6ce;
  --gold: #a07d2a;
  --danger: #93342b;
  --shadow: 0 1px 3px rgba(29, 28, 22, .08), 0 4px 16px rgba(29, 28, 22, .06);
  --radius: 10px;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Work Sans", -apple-system, sans-serif;
}
[x-cloak] { display: none !important; }
body.dark {
  --surface: #191813;
  --surface-low: #201f19;
  --surface-container: #26241e;
  --surface-high: #2d2b24;
  --ink: #f5f0e7;
  --ink-soft: #c9beb3;
  --outline: #9a8a80;
  --outline-soft: #4a4038;
  --primary: #ffb59f;
  --primary-strong: #ffcbba;
  --primary-container: #a65d47;
  --on-primary: #2d130a;
  --sage: #b7ccb5;
  --sage-container: #38503a;
  --gold: #d9b45e;
  --danger: #ff9a8d;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 18px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.55;
  transition: background .25s, color .25s;
  min-height: 100vh;
}

/* ─── Masthead ────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 3px double var(--outline);
  background: var(--surface-low);
  position: sticky; top: 0; z-index: 20;
}
.masthead-inner {
  max-width: 980px; margin: 0 auto; padding: 18px 20px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-size: 34px; color: var(--primary);
  background: var(--surface-container); border: 1px solid var(--outline-soft);
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
}
.brand h1 { font-family: var(--serif); font-weight: 800; font-size: 26px; letter-spacing: .3px; }
.dateline { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1.2px; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profession-select {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 9px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--outline-soft); background: var(--surface); color: var(--ink);
  cursor: pointer;
}

/* ─── Tabs ────────────────────────────────────────────────────────── */
.tabs { max-width: 980px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; }
.tabs button {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  background: none; border: none; color: var(--ink-soft);
  padding: 10px 16px 12px; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge {
  background: var(--primary); color: var(--on-primary);
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px;
}

/* ─── Layout ──────────────────────────────────────────────────────── */
main { max-width: 980px; margin: 0 auto; padding: 26px 20px 80px; }

/* ─── Buttons ─────────────────────────────────────────────────────── */
.btn {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .1s, box-shadow .15s, background .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--outline-soft); }
.btn-ghost:hover { color: var(--ink); border-color: var(--outline); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-approve { background: var(--sage-container); color: var(--sage); border-color: var(--sage); }
.btn-approve:hover { filter: brightness(1.05); }
.btn-reject { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-vote { background: var(--surface-container); border-color: var(--outline-soft); font-size: 15px; padding: 6px 12px; }
.btn-vote:hover { transform: scale(1.12); }
.theme-toggle { font-size: 16px; padding: 8px 12px; }

.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.running-label { display: inline-flex; align-items: center; gap: 7px; }

/* ─── Digest ──────────────────────────────────────────────────────── */
.digest {
  background: var(--surface-container); border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; margin-bottom: 22px;
}
.digest h3 {
  font-family: var(--serif); font-size: 15px; font-style: italic;
  color: var(--primary); margin-bottom: 6px;
}
.digest p { font-size: 14.5px; color: var(--ink-soft); }

.snapshot-note {
  font-size: 12px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 18px;
  border-bottom: 1px solid var(--outline-soft); padding-bottom: 8px;
}

/* ─── Stories ─────────────────────────────────────────────────────── */
.story {
  display: flex; gap: 18px; padding: 20px 4px;
  border-bottom: 1px solid var(--outline-soft);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.story.lead .headline { font-size: 30px; }
.story-rank {
  font-family: var(--serif); font-weight: 800; font-size: 26px;
  color: var(--outline); min-width: 44px; text-align: right; line-height: 1.15;
}
.story.lead .story-rank { color: var(--primary); font-size: 34px; }
.story-body { flex: 1; min-width: 0; }
.story-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chip {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--surface-high); color: var(--ink-soft);
}
.chip-judgment, .chip-order { background: var(--primary-container); color: var(--on-primary); }
.chip-regulation, .chip-circular { background: var(--sage-container); color: var(--sage); }
.corroboration { font-size: 12px; font-weight: 700; color: var(--sage); }
.must-post { font-size: 12px; font-weight: 700; color: var(--gold); }
.story-time { font-size: 12px; color: var(--ink-soft); margin-left: auto; }
.headline {
  font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1.28;
  cursor: pointer; transition: color .15s;
}
.headline:hover { color: var(--primary); }
.why { font-size: 14px; color: var(--primary); font-style: italic; margin-top: 5px; }

.story-detail { margin-top: 12px; }
.summary { font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; }
.sources { font-size: 13px; margin-bottom: 12px; }
.sources .label { font-weight: 700; color: var(--ink-soft); }

.score-panel {
  background: var(--surface-container); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
}
.score-panel h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--ink-soft); margin-bottom: 10px;
  display: flex; justify-content: space-between;
}
.score-panel .total { color: var(--primary); }
.meter { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.meter-label { font-size: 12px; width: 150px; color: var(--ink-soft); }
.meter-track {
  flex: 1; height: 7px; border-radius: 999px; background: var(--surface-high); overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--primary));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.meter-value { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-soft); width: 36px; text-align: right; }

.story-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vote { display: flex; gap: 8px; }

/* ─── Drafts ──────────────────────────────────────────────────────── */
.drafts-toolbar { margin-bottom: 18px; display: flex; justify-content: flex-end; }
.draft-card {
  background: var(--surface-low); border: 1px solid var(--outline-soft);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px; animation: rise .35s ease both;
}
.draft-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.draft-story { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink-soft); }
.draft-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .draft-columns { grid-template-columns: 1fr; } }
.draft-platform {
  background: var(--surface); border: 1px solid var(--outline-soft);
  border-radius: var(--radius); padding: 14px;
}
.platform-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.platform-head h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--primary); }
.card-img { width: 100%; max-width: 280px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--outline-soft); }
.caption { font-size: 13.5px; white-space: pre-wrap; color: var(--ink); }
.hashtags { font-size: 12.5px; color: var(--sage); margin-top: 8px; font-weight: 600; }
.fb-link { font-size: 12px; color: var(--primary); word-break: break-all; }
.draft-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.action-row { display: flex; gap: 10px; }
.published-note { font-size: 13px; color: var(--sage); font-weight: 600; }

.status-pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 3px 10px; border-radius: 999px;
}
.status-draft { background: var(--surface-high); color: var(--ink-soft); }
.status-approved { background: var(--sage-container); color: var(--sage); }
.status-published { background: var(--primary-container); color: var(--on-primary); }
.status-rejected, .status-failed { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.status-done { background: var(--sage-container); color: var(--sage); }
.status-running { background: var(--gold); color: #fff; }

/* ─── Runs ────────────────────────────────────────────────────────── */
.run-card {
  background: var(--surface-low); border: 1px solid var(--outline-soft);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
  animation: rise .3s ease both;
}
.run-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.run-head strong { font-size: 14px; }
.run-meta { font-size: 12.5px; color: var(--ink-soft); }
.run-stages { display: flex; gap: 14px; flex-wrap: wrap; }
.stage { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--outline-soft); }
.stage-done .stage-dot { background: var(--sage); }
.stage-failed .stage-dot { background: var(--danger); }
.stage-running .stage-dot { background: var(--gold); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.stage-counters { color: var(--outline); font-size: 11.5px; }
.run-usage { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.usage-chip {
  font-size: 11.5px; background: var(--surface-container); color: var(--ink-soft);
  border-radius: 999px; padding: 3px 10px;
}
.run-error { margin-top: 8px; font-size: 12.5px; color: var(--danger); }

/* ─── Empty states, skeletons, toasts ─────────────────────────────── */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 8px; }
.empty-state p { color: var(--ink-soft); margin-bottom: 18px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.skeleton-card {
  padding: 20px 4px; border-bottom: 1px solid var(--outline-soft);
}
.sk-line {
  height: 13px; border-radius: 6px; margin: 8px 0;
  background: linear-gradient(90deg, var(--surface-high) 25%, var(--surface-container) 50%, var(--surface-high) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
.sk-line.tall { height: 22px; }
.w40 { width: 40%; } .w70 { width: 70%; } .w90 { width: 90%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast {
  background: var(--ink); color: var(--surface);
  padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 500; animation: slide-in .25s ease;
  max-width: 340px;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--sage); color: #fff; }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }

/* ─── Studio ──────────────────────────────────────────────────────── */
.studio-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-title { font-family: var(--serif); font-size: 24px; }
.studio-toolbar .btn-primary { margin-left: auto; }
.studio-story {
  font-family: var(--serif); font-weight: 600; font-size: 15px;
  color: var(--ink-soft); flex: 1; min-width: 200px;
}

/* history grid */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.video-card {
  background: var(--surface-low); border: 1px solid var(--outline-soft);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  animation: rise .3s ease both;
}
.video-poster {
  position: relative; aspect-ratio: 9 / 16; max-height: 300px; width: 100%;
  background: var(--surface-high); cursor: pointer; overflow: hidden;
}
.video-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 34px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.55);
  opacity: .85; transition: transform .15s, opacity .15s;
}
.video-poster:hover .play-badge { transform: scale(1.15); opacity: 1; }
.video-info { padding: 12px 14px 14px; }
.video-headline {
  font-family: var(--serif); font-weight: 600; font-size: 14.5px; line-height: 1.3;
  margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.video-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-soft); margin-bottom: 10px;
}
.video-actions { display: flex; gap: 8px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }

.video-modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(20, 18, 12, .78); padding: 24px;
}
.video-modal-inner { position: relative; max-width: 420px; width: 100%; }
.video-modal-inner video {
  width: 100%; aspect-ratio: 9 / 16; border-radius: 12px;
  background: #000; box-shadow: 0 12px 60px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface); color: var(--ink); font-size: 15px; box-shadow: var(--shadow);
}
.modal-caption { color: #f5f0e7; font-size: 13.5px; margin-top: 12px; text-align: center; }

/* wizard steps */
.studio-steps {
  display: flex; gap: 6px; list-style: none; margin-bottom: 24px; flex-wrap: wrap;
}
.studio-steps li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface-container); border: 1.5px solid transparent;
}
.studio-steps li span {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: var(--surface-high); color: var(--ink-soft);
}
.studio-steps li.active { color: var(--primary); border-color: var(--primary); background: var(--surface-low); }
.studio-steps li.active span { background: var(--primary); color: var(--on-primary); }
.studio-steps li.done { color: var(--sage); }
.studio-steps li.done span { background: var(--sage-container); color: var(--sage); }

.studio-panel { animation: rise .3s ease both; }
.panel-title { font-family: var(--serif); font-size: 18px; margin: 22px 0 12px; }
.panel-title:first-child { margin-top: 0; }
.panel-hint { font-family: var(--sans); font-size: 12px; color: var(--ink-soft); font-weight: 400; margin-left: 8px; }

/* project source */
.source-editor { display: flex; flex-direction: column; gap: 12px; }
.source-segment {
  display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px;
  border: 1.5px solid var(--outline-soft); border-radius: var(--radius);
  background: var(--surface-container);
}
.source-segment button {
  border: 0; border-radius: calc(var(--radius) - 3px); padding: 7px 12px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft); background: transparent; cursor: pointer;
}
.source-segment button.active {
  color: var(--on-primary); background: var(--primary); box-shadow: var(--shadow);
}
.source-card {
  border: 1.5px solid var(--outline-soft); border-radius: var(--radius);
  background: var(--surface-low); padding: 12px 14px;
}
.source-locked { margin-bottom: 4px; }
.source-kicker {
  display: block; color: var(--ink-soft); font-size: 11px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: 5px;
}
.source-card strong { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.35; }
.topic-brief { display: flex; flex-direction: column; gap: 6px; }
.topic-label {
  display: block; color: var(--ink-soft); font-size: 12.5px; font-weight: 700;
}
.topic-label .setting-input { margin-top: 6px; }
.topic-input { min-height: 92px; }
.topic-context-input { min-height: 84px; }
.field-meta {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; flex-wrap: wrap;
  color: var(--ink-soft); font-size: 12px; font-weight: 600;
}

/* asset library */
.asset-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.asset-tile {
  width: 118px; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 2.5px solid var(--outline-soft); background: var(--surface-low);
  transition: border-color .15s, transform .1s; text-align: center;
}
.asset-tile:hover { transform: translateY(-2px); }
.asset-tile.selected { border-color: var(--primary); box-shadow: var(--shadow); }
.asset-tile img { width: 100%; height: 118px; object-fit: cover; display: block; }
.asset-label {
  display: block; font-size: 11.5px; color: var(--ink-soft); padding: 6px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 118px; padding: 10px;
  border-style: dashed; color: var(--ink-soft); font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.upload-tile:hover { color: var(--primary); border-color: var(--primary); }
.upload-plus { font-size: 22px; line-height: 1; }

.voice-list { display: flex; flex-direction: column; gap: 10px; }
.voice-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--radius); cursor: pointer;
  border: 2.5px solid var(--outline-soft); background: var(--surface-low);
}
.voice-row.selected { border-color: var(--primary); box-shadow: var(--shadow); }
.voice-name { font-weight: 600; font-size: 13.5px; }
.chip-cloned { background: var(--sage-container); color: var(--sage); }
.voice-row audio { margin-left: auto; height: 32px; max-width: 260px; }
.voice-upload { flex-direction: row; min-height: 0; width: 100%; border-radius: var(--radius); }

/* outro editor */
.outro-editor { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; }
@media (max-width: 640px) { .outro-editor { grid-template-columns: 1fr; } }
.outro-fields { display: flex; flex-direction: column; gap: 14px; }
.outro-fields label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); display: block; }
.outro-fields input, .revise-box input {
  width: 100%; margin-top: 5px; padding: 10px 12px; font-family: var(--sans); font-size: 14px;
  border-radius: var(--radius); border: 1.5px solid var(--outline-soft);
  background: var(--surface); color: var(--ink);
}
.outro-fields input:focus, .revise-box input:focus { outline: none; border-color: var(--primary); }
.outro-preview {
  background: #fef9ef; border: 1px solid var(--outline-soft); border-radius: var(--radius);
  aspect-ratio: 9 / 16; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 16px; text-align: center;
}
.outro-photo {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  border: 3px solid #884531; background: #ede8df;
}
.outro-photo img { width: 100%; height: 100%; object-fit: cover; }
.outro-name { font-weight: 600; font-size: 15px; color: #1d1c16; }
.outro-rule { width: 44px; height: 3px; background: #884531; border-radius: 2px; }
.outro-tag { font-size: 12px; color: #53433e; }

.setting-input {
  width: 100%; padding: 10px 12px; font-family: var(--sans); font-size: 14px;
  border-radius: var(--radius); border: 1.5px solid var(--outline-soft);
  background: var(--surface); color: var(--ink); resize: vertical; line-height: 1.5;
}
.setting-input:focus { outline: none; border-color: var(--primary); }

.lang-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 16px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.lang-select {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  padding: 8px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--outline-soft); background: var(--surface); color: var(--ink);
  cursor: pointer;
}
.chip-lang { background: var(--gold); color: #fff; }

.studio-nav {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  margin-top: 26px; flex-wrap: wrap;
}
.nav-hint { font-size: 12.5px; color: var(--ink-soft); margin-right: auto; }

/* script step */
.script-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.script-est { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.version-note { font-size: 12px; color: var(--ink-soft); font-style: italic; }
.segment-card {
  background: var(--surface-low); border: 1px solid var(--outline-soft);
  border-left: 4px solid var(--sage);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px; margin-bottom: 10px;
}
.segment-text { font-size: 15px; line-height: 1.7; }
.tag-chip {
  display: inline-block; background: var(--sage-container); color: var(--sage);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  border-radius: 999px; padding: 1px 9px; margin: 0 3px; vertical-align: 1px;
}
.broll-badge {
  margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--gold);
}
.revise-box { display: flex; gap: 10px; margin-top: 16px; }
.revise-box input { flex: 1; margin-top: 0; }

/* generate step */
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-card {
  background: var(--surface-low); border: 2.5px solid var(--outline-soft);
  border-radius: var(--radius); padding: 16px 18px; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.mode-card:hover:not(.disabled) { transform: translateY(-2px); }
.mode-card.selected { border-color: var(--primary); box-shadow: var(--shadow); }
.mode-card.disabled { opacity: .55; cursor: not-allowed; }
.mode-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mode-head h4 { font-family: var(--serif); font-size: 17px; }
.reco-badge {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  background: var(--sage-container); color: var(--sage); border-radius: 999px; padding: 2px 9px;
}
.mode-card p { font-size: 13px; color: var(--ink-soft); }
.mode-price {
  font-family: var(--serif); font-size: 24px; font-weight: 700;
  color: var(--primary) !important; margin-top: 10px;
}

.gen-progress { text-align: left; }
.gen-progress .panel-title { display: flex; align-items: center; gap: 10px; }
.studio-stages { margin: 16px 0; }
.stage-skipped .stage-dot { background: var(--sage-container); }
.meter-track.big { height: 10px; margin: 14px 0; }
.gen-hint {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-soft); margin-top: 14px;
}
.gen-hint audio { height: 34px; }

.gen-done { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.studio-video {
  width: 100%; max-width: 340px; aspect-ratio: 9 / 16;
  border-radius: 12px; background: #000; box-shadow: var(--shadow);
}
.total-chip { background: var(--primary); color: var(--on-primary); font-weight: 700; }

@media (max-width: 640px) {
  .brand h1 { font-size: 20px; }
  .story { gap: 12px; }
  .story-rank { min-width: 30px; font-size: 20px; }
  .headline { font-size: 18px; }
  .story.lead .headline { font-size: 22px; }
  .meter-label { width: 110px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .voice-row audio { max-width: 100%; margin-left: 0; width: 100%; }
}

/* ── studio: background music toggle ─────────────────────────────── */
.music-row { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.music-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.music-toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.music-price { color: var(--muted); font-weight: 400; font-size: 0.9em; }
.music-style { max-width: 560px; }

/* ── studio: premiere engine picker ──────────────────────────────── */
.engine-cards { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.engine-card {
  flex: 1 1 130px; min-width: 130px; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 10px; background: transparent;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.engine-card:hover { border-color: var(--primary); }
.engine-card.selected { border-color: var(--primary); background: var(--primary-soft, rgba(136,69,49,0.08)); }
.engine-card span { font-size: 0.8em; color: var(--muted); }
.engine-card em { font-style: normal; font-weight: 600; }

/* ── studio: voiceover preview gate ──────────────────────────────── */
.voiceover-gate { margin: 4px 0 20px; }
.voiceover-ready { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.voiceover-audio { height: 38px; flex: 1 1 240px; max-width: 380px; }
