/* ============================================================
   Dramamint · 电影感深色主题
   ============================================================ */
:root {
  /* Palette — Ink + Amber */
  --ink-0: #0a0a0d;          /* deepest */
  --ink-1: #0f0f13;          /* page bg */
  --ink-2: #15151b;          /* panel */
  --ink-3: #1c1c24;          /* card */
  --ink-4: #25252f;          /* raised */
  --ink-5: #33333f;          /* border subtle */
  --ink-6: #44444f;          /* border */
  --line: rgba(255, 240, 210, 0.07);
  --line-strong: rgba(255, 240, 210, 0.14);

  --bone: #f3ead4;           /* primary text */
  --bone-2: #d8cfba;
  --bone-3: #a39c8a;
  --bone-4: #6e6a5e;
  --bone-5: #4a473f;

  /* Mint — signature accent (from logo green) */
  --amber: oklch(0.82 0.22 142);
  --amber-soft: oklch(0.82 0.22 142 / 0.12);
  --amber-line: oklch(0.82 0.22 142 / 0.4);
  --amber-deep: oklch(0.62 0.2 142);
  --amber-glow: oklch(0.88 0.24 145);

  /* Status */
  --ok: oklch(0.78 0.11 150);
  --warn: oklch(0.82 0.14 55);
  --err: oklch(0.7 0.18 25);
  --info: oklch(0.78 0.08 240);

  /* Type */
  --serif: "Cormorant Garamond", "Songti SC", "STSong", serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing tokens */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 18px;

  --shadow-card: 0 1px 0 rgba(255,240,210,0.04) inset, 0 8px 24px rgba(0,0,0,0.5);
  --shadow-pop: 0 12px 48px rgba(0,0,0,0.6), 0 0 0 1px var(--line-strong);
}

/* Theme variants — set on <html data-theme="..."> */
html[data-theme="mint"] {
  --amber: oklch(0.82 0.22 142);
  --amber-soft: oklch(0.82 0.22 142 / 0.12);
  --amber-line: oklch(0.82 0.22 142 / 0.4);
  --amber-deep: oklch(0.62 0.2 142);
  --amber-glow: oklch(0.88 0.24 145);
}
html[data-theme="amber"] {
  --amber: oklch(0.78 0.13 75);
  --amber-soft: oklch(0.78 0.13 75 / 0.12);
  --amber-line: oklch(0.78 0.13 75 / 0.35);
  --amber-deep: oklch(0.62 0.14 60);
  --amber-glow: oklch(0.85 0.14 80);
}
html[data-theme="ember"] {
  --amber: oklch(0.7 0.2 30);
  --amber-soft: oklch(0.7 0.2 30 / 0.14);
  --amber-line: oklch(0.7 0.2 30 / 0.4);
  --amber-deep: oklch(0.55 0.2 30);
  --amber-glow: oklch(0.78 0.22 35);
}
html[data-theme="moonstone"] {
  --amber: oklch(0.82 0.1 240);
  --amber-soft: oklch(0.82 0.1 240 / 0.13);
  --amber-line: oklch(0.82 0.1 240 / 0.36);
  --amber-deep: oklch(0.6 0.12 240);
  --amber-glow: oklch(0.88 0.1 240);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-1);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
body {
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}
button { cursor: pointer; }

