@font-face {
  font-family: Geist;
  src: url('/assets/geist-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --sans: "Noto Sans CJK SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: Geist, "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --base: #f6f6f6;
  --side: #fff;
  --raised: #f5f7fb;
  --line: #e2e8f0;
  --edge: #cbd5e1;
  --muted: #526176;
  --text: #0f172a;
  --focus: #3d50c9;
  --lav: #6544ab;
  --teal: #047857;
  --danger: #af283d;
  --selected: #eeefff;
  --selected-line: #b8befa;
  --accent-gradient: linear-gradient(110deg,#5445c9,#4058d2);
  --shadow: 0 3px 14px #1726470a;
  --gold: var(--focus);
  --lilac: var(--lav);
  --bg: var(--base);
  --panel: var(--side);
  --border: var(--line);
  --ink: var(--text);
  --serif: var(--display);
  accent-color: var(--focus);
  font-family: var(--sans);
}
body,body.studio-page {color:var(--text);background:var(--base);--paper:#fff}
body { -webkit-font-smoothing:antialiased }
h1,h2,h3,.brand,.studio-brand,.subbrand,.card-foot,.workspace-meta,.player output,.scene-clock output {font-family:var(--display)}
button,input,textarea,select {font-family:inherit}
:focus-visible {outline:3px solid #5362d9;outline-offset:3px}
::selection {background:#dedaff;color:#1e1853}
button,select,input:not([type=range]),textarea {color:var(--text);border-color:var(--edge);border-radius:8px;background-color:#fff}
input::placeholder,textarea::placeholder {color:#657185;opacity:1}
input:focus-visible,textarea:focus-visible,select:focus-visible {outline:2px solid #7163d8;outline-offset:1px}
button:not(:disabled):hover,.secondary:hover:not(:disabled) {border-color:#9ca8c5}
:is(.primary,.studio-page .primary,.button.primary,.action.primary) {color:#fff;background:var(--accent-gradient);border:1px solid transparent;border-radius:9px;font-weight:650;box-shadow:0 3px 10px #5361c525}
:is(.primary,.studio-page .primary,.button.primary,.action.primary):hover:not(:disabled) {color:#fff;background:linear-gradient(110deg,#493abd,#3449c0);box-shadow:0 4px 14px #5361c53a}
.studio-page .secondary,.secondary,.icon {color:#334155;background:#fff;border-color:var(--edge)}
.studio-page .secondary:hover:not(:disabled),.secondary:hover:not(:disabled) {color:var(--focus);background:#f6f6ff;border-color:#a7aee6}
.studio-header,.toolbar,.top {background:#ffffffed;border-color:var(--line)}
.studio-bar {min-height:68px}
.studio-brand,.brand {color:#22273a;font-weight:710;letter-spacing:-.02em}
.studio-brand i,.mark {position:relative;display:inline-block;flex:none;width:27px;height:27px;border:0;border-radius:9px;background:linear-gradient(145deg,#7250e3 15%,#7167ec 50%,#56bdec);box-shadow:inset 0 0 0 1px #ffffff36}
.studio-brand i::before,.mark::before {content:"";position:absolute;inset:7px 8px;border-radius:4px 6px 4px 6px;background:#fff;transform:skewX(-12deg)}
.mark::after {display:none}
.subbrand {color:#536177;font-weight:530;border-left:1px solid var(--line);padding-left:12px;letter-spacing:0}
.utility-nav a,.utility-link,.back-link {color:#46536a}
.utility-nav a:hover,.utility-link:hover,.back-link:hover,.studio-entry:hover {color:var(--focus)}
.library-page {--content:1220px}
.library-head,.empty-library .library-head {
  position:relative;isolation:isolate;overflow:hidden;
  border:1px solid #dfe3f2;border-radius:20px;
  padding:clamp(25px,4.5vw,54px);
  background:radial-gradient(ellipse at 82% 0%,#ddeaff 0%,transparent 50%),radial-gradient(ellipse at 63% 120%,#e9e2ff 0%,transparent 60%),linear-gradient(105deg,#fff 8%,#f8f7fd 75%);
}
.library-head h1,.compose-page h1,.editor-title h1 {letter-spacing:-.035em;font-weight:680}
.library-head .action {position:relative;min-height:44px}
.project-card,.form-sheet,.writing-main,.writing-idea,.release-check,.release-details,.skill-list,.skill-detail,.film-columns>section,.film-columns>aside,#film-final,.asset-card {border:1px solid var(--line);border-radius:14px;background:var(--paper,#fff);box-shadow:var(--shadow)}
.project-card {transition:box-shadow .18s,border-color .18s}
.project-card:hover,.project-card:focus-visible {border-color:#a9b4ea;box-shadow:0 7px 22px #24345a15}
.project-badge {color:#38416a;background:#edf0fa;border-radius:4px}
.remove-work {color:var(--muted);background:var(--paper);border:1px solid var(--edge);border-radius:7px}
.remove-work:hover,.danger {color:#fff;background:#ab2b45}
.card-content {padding:18px 19px}
.card-foot {margin-top:calc(12px + var(--project-card-space));border-top:1px solid var(--line)}
.form-sheet label,.writing-view label,.fields label,dialog label {color:#344155}
.plain-details summary,.rule-box>summary {color:#435071}
.form-sheet,.writing-view,.release-view {line-height:1.6}
.form-sheet :is(select,input),.writing-view :is(select,input) {min-height:42px}
dialog {border-radius:16px;border:1px solid var(--line);background:#fff;box-shadow:0 20px 75px #17203e3b}
dialog::backdrop {background:#0f172a66}
.editor-shell {display:grid;grid-template-columns:clamp(148px,13vw,208px) minmax(0,1fr);max-width:1920px;min-height:calc(100dvh - 68px);margin:auto}
#editor-sidebar {background:#f8fafc;border-right:1px solid var(--line);min-width:0}
#editor-sidebar .step-nav {position:sticky;top:20px}
#editor-steps {display:flex;flex-direction:column;gap:6px;height:auto;margin:0;border:0;padding:20px 12px;overflow:visible}
#editor-steps a {display:flex;align-items:center;gap:11px;min-height:44px;padding:9px 13px;color:#455469;letter-spacing:.01em;border:1px solid transparent;border-radius:9px}
#editor-steps a::before {content:"";width:8px;height:8px;flex:none;border:1.6px solid currentColor;border-radius:3px}
#editor-steps a:hover {color:var(--focus);background:#ecf0f7}
#editor-steps a[aria-current] {color:#3e44ad;background:#eaeaff;border-color:#dcdffb}
#editor-steps a[aria-current]::before {background:#625bd4;border-color:#625bd4}
.editor-shell .editor-page {width:100%;min-width:0;max-width:none;padding-inline:clamp(16px,2.35vw,40px)}
.editor-title {margin-bottom:18px}
.editor-page .desk {background:#fff;border-radius:14px}
.editor-page .workspace {background:#fff}
.scene-list button.current,.projects button.current,.tabs button[aria-pressed=true],.skill-list button[aria-pressed=true],#film-scenes [aria-pressed=true] {color:#3d44a9;background:var(--selected);border-color:var(--selected-line)}
.board,.graph-viewport {background:#f7f8fc radial-gradient(#c5cde0 1px,transparent 1px) 0 0/17px 17px;scrollbar-color:#bcc6d8 #f7f8fc}
.map-node {background:#fff;border:1px solid #b3bed3;border-radius:8px;box-shadow:0 2px 5px #2331510c}
.map-node.ending {border-color:#6da993}
.map-node.selected {background:#eeecff;border-color:#7464cc}
.rule-box,.option-row,.skill-missing,.skill-code {background:#f8f9fc;border-color:var(--line)}
.rule-row {border-color:var(--line)}
.rule-box>summary small {color:#55637a}
.agent-skills li {border-color:#d7cef0;background:#f8f5ff}
.skill-list {scrollbar-color:#bbc5d6 #f7f8fb}
.skill-list button:hover {border-color:#b7c3dd}
.editor-page .film-page {padding:0}
#editor-drawer {position:fixed;inset:0 auto 0 0;margin:0;width:min(280px,82vw);max-width:none;max-height:none;height:100dvh;padding:18px 10px;border:0;border-radius:0 16px 16px 0;background:#f8fafc}
#editor-menu-close {display:block;margin:0 10px 4px auto}
#editor-drawer #editor-steps {padding:12px 6px}
#editor-menu {white-space:nowrap;font-weight:600}
.canvas-mode #editor-sidebar {display:none}
.canvas-mode .editor-shell {display:block;max-width:none;min-height:0}
.canvas-mode .editor-shell .editor-page {padding:0}
.canvas-mode #film {background:#fbfcff}
#canvas-project,#canvas-heading label,.board-bar label {color:var(--muted)}
.canvas-task {color:var(--teal)}
#canvas-heading select,.board-bar select {background:#fff;border-color:var(--edge);color:var(--text)}
#film-tab-canvas {border-color:var(--line)}
.board-bar,.board-zoom,#canvas-detail {color:var(--text);background:#fffffff5;border-color:#cbd4e3;box-shadow:0 4px 18px #0f172a13}
.board-zoom button,#canvas-detail-close,.board-zoom output,#canvas-detail h3 {color:#41516a}
.board-zoom button:hover,#canvas-detail-close:hover {background:var(--selected)}
.board-zoom .board-fit,#canvas-detail>header {border-color:var(--line)}
.film-node {--tone:#6350bc;background:white;color:#17253b;border-color:#c4ccdb;box-shadow:0 5px 16px #20325913}
.film-node.image {--tone:#126f73}.film-node.audio {--tone:#9f3c6a}.film-node.config {--tone:#355eae}.film-node.group {--tone:#8a5517;background:#fffdfa}
.film-node:hover {color:#12233c}
.node-head {background:color-mix(in srgb,var(--tone) 7%,white);border-color:var(--line)}
.node-state,.node-foot,.node-placeholder,.node-sound,.node-video,.node-group-copy,.node-copy,.node-group-copy>span,#film-inspector p {color:#4c5b71}
.node-state.ready {color:var(--teal)}.node-state.failed {color:var(--danger)}.node-state.submitted {color:#915a08}
.node-media,.asset-thumb {background:#eff2f8}
.node-film-format {color:#344f82;background:#edf3ff}
.node-group-copy b {color:#80511b}
.node-foot,.node-sound {border-color:var(--edge)}.node-socket {background:#fff}
body:not(.studio-page) .top {background:#fff}
.screen,.decision,.timeline,.variable-trace {border-radius:14px;box-shadow:var(--shadow);overflow:hidden}
.player {background:#fff}.player output,.map-controls,#chapter-text {color:#45546c}
.player input {background:linear-gradient(90deg,var(--focus) var(--p,0%),#dce2ec var(--p,0%)) center/100% 4px no-repeat}
.pick,.map-controls button,.node,.audience-variables>div,.variable-trace span {background:#fff;color:#24314b;border-color:var(--edge);border-radius:7px}
.pick:hover:not(:disabled),.node.current {color:var(--text);border-color:var(--focus);background:var(--selected)}
.key {background:#eeebfc;color:#6544ab}
.node small {color:#526483}.node.locked {color:#5a687b;background:#f3f5f9;border-color:#bcc5d3}
.node.seen {border-color:#9d86c4}.node.on-path {border-color:#7970b6}
.node.current {border-color:var(--focus);box-shadow:0 0 0 2px #5c66cb2b}
.preview-note {color:#4c4097;background:#f0edff;border-color:#d8d4ee}
.foot {border-color:var(--line)}
.hero,.poster,.feature {background:var(--paper,#fff);color:var(--text);border-color:var(--line);border-radius:14px}
.hero h1,.poster h3,.feature h1 {font-family:var(--display);font-weight:640}
.button.ghost {color:#364260;background:#fff;border-color:var(--edge)}
.button.ghost:hover {background:#f0f0ff;border-color:var(--selected-line);color:var(--focus)}
#choice-buttons .pick {background:#201b32ec;color:white;border-color:#b1a8c3}
#choice-buttons .pick:hover,#choice-buttons .pick:focus-visible {background:#3b3151;color:white;border-color:#bca9ff}
.choice-panel .key {color:#fff;background:#4f4566}
@media(max-width:1080px) {
  .editor-shell {display:block;min-height:0}
  #editor-sidebar {display:none}
  .editor-shell .editor-page {padding-inline:clamp(12px,2.7vw,26px)}
  .studio-bar:has(#editor-menu) {gap:8px}
  .studio-bar:has(#editor-menu) .save-actions {margin-left:auto}
}
@media(max-width:660px) {
  .studio-bar {min-height:56px}
  .studio-bar:has(#editor-menu) .back-link {font-size:.83rem}
  #editor-menu {font-size:.85rem;padding:6px 8px}
  .library-head {align-items:stretch}
  .library-head .action {align-self:flex-start}
  .editor-title {margin-bottom:12px}
  .editor-page .workspace {order:1}.editor-page .inspector {order:2}
}
.mode-picker {margin:0 0 20px;padding:0;border:0;min-width:0}
.mode-picker legend {font-weight:650;padding:0;margin-bottom:8px}
.mode-options {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mode-options label,.form-sheet .mode-options label {display:flex;align-items:center;gap:9px;cursor:pointer;padding:12px 13px;margin:0;border:1px solid var(--edge);border-radius:10px;background:#fff}
.mode-options label:has(input:checked) {border-color:#9b98e8;background:#f2f1ff}
.mode-options input[type=radio] {margin:0;padding:0;width:17px;height:17px;min-height:0;flex:none}
.mode-options strong,.mode-options small {display:block}.mode-options small {margin-top:2px;color:var(--muted);font-size:.78rem}
#refined-room {display:grid;gap:14px;align-content:start}
#refined-room>button {justify-self:start}
#refined-room .plain-details,#refined-room .form-actions,#refined-room .message {margin:0}
#refined-room .message:empty {display:none}
#refined-original {font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;max-height:18rem;overflow:auto;padding:12px;background:var(--raised)}
#refined-proposals {display:grid;gap:10px}
.direction {display:grid;gap:6px;background:#fcfcff;border:1px solid var(--line);border-radius:10px;padding:13px 16px}
.direction.chosen {border-color:#9997e6;background:#f3f2ff}
.direction h3,.direction h4 {margin:0;font-size:1rem}.direction h4 {font-size:.88rem;margin-top:.5rem}
.direction p,.talk p {white-space:pre-wrap;overflow-wrap:anywhere;color:#3d4c62}
.direction button {justify-self:start}.direction summary {cursor:pointer;color:var(--focus);font-size:.88rem}
.selected-note {color:var(--focus);font-size:.85rem;font-weight:600}
#refined-manuscript label,#refined-composer label {margin-top:0}
#refined-text {min-height:270px}
#refined-chat {border-top:1px solid var(--line);padding-top:14px}
#refined-history {display:grid;gap:8px;max-height:420px;overflow:auto;margin-block:10px}
.talk {max-width:92%;padding:10px 12px;justify-self:start;background:#f2f5f9;border-radius:10px}
.talk.author {justify-self:end;background:#f0ecff}.talk strong {font-size:.8rem;color:#514799}
#refined-composer button {margin-top:6px}
@media(max-width:500px){.mode-options label,.form-sheet .mode-options label {padding:9px;gap:6px}.mode-options small {font-size:.75rem}}
#new-project {border-radius:999px;padding:11px 22px;background:linear-gradient(105deg,#a4378d,#7341d2 72%,#6441c6);box-shadow:0 4px 13px #7753ac38}
#new-project:hover {background:linear-gradient(105deg,#922979,#6536c2)}
#editor-steps a::before {width:13px;height:13px;border-radius:3px;box-sizing:border-box;opacity:.94}
#editor-steps a[data-view=write]::before {background:linear-gradient(currentColor,currentColor) 2px 3px/6px 1px no-repeat,linear-gradient(currentColor,currentColor) 2px 6px/4px 1px no-repeat}
#editor-steps a[data-view=scenes]::before {border:0;border-radius:0;background:linear-gradient(currentColor,currentColor) 0 5px/4px 4px no-repeat,linear-gradient(currentColor,currentColor) 9px 1px/4px 4px no-repeat,linear-gradient(currentColor,currentColor) 9px 9px/4px 4px no-repeat,linear-gradient(currentColor,currentColor) 6px 3px/1px 8px no-repeat,linear-gradient(currentColor,currentColor) 6px 3px/4px 1px no-repeat,linear-gradient(currentColor,currentColor) 6px 10px/4px 1px no-repeat,linear-gradient(currentColor,currentColor) 3px 6px/4px 1px no-repeat}
#editor-steps a[data-view=produce]::before {background:repeating-linear-gradient(118deg,transparent 0 2px,currentColor 3px 4px) 0 0/100% 3px no-repeat}
#editor-steps a[data-view=release]::before {border-radius:50%;background:currentColor;clip-path:polygon(0 0,100% 0,100% 100%,0 100%,0 0,36% 24%,36% 76%,75% 50%,36% 24%,0 0);border:0}
#source-upload {margin-top:15px}
#refined-source {margin-top:18px}
#source-file::file-selector-button {border:1px solid var(--edge);background:#f5f6fc;color:var(--text);padding:5px 10px;border-radius:6px;margin-inline-end:10px}
.skill-detail,.skill-content p,.skill-content li,.skill-content :not(pre)>code {overflow-wrap:anywhere}
.skill-code {white-space:pre;overflow:auto}

/* A collapsed rail gives part of its width to the scene list and the rest to the stage. */
#editor-rail {position:sticky;top:12px;padding-top:12px}
#editor-sidebar #editor-steps {position:static;padding-top:8px}
#editor-menu {margin:0 12px;display:flex;align-items:center;gap:10px;min-height:36px;padding:6px 12px;border:0;border-radius:7px;background:transparent;color:#526074}
#editor-menu:hover {background:#e9edf5;color:var(--focus)}
.rail-chevron {display:block;width:9px;height:9px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
.rail-collapsed .rail-chevron {transform:rotate(225deg)}
.editor-shell.rail-collapsed {grid-template-columns:60px minmax(0,1fr)}
.rail-collapsed #editor-sidebar .nav-label {display:none}
.rail-collapsed #editor-menu {justify-content:center;width:40px;margin:0 auto;padding:0}
.rail-collapsed #editor-sidebar #editor-steps {padding:8px 6px}
.rail-collapsed #editor-sidebar #editor-steps a {justify-content:center;padding:0}
.rail-collapsed #editor-sidebar #editor-steps a::before {transform:scale(1.25)}
@media(min-width:1081px){
  .editor-shell.rail-collapsed .desk {grid-template-columns:clamp(220px,18vw,272px) minmax(0,1fr) minmax(265px,340px)}
}
@media(max-width:1080px){
  body:not(.canvas-mode) .editor-shell {display:grid;grid-template-columns:48px minmax(0,1fr)}
  body:not(.canvas-mode) #editor-sidebar {display:block}
  .rail-collapsed #editor-sidebar #editor-steps {padding:8px 3px}
  #editor-rail {top:4px;padding-top:8px}
}
@media(min-width:951px) and (max-width:1080px){
  .editor-shell.rail-collapsed .desk {grid-template-columns:clamp(187px,19vw,211px) minmax(0,1fr) minmax(255px,300px)}
}
@media(max-width:950px){
  #scenes button {width:clamp(146px,39vw,195px)}
}
