/* =========================================================
   镜语 StoryFrame — 电影感界面
   ========================================================= */
:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-soft: #0f0f12;
  --panel: #141417;
  --panel-2: #18181c;
  --panel-3: #1e1e23;
  --line: rgba(242, 237, 227, 0.09);
  --line-strong: rgba(242, 237, 227, 0.16);
  --text: #f2ede3;
  --muted: #a09a8f;
  --faint: #6d6860;
  --gold: #d7a45c;
  --gold-soft: #e8c58e;
  --gold-dim: rgba(215, 164, 92, 0.14);
  --teal: #7fb7ad;
  --red: #c96a5b;
  --green: #7fae8b;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", "Courier New", monospace;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(215, 164, 92, 0.10), transparent 62%),
    radial-gradient(760px 520px at 8% 18%, rgba(127, 183, 173, 0.06), transparent 65%),
    linear-gradient(180deg, #0a0a0c 0%, #0b0b0e 42%, #09090b 100%);
}
::selection { background: rgba(215, 164, 92, 0.3); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-soft); text-decoration: none; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.thumb-svg { stroke: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #34343a transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #34343a; border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   Shell
   ========================================================= */
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 20px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 16, 19, 0.95), rgba(10, 10, 12, 0.96));
  backdrop-filter: blur(18px);
  z-index: 20;
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 0 4px 24px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(215, 164, 92, 0.55);
  border-radius: 12px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 22px;
  background: linear-gradient(145deg, rgba(215, 164, 92, 0.16), rgba(215, 164, 92, 0.02));
  box-shadow: inset 0 0 24px rgba(215, 164, 92, 0.08);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-family: var(--serif); font-size: 21px; letter-spacing: 0.18em; font-weight: 600; }
.brand-text span { margin-top: 3px; font-size: 8px; letter-spacing: 0.26em; color: var(--faint); }
.new-project {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255,255,255,0.025);
  color: var(--text);
  font-size: 12.5px;
  transition: .2s ease;
}
.new-project:hover { border-color: rgba(215,164,92,.55); color: var(--gold-soft); background: var(--gold-dim); }
.new-project svg { width: 15px; height: 15px; }
.step-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 26px; }
.step-link {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  width: 100%; padding: 11px 11px;
  border: 0; border-radius: 12px;
  background: transparent; color: var(--muted);
  text-align: left;
  transition: .2s ease;
}
.step-link::before {
  content: ""; position: absolute; left: -20px; top: 12px; bottom: 12px;
  width: 2px; border-radius: 2px; background: transparent; transition: .2s;
}
.step-link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.step-link.is-active { color: var(--text); background: linear-gradient(90deg, rgba(215,164,92,.13), rgba(215,164,92,.02)); }
.step-link.is-active::before { background: var(--gold); }
.step-num { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--faint); width: 20px; }
.step-link.is-active .step-num { color: var(--gold); }
.step-copy { display: flex; flex-direction: column; line-height: 1.3; }
.step-copy b { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }
.step-copy small { margin-top: 2px; font-size: 10.5px; color: var(--faint); }
.step-link.is-active .step-copy small { color: var(--muted); }
.project-block {
  margin-top: auto;
  padding: 16px 4px 18px;
  border-top: 1px solid var(--line);
}
.mini-label { display: block; font-size: 9px; letter-spacing: .18em; color: var(--faint); text-transform: uppercase; }
.project-name {
  display: block; width: 100%;
  margin-top: 6px; padding: 0;
  border: 0; background: transparent;
  color: var(--text); text-align: left;
  font-family: var(--serif); font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-name:hover { color: var(--gold-soft); }
.save-state { display: block; margin-top: 4px; font-size: 10.5px; color: var(--faint); }
.sidebar-foot { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 6px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-size: 12px; text-align: left;
}
.side-link:hover { color: var(--text); background: rgba(255,255,255,.03); }
.side-link svg { width: 15px; height: 15px; color: var(--faint); }
.side-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--faint); }
.side-dot.is-on { background: var(--green); box-shadow: 0 0 10px rgba(127,174,139,.7); }
.version-line { padding: 12px 6px 0; font-size: 9px; color: #4f4b45; line-height: 1.5; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(18px);
}
.crumb { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 11px; color: var(--faint); letter-spacing: .06em; }
.crumb i { color: #3d3a35; font-style: normal; }
.crumb strong { color: var(--muted); font-weight: 500; }
.title-wrap { flex: 1; min-width: 60px; }
.project-title-input {
  width: 100%; max-width: 460px;
  padding: 5px 0;
  border: 0; border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .04em;
  outline: none;
  transition: .2s;
}
.project-title-input:hover { border-bottom-color: var(--line); }
.project-title-input:focus { border-bottom-color: rgba(215,164,92,.6); }
.top-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.save-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.save-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.save-pill.is-saving::before { background: var(--gold); animation: pulse 1s infinite; }
.save-pill.is-saved::before { background: var(--green); }
.content { max-width: 1500px; margin: 0 auto; padding: 38px 38px 90px; }

/* =========================================================
   Type + generic
   ========================================================= */
.eyebrow { display: inline-block; font-size: 9px; letter-spacing: .24em; color: var(--faint); text-transform: uppercase; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
h1, h2 { font-family: var(--serif); }
h2 { font-size: 20px; letter-spacing: .03em; }
h3 { font-size: 16px; }
p { margin: 0; }
small { font-size: 11px; }
em { font-style: normal; color: var(--gold-soft); }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 19px; padding: 0 5px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 5px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-family: var(--mono); font-size: 9px;
}
.head-hint { font-size: 10.5px; color: var(--faint); text-align: right; line-height: 1.5; max-width: 250px; }
.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(25,25,29,.86), rgba(17,17,20,.88));
  box-shadow: 0 1px 0 rgba(255,255,255,.025) inset;
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.card-head h2 { margin-top: 4px; }
.card-head h2 small { color: var(--faint); font-family: var(--sans); font-size: 11px; font-weight: 400; }
.card-head .eyebrow { color: #777167; }

/* =========================================================
   Step 1
   ========================================================= */
.step-panel { display: none; animation: panelIn .35s ease both; }
.step-panel.is-active { display: block; }
.brief-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 8px 0 34px; }
.brief-head h1 { margin: 10px 0 14px; font-size: clamp(34px, 4.2vw, 58px); line-height: 1.13; letter-spacing: .02em; }
.brief-head p { max-width: 650px; color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.head-stamp {
  flex-shrink: 0;
  min-width: 168px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
  text-align: right;
}
.head-stamp span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: .2em; color: var(--gold); }
.head-stamp b { display: block; margin: 5px 0 2px; font-family: var(--serif); font-size: 16px; font-weight: 500; }
.head-stamp small { font-size: 9.5px; color: var(--faint); }
.brief-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.brief-main { min-width: 0; }
.brief-aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; }
.idea-input {
  width: 100%;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(8,8,10,.7);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
  resize: vertical;
  outline: none;
  transition: .2s;
}
.idea-input::placeholder { color: #5d584f; }
.idea-input:focus { border-color: rgba(215,164,92,.55); box-shadow: 0 0 0 3px rgba(215,164,92,.07); }
.input-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; }
.char-count { font-family: var(--mono); font-size: 9.5px; color: var(--faint); white-space: nowrap; }
.char-count b { color: var(--muted); font-weight: 500; }
.example-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.example-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: .2s;
}
.example-chip:hover { border-color: rgba(215,164,92,.4); color: var(--gold-soft); background: var(--gold-dim); }
.mode-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0,0,0,.22);
}
.mode-btn {
  padding: 5px 10px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}
