:root {
  color-scheme: dark;
  --bg: #101210;
  --panel: #161917;
  --panel-2: #1d211e;
  --panel-3: #252a26;
  --line: #303631;
  --line-strong: #414941;
  --text: #f4f3ed;
  --muted: #9ba29a;
  --faint: #6d746e;
  --lime: #c6f56d;
  --lime-ink: #18200e;
  --amber: #e9b35a;
  --cyan: #78c9c3;
  --danger: #ee887d;
  --radius: 6px;
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.app-shell { display: grid; grid-template-columns: 58px minmax(0, 1fr); height: 100dvh; }
.rail { padding: 12px 8px; border-right: 1px solid var(--line); background: #0c0e0c; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 30; }
.brand-mark, .avatar-button { width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; background: var(--text); color: #111; font-weight: 800; }
.avatar-button { background: #342c40; color: #eadffc; border-color: #554663; font-size: 11px; }
.rail-nav { display: grid; gap: 6px; margin-top: 18px; }
.rail-spacer { flex: 1; }
.rail-button, .icon-button { width: 38px; height: 38px; border: 1px solid transparent; border-radius: var(--radius); display: inline-grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.rail-button:hover, .icon-button:hover { color: var(--text); background: var(--panel-3); }
.rail-button.active { background: var(--lime); color: var(--lime-ink); }
.rail-button.active { cursor: default; }

.app-main { min-width: 0; min-height: 0; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: 58px minmax(0, 1fr); }
.topbar { padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); background: #131613; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-identity, .topbar-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.project-title { overflow: hidden; color: var(--text); font-size: 15px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { margin-bottom: 3px; color: var(--lime); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.1px; }
.runtime-pill { margin-right: 4px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.runtime-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(233,179,90,.1); }
.runtime-pill.connected { color: #dce5d8; }
.runtime-pill.connected span { background: var(--lime); box-shadow: 0 0 0 3px rgba(198,245,109,.1); }
.account-metrics { height: 40px; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #101310; }
.account-metrics > span { min-width: 58px; padding: 5px 9px; display: grid; align-content: center; line-height: 1.05; }
.account-metrics > span + span { border-left: 1px solid var(--line); }
.account-metrics small, .account-metrics b { display: block; }
.account-metrics small { color: var(--faint); font-size: 8px; }
.account-metrics b { margin-top: 4px; color: #e5e8e1; font-size: 11px; font-variant-numeric: tabular-nums; }
.account-metrics > span:first-child b { color: var(--lime); }
.primary-button, .secondary-button, .generate-button { min-height: 36px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 650; }
.compact-action { min-width: 66px; }
.compact-action svg { width: 15px; height: 15px; }
.secondary-button { background: var(--panel-2); color: var(--text); }
.version-switch { text-decoration: none; }
.secondary-button:hover { border-color: #5b645c; background: var(--panel-3); }
.primary-button, .generate-button { border-color: var(--lime); background: var(--lime); color: var(--lime-ink); }
.primary-button:hover, .generate-button:hover { background: #d2fb82; }
.mobile-only { display: none; }

.studio-grid { min-height: 0; height: 100%; overflow: hidden; display: grid; grid-template-columns: 360px minmax(430px, 1fr) 320px; }
.director-panel, .sequence-panel { min-width: 0; min-height: 0; background: var(--panel); }
.director-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-right: 1px solid var(--line); }
.panel-heading, .sequence-heading { min-height: 65px; padding: 14px 16px 11px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading h1, .sequence-heading h2 { margin: 0; font-size: 17px; font-weight: 680; }
.panel-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.control-section { padding: 17px 18px; border-top: 1px solid var(--line); }
.section-title-row { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #d7dbd5; font-size: 12px; font-weight: 650; }
.prompt-box { border: 1px solid var(--line-strong); border-radius: var(--radius); background: #101310; overflow: hidden; }
.prompt-box:focus-within { border-color: #75876c; }
.mention-menu { border-top: 1px solid var(--line-strong); background: #192019; }
.mention-menu[hidden], .mention-empty[hidden] { display: none; }
#mentionOptions { position: relative; max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.mention-option { width: 100%; min-height: 54px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.mention-option[aria-selected='true'], .mention-option:hover { background: #2c3825; color: var(--lime); }
.mention-preview { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; background: #101310; border-radius: 4px; overflow: hidden; }
.mention-preview img { width: 100%; height: 100%; object-fit: cover; }
.mention-preview svg { width: 18px; height: 18px; }
.mention-label { min-width: 0; }
.mention-label b, .mention-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-label b { font-size: 12px; }
.mention-label small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.mention-empty { padding: 14px 10px; color: var(--muted); font-size: 12px; }
.prompt-tags { padding: 9px 9px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 7px 3px 4px; border: 1px solid #46504a; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; background: #232925; color: #dce1da; font-size: 10px; cursor: pointer; }
.tag-thumb { width: 18px; height: 18px; border-radius: 50%; background-position: center; background-size: cover; }
.prompt-box textarea { width: 100%; min-height: 122px; padding: 12px; resize: vertical; border: 0; background: transparent; color: var(--text); font-size: 12px; line-height: 1.7; }
.prompt-box textarea:focus { outline: 0; }
.prompt-actions { padding: 7px 9px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 10px; }
.text-icon-button { padding: 0; border: 0; display: inline-flex; align-items: center; gap: 5px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.text-icon-button:hover { color: var(--lime); }
.text-icon-button svg { width: 14px; height: 14px; }
.prompt-context { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.prompt-context svg { width: 13px; height: 13px; color: var(--lime); }

.asset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.asset-tile { min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 42px minmax(0, 1fr) 14px; align-items: center; gap: 7px; background: #111411; text-align: left; cursor: pointer; }
.asset-tile:hover { border-color: var(--line-strong); }
.asset-tile.selected { border-color: #506344; background: #1c2418; }
.asset-photo { width: 42px; aspect-ratio: 1; border-radius: 4px; background-position: center; background-size: cover; }
.asset-tile span:nth-child(2) { min-width: 0; }
.asset-tile b, .asset-tile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-tile b { font-size: 11px; }
.asset-tile small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.asset-tile svg { width: 12px; color: var(--lime); }
.character-one { background-image: url('./assets/character.jpg'); }
.location-one { background-image: url('./assets/scene-rain.jpg'); }

.media-dropzone { width: 100%; min-height: 68px; padding: 10px 12px; border: 1px dashed #465048; border-radius: var(--radius); display: flex; align-items: center; gap: 10px; background: #101310; color: var(--muted); text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.media-dropzone:hover, .media-dropzone.dragging { border-color: var(--lime); background: #192016; }
.media-dropzone > svg { width: 22px; height: 22px; color: var(--lime); }
.media-dropzone span, .media-dropzone b, .media-dropzone small { display: block; }
.media-dropzone b { color: #e2e5df; font-size: 11px; }
.media-dropzone small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.media-summary { min-height: 34px; display: flex; align-items: center; gap: 13px; color: var(--faint); font-size: 9px; }
.media-summary span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.media-summary svg { width: 12px; height: 12px; }
.media-summary b { color: #dce0d9; font-size: 10px; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.media-empty { grid-column: 1 / -1; padding: 4px 0 1px; color: var(--faint); font-size: 10px; }
.media-item { position: relative; min-width: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #202520; }
.media-item img, .media-item video { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-item .media-kind { position: absolute; left: 4px; bottom: 4px; padding: 2px 4px; border-radius: 3px; background: rgba(9,11,9,.74); color: #fff; font-size: 8px; }
.media-item .remove-media { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(8,10,8,.8); color: #fff; cursor: pointer; }
.media-item .remove-media svg { width: 11px; height: 11px; }
.media-file-icon { width: 100%; height: 100%; display: grid; place-items: center; color: var(--cyan); }
.media-file-icon svg { width: 23px; height: 23px; }

.setting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings-section label { min-width: 0; display: grid; gap: 5px; color: var(--faint); font-size: 9px; }
.settings-section select { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: #111411; color: #e4e6e1; font-size: 11px; }
.wide-control { margin-top: 8px; }
.icon-button.compact { width: 28px; height: 28px; }
.icon-button.compact svg { width: 14px; height: 14px; }
.generation-bar { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #131613; }
.generation-bar > div span, .generation-bar > div strong { display: block; }
.generation-bar > div span { color: var(--faint); font-size: 9px; }
.generation-bar > div strong { margin-top: 3px; font-size: 12px; }
.generate-button { min-width: 128px; }

.stage { min-width: 0; min-height: 0; height: 100%; overflow: hidden; display: grid; grid-template-rows: 54px minmax(0, 1fr) auto 51px; background: #090b09; }
.stage-toolbar { padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1e221f; }
.stage-status { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.stage-status span:last-child { color: var(--faint); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.stage-tools { display: flex; gap: 2px; }
.stage-format { margin-right: 4px; display: flex; align-items: center; color: var(--muted); font-size: 9px; }
.stage-format span { padding: 4px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #111411; }
.stage-format span:first-child { border-left: 1px solid var(--line); border-radius: 4px 0 0 4px; color: #dce2d9; }
.stage-format span:last-child { border-right: 1px solid var(--line); border-radius: 0 4px 4px 0; }
.stage-format span + span { border-left: 1px solid var(--line); }
.canvas-wrap { --canvas-inset: 16px; position: relative; min-height: 0; overflow: hidden; }
.canvas { position: absolute; inset: var(--canvas-inset); min-width: 0; min-height: 0; overflow: hidden; background: #050705; box-shadow: 0 16px 48px rgba(0,0,0,.28); }
.canvas > img, .canvas > video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; background: #050705; transition: opacity .22s ease; }
.canvas > video[hidden], .canvas > img[hidden] { display: none; }
.playback-error { position: absolute; inset: 0; z-index: 1; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; background: #101310; }
.playback-error[hidden] { display: none; }
.playback-error > span { max-width: 360px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.canvas-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 100px rgba(0,0,0,.45); pointer-events: none; }
.canvas-meta { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between; color: rgba(255,255,255,.78); font-family: ui-monospace, Consolas, monospace; font-size: 10px; }
.generation-overlay { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 9px; background: rgba(9,11,9,.84); backdrop-filter: blur(8px); }
.generation-overlay[hidden] { display: none; }
.generation-overlay strong { font-size: 14px; }
.generation-overlay span { color: var(--muted); font-size: 11px; }
.loader { width: 30px; height: 30px; border: 2px solid #3a423b; border-top-color: var(--lime); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.transport { padding: 0 13px; border-top: 1px solid #1e221f; display: flex; align-items: center; gap: 4px; }
.transport-play { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; background: var(--text); color: #111; cursor: pointer; }
.transport-play:disabled { border-color: var(--line); background: #242824; color: var(--faint); cursor: default; }
.timecode { margin-left: 7px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 10px; }
.transport-spacer { flex: 1; }
.sequence-panel { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; border-left: 1px solid var(--line); }
.history-more { margin: 0 12px 12px; }
.task-poster { width: 100%; height: 100%; min-height: 48px; display: grid; place-items: center; background: #242a24; color: #a5b99b; border-radius: 4px; }
.task-detail-text { white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; max-height: 55dvh; line-height: 1.7; user-select: text; }
.sequence-panel.attention { box-shadow: inset 3px 0 0 var(--lime); }
.sequence-heading { padding-bottom: 8px; }
.sequence-summary { padding: 0 16px 11px; display: flex; gap: 8px; color: var(--faint); font-size: 9px; }
.sequence-summary span + span::before { content: '·'; margin-right: 8px; }
.record-filters { margin: 0 12px 10px; padding: 3px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: #101310; }
.record-filters button { min-width: 0; height: 29px; padding: 0 5px; border: 0; border-radius: 3px; background: transparent; color: var(--faint); font-size: 9px; cursor: pointer; }
.record-filters button:hover { color: var(--text); }
.record-filters button.active { background: var(--panel-3); color: var(--lime); }
.shot-list { min-height: 0; padding: 5px 12px 12px; overflow: auto; display: grid; align-content: start; gap: 8px; }
.shot-card { position: relative; min-width: 0; min-height: 76px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 22px 84px minmax(0, 1fr) 20px; align-items: center; gap: 7px; background: #111411; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.shot-card:hover { border-color: #4c544d; }
.shot-card.active { border-color: var(--lime); background: #1c2218; transform: translateX(-2px); }
.shot-card img { width: 84px; height: 58px; border-radius: 3px; object-fit: cover; }
.shot-index { color: var(--faint); font-size: 9px; align-self: start; padding-top: 4px; }
.shot-info { min-width: 0; }
.shot-info b, .shot-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-info b { font-size: 11px; }
.shot-info small { margin-top: 6px; color: var(--faint); font-size: 9px; }
.shot-state { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; }
.shot-state svg { width: 10px; height: 10px; }
.shot-state.ready { background: #314226; color: var(--lime); }
.shot-state.working { background: #473820; color: var(--amber); }
.shot-state.working svg { animation: spin 1.2s linear infinite; }
.shot-state.failed { background: #452621; color: var(--danger); }
.shot-state.queued { background: #29323a; color: #9bc4e1; }
.shot-card.task-card .shot-info small { white-space: normal; line-height: 1.35; }
.shot-card.task-card img { background: #232823; }
.wide { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(420px, calc(100vw - 28px)); padding: 11px 14px; border: 1px solid #566051; border-radius: var(--radius); background: #242a22; color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.4); font-size: 12px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.connect-dialog { width: min(430px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); color: var(--text); box-shadow: 0 28px 90px rgba(0,0,0,.66); }
.connect-dialog::backdrop { background: rgba(5,7,5,.72); backdrop-filter: blur(5px); }
.connect-card { padding: 18px; display: grid; gap: 14px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font-size: 18px; }
.connect-card > label:not(.remember-row) { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.connect-card input[type='url'], .connect-card input[type='password'], .connect-card input[type='text'] { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: #0f120f; color: var(--text); }
.connect-card input[readonly] { color: var(--muted); cursor: text; }
.remember-row { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.dialog-note { padding: 10px; border: 1px solid #354137; border-radius: 4px; display: flex; gap: 8px; background: #192019; color: #aeb8ac; font-size: 10px; line-height: 1.55; }
.dialog-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--lime); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.wallet-preview { padding: 12px; border: 1px solid #354137; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; background: #192019; }
.wallet-preview span { color: var(--muted); font-size: 10px; }
.wallet-preview strong { color: var(--lime); font-size: 19px; }
.purchase-link { color: var(--lime); font-size: 11px; text-decoration: none; }
.purchase-link:hover { text-decoration: underline; }
.api-auth-row { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; background: #101310; }
.api-auth-row span { color: var(--faint); font-size: 9px; }
.api-auth-row code { color: #dce3d8; font-family: Consolas, monospace; font-size: 11px; }
.generate-button:disabled, .primary-button:disabled { opacity: .55; cursor: wait; }

@media (max-width: 1180px) {
  .studio-grid { grid-template-columns: 324px minmax(390px, 1fr) 276px; }
  .account-metrics > span:nth-child(2), .account-metrics > span:nth-child(4) { display: none; }
  .shot-card { grid-template-columns: 20px 68px minmax(0, 1fr) 18px; }
  .shot-card img { width: 68px; height: 50px; }
}

@media (max-width: 960px) {
  body { overflow: auto; }
  .app-shell { min-height: 100dvh; height: auto; grid-template-columns: 52px minmax(0, 1fr); }
  .app-main { min-height: 100dvh; }
  .studio-grid { min-height: calc(100dvh - 58px); grid-template-columns: minmax(0, 1fr) 264px; grid-template-areas: 'stage sequence'; }
  .director-panel { position: fixed; z-index: 50; inset: 0 auto 0 52px; width: min(360px, calc(100vw - 52px)); box-shadow: 20px 0 60px rgba(0,0,0,.55); transform: translateX(-110%); transition: transform .22s ease; }
  .director-panel.open { transform: translateX(0); }
  .stage { grid-area: stage; }
  .sequence-panel { grid-area: sequence; }
  .mobile-only { display: inline-grid; }
}

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-main { height: auto; overflow: visible; }
  .rail { display: none; }
  .topbar { padding: 0 10px; }
  .topbar-actions .runtime-pill, .topbar-actions .account-metrics, .topbar-actions .secondary-button, .topbar-actions > .icon-button { display: none; }
  .topbar-actions #apiInfoButton, .topbar-actions #rechargeButton { width: 38px; min-width: 38px; padding: 0; display: inline-flex; }
  .topbar-actions #apiInfoButton span, .topbar-actions #rechargeButton span { display: none; }
  .studio-grid { min-height: 0; height: auto; overflow: visible; display: flex; flex-direction: column; }
  .director-panel { left: 0; width: min(380px, 92vw); }
  .stage { min-height: 490px; height: 62vh; flex: 0 0 auto; order: 1; grid-template-rows: 48px minmax(200px, 1fr) auto 48px; }
  .canvas-wrap { --canvas-inset: 12px; }
  .sequence-panel { min-height: 360px; order: 2; border-left: 0; border-top: 1px solid var(--line); }
  .sequence-panel { grid-template-rows: auto auto auto auto auto auto; }
  .stage-format span:first-child { display: none; }
  .stage-format span:nth-child(2) { border-left: 1px solid var(--line); border-radius: 4px 0 0 4px; }
  .shot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .shot-card { grid-template-columns: 18px 58px minmax(0, 1fr); }
  .shot-card img { width: 58px; height: 48px; }
  .shot-state { display: none; }
}

@media (max-width: 460px) {
  .topbar .primary-button span { display: none; }
  .topbar .primary-button { width: 38px; padding: 0; }
  .shot-list { grid-template-columns: 1fr; }
  .timecode { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.draft-status { margin: -4px 0 9px; font-size: 10px; color: var(--muted); }
.editor-notice { padding: 9px 0; margin-bottom: 8px; color: var(--amber); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
#submissionNotice { display: grid; gap: 5px; }
.media-missing { border-color: var(--amber); cursor: pointer; }
.media-missing-label { position: absolute; top: 50%; left: 0; right: 0; text-align: center; background: #24251ce6; color: var(--amber); font-size: 10px; }
#priceBreakdown { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.generation-bar > div { min-width: 0; }
.generation-bar .generate-button { flex: 0 0 auto; }
.task-stage { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11px; min-width: 0; }
.task-stage > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.task-stage strong { color: var(--cyan); }
.task-stage small { color: var(--faint); font-size: 9px; }
.task-stage p { margin: 5px 0 0; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.history-search { margin: 0 12px 10px; min-width: 0; }
.history-search summary { cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; padding: 5px 0; }
.history-search form { display: grid; gap: 8px; padding: 8px 0; }
.history-search label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.history-search input, .history-search select { width: 100%; min-width: 0; height: 32px; padding: 0 6px; background: #101310; color: var(--text); border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.search-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.search-actions { display: flex; gap: 6px; }
.mobile-bottom-nav { display: none; }
#confirmUxText { white-space: pre-wrap; line-height: 1.7; }
@media (max-width: 720px) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .director-panel { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 55; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: #161917; }
  .mobile-bottom-nav button { min-width: 0; min-height: 58px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; color: var(--muted); }
  .mobile-bottom-nav button:focus-visible, .mobile-bottom-nav button:hover { color: var(--lime); }
}

.privacy-generation{margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.settings-section .privacy-generation-switch{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--text)}
.privacy-generation-switch input{width:17px;height:17px;min-height:0;flex:none;margin:0;accent-color:#bff06c}
.privacy-generation p{font-size:11px;line-height:1.7;color:var(--muted);margin:9px 0}
.privacy-generation input[type=number]{width:100%;min-width:0;background:var(--panel-2);border:1px solid var(--line);border-radius:6px;color:inherit;padding:9px;font:inherit}
