:root {
  --bg: #090b0c;
  --rail: #0d1012;
  --surface: #121517;
  --surface-2: #171b1e;
  --surface-3: #1d2327;
  --ink: #f2f1ed;
  --muted: #9da4a6;
  --dim: #626b70;
  --line: rgba(238, 242, 239, .09);
  --line-strong: rgba(238, 242, 239, .17);
  --accent: #f29a61;
  --accent-soft: rgba(242, 154, 97, .13);
  --mint: #8ec7a1;
  --cyan: #7eb7c5;
  --danger: #df8076;
  --radius: 7px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #353d41 #0b0e0f; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: #0b0e0f; }
*::-webkit-scrollbar-thumb { border: 2px solid #0b0e0f; border-radius: 5px; background: #353d41; }
*::-webkit-scrollbar-thumb:hover { background: #4b565b; }
*::-webkit-scrollbar-corner { background: #0b0e0f; }
html, body { min-height: 100%; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Manrope, "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body.workspace-active { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
select { color-scheme: dark; }
select option { background: #121517; color: #f2f1ed; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; stroke-width: 1.8; }
.mono { font-family: "DM Mono", Consolas, monospace; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 58px; flex: 0 0 auto; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(9, 11, 12, .96); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; letter-spacing: -.025em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: #2d190e; }
.brand small { display: block; margin-top: 1px; color: var(--dim); font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.topbar-center { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; color: var(--dim); font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.signal-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(142, 199, 161, .1); }
.topbar-actions, .user-chip, .button-row, .inline, .stage-row { display: flex; align-items: center; }
.topbar-actions { gap: 10px; }
.user-chip { gap: 8px; color: var(--muted); font-size: 11px; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #d2ae8c; color: #25160e; font-size: 10px; font-weight: 800; }
.balance { display: flex; gap: 8px; align-items: center; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--dim); font-size: 10px; }
.balance:hover { border-color: rgba(242,154,97,.42); color: var(--ink); }
.balance b { color: var(--ink); font-family: "DM Mono", monospace; }

.btn { min-height: 34px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 700; transition: border-color .16s, background .16s, transform .16s; }
.btn:hover { border-color: rgba(238, 242, 239, .32); background: var(--surface-3); transform: translateY(-1px); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #2a170d; }
.btn.primary:hover { border-color: #f6aa77; background: #f6aa77; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: rgba(238, 242, 239, .06); }
.btn.danger { border-color: rgba(223, 128, 118, .28); color: var(--danger); }
.btn.small { min-height: 29px; padding: 6px 8px; font-size: 10px; }
.btn.icon-btn { width: 34px; padding: 0; }
.button-row { gap: 7px; flex-wrap: wrap; }

.page { width: min(1280px, 100%); margin: 0 auto; padding: 44px 30px 80px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.project-hero { padding: 28px 0 34px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font: 700 9px "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 4vw, 40px); line-height: 1.08; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 17px; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 13px; }
.lead { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.project-toolbar { height: 66px; display: flex; align-items: center; justify-content: space-between; }
.section-title { display: flex; align-items: baseline; gap: 10px; font-weight: 700; }
.section-title small { color: var(--dim); font-size: 10px; font-weight: 500; }
.toolbar-actions { display: flex; gap: 3px; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-card { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); text-align: left; transition: transform .18s, border-color .18s; }
.project-card:hover { border-color: rgba(242, 154, 97, .42); transform: translateY(-3px); }
.project-cover { height: 154px; position: relative; background-position: center; background-size: cover; }
.project-cover::after { content: ""; position: absolute; inset: 0; background: rgba(5, 7, 8, .28); }
.project-cover-0 { background-image: url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=900&q=80"); }
.project-cover-1 { background-image: url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=900&q=80"); }
.project-cover-2 { background-image: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=900&q=80"); }
.cover-stage, .cover-time, .cover-action { position: absolute; z-index: 1; }
.cover-stage { left: 11px; top: 11px; padding: 4px 6px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; background: rgba(7,9,10,.7); color: rgba(255,255,255,.82); font: 8px "DM Mono", monospace; letter-spacing: .08em; }
.cover-time { left: 11px; bottom: 10px; color: rgba(255,255,255,.7); font-size: 8px; }
.cover-action { right: 9px; top: 9px; width: 28px; height: 28px; border: 0; border-radius: 5px; display: grid; place-items: center; background: rgba(7,9,10,.62); color: rgba(255,255,255,.72); opacity: 0; transition: opacity .16s; }
.project-card:hover .cover-action { opacity: 1; }
.cover-action:hover { color: var(--danger); }
.project-card-body { min-height: 128px; padding: 14px; display: flex; flex-direction: column; }
.project-card h3 { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.project-card p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.project-foot { margin-top: auto; padding-top: 15px; display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 9px; }
.stage-pill { padding: 4px 6px; border-radius: 4px; background: rgba(126, 183, 197, .1); color: var(--cyan); font-size: 9px; }
.project-card-new { min-height: 284px; border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.project-card-new:hover { color: var(--ink); background: rgba(242, 154, 97, .025); }
.project-card-new > span:last-child { margin-top: 4px; color: var(--dim); font-size: 10px; }
.new-icon { width: 38px; height: 38px; margin-bottom: 12px; border: 1px solid rgba(242,154,97,.24); border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty { padding: 54px 20px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); text-align: center; }
.empty .icon { width: 24px; height: 24px; margin-bottom: 10px; color: var(--accent); }
.library-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; }
.library-empty strong { color: var(--ink); }
.library-empty span { margin-top: 5px; color: var(--dim); font-size: 10px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; padding: 18px; display: grid; place-items: center; background: rgba(0,0,0,.75); backdrop-filter: blur(7px); }
.modal { width: min(540px, 100%); padding: 22px; border: 1px solid var(--line-strong); border-radius: 9px; background: #121618; box-shadow: 0 30px 90px rgba(0,0,0,.58); }
.modal-head { margin-bottom: 19px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 5px 0; font-size: 19px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; }
.modal-actions { margin-top: 5px; justify-content: flex-end; }
.action-dialog { width: min(460px, 100%); }
.action-dialog-message { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.recharge-modal { width: min(520px, 100%); }
.recharge-target { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(238,242,239,.025); }
.recharge-target strong, .recharge-target span { display: block; }
.recharge-target strong { color: var(--ink); font-size: 12px; }
.recharge-target span { margin-top: 4px; color: var(--dim); font-size: 9px; }
.export-modal { width: min(620px, 100%); }
.billing-modal { width: min(680px, 100%); max-height: calc(100vh - 36px); overflow: auto; }
.billing-balance { margin-bottom: 16px; padding: 16px; border: 1px solid rgba(242,154,97,.25); border-radius: 7px; background: rgba(242,154,97,.055); }
.billing-balance span, .billing-balance strong { display: block; }
.billing-balance span { color: var(--dim); font: 9px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.billing-balance strong { margin-top: 7px; color: var(--accent); font: 27px "DM Mono", monospace; }
.billing-ledger { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.billing-ledger-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.billing-ledger-head strong { font-size: 11px; }.billing-ledger-head span { color: var(--dim); font-size: 9px; }
.billing-row { padding: 11px 12px; border-bottom: 1px solid rgba(238,242,239,.06); display: flex; justify-content: space-between; gap: 12px; }.billing-row:last-child { border-bottom: 0; }
.billing-row > div:last-child { text-align: right; }.billing-row strong, .billing-row b, .billing-row small { display: block; }.billing-row strong { color: var(--ink); font-size: 11px; }.billing-row small { margin-top: 3px; color: var(--dim); font-size: 9px; }.billing-row b { font: 12px "DM Mono", monospace; }.billing-row b.is-charge { color: var(--accent); }.billing-row b.is-credit { color: var(--mint); }.billing-row .billing-partial { margin-top: 5px; color: #f0b18a; font-size: 9px; line-height: 1.55; }.billing-empty { padding: 30px; color: var(--dim); font-size: 10px; text-align: center; }
.export-options { display: grid; gap: 9px; }
.export-option { width: 100%; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #0b0e0f; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 12px; color: var(--muted); text-align: left; }
.export-option:hover { border-color: rgba(242,154,97,.38); background: rgba(242,154,97,.045); color: var(--ink); }
.export-option:disabled { cursor: wait; opacity: .62; }
.export-option-icon { width: 38px; height: 38px; border: 1px solid rgba(242,154,97,.22); border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.export-option strong, .export-option small { display: block; }
.export-option strong { color: var(--ink); font-size: 12px; }
.export-option small { margin-top: 4px; color: var(--dim); font-size: 10px; line-height: 1.5; }
.close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 5px; display: grid; place-items: center; background: transparent; color: var(--dim); }
.close:hover { background: var(--surface-3); color: var(--ink); }
.compare-modal { width: min(920px,100%); max-height: calc(100vh - 36px); overflow: auto; }
.compare-results-modal { width: min(1280px,100%); }
.compare-provider-list { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: hidden; }
.compare-provider { min-width: 0; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; cursor: pointer; }
.compare-provider:nth-child(2n) { border-right: 0; }
.compare-provider:hover { background: rgba(238,242,239,.035); }
.compare-provider input { width: 15px; height: 15px; accent-color: var(--accent); }
.compare-provider > span:last-child { min-width: 0; flex: 1; }
.compare-provider strong, .compare-provider small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.compare-provider strong { font-size: 10px; }
.compare-provider small { margin-top: 2px; color: var(--dim); font-size: 8px; }
.compare-provider-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.compare-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.compare-candidate { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #0b0e0f; }
.compare-candidate-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.compare-candidate-head h3 { margin: 3px 0 0; font-size: 12px; }
.compare-results-modal .compare-select:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.compare-results-modal .compare-select.loading { cursor: wait; opacity: .72; }
.compare-results-modal .close:disabled { cursor: wait; opacity: .35; }
.compare-artifact { max-height: 480px; margin-bottom: 12px; overflow: auto; }
.compare-artifact .script-title h2 { font-size: 16px; }
.compare-artifact .script-scene { padding: 12px 0; }
.compare-artifact .document-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.compare-error { border-color: rgba(223,128,118,.25); }
.compare-error > p { color: var(--danger); font-size: 9px; }
.source-change-modal { width: min(1080px,100%); max-height: calc(100vh - 36px); overflow: auto; }
.source-change-modal .field textarea { min-height: 128px; font-size: 13px; line-height: 1.7; }
.source-change-scopes { margin: 16px 0; padding: 0; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: hidden; }
.source-change-scopes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.source-change-scopes label { min-width: 0; padding: 13px; border-right: 1px solid var(--line); display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.source-change-scopes label:last-child { border-right: 0; }
.source-change-scopes label:hover { background: rgba(238,242,239,.035); }
.source-change-scopes input { margin-top: 2px; accent-color: var(--accent); }
.source-change-scopes strong, .source-change-scopes small { display: block; }
.source-change-scopes strong { font-size: 11px; }
.source-change-scopes small { margin-top: 3px; color: var(--dim); font-size: 9px; line-height: 1.45; }
.source-change-note { margin: 14px 0; padding: 10px 11px; border: 1px solid rgba(126,183,197,.18); border-radius: 6px; background: rgba(126,183,197,.055); display: flex; align-items: center; gap: 8px; color: #aebbbd; font-size: 10px; line-height: 1.55; }
.source-change-note .icon { color: var(--cyan); }
.source-version-restore { margin-bottom: 15px; padding: 11px 12px; border: 1px solid rgba(142,199,161,.18); border-radius: 6px; background: rgba(142,199,161,.055); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-version-restore span, .source-version-restore strong, .source-version-restore small { display: block; }
.source-version-restore span { color: var(--mint); font: 8px "DM Mono", monospace; }
.source-version-restore strong { margin-top: 4px; font-size: 11px; }
.source-version-restore small { margin-top: 2px; color: var(--dim); font-size: 8px; }
.source-change-summary { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.source-change-summary > div { display: flex; gap: 6px; flex-wrap: wrap; }
.source-change-summary h3 { margin: 12px 0 6px; font-size: 17px; }
.source-change-summary p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.source-change-impact-grid { margin: 14px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.source-change-impact-grid > div { min-width: 0; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.source-change-impact-grid span, .source-change-impact-grid strong { display: block; }
.source-change-impact-grid span { color: var(--dim); font-size: 9px; }
.source-change-impact-grid strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 14px; }
.source-change-scenes { display: flex; flex-direction: column; gap: 9px; }
.source-change-scene { border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; overflow: hidden; }
.source-change-scene summary { padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.source-change-scene summary span { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }
.source-change-scene summary code { color: var(--accent); font: 9px "DM Mono", monospace; }
.source-change-scene summary small { color: var(--dim); font-size: 9px; }
.source-change-diff { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.source-change-diff > div { min-width: 0; padding: 11px; border-right: 1px solid var(--line); }
.source-change-diff > div:last-child { border-right: 0; }
.source-change-diff span { color: var(--dim); font: 8px "DM Mono", monospace; }
.source-change-diff pre { max-height: 260px; margin: 7px 0 0; overflow: auto; color: #cbd2d0; font: 12px/1.75 Manrope, "Microsoft YaHei UI", "PingFang SC", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-change-proposal-actions { position: sticky; bottom: -22px; z-index: 2; margin: 16px -22px -22px; padding: 12px 22px; border-top: 1px solid var(--line); background: rgba(18,22,24,.97); }

.workspace { height: calc(100vh - 58px); min-height: 650px; display: grid; grid-template-columns: 216px minmax(0,1fr); overflow: hidden; }
.workspace-sidebar { min-height: 0; padding: 15px 11px; border-right: 1px solid var(--line); background: var(--rail); display: flex; flex-direction: column; }
.back-projects { height: 30px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 10px; }
.back-projects:hover { background: rgba(238,242,239,.05); color: var(--ink); }
.project-context { margin-top: 15px; padding: 14px 8px 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-context h2 { margin: 6px 0 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.project-context p { margin: 0; color: var(--dim); font-size: 9px; }
.stage-list { padding-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.stage-item { width: 100%; padding: 9px 8px; border: 0; border-radius: 6px; background: transparent; display: flex; align-items: center; gap: 9px; color: var(--muted); text-align: left; transition: background .15s,color .15s; }
.stage-item:hover { background: rgba(238,242,239,.05); color: var(--ink); }
.stage-item.active { background: var(--accent-soft); color: var(--ink); }
.stage-index { width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 5px; display: grid; place-items: center; color: var(--dim); font: 9px "DM Mono", monospace; }
.stage-item.done .stage-index { border-color: rgba(142,199,161,.45); color: var(--mint); }
.stage-item.active .stage-index { border-color: var(--accent); background: var(--accent); color: #28160d; font-weight: 700; }
.stage-label { min-width: 0; flex: 1; }
.stage-label strong { display: block; font-size: 11px; }
.stage-label small { display: block; margin-top: 1px; color: var(--dim); font-size: 8px; }
.workspace-sidebar-foot { margin-top: auto; padding: 15px 8px 4px; border-top: 1px solid var(--line); }
.sidebar-progress { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.sidebar-progress b { color: var(--ink); font-family: "DM Mono", monospace; font-weight: 500; }
.progress-track { height: 3px; margin: 9px 0 10px; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
.progress-track i { height: 100%; width: 4%; display: block; background: var(--accent); transition: width .25s; }
.progress-track i.running { width: 34% !important; animation: progress-sweep 1.4s ease-in-out infinite; }
@keyframes progress-sweep { 0% { opacity: .45; transform: translateX(0); } 50% { opacity: 1; transform: translateX(190%); } 100% { opacity: .45; transform: translateX(0); } }
.workspace-sidebar-foot p { margin: 0; color: var(--dim); font-size: 8px; line-height: 1.55; }

.workspace-main { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.stage-header { min-height: 116px; flex: 0 0 auto; padding: 22px 26px 19px; border-bottom: 1px solid var(--line); background: #0b0e0f; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.stage-header h1 { margin: 5px 0 5px; font-size: 23px; }
.stage-header p { max-width: 670px; margin: 0; color: var(--muted); font-size: 10px; }
.stage-run-status { display: none; align-items: center; gap: 6px; margin-top: 7px; color: var(--accent); font-size: 10px; }
.stage-run-status.active { display: inline-flex; }
.stage-run-status.active::before { content: ""; width: 7px; height: 7px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.generation-progress-panel { flex: 0 0 auto; padding: 10px 18px; border-bottom: 1px solid rgba(242,154,97,.18); background: rgba(242,154,97,.045); }
.generation-progress-panel > div:first-child { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 9px; }
.generation-progress-icon { width: 28px; height: 28px; border: 1px solid rgba(242,154,97,.25); border-radius: 6px; display: grid; place-items: center; color: var(--accent); }
.generation-progress-icon .icon { width: 14px; height: 14px; animation: spin .8s linear infinite; }
.generation-progress-panel strong, .generation-progress-panel small { display: block; }
.generation-progress-panel strong { font-size: 11px; }
.generation-progress-panel small { margin-top: 2px; color: var(--dim); font-size: 9px; }
.generation-progress-panel b { color: var(--accent); font: 10px "DM Mono", monospace; }
.generation-progress-track { height: 3px; margin-top: 8px; overflow: hidden; border-radius: 2px; background: #171b1d; }
.generation-progress-track i { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.stage-content { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.stage-content > .chat-layout, .stage-content > .studio-canvas { min-height: 0; flex: 1 1 auto; }
.chat-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(360px,var(--chat-pane-size,54%)) 12px minmax(0,1fr); }
.conversation-panel { height: 100%; min-height: 0; padding: 20px 18px 16px; background: #0d1011; display: flex; flex-direction: column; overflow: hidden; }
.chat-resizer { width: 12px; min-width: 12px; height: 100%; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); outline: 0; background: #0a0c0d; display: grid; place-items: center; color: #50595d; cursor: col-resize; touch-action: none; }
.chat-resizer .icon { width: 11px; height: 18px; }
.chat-resizer:hover, .chat-resizer:focus-visible { background: rgba(242,154,97,.08); color: var(--accent); }
.resizing-chat-pane, .resizing-chat-pane * { cursor: col-resize !important; user-select: none !important; }
.pane-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.pane-heading h2 { margin: 3px 0 0; font-size: 15px; }
.pane-kicker { color: var(--dim); font: 8px "DM Mono", monospace; letter-spacing: .1em; }
.agent-online { display: flex; align-items: center; gap: 5px; color: var(--mint); font-size: 8px; }
.agent-online i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chat-thread { min-height: 0; flex: 1 1 auto; padding: 22px 2px 22px 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 12px; }
.message { max-width: 92%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: #d4dad8; font-size: 15px; line-height: 1.72; white-space: pre-wrap; }
.message.user { margin-left: auto; border-color: rgba(242,154,97,.24); background: var(--accent-soft); color: var(--ink); }
.message-meta { margin-bottom: 5px; display: block; color: #788286; font: 9px "DM Mono", monospace; text-transform: uppercase; }
.stage-proposal { width: 100%; padding: 12px; border: 1px solid rgba(242,154,97,.34); border-radius: 7px; background: rgba(242,154,97,.08); }
.stage-proposal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stage-proposal-head span { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 700; }
.stage-proposal-head .icon { width: 14px; height: 14px; }
.stage-proposal-head small { color: var(--dim); font: 8px "DM Mono", monospace; }
.stage-proposal p { margin: 9px 0 12px; color: #bdc5c3; font-size: 12px; line-height: 1.65; }
.stage-proposal-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.stage-proposal-actions .btn { width: 100%; justify-content: center; }
.composer { flex: 0 0 auto; position: relative; z-index: 2; padding: 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 30px rgba(0,0,0,.22); }
.composer textarea { width: 100%; min-height: 68px; padding: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font-size: 15px; line-height: 1.65; }
.composer textarea::placeholder { color: var(--dim); }
.composer-foot { margin-top: 7px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.composer-tools { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.composer-actions { flex: 0 0 auto; margin-left: 8px; display: flex; align-items: center; gap: 6px; }
.composer-compare { min-height: 34px; padding-inline: 10px; }
.composer-compare .icon { width: 14px; height: 14px; }
.compare-label-short { display: none; }
.helper { display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: 9px; }
.helper .icon { width: 12px; height: 12px; }
.composer-model-picker { min-width: 0; max-width: 190px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: #0b0e0f; display: inline-flex; align-items: center; gap: 5px; color: var(--cyan); }
.composer-model-picker .icon { width: 12px; height: 12px; }
.composer-model-picker select { min-width: 0; width: 155px; border: 0; outline: 0; background: transparent; color: var(--muted); font-size: 9px; text-overflow: ellipsis; }
.stage-header #stageActions .composer-model-picker { height: 34px; max-width: 210px; background: var(--surface); }
.stage-header #stageActions .composer-model-picker select { width: 168px; font-size: 10px; }

.output-canvas { min-width: 0; min-height: 0; padding: 18px; overflow-y: auto; background: #0a0c0d; }
.artifact { padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.artifact-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.artifact-head h2 { margin: 4px 0 0; font-size: 17px; }
.status { display: flex; align-items: center; gap: 5px; color: var(--mint); font-size: 9px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.demo-status { color: var(--accent); }
.artifact-warning { margin: -4px 0 16px; padding: 10px 11px; border: 1px solid rgba(242,154,97,.22); border-radius: 6px; background: var(--accent-soft); display: flex; align-items: center; gap: 7px; color: #e8b38f; font-size: 10px; line-height: 1.55; }
.artifact-warning .icon { width: 14px; }
.canvas-empty { min-height: 100%; border: 1px dashed var(--line-strong); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.output-canvas > .canvas-empty { min-height: 280px; }
.canvas-empty.compact { min-height: 340px; }
.canvas-empty-icon { width: 42px; height: 42px; margin-bottom: 13px; border: 1px solid var(--line-strong); border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.canvas-empty > span { color: var(--dim); font: 8px "DM Mono", monospace; letter-spacing: .1em; }
.canvas-empty h2 { margin: 7px 0 5px; font-size: 15px; }
.canvas-empty p { max-width: 380px; margin: 0; color: var(--dim); font-size: 10px; }
.idea-document .document-label { color: var(--dim); font: 8px "DM Mono", monospace; letter-spacing: .1em; }
.idea-document blockquote { margin: 10px 0 24px; padding-left: 15px; border-left: 2px solid var(--accent); color: var(--ink); font-size: clamp(18px,2.2vw,28px); line-height: 1.35; letter-spacing: -.025em; }
.document-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.document-grid > div { min-height: 78px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.document-grid span { display: block; color: #778084; font-size: 9px; }
.document-grid strong { display: block; margin-top: 5px; font-size: 12px; line-height: 1.5; font-weight: 600; }
.outline-document { display: flex; flex-direction: column; }
.outline-document article { min-height: 118px; padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 50px minmax(0,1fr); gap: 15px; }
.act-number { color: var(--accent); font: 20px "DM Mono", monospace; }
.outline-document small { color: var(--dim); font: 8px "DM Mono", monospace; }
.outline-document h3 { margin: 4px 0 7px; font-size: 15px; }
.outline-document p { max-width: 650px; margin: 0; color: #bdc5c3; font-size: 12px; line-height: 1.7; }
.script-title { padding: 14px 0 22px; text-align: center; }
.script-title span { color: #788286; font: 9px "DM Mono", monospace; letter-spacing: .1em; }
.script-title h2 { margin: 8px 0 0; font-size: 26px; }
.script-scene { padding: 24px 0; border-top: 1px solid var(--line); }
.scene-heading { margin-bottom: 14px; display: flex; gap: 11px; align-items: center; }
.scene-heading span { width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 5px; display: grid; place-items: center; color: var(--accent); font: 10px "DM Mono", monospace; }
.scene-heading strong { font-size: 16px; letter-spacing: 0; }
.script-scene > p { margin: 0; color: #ccd3d1; font-size: 15px; line-height: 1.85; }
.script-dialogue { max-width: 760px; margin: 20px 0 0 50px; display: flex; flex-direction: column; gap: 16px; }
.dialogue-turn { padding-left: 15px; border-left: 2px solid rgba(242,154,97,.58); }
.dialogue-turn strong { display: block; color: #f5a36d; font-size: 14px; letter-spacing: 0; }
.script-scene .dialogue-turn p { margin: 6px 0 0; color: #f2f1ed; font-size: 16px; line-height: 1.8; }
.script-scene .dialogue-action { margin: 1px 0; color: #bdc6c4; font-size: 15px; line-height: 1.85; }

.studio-canvas { min-height: 100%; height: 100%; padding: 20px 24px 50px; overflow-x: hidden; overflow-y: auto; }
.canvas-heading { height: 48px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.canvas-count { color: var(--dim); font: 8px "DM Mono", monospace; }
.agent-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-bottom: 18px; }
.agent-card { min-height: 74px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); display: grid; grid-template-columns: 30px 1fr 16px; align-items: center; gap: 10px; }
.agent-card.complete { border-color: rgba(142,199,161,.18); }
.agent-card.inventory, .agent-card.prompting { border-color: rgba(242,154,97,.34); background: rgba(242,154,97,.045); }
.agent-card.error { border-color: rgba(224,112,112,.38); }
.agent-icon { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: rgba(126,183,197,.1); color: var(--cyan); }
.agent-card strong { display: block; font-size: 11px; }
.agent-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.agent-state { width: 13px; color: var(--mint); }
.agent-card.inventory .agent-state, .agent-card.prompting .agent-state { color: var(--accent); }
.agent-card.prompting .agent-state { animation: spin .8s linear infinite; }
.agent-card.error .agent-state { color: var(--danger); }
.agent-card-titleline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-card-titleline small { color: #7b8589; font: 8px "DM Mono", monospace; }
.asset-run-progress { margin-bottom: 12px; padding: 11px 12px; border: 1px solid rgba(242,154,97,.22); border-radius: 7px; background: rgba(242,154,97,.045); }
.asset-run-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-run-progress strong { font-size: 10px; }
.asset-run-progress span { color: var(--dim); font: 8px "DM Mono", monospace; }
.asset-progress-track { height: 3px; margin-top: 9px; overflow: hidden; border-radius: 2px; background: #171b1d; }
.asset-progress-track i { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.asset-library-toolbar { margin: 0 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-filter-tabs { min-width: 0; display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.asset-filter-tabs::-webkit-scrollbar { display: none; }
.asset-filter-tab { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; font-size: 11px; }
.asset-filter-tab .icon { width: 13px; }
.asset-filter-tab small { min-width: 19px; padding: 2px 5px; border-radius: 4px; background: rgba(238,242,239,.06); color: #7b8589; font: 9px "DM Mono", monospace; text-align: center; }
.asset-filter-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.asset-filter-tab.active { border-color: rgba(242,154,97,.46); background: var(--accent-soft); color: #f5b184; }
.asset-filter-tab.active small { background: rgba(242,154,97,.16); color: #f5b184; }
.asset-search { width: min(310px, 36vw); min-height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #0b0e0f; display: flex; align-items: center; gap: 8px; color: var(--dim); }
.asset-search:focus-within { border-color: rgba(242,154,97,.6); color: var(--accent); }
.asset-search > .icon { width: 14px; }
.asset-search input { min-width: 0; flex: 1; padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.asset-search input::placeholder { color: var(--dim); }
.asset-search input::-webkit-search-cancel-button { display: none; }
.asset-search-clear { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; color: var(--dim); }
.asset-search-clear:hover { color: var(--ink); }
.asset-search-clear .icon { width: 13px; }
.asset-result-summary { margin-bottom: 19px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #7b8589; font: 9px "DM Mono", monospace; }
.asset-category-section { margin-top: 23px; }
.asset-category-section:first-child { margin-top: 0; }
.asset-category-heading { min-height: 42px; margin-bottom: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-category-heading > div { display: flex; align-items: center; gap: 9px; }
.asset-category-heading small, .asset-category-heading strong { display: block; }
.asset-category-heading small { margin-bottom: 2px; color: #7b8589; font: 8px "DM Mono", monospace; }
.asset-category-heading strong { font-size: 15px; }
.asset-category-icon { width: 29px; height: 29px; border-radius: 6px; background: rgba(126,183,197,.09); display: grid; place-items: center; color: var(--cyan); }
.asset-category-icon .icon { width: 14px; }
.asset-category-count { color: #7b8589; font: 9px "DM Mono", monospace; }
.asset-filter-empty { min-height: 190px; border: 1px dashed var(--line-strong); border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--dim); text-align: center; }
.asset-filter-empty .icon { width: 22px; height: 22px; margin-bottom: 10px; }
.asset-filter-empty strong { color: var(--muted); font-size: 11px; }
.asset-filter-empty span { margin-top: 4px; font-size: 9px; }
.asset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.asset-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.asset-card-body { padding: 13px; }
.asset-type { color: var(--accent); font: 10px "DM Mono", monospace; letter-spacing: .04em; text-transform: uppercase; }
.asset-card h3 { margin: 5px 0; font-size: 12px; }
.asset-anchor { min-height: 50px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.prompt-line { margin-top: 11px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: #aec4c8; font-size: 8px; line-height: 1.55; }
.copy-prompt { flex: 0 0 auto; padding: 3px; border: 0; background: transparent; color: var(--dim); }
.copy-prompt:hover { color: var(--ink); }
.palette-card { grid-column: 1 / -1; background: #101415; }
.palette-card-body { padding: 14px; }
.palette-card .asset-card-title { align-items: flex-start; }
.palette-card .asset-card-title .btn { flex: 0 0 auto; }
.palette-coverage { margin: 12px 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; }
.palette-coverage span { color: #818b8e; font: 9px "DM Mono", monospace; }
.palette-coverage p { margin: 5px 0 0; color: #d0d8d5; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.palette-colors { display: grid; gap: 6px; }
.palette-color { min-width: 0; min-height: 48px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; display: grid; grid-template-columns: 30px minmax(0,1fr) 74px 14px; align-items: center; gap: 8px; color: var(--ink); text-align: left; }
.palette-color:hover { border-color: var(--line-strong); }
.palette-swatch { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; background: var(--palette-color); display: block; }
.palette-color-meta { min-width: 0; display: block; }
.palette-color-meta b, .palette-color-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-color-meta b { color: #bdc6c4; font-size: 11px; }
.palette-color-meta small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.palette-color code { width: 74px; color: #d5e0de; font: 10px "DM Mono", monospace; white-space: nowrap; }
.palette-color > .icon { width: 14px; color: var(--dim); }

.storyboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.shot-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.shot-frame { aspect-ratio: 16/9; padding: 9px; position: relative; background-position: center; background-size: cover; }
.shot-frame::after { content: ""; position: absolute; inset: 0; background: rgba(5,7,8,.3); }
.shot-frame-0 { background: #11191c; }
.shot-frame-1 { background: #16151c; }
.shot-frame-2 { background: #1b1815; }
.shot-frame-code, .shot-frame-type { position: absolute; z-index: 1; color: rgba(255,255,255,.78); font-size: 8px; }
.shot-frame-code { left: 9px; top: 8px; }
.shot-frame-type { right: 9px; bottom: 8px; padding: 3px 5px; border-radius: 3px; background: rgba(0,0,0,.58); }
.shot-card-body { padding: 12px; }
.shot-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.shot-card-head > div { min-width: 0; }
.shot-no { color: var(--accent); font: 8px "DM Mono", monospace; }
.shot-card h3 { margin: 3px 0 0; font-size: 11px; }
.shot-card p { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.storyboard-units { display: flex; flex-direction: column; gap: 30px; }
.storyboard-unit { min-width: 0; }
.storyboard-unit-head { min-height: 58px; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.storyboard-unit-head > div:last-child { text-align: right; }
.storyboard-unit-head h3 { margin: 4px 0 0; font-size: 17px; }
.storyboard-unit-head strong, .storyboard-unit-head span { display: block; }
.storyboard-unit-head > div:last-child strong { color: var(--accent); font: 20px "DM Mono", monospace; }
.storyboard-unit-head > div:last-child span { margin-top: 2px; color: var(--dim); font-size: 9px; }
.unit-id { color: var(--cyan); font: 10px "DM Mono", monospace; }
.unit-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.unit-look-id { padding: 3px 5px; border: 1px solid rgba(142,199,161,.28); border-radius: 4px; display: inline-flex !important; align-items: center; gap: 4px; color: var(--mint) !important; font: 9px "DM Mono", monospace; line-height: 1; }
.unit-look-id .icon { width: 11px; height: 11px; }
.unit-duration-track { height: 6px; margin: 10px 0 12px; border-radius: 3px; overflow: hidden; display: flex; gap: 2px; background: #0b0e0f; }
.unit-duration-track span { display: block; min-width: 4px; background: var(--accent); }
.unit-duration-track span:nth-child(3n+2) { background: var(--cyan); }
.unit-duration-track span:nth-child(3n) { background: var(--mint); }
.storyboard-shot-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.shot-card-detailed { display: grid; grid-template-columns: 112px minmax(0,1fr); }
.shot-sequence { padding: 15px 12px; border-right: 1px solid var(--line); background: #0b0e0f; display: flex; flex-direction: column; align-items: flex-start; }
.shot-sequence span, .shot-sequence strong, .shot-sequence small { display: block; }
.shot-sequence span { color: var(--accent); font: 9px "DM Mono", monospace; }
.shot-sequence strong { margin-top: 8px; color: var(--ink); font: 15px "DM Mono", monospace; }
.shot-sequence small { margin-top: auto; padding-top: 18px; color: var(--cyan); font-size: 10px; line-height: 1.45; }
.shot-card-detailed .shot-card-body { padding: 15px; }
.shot-card-detailed .shot-card-head h3 { font-size: 15px; }
.shot-duration { flex: 0 0 auto; padding: 4px 6px; border: 1px solid rgba(242,154,97,.28); border-radius: 4px; color: var(--accent); font: 10px "DM Mono", monospace; }
.shot-spec-grid { margin-top: 13px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.shot-spec-grid > div { padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shot-spec-grid span { color: #818b8e; font: 9px "DM Mono", monospace; }
.shot-card .shot-spec-grid p { margin: 6px 0 0; color: #c4ccca; font-size: 12px; line-height: 1.7; }
.shot-assets { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.shot-assets code { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--cyan); font: 9px "DM Mono", monospace; }
.shot-card-detailed .prompt-line { font-size: 10px; line-height: 1.65; }

.video-timeline { max-width: 900px; margin: 0 auto; }
.video-prompt-card { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 10px; }
.timeline-index { position: relative; display: flex; flex-direction: column; align-items: center; }
.timeline-index span { width: 28px; height: 28px; z-index: 1; border: 1px solid rgba(242,154,97,.34); border-radius: 50%; display: grid; place-items: center; background: var(--rail); color: var(--accent); font: 8px "DM Mono", monospace; }
.timeline-index i { width: 1px; min-height: 110px; flex: 1; background: var(--line-strong); }
.video-prompt-card:last-child .timeline-index i { background: transparent; }
.video-prompt-body { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.video-unit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.video-unit-head h3 { margin: 4px 0 0; font-size: 17px; }
.video-section-title { margin: 20px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.video-prompt-text { margin: 13px 0; padding: 11px; border-radius: 5px; background: #0b0e0f; color: #bdccce; font: 9px/1.65 "DM Mono", monospace; }
.negative-line { padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 8px; }
.negative-line span { margin-right: 8px; color: var(--danger); font-family: "DM Mono", monospace; }

.auth-form { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--muted); font-size: 10px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; resize: vertical; background: #0b0e0f; color: var(--ink); font-size: 11px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field small { color: var(--dim); font-size: 8px; line-height: 1.45; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-label-row .btn { padding: 5px 7px; font-size: 8px; }
.mini-check { display: inline-flex; align-items: center; gap: 5px; color: var(--dim) !important; font-size: 8px !important; font-weight: 400 !important; }
.mini-check input { width: 13px; height: 13px; accent-color: var(--accent); }
.field input:disabled, .field select:disabled { cursor: not-allowed; opacity: .48; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 38px; color: var(--muted); font-size: 10px; }
.check-row.full { grid-column: 1/-1; }
.check-row input { width: 15px; height: 15px; accent-color: var(--accent); }
.notice code { color: var(--cyan); font-family: "DM Mono", monospace; }
.error { min-height: 15px; color: var(--danger); font-size: 10px; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0,1fr); }
.admin-sidebar { height: 100vh; padding: 17px 12px; border-right: 1px solid var(--line); background: var(--rail); display: flex; flex-direction: column; position: sticky; top: 0; }
.admin-sidebar .brand { padding: 0 7px 20px; border-bottom: 1px solid var(--line); }
.admin-nav-label { padding: 20px 9px 8px; color: var(--dim); font: 8px "DM Mono", monospace; letter-spacing: .11em; text-transform: uppercase; }
.admin-tabs { display: flex; flex-direction: column; gap: 3px; }
.admin-tab { width: 100%; padding: 9px; border: 0; border-radius: 6px; background: transparent; display: flex; align-items: center; gap: 9px; color: var(--muted); text-align: left; font-size: 10px; font-weight: 700; }
.admin-tab:hover { background: rgba(238,242,239,.05); color: var(--ink); }
.admin-tab.active { background: var(--accent-soft); color: var(--ink); }
.admin-tab .icon { width: 14px; }
.admin-sidebar-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); }
.admin-main { min-width: 0; }
.admin-topbar { height: 58px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(9,11,12,.93); display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 9px; }
.admin-topbar > div:first-child { display: flex; align-items: center; gap: 7px; }
.admin-content { width: min(1200px,100%); margin: 0 auto; padding: 34px 28px 70px; }
.admin-heading { align-items: flex-end; margin-bottom: 24px; }
.admin-heading h1 { margin: 5px 0 6px; font-size: 29px; }
.admin-date { color: var(--dim); font-size: 9px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-bottom: 28px; }
.stat-card { min-height: 95px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.stat-card span { color: var(--dim); font-size: 9px; }
.stat-card strong { display: block; margin-top: 10px; font: 24px "DM Mono", monospace; }
#adminContent .section-head { min-height: 45px; display: flex; align-items: center; justify-content: space-between; }
#adminContent .section-head h2 { margin: 0; font-size: 13px; }
#adminContent .section-head span { color: var(--dim); font-size: 9px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid rgba(238,242,239,.055); text-align: left; font-size: 10px; }
th { background: #0e1112; color: var(--dim); font: 700 8px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--muted); }
td strong { color: var(--ink); font-size: 10px; }
tr:last-child td { border-bottom: 0; }
.tag { padding: 4px 6px; border-radius: 4px; background: rgba(142,199,161,.1); color: var(--mint); font-size: 8px; }
.tag.off { background: rgba(223,128,118,.1); color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field.full { grid-column: 1/-1; }
.settings-card { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.notice { margin-bottom: 16px; padding: 11px 12px; border: 1px solid rgba(126,183,197,.16); border-radius: 6px; background: rgba(126,183,197,.06); color: var(--muted); font-size: 9px; }
.provider-manager { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.provider-manager-head { padding: 12px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.provider-manager-head strong { display: block; font-size: 10px; }
.provider-manager-head span { display: block; margin-top: 2px; color: var(--dim); font-size: 8px; }
.llm-provider-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.llm-provider-row { min-width: 0; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.llm-provider-row:nth-child(2n) { border-right: 0; }
.llm-provider-row.selected { background: var(--accent-soft); }
.provider-choice { min-width: 0; flex: 1; padding: 5px; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; color: var(--muted); text-align: left; }
.provider-choice > span:nth-child(2) { min-width: 0; flex: 1; }
.provider-choice strong, .provider-choice small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.provider-choice strong { color: var(--ink); font-size: 9px; }
.provider-choice small { margin-top: 2px; color: var(--dim); font-size: 8px; }
.provider-choice em { padding: 3px 5px; border-radius: 3px; background: rgba(142,199,161,.12); color: var(--mint); font-size: 7px; font-style: normal; }
.provider-choice .provider-billing { margin-left: auto; background: rgba(126,183,197,.12); color: var(--cyan); }.provider-choice .provider-billing.unpriced { background: rgba(223,128,118,.12); color: var(--danger); }.provider-choice .provider-billing.free { background: rgba(142,199,161,.12); color: var(--mint); }
.provider-status { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); }
.provider-status.off { background: var(--dim); }
.provider-row-actions { flex: 0 0 auto; display: flex; gap: 4px; }
.provider-row-actions .btn { min-height: 27px; }
.model-capability { min-height: 56px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.model-capability.full { grid-column: 1/-1; }
.model-capability > div { padding: 10px 11px; border-right: 1px solid var(--line); }
.model-capability > div:last-child { border-right: 0; }
.model-capability span { display: block; color: var(--dim); font: 8px "DM Mono", monospace; }
.model-capability strong { display: block; margin-top: 5px; color: var(--ink); font-size: 9px; }
.model-capability > .dim { grid-column: 1/-1; padding: 16px 11px; }
.is-disabled { opacity: .55; }
.billing-config { padding: 13px; border: 1px solid rgba(126,183,197,.22); border-radius: 7px; background: rgba(126,183,197,.04); }.billing-config-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }.billing-config-head strong, .billing-config-head span { display: block; }.billing-config-head strong { font-size: 11px; }.billing-config-head span { margin-top: 3px; color: var(--dim); font-size: 9px; }.billing-status { flex: 0 0 auto; padding: 4px 6px; border-radius: 4px; background: rgba(142,199,161,.12); color: var(--mint); font-size: 8px; }.billing-status.metered { background: rgba(126,183,197,.12); color: var(--cyan); }.billing-status.unpriced { background: rgba(223,128,118,.12); color: var(--danger); }.billing-config-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }.billing-config-warning { display: none; margin: 10px 0 0; color: var(--danger); font-size: 10px; line-height: 1.55; }.billing-config-warning.visible { display: block; }.usage-uncollected { color: var(--danger); font-size: 9px; }

.prompt-manager { display: grid; grid-template-columns: 250px minmax(0,1fr); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.prompt-profile-list { min-width: 0; border-right: 1px solid var(--line); background: #0b0e0f; }
.prompt-group { padding: 12px 8px 5px; }
.prompt-group > span { display: block; padding: 0 7px 7px; color: var(--dim); font: 8px "DM Mono", monospace; letter-spacing: .08em; }
.prompt-profile-choice { width: 100%; padding: 9px 8px; border: 0; border-radius: 5px; background: transparent; display: flex; align-items: center; gap: 8px; color: var(--muted); text-align: left; }
.prompt-profile-choice:hover { background: rgba(238,242,239,.04); }
.prompt-profile-choice.selected { background: var(--accent-soft); }
.prompt-profile-choice > span:last-child { min-width: 0; }
.prompt-profile-choice strong, .prompt-profile-choice small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prompt-profile-choice strong { color: var(--ink); font-size: 9px; }
.prompt-profile-choice small { margin-top: 3px; color: var(--dim); font: 8px "DM Mono", monospace; }
.prompt-editor { min-width: 0; padding: 18px; }
.prompt-editor-head { padding-bottom: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.prompt-editor-head h2 { margin: 4px 0 6px; font-size: 17px; }
.prompt-editor-head p { max-width: 650px; margin: 0; color: var(--muted); font-size: 10px; }
.prompt-version { min-width: 76px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.prompt-version span { display: block; color: var(--dim); font-size: 8px; }
.prompt-version strong { display: block; margin-top: 3px; color: var(--accent); font: 15px "DM Mono", monospace; }
.prompt-contract-notice { margin: 14px 0 0; }
#promptForm { display: flex; flex-direction: column; gap: 14px; padding-top: 13px; }
.prompt-variables { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.prompt-variables > span { margin-right: 3px; color: var(--dim); font-size: 8px; }
.prompt-variables code { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: #0b0e0f; color: var(--cyan); font: 8px "DM Mono", monospace; }
.prompt-field { min-width: 0; }
.prompt-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.prompt-field .field-label-row label { margin-bottom: 0; }
.prompt-field textarea, .prompt-test-panel textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; resize: vertical; background: #0b0e0f; color: #c9d3d1; font: 9px/1.65 "DM Mono", Consolas, monospace; }
.prompt-field textarea:focus, .prompt-test-panel textarea:focus { border-color: rgba(242,154,97,.5); }
.prompt-form-actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 2px; }
.prompt-test-panel, .prompt-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.prompt-test-head, .prompt-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.prompt-test-head strong, .prompt-history-head strong { display: block; font-size: 10px; }
.prompt-test-head span, .prompt-history-head span { display: block; margin-top: 2px; color: var(--dim); font-size: 8px; }
.prompt-test-head select { max-width: 190px; }
.prompt-test-result { margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; }
.prompt-test-result > div { padding: 9px 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.prompt-test-result details { border-bottom: 1px solid var(--line); }
.prompt-test-result details:last-child { border-bottom: 0; }
.prompt-test-result summary { padding: 9px 10px; color: var(--cyan); font-size: 9px; cursor: pointer; }
.prompt-test-result pre { max-height: 300px; margin: 0; padding: 10px; overflow: auto; color: var(--muted); font: 9px/1.6 "DM Mono", monospace; white-space: pre-wrap; }
.prompt-history-row { min-height: 48px; padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prompt-history-row > span strong, .prompt-history-row > span small { display: block; }
.prompt-history-row > span strong { font: 10px "DM Mono", monospace; }
.prompt-history-row > span small { margin-top: 3px; color: var(--dim); font-size: 8px; }

.toast { position: fixed; left: 50%; bottom: 20px; z-index: 70; max-width: min(90vw,500px); padding: 9px 13px; border: 1px solid rgba(242,154,97,.3); border-radius: 6px; background: #27211d; color: var(--ink); box-shadow: var(--shadow); font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%,12px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.loading { opacity: .55; pointer-events: none; position: relative; }
.loading::after { content: ""; width: 11px; height: 11px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Structured asset and Unit prompt layouts */
.asset-grid { grid-template-columns: 1fr; }
.asset-card-detailed { display: block; }
.asset-card-detailed .asset-card-body { padding: 18px; }
.asset-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.asset-card-title h3 { margin-top: 6px; font-size: 19px; }
.asset-facts { margin-top: 16px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.asset-facts > div { padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.asset-facts span, .video-setting-grid span { display: block; color: var(--dim); font: 8px "DM Mono", monospace; letter-spacing: .04em; }
.asset-facts p, .video-setting-grid p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.asset-facts span { color: #818b8e; font-size: 10px; }
.asset-facts p { margin-top: 7px; color: #c3cbca; font-size: 13px; line-height: 1.75; }
.asset-prompt-grid { margin-top: 14px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.asset-prompt-section { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #0b0e0f; }
.asset-prompt-head { min-height: 62px; padding: 11px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-prompt-head span, .asset-prompt-head small { display: block; }
.asset-prompt-head span { color: var(--ink); font-size: 13px; font-weight: 700; }
.asset-prompt-head small { margin-top: 3px; color: #818b8e; font: 9px "DM Mono", monospace; }
.asset-prompt-head .btn { min-height: 32px; font-size: 11px; }
.asset-prompt-section pre { max-height: 520px; min-height: 170px; margin: 0; padding: 15px; overflow: auto; color: #d3dad8; font: 13px/1.85 Manrope, "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif; letter-spacing: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.asset-prompt-section:last-child pre { font-family: "DM Mono", Consolas, monospace; font-size: 12px; line-height: 1.8; }
.prompt-details { margin-top: 13px; border: 1px solid var(--line); border-radius: 6px; background: #0b0e0f; }
.prompt-details summary { padding: 9px 10px; cursor: pointer; color: var(--cyan); font-size: 9px; }
.prompt-details pre { max-height: 430px; margin: 0; padding: 11px; overflow: auto; border-top: 1px solid var(--line); color: #bdccce; font: 9px/1.7 "DM Mono", Consolas, monospace; white-space: pre-wrap; }
.video-setting-grid { margin: 14px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.video-setting-grid > div { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.video-setting-grid span { color: #818b8e; font-size: 9px; }
.video-setting-grid p { margin-top: 7px; color: #c4ccca; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.timeline-beats { margin-top: 15px; border-top: 1px solid var(--line); }
.timeline-beat { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.beat-range { color: var(--accent); font-size: 11px; }
.timeline-beat strong { display: block; margin-top: 5px; color: var(--ink); font-size: 11px; }
.timeline-beat strong:first-child { margin-top: 0; }
.timeline-beat p { margin: 4px 0 10px; color: #c4ccca; font-size: 12px; line-height: 1.75; }
.stage-warning { margin: 0 0 15px; padding: 10px 11px; border: 1px solid rgba(242,154,97,.22); border-radius: 6px; background: var(--accent-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e8b38f; font-size: 10px; }
.stage-warning-copy { min-width: 0; display: flex; align-items: center; gap: 7px; line-height: 1.55; }
.stage-warning .icon { width: 14px; flex: 0 0 auto; }
.stage-warning .btn { flex: 0 0 auto; }
.stage-warning .btn:disabled { opacity: .58; cursor: wait; }
.stage-warning .btn:disabled .icon { animation: spin .7s linear infinite; }
.source-impact { margin: 0 0 15px; padding: 11px 12px; border: 1px solid rgba(126,183,197,.25); border-radius: 6px; background: rgba(126,183,197,.065); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.source-impact.error { border-color: rgba(223,128,118,.3); background: rgba(223,128,118,.07); }
.source-impact-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.source-impact-icon { width: 30px; height: 30px; border-radius: 5px; background: rgba(126,183,197,.1); display: grid; place-items: center; color: var(--cyan); }
.source-impact.error .source-impact-icon { background: rgba(223,128,118,.1); color: var(--danger); }
.source-impact-copy strong { display: block; font-size: 11px; }
.source-impact-copy p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.source-impact .btn:disabled .icon { animation: spin .7s linear infinite; }

@media (min-width: 821px) and (max-width: 1500px) {
  .stage-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .stage-header #stageActions { justify-content: flex-start; }
}
@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .asset-grid, .storyboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topbar { padding: 0 12px; }
  .topbar-center { display: none; }
  .topbar .balance { display: inline-flex; }
  .topbar .balance > span { display: none; }
  .page { padding: 26px 15px 60px; }
  .project-hero { display: block; }
  .project-hero .btn { margin-top: 18px; }
  .workspace { height: auto; min-height: calc(100vh - 58px); display: block; overflow: visible; }
  .workspace-sidebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 62px; padding: 6px 8px; border: 0; border-top: 1px solid var(--line); display: block; }
  .back-projects, .project-context, .workspace-sidebar-foot { display: none; }
  .stage-list { height: 100%; padding: 0; flex-direction: row; align-items: center; }
  .stage-item { flex: 1; justify-content: center; padding: 7px 0; }
  .stage-label { display: none; }
  .stage-index { width: 28px; height: 28px; }
  .workspace-main { height: calc(100dvh - 120px); overflow: hidden; }
  .stage-header { min-height: 0; padding: 20px 15px; display: block; }
  .stage-header .button-row { margin-top: 15px; justify-content: flex-start; }
  .stage-warning { align-items: stretch; flex-direction: column; }
  .stage-warning .btn { align-self: flex-start; }
  .source-impact { align-items: stretch; flex-direction: column; }
  .source-impact .button-row { justify-content: flex-start; }
  .composer-tools { gap: 5px; }
  .composer-tools .helper { display: none; }
  .composer-model-picker { max-width: 160px; }
  .composer-model-picker select { width: 128px; }
  .compare-label-long { display: none; }
  .compare-label-short { display: inline; }
  .chat-layout { height: 100%; display: block; }
  .chat-resizer { display: none; }
  .conversation-panel { height: 100%; min-height: 0; border: 0; border-bottom: 1px solid var(--line); overflow: hidden; }
  .chat-thread { min-height: 0; max-height: none; }
  .output-canvas { min-height: 100%; padding: 15px 15px 82px; }
  .studio-canvas { padding: 16px 15px 88px; }
  .admin-shell { display: block; }
  .admin-sidebar { height: 58px; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); position: sticky; z-index: 20; flex-direction: row; align-items: center; }
  .admin-sidebar .brand, .admin-nav-label, .admin-sidebar-foot span { display: none; }
  .admin-tabs { flex: 1; flex-direction: row; }
  .admin-tab { justify-content: center; }
  .admin-sidebar-foot { margin: 0; padding: 0; border: 0; display: flex; }
  .admin-topbar { display: none; }
  .admin-content { padding: 24px 15px 60px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .billing-config-grid { grid-template-columns: 1fr; }
  .llm-provider-list { grid-template-columns: 1fr; }
  .llm-provider-row { border-right: 0; }
  .prompt-manager { grid-template-columns: 1fr; }
  .prompt-profile-list { max-height: 280px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .prompt-test-head { align-items: flex-start; flex-direction: column; }
  .compare-results, .compare-provider-list { grid-template-columns: 1fr; }
  .compare-provider { border-right: 0; }
  .source-change-scopes, .source-change-impact-grid { grid-template-columns: 1fr; }
  .source-change-scopes label { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-change-scopes label:last-child { border-bottom: 0; }
  .source-change-diff { grid-template-columns: 1fr; }
  .source-change-diff > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-change-diff > div:last-child { border-bottom: 0; }
  .source-version-restore { align-items: stretch; flex-direction: column; }
  .source-version-restore .btn { align-self: flex-start; }
  .source-change-proposal-actions { bottom: -22px; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .admin-tabs .admin-tab span { display: none; }
  .project-grid, .storyboard-grid, .document-grid, .asset-facts, .asset-prompt-grid, .video-setting-grid { grid-template-columns: 1fr; }
  .asset-card-detailed .asset-card-body { padding: 15px; }
  .project-cover { height: 180px; }
  .agent-grid { grid-template-columns: 1fr; }
  .palette-color { grid-template-columns: 30px minmax(0,1fr) 74px 14px; gap: 6px; }
  .asset-library-toolbar { align-items: stretch; flex-direction: column; }
  .asset-search { width: 100%; }
  .asset-result-summary span:last-child { display: none; }
  .shot-card-detailed { grid-template-columns: 1fr; }
  .shot-sequence { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .shot-sequence strong, .shot-sequence small { margin: 0; padding: 0; }
  .shot-spec-grid { grid-template-columns: 1fr; }
  .video-unit-head { align-items: stretch; flex-direction: column; }
  .video-unit-head .btn { align-self: flex-start; }
  .timeline-beat { grid-template-columns: 1fr; gap: 8px; }
  .user-chip > span:last-child { display: none; }
  .script-dialogue { margin-left: 0; }
  .model-capability { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .model-capability > div:nth-child(2) { border-right: 0; }
  .model-capability > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