.mode-btn.is-active { background: rgba(255,255,255,.08); color: var(--text); }
.image-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 150px; padding: 20px;
  border: 1px dashed rgba(242,237,227,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.015);
  text-align: center;
  cursor: pointer;
  transition: .2s;
}
.upload-zone:focus-visible { outline: 2px solid rgba(215,164,92,.65); outline-offset: 2px; }
.upload-zone.is-drag { border-color: var(--gold); background: var(--gold-dim); }
.upload-zone > svg { width: 24px; height: 24px; color: var(--gold); margin-bottom: 8px; }
.upload-zone b { font-size: 12px; font-weight: 500; }
.upload-zone span { max-width: 350px; margin: 4px 0 12px; color: var(--faint); font-size: 10.5px; line-height: 1.6; }
.ref-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ref-thumb {
  position: relative; width: 92px; height: 66px;
  border: 1px solid var(--line-strong);
  border-radius: 9px; overflow: hidden;
  background: #111;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb button {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff;
}
.ref-thumb button svg { width: 10px; height: 10px; }
.ref-palette { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 2px; }
.ref-palette i { width: 7px; height: 7px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }

.genre-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.genre-card {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  min-height: 74px; padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  text-align: left;
  transition: .2s ease;
}
.genre-card:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.035); transform: translateY(-1px); }
.genre-card.is-active { border-color: rgba(215,164,92,.55); background: linear-gradient(140deg, rgba(215,164,92,.13), rgba(215,164,92,.02)); }
.genre-card .g-icon { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--gold); font-size: 13px; }
.genre-card .g-copy { display: flex; flex-direction: column; min-width: 0; }
.genre-card b { font-size: 12.5px; font-weight: 500; }
.genre-card small { margin-top: 3px; color: var(--faint); font-size: 9.5px; line-height: 1.45; }
.genre-card.is-active b { color: var(--gold-soft); }

