:root {
  --bg: #0e1316;
  --bg-soft: #12191d;
  --surface: #182126;
  --surface-2: #202a30;
  --surface-3: #27343a;
  --line: #324149;
  --line-soft: #26343a;
  --text: #edf3ef;
  --muted: #a6b3b1;
  --faint: #718087;
  --teal: #82d8c4;
  --teal-strong: #46bca4;
  --amber: #efb861;
  --red: #e57f76;
  --blue: #79afe1;
  --green-bg: #19352f;
  --amber-bg: #392f20;
  --red-bg: #3b2629;
  --shadow: 0 18px 48px rgba(0, 0, 0, .22);
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; letter-spacing: 0; }
.visual-direction-status { grid-column: 1 / -1; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.inline-visual-direction { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 8px 12px; min-width: 0; }
.inline-visual-direction label { min-width: 0; }
.inline-visual-direction select, .inline-visual-direction textarea { width: 100%; min-width: 0; height: 38px; min-height: 38px; }
.inline-visual-direction textarea { resize: vertical; max-height: 160px; }
.inline-visual-direction button { justify-self: start; min-height: 32px; white-space: nowrap; }
.inline-visual-direction .visual-direction-status { grid-column: 2; align-self: center; }
.inline-visual-direction[data-visual-direction-controls="intake"] { grid-template-columns: minmax(0, 1fr); }
.inline-visual-direction[data-visual-direction-controls="intake"] .visual-direction-status { grid-column: 1; }
.visual-style-reference { min-width: 0; display: grid; gap: 7px; }
.visual-style-reference-actions { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; }
.inline-visual-direction .visual-style-reference-preview { flex: 0 0 38px; width: 38px; height: 38px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.visual-style-reference-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.visual-direction-text { grid-column: 1 / -1; min-width: 0; color: var(--muted); font-size: 12px; }
.visual-direction-text summary { cursor: pointer; }
.visual-direction-text[open] label { margin-top: 8px; }
@media (max-width: 700px) {
  .inline-visual-direction { grid-template-columns: minmax(0, 1fr); }
  .inline-visual-direction .visual-direction-status { grid-column: 1; }
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--teal); text-decoration: none; }

.studio-shell { min-height: 100vh; display: flex; }
.side-nav { position: sticky; top: 0; width: 248px; flex: 0 0 248px; height: 100vh; display: flex; flex-direction: column; padding: 18px 13px 14px; background: #11171a; border-right: 1px solid var(--line-soft); z-index: 10; }
.brand-block { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-block .side-nav-close { display: none; margin-left: auto; flex: 0 0 34px; }
.brand-mark { flex: 0 0 36px; display: grid; place-items: center; width: 36px; height: 36px; color: var(--teal); border: 1px solid #5ea999; font-size: 12px; font-weight: 800; }
.brand-block strong, .brand-block small { display: block; }
.brand-block strong { font-size: 15px; }
.brand-block small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.project-summary { width: 100%; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; text-align: left; }
.project-summary:hover { border-color: #5b7077; background: var(--surface-2); }
.project-symbol { display: grid; place-items: center; width: 32px; height: 32px; color: #dff7f1; background: #31524d; border-radius: 4px; font-size: 11px; font-weight: 700; }
.project-summary small, .project-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-summary small { color: var(--muted); font-size: 10px; }
.project-summary strong { margin-top: 3px; font-size: 12px; }
.project-arrow { color: var(--muted); font-size: 18px; }
.project-library-body { min-height: 180px; }
.project-library-list { display: grid; gap: 8px; margin-top: 13px; }
.project-library-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; background: #12191d; border: 1px solid var(--line-soft); border-radius: 5px; }
.project-library-item.current { border-color: #4f897e; background: #1c302e; }
.project-library-item strong, .project-library-item small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-library-item strong { color: var(--text); font-size: 13px; }
.project-library-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.project-library-item button { flex: 0 0 auto; min-width: 84px; }
.project-library-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.project-library-item { flex-wrap:wrap; }
.project-library-item > div:first-child { flex:1 1 160px; min-width:0; }
.project-library-actions { flex-wrap:wrap; flex-shrink:1; max-width:100%; min-width:0; }
.project-library-actions [data-project-rename] { display:inline-flex; align-items:center; justify-content:center; gap:5px; }
.project-library-actions [data-project-rename] svg { width:14px; height:14px; }
#projectRenameDialog { width:min(440px,calc(100vw - 32px)); }
#projectRenameInput { display:block; width:100%; margin-top:10px; }
#projectRenameError { color:var(--red); }

.stage-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 15px; overflow-y: auto; }
.stage-nav-item { width: 100%; min-height: 52px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 7px 8px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; text-align: left; }
.stage-nav-item:hover { color: var(--text); background: #1a2327; }
.stage-nav-item.active { color: var(--text); background: #203737; border-color: #38615c; }
.stage-nav-item.complete .nav-step { color: #10201d; background: var(--teal); border-color: var(--teal); }
.stage-nav-item.stale em { color: var(--amber); }
.stage-nav-item.locked { opacity: .68; }
.nav-step { display: grid; place-items: center; width: 28px; height: 28px; color: #b8c4c1; background: #252f34; border: 1px solid #46565d; border-radius: 50%; font: 700 11px/1 Consolas, monospace; }
.stage-nav-item strong, .stage-nav-item small { display: block; }
.stage-nav-item strong { color: inherit; font-size: 12px; }
.stage-nav-item small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.stage-nav-item em { color: var(--faint); font-size: 9px; font-style: normal; white-space: nowrap; }
.stage-nav-item.active em { color: var(--teal); }

.side-footer { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid var(--line-soft); }
.local-indicator { display: flex; align-items: center; gap: 7px; }
.local-indicator > span { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 3px rgba(130,216,196,.12); }
.local-indicator strong { font-size: 11px; }
.local-indicator em { margin-left: auto; color: var(--teal); font-size: 9px; font-style: normal; }
.side-footer > small { display: block; margin: 8px 0 10px 14px; color: var(--faint); font-size: 10px; line-height: 1.45; }
.side-footer a { margin-left: 14px; font-size: 10px; }

.studio-main { min-width: 0; flex: 1; background: var(--bg-soft); }
.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: rgba(14, 19, 22, .95); border-bottom: 1px solid var(--line-soft); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-left > div span, .topbar-left > div strong { display: block; }
.topbar-left > div span { color: var(--faint); font-size: 10px; }
.topbar-left > div strong { margin-top: 2px; font-size: 13px; }
.local-badge { padding: 4px 7px; color: var(--teal); background: #1b3531; border: 1px solid #315e56; border-radius: 4px; font-size: 10px; }
.local-badge.ready { color: #c9f7ea; background: #1b3d35; border-color: #4b887b; }
.local-badge.checking { color: #c7ddff; background: #19283a; border-color: #3b5c84; }
.local-badge.blocked { color: #ffe0ac; background: var(--amber-bg); border-color: #6a5330; }
.save-state { color: var(--muted); font-size: 11px; }
.mobile-nav-button { display: none; width: 34px; height: 34px; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 5px; }

.outline-button, .primary-button, .quiet-button, .danger-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 5px; font-size: 12px; font-weight: 650; }
.outline-button { color: var(--text); background: transparent; border: 1px solid var(--line); }
.outline-button:hover { background: var(--surface-2); border-color: #62757c; }
.primary-button { color: #10211e; background: var(--teal); border: 1px solid #a7ecdd; }
.primary-button:hover { background: #a9eadc; }
.quiet-button { color: var(--muted); background: transparent; border: 1px solid transparent; }
.quiet-button:hover { color: var(--text); background: var(--surface-2); }
.danger-button { color: #ffd6d1; background: var(--red-bg); border: 1px solid #704247; }
.icon-button { width: 34px; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line); }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.global-pipeline { display: flex; align-items: stretch; gap: 14px; margin: 16px 22px 0; padding: 12px 13px; background: #151d21; border: 1px solid var(--line); border-radius: 7px; }
.pipeline-copy { width: 160px; flex: 0 0 160px; display: flex; flex-direction: column; justify-content: center; padding-right: 12px; border-right: 1px solid var(--line); }
.pipeline-copy strong, .pipeline-copy small { display: block; }
.pipeline-copy strong { font-size: 13px; }
.pipeline-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pipeline-steps { min-width: 0; flex: 1; display: grid; grid-template-columns: repeat(7, minmax(92px,1fr)); gap: 5px; overflow-x: auto; }
.pipeline-step { min-height: 51px; display: grid; grid-template-columns: 24px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 7px; align-content: center; padding: 7px; color: var(--muted); background: #111719; border: 1px solid #2d3b41; border-radius: 5px; text-align: left; }
.pipeline-step:hover { color: var(--text); border-color: #566a72; }
.pipeline-step > span { grid-row: 1 / 3; display: grid; place-items: center; width: 24px; height: 24px; align-self: center; color: #bac5c2; background: #273237; border: 1px solid #46565c; border-radius: 50%; font: 700 10px/1 Consolas, monospace; }
.pipeline-step strong { font-size: 11px; }
.pipeline-step small { color: var(--faint); font-size: 9px; }
.pipeline-step.active { color: #effffb; background: #203b38; border-color: #4f897e; }
.pipeline-step.complete > span { color: #10201d; background: var(--teal); border-color: var(--teal); }
.pipeline-step.stale small { color: var(--amber); }

.view-root { padding: 22px 22px 36px; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.view-heading-copy > span { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-size: 11px; font-weight: 700; }
.view-heading h1 { margin: 7px 0 5px; font-size: 25px; line-height: 1.15; }
.view-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.view-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.notice-band { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 11px 13px; color: #d5e3df; background: #192328; border: 1px solid #35474f; border-radius: 5px; font-size: 12px; line-height: 1.5; }
.notice-band strong { color: var(--teal); white-space: nowrap; }
.notice-band.warn { background: var(--amber-bg); border-color: #6a5330; }
.notice-band.warn strong { color: var(--amber); }
.notice-band.error { background: var(--red-bg); border-color: #714248; }
.notice-band.error strong { color: var(--red); }
.notice-band.series-rerun-confirmation { flex-direction: column; align-items: stretch; }
.notice-band.series-plan-status { flex-direction: column; align-items: stretch; }
.series-plan-status strong, .series-plan-status small { white-space: normal; overflow-wrap: anywhere; }
.series-plan-status .button-row { flex-wrap: wrap; }
.series-rerun-confirmation > strong { white-space: normal; }
.series-rerun-confirmation > span { min-width: 0; overflow-wrap: anywhere; }
.series-rerun-confirmation .button-row { justify-content: flex-end; flex-wrap: wrap; }
.series-rerun-confirmation .button-row > button { flex: 0 1 auto; max-width: 100%; min-height: 36px; }

.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 7px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head h2 { font-size: 16px; }
.panel-head h3 { font-size: 14px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.panel-body { padding: 15px 16px; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.section-label { display: block; margin-bottom: 7px; color: var(--faint); font-size: 10px; font-weight: 700; text-transform: uppercase; }

label { display: block; color: var(--muted); font-size: 12px; }
input, select, textarea { width: 100%; margin-top: 6px; color: var(--text); background: #111719; border: 1px solid #394950; border-radius: 4px; }
input, select { height: 38px; padding: 0 10px; }
textarea { min-height: 110px; padding: 10px 11px; resize: vertical; line-height: 1.65; }
input:hover, select:hover, textarea:hover { border-color: #5b7078; }
.field-grid { display: grid; gap: 11px; }
.field-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.field-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field-help { display: block; margin-top: 5px; color: var(--faint); font-size: 10px; line-height: 1.4; }

.intake-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(290px,.7fr); gap: 14px; }
.source-mode-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.source-mode { min-height: 94px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 12px; color: var(--muted); background: #151c20; border: 1px solid #34434a; border-radius: 6px; text-align: left; }
.source-mode:hover { color: var(--text); border-color: #61757c; }
.source-mode.active { color: var(--text); background: #203a37; border-color: #579387; }
.source-mode span { color: var(--teal); font: 800 12px/1 Consolas, monospace; }
.source-mode strong { font-size: 13px; }
.source-mode small { color: var(--faint); font-size: 10px; line-height: 1.35; }
.source-editor { min-height: 310px; margin-top: 12px; }
.source-editor textarea { min-height: 240px; font-size: 13px; }
.file-drop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding: 10px 11px; color: var(--muted); background: #131a1e; border: 1px dashed #44565e; border-radius: 5px; font-size: 11px; }
.idea-development-panel { margin: 18px -16px -15px; padding: 16px; background: #141d21; border-top: 1px solid var(--line); }
.idea-development-panel.confirmed { background: #162622; border-top-color: #3f7268; }
.idea-development-panel.interrupted, .idea-development-panel.error { background: #241f19; border-top-color: #6a5330; }
.idea-development-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.idea-development-head span { color: var(--teal); font-size: 10px; font-weight: 750; }
.idea-development-head h3 { margin: 5px 0 0; font-size: 15px; }
.idea-development-head em { flex: 0 0 auto; padding: 4px 7px; color: var(--amber); background: var(--amber-bg); border: 1px solid #6a5330; border-radius: 4px; font-size: 10px; font-style: normal; }
.idea-development-panel.confirmed .idea-development-head em { color: var(--teal); background: var(--green-bg); border-color: #3f7268; }
.idea-development-panel > p { max-width: 760px; margin: 11px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.idea-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.idea-field-grid .wide { grid-column: 1 / -1; }
.idea-field-grid label { position: relative; }
.idea-field-grid label > span { float: right; color: var(--teal); font-size: 9px; font-weight: 700; }
.idea-field-grid textarea { min-height: 82px; }
#ideaEpisodeBeatsField { min-height: 150px; }
.idea-timing-plan { display: grid; gap: 8px; margin-top: 6px; }
.idea-timing-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.idea-timing-title strong { font-size: 12px; }
.idea-timing-title span { color: var(--muted); font-size: 10px; }
.idea-timing-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 10px; padding: 10px; background: #11191d; border: 1px solid var(--line-soft); border-radius: 5px; }
.idea-timing-meta { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.idea-timing-meta strong { font-size: 11px; }
.idea-timing-meta b { color: var(--teal); font-size: 11px; }
.idea-timing-budget { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.idea-timing-budget span { padding: 3px 6px; color: var(--muted); background: #182328; border: 1px solid var(--line-soft); border-radius: 3px; font-size: 9px; }
.idea-timing-row label { font-size: 10px; }
.idea-timing-row textarea { min-height: 70px; margin-top: 5px; }
.idea-timing-plan.legacy pre { max-height: 220px; margin: 0; padding: 10px; overflow: auto; color: var(--muted); background: #11191d; border: 1px solid var(--line-soft); white-space: pre-wrap; }
.idea-development-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.idea-development-foot > span { color: var(--faint); font-size: 10px; }
.creative-addition-review { margin-top: 10px; padding: 11px; background: #11191d; border: 1px solid var(--line); border-radius: 5px; }
.creative-addition-review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.creative-addition-review-head strong { font-size: 11px; }
.creative-addition-review-head span { color: var(--amber); font-size: 10px; font-weight: 700; }
.creative-addition-list { display: grid; gap: 6px; margin-top: 9px; }
.creative-addition-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px; color: var(--muted); background: #182328; border: 1px solid var(--line-soft); border-radius: 4px; cursor: pointer; font-size: 10px; line-height: 1.45; }
.creative-addition-item input { flex: 0 0 auto; width: 14px; height: 14px; margin: 1px 0 0; accent-color: var(--teal); }
.creative-addition-item span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.creative-addition-item b { color: var(--teal); }
.creative-addition-item em { flex: 0 0 auto; color: var(--amber); font-size: 9px; font-style: normal; }
.creative-addition-item:has(input:checked) { border-color: #3f7268; background: #162622; }
.creative-addition-item:has(input:checked) em { color: var(--teal); }
.idea-history { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.idea-history > strong { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.idea-history > div { display: flex; flex-wrap: wrap; gap: 6px; }
.idea-history button { min-height: 30px; padding: 0 9px; font-size: 10px; }
.idea-history-stale { color: var(--muted); }
.idea-history-stale summary { cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.idea-history-stale summary:hover { color: var(--text); }
.idea-history-stale > p { margin: 8px 0; color: var(--faint); font-size: 10px; line-height: 1.45; }
.idea-history-stale-item { display: flex; flex-direction: column; gap: 3px; min-width: 180px; padding: 8px 9px; color: var(--muted); background: #11191d; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 10px; }
.idea-history-stale-item strong { color: var(--text); font-size: 10px; }
.idea-history-stale-item span { color: var(--amber); font-size: 9px; }
.idea-operation-error { margin: 11px 0 12px; flex-wrap: wrap; }
.idea-operation-error strong { white-space: normal; }
.idea-operation-error span { min-width: 0; overflow-wrap: anywhere; }
.idea-fidelity-audit { margin-top: 13px; padding: 12px 0 0 13px; border-top: 1px solid var(--line-soft); border-left: 3px solid var(--red); }
.idea-fidelity-audit.adoptable { border-left-color: var(--amber); }
.idea-fidelity-audit.recommended { border-left-color: var(--teal); }
.idea-fidelity-score { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.idea-fidelity-score > div { display: flex; align-items: baseline; gap: 10px; }
.idea-fidelity-score span { color: var(--muted); font-size: 10px; font-weight: 700; }
.idea-fidelity-score strong { color: var(--red); font: 800 25px/1 Consolas, monospace; }
.idea-fidelity-audit.adoptable .idea-fidelity-score strong { color: var(--amber); }
.idea-fidelity-audit.recommended .idea-fidelity-score strong { color: var(--teal); }
.idea-fidelity-score small { margin-left: 2px; color: var(--faint); font-size: 10px; }
.idea-fidelity-score em { padding: 4px 7px; color: var(--red); background: var(--red-bg); border: 1px solid #704046; border-radius: 4px; font-size: 9px; font-style: normal; font-weight: 700; }
.idea-fidelity-audit.adoptable .idea-fidelity-score em { color: var(--amber); background: var(--amber-bg); border-color: #6a5330; }
.idea-fidelity-audit.recommended .idea-fidelity-score em { color: var(--teal); background: var(--green-bg); border-color: #3f7268; }
.idea-fidelity-audit > p { margin: 9px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.idea-fidelity-audit details { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line-soft); }
.idea-fidelity-audit summary { color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.idea-fidelity-audit summary:hover { color: var(--text); }
.idea-fidelity-audit ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.idea-fidelity-audit li { display: grid; gap: 3px; padding: 8px 9px; background: #11191d; border-left: 2px solid var(--line); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.idea-fidelity-audit li strong { color: var(--text); }
.idea-fidelity-audit li span, .idea-fidelity-audit li small { color: var(--muted); }
.idea-fidelity-audit li em { color: var(--teal); font-style: normal; }
.idea-fidelity-blockers { margin: 10px 0; }
.idea-fidelity-blockers > strong { color: var(--red); font-size: 10px; }
.idea-fidelity-blockers li { border-left-color: var(--red); }
.idea-fidelity-evidence .table-wrap { max-height: 280px; margin-top: 8px; overflow: auto; border: 1px solid var(--line-soft); }
.idea-fidelity-evidence table { min-width: 760px; border-collapse: collapse; font-size: 9px; }
.idea-fidelity-evidence th, .idea-fidelity-evidence td { padding: 7px 8px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.idea-fidelity-evidence th { position: sticky; top: 0; color: var(--muted); background: #172126; z-index: 1; }
.idea-fidelity-evidence td { color: var(--muted); }
.idea-fidelity-evidence dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 9px 0 0; }
.idea-fidelity-evidence dl > div { min-width: 0; }
.idea-fidelity-evidence dt { color: var(--faint); font-size: 9px; }
.idea-fidelity-evidence dd { margin: 2px 0 0; color: var(--muted); font: 9px/1.45 Consolas, monospace; overflow-wrap: anywhere; }
.idea-fidelity-usage { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--faint); font-size: 9px; }
.intake-checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.check-item:last-child { border-bottom: 0; }
.check-mark { flex: 0 0 22px; display: grid; place-items: center; width: 22px; height: 22px; color: var(--teal); background: var(--green-bg); border: 1px solid #3b695f; border-radius: 50%; font-size: 10px; }
.check-item strong, .check-item small { display: block; }
.check-item strong { font-size: 12px; }
.check-item small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.writer-stack-status { padding: 11px; background: #12191d; border: 1px solid var(--line); border-radius: 5px; }
.writer-stack-status.ready { border-color: #3f7268; }
.writer-stack-status.blocked { border-color: #6a5330; }
.writer-stack-head { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 8px; align-items: center; padding-bottom: 9px; border-bottom: 1px solid var(--line-soft); }
.connection-dot { width: 8px; height: 8px; background: var(--amber); border-radius: 50%; }
.writer-stack-status.ready .connection-dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(130,216,196,.12); }
.writer-stack-status.checking .connection-dot { background: var(--blue); }
.writer-stack-head strong { font-size: 12px; }
.writer-stack-head small { color: var(--faint); font-size: 11px; }
.writer-model-row { display: grid; grid-template-columns: 55px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.writer-model-row span, .writer-model-row em { color: var(--muted); font-size: 11px; font-style: normal; }
.writer-model-row strong { font-size: 12px; }
.writer-model-row em { color: var(--amber); }
.writer-stack-status.ready .writer-model-row em { color: var(--teal); }
.writer-stack-status .button-row { margin-top: 10px; }
.writer-stack-status .button-row > button { flex: 1; }
.writer-audit-summary { margin-top: 10px; padding: 9px; background: #182328; border: 1px solid var(--line-soft); border-radius: 4px; }
.writer-audit-summary div { display: flex; justify-content: space-between; gap: 10px; }
.writer-audit-summary span { color: var(--muted); font-size: 11px; }
.writer-audit-summary strong { color: var(--teal); font-size: 12px; }
.writer-audit-summary p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.repair-run-panel { margin-bottom: 14px; padding: 14px; background: #151d21; border: 1px solid var(--line); border-radius: 7px; }
.repair-run-panel.passed { border-color: #3f7268; }
.repair-run-panel.failed, .repair-run-panel.error { border-color: #714248; }
.repair-run-panel.generating, .repair-run-panel.repairing { border-color: #496b88; }
.repair-run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.repair-run-head > div:last-child { text-align: right; }
.repair-run-head span, .repair-run-head strong, .repair-run-head small { display: block; }
.repair-run-head span { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; }
.repair-run-head h2 { margin: 5px 0 0; font-size: 15px; }
.repair-run-head > div:last-child strong { font-size: 11px; }
.repair-run-head > div:last-child small { margin-top: 4px; color: var(--faint); font-size: 11px; }
.repair-run-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.repair-run-metrics span { min-width: 0; padding: 7px 8px; color: var(--faint); background: #11181c; border: 1px solid var(--line-soft); border-radius: 3px; font-size: 10px; }
.repair-run-metrics strong { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.repair-run-message { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.structure-score-overview,
.structure-review-overview { display: grid; grid-template-columns: 118px minmax(0, 1fr) 280px; gap: 16px; align-items: stretch; padding: 14px; background: #11191d; border: 1px solid var(--line-soft); border-radius: 6px; }
.structure-score-overview.recommended,
.structure-review-overview.recommended,
.structure-score-overview.ready,
.structure-review-overview.ready { border-color: #3f7268; }
.structure-score-overview.usable,
.structure-review-overview.usable { border-color: #7d6a39; }
.structure-score-overview.blocked,
.structure-review-overview.blocked { border-color: #714248; }
.structure-score-number,
.structure-review-version { display: flex; justify-content: center; flex-direction: column; min-height: 96px; padding-right: 14px; border-right: 1px solid var(--line-soft); }
.structure-score-number span,
.structure-review-version span { color: var(--faint); font-size: 10px; }
.structure-score-number strong,
.structure-review-version strong { margin-top: 5px; color: var(--text); font-size: 32px; line-height: 1; }
.structure-score-number strong small { margin-left: 3px; color: var(--faint); font-size: 12px; font-weight: 600; }
.structure-score-copy,
.structure-review-copy { align-self: center; min-width: 0; }
.structure-score-copy > span,
.structure-review-copy > span { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; }
.structure-score-copy h2,
.structure-review-copy h2 { margin: 5px 0 0; font-size: 18px; }
.structure-score-copy p,
.structure-review-copy p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.structure-score-copy em,
.structure-review-copy em { display: inline-block; margin-top: 8px; padding: 4px 7px; color: #d7e7ef; background: #20303a; border: 1px solid #3c5666; border-radius: 3px; font-size: 11px; font-style: normal; font-weight: 700; }
.structure-score-overview.recommended .structure-score-copy em,
.structure-review-overview.recommended .structure-review-copy em,
.structure-score-overview.ready .structure-score-copy em,
.structure-review-overview.ready .structure-review-copy em { color: #d9fff3; background: var(--green-bg); border-color: #3f7268; }
.structure-score-overview.usable .structure-score-copy em,
.structure-review-overview.usable .structure-review-copy em { color: #ffe9ad; background: var(--amber-bg); border-color: #7d6a39; }
.structure-score-overview.warning .structure-score-copy em,
.structure-review-overview.warning .structure-review-copy em { color: #ffe9ad; background: var(--amber-bg); border-color: #7d6a39; }
.structure-score-overview.blocked .structure-score-copy em,
.structure-review-overview.blocked .structure-review-copy em { color: #ffd9d5; background: var(--red-bg); border-color: #714248; }
.structure-score-policy,
.structure-review-stats { display: grid; grid-template-columns: 1fr; gap: 6px; align-content: center; }
.structure-score-policy > div,
.structure-review-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; background: #172126; border: 1px solid var(--line-soft); border-radius: 4px; }
.structure-score-policy span,
.structure-review-stats span { color: var(--muted); font-size: 11px; }
.structure-score-policy strong,
.structure-review-stats strong { color: var(--text); font-size: 12px; }
.structure-score-policy > div:last-child strong,
.structure-review-stats > div:last-child strong { color: var(--teal); }
.structure-technical-details { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.structure-technical-details > summary { min-height: 40px; padding: 12px 2px 0; color: var(--blue); cursor: pointer; font-size: 11px; }
.structure-technical-details > summary small { float: right; color: var(--faint); font-size: 10px; }
.structure-technical-details-body { padding-top: 10px; }
.structure-technical-status { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 10px; background: #11191d; border: 1px solid var(--line-soft); border-radius: 4px; }
.structure-technical-status strong { font-size: 11px; }
.structure-technical-status span { color: var(--muted); font-size: 11px; text-align: right; }
.structure-attempt-advice { display: grid; gap: 3px; margin-top: 9px; padding: 8px 9px; background: #182227; border-left: 3px solid var(--blue); }
.structure-attempt-advice strong { font-size: 11px; }
.structure-attempt-advice span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.structure-attempt-advice.recommended { background: var(--green-bg); border-left-color: var(--teal); }
.structure-attempt-advice.usable { background: var(--amber-bg); border-left-color: var(--amber); }
.structure-attempt-advice.warning { background: var(--amber-bg); border-left-color: var(--amber); }
.structure-attempt-advice.blocked { background: var(--red-bg); border-left-color: var(--red); }
.structure-attempt-details { margin-top: 9px; border: 1px solid var(--line-soft); border-radius: 4px; }
.structure-attempt-details > summary { min-height: 36px; padding: 9px; color: var(--blue); cursor: pointer; font-size: 11px; }
.structure-attempt-details > summary small { float: right; color: var(--faint); font-size: 10px; }
.structure-attempt-details-body { padding: 0 9px 9px; border-top: 1px solid var(--line-soft); }
.structure-attempt-details-body .repair-dimensions { margin-top: 9px; }
.structure-attempt-details-body > footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 9px; padding-top: 8px; color: var(--faint); border-top: 1px solid var(--line-soft); font-size: 10px; }
.structure-operation-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px 18px; align-items: center; margin-top: 11px; padding: 11px 12px; background: #11191d; border: 1px solid #496b88; border-radius: 5px; }
.structure-operation-progress > div:first-child strong, .structure-operation-progress > div:first-child span, .structure-operation-progress > div:nth-child(2) span, .structure-operation-progress > div:nth-child(2) small { display: block; }
.structure-operation-progress > div:first-child strong { color: #d8edf9; font-size: 12px; }
.structure-operation-progress > div:first-child span { margin-top: 4px; color: var(--blue); font-size: 11px; }
.structure-operation-progress > div:nth-child(2) { min-width: 145px; text-align: right; }
.structure-operation-progress > div:nth-child(2) span { color: var(--text); font-size: 11px; }
.structure-operation-progress > div:nth-child(2) small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.structure-operation-progress p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.structure-operation-progress.completed { border-color: #3f7268; }
.structure-operation-progress.uncertain { border-color: #8a6436; }
.repair-next-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; background: #182227; border: 1px solid var(--line-soft); border-radius: 5px; }
.repair-next-actions strong, .repair-next-actions small { display: block; }
.repair-next-actions strong { font-size: 12px; }
.repair-next-actions small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.repair-next-actions button { min-height: 36px; white-space: nowrap; }
.repair-attempts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.repair-attempt { min-width: 0; padding: 11px; background: #11181c; border: 1px solid var(--line-soft); border-radius: 6px; }
.repair-attempt.accepted { border-color: #3f7268; }
.repair-attempt.selectable { border-color: #7d6a39; }
.repair-attempt.rejected { border-color: #5d4145; }
.repair-attempt > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.repair-attempt > header span, .repair-attempt > header strong { display: block; }
.repair-attempt > header span { color: var(--faint); font-size: 10px; }
.repair-attempt > header strong { margin-top: 3px; font-size: 13px; }
.repair-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.repair-badges em, .repair-badges b { padding: 3px 5px; border-radius: 3px; font-size: 10px; font-style: normal; }
.repair-badges em { color: #dcecff; background: #20334a; border: 1px solid #3f5c7c; }
.repair-badges b { color: #ffd9d5; background: var(--red-bg); border: 1px solid #704247; }
.repair-attempt.accepted .repair-badges b { color: #d9fff3; background: var(--green-bg); border-color: #3f7268; }
.repair-attempt.selectable .repair-badges b { color: #ffe9ad; background: var(--amber-bg); border-color: #7d6a39; }
.repair-summary { min-height: 48px; margin: 9px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.repair-dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.repair-dimension { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; padding: 5px 6px; background: #182227; border: 1px solid var(--line-soft); border-radius: 3px; }
.repair-dimension span { overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.repair-dimension strong { color: var(--text); font-size: 12px; }
.repair-dimension strong small { margin-left: 4px; color: var(--faint); font-size: 10px; font-weight: 600; }
.repair-dimension.target-gap { background: #302b1f; border-color: #695d35; }
.repair-dimension.target-gap strong { color: #ffe6a3; }
.repair-dimension.failed { background: var(--red-bg); border-color: #704247; }
.repair-dimension.failed strong { color: #ffd9d5; }
.repair-issues { display: grid; gap: 5px; margin-top: 8px; }
.repair-issue { padding: 7px; background: #182126; border-left: 3px solid var(--blue); }
.repair-issue.blocking { background: var(--red-bg); border-left-color: var(--red); }
.repair-issue.major { background: var(--amber-bg); border-left-color: var(--amber); }
.repair-issue > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.repair-issue strong { font-size: 11px; }
.repair-issue em { color: var(--faint); font-size: 10px; font-style: normal; }
.repair-issue p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.repair-issue small { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; line-height: 1.4; }
.repair-empty { padding: 8px; color: var(--teal); background: var(--green-bg); border: 1px solid #315e56; border-radius: 4px; font-size: 11px; }
.repair-change-block { margin-top: 9px; }
.repair-change-block > strong { color: var(--muted); font-size: 11px; }
.repair-change-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.repair-change-list span { padding: 4px 6px; color: #c6dff6; background: #1b2a38; border: 1px solid #30485d; border-radius: 3px; font-size: 11px; }
.repair-evidence-block { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.repair-evidence-block > strong { color: var(--teal); font-size: 11px; }
.repair-evidence-list { display: grid; gap: 8px; margin-top: 7px; }
.repair-evidence-item { min-width: 0; padding-left: 8px; border-left: 2px solid #3f7268; }
.repair-evidence-item > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.repair-evidence-item b { color: #d9fff3; font-size: 10px; }
.repair-evidence-item span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.repair-evidence-item small { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 5px; margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.repair-evidence-item em { color: var(--muted); font-style: normal; }
.repair-script-details { margin-top: 9px; border: 1px solid var(--line-soft); border-radius: 4px; }
.repair-script-details summary { padding: 8px; color: var(--blue); font-size: 11px; cursor: pointer; }
.repair-script-details pre { max-height: 320px; margin: 0; padding: 10px; overflow: auto; color: var(--text); background: #0d1417; border-top: 1px solid var(--line-soft); font: 12px/1.7 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.repair-adopt-row { min-height: 34px; margin-top: 10px; display: flex; align-items: center; }
.repair-adopt-button { width: 100%; min-height: 34px; }
.repair-adopt-blocked { width: 100%; min-height: 34px; display: flex; align-items: center; justify-content: center; padding: 6px 9px; color: var(--faint); background: #0d1417; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 10px; }
.repair-attempt > footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 9px; padding-top: 8px; color: var(--faint); border-top: 1px solid var(--line-soft); font-size: 10px; }
.formal-audit-dimensions { margin: 10px 0; }
.audit-strengths { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.audit-strengths span { padding: 5px 7px; color: #d9fff3; background: var(--green-bg); border: 1px solid #315e56; border-radius: 3px; font-size: 11px; }
.repair-pending { grid-column: 1 / -1; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); border: 1px dashed var(--line); }
.repair-pending span { width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: repair-spin .8s linear infinite; }
.repair-pending.stopped { flex-direction: column; gap: 5px; padding: 12px; text-align: center; border-color: #714248; }
.repair-pending.stopped strong { color: #ffd7db; font-size: 12px; }
.repair-pending.stopped small { max-width: 680px; color: var(--muted); font-size: 11px; line-height: 1.5; }
@keyframes repair-spin { to { transform: rotate(360deg); } }

.stat-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.stat-item { padding: 11px 12px; background: #151d21; border: 1px solid var(--line-soft); border-radius: 5px; }
.stat-item span, .stat-item strong { display: block; }
.stat-item span { color: var(--muted); font-size: 10px; }
.stat-item strong { margin-top: 5px; font-size: 17px; }

.script-layout { display: grid; grid-template-columns: 230px minmax(360px,1fr) 290px; gap: 12px; align-items: start; }
.script-layout .notice-band { display: grid; grid-template-columns: minmax(0, 1fr); }
.script-layout .notice-band strong { white-space: normal; overflow-wrap: anywhere; }
.script-layout .notice-band span { min-width: 0; overflow-wrap: anywhere; }
.scene-tree { max-height: calc(100vh - 250px); overflow-y: auto; }
.tree-section { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); }
.tree-section > strong { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.tree-item { width: 100%; display: block; padding: 8px 9px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; text-align: left; }
.tree-item:hover { color: var(--text); background: var(--surface-2); }
.tree-item.active { color: var(--text); background: #213a38; border-color: #426d65; }
.tree-item strong, .tree-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item strong { font-size: 11px; }
.tree-item small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.script-scene-location { min-height: 34px; padding: 8px 16px; color: #b8ddd4; background: #102022; border-bottom: 1px solid var(--line-soft); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.script-editor { min-height: calc(100vh - 280px); padding: 15px 16px; }
.script-editor textarea { min-height: calc(100vh - 370px); font: 13px/1.85 Consolas, "Microsoft YaHei", monospace; transition: border-color 160ms ease, box-shadow 160ms ease; }
.script-editor textarea.scene-located { border-color: #5f9b8e; box-shadow: 0 0 0 2px rgba(95, 155, 142, .18); }
.version-list { display: flex; flex-direction: column; gap: 7px; }
.version-item { padding: 9px; background: #151d21; border: 1px solid var(--line-soft); border-radius: 4px; }
.version-item strong, .version-item small { display: block; }
.version-item strong { font-size: 11px; }
.version-item small { margin-top: 4px; color: var(--faint); font-size: 9px; }

.analysis-layout { display: grid; grid-template-columns: 250px minmax(380px,1fr) 310px; gap: 12px; align-items: start; }
.entity-tabs { display: flex; gap: 4px; padding: 9px; border-bottom: 1px solid var(--line-soft); }
.entity-tab { flex: 1; min-height: 30px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: 10px; }
.entity-tab.active { color: var(--text); background: #243a3a; border-color: #416663; }
.entity-list { max-height: 560px; padding: 8px; overflow-y: auto; }
.entity-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; text-align: left; }
.entity-item:hover { background: var(--surface-2); }
.entity-item.active { color: var(--text); background: #203836; border-color: #416a63; }
.entity-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-item em { color: var(--faint); font-size: 9px; font-style: normal; }
.analysis-records { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: 620px; overflow-y: auto; }
.analysis-record { padding: 11px; background: #151d21; border: 1px solid var(--line-soft); border-radius: 5px; }
.analysis-record.selected { border-color: #548b80; background: #1c302e; }
.analysis-record-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.analysis-record-head strong { font-size: 12px; }
.confidence { padding: 3px 5px; color: var(--teal); background: var(--green-bg); border-radius: 3px; font-size: 9px; }
.confidence.low { color: var(--amber); background: var(--amber-bg); }
.analysis-record p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.source-trace { padding: 13px; background: #101619; border: 1px solid #2c3a40; border-radius: 5px; }
.source-trace pre { max-height: 420px; margin: 9px 0 0; overflow: auto; color: #d1ddd9; font: 11px/1.75 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; }
.source-highlight { color: #17201e; background: var(--teal); }
.issue-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.issue-item { padding: 8px 9px; color: #e6c48f; background: var(--amber-bg); border: 1px solid #5e492c; border-radius: 4px; font-size: 10px; line-height: 1.45; }

.storyboard-layout { display: grid; grid-template-columns: 220px minmax(340px,1fr) minmax(430px,520px); gap: 12px; align-items: start; }
.scene-source-list { max-height: 640px; padding: 8px; overflow-y: auto; }
.storyboard-center { min-width: 0; }
.storyboard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.shot-stack { display: flex; flex-direction: column; gap: 7px; padding: 10px; max-height: 640px; overflow-y: auto; }
.shot-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 9px; color: var(--muted); background: #151d21; border: 1px solid var(--line-soft); border-radius: 5px; text-align: left; }
.shot-row:hover { border-color: #52666d; }
.shot-row.active { color: var(--text); background: #203735; border-color: #4f8278; }
.shot-id { display: grid; place-items: center; width: 48px; height: 36px; color: var(--teal); background: #1b2a2a; border: 1px solid #35534e; border-radius: 4px; font: 700 10px/1 Consolas, monospace; }
.shot-row strong, .shot-row small { display: block; }
.shot-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.shot-row small { margin-top: 5px; color: var(--faint); font-size: 10px; }
.shot-row em { color: var(--amber); font-size: 10px; font-style: normal; white-space: nowrap; }
.shot-detail-form { display: flex; flex-direction: column; gap: 10px; padding: 13px; }
.source-link { padding: 9px; color: #c8d7d3; background: #111719; border: 1px solid #2f3e44; border-radius: 4px; font-size: 10px; line-height: 1.55; }
.performance-editor { margin: 4px -2px 0; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.performance-editor-head, .performance-beat-head, .performance-character-head, .prop-change-head, .performance-beat-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.performance-editor-head p { margin: 4px 0 0; color: var(--faint); font-size: 10px; line-height: 1.45; }
.performance-audit { flex: 0 0 auto; padding: 4px 7px; border: 1px solid; border-radius: 4px; font-size: 10px; font-weight: 700; }
.performance-audit.passed { color: var(--teal); background: var(--green-bg); border-color: #3f7268; }
.performance-audit.pending { color: #ead49b; background: #332e21; border-color: #6f6239; }
.performance-audit.failed { color: #f1b9ad; background: #3a2422; border-color: #7b4741; }
.performance-inline-issue { margin-top: 9px; padding: 8px 9px; color: #f1c4bb; background: #30201f; border-left: 3px solid #a65a50; font-size: 10px; line-height: 1.5; }
.performance-beat-list { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.performance-beat-editor { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.performance-beat-head strong, .performance-beat-head small { display: block; }
.performance-beat-head strong { font-size: 12px; }
.performance-beat-head small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.performance-time-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.character-performance-list { margin-top: 11px; }
.character-performance-editor { padding: 10px 0 10px 10px; border-left: 2px solid #3d625c; }
.character-performance-editor + .character-performance-editor { margin-top: 8px; }
.performance-character-head strong { color: var(--text); font-size: 11px; }
.performance-character-head span { color: var(--faint); font-size: 9px; }
.performance-field-grid, .performance-state-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.performance-field-grid .wide, .performance-state-grid .wide { grid-column: 1 / -1; }
.performance-field-grid textarea { min-height: 64px; }
.performance-state-details { margin-top: 9px; padding-top: 8px; border-top: 1px dashed #34464c; }
.performance-state-details summary { cursor: pointer; color: #a9bbb7; font-size: 10px; }
.performance-state-details > strong { display: block; margin-top: 9px; color: var(--faint); font-size: 9px; }
.prop-change-list { margin-top: 10px; }
.prop-change-editor { padding: 10px 0 10px 10px; border-left: 2px solid #715f3e; }
.prop-change-editor + .prop-change-editor { margin-top: 8px; }
.prop-change-head strong { color: #dfc18a; font-size: 10px; }
.icon-text-button { min-height: 28px; padding: 4px 7px; color: var(--muted); background: transparent; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 9px; }
.icon-text-button:hover { color: var(--text); border-color: #63757b; }
.performance-beat-actions { justify-content: flex-start; margin: 9px 0; }
.performance-editor-actions { margin-top: 11px; }
.budget-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.budget-summary div { padding: 8px; background: #151d21; border: 1px solid var(--line-soft); border-radius: 4px; }
.budget-summary span, .budget-summary strong { display: block; }
.budget-summary span { color: var(--muted); font-size: 9px; }
.budget-summary strong { margin-top: 4px; font-size: 13px; }

.asset-groups { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.asset-create-panel { margin-bottom: 12px; }
.asset-create-form { display: grid; grid-template-columns: 120px minmax(180px,.7fr) minmax(260px,1.4fr) auto; gap: 10px; align-items: end; }
.asset-list { display: flex; flex-direction: column; }
.asset-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.asset-row:last-child { border-bottom: 0; }
.asset-symbol { display: grid; place-items: center; width: 34px; height: 34px; color: #d5eee8; background: #284640; border-radius: 4px; font-size: 11px; font-weight: 700; }
.asset-row strong, .asset-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-row strong { font-size: 12px; }
.asset-row small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.asset-anchor-field { min-width: 0; }
.asset-anchor-field p { overflow-wrap: anywhere; }
.asset-anchor-field input { margin-top: 5px; }
.asset-row-actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.asset-row-actions .quiet-button { min-height: 28px; }
.status-button { min-height: 29px; padding: 0 8px; color: var(--amber); background: var(--amber-bg); border: 1px solid #5e492c; border-radius: 4px; font-size: 10px; }
.status-button.approved { color: var(--teal); background: var(--green-bg); border-color: #3c685f; }
.person-asset-library { margin-top: 12px; }
.person-asset-toolbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 10px; }
.person-asset-toolbar label { min-width: 0; }
.person-asset-preview { display: block; width: 100%; padding: 0; border: 0; background: transparent; }
.person-asset-pagination { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.person-asset-documents { margin-top: 14px; }
.person-asset-documents > div { display: flex; flex-direction: column; max-height: 250px; overflow: auto; align-items: flex-start; }
.person-asset-documents button { text-align: left; overflow-wrap: anywhere; }
.person-asset-document { margin-top: 12px; }
.person-asset-document .person-asset-prompt { max-height: 400px; font: 12px/1.7 inherit; }
.person-asset-selected { display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; margin: 8px 0 10px; padding: 8px 10px; color: var(--muted); background: #151d21; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 10px; line-height: 1.45; }
.person-asset-selected strong { color: var(--text); }
.person-asset-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.person-asset-item { min-width: 0; overflow: hidden; background: #111719; border: 1px solid var(--line-soft); border-radius: 4px; }
.person-asset-item.selected { border-color: #548b80; background: #172724; }
.person-asset-item img { display: block; width: 100%; aspect-ratio: 1 / 1.15; object-fit: contain; background: #0d1316; }
.person-asset-meta { min-width: 0; padding: 7px 8px 0; }
.person-asset-meta strong, .person-asset-meta small { display: block; overflow-wrap: anywhere; }
.person-asset-meta strong { font-size: 11px; }
.person-asset-meta small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.person-asset-actions { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 8px 8px; }
.person-asset-actions button { min-height: 27px; font-size: 9px; }
.person-asset-prompt { max-height: 150px; margin: 0 8px 8px; padding: 7px; overflow: auto; color: var(--muted); background: #0d1316; border: 1px solid var(--line-soft); white-space: pre-wrap; font: 9px/1.45 Consolas, monospace; }

.production-readiness { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 0 14px; padding: 0; overflow: hidden; background: #151d21; border: 1px solid var(--line-soft); border-radius: 5px; list-style: none; }
.production-readiness li { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 9px; align-items: center; min-height: 62px; padding: 10px 12px; border-right: 1px solid var(--line-soft); }
.production-readiness li:last-child { border-right: 0; }
.production-readiness li > span { display: grid; place-items: center; width: 28px; height: 28px; color: var(--faint); background: #263137; border: 1px solid #45565d; border-radius: 50%; font: 700 10px/1 Consolas, monospace; }
.production-readiness strong, .production-readiness small { display: block; }
.production-readiness strong { font-size: 12px; }
.production-readiness small { margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.4; }
.production-readiness li.current { background: var(--amber-bg); }
.production-readiness li.current > span { color: #19140c; background: var(--amber); border-color: var(--amber); }
.production-readiness li.complete { background: var(--green-bg); }
.production-readiness li.complete > span { color: #10201d; background: var(--teal); border-color: var(--teal); }
.production-readiness li.blocked > span { color: #241315; background: var(--red); border-color: var(--red); }
.production-layout { display: grid; grid-template-columns: 220px minmax(400px,1fr) 330px; gap: 12px; align-items: start; }
.episode-production-layout { grid-template-columns: 220px minmax(400px,1fr) 330px; }
.production-layout > * { min-width: 0; }
.production-shot-list { max-height: 670px; padding: 8px; overflow-y: auto; }
.production-preview { min-height: 340px; display: grid; grid-template-columns: minmax(180px,250px) minmax(0,1fr); gap: 18px; align-items: center; padding: 18px; background: #111719; }
.preview-frame { width: min(100%, 230px); aspect-ratio: 9/16; margin: 0 auto; overflow: hidden; background: #0d1316; border: 1px solid #4d646b; border-radius: 3px; }
.preview-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.production-media-empty { width: min(100%,230px); aspect-ratio: 9/16; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin: 0 auto; padding: 20px; color: var(--muted); background: #0d1316; border: 1px dashed #53666d; border-radius: 3px; text-align: center; }
.production-media-empty span { color: var(--teal); font-size: 10px; font-weight: 700; }
.production-media-empty strong { color: var(--text); font-size: 14px; }
.production-media-empty small { max-width: 170px; color: var(--faint); font-size: 10px; line-height: 1.55; }
.preview-copy h2 { margin: 0 0 7px; font-size: 18px; }
.preview-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.spec-table { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.spec-table div { padding: 8px; background: #182126; border: 1px solid var(--line-soft); border-radius: 4px; }
.spec-table span, .spec-table strong { display: block; }
.spec-table span { color: var(--faint); font-size: 9px; }
.spec-table strong { margin-top: 4px; font-size: 11px; }
.production-settings-panel { min-width: 0; overflow: hidden; }
.production-reference-control { display: grid; grid-template-columns: minmax(0,1fr) 74px; gap: 10px; align-items: center; margin: 0 13px 12px; padding: 11px; background: #121a1e; border: 1px solid var(--line-soft); border-radius: 5px; }
.production-reference-copy { min-width: 0; }
.production-reference-copy span, .production-reference-copy strong, .production-reference-copy small { display: block; }
.production-reference-copy span { color: var(--teal); font-size: 10px; font-weight: 700; }
.production-reference-copy strong { margin-top: 4px; font-size: 12px; }
.production-reference-copy small { margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.production-reference-preview-button, .production-reference-empty { grid-row: 1 / 3; grid-column: 2; width: 74px; aspect-ratio: 9 / 16; background: #0a0f12; border: 1px solid #42535a; border-radius: 3px; }
.production-reference-preview-button { display: block; min-height: 0; padding: 0; overflow: hidden; cursor: zoom-in; }
.production-reference-preview-button:hover, .production-reference-preview-button:focus-visible { border-color: #78aa9f; box-shadow: 0 0 0 2px rgba(82,142,129,.2); }
.production-reference-preview-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.production-reference-empty { display: grid; place-items: center; padding: 7px; color: var(--faint); font-size: 9px; text-align: center; }
.production-reference-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.production-reference-actions .outline-button, .production-reference-actions .primary-button, .production-reference-actions .quiet-button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.production-reference-control:has(#adoptFirstFrameImageButton) { border-color: #53776f; }
.production-reference-control:has(#adoptFirstFrameImageButton) .production-reference-preview-button { border-color: #70a79b; box-shadow: 0 0 0 2px rgba(82,142,129,.16); }
.episode-generation-settings { display: grid; gap: 10px; margin: 0 13px 12px; padding: 11px; background: #121a1e; border: 1px solid var(--line-soft); border-radius: 5px; }
.episode-generation-settings .native-audio-toggle { margin: 0; }
.episode-generation-settings > .field-help { display: block; line-height: 1.45; }
.production-prompt-block { min-width: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.production-prompt-block .section-label { padding: 0 13px; }
.episode-prompt-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 10px; }
.episode-prompt-heading .section-label { min-width: 0; margin: 0; }
.episode-prompt-heading button { flex: 0 0 auto; }
.production-video { display: block; width: 100%; max-height: 260px; margin-top: 10px; background: #080d0f; border: 1px solid var(--line-soft); border-radius: 4px; }
.production-video-preview { width: min(100%,250px); max-height: 440px; margin: 0 auto; }
.production-take-record { overflow: hidden; }
.production-take-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.production-take-actions button { min-height: 34px; }
.production-segment-row { display: flex; align-items: stretch; gap: 8px; }
.production-segment-row .tree-item { flex: 1 1 auto; min-width: 0; }
.production-segment-row > .outline-button { flex: 0 0 auto; align-self: center; }
.video-error { color: var(--red); }
.production-cost-notice { margin: 0 13px 13px; }
.prompt-output { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; min-height: 250px; max-height: 410px; margin: 0; padding: 13px; overflow: auto; overflow-wrap: anywhere; word-break: break-word; color: #cfe0db; background: #0e1417; font: 11px/1.7 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; }
.combat-prompt-library { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.combat-prompt-toolbar { display: grid; grid-template-columns: minmax(0,.7fr) minmax(0,1.3fr); gap: 8px; margin: 10px 0; }
.combat-prompt-toolbar label { min-width: 0; }
.combat-prompt-results { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow: auto; padding: 7px; background: #101719; border: 1px solid var(--line-soft); }
.combat-prompt-result { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 7px 8px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 3px; text-align: left; }
.combat-prompt-result:hover, .combat-prompt-result.active { background: #1b2a2a; border-color: #477268; }
.combat-prompt-result strong, .combat-prompt-result small { display: block; max-width: 100%; overflow-wrap: anywhere; }
.combat-prompt-result strong { font-size: 11px; }
.combat-prompt-result small { color: var(--faint); font-size: 9px; }
.combat-prompt-detail { margin-top: 9px; padding: 9px; background: #101719; border: 1px solid var(--line-soft); }
.combat-prompt-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.combat-prompt-detail-head strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.combat-prompt-detail > small { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }
.combat-prompt-detail pre { max-height: 220px; margin: 9px 0 0; padding: 8px; overflow: auto; color: #cfe0db; background: #0d1316; white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.6 Consolas, "Microsoft YaHei", monospace; }
.combat-prompt-detail .field-help { margin: 7px 0 0; }
.generation-state { display: flex; align-items: center; gap: 8px; padding: 9px; color: var(--muted); background: #151d21; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 11px; }
.generation-state span { width: 7px; height: 7px; background: var(--amber); border-radius: 50%; }

.delivery-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 12px; }
.delivery-timeline { padding: 14px; overflow-x: auto; }
.timeline-track { min-width: 720px; display: flex; gap: 3px; height: 84px; padding: 9px; background: #101619; border: 1px solid #2c3a40; }
.timeline-clip { min-width: 70px; flex: var(--duration, 6); display: flex; flex-direction: column; justify-content: space-between; padding: 8px; color: #dff4ee; background: #294641; border: 1px solid #477268; border-radius: 3px; font-size: 10px; }
.timeline-clip.pending { color: var(--muted); background: #242d31; border-color: #3c494e; }
.post-chain { display: flex; flex-direction: column; }
.post-step { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.post-step:last-child { border-bottom: 0; }
.post-step > span { display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); background: #253037; border: 1px solid #45555c; border-radius: 50%; font-size: 10px; }
.post-step strong, .post-step small { display: block; }
.post-step strong { font-size: 12px; }
.post-step small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.post-step em { color: var(--amber); font-size: 9px; font-style: normal; }

.gate-panel { max-width: 760px; margin: 44px auto; padding: 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.gate-icon { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 13px; color: var(--amber); background: var(--amber-bg); border: 1px solid #6d5530; border-radius: 50%; font-size: 16px; }
.gate-panel h2 { margin: 0; font-size: 18px; }
.gate-panel p { max-width: 570px; margin: 9px auto 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: min(460px,calc(100vw - 32px)); padding: 11px 14px; color: #e8fff8; background: #245149; border: 1px solid #5c9a8d; border-radius: 5px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.warn { color: #ffe0ac; background: #4a3922; border-color: #9a7540; }
.toast.error { color: #ffd4cf; background: #4a2a2e; border-color: #9b555d; }

.assistant-open-button { display: inline-flex; align-items: center; gap: 7px; }
.autopilot-open-button { display: inline-flex; align-items: center; gap: 7px; }
.autopilot-open-button > span { display: grid; place-items: center; width: 22px; height: 22px; color: #0a1214; background: #e1b66f; border-radius: 3px; font-size: 10px; font-weight: 800; }
.autopilot-control-panel { position: fixed; z-index: 88; right: 18px; bottom: 18px; display: grid; width: min(420px, calc(100vw - 36px)); color: var(--text); background: #10191d; border: 1px solid #5a6c70; border-radius: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.42); }
.autopilot-control-panel[hidden] { display: none; }
.autopilot-control-panel header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px; background: #182326; border-bottom: 1px solid var(--line); }
.autopilot-control-panel header span,.autopilot-control-panel header strong { display: block; }
.autopilot-control-panel header span { color: var(--amber); font-size: 9px; font-weight: 750; }
.autopilot-control-panel header strong { margin-top: 3px; font-size: 15px; }
.autopilot-control-body { display: grid; gap: 9px; padding: 14px; }
.autopilot-status-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.autopilot-status-row strong { color: var(--amber); font-size: 13px; }
.autopilot-status-row span,.autopilot-control-body small { color: var(--muted); font-size: 11px; }
.autopilot-control-body p { margin: 0; color: var(--text); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.autopilot-control-body .button-row { margin-top: 2px; }
.autopilot-control-body .button-row button { flex: 1; }
.autopilot-boundary { line-height: 1.5; }
.autopilot-control-panel[data-status="complete"] .autopilot-status-row strong { color: var(--teal); }
.autopilot-control-panel[data-status="blocked"] .autopilot-status-row strong,.autopilot-control-panel[data-status="error"] .autopilot-status-row strong { color: var(--red); }
.assistant-open-button > span { display: grid; place-items: center; width: 22px; height: 22px; color: #0a1214; background: #76c1b1; border-radius: 3px; font-size: 11px; font-weight: 800; }
.studio-assistant-panel[hidden] { display: none; }
.studio-assistant-panel { position: fixed; z-index: 90; top: 0; right: 0; display: flex; width: min(440px,100vw); height: 100vh; height: 100dvh; flex-direction: column; color: var(--text); background: #0e1518; border-left: 1px solid #4c6068; box-shadow: -20px 0 60px rgba(0,0,0,.5); }
.assistant-panel-head { display: flex; min-height: 82px; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px; background: #121c20; border-bottom: 1px solid var(--line); }
.assistant-panel-head > div:first-child { min-width: 0; }
.assistant-panel-head span,.assistant-panel-head h2,.assistant-panel-head small { display: block; }
.assistant-panel-head span { color: var(--teal); font-size: 10px; font-weight: 700; }
.assistant-panel-head h2 { margin: 4px 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.assistant-panel-tools { display: flex; flex: 0 0 auto; gap: 7px; }
.assistant-panel-tools .outline-button { min-height: 34px; padding: 7px 10px; }
.assistant-connection-state { color: var(--faint); font-size: 11px; }
.assistant-connection-state.ready { color: #8ed0c0; }
.assistant-panel-body { min-height: 0; flex: 1; overflow: auto; }
.assistant-error-state { margin: 12px 14px 0; padding: 10px 11px; color: #ffd4cf; background: #342126; border: 1px solid #84515a; border-radius: 4px; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.assistant-consent-panel { padding: 18px; }
.assistant-consent-panel > strong { display: block; font-size: 15px; }
.assistant-consent-panel p { margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.assistant-consent-check { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 9px; align-items: start; margin-bottom: 14px; padding: 11px; color: var(--text); background: #121c20; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 12px; line-height: 1.5; }
.assistant-consent-check input { width: 16px; height: 16px; margin: 1px 0 0; }
.assistant-consent-panel .primary-button { width: 100%; }
.assistant-workspace { min-height: 100%; }
.assistant-quick-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.assistant-quick-actions button { min-width: 0; min-height: 34px; padding: 7px 6px; font-size: 11px; }
.assistant-messages { min-height: 260px; max-height: calc(100dvh - 380px); padding: 14px; overflow: auto; }
.assistant-empty-state { display: grid; gap: 6px; padding: 22px 12px; color: var(--muted); text-align: center; }
.assistant-empty-state strong { color: var(--text); font-size: 14px; }
.assistant-empty-state span { font-size: 12px; line-height: 1.6; }
.assistant-message { width: min(92%,370px); margin-bottom: 12px; padding: 10px 11px; background: #172126; border: 1px solid #2d3c42; border-radius: 6px; }
.assistant-message.user { margin-left: auto; background: #203e39; border-color: #48786e; }
.assistant-message.local { background: #20272a; border-style: dashed; }
.assistant-message-label { display: block; margin-bottom: 5px; color: #82c6b7; font-size: 10px; font-weight: 700; }
.assistant-message.user .assistant-message-label { color: #b5e2d8; }
.assistant-message-content { color: #dce8e4; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.assistant-message-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.assistant-message-actions button { min-height: 32px; padding: 7px 9px; font-size: 11px; white-space: normal; }
.assistant-proposal-list { display: grid; gap: 7px; flex: 1 1 100%; padding: 9px; background: #111a1e; border: 1px solid #4c7067; border-radius: 4px; }
.assistant-proposal-list > strong { color: #b8e9dd; font-size: 11px; }
.assistant-proposal-item { display: grid; gap: 3px; padding-top: 6px; border-top: 1px solid #2d4645; }
.assistant-proposal-item span { color: #e2efeb; font-size: 11px; line-height: 1.45; }
.assistant-proposal-item small { color: #9bb4ae; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.assistant-script-review { margin-top: 4px; border-top: 1px solid #2d4645; }
.assistant-script-review > summary { padding: 7px 0 3px; color: #b8e9dd; cursor: pointer; font-size: 11px; }
.assistant-script-review-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding-top: 5px; }
.assistant-script-review-columns section { min-width: 0; }
.assistant-script-review-columns section > strong { display: block; margin-bottom: 4px; color: #d8e8e3; font-size: 10px; }
.assistant-script-review-columns pre { max-height: 260px; margin: 0; padding: 7px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #2d4645; background: #0b1215; color: #bdcdc8; font: 10px/1.55 ui-monospace, Consolas, monospace; }
@media (max-width: 760px) { .assistant-script-review-columns { grid-template-columns: 1fr; } }
.assistant-message-usage { display: block; margin-top: 7px; color: var(--faint); font-size: 10px; }
.assistant-thinking { margin: 0 0 12px; padding: 10px 11px; color: var(--muted); font-size: 12px; }
.assistant-thinking::before { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--amber); border-radius: 50%; content: ""; }
.assistant-composer { position: sticky; bottom: 0; display: grid; gap: 8px; padding: 13px 14px 15px; background: #111a1e; border-top: 1px solid var(--line); }
.assistant-composer label { color: var(--text); font-size: 12px; font-weight: 700; }
.assistant-composer textarea { box-sizing: border-box; width: 100%; min-height: 92px; max-height: 180px; resize: vertical; }
.assistant-composer small { color: var(--faint); font-size: 10px; line-height: 1.5; }
.assistant-composer .primary-button { width: 100%; }
.assistant-permission-list { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; margin-top: 14px; padding: 11px; background: #12191d; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 11px; }
.assistant-permission-list strong { color: #8ed0c0; }
.assistant-permission-list strong:nth-of-type(n+3) { color: #ffb7ae; }
.assistant-config-actions { flex-wrap: wrap; }
.assistant-config-actions .quiet-button { margin-right: auto; }

@media (min-width: 1000px) {
  body.assistant-panel-open .studio-shell { padding-right: 440px; }
  body.assistant-panel-open .studio-assistant-panel { width: 440px; }
}

dialog { width: min(540px,calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid #4c6068; border-radius: 7px; box-shadow: 0 24px 80px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(3,7,9,.72); }
.episode-prompt-editor-dialog { width: min(1100px,calc(100vw - 24px)); }
.episode-prompt-editor-dialog textarea { box-sizing: border-box; display: block; width: 100%; height: 52vh; height: 52dvh; min-height: 160px; margin: 0; padding: 12px; resize: none; overflow-wrap: anywhere; color: #cfe0db; background: #0e1417; font: 14px/1.7 Consolas, "Microsoft YaHei", monospace; }
.episode-prompt-editor-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.episode-prompt-editor-meta span { overflow-wrap: anywhere; }
.episode-prompt-editor-error { color: #f4aba7; overflow-wrap: anywhere; }
.episode-prompt-editor-error:empty { display: none; }
dialog form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 17px 12px; border-bottom: 1px solid var(--line); }
.dialog-head span { color: var(--teal); font-size: 10px; }
.dialog-head h2 { margin: 5px 0 0; font-size: 17px; }
.dialog-body { min-height: 0; padding: 15px 17px 18px; overflow-y: auto; color: var(--muted); font-size: 12px; line-height: 1.65; }
.dialog-body p { margin: 0 0 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 17px 16px; border-top: 1px solid var(--line); }
.writer-adoption-dialog,.writer-generation-dialog,.video-release-dialog,.video-generation-dialog,.first-frame-image-dialog { width: min(720px,calc(100vw - 32px)); }
.writer-adoption-dialog.dialog-fallback[open],.writer-generation-dialog.dialog-fallback[open],.video-release-dialog.dialog-fallback[open],.video-generation-dialog.dialog-fallback[open],.first-frame-image-dialog.dialog-fallback[open] { position: fixed; inset: 50% auto auto 50%; z-index: 101; display: block; width: min(720px,calc(100vw - 32px)); margin: 0; transform: translate(-50%,-50%); }
body.writer-adoption-fallback-open::before,body.writer-generation-fallback-open::before,body.video-release-fallback-open::before,body.video-generation-fallback-open::before,body.first-frame-image-fallback-open::before { position: fixed; z-index: 100; inset: 0; content: ""; background: rgba(3,7,9,.72); }
.reference-image-viewer-dialog { width: min(1100px,calc(100vw - 32px)); height: min(900px,calc(100dvh - 32px)); max-height: calc(100dvh - 32px); background: #090d0f; }
.reference-image-viewer-dialog.dialog-fallback[open] { position: fixed; inset: 50% auto auto 50%; z-index: 101; display: block; width: min(1100px,calc(100vw - 32px)); height: min(900px,calc(100dvh - 32px)); margin: 0; transform: translate(-50%,-50%); }
body.reference-image-viewer-fallback-open::before { position: fixed; z-index: 100; inset: 0; content: ""; background: rgba(3,7,9,.86); }
.reference-image-viewer-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.reference-image-viewer-body { display: grid; min-height: 0; flex: 1; place-items: center; padding: 12px; overflow: hidden; background: #050809; }
.reference-image-viewer-body img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.writer-adoption-overview { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 12px; align-items: stretch; }
.writer-adoption-score { display: grid; place-items: center; align-content: center; min-height: 96px; padding: 12px; color: #ffe2aa; background: var(--amber-bg); border: 1px solid #725936; border-radius: 5px; text-align: center; }
.writer-adoption-score strong { font-size: 31px; line-height: 1; }
.writer-adoption-score span { margin-top: 7px; color: var(--muted); font-size: 11px; }
.writer-adoption-verdict { padding: 12px 13px; background: #151e22; border: 1px solid var(--line-soft); border-radius: 5px; }
.writer-adoption-verdict strong, .writer-adoption-verdict span { display: block; }
.writer-adoption-verdict strong { color: #ffd0ca; font-size: 14px; }
.writer-adoption-verdict span { margin-top: 6px; color: #ffe0ac; font-size: 12px; font-weight: 700; }
.writer-adoption-verdict p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.writer-adoption-cost { margin: 13px 0; }
.writer-adoption-risk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.writer-adoption-risk-head strong { color: var(--text); font-size: 13px; }
.writer-adoption-risk-head span { color: var(--faint); font-size: 11px; }
.writer-adoption-risks { display: grid; gap: 7px; }
.writer-adoption-risks .repair-issue { padding: 9px 10px; }
.writer-adoption-impact-list { display: grid; gap: 6px; margin-top: 12px; padding: 10px 12px; color: var(--muted); background: #12191d; border: 1px solid var(--line-soft); border-radius: 5px; font-size: 11px; line-height: 1.5; }
.writer-adoption-impact-list span::before { margin-right: 7px; color: var(--amber); content: "•"; }
.writer-adoption-dialog .dialog-actions button,.writer-generation-dialog .dialog-actions button,.video-release-dialog .dialog-actions button,.video-generation-dialog .dialog-actions button,.first-frame-image-dialog .dialog-actions button { min-width: 132px; }
.model-security-notes { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 5px 10px; margin-top: 13px; padding: 10px; color: var(--muted); background: #12191d; border: 1px solid var(--line-soft); border-radius: 4px; font-size: 11px; }
.model-security-notes strong { color: var(--text); }
.model-region-notice { margin: 13px 0 0; }

/* Operational text stays readable at normal browser zoom. */
.studio-shell small { font-size: 12px; }
.studio-shell em { font-size: 11px; }
.outline-button, .primary-button, .quiet-button, .danger-button, .icon-button { font-size: 13px; }
.project-summary small { font-size: 12px; }
.project-summary strong { font-size: 13px; }
.stage-nav-item { min-height: 58px; }
.nav-step { width: 30px; height: 30px; font-size: 12px; }
.stage-nav-item strong { font-size: 13px; }
.stage-nav-item small { font-size: 12px; }
.stage-nav-item em { font-size: 11px; }
.local-indicator strong,
.side-footer > small,
.side-footer a { font-size: 12px; }
.topbar-left > div span,
.local-badge,
.save-state { font-size: 12px; }
.pipeline-step > span { font-size: 11px; }
.view-heading p { font-size: 13px; }
.project-summary small,
.topbar-left > div span,
.local-badge,
.save-state,
.pipeline-copy small,
.pipeline-step strong,
.pipeline-step small,
.view-heading-copy > span,
.panel-head p,
.section-label,
.field-help,
.entity-tab,
.confidence,
.issue-item,
.source-link,
.status-button,
.spec-table span,
.timeline-clip,
.dialog-head span { font-size: 12px; }
.tree-item strong,
.version-item strong,
.analysis-record p,
.source-trace pre,
.preview-copy p,
.spec-table strong,
.prompt-output { font-size: 12px; }

@media (max-width: 1250px) {
  .side-nav { width: 76px; flex-basis: 76px; padding: 15px 8px 12px; }
  .brand-block { justify-content: center; padding: 0 0 15px; }
  .brand-block > span:nth-child(2), .project-summary > span:nth-child(2), .project-summary .project-arrow, .stage-nav-item > span:nth-child(2), .stage-nav-item em, .side-footer > small, .side-footer a, .local-indicator strong, .local-indicator em { display: none; }
  .project-summary { display: flex; justify-content: center; padding: 8px; }
  .stage-nav-item { display: flex; justify-content: center; padding: 7px; }
  .side-footer { padding: 12px 0 0; }
  .local-indicator { justify-content: center; }
  .script-layout, .analysis-layout, .storyboard-layout, .production-layout { grid-template-columns: 210px minmax(360px,1fr); }
  .episode-production-layout { grid-template-columns: 210px minmax(360px,1fr) 330px; }
  .script-layout > :last-child, .analysis-layout > :last-child, .storyboard-layout > :last-child, .production-layout > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .global-pipeline { display: block; }
  .pipeline-copy { width: auto; padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pipeline-steps { display: flex; padding-top: 10px; }
  .pipeline-step { min-width: 115px; }
  .source-mode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .intake-layout, .delivery-layout { grid-template-columns: 1fr; }
  .asset-groups { grid-template-columns: 1fr; }
  .asset-create-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .repair-attempts { grid-template-columns: 1fr; }
  .structure-score-overview,
  .structure-review-overview { grid-template-columns: 110px minmax(0, 1fr); }
  .structure-score-policy,
  .structure-review-stats { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .side-nav { position: fixed; left: -260px; width: 248px; height: 100vh; flex-basis: 248px; padding: 18px 13px 14px; transition: left .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.42); }
  .side-nav.open { left: 0; }
  .side-nav .brand-block { justify-content: flex-start; padding: 0 8px 18px; }
  .side-nav .side-nav-close { display: inline-flex; }
  .side-nav .brand-block > span:nth-child(2), .side-nav .project-summary > span:nth-child(2), .side-nav .project-summary .project-arrow, .side-nav .stage-nav-item > span:nth-child(2), .side-nav .stage-nav-item em, .side-nav .side-footer > small, .side-nav .side-footer a, .side-nav .local-indicator strong, .side-nav .local-indicator em { display: block; }
  .side-nav .project-summary { display: grid; justify-content: initial; padding: 10px; }
  .side-nav .stage-nav-item { display: grid; justify-content: initial; padding: 7px 8px; }
  .side-nav .local-indicator { justify-content: flex-start; }
  .mobile-nav-button { display: inline-grid; place-items: center; }
  .topbar { height: auto; min-height: 60px; padding: 10px 12px; }
  .topbar-actions .save-state { display: none; }
  .assistant-open-button,.autopilot-open-button { min-height: 36px; padding: 7px 9px; }
  .assistant-open-button > span { display: none; }
  .autopilot-open-button > span { display: none; }
  #exportProjectButton { min-height: 36px; padding: 8px 10px; font-size: 12px; }
  .global-pipeline { margin: 12px 12px 0; }
  .view-root { padding: 18px 12px 30px; }
  .view-heading { display: block; }
  .writer-adoption-overview { grid-template-columns: 1fr; }
  .writer-adoption-score { min-height: 76px; }
  .writer-adoption-dialog .dialog-actions,.writer-generation-dialog .dialog-actions,.video-release-dialog .dialog-actions,.video-generation-dialog .dialog-actions,.first-frame-image-dialog .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .writer-adoption-dialog .dialog-actions button,.writer-generation-dialog .dialog-actions button,.video-release-dialog .dialog-actions button,.video-generation-dialog .dialog-actions button,.first-frame-image-dialog .dialog-actions button { width: 100%; }
  .view-heading-actions { justify-content: flex-start; margin-top: 12px; }
  .view-heading h1 { font-size: 22px; }
  .field-grid.two, .field-grid.three, .stat-strip, .performance-field-grid, .performance-state-grid { grid-template-columns: 1fr; }
  .performance-field-grid .wide, .performance-state-grid .wide { grid-column: auto; }
  .idea-field-grid { grid-template-columns: 1fr; }
  .idea-field-grid .wide { grid-column: auto; }
  .idea-timing-row { grid-template-columns: 1fr; }
  .idea-timing-meta, .idea-timing-budget { grid-column: auto; }
  .idea-fidelity-evidence dl { grid-template-columns: 1fr; }
  .repair-run-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repair-next-actions { grid-template-columns: 1fr; }
  .repair-next-actions button { width: 100%; white-space: normal; }
  .structure-score-overview,
  .structure-review-overview { grid-template-columns: 1fr; gap: 12px; }
  .structure-score-number,
  .structure-review-version { min-height: 0; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .structure-score-policy,
  .structure-review-stats { grid-column: auto; }
  .structure-technical-status { align-items: flex-start; flex-direction: column; }
  .structure-technical-status span { text-align: left; }
  .production-readiness { grid-template-columns: 1fr; }
  .production-readiness li { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .production-readiness li:last-child { border-bottom: 0; }
  .script-layout, .analysis-layout, .storyboard-layout, .production-layout { display: block; }
  .script-layout > *, .analysis-layout > *, .storyboard-layout > *, .production-layout > * { margin-bottom: 11px; }
  .scene-tree, .entity-list, .analysis-records, .scene-source-list, .shot-stack, .production-shot-list { max-height: 330px; }
  .script-editor { min-height: auto; }
  .script-editor textarea { min-height: 420px; }
  .production-preview { grid-template-columns: 1fr; }
  .preview-copy { text-align: left; }
  .asset-create-form { grid-template-columns: 1fr; }
  .person-asset-toolbar { grid-template-columns: 1fr; }
  .person-asset-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .asset-row { grid-template-columns: 34px minmax(0,1fr); }
  .asset-row-actions { grid-column: 1 / -1; flex-direction: row; }
  .studio-assistant-panel { width: 100vw; border-left: 0; }
  .autopilot-control-panel { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .assistant-messages { max-height: calc(100dvh - 365px); }
  .assistant-config-actions { display: grid; grid-template-columns: 1fr; }
  .assistant-config-actions .quiet-button { width: 100%; margin-right: 0; }
}

@media (max-width: 430px) {
  .series-rerun-confirmation .button-row { flex-direction: column-reverse; align-items: stretch; }
  .series-rerun-confirmation .button-row > button { width: 100%; }
  .source-mode-grid { grid-template-columns: 1fr; }
  .source-mode { min-height: 72px; }
  .topbar-left .local-badge { display: none; }
  .panel-head, .panel-footer { align-items: flex-start; flex-direction: column; }
  .idea-development-head, .idea-development-foot { align-items: flex-start; flex-direction: column; }
  .idea-development-foot .button-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .idea-development-panel .notice-band { flex-direction: column; }
  .idea-development-panel .notice-band strong { white-space: normal; }
  .idea-fidelity-score { align-items: flex-start; flex-direction: column; }
  .button-row { width: 100%; }
  .button-row > button { flex: 1; }
  .storyboard-toolbar { align-items: flex-start; flex-direction: column; }
  .repair-dimensions { grid-template-columns: 1fr; }
  .repair-run-metrics { grid-template-columns: 1fr; }
  .structure-operation-progress { grid-template-columns: 1fr; }
  .structure-operation-progress > div:nth-child(2) { min-width: 0; text-align: left; }
  .structure-score-policy { grid-template-columns: 1fr; }
  .structure-technical-details > summary small, .structure-attempt-details > summary small { float: none; display: block; margin-top: 4px; }
  .budget-summary, .spec-table { grid-template-columns: 1fr; }
}
