:root {
  --tech-bg: #06131f;
  --tech-panel: #0a1b29;
  --tech-panel-2: #0d2233;
  --tech-line: #17364a;
  --tech-line-bright: #28617a;
  --tech-text: #e8f5fb;
  --tech-muted: #7895a6;
  --tech-cyan: #35d5df;
  --tech-cyan-soft: rgba(53,213,223,.12);
  --tech-orange: #f07a32;
  --tech-green: #46d7a0;
  --tech-red: #ff6b6b;
  --ink: var(--tech-text);
  --muted: var(--tech-muted);
  --line: var(--tech-line);
  --coral: var(--tech-orange);
  --paper: var(--tech-bg);
  --shadow: 0 24px 70px rgba(0,0,0,.36);
}

* { scrollbar-color: #24556b #081722; }
body { color: var(--tech-text); background: var(--tech-bg); }
button, input, select, textarea { letter-spacing: 0; }
button { cursor: pointer; }
input, select, textarea { color: var(--tech-text); border-color: var(--tech-line); background: #081a27; }
input:focus, select:focus, textarea:focus { border-color: var(--tech-cyan); box-shadow: 0 0 0 2px rgba(53,213,223,.1); outline: none; }
select { color-scheme: dark; }

.app-shell { grid-template-columns: 284px minmax(0,1fr); min-height: 100vh; background: radial-gradient(circle at 78% 0,rgba(32,112,143,.12),transparent 27%), var(--tech-bg); }
.app-shell.portfolio-mode, .app-shell.project-mode { grid-template-columns: minmax(0,1fr); }
.portfolio-mode .sidebar, .project-mode .sidebar { width: 284px; position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(0,0,0,.38); }
.portfolio-mode .sidebar.open, .project-mode .sidebar.open { transform: translateX(0); }
.portfolio-mode .menu-button, .project-mode .menu-button { display: inline-grid; place-items: center; }
.portfolio-mode .mobile-brand, .project-mode .mobile-brand { display: flex; margin-right: 10px; }
.portfolio-mode .mobile-brand-logo, .project-mode .mobile-brand-logo { width: 64px; height: 22px; object-fit: contain; }
.portfolio-mode .mobile-brand strong, .project-mode .mobile-brand strong { padding-left: 10px; color: var(--tech-text); border-left: 1px solid var(--tech-line); font-size: 12px; }
.mobile-scrim.show { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(2,9,15,.68); backdrop-filter: blur(2px); }
.sidebar { z-index: 20; color: var(--tech-text); border-right: 1px solid var(--tech-line); background: #071622; box-shadow: inset -1px 0 rgba(75,203,218,.04); }
.brand-row { height: 84px; padding: 0 22px; border-bottom: 1px solid var(--tech-line); }
.brand-logo { width: 86px; height: 30px; object-fit: contain; }
.brand-copy { padding-left: 13px; border-left: 1px solid var(--tech-line-bright); }
.brand-copy strong { color: #f2f9fc; font-size: 15px; }
.brand-copy small { color: #5e8295; font: 8px Consolas,monospace; }
.create-button { margin: 18px 18px 10px; width: calc(100% - 36px); min-height: 42px; border: 1px solid var(--tech-orange); border-radius: 3px; background: linear-gradient(135deg,#d95e22,#f4863d); box-shadow: 0 8px 22px rgba(240,122,50,.18); }
.sidebar-projects-button, .sidebar-ledger-button { width: calc(100% - 36px); min-height: 52px; margin: 6px 18px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px 11px; color: #91aabc; border: 1px solid transparent; border-radius: 3px; background: transparent; text-align: left; }
.sidebar-projects-button:hover, .sidebar-projects-button.active, .sidebar-ledger-button:hover, .sidebar-ledger-button.active { color: var(--tech-text); border-color: #17425a; background: var(--tech-cyan-soft); }
.sidebar-projects-button.active { border-left: 2px solid var(--tech-cyan); }
.sidebar-projects-button > span, .sidebar-ledger-button > span { color: var(--tech-cyan); font-size: 18px; }
.sidebar-projects-button strong, .sidebar-projects-button small, .sidebar-ledger-button strong, .sidebar-ledger-button small { display: block; }
.sidebar-projects-button strong, .sidebar-ledger-button strong { font-size: 12px; }
.sidebar-projects-button small, .sidebar-ledger-button small { margin-top: 3px; color: #537488; font-size: 9px; }
.sidebar-projects-button b, .sidebar-ledger-button b { color: var(--tech-cyan); font: 700 11px Consolas,monospace; }
.sidebar-section { min-height: 0; }
.section-label { color: #547487; border-color: var(--tech-line); }
.section-label b { color: var(--tech-cyan); }
.section-label button { color: #7597a9; }
.project-row { border-left: 2px solid transparent; }
.project-row:hover, .project-row.active { border-left-color: var(--tech-cyan); background: rgba(29,87,113,.22); }
.project-item strong { color: #cfe2ec; }
.project-item small { color: #58788b; }
.project-delete { color: #628296; }
.project-delete:hover { color: var(--tech-red); }
.task-log-section { border-color: var(--tech-line); }
.task-log-list { scrollbar-color: #24556b transparent; }
.task-log-item { border-color: var(--tech-line); background: rgba(12,38,54,.66); }
.task-log-item strong { color: #abc0cb; }
.task-log-item small { color: #557488; }
.sidebar-footer { border-color: var(--tech-line); }
.connection { color: #66899c; }

.workspace { background: transparent; }
.topbar { height: 66px; padding: 0 26px; color: var(--tech-text); border-bottom: 1px solid var(--tech-line); background: rgba(6,19,31,.94); backdrop-filter: blur(14px); }
.back-projects-button { min-height: 34px; padding: 0 12px; color: #91b0bf; border: 1px solid #244f65; border-radius: 3px; background: #0a2130; font-size: 10px; }
.back-projects-button:hover { color: var(--tech-cyan); border-color: var(--tech-cyan); }
.topbar .mobile-brand { flex: 0 0 auto; }
.topbar .breadcrumb { min-width: 0; }
.topbar-actions .back-projects-button { order: -1; }
.breadcrumb span, .breadcrumb b { color: #496a7d; }
.breadcrumb strong { color: #e6f2f7; }
.mode-badge { color: var(--tech-green); border-color: rgba(70,215,160,.35) !important; background: rgba(70,215,160,.07); }
.mode-badge.needs-config { color: #f3ad66; border-color: rgba(243,173,102,.4) !important; background: rgba(243,173,102,.08); }
.points-badge, .account-button { color: #b6ccd7; border-color: var(--tech-line); background: #0a1e2c; }
.points-badge b { color: var(--tech-cyan); }
.account-button span { color: #06131f; background: var(--tech-cyan); }
.mobile-brand strong { color: var(--tech-text); border-color: var(--tech-line); }

.projects-view { min-height: calc(100vh - 66px); padding: 34px clamp(24px,3vw,52px) 60px; }
.projects-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.projects-header h1 { margin: 5px 0 7px; color: #f0f8fb; font: 700 clamp(28px,3vw,42px)/1.1 "Microsoft YaHei",sans-serif; }
.projects-header p:not(.eyebrow) { margin: 0; color: var(--tech-muted); }
.eyebrow { color: var(--tech-cyan); font: 700 9px Consolas,monospace; }
.primary-button { color: white; border-color: var(--tech-orange); border-radius: 3px; background: var(--tech-orange); }
.primary-button:hover { background: #ff8a44; }
.secondary-button, .quiet-button { color: #a8c3cf; border-color: #275268; border-radius: 3px; background: #0c2636; }
.secondary-button:hover, .quiet-button:hover { color: #e7f6fa; border-color: var(--tech-cyan); background: #103247; }
.portfolio-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--tech-line); background: #081925; }
.portfolio-metrics > div { min-height: 112px; padding: 20px 22px; position: relative; border-right: 1px solid var(--tech-line); }
.portfolio-metrics > div:last-child { border-right: 0; }
.portfolio-metrics span, .portfolio-metrics strong, .portfolio-metrics small { display: block; }
.portfolio-metrics span { color: #7897a8; font-size: 11px; }
.portfolio-metrics strong { margin-top: 9px; color: #eef8fb; font: 700 32px Consolas,monospace; }
.portfolio-metrics small { position: absolute; right: 16px; bottom: 14px; color: #2b596d; font: 700 8px Consolas,monospace; }
.portfolio-metrics > div:nth-child(2) strong { color: var(--tech-cyan); }
.portfolio-metrics > div:nth-child(3) strong { color: #f3ad66; }
.portfolio-metrics > div:nth-child(4) strong { color: var(--tech-green); }
.portfolio-toolbar { min-height: 62px; margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--tech-line); background: #081925; }
.portfolio-search { min-width: 260px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #183b4e; background: #061520; }
.portfolio-search span { color: var(--tech-cyan); font-size: 19px; }
.portfolio-search input { width: 100%; min-height: 38px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.portfolio-filters { display: flex; align-items: center; padding: 3px; border: 1px solid var(--tech-line); background: #061520; }
.portfolio-filters button { min-height: 32px; padding: 0 14px; color: #66899c; border: 0; background: transparent; font-size: 10px; }
.portfolio-filters button.active { color: #07141e; background: var(--tech-cyan); }
.portfolio-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill,minmax(330px,1fr)); gap: 14px; }
.portfolio-card { min-height: 302px; position: relative; display: flex; flex-direction: column; border: 1px solid var(--tech-line); border-top: 2px solid #235269; border-radius: 3px; background: linear-gradient(145deg,#0a1c29,#081722); box-shadow: 0 18px 38px rgba(0,0,0,.14); transition: border-color .18s, transform .18s, box-shadow .18s; }
.portfolio-card:hover { transform: translateY(-2px); border-color: #327592; box-shadow: 0 22px 50px rgba(0,0,0,.26); }
.portfolio-card.is-running { border-top-color: var(--tech-cyan); }
.portfolio-card.is-running::after { content: ''; width: 6px; height: 6px; position: absolute; right: 15px; top: 17px; border-radius: 50%; background: var(--tech-green); box-shadow: 0 0 12px var(--tech-green); }
.portfolio-card-top { height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-bottom: 1px solid var(--tech-line); }
.portfolio-select { display: grid; place-items: center; }
.portfolio-status { color: #7fa1b2; font: 700 9px Consolas,monospace; }
.portfolio-delete { margin-left: auto; color: #55778a; border: 0; background: transparent; font-size: 18px; }
.portfolio-delete:hover { color: var(--tech-red); }
.portfolio-card-copy { flex: 1; padding: 19px 18px 12px; }
.portfolio-card-copy small { color: #4f788d; font: 700 9px Consolas,monospace; }
.portfolio-card-copy h2 { margin: 8px 0; overflow: hidden; color: #e9f4f8; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-card-copy p { min-height: 42px; margin: 0; display: -webkit-box; overflow: hidden; color: #718f9f; font-size: 11px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.portfolio-progress { padding: 0 18px 16px; }
.portfolio-progress > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portfolio-progress span { overflow: hidden; color: #6b8b9c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-progress b { color: var(--tech-cyan); font: 700 10px Consolas,monospace; }
.portfolio-progress i { height: 3px; margin-top: 8px; display: block; background: #112d3d; }
.portfolio-progress em { height: 100%; display: block; background: linear-gradient(90deg,#188fb0,var(--tech-cyan)); box-shadow: 0 0 8px rgba(53,213,223,.42); }
.portfolio-output { min-height: 48px; display: grid; grid-template-columns: repeat(3,auto) minmax(110px,1fr); align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--tech-line); }
.portfolio-output span { color: #587a8d; font-size: 9px; }
.portfolio-output b { color: #adc5cf; }
.portfolio-output button { min-height: 30px; color: var(--tech-cyan); border: 0; background: transparent; font-size: 10px; text-align: right; }
.portfolio-empty { grid-column: 1/-1; padding: 70px 20px; color: #587789; border: 1px dashed #245168; text-align: center; }
.portfolio-empty b { color: #39758e; font: 700 13px Consolas,monospace; }

.project-header { padding: 30px 34px 24px; color: var(--tech-text); border-bottom: 1px solid var(--tech-line); background: linear-gradient(90deg,rgba(16,56,77,.36),transparent 65%); }
.project-mode .project-header { display: none; }
.project-mode .production-status { min-height: 44px; padding: 8px 24px; display: flex; align-items: center; gap: 20px; }
.project-mode .status-heading { min-width: 0; flex: 1; margin: 0; }
.project-mode .status-heading > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.project-mode .status-heading small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-mode .progress-track { width: min(300px,24vw); flex: 0 0 auto; }
.project-mode .stage-grid { display: none; }
.project-mode .content-tabs { min-height: 46px; }
.project-mode .content-tabs button { min-height: 46px; }
.project-header h1 { color: #eff8fb; font-family: "Microsoft YaHei",sans-serif; }
.project-premise { color: #7997a7; }
.production-status { padding: 20px 34px; border-color: var(--tech-line); background: #081925; }
.status-heading strong { color: #dcecf3; }
.status-heading small { color: #628497; }
.status-heading b { color: var(--tech-cyan); }
.status-dot { background: var(--tech-green); box-shadow: 0 0 10px var(--tech-green); }
.progress-track { background: #102c3c; }
.progress-track > div { background: linear-gradient(90deg,#188fac,var(--tech-cyan)); box-shadow: 0 0 10px rgba(53,213,223,.4); }
.stage-grid > div { color: #5c7d8f; }
.stage-grid > div span { color: #5d7e90; border-color: #245067; background: #0a202f; }
.stage-grid > div.active span { color: #07141e; border-color: var(--tech-cyan); background: var(--tech-cyan); }
.stage-grid > div.done span { color: #062219; border-color: var(--tech-green); background: var(--tech-green); }
.stage-grid > div strong { color: #9bb5c1; }
.stage-grid > div small { color: #4e7184; }
.stage-grid > div::after { background: var(--tech-line); }
.content-tabs { min-height: 58px; padding: 0 34px; gap: 4px; border-color: var(--tech-line); background: #071723; }
.content-tabs button { min-height: 58px; padding: 0 22px; color: #638497; border-bottom: 2px solid transparent; background: transparent; }
.content-tabs button small { margin-right: 7px; color: #365d72; font: 700 9px Consolas,monospace; }
.content-tabs button.active { color: #e5f3f7; border-bottom-color: var(--tech-cyan); }
.content-tabs button.active small { color: var(--tech-cyan); }
.content-tabs button span { color: #08202b; background: var(--tech-cyan); }
.shots-panel, .assets-panel, .script-panel, .delivery-panel { max-width: none; padding: 26px 34px 54px; background: transparent; }
.shots-panel { padding: 0 0 54px; }
.director-batch-bar { min-height: 58px; position: sticky; top: 66px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 18px; border-bottom: 1px solid #24536b; background: rgba(8,27,41,.96); box-shadow: 0 10px 26px rgba(0,0,0,.2); backdrop-filter: blur(14px); }
.director-batch-bar.has-selection { border-bottom-color: var(--tech-cyan); box-shadow: 0 10px 30px rgba(0,0,0,.24),0 1px 12px rgba(53,213,223,.12); }
.director-selection { min-width: 220px; display: flex; align-items: center; gap: 12px; }
.director-selection label { display: flex; align-items: center; gap: 8px; color: #c9dde6; font-size: 11px; font-weight: 750; cursor: pointer; }
.director-selection label span { white-space: nowrap; }
.director-selection input, .shot-check input { accent-color: var(--tech-cyan); }
.director-selection b { min-width: 58px; padding: 5px 8px; color: #6f93a5; border: 1px solid #214a60; border-radius: 3px; background: #071722; font: 700 10px Consolas,monospace; text-align: center; }
.director-selection b span { color: var(--tech-cyan); }
.director-batch-actions { display: flex; gap: 8px; }
.director-batch-actions button { min-height: 38px; padding: 0 15px; border-radius: 3px; font-size: 10px; font-weight: 800; transition: border-color .16s,background .16s,transform .16s,box-shadow .16s; }
.director-batch-actions button:hover:not(:disabled) { transform: translateY(-1px); }
.director-batch-actions button small { margin-left: 7px; opacity: .72; font-size: 8px; font-weight: 600; }
.batch-image-button { color: #fff; border: 1px solid #e98440; background: linear-gradient(135deg,#dc6527,#f4863d); box-shadow: 0 7px 18px rgba(240,122,50,.18); }
.batch-image-button:hover:not(:disabled) { box-shadow: 0 9px 24px rgba(240,122,50,.3); }
.batch-video-button { color: #06202a; border: 1px solid #5be5ec; background: linear-gradient(135deg,#35c3d0,#57e1e8); box-shadow: 0 7px 18px rgba(53,213,223,.15); }
.batch-video-button:hover:not(:disabled) { box-shadow: 0 9px 24px rgba(53,213,223,.28); }
.batch-pull-button { color: #a9cad8; border: 1px solid #35627a; background: #0d2a3b; }
.batch-pull-button:hover:not(:disabled) { color: #e0f7fb; border-color: #54bfd0; background: #12394d; box-shadow: 0 9px 22px rgba(42,151,174,.18); }
.director-batch-actions button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.commercial-director { min-height: calc(100vh - 250px); display: grid; grid-template-columns: 190px minmax(520px,1fr) 320px; border-bottom: 1px solid var(--tech-line); background: #071421; }
.commercial-shot-rail { min-width: 0; padding: 18px 11px; border-right: 1px solid var(--tech-line); background: #081825; }
.commercial-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.commercial-rail-head b { color: #b7d0db; font-size: 12px; }
.commercial-rail-head span { color: #52788c; font: 700 8px Consolas,monospace; }
.commercial-rail-filter { display: flex; gap: 3px; margin: 15px 4px 10px; }
.commercial-rail-filter button { min-height: 27px; padding: 0 9px; color: #64889d; border: 1px solid #21445b; border-radius: 2px; background: #0b2233; font-size: 8px; }
.commercial-rail-filter button.active { color: var(--tech-cyan); border-color: #2e8cab; background: #0c3145; }
.commercial-shot-list { max-height: calc(100vh - 365px); overflow-y: auto; }
.commercial-shot-wrap { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: stretch; border-left: 2px solid transparent; }
.commercial-shot-wrap:hover, .commercial-shot-wrap.active { border-left-color: var(--tech-cyan); background: #0d2b41; }
.shot-check { display: grid; place-items: center; cursor: pointer; }
.shot-check input { width: 14px; height: 14px; margin: 0; }
.commercial-shot { width: 100%; min-width: 0; min-height: 58px; display: grid; grid-template-columns: 28px minmax(0,1fr) 12px; align-items: center; gap: 7px; padding: 9px 7px 9px 2px; color: #6f90a4; border: 0; background: transparent; text-align: left; }
.commercial-shot:hover, .commercial-shot.active { color: #e0f3f8; border-left-color: var(--tech-cyan); background: #0d2b41; }
.commercial-shot > span { color: #4e778e; font: 10px Consolas,monospace; }
.commercial-shot b, .commercial-shot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commercial-shot b { font-size: 10px; }
.commercial-shot small { margin-top: 4px; color: #577b90; font-size: 8px; }
.commercial-shot i { color: #3c687e; font-size: 8px; }
.commercial-shot.active i { color: var(--tech-green); text-shadow: 0 0 8px var(--tech-green); }
.commercial-director-stage { min-width: 0; padding: 18px 21px; }
.commercial-stage-head { min-height: 62px; display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.commercial-stage-head > div:first-child > span { color: #5796ae; font: 700 8px Consolas,monospace; }
.commercial-stage-head h2 { margin: 6px 0 5px; color: #edf9ff; font-size: 21px; }
.commercial-stage-head small { color: #6e91a6; font-size: 9px; }
.commercial-stage-head > div:last-child { display: flex; gap: 6px; }
.commercial-stage-head button { min-height: 32px; }
.commercial-monitor { overflow: hidden; border: 1px solid #23475e; background: #040c14; box-shadow: 0 16px 45px rgba(0,0,0,.46); }
.commercial-monitor-top, .commercial-monitor-bottom { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; color: #62879c; font: 700 8px Consolas,monospace; }
.commercial-monitor-media { height: min(44vh,390px); position: relative; overflow: hidden; background: linear-gradient(160deg,#0c273c,#102f3d 42%,#20253a 70%,#0c1321); }
.commercial-monitor-media > img, .commercial-monitor-media > video, .director-mock { width: 100%; height: 100%; object-fit: contain; background: #030a10; }
.director-placeholder { width: 100%; height: 100%; position: relative; display: grid; place-content: center; justify-items: center; overflow: hidden; color: #4aa2bd; }
.director-placeholder::before { content: ''; width: 64px; height: 64px; position: absolute; right: 17%; top: 14%; border-radius: 50%; background: rgba(216,230,208,.72); box-shadow: 0 0 35px rgba(216,230,208,.38); }
.director-placeholder::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(7,19,29,.6),transparent 42%,rgba(7,19,29,.62)),linear-gradient(0deg,#050913,transparent 45%),repeating-linear-gradient(0deg,transparent,transparent 24px,rgba(76,169,194,.035) 25px); }
.director-placeholder i { width: 110%; height: 78px; position: absolute; left: -5%; bottom: 21%; z-index: 1; background: rgba(165,222,218,.13); filter: blur(13px); transform: rotate(-4deg); }
.director-placeholder b, .director-placeholder span, .director-placeholder small { z-index: 2; }
.director-placeholder b { font-size: 34px; text-shadow: 0 0 16px rgba(60,182,212,.55); }
.director-placeholder span { margin-top: 5px; color: #88aab9; font-size: 9px; }
.director-placeholder small { max-width: 380px; margin-top: 9px; overflow: hidden; color: #50768a; text-overflow: ellipsis; white-space: nowrap; }
.director-preview-action { position: absolute; right: 12px; bottom: 12px; z-index: 3; min-height: 32px; padding: 0 11px; color: #06131f; border: 0; background: var(--tech-cyan); font-size: 9px; font-weight: 800; }
.commercial-monitor-bottom { height: 36px; gap: 10px; }
.commercial-monitor-bottom button { color: #7ba6bb; border: 0; background: transparent; }
.commercial-monitor-bottom i { height: 3px; flex: 1; background: #1b3a4e; }
.commercial-monitor-bottom em { height: 100%; display: block; background: var(--tech-cyan); box-shadow: 0 0 8px var(--tech-cyan); }
.director-prompt-workbench { margin-top: 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.director-prompt-panel { min-width: 0; padding: 13px; border: 1px solid #1d4b62; border-top: 2px solid var(--tech-cyan); border-radius: 3px; background: #0a1f2e; }
.video-prompt-panel { border-top-color: var(--tech-orange); background: #0c1e2b; }
.director-prompt-head { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.director-prompt-head > div:first-child span, .director-prompt-head > div:first-child b { display: block; }
.director-prompt-head > div:first-child span { color: #4d8298; font: 700 8px Consolas,monospace; }
.director-prompt-head > div:first-child b { margin-top: 3px; color: #deeff5; font-size: 11px; }
.director-prompt-head > div:last-child { display: flex; gap: 6px; }
.director-prompt-panel textarea { width: 100%; min-height: 150px; margin-top: 8px; padding: 10px; color: #d4e7ee; border: 1px solid #245269; border-radius: 2px; background: #071824; font-size: 10px; line-height: 1.65; resize: vertical; }
.director-prompt-panel p { margin: 7px 0 0; color: #5f8394; font-size: 8px; }
.director-prompt-panel .prompt-mentions { margin-bottom: 2px; }
.director-prompt-panel .prompt-mentions span { padding: 5px 8px; color: #72f2dc; border: 1px solid #247d6b; border-radius: 3px; background: linear-gradient(135deg,rgba(35,168,140,.22),rgba(28,111,116,.18)); box-shadow: inset 0 0 12px rgba(70,215,180,.08),0 0 10px rgba(53,213,190,.08); font-size: 9px; }
.prompt-generate-button { min-height: 28px; padding: 0 10px; border-radius: 3px; font-size: 9px; font-weight: 850; }
.prompt-generate-button.image { color: #fff; border: 1px solid #e98440; background: linear-gradient(135deg,#dc6527,#f4863d); }
.prompt-generate-button.video { color: #062029; border: 1px solid #5ee8ed; background: linear-gradient(135deg,#42ccd6,#72edf0); }
.prompt-generate-button:disabled { opacity: .38; cursor: not-allowed; }
.commercial-inspector { min-width: 0; padding: 0 14px; overflow-y: auto; border-left: 1px solid var(--tech-line); background: #091a29; }
.commercial-inspector-tabs { height: 42px; display: flex; border-bottom: 1px solid var(--tech-line); }
.commercial-inspector-tabs button { flex: 1; color: #6f91a7; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 9px; }
.commercial-inspector-tabs button.active { color: #d7f5fb; border-color: var(--tech-cyan); }
.commercial-inspector > section { padding: 14px 3px; border-bottom: 1px solid var(--tech-line); }
.commercial-inspect-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.commercial-inspect-title b { color: #d9f1f7; font-size: 10px; }
.commercial-inspect-title span { color: #5e90a5; font-size: 8px; }
.commercial-inspector label { display: block; margin: 9px 0; color: #7192a7; font-size: 8px; }
.commercial-inspector label small { display: block; margin-top: 4px; color: #58a7b6; font-size: 8px; text-align: right; }
.commercial-inspector select, .commercial-inspector input, .commercial-inspector textarea { width: 100%; margin-top: 5px; padding: 8px; color: #c9e8f2; border: 1px solid #20455d; border-radius: 2px; background: #0b2538; font-size: 9px; }
.commercial-inspector select, .commercial-inspector input { height: 31px; }
.commercial-inspector textarea { height: 104px; resize: vertical; line-height: 1.6; }
.commercial-inspector p { margin: 7px 0 0; color: #527b90; font-size: 8px; line-height: 1.5; }
.commercial-inspector .prompt-mentions { margin-bottom: 7px; }
.commercial-inspector .prompt-mentions span { padding: 5px 8px; color: #72f2dc; border: 1px solid #247d6b; border-radius: 3px; background: linear-gradient(135deg,rgba(35,168,140,.22),rgba(28,111,116,.18)); box-shadow: inset 0 0 12px rgba(70,215,180,.08),0 0 10px rgba(53,213,190,.06); font-size: 9px; }
.ai-optimize-button { min-height: 28px; padding: 0 10px; color: #062029; border: 1px solid #5ee8ed; border-radius: 3px; background: linear-gradient(135deg,#42ccd6,#72edf0); box-shadow: 0 5px 15px rgba(53,213,223,.2); font-size: 9px; font-weight: 850; }
.ai-optimize-button:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(53,213,223,.3); }
.commercial-generate, .commercial-video-generate { width: 100%; min-height: 32px; margin-top: 7px; color: #bff7fc; border: 1px solid #2d8fb0; background: #0d3c4d; font-size: 9px; }
.commercial-video-generate { color: #fff; border-color: #d78040; background: #d47739; }
.commercial-generate:disabled, .commercial-video-generate:disabled { opacity: .38; cursor: not-allowed; }
.script-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--tech-line); border-top: 2px solid var(--tech-cyan); border-radius: 3px; background: #091d2b; }
.script-toolbar .eyebrow { margin: 0 0 3px; color: #4e8499; font: 700 8px Consolas,monospace; }
.script-toolbar strong { color: #e0f1f6; font-size: 14px; }
.script-overview { display: grid; grid-template-columns: minmax(220px,.32fr) minmax(420px,1fr); gap: 1px; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--tech-line); border-top: 2px solid var(--tech-orange); border-radius: 3px; background: var(--tech-line); }
.script-overview label { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 13px 15px; color: #79a0b2; background: #0a1d2a; font-size: 10px; }
.script-overview input, .script-overview textarea { width: 100%; padding: 9px 10px; color: #d7e9ef; border: 1px solid #255269; border-radius: 2px; outline: 0; background: #071823; font-size: 12px; line-height: 1.55; resize: vertical; }
.script-overview input:focus, .script-overview textarea:focus, .script-worktable input:focus, .script-worktable textarea:focus { border-color: var(--tech-cyan); box-shadow: 0 0 0 2px rgba(53,213,223,.09); }
.script-table-section { margin-top: 14px; overflow: hidden; border: 1px solid var(--tech-line); border-radius: 3px; background: #081925; box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.script-section-title { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--tech-line); background: #0b2231; }
.script-section-title span, .script-section-title b { display: block; }
.script-section-title span { color: #4d8298; font: 700 8px Consolas,monospace; }
.script-section-title b { margin-top: 3px; color: #dcecf2; font-size: 12px; }
.script-section-title em { padding: 5px 8px; color: #7ba7b8; border: 1px solid #28526a; border-radius: 2px; background: #071823; font-size: 9px; font-style: normal; white-space: nowrap; }
.script-table-wrap { width: 100%; overflow-x: auto; }
.script-worktable { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; color: #a7c0cb; background: #081925; }
.script-worktable th { height: 38px; padding: 8px 10px; color: #7295a6; border-right: 1px solid var(--tech-line); border-bottom: 1px solid var(--tech-line); background: #091d2b; font-size: 9px; text-align: left; }
.script-worktable th:first-child, .script-worktable td:first-child { width: 58px; text-align: center; }
.script-worktable th:nth-child(2) { width: 180px; }
.script-worktable th:last-child, .script-worktable td:last-child { width: 76px; text-align: center; }
.script-worktable td { padding: 8px; vertical-align: top; border-right: 1px solid var(--tech-line); border-bottom: 1px solid var(--tech-line); background: #091a27; }
.script-worktable tr:last-child td { border-bottom: 0; }
.script-worktable th:last-child, .script-worktable td:last-child { border-right: 0; }
.script-worktable tbody tr:hover td { background: #0b2231; }
.script-worktable td:first-child b { color: var(--tech-cyan); font: 700 11px Consolas,monospace; }
.script-worktable input, .script-worktable textarea { width: 100%; padding: 8px 9px; color: #d2e5ec; border: 1px solid #204b62; border-radius: 2px; outline: 0; background: #071722; font-size: 11px; line-height: 1.55; resize: vertical; }
.script-worktable input { min-height: 36px; }
.script-worktable td > span { display: inline-block; padding: 6px 8px; color: #8bb3c1; border: 1px solid #244d62; background: #0b2635; font-size: 10px; white-space: nowrap; }
.character-worktable { min-width: 680px; }
.character-worktable th:nth-child(2) { width: 220px; }
.character-worktable .character { padding: 0; border: 0; background: transparent; }
.character-worktable .character input, .character-worktable .character textarea { font-size: 11px; }
.script-copy, .character-list, .asset-card, .production-toolbar { color: var(--tech-text); border-color: var(--tech-line); background: #0a1c29; box-shadow: none; }
.script-copy { border-top-color: var(--tech-cyan); }
.character-list { border-top-color: var(--tech-orange); }
.script-copy > label, .script-scene label, .character label, .prompt-editor, .asset-ratio-field { color: #7f9dab; }
.script-scene { border-color: var(--tech-line); }
.script-scene h3 { color: var(--tech-orange); }
.production-toolbar { min-height: 72px; padding: 13px 16px; border: 1px solid var(--tech-line); border-top: 2px solid var(--tech-cyan); border-left-width: 1px; border-radius: 3px; background: #091d2b; }
.production-toolbar > div:first-child strong { color: #e0f1f6; font-size: 14px; }
.selection-note { color: #577a8d; }
.compact-field { color: #7191a2; }
.shot-table-wrap { border-color: var(--tech-line); box-shadow: 0 15px 35px rgba(0,0,0,.18); }
.shot-table { color: #9ab4c0; background: #081925; }
.shot-table th { color: #618397; border-color: var(--tech-line); background: #0b2231; }
.shot-table td { border-color: var(--tech-line); background: #091b28; }
.shot-table tbody tr:hover td { background: #0b2231; }
.table-shot-title b { color: var(--tech-cyan); }
.table-preview, .asset-media { background: #06131f; }
.media-empty { color: #37647a; background: repeating-linear-gradient(135deg,#071923,#071923 10px,#091d29 10px,#091d29 20px); }
.inline-editor, .prompt-editor-stack > label, .advanced-prompts label { color: #7293a3; }
.prompt-editor-stack > label { border-color: #1d4d65; border-top-color: var(--tech-cyan); background: #0a2130; }
.prompt-editor-stack > label:nth-child(2) { border-top-color: var(--tech-green); color: #76a89a; background: #09221f; }
.prompt-editor-stack .prompt-mentions span, .reference-assets span { color: #54d7c3; border-color: #1b725f; background: rgba(30,160,130,.12); }
.reference-plan { border-color: #1c485e; background: #081d2a; }
.reference-plan b { color: #b4ccd6; }
.reference-plan small { color: #52788b; }
.state-chip { color: #7da0b0; background: #102c3b; border-left-color: var(--tech-cyan); }
.table-action { color: #86bec8; border-color: #285a6f; }
.table-action:hover { border-color: var(--tech-cyan); background: var(--tech-cyan-soft); }
.table-action.primary { color: white; border-color: var(--tech-orange); background: var(--tech-orange); }
.asset-card { color: #a9c2cd; border-top-color: var(--tech-cyan); background: #0a1c29; }
.asset-card:hover { box-shadow: 0 16px 34px rgba(0,0,0,.28); }
.asset-body { color: #a8c0cb; background: #0a1c29; }
.asset-body > p { color: #91aebb; line-height: 1.6; }
.asset-body .check-label { color: #d8e9ef; }
.asset-body .check-label strong { color: #e4f2f6; }
.asset-body .prompt-editor, .asset-body .asset-ratio-field { color: #84a9b8; }
.asset-body textarea, .asset-body input, .asset-body select { color: #d5e9ef; border-color: #25536a; background: #071823; }
.asset-body textarea:focus, .asset-body input:focus, .asset-body select:focus { border-color: var(--tech-cyan); box-shadow: 0 0 0 2px rgba(53,213,223,.08); }
.asset-pull-button { color: #b8e0e7; border-color: #347088; background: #0d3042; }
.asset-pull-button:hover:not(:disabled) { color: #effdff; border-color: var(--tech-cyan); background: #104157; box-shadow: 0 8px 20px rgba(53,213,223,.16); }
.asset-select-all { color: #b8d3dc; border: 1px solid #28556b; border-left: 3px solid var(--tech-cyan); border-radius: 2px; background: #0a2332; }
.asset-select-all input { accent-color: var(--tech-cyan); }
.asset-actions span { color: #6d91a1; }
.asset-media > span { color: var(--tech-cyan); background: #061722; }
.download-button { color: #b9e4e8; border-color: #276276; background: #0d2b3a; }
.media-links a, .media-links button, .delivery-card-actions a { color: #77cfd5; border-color: #24556c; background: #0a2433; }
.advanced-prompts { border-color: var(--tech-line); background: #081b27; }
.advanced-prompts summary { color: #6d9aac; }
.asset-empty, .preview-placeholder { color: #57798b; border-color: #245168; background: #081925; }

.delivery-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--tech-line); border-top: 2px solid var(--tech-cyan); border-radius: 3px; background: #091d2b; }
.delivery-head h2 { margin: 3px 0 3px; color: #eef8fb; font-size: 14px; }
.delivery-head p:not(.eyebrow) { margin: 0; color: #6e8c9c; }
.delivery-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.delivery-workspace { display: grid; grid-template-columns: minmax(0,1fr) 300px; align-items: start; gap: 14px; }
.delivery-main { min-width: 0; }
.delivery-summary { display: grid; grid-template-columns: repeat(4,1fr); margin: 0 0 14px; border: 1px solid var(--tech-line); }
.delivery-summary span { padding: 14px 16px; color: #628596; border-right: 1px solid var(--tech-line); font-size: 10px; }
.delivery-summary span:last-child { border-right: 0; }
.delivery-summary b { margin-right: 6px; color: var(--tech-cyan); font: 700 18px Consolas,monospace; }
.delivery-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; }
.delivery-card { overflow: hidden; border: 1px solid var(--tech-line); border-radius: 3px; background: #091b28; }
.delivery-media { height: 180px; position: relative; overflow: hidden; background: #06131f; }
.delivery-media img, .delivery-media video { width: 100%; height: 100%; object-fit: cover; }
.delivery-media > button { position: absolute; right: 9px; bottom: 9px; min-height: 30px; padding: 0 10px; color: #07141e; border: 0; background: var(--tech-cyan); font-size: 10px; font-weight: 800; }
.delivery-card-body { padding: 14px; }
.delivery-card-body > small { color: #4f7589; font: 700 9px Consolas,monospace; }
.delivery-card-body h3 { margin: 7px 0 12px; color: #d8e9ef; font-size: 15px; }
.delivery-card-body > div:not(.delivery-card-actions) { display: flex; gap: 8px; }
.delivery-card-body > div:not(.delivery-card-actions) span { padding: 4px 7px; color: #6f94a5; background: #102b3a; font-size: 9px; }
.delivery-card-body p { font-size: 10px; line-height: 1.5; }
.delivery-card-actions { margin-top: 12px; display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; }
.delivery-card-actions a { min-height: 30px; display: grid; place-items: center; text-decoration: none; font-size: 10px; }
.delivery-task-log { min-width: 0; position: sticky; top: 130px; overflow: hidden; border: 1px solid var(--tech-line); border-top: 2px solid var(--tech-orange); border-radius: 3px; background: #081925; }
.delivery-log-head { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--tech-line); background: #0b2231; }
.delivery-log-head span, .delivery-log-head b { display: block; }
.delivery-log-head span { color: #4f7e92; font: 700 8px Consolas,monospace; }
.delivery-log-head b { margin-top: 3px; color: #d9eaf0; font-size: 12px; }
.delivery-log-head em { color: #779bac; font-size: 9px; font-style: normal; }
.delivery-log-list { max-height: calc(100vh - 285px); overflow-y: auto; }
.delivery-log-item { display: grid; grid-template-columns: 8px minmax(0,1fr); gap: 8px; padding: 10px 11px; border-bottom: 1px solid #102f41; }
.delivery-log-item:last-child { border-bottom: 0; }
.delivery-log-item > i { width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: #52839a; box-shadow: 0 0 8px rgba(82,131,154,.4); }
.delivery-log-item.running > i, .delivery-log-item.info > i { background: var(--tech-cyan); box-shadow: 0 0 9px rgba(53,213,223,.55); }
.delivery-log-item.success > i { background: var(--tech-green); box-shadow: 0 0 9px rgba(70,215,160,.5); }
.delivery-log-item.error > i { background: var(--tech-red); box-shadow: 0 0 9px rgba(255,107,107,.5); }
.delivery-log-item p { margin: 0; color: #a8c0cb; font-size: 10px; line-height: 1.55; }
.delivery-log-item time { display: block; margin-top: 4px; color: #4f7183; font: 8px Consolas,monospace; }
.delivery-log-empty { margin: 0; padding: 22px 14px; color: #56798b; font-size: 10px; line-height: 1.6; }

.credits-view { color: var(--tech-text); }
.credits-header, .credits-toolbar { border-color: var(--tech-line); background: transparent; }
.credits-header h1 { color: #eef8fb; }
.credits-header p { color: #6c8b9b; }
.credits-summary { border-color: var(--tech-line); background: #081925; }
.credits-summary > div { border-color: var(--tech-line) !important; }
.credits-summary span, .credits-summary small { color: #5f8092; }
.credits-summary strong { color: var(--tech-cyan); }
.credits-filters { border-color: var(--tech-line); background: #061520; }
.credits-filters button { color: #65879a; }
.credits-filters button.active { color: #07141e; background: var(--tech-cyan); }
.credits-table-wrap, .credits-table th, .credits-table td { border-color: var(--tech-line); }
.credits-table { color: #93adba; background: #081925; }
.credits-table th { color: #5e8295; background: #0b2231; }

dialog { color: var(--tech-text); border-color: #27566e; background: #091b29; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2,9,15,.78); backdrop-filter: blur(6px); }
.dialog-form { color: var(--tech-text); background: #091b29; }
.dialog-header { border-color: var(--tech-line); }
.dialog-header h2 { color: #edf7fa; }
.dialog-form label { color: #7797a8; }
.script-source-switch { border-color: var(--tech-line); background: #061722; }
.script-source-switch label:has(input:checked) { color: #06131f; background: var(--tech-cyan); }
.provider-params-panel, .cost-estimate { color: #77a0b0; border-color: var(--tech-line); background: #081925; }
.project-form-section { margin-bottom: 14px; padding: 15px; border: 1px solid var(--tech-line); border-radius: 3px; background: #081925; }
.project-source-section { border-top: 2px solid var(--tech-cyan); }
.project-setup-section { border-top: 2px solid var(--tech-orange); }
.project-form-section-title { min-height: 34px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 11px; border-bottom: 1px solid var(--tech-line); }
.project-form-section-title > span { width: 28px; height: 28px; display: grid; place-items: center; color: #06131f; border-radius: 2px; background: var(--tech-cyan); font: 800 10px Consolas,monospace; }
.project-setup-section .project-form-section-title > span { background: var(--tech-orange); }
.project-form-section-title b, .project-form-section-title small { display: block; }
.project-form-section-title b { color: #e1eff4; font-size: 12px; }
.project-form-section-title small { margin-top: 2px; color: #66899a; font-size: 9px; }
.project-form-section > label, .project-form-section .form-grid > label { display: grid; gap: 7px; margin-bottom: 13px; color: #8ba9b6; font-size: 11px; font-weight: 700; }
.project-form-section label small { color: #5f8293; font-weight: 400; }
.script-import-toolbar { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 6px 5px 10px; color: #7093a3; border: 1px dashed #2b6077; border-radius: 2px; background: #071722; font-size: 10px; font-weight: 500; }
.script-import-toolbar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.script-file-button { min-height: 28px; flex: 0 0 auto; padding: 0 11px; color: #062029; border: 1px solid #5ee8ed; border-radius: 2px; background: var(--tech-cyan); font-size: 9px; font-weight: 800; }
#projectDialog { width: min(780px,calc(100vw - 28px)); }
#projectDialog .dialog-form { padding: 22px; }
#projectDialog .dialog-header { margin-bottom: 15px; }
#projectDialog .dialog-header h2 { color: #eef7fa; font: 700 23px "Microsoft YaHei",sans-serif; }
#projectDialog .cost-estimate { margin-top: 0; }
.preview-dialog, .preview-shell { background: #050e15; }
.preview-topbar { border-color: var(--tech-line); }
.toast { color: #07141e; border-color: var(--tech-cyan); background: var(--tech-cyan); }
.danger-text { color: var(--tech-red) !important; }

@media (max-width: 1100px) {
  .commercial-director { grid-template-columns: 165px minmax(0,1fr); }
  .commercial-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--tech-line); border-left: 0; }
  .commercial-inspector-tabs { display: none; }
  .commercial-inspector > section { padding: 14px; border-right: 1px solid var(--tech-line); }
  .portfolio-metrics { grid-template-columns: repeat(2,1fr); }
  .portfolio-metrics > div:nth-child(2) { border-right: 0; }
  .portfolio-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--tech-line); }
  .portfolio-toolbar { align-items: stretch; flex-wrap: wrap; }
  .portfolio-search { min-width: 100%; }
  .portfolio-filters { flex: 1; }
  .delivery-head { align-items: flex-start; flex-direction: column; }
  .delivery-actions { justify-content: flex-start; }
  .delivery-workspace { grid-template-columns: minmax(0,1fr) 260px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .projects-view { padding: 24px 20px 44px; }
  .projects-header { align-items: flex-start; flex-direction: column; }
  .content-tabs { padding: 0 18px; overflow-x: auto; }
  .content-tabs button { flex: 0 0 auto; padding: 0 15px; }
  .shots-panel, .assets-panel, .script-panel, .delivery-panel { padding: 20px; }
  .shots-panel { padding: 0 0 40px; }
  .commercial-director { display: block; }
  .commercial-shot-rail { padding: 7px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--tech-line); }
  .commercial-rail-head, .commercial-rail-filter { display: none; }
  .commercial-shot-list { max-height: none; display: flex; overflow-x: auto; }
  .commercial-shot-wrap { min-width: 170px; }
  .commercial-shot { min-width: 0; }
  .commercial-director-stage { padding: 14px 12px; }
  .commercial-inspector { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .director-prompt-workbench { grid-template-columns: 1fr; }
  .script-overview { grid-template-columns: 1fr; }
  .delivery-workspace { grid-template-columns: 1fr; }
  .delivery-task-log { position: static; }
  .delivery-log-list { max-height: 340px; }
}

@media (max-width: 620px) {
  .projects-view { padding: 18px 12px 36px; }
  .projects-header h1 { font-size: 29px; }
  .projects-header .primary-button { width: 100%; }
  .portfolio-metrics { grid-template-columns: repeat(2,1fr); }
  .portfolio-metrics > div { min-height: 92px; padding: 15px; }
  .portfolio-metrics strong { font-size: 25px; }
  .portfolio-toolbar { padding: 8px; }
  .portfolio-filters { width: 100%; overflow-x: auto; }
  .portfolio-filters button { flex: 1 0 auto; padding: 0 10px; }
  .portfolio-toolbar > .secondary-button { width: 100%; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-output { grid-template-columns: repeat(3,auto); }
  .portfolio-output button { grid-column: 1/-1; text-align: left; }
  .project-header, .production-status { padding-left: 16px; padding-right: 16px; }
  .shots-panel, .assets-panel, .script-panel, .delivery-panel { padding: 14px 12px 32px; }
  .delivery-summary { grid-template-columns: repeat(2,1fr); }
  .delivery-summary span:nth-child(2) { border-right: 0; }
  .delivery-summary span:nth-child(-n+2) { border-bottom: 1px solid var(--tech-line); }
  .delivery-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .commercial-stage-head { align-items: flex-start; flex-direction: column; }
  .project-mode .production-status { padding: 9px 12px; gap: 9px; }
  .project-mode .status-heading small { display: none; }
  .project-mode .progress-track { width: 88px; }
  .project-mode .status-heading b { font-size: 11px; }
  .commercial-stage-head > div:last-child { width: 100%; }
  .commercial-stage-head button { flex: 1; }
  .commercial-monitor-media { height: 230px; }
  .commercial-inspector { grid-template-columns: 1fr; }
  .commercial-inspector > section { border-right: 0; }
  .script-toolbar { align-items: stretch; flex-direction: column; }
  .script-toolbar button { width: 100%; }
  .director-prompt-head { align-items: stretch; flex-direction: column; }
  .director-prompt-head > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .director-prompt-head button { min-height: 34px; }
  .assets-panel .toolbar-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .assets-panel .toolbar-actions .compact-field { min-width: 0; grid-column: auto; align-items: stretch; flex-direction: column; }
  .assets-panel .toolbar-actions .compact-field select { width: 100%; }
  .assets-panel .toolbar-actions .primary-button { grid-column: 1 / -1; }
  #projectDialog .dialog-form { padding: 14px; }
  .project-form-section { padding: 12px; }
  .project-form-section .form-grid { grid-template-columns: 1fr; }
  .script-import-toolbar { align-items: stretch; flex-direction: column; }
  .script-file-button { width: 100%; min-height: 34px; }
  .delivery-head { padding: 13px; }
}

/* Responsive typography and brand polish */
* { letter-spacing: 0 !important; }
html { font-size: 16px; }
body { font-size: 13px; line-height: 1.5; }
.topbar { min-height: 66px; }
.portfolio-mode .topbar, .project-mode .topbar { justify-content: flex-start; }
.portfolio-mode .topbar-actions, .project-mode .topbar-actions { margin-left: auto; }
.portfolio-mode .mobile-brand, .project-mode .mobile-brand { gap: 12px; }
.portfolio-mode .mobile-brand-logo, .project-mode .mobile-brand-logo { width: 76px; height: 26px; }
.portfolio-mode .mobile-brand strong, .project-mode .mobile-brand strong { font-size: 13px; }
.breadcrumb { font-size: 11px; }
.points-badge, .account-button { font-size: 11px; }
.content-tabs button { font-size: 11px; font-weight: 750; }
.commercial-rail-head b { font-size: 13px; }
.commercial-rail-head span, .commercial-rail-filter button { font-size: 9px; }
.commercial-shot { min-height: 62px; }
.commercial-shot > span { font-size: 11px; }
.commercial-shot b { font-size: 11px; }
.commercial-shot small { font-size: 9px; }
.commercial-stage-head > div:first-child > span { font-size: 9px; }
.commercial-stage-head h2 { font-size: 22px; }
.commercial-stage-head small { font-size: 10px; }
.commercial-monitor-top, .commercial-monitor-bottom { font-size: 9px; }
.commercial-inspect-title b { font-size: 11px; }
.commercial-inspect-title span, .commercial-inspector label, .commercial-inspector p { font-size: 9px; }
.commercial-inspector select, .commercial-inspector input, .commercial-inspector textarea { font-size: 10px; }
.commercial-inspector textarea { line-height: 1.65; }
.commercial-generate, .commercial-video-generate { min-height: 36px; font-size: 10px; }
.script-copy > label, .script-scene label, .character label, .prompt-editor, .asset-ratio-field { font-size: 11px; }
.script-copy input, .script-copy textarea, .script-scene input, .script-scene textarea, .character input, .character textarea { font-size: 12px; }
.asset-body > p, .delivery-card-body, .credits-table { font-size: 11px; }
.portfolio-card-copy p { font-size: 12px; }
.portfolio-card-copy small, .portfolio-status, .portfolio-output span { font-size: 10px; }
.mode-badge { display: none !important; }

@media (min-width: 1400px) {
  .commercial-director { grid-template-columns: 210px minmax(620px,1fr) 350px; }
  .commercial-director-stage { padding: 20px 24px; }
  .commercial-inspector { padding-left: 16px; padding-right: 16px; }
  .commercial-monitor-media { height: min(52vh,520px); }
  .projects-view { max-width: 1700px; width: 100%; margin: 0 auto; }
  .portfolio-grid { grid-template-columns: repeat(3,minmax(330px,1fr)); }
}

@media (max-width: 700px) {
  body { font-size: 12px; }
  .topbar { height: 58px; min-height: 58px; padding: 0 10px; gap: 7px; }
  .portfolio-mode .mobile-brand, .project-mode .mobile-brand { gap: 6px; margin-right: 0; }
  .portfolio-mode .mobile-brand-logo, .project-mode .mobile-brand-logo { width: 62px; height: 21px; }
  .portfolio-mode .mobile-brand strong, .project-mode .mobile-brand strong { padding-left: 7px; font-size: 11px; }
  .back-projects-button { width: 34px; min-width: 34px; padding: 0; font-size: 0; }
  .back-projects-button::before { content: '←'; font-size: 15px; }
  .points-badge { min-height: 32px; padding: 0 7px; font-size: 9px; }
  .points-badge b { font-size: 11px; }
  .account-button { min-height: 32px; padding: 3px; }
  .account-button span { width: 25px; height: 25px; }
  .project-mode .content-tabs { min-height: 50px; padding: 0 8px; }
  .project-mode .content-tabs button { min-height: 50px; padding: 0 13px; font-size: 11px; }
  .director-batch-bar { min-height: 58px; top: 58px; justify-content: flex-start; gap: 9px; padding: 8px 10px; overflow-x: auto; }
  .director-selection { min-width: max-content; flex: 0 0 auto; gap: 7px; }
  .director-selection b { min-width: 48px; padding-left: 5px; padding-right: 5px; }
  .director-batch-actions { display: flex; flex: 0 0 auto; }
  .director-batch-actions button { min-width: max-content; padding: 0 10px; }
  .director-batch-actions button small { display: none; }
  .commercial-shot-wrap { min-width: 174px; }
  .commercial-shot { min-width: 0; min-height: 64px; }
  .commercial-stage-head h2 { font-size: 20px; }
  .commercial-monitor-top { font-size: 8px; }
  .commercial-inspect-title b { font-size: 12px; }
  .commercial-inspector label, .commercial-inspector p { font-size: 10px; }
  .commercial-inspector select, .commercial-inspector input, .commercial-inspector textarea { font-size: 11px; }
}

@media (max-width: 430px) {
  .portfolio-mode .mobile-brand strong, .project-mode .mobile-brand strong { display: none; }
  .portfolio-mode .mobile-brand-logo, .project-mode .mobile-brand-logo { width: 58px; }
  .topbar-actions { gap: 4px; }
  .projects-header h1 { font-size: 27px; }
  .portfolio-card-copy h2 { font-size: 18px; }
  .commercial-monitor-media { height: 220px; }
}