/* ============================================================
   Layout shell
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -200px, oklch(0.82 0.22 142 / 0.06), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, oklch(0.82 0.22 142 / 0.04), transparent 60%),
    var(--ink-1);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.15));
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 14px;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #000;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-strong), 0 4px 12px rgba(0,0,0,0.5);
}
.brand-mark svg { display: block; }
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--bone);
}
.brand-name em {
  font-style: italic;
  color: var(--amber);
  font-weight: 400;
}

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-4);
  padding: 8px 10px 4px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--bone-2);
  font-size: 13px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item .nav-icon { width: 16px; height: 16px; opacity: 0.75; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,240,210,0.04); color: var(--bone); }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active {
  background: var(--amber-soft);
  color: var(--bone);
}
.nav-item.active .nav-icon { color: var(--amber); opacity: 1; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--amber);
  border-radius: 0 2px 2px 0;
}
.nav-badge {
  margin-left: auto;
  font-size: 10px;
  background: var(--ink-4);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--bone-3);
  font-family: var(--mono);
}
.nav-item.active .nav-badge { background: rgba(0,0,0,0.3); color: var(--amber); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.upgrade-card {
  background: linear-gradient(135deg, oklch(0.28 0.1 145 / 0.5), oklch(0.16 0.05 145 / 0.6));
  border: 1px solid var(--amber-line);
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.upgrade-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at 100% 0%, var(--amber-soft), transparent);
  pointer-events: none;
}
.upgrade-title {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--amber-glow);
  letter-spacing: 0.01em;
}
.upgrade-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--bone-3);
  font-family: var(--mono);
}
.upgrade-meta b { color: var(--bone); font-weight: 500; }
.upgrade-btn {
  background: var(--amber);
  color: #07140a;
  font-weight: 600;
  font-size: 12px;
  padding: 7px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  transition: filter 0.15s;
}
.upgrade-btn:hover { filter: brightness(1.08); }

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-top: 1px solid var(--line);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.6 0.12 60), oklch(0.4 0.1 30));
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--bone);
  font-family: var(--mono);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; color: var(--bone); font-weight: 500; }
.user-plan { font-size: 10px; color: var(--bone-4); font-family: var(--mono); }

/* ============================================================
   Topbar
   ============================================================ */
.main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(15,15,19,0.7);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--bone-3);
}
.crumb b { color: var(--bone); font-weight: 500; }
.crumb-sep { color: var(--bone-5); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bone-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  transition: all 0.15s;
}
.btn:hover { background: rgba(255,240,210,0.05); color: var(--bone); border-color: var(--bone-5); }
.btn-primary {
  background: var(--amber);
  color: #07140a;
  border: 1px solid var(--amber);
  font-weight: 600;
}
.btn-primary:hover { background: var(--amber-glow); border-color: var(--amber-glow); }
.btn-ghost { border: 1px solid transparent; }
.btn-ghost:hover { background: rgba(255,240,210,0.05); border-color: transparent; }
.btn-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 6px;
}
.btn svg { width: 14px; height: 14px; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 13px; }

/* ============================================================
   Page surfaces
   ============================================================ */
.page {
  flex: 1;
  padding: 36px 48px 80px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  align-self: center;
}
.page-narrow { max-width: 1080px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--amber);
}

h1.display {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  text-wrap: pretty;
}
h1.display em { font-style: italic; color: var(--amber); }
h2.section {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 4px;
}
.subtle { color: var(--bone-3); font-size: 13px; }
.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-4);
}

/* Card */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  position: relative;
}
.card-pad { padding: 24px; }

/* ============================================================
   Stage progress (the 8-step pipeline visual)
   ============================================================ */
.stage-rail {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.stage-step {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  border-right: 1px solid var(--line);
  transition: background 0.15s;
  text-align: left;
}
.stage-step:last-child { border-right: none; }
.stage-step:hover { background: rgba(255,240,210,0.03); }
.stage-step .stage-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bone-4);
  letter-spacing: 0.1em;
}
.stage-step .stage-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--bone-2);
}
.stage-step.done .stage-num { color: var(--amber); }
.stage-step.done .stage-name { color: var(--bone); }
.stage-step.done::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--amber);
  opacity: 0.6;
}
.stage-step.current {
  background: var(--amber-soft);
}
.stage-step.current .stage-num { color: var(--amber); }
.stage-step.current .stage-name { color: var(--bone); font-weight: 600; }
.stage-step.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}
.stage-step.locked .stage-num,
.stage-step.locked .stage-name { color: var(--bone-5); }

/* ============================================================
   Inputs
   ============================================================ */