.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-card {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 82px; padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  text-align: left;
  overflow: hidden;
  transition: .2s ease;
}
.style-card::after {
  content: ""; position: absolute; right: -12px; bottom: -18px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--swatch, var(--gold));
  opacity: .1; filter: blur(6px);
}
.style-card:hover { border-color: rgba(255,255,255,.2); transform: translateY(-1px); }
.style-card.is-active { border-color: rgba(215,164,92,.55); background: linear-gradient(140deg, rgba(215,164,92,.12), rgba(215,164,92,.02)); }
.style-card b { font-size: 12.5px; font-weight: 500; }
.style-card small { color: var(--faint); font-size: 9.5px; }
.style-card .style-desc { margin-top: 5px; color: #777167; font-size: 9.5px; line-height: 1.5; }
.style-card.is-active b { color: var(--gold-soft); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { display: flex; align-items: baseline; gap: 6px; font-size: 10.5px; color: var(--muted); letter-spacing: .03em; }
.field-label small { color: var(--faint); font-size: 9px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(7,7,9,.55);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: .2s;
}
.input, .select { height: 38px; padding: 0 11px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.textarea { min-height: 90px; padding: 10px 11px; line-height: 1.7; resize: vertical; }
.textarea.small { min-height: 76px; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(215,164,92,.55); box-shadow: 0 0 0 3px rgba(215,164,92,.06); }
.input::placeholder, .textarea::placeholder { color: #57534b; }
.spec-grid { display: grid; grid-template-columns: 1.15fr .85fr .85fr 1.1fr; gap: 16px; }
.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.22); min-height: 38px; }
.seg-btn {
  flex: 1; padding: 5px 7px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--faint);
  font-size: 10.5px; white-space: nowrap;
  transition: .2s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: rgba(255,255,255,.09); color: var(--text); }
.platform-field { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.platform-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.platform-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  text-align: left;
}
.platform-card:hover { border-color: rgba(255,255,255,.2); }
.platform-card.is-active { border-color: rgba(215,164,92,.5); background: var(--gold-dim); }
.platform-card b { font-size: 11.5px; font-weight: 500; }
.platform-card small { color: var(--faint); font-size: 9px; }
.cast-grid { display: grid; grid-template-columns: 1fr .7fr 1fr; gap: 16px; }

/* aside */
.summary-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(215,164,92,.24);
  border-radius: 18px;
  background:
    radial-gradient(240px 160px at 100% 0%, rgba(215,164,92,.15), transparent 70%),
    linear-gradient(165deg, #1a1815, #121214 68%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.summary-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .7;
}
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--faint);
  font-size: 9px; letter-spacing: .05em;
  white-space: nowrap;
}
.badge.is-on { border-color: rgba(127,183,173,.45); color: var(--teal); background: rgba(127,183,173,.08); }
.summary-card h3 { margin: 12px 0 6px; font-family: var(--serif); font-size: 24px; line-height: 1.25; }
.summary-card > p { color: var(--muted); font-size: 11.5px; line-height: 1.7; min-height: 38px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px 8px; margin: 18px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-grid div { display: flex; flex-direction: column; gap: 2px; }
.summary-grid span { color: var(--faint); font-size: 8.5px; letter-spacing: .08em; }
.summary-grid b { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.summary-list span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10.5px; }
.summary-list i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); opacity: .8; }
.summary-note { margin-top: 10px !important; color: var(--faint) !important; font-size: 9px !important; line-height: 1.6 !important; text-align: center; min-height: 0 !important; }
.aside-quote {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.016);
}
.aside-quote svg { width: 18px; height: 18px; color: var(--gold); opacity: .7; }
.aside-quote p { margin: 9px 0 10px; font-family: var(--serif); font-size: 16px; line-height: 1.65; color: #d8d1c5; }
.aside-quote span { font-size: 9px; color: var(--faint); letter-spacing: .08em; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: .2s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  border-color: rgba(231,192,134,.35);
  background: linear-gradient(180deg, #e2b574, #c89750);
  color: #17120c;
  box-shadow: 0 6px 22px rgba(215,164,92,.18), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 9px 28px rgba(215,164,92,.26); }
.btn-primary kbd { border-color: rgba(0,0,0,.16); background: rgba(255,255,255,.18); color: rgba(23,18,12,.7); }
.btn-ghost { border-color: var(--line-strong); background: rgba(255,255,255,.025); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.05); }
.btn-danger { border-color: rgba(201,106,91,.35); background: rgba(201,106,91,.1); color: #e5a094; }
.btn-danger:hover { background: rgba(201,106,91,.18); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 10px; border-radius: 7px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-wide { width: 100%; height: 42px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.icon-btn svg { width: 13px; height: 13px; }
.icon-btn.danger:hover { color: #e5a094; border-color: rgba(201,106,91,.4); }

/* =========================================================
   Step 2 — script
   ========================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.page-head h1 { margin: 7px 0 8px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.25; }
.page-head p { max-width: 720px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.meta-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.meta-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--faint); font-size: 9.5px;
}
.meta-tag b { color: var(--muted); font-weight: 500; }
.script-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; }
.script-main { min-width: 0; }
.script-aside { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px; }
.story-card { padding: 26px; }
.story-title {
  margin: 8px 0 8px;
  font-family: var(--serif);
  font-size: 34px; line-height: 1.3;
  outline: none;
}
.story-title:focus, .editable:focus { background: rgba(215,164,92,.06); box-shadow: 0 0 0 3px rgba(215,164,92,.05); border-radius: 5px; }
.story-logline { color: #cdc6ba; font-family: var(--serif); font-size: 17px; line-height: 1.75; outline: none; }
.story-synopsis { margin-top: 14px; color: var(--muted); font-size: 12.5px; line-height: 1.9; outline: none; }
.theme-line { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.theme-line b { flex-shrink: 0; color: var(--gold); font-weight: 500; }
.theme-line span { outline: none; }
.act-label { display: flex; align-items: center; gap: 12px; margin: 28px 0 12px; color: var(--faint); font-size: 9px; letter-spacing: .18em; }
.act-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.scene-card { padding: 22px 24px; }
.scene-card + .scene-card { margin-top: 12px; }
.scene-head { display: flex; align-items: flex-start; gap: 13px; }
.scene-num { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(215,164,92,.35); border-radius: 8px; color: var(--gold); font-family: var(--mono); font-size: 11px; background: var(--gold-dim); }
.scene-title-wrap { flex: 1; min-width: 0; }
.scene-title { font-family: var(--serif); font-size: 20px; line-height: 1.35; outline: none; }
.slug { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 5px; color: var(--faint); font-size: 9.5px; letter-spacing: .04em; }
.slug span { display: inline-flex; align-items: center; gap: 4px; }
.slug b { color: var(--muted); font-weight: 500; }
.scene-purpose { margin: 13px 0 0; padding: 9px 11px; border-left: 2px solid rgba(215,164,92,.45); background: rgba(215,164,92,.045); color: #a9a196; font-size: 10.5px; line-height: 1.65; }
.scene-action { margin-top: 15px; color: #d8d1c5; font-family: var(--serif); font-size: 15px; line-height: 1.9; outline: none; white-space: pre-wrap; }
.scene-reaction { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.8; outline: none; }
.dialogue-block { margin-top: 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.18); }
.dialogue-line { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.8; }
.dialogue-line + .dialogue-line { margin-top: 6px; }
.dialogue-line b { flex-shrink: 0; min-width: 54px; color: var(--gold-soft); font-weight: 500; font-family: var(--serif); }
.dialogue-line span { color: #d8d1c5; outline: none; }
.scene-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.scene-foot .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-tag { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--faint); font-size: 9px; }
.character-card { padding: 18px; }
.character-head { display: flex; align-items: center; gap: 11px; }
.avatar { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--avatar, #c7a36a); color: rgba(10,10,12,.8); font-family: var(--serif); font-size: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.character-head b { display: block; font-size: 13px; font-weight: 600; }
.character-head small { display: block; color: var(--faint); font-size: 9.5px; }
.char-field { margin-top: 11px; }
.char-field span { display: block; color: var(--faint); font-size: 8.5px; letter-spacing: .08em; margin-bottom: 2px; }
.char-field p { color: #c8c1b5; font-size: 10.5px; line-height: 1.65; outline: none; }
.empty-mini { padding: 24px; text-align: center; color: var(--faint); font-size: 11px; }

/* =========================================================
   Step 3 — board
   ========================================================= */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.stat-card span { display: block; color: var(--faint); font-size: 8.5px; letter-spacing: .12em; }
.stat-card b { display: block; margin-top: 3px; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.stat-card b small { margin-left: 3px; color: var(--faint); font-family: var(--sans); font-size: 9px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.toolbar-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.2); }
.view-toggle button { width: 30px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--faint); }
.view-toggle button.is-active { background: rgba(255,255,255,.08); color: var(--text); }
.timeline-wrap { padding: 13px 14px 9px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.015); margin-bottom: 18px; }
.timeline-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--faint); font-size: 8.5px; letter-spacing: .1em; }
.timeline { display: flex; gap: 2px; height: 24px; border-radius: 6px; overflow: hidden; }
.timeline-seg { position: relative; border: 0; padding: 0; min-width: 5px; background: var(--seg, #333); opacity: .75; transition: .2s; }
.timeline-seg:hover { opacity: 1; }
.timeline-seg.is-active { opacity: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.shot-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(170deg, #17171b, #111114);
  overflow: hidden;
  transition: .22s ease;
}
.shot-card:hover { transform: translateY(-2px); border-color: rgba(242,237,227,.2); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.shot-thumb { position: relative; background: #08080a; overflow: hidden; }
.shot-thumb img, .shot-thumb svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot-thumb::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 50px rgba(0,0,0,.45); pointer-events: none; }
.shot-num, .shot-duration, .shot-ref {
  position: absolute; z-index: 2;
  font-family: var(--mono); font-size: 9px;
  background: rgba(6,6,8,.72); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; padding: 2px 5px;
}
.shot-num { top: 8px; left: 8px; color: var(--gold-soft); }
.shot-duration { top: 8px; right: 8px; color: #dfe4e2; }
.shot-ref { bottom: 8px; left: 8px; color: var(--teal); }
.shot-edit-btn { position: absolute; z-index: 2; right: 8px; bottom: 8px; }
.shot-body { display: flex; flex-direction: column; flex: 1; padding: 12px 13px 11px; }
.shot-kicker { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 8.5px; letter-spacing: .08em; }
.shot-kicker i { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.shot-body h3 { margin-top: 5px; font-size: 12.5px; font-weight: 500; line-height: 1.45; }
.shot-action { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; color: #a9a297; font-size: 10.5px; line-height: 1.65; min-height: 34px; }
.shot-dialogue { margin-top: 4px; color: #c8bda9; font-family: var(--serif); font-size: 10px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shot-dialogue::before { content: "“"; color: var(--gold); }
.shot-dialogue::after { content: "”"; color: var(--gold); }
.shot-move { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; color: #7f786d; font-size: 9.5px; line-height: 1.55; }
.shot-move b { margin-right: 5px; color: var(--gold); font-weight: 500; }
.shot-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.tag { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.tag.gold { border-color: rgba(215,164,92,.28); color: var(--gold-soft); background: rgba(215,164,92,.06); }
.tag.teal { border-color: rgba(127,183,173,.25); color: #a1ccc5; background: rgba(127,183,173,.05); }
.tag.red { border-color: rgba(201,106,91,.25); color: #d89a8f; background: rgba(201,106,91,.05); }
.shot-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.shot-foot .move-label { color: var(--faint); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-foot button { flex-shrink: 0; }

/* list view */
.shot-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.shot-row { display: grid; grid-template-columns: 52px 120px minmax(160px, 1fr) minmax(130px, .8fr) 120px 55px 42px; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.012); }
.shot-row:last-child { border-bottom: 0; }
.shot-row.is-head { background: rgba(255,255,255,.03); color: var(--faint); font-size: 8.5px; letter-spacing: .1em; }
.shot-row:not(.is-head):hover { background: rgba(255,255,255,.035); }
.shot-row .row-num { font-family: var(--mono); font-size: 9px; color: var(--gold); }
.shot-row .row-thumb { width: 108px; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; background: #08080a; }
.shot-row .row-thumb svg, .shot-row .row-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.shot-row b { font-size: 10.5px; font-weight: 500; }
.shot-row p { color: var(--faint); font-size: 9.5px; }
.shot-row .row-tags { display: flex; flex-wrap: wrap; gap: 3px; }

/* empty */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 420px; padding: 40px;
  border: 1px dashed rgba(242,237,227,.15);
  border-radius: 18px;
  background: radial-gradient(400px 250px at 50% 20%, rgba(215,164,92,.06), transparent 75%);
  text-align: center;
}
.empty-state .empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(215,164,92,.3); border-radius: 16px; color: var(--gold); background: var(--gold-dim); margin-bottom: 16px; }
.empty-state .empty-icon svg { width: 24px; height: 24px; }
.empty-state h2 { margin-bottom: 7px; }
.empty-state p { max-width: 380px; color: var(--faint); font-size: 11.5px; line-height: 1.8; margin-bottom: 18px; }

/* =========================================================
   Step 4 — prompts
   ========================================================= */
.prompt-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.prompt-list { position: sticky; top: 88px; max-height: calc(100vh - 120px); overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.015); padding: 6px; }
.prompt-list-head { display: flex; justify-content: space-between; padding: 8px 9px 10px; color: var(--faint); font-size: 8.5px; letter-spacing: .1em; }
.prompt-item { display: flex; gap: 9px; width: 100%; padding: 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; }
.prompt-item:hover { background: rgba(255,255,255,.035); }
.prompt-item.is-active { border-color: rgba(215,164,92,.3); background: rgba(215,164,92,.07); }
.prompt-item .pi-thumb { flex-shrink: 0; width: 64px; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: #08080a; }
.prompt-item .pi-thumb svg, .prompt-item .pi-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.prompt-item .pi-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.prompt-item .pi-copy b { font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt-item .pi-copy span { color: var(--faint); font-size: 8.5px; }
.prompt-work { min-width: 0; }
.prompt-work-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.prompt-work-head h2 { margin-top: 3px; font-size: 25px; }
.prompt-work-head .sub { margin-top: 4px; color: var(--faint); font-size: 10.5px; }
.prompt-toolbar { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.prompt-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.platform-note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }
.platform-note b { display: flex; align-items: center; gap: 6px; font-size: 10.5px; }
.platform-note b i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.platform-note p { margin-top: 4px; color: var(--faint); font-size: 9.5px; line-height: 1.6; }
.prompt-block { border: 1px solid var(--line); border-radius: 12px; background: #0d0d10; overflow: hidden; }
.prompt-block + .prompt-block { margin-top: 10px; }
.prompt-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.018); }
.prompt-block-head .pb-title { display: flex; align-items: center; gap: 7px; font-size: 10.5px; }
.prompt-block-head .pb-title i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent, var(--gold)); }
.prompt-block-head .pb-title small { color: var(--faint); font-size: 8.5px; }
.pb-actions { display: flex; align-items: center; gap: 6px; }
.prompt-textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: #d6d0c5;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.85;
  resize: vertical;
  outline: none;
}
.prompt-textarea.is-en { font-family: var(--mono); font-size: 10.5px; line-height: 1.8; color: #c5d1cd; }
.prompt-textarea.is-video { color: #d9cbb7; }
.pb-foot { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8.5px; }
.pb-foot b { font-weight: 400; color: var(--muted); }
.prompt-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.prompt-meta div { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.015); }
.prompt-meta span { display: block; color: var(--faint); font-size: 8px; letter-spacing: .08em; }
.prompt-meta b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guidance-card { margin-top: 14px; padding: 18px; }
.guidance-card h3 { font-size: 14px; }
.guidance-card p { margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.7; }
.guidance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.guidance-item { padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.015); }
.guidance-item b { display: block; color: var(--gold-soft); font-size: 10px; font-weight: 500; }
.guidance-item span { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; line-height: 1.6; }

/* =========================================================
   Drawer
   ========================================================= */
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0;
  width: min(540px, 100vw);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line-strong);
  background: #121215;
  box-shadow: -30px 0 90px rgba(0,0,0,.5);
  transform: translateX(102%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  visibility: hidden;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin-top: 3px; font-size: 23px; }
.drawer-head .sub { color: var(--faint); font-size: 10px; margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px 26px; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); }
.drawer-foot .group { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer-thumb { position: relative; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #08080a; }
.drawer-thumb svg, .drawer-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.drawer-thumb .thumb-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.drawer-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.drawer-section:first-of-type { margin-top: 16px; padding-top: 0; border-top: 0; }
.drawer-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.effect-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.effect-pill { padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--faint); font-size: 9px; }
.effect-pill.is-on { border-color: rgba(215,164,92,.4); color: var(--gold-soft); background: var(--gold-dim); }
.prompt-preview { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.2); color: #b8b1a6; font-size: 10px; line-height: 1.7; max-height: 130px; overflow: auto; white-space: pre-wrap; }
.drawer-note { margin-top: 9px; color: var(--faint); font-size: 9px; line-height: 1.6; }

/* =========================================================
   Modal
   ========================================================= */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px; background: rgba(0,0,0,.66); backdrop-filter: blur(5px); }
.modal-card {
  width: min(680px, 100%);
  max-height: min(86vh, 860px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #141417;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modalIn .25s ease both;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin-top: 3px; font-size: 24px; }
.modal-head p { margin-top: 3px; color: var(--faint); font-size: 10.5px; }
.modal-body { overflow: auto; padding: 20px 22px 24px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(0,0,0,.18); }
.modal-section { margin-bottom: 20px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section h3 { margin-bottom: 4px; font-size: 13px; }
.modal-section > p { color: var(--faint); font-size: 10px; line-height: 1.7; margin-bottom: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-grid .span-2 { grid-column: span 2; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.015); }
.check-row input { margin-top: 2px; accent-color: var(--gold); }
.check-row b { display: block; font-size: 10.5px; font-weight: 500; }
.check-row small { display: block; color: var(--faint); font-size: 9px; line-height: 1.6; margin-top: 2px; }
.security-note { display: flex; gap: 9px; padding: 11px 12px; border: 1px solid rgba(127,183,173,.22); border-radius: 9px; background: rgba(127,183,173,.05); color: #a9c9c4; font-size: 9.5px; line-height: 1.65; }
.security-note svg { flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.export-option { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); text-align: left; }
.export-option:hover { border-color: rgba(215,164,92,.45); background: var(--gold-dim); }
.export-option b { font-size: 12px; font-weight: 500; }
.export-option span { color: var(--faint); font-size: 9.5px; line-height: 1.5; }
.export-option svg { width: 18px; height: 18px; color: var(--gold); margin-bottom: 5px; }
.project-list { display: flex; flex-direction: column; gap: 7px; }
.project-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.015); }
.project-row.is-current { border-color: rgba(215,164,92,.3); background: rgba(215,164,92,.05); }
.project-row .pr-main { flex: 1; min-width: 0; }
.project-row b { display: block; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row small { display: block; color: var(--faint); font-size: 9px; }
.project-row .pr-actions { display: flex; gap: 5px; }
.help-steps { display: flex; flex-direction: column; gap: 10px; }
.help-step { display: flex; gap: 12px; }
.help-step .hs-num { flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid rgba(215,164,92,.35); border-radius: 7px; color: var(--gold); font-family: var(--mono); font-size: 9px; background: var(--gold-dim); }
.help-step b { display: block; font-size: 11px; font-weight: 500; }
.help-step p { margin-top: 2px; color: var(--faint); font-size: 9.5px; line-height: 1.7; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 9.5px; color: var(--muted); }
.shortcut-row kbd { min-width: 30px; }

/* =========================================================
   Progress / toast
   ========================================================= */
.progress-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(6,6,8,.76); backdrop-filter: blur(8px); }
.progress-card { width: min(480px, 100%); padding: 30px; border: 1px solid var(--line-strong); border-radius: 20px; background: radial-gradient(300px 200px at 50% 0%, rgba(215,164,92,.12), transparent 75%), #121215; box-shadow: var(--shadow); text-align: center; }
.progress-orbit { position: relative; width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%; border: 1px solid rgba(215,164,92,.25); }
.progress-orbit span { position: absolute; inset: 7px; border-radius: 50%; border: 1px dashed rgba(215,164,92,.55); animation: spin 9s linear infinite; }
.progress-orbit i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 18px rgba(215,164,92,.85); }
.progress-card h3 { margin: 7px 0 5px; font-family: var(--serif); font-size: 23px; }
.progress-card > p { color: var(--faint); font-size: 10.5px; line-height: 1.7; }
.progress-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 18px 0 14px; }
.progress-steps span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-size: 9px; }
.progress-steps span.is-done { border-color: rgba(127,174,139,.3); color: var(--green); background: rgba(127,174,139,.06); }
.progress-steps span.is-active { border-color: rgba(215,164,92,.45); color: var(--gold-soft); background: var(--gold-dim); }
.progress-bar { height: 3px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress-bar span { display: block; width: 8%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), #f1cc94); transition: width .45s ease; }
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border: 1px solid var(--line-strong); border-left: 2px solid var(--gold); border-radius: 9px; background: rgba(22,22,26,.96); box-shadow: 0 12px 30px rgba(0,0,0,.35); color: #d6d0c5; font-size: 11px; line-height: 1.6; animation: toastIn .25s ease both; pointer-events: auto; }
.toast.is-warn { border-left-color: var(--red); }
.toast.is-ok { border-left-color: var(--green); }
.toast svg { flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; color: var(--gold); }
.toast.is-warn svg { color: var(--red); }
.toast.is-ok svg { color: var(--green); }

/* =========================================================
   Print
   ========================================================= */
.print-area { display: none; }
@page { margin: 16mm 14mm; }
@media print {
  body { background: #fff !important; color: #111 !important; }
  body::before, .app-shell, .drawer, .drawer-backdrop, .modal-root, .toast-stack, .progress-overlay { display: none !important; }
  .print-area { display: block !important; color: #111; font-family: var(--sans); }
  .print-cover { padding-bottom: 18px; border-bottom: 2px solid #111; margin-bottom: 18px; }
  .print-kicker { font-size: 8pt; letter-spacing: .18em; color: #777; }
  .print-cover h1 { font-family: var(--serif); font-size: 28pt; margin: 8pt 0; color: #111; }
  .print-logline { font-family: var(--serif); font-size: 12pt; line-height: 1.7; color: #333; }
  .print-meta { margin-top: 8pt; font-size: 8pt; color: #777; }
  .print-area section { margin-top: 16pt; break-inside: auto; }
  .print-area h2 { font-family: var(--serif); font-size: 15pt; margin-bottom: 8pt; padding-bottom: 4pt; border-bottom: 1px solid #ddd; color: #111; }
  .print-area h3 { font-size: 11pt; margin: 10pt 0 4pt; color: #111; }
  .print-area p { font-size: 9pt; line-height: 1.7; margin: 4pt 0; color: #222; }
  .print-theme { color: #666 !important; font-style: italic; }
  .print-chars { display: grid; grid-template-columns: 1fr 1fr; gap: 8pt; }
  .print-char { border: 1px solid #ddd; border-radius: 4pt; padding: 7pt; }
  .print-char strong { display: block; font-size: 9.5pt; }
  .print-char span { display: block; font-size: 8pt; color: #777; }
  .print-char p { font-size: 8pt; }
  .print-scene { break-inside: avoid; margin-bottom: 10pt; }
  .print-slug { font-family: var(--mono); font-size: 7.5pt; color: #777; margin-bottom: 3pt; }
  .print-dialogue { margin-left: 12pt; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
  .print-table th, .print-table td { border: 1px solid #ddd; padding: 4pt 5pt; text-align: left; vertical-align: top; }
  .print-table th { background: #f3f1ed; font-weight: 600; }
  .print-shot { break-inside: avoid; margin-bottom: 10pt; padding-bottom: 8pt; border-bottom: 1px solid #eee; }
  .print-prompt-label { margin-top: 4pt; font-size: 7.5pt; font-weight: 600; color: #555; }
  .print-prompt { font-family: var(--mono); font-size: 7pt; line-height: 1.55; background: #f7f6f3; padding: 4pt 5pt; border-radius: 3pt; }
  .print-footer { margin-top: 18pt; padding-top: 6pt; border-top: 1px solid #ddd; font-size: 7pt; color: #888; text-align: center; }
}

/* =========================================================
   Motion
   ========================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1240px) {
  .brief-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .genre-grid, .style-grid { grid-template-columns: repeat(3, 1fr); }
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .shot-row { grid-template-columns: 44px 100px minmax(150px, 1fr) minmax(110px, .7fr) 105px 48px 36px; gap: 9px; }
}
@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 212px minmax(0, 1fr); }
  .content { padding: 30px 26px 70px; }
  .topbar { padding: 0 24px; }
  .brief-layout { grid-template-columns: 1fr; }
  .brief-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .aside-quote { align-self: start; }
  .script-layout { grid-template-columns: 1fr; }
  .script-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .prompt-layout { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 16px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-block { padding-bottom: 14px; }
  .new-project { position: absolute; top: 18px; right: 18px; width: auto; padding: 0 14px; }
  .step-nav { flex-direction: row; margin-top: 12px; gap: 4px; overflow-x: auto; }
  .step-link { flex: 1; min-width: 110px; padding: 8px 9px; gap: 8px; }
  .step-link::before { left: 10px; right: 10px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .step-copy small { display: none; }
  .project-block { display: none; }
  .sidebar-foot { flex-direction: row; align-items: center; gap: 3px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .side-link { width: auto; padding: 7px 8px; }
  .side-link span:not(.side-dot) { display: none; }
  .version-line { margin-left: auto; padding: 0; }
  .topbar { top: 0; height: 56px; padding: 0 18px; }
  .crumb { display: none; }
  .content { padding: 24px 18px 60px; }
  .brief-head { display: block; padding-bottom: 24px; }
  .head-stamp { display: none; }
  .brief-head h1 { font-size: 38px; }
  .brief-aside { grid-template-columns: 1fr; }
  .aside-quote { display: none; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .cast-grid { grid-template-columns: 1fr 1fr; }
  .page-head { display: block; }
  .page-actions { justify-content: flex-start; margin-top: 14px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .script-aside { grid-template-columns: 1fr; }
  .prompt-layout { grid-template-columns: 1fr; }
  .prompt-list { position: static; max-height: 230px; }
  .prompt-platforms { grid-template-columns: 1fr; }
  .shot-row { grid-template-columns: 38px 88px minmax(140px, 1fr) 90px 40px; }
  .shot-row > :nth-child(4), .shot-row > :nth-child(6) { display: none; }
  .shot-row.is-head > :nth-child(4), .shot-row.is-head > :nth-child(6) { display: none; }
}
@media (max-width: 620px) {
  .content { padding: 20px 14px 55px; }
  .card { padding: 18px; border-radius: 15px; }
  .brief-head h1 { font-size: 32px; }
  .brief-head p { font-size: 12px; }
  .genre-grid, .style-grid { grid-template-columns: 1fr 1fr; }
  .genre-card { min-height: 68px; padding: 10px; }
  .style-card { min-height: 74px; }
  .input-foot { align-items: flex-start; flex-direction: column-reverse; }
  .example-chips { justify-content: flex-start; }
  .spec-grid, .cast-grid { grid-template-columns: 1fr; }
  .platform-row { grid-template-columns: 1fr; }
  .top-actions .btn-ghost { display: none; }
  .top-actions .save-pill { display: none; }
  .project-title-input { font-size: 15px; }
  .board-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .shot-table { overflow-x: auto; }
  .shot-row { min-width: 620px; }
  .prompt-meta { grid-template-columns: 1fr 1fr; }
  .guidance-grid { grid-template-columns: 1fr; }
  .form-grid, .settings-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .settings-grid .span-2 { grid-column: span 1; }
  .export-grid { grid-template-columns: 1fr; }
  .drawer-foot { align-items: flex-start; flex-direction: column; }
  .drawer-foot .group { width: 100%; }
  .drawer-foot .group .btn { flex: 1; }
  .modal-card { max-height: 92vh; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .scene-card { padding: 18px; }
  .story-card { padding: 18px; }
  .story-title { font-size: 27px; }
  .toast-stack { right: 12px; bottom: 12px; }
}