.field {
  background: var(--ink-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--bone);
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.field:focus { border-color: var(--amber-line); background: var(--ink-2); }
.field::placeholder { color: var(--bone-4); }

.tab-row {
  display: inline-flex;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.tab {
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--bone-3);
  font-weight: 500;
  transition: all 0.15s;
}
.tab:hover { color: var(--bone-2); }
.tab.active {
  background: var(--ink-1);
  color: var(--bone);
  box-shadow: 0 1px 0 var(--line-strong) inset, 0 4px 8px rgba(0,0,0,0.3);
}
.tab.active.amber {
  background: var(--amber-soft);
  color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-line);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  color: var(--bone-2);
  background: var(--ink-3);
  white-space: nowrap;
}
.chip.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.chip.ok { color: var(--ok); border-color: oklch(0.78 0.11 150 / 0.4); background: oklch(0.78 0.11 150 / 0.1); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Toggle switch */
.toggle {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--ink-4);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bone-3);
  transition: all 0.2s;
}
.toggle.on { background: var(--amber); }
.toggle.on::after { left: 16px; background: #07140a; }

/* ============================================================
   Project cards / lists
   ============================================================ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.proj-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.proj-card:hover { border-color: var(--bone-5); transform: translateY(-2px); }
.proj-thumb {
  aspect-ratio: 16 / 10;
  position: relative;
  background: var(--ink-3);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.proj-thumb-stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,240,210,0.025) 0,
    rgba(255,240,210,0.025) 1px,
    transparent 1px,
    transparent 8px
  );
}
.proj-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}
.proj-thumb-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-4);
}
.proj-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.proj-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--bone);
}
.proj-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--bone-4);
  font-family: var(--mono);
}
.proj-progress {
  height: 3px;
  background: var(--ink-4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.proj-progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
}

/* ============================================================
   Storyboard / cast grids
   ============================================================ */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.cast-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}
.cast-card:hover { border-color: var(--bone-5); }
.cast-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  position: relative;
  overflow: hidden;
}
.cast-avatar::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), transparent 50%);
}
.cast-info { display: flex; flex-direction: column; gap: 4px; }
.cast-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.cast-role { font-size: 11px; color: var(--bone-4); font-family: var(--mono); letter-spacing: 0.08em; }
.cast-tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* Storyboard */
.sb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sb-cell {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.15s;
}
.sb-cell:hover { border-color: var(--bone-5); }
.sb-cell.selected {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-line);
}
.sb-frame {
  aspect-ratio: 16 / 9;
  background: var(--ink-3);
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sb-frame-stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    -30deg,
    rgba(255,240,210,0.03) 0, rgba(255,240,210,0.03) 1px,
    transparent 1px, transparent 6px
  );
}
.sb-frame-num {
  position: absolute;
  top: 8px; left: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bone-4);
  letter-spacing: 0.12em;
}
.sb-frame-len {
  position: absolute;
  top: 8px; right: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bone-4);
  letter-spacing: 0.06em;
}
.sb-frame-icon {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--bone-5);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.sb-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.sb-prompt {
  font-size: 11px;
  color: var(--bone-2);
  font-family: var(--mono);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sb-status {
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sb-actions { display: flex; gap: 4px; }
.sb-icon-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--bone-3);
}
.sb-icon-btn:hover { background: rgba(255,240,210,0.08); color: var(--bone); }
.sb-icon-btn svg { width: 12px; height: 12px; }

/* ============================================================
   Script editor
   ============================================================ */
.script-shell {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.script-doc {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.script-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255,240,210,0.02), transparent);
}
.script-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.script-body { padding: 24px 28px 32px; max-height: 720px; overflow: auto; }
.scene-block { margin-bottom: 28px; }
.scene-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.scene-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--amber);
  font-weight: 600;
}
.scene-slug {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--bone-3);
  text-transform: uppercase;
}
.scene-action {
  font-size: 14px;
  line-height: 1.7;
  color: var(--bone-2);
  margin: 0 0 12px;
  text-wrap: pretty;
}
.dialogue {
  margin: 10px 0 10px 36px;
}
.dialogue-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 2px;
}
.dialogue-paren {
  font-style: italic;
  font-size: 12px;
  color: var(--bone-4);
  margin-bottom: 2px;
}
.dialogue-line {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--bone);
}

.editable {
  cursor: text;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 0.15s;
}
.editable:hover { background: rgba(255,240,210,0.04); }
.editable.active {
  background: var(--amber-soft);
  box-shadow: 0 0 0 1px var(--amber-line);
}

.script-rail {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI rewrite card */
.rewrite-card {
  background: var(--ink-2);
  border: 1px solid var(--amber-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.rewrite-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--amber-soft);
}
.rewrite-head-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--amber);
}
.rewrite-options { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rewrite-opt {
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--bone-2);
  cursor: pointer;
  transition: all 0.15s;
}
.rewrite-opt:hover { border-color: var(--bone-5); color: var(--bone); }
.rewrite-opt-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 4px;
  display: block;
}

/* Compare panel */
.compare {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.compare-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-4);
}
.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 12px;
}
.compare-cell { padding: 12px 14px; line-height: 1.55; }
.compare-cell.before {
  background: oklch(0.7 0.18 25 / 0.08);
  color: var(--bone-3);
  text-decoration: line-through;
  text-decoration-color: oklch(0.7 0.18 25 / 0.5);
  border-right: 1px solid var(--line);
}
.compare-cell.after {
  background: oklch(0.78 0.11 150 / 0.06);
  color: var(--bone);
}

/* ============================================================
   Misc helpers
   ============================================================ */
.hr { height: 1px; background: var(--line); border: none; margin: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.flex-1 { flex: 1; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* Banner */
.banner {
  background: linear-gradient(90deg, oklch(0.24 0.09 145 / 0.4), oklch(0.16 0.05 145 / 0.5));
  border: 1px solid var(--amber-line);
  border-radius: var(--r-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--bone-2);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 100px at 0 50%, var(--amber-soft), transparent);
  pointer-events: none;
}
.banner em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--amber);
  font-size: 14px;
  font-weight: 500;
}
.banner-close { margin-left: auto; color: var(--bone-4); padding: 4px; }
.banner-close:hover { color: var(--bone); }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 18px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 5px; border: 2px solid var(--ink-1); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-6); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer-bg {
  background: linear-gradient(90deg,
    var(--ink-3) 0%,
    var(--ink-4) 50%,
    var(--ink-3) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

/* Suggestion pills row */
.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--bone-2);
  transition: all 0.15s;
  white-space: nowrap;
}
.pill:hover { border-color: var(--amber-line); color: var(--bone); background: var(--ink-4); }
.pill svg { width: 12px; height: 12px; color: var(--amber); }

/* Input window */
.idea-window {
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-card);
}
.idea-tabs {
  display: flex;
  align-items: center;
  padding: 10px 14px 0;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.idea-tab {
  padding: 6px 14px;
  font-size: 12px;
  color: var(--bone-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  font-weight: 500;
}
.idea-tab:hover { color: var(--bone); }
.idea-tab.active { color: var(--bone); border-bottom-color: var(--amber); }

.idea-input {
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  padding: 22px 24px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--bone);
  font-family: var(--sans);
  min-height: 200px;
  display: block;
}
.idea-input::placeholder { color: var(--bone-4); font-style: italic; font-family: var(--serif); font-size: 16px; }

.idea-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
}
.idea-foot .meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--bone-2);
  background: var(--ink-3);
  border: 1px solid var(--line);
}
.idea-foot .meta-chip svg { width: 12px; height: 12px; color: var(--amber); }
.idea-counter {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bone-4);
}

/* Mode switch */
.mode-switch {
  display: inline-flex;
  background: var(--ink-3);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 3px;
}
.mode-switch button {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--bone-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.mode-switch button.active {
  background: var(--ink-1);
  color: var(--bone);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.mode-switch button svg { width: 12px; height: 12px; }

/* Render screen specific */
.render-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.render-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.render-frame {
  aspect-ratio: 16/9;
  background: var(--ink-3);
  position: relative;
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.render-status-bar {
  height: 4px;
  background: var(--ink-4);
  position: relative;
  overflow: hidden;
}
.render-status-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
}
.render-status-fill.indeterminate {
  width: 40%;
  position: absolute;
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide {
  0% { left: -40%; }
  100% { left: 100%; }
}
.render-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

.waveform {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.waveform-bar {
  flex: 1;
  background: var(--bone-5);
  border-radius: 1px;
  min-height: 2px;
  max-height: 100%;
}
.waveform-bar.hot { background: var(--amber); }

/* Compose screen */
.timeline {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}
.tl-track {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.tl-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tl-label svg { width: 12px; height: 12px; }
.tl-row {
  height: 36px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  gap: 2px;
  padding: 2px;
  position: relative;
}
.tl-clip {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: 3px;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10px;
  color: var(--amber);
  font-family: var(--mono);
  overflow: hidden;
  white-space: nowrap;
}
.tl-clip.bg { background: oklch(0.78 0.08 240 / 0.12); border-color: oklch(0.78 0.08 240 / 0.4); color: oklch(0.82 0.08 240); }
.tl-clip.sfx { background: oklch(0.78 0.11 150 / 0.12); border-color: oklch(0.78 0.11 150 / 0.4); color: var(--ok); }
.tl-clip.cap { background: rgba(255,240,210,0.08); border-color: var(--line-strong); color: var(--bone-2); }
.tl-playhead {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  pointer-events: none;
  z-index: 2;
}
.tl-playhead::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -5px;
  width: 12px;
  height: 8px;
  background: var(--amber);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Outline screen */
.outline-list { display: flex; flex-direction: column; gap: 12px; }
.outline-item {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: start;
  transition: all 0.15s;
}
.outline-item:hover { border-color: var(--bone-5); }
.outline-num {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--amber);
  font-style: italic;
  line-height: 1;
}
.outline-act {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-4);
  margin-bottom: 6px;
}
.outline-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
}
.outline-desc {
  font-size: 13px;
  color: var(--bone-2);
  line-height: 1.6;
}

/* Empty / placeholder text style */
.muted { color: var(--bone-4); }
.dim { color: var(--bone-3); }

/* Top header section variants */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 24px;
  flex-wrap: wrap;
}
.page-head .col { gap: 6px; }

/* Stat blocks */
.stat-row { display: flex; gap: 18px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--bone);
  line-height: 1;
}
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-4);
}

/* Big primary CTA */
.cta-generate {
  height: 44px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  background: var(--amber);
  color: #07140a;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px oklch(0.82 0.22 142 / 0.25), 0 0 0 1px oklch(0.82 0.22 142 / 0.4);
  transition: all 0.15s;
}
.cta-generate:hover {
  background: var(--amber-glow);
  box-shadow: 0 10px 30px oklch(0.88 0.24 145 / 0.35), 0 0 0 1px var(--amber);
}
.cta-generate svg { width: 14px; height: 14px; }

/* Pro page styles */
.param-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.param-block {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.param-block h4 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-4);
  font-weight: 500;
}
.param-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.param-opt {
  padding: 6px 12px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--bone-2);
  cursor: pointer;
  transition: all 0.15s;
}
.param-opt:hover { border-color: var(--bone-5); color: var(--bone); }
.param-opt.active {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  color: var(--amber);
}

/* Slider */
.slider-track {
  position: relative;
  height: 4px;
  background: var(--ink-4);
  border-radius: 2px;
  margin: 16px 0 8px;
}
.slider-fill {
  position: absolute;
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
  left: 0;
}
.slider-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bone);
  border: 2px solid var(--amber);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.slider-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--bone-4);
  letter-spacing: 0.1em;
}

/* Export */
.export-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.export-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.export-card:hover { border-color: var(--bone-5); }
.export-card.active { border-color: var(--amber); background: var(--amber-soft); }
.export-card-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.export-card-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--bone-4);
  text-transform: uppercase;
}
