:root {
  --bg: #f3f5f3;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --ink: #17201b;
  --muted: #68736c;
  --line: #d8ded9;
  --line-strong: #bfc8c1;
  --green: #1f6f4a;
  --green-dark: #154e35;
  --green-soft: #e5f2eb;
  --lime: #d5f35f;
  --blue: #315f8a;
  --blue-soft: #e7eef5;
  --amber: #a85e1d;
  --amber-soft: #fff0df;
  --coral: #ad493f;
  --coral-soft: #f8e8e6;
  --purple: #7450d8;
  --purple-soft: #eee9fb;
  --dark: #111513;
  --dark-2: #181d1a;
  --dark-3: #222925;
  --dark-line: #303833;
  --radius: 7px;
  font-family: "Microsoft YaHei UI", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111513;
  --surface: #171c19;
  --surface-2: #202622;
  --ink: #edf3ef;
  --muted: #9ba79f;
  --line: #303833;
  --line-strong: #465149;
  --green: #43b786;
  --green-dark: #8fe0b9;
  --green-soft: #20372b;
  --blue: #8db7df;
  --blue-soft: #203244;
  --amber: #efb36f;
  --amber-soft: #3b2d1e;
  --coral: #e58f85;
  --coral-soft: #3f2826;
  --purple: #9d82ef;
  --purple-soft: #30284a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); text-decoration: none; }
.button:hover { border-color: var(--green); }
.button.primary { border-color: var(--green); background: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.purple { border-color: var(--purple); background: var(--purple); color: white; }
.button.dark { border-color: #313a35; background: #202722; color: white; }
.button.ghost { border-color: transparent; background: transparent; }
.button.danger { border-color: var(--coral); color: var(--coral); }
.button.compact { min-height: 28px; padding: 0 9px; font-size: 11px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 18px; }
.theme-toggle { flex: 0 0 34px; font-size: 17px; }
.auth-brand .theme-toggle, .admin-brand .theme-toggle { margin-left: auto; border-color: #425047; background: rgba(255,255,255,.05); color: white; }
.field { display: grid; gap: 6px; }
.field > span, .field > label { color: var(--muted); font-size: 11px; }
.field input, .field textarea, .field select, .control { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); }
.field textarea { resize: vertical; line-height: 1.6; }
.field-help { display: block; color: var(--muted); font-size: 9px; line-height: 1.55; }
.field-help[data-upload-status="working"] { color: #31577c; }
.field-help[data-upload-status="ready"] { color: var(--green-dark); }
.field-help[data-upload-status="error"] { color: var(--danger); }
.inline-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.inline-field > * { min-width: 0; }
.inline-field select { max-width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.switch { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.switch input { accent-color: var(--green); }
.badge { display: inline-flex; align-items: center; width: fit-content; min-height: 22px; padding: 0 7px; border-radius: 4px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; white-space: nowrap; }
.badge.warning { background: var(--amber-soft); color: var(--amber); }
.badge.error { background: var(--coral-soft); color: var(--coral); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.muted { color: var(--muted); font-size: 11px; }
.empty { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 9px; padding: 24px; color: var(--muted); text-align: center; }
.empty strong { color: var(--ink); font-weight: 500; }
.empty p { max-width: 440px; margin: 0; font-size: 11px; line-height: 1.65; }
.error-box { padding: 10px 12px; border-left: 3px solid var(--coral); background: var(--coral-soft); color: var(--coral); font-size: 11px; line-height: 1.6; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 90; max-width: 380px; padding: 11px 14px; border-radius: 6px; background: #17201b; color: white; box-shadow: 0 14px 34px rgba(23,32,27,.18); font-size: 12px; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); background: #121814; color: white; }
.auth-visual { display: flex; flex-direction: column; justify-content: space-between; padding: 46px; border-right: 1px solid #2a342e; }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; background: var(--lime); color: #17201b; font-weight: 700; }
.auth-brand strong { display: block; font-weight: 500; }
.auth-brand small { color: #8d9b92; font-size: 10px; }
.auth-message h1 { max-width: 620px; margin: 0 0 14px; font-size: 34px; font-weight: 500; letter-spacing: 0; }
.auth-message p { max-width: 560px; margin: 0; color: #a9b4ad; line-height: 1.8; }
.auth-flow { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-flow span { padding: 7px 9px; border: 1px solid #354039; border-radius: 5px; color: #aab6ae; font-size: 11px; }
.auth-panel { display: grid; place-items: center; padding: 34px; background: var(--surface); color: var(--ink); }
.auth-card { width: min(410px, 100%); }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 500; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.auth-card form { display: grid; gap: 13px; }
.auth-card .button { margin-top: 4px; }
.auth-hint { margin-top: 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9f7; color: var(--muted); font-size: 10px; line-height: 1.7; }

.client-shell { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); background: var(--bg); }
.client-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.client-brand { display: flex; align-items: center; gap: 10px; }
.client-brand .auth-mark { width: 34px; height: 34px; }
.client-brand strong { font-size: 14px; font-weight: 500; }
.workflow-steps { display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 6px; background: var(--surface-2); }
.workflow-steps button { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; }
.workflow-steps button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23,32,27,.08); }
.header-account { display: flex; align-items: center; gap: 8px; }
.header-account strong { font-size: 11px; font-weight: 500; }
.credit-pill { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid #b9d4c3; border-radius: 5px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; white-space: nowrap; }
.client-sidebar { grid-row: 2; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.sidebar-heading strong { font-size: 12px; font-weight: 500; }
.project-list { display: grid; overflow-y: auto; }
.project-item { display: grid; gap: 4px; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.project-item:hover { background: #f7f9f7; }
.project-item.active { background: var(--green-soft); box-shadow: inset 3px 0 var(--green); }
.project-item strong { font-size: 11px; font-weight: 500; }
.project-item small { color: var(--muted); font-size: 9px; }
.project-item-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notification-count { min-width: 17px; height: 17px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 9px; background: #b54835; color: #fff; font-size: 8px; font-weight: 600; line-height: 1; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.client-main { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow: auto; }
.assignment-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 22px -4px; padding: 11px 13px; border: 1px solid #d8b66c; border-left: 3px solid #c98918; border-radius: 5px; background: #fff8e9; color: #6d5118; }
.assignment-notice div { min-width: 0; }
.assignment-notice strong { display: block; font-size: 11px; font-weight: 600; }
.assignment-notice span { display: block; margin-top: 3px; overflow: hidden; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.page { min-height: 100%; padding: 20px 22px 30px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.page-head h1 { margin: 3px 0 0; font-size: 21px; font-weight: 500; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.eyebrow { color: var(--green); font-size: 9px; font-weight: 500; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section + .section { margin-top: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.section-head strong { font-size: 12px; font-weight: 500; }
.section-body { padding: 15px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.summary { padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.summary span { color: var(--muted); font-size: 10px; }
.summary strong { display: block; margin-top: 4px; font-size: 20px; font-weight: 500; }
.summary small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.script-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 14px; }
.script-editor { width: 100%; min-height: 460px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; resize: vertical; font-family: "Microsoft YaHei UI", sans-serif; line-height: 1.7; }
.episode-list { display: grid; }
.episode-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.episode-row:last-child { border-bottom: 0; }
.episode-row strong { display: block; font-size: 11px; font-weight: 500; }
.episode-row small { color: var(--muted); font-size: 9px; }
.recommend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.recommend-card { padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.recommend-card header { display: flex; justify-content: space-between; gap: 8px; }
.recommend-card strong { font-size: 12px; font-weight: 500; }
.recommend-card p { color: var(--muted); font-size: 10px; line-height: 1.65; }
.compact-empty { min-height: 130px; margin-bottom: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,.55); }
.benchmark-panel { margin-bottom: 14px; }
.analysis-copy strong { display: block; margin-top: 10px; font-size: 11px; }
.analysis-copy strong:first-child { margin-top: 0; }
.analysis-copy p, .analysis-copy li { color: var(--muted); font-size: 10px; line-height: 1.65; }
.analysis-copy ul { margin: 6px 0 0; padding-left: 18px; }
.adaptation { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.adaptation strong { font-size: 10px; font-weight: 500; }
.deliverable { max-height: 320px; overflow: auto; padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9f7; color: #465149; font-family: Consolas, "Microsoft YaHei UI", monospace; font-size: 10px; line-height: 1.65; white-space: pre-wrap; }
.analysis-run-status { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.analysis-run-status[hidden] { display: none; }
.analysis-run-status .analysis-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.analysis-run-status.running .analysis-status-dot { background: #c98918; box-shadow: 0 0 0 4px rgba(201,137,24,.12); }
.analysis-run-status.success .analysis-status-dot { background: var(--green); }
.analysis-run-status.error .analysis-status-dot { background: #b94b4b; }
.analysis-run-status strong { display: block; font-size: 10px; font-weight: 500; }
.analysis-run-status p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.analysis-run-status time { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.button-spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .7s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }

.art-toolbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; margin: -20px -22px 14px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.art-filters, .art-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.art-batch-count { height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.art-batch-count input { width: 38px; height: 22px; padding: 0 3px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); text-align: center; }
.art-tab { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.art-tab.active { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.asset-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 9px; align-items: start; }
.asset-card { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.character-asset-card { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.character-asset-card:hover, .character-asset-card:focus-visible { border-color: #78a88c; box-shadow: 0 5px 16px rgba(22,53,35,.1); outline: 0; transform: translateY(-1px); }
.asset-visual { position: relative; aspect-ratio: 16/9; background: #eef1ee; color: #657169; }
.asset-visual img, .asset-visual video { width: 100%; height: 100%; display: block; object-fit: cover; }
.asset-audio-thumb { width: 100%; height: 100%; display: grid; place-content: center; gap: 4px; text-align: center; background: #e6ebe7; color: #34423a; }
.asset-audio-thumb strong { font-size: 12px; }
.asset-audio-thumb span { font-size: 8px; color: var(--muted); }
.asset-audio-player { min-height: 180px; display: grid; place-content: center; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); text-align: center; }
.asset-audio-player audio { width: min(560px, 80vw); }
.asset-media-player { width: 100%; }
.asset-placeholder { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 7px; background: #e9edea; color: #67736b; }
.asset-placeholder strong { color: #273029; font-size: 13px; font-weight: 500; }
.asset-placeholder span { font-size: 10px; }
.asset-type { position: absolute; left: 7px; top: 7px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1f6f4a; color: white; font-size: 10px; }
.asset-count-badge { position: absolute; right: 7px; bottom: 7px; padding: 4px 7px; border-radius: 4px; background: rgba(23,29,25,.82); color: white; font-size: 9px; }
.asset-card-body { padding: 9px; }
.asset-card-body p { height: 32px; margin: 0 0 8px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.55; }
.asset-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-card-foot strong { overflow: hidden; color: var(--green); font-size: 10px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.asset-tools { display: flex; gap: 4px; }
.asset-tools button { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.asset-tools button.danger { border-color: rgba(185,75,75,.42); color: var(--coral); }
.art-empty { min-height: 420px; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.art-empty strong { color: var(--ink); font-weight: 500; }
.art-empty p { max-width: 420px; font-size: 11px; line-height: 1.7; }

.story-workbench { display: grid; grid-template-columns: 300px minmax(620px, 1fr); min-height: calc(100vh - 64px); margin: -20px -22px -30px; background: #f5f7f8; }
.story-script { position: sticky; top: 0; height: calc(100vh - 64px); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.story-script-head { padding: 14px; border-bottom: 1px solid var(--line); }
.story-script-head select { width: 100%; height: 34px; margin-top: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; }
.position-map-panel { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.position-map-title { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 7px; }
.position-map-title strong { font-size: 10px; font-weight: 500; }
.position-map-title span { color: var(--muted); font-size: 9px; }
.position-map-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 12px 9px; }
.position-parameter { min-width: 0; display: grid; gap: 3px; }
.position-parameter.model { grid-column: 1 / -1; }
.position-parameter > span { color: var(--muted); font-size: 7px; }
.position-parameter select, .position-parameter input { width: 100%; min-width: 0; height: 29px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 8px; }
.position-parameter.copies input { text-align: center; }
.position-map-controls .billing-estimate { grid-column: 1 / -1; }
.position-map-controls .button { grid-column: 1 / -1; }
.position-scene-list { max-height: 390px; display: grid; gap: 7px; overflow-y: auto; padding: 0 12px 10px; }
.position-scene-card { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.position-scene-head, .position-scene-foot { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 7px 8px; }
.position-scene-head > div { min-width: 0; display: grid; gap: 2px; }
.position-scene-head strong { font-size: 9px; font-weight: 600; }
.position-scene-head span, .position-scene-head small, .position-scene-foot span { overflow: hidden; color: var(--muted); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.position-scene-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.position-thumb { position: relative; width: 100%; aspect-ratio: 16/9; display: block; overflow: hidden; padding: 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #dde3df; cursor: zoom-in; }
.position-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.position-thumb span { position: absolute; right: 6px; bottom: 6px; padding: 3px 5px; border-radius: 3px; background: rgba(20,27,22,.78); color: #fff; font-size: 8px; }
.position-guide-ready { min-height: 72px; display: grid; place-content: center; gap: 5px; padding: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #edf1ee; text-align: center; }
.position-guide-ready strong { color: var(--green-dark); font-size: 9px; font-weight: 500; }
.position-guide-ready span { max-height: 30px; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.55; }
.position-auto-assets { min-height: 42px; display: flex; align-items: center; gap: 5px; padding: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); }
.position-auto-assets button { width: 42px; flex: 0 0 auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); cursor: zoom-in; }
.position-auto-assets img { width: 100%; height: 31px; display: block; object-fit: cover; }
.position-auto-assets button.missing { border-color: #dfc48d; background: #fff7e7; cursor: pointer; }
.position-auto-placeholder { height: 31px; display: grid; place-items: center; color: #8a621a; font-size: 7px; font-weight: 500; }
.position-auto-assets button span { display: block; overflow: hidden; padding: 2px 3px; font-size: 6px; white-space: nowrap; text-overflow: ellipsis; }
.position-auto-assets > small { color: var(--muted); font-size: 8px; }
.position-auto-assets.empty-assets { color: #8a621a; font-size: 8px; }
.position-route-note { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--green-soft); }
.position-route-note strong, .position-route-note span { font-size: 8px; }
.position-route-note strong { color: var(--green-dark); font-weight: 500; }
.position-route-note span { color: var(--muted); text-align: right; }
.position-route-note.error { background: #fff1ed; }
.position-route-note.error strong, .position-route-note.error span { color: #a54835; }
.position-preview-dialog { width: min(1180px, calc(100% - 30px)); }
.position-preview-image { width: 100%; max-height: calc(100vh - 220px); display: block; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: #111; }
.position-preview-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.position-preview-meta span { padding: 4px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.position-preview-assets { display: flex; gap: 7px; margin-top: 10px; overflow-x: auto; }
.position-preview-assets div { width: 92px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.position-preview-assets img { width: 100%; aspect-ratio: 16/9; display: block; object-fit: cover; }
.position-preview-assets span { display: block; overflow: hidden; padding: 5px; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.position-history { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.position-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.position-history-head strong { font-size: 11px; font-weight: 600; }
.position-history-head span { color: var(--muted); font-size: 9px; }
.position-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.position-history-item { position: relative; display: grid; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.position-history-item.selected { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green-soft); }
.position-history-item > button:first-child { min-width: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: zoom-in; }
.position-history-item img { width: 82px; aspect-ratio: 16/9; display: block; border-radius: 4px; object-fit: cover; }
.position-history-item span { min-width: 0; display: grid; gap: 3px; }
.position-history-item strong, .position-history-item small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.position-history-item strong { font-size: 9px; }
.position-history-item small { color: var(--muted); font-size: 8px; }
.position-history-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.position-history-actions .badge { margin-right: auto; }
.story-script-text { flex: 1; overflow: auto; padding: 14px; color: #344039; font-size: 11px; line-height: 1.72; white-space: pre-wrap; }
.story-content { min-width: 0; padding: 14px; }
.story-toolbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; margin: -14px -14px 12px; padding: 7px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.story-toolbar strong { font-size: 12px; font-weight: 500; }
.framework-enabled { display: block; margin-top: 2px; color: var(--green-dark); font-size: 8px; }
.shot-stack { display: grid; gap: 10px; }
.shot-block { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.shot-main { min-width: 0; }
.shot-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.shot-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #202722; color: white; font-size: 11px; }
.shot-controls select { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #f7f9f8; font-size: 10px; }
.duration-plan-note { color: var(--green-dark); font-size: 9px; white-space: nowrap; }
.video-request-spec { padding: 5px 7px; border: 1px solid #b9d4c3; border-radius: 4px; background: var(--green-soft); color: var(--green-dark); font-size: 8px; white-space: nowrap; }
.insert-block-divider { display: grid; grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr); align-items: center; gap: 10px; min-height: 26px; margin: -6px 14px; }
.insert-block-divider span { height: 1px; background: var(--line-strong); }
.insert-block-divider .button { min-width: 132px; border-style: dashed; color: var(--green-dark); background: var(--surface); }
.insert-block-divider .button:hover { border-color: var(--green); background: var(--green-soft); }
.prompt-edit-button { margin-left: auto; }
.shot-prompt { min-height: 150px; max-height: 280px; overflow: auto; padding: 11px; border-radius: 6px; background: #f2f4f3; color: #39443d; font-size: 10px; line-height: 1.62; white-space: pre-wrap; }
.execution-reference-bar { min-height: 38px; display: flex; align-items: center; gap: 6px; margin-bottom: 7px; padding: 5px 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.execution-reference-bar > span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.execution-reference-bar > small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.mount-reference-add { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px dashed var(--line-strong); border-radius: 5px; background: var(--surface-2); color: var(--green-dark); font-size: 14px; cursor: pointer; }
.prompt-reference-chip { min-width: 0; height: 30px; display: inline-grid; grid-template-columns: 24px auto; grid-template-rows: 15px 11px; align-items: center; column-gap: 5px; flex: 0 0 auto; padding: 2px 7px 2px 2px; border: 1px solid #b8d6c4; border-radius: 5px; background: #f0f8f3; color: #254d35; vertical-align: middle; cursor: zoom-in; }
.prompt-reference-chip img, .prompt-reference-chip > span { grid-row: 1 / 3; width: 24px; height: 24px; display: grid; place-items: center; object-fit: cover; border-radius: 3px; background: #dce9e1; font-size: 9px; }
.prompt-reference-chip b { overflow: hidden; font-size: 8px; font-weight: 500; line-height: 14px; white-space: nowrap; text-overflow: ellipsis; }
.prompt-reference-chip small { overflow: hidden; color: var(--muted); font-size: 6px; line-height: 10px; white-space: nowrap; text-overflow: ellipsis; }
.prompt-reference-chip.compact { height: 23px; display: inline-flex; grid-template-columns: none; grid-template-rows: none; margin: 0 2px; padding: 1px 5px 1px 2px; transform: translateY(3px); }
.prompt-reference-chip.compact img, .prompt-reference-chip.compact > span { width: 19px; height: 19px; }
.prompt-reference-chip.compact b { font-size: 8px; }
.prompt-reference-chip.compact small { display: none; }
.prompt-reference-chip.missing { border-color: #dfc48d; background: #fff7e7; color: #7c5b1f; cursor: pointer; }
.prompt-reference-chip.position { border-color: #9cb8d7; background: #eef5fb; color: #31577c; }
.rich-prompt { white-space: pre-wrap; }
.asset-anchor-status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; align-items: center; margin-top: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.asset-anchor-status strong { color: var(--green-dark); font-size: 9px; font-weight: 500; }
.asset-anchor-status span { overflow: hidden; color: var(--muted); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.asset-anchor-status.unmatched strong { color: #8a621a; }
.mount-strip { display: flex; gap: 7px; margin-top: 9px; overflow-x: auto; }
.mount-card { width: 92px; flex: 0 0 auto; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); text-align: left; cursor: zoom-in; }
.mount-card img, .mount-card video, .mount-card .mount-placeholder, .mount-card .asset-audio-thumb { width: 100%; height: 70px; display: grid; place-items: center; object-fit: cover; background: #e9edea; color: #647068; font-size: 9px; }
.mount-card span { display: block; overflow: hidden; padding: 5px 6px; background: #3f4742; color: white; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.mount-add { width: 92px; height: 96px; flex: 0 0 auto; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 5px; background: #f8faf9; color: var(--muted); font-size: 20px; }
.position-mount-card { border-color: #7fa98e; box-shadow: inset 0 -2px 0 #4a8b61; }
.shot-result { min-height: 260px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #eef1ef; }
.result-media-shell { min-height: 260px; height: 100%; display: flex; flex-direction: column; background: var(--surface); }
.result-media-preview { min-height: 220px; flex: 1 1 auto; overflow: hidden; background: #111; }
.shot-result .result-media-preview img { width: 100%; height: 100%; min-height: 220px; display: block; object-fit: cover; background: #111; }
.shot-result .result-media-preview video { width: 100%; height: 100%; min-height: 220px; display: block; object-fit: contain; background: #000; }
.result-media-preview video:fullscreen,
.history-result-media video:fullscreen,
.result-media-preview video:-webkit-full-screen,
.history-result-media video:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  background: #000 !important;
}
.result-action-bar { display: flex; align-items: stretch; flex-direction: column; gap: 8px; padding: 9px; border-top: 1px solid var(--line); background: var(--surface); }
.result-action-bar > div:first-child { min-width: 0; display: grid; gap: 2px; }
.result-action-bar strong { color: var(--green-dark); font-size: 9px; font-weight: 500; }
.result-action-bar span { overflow: hidden; color: var(--muted); font-size: 7px; white-space: nowrap; text-overflow: ellipsis; }
.result-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.result-actions .button { min-width: 0; flex: 1 1 0; }
.shot-result-empty { height: 100%; min-height: 260px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.shot-result-empty strong { color: var(--ink); font-size: 11px; font-weight: 500; }
.shot-result-empty.missing-position { background: #fff8eb; }
.shot-result-empty.missing-position strong { color: #8a621a; }
.shot-result-empty.block-job-progress { padding: 24px; background: #f4f8f5; }
.block-job-progress strong { color: var(--green-dark); }
.block-job-progress .block-progress-bar { width: min(220px, 82%); height: 8px; margin: 5px auto 0; }
.block-progress-value { min-width: 42px; color: var(--green-dark); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.shot-result-empty.block-job-failed { padding: 24px; background: #fff6f3; }
.shot-result-empty.block-job-failed strong { color: var(--coral); }

.project-framework-summary .section-head > div { display: flex; align-items: center; gap: 8px; }
.project-framework-summary p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.65; }
.framework-order-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.framework-order-preview span { padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--green-dark); font-size: 9px; text-align: center; }
.block-result-history-dialog .dialog-head > div { display: grid; gap: 3px; }
.block-result-history-dialog .dialog-head small { color: var(--muted); font-size: 9px; }
.block-result-history-list { display: grid; gap: 10px; }
.block-result-history-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.block-result-history-item.current { border-color: #7fa98e; box-shadow: inset 3px 0 0 var(--green); }
.history-result-media { width: 150px; height: 120px; overflow: hidden; border-radius: 4px; background: #111; }
.history-result-media img, .history-result-media video { width: 100%; height: 100%; display: block; object-fit: contain; background: #111; }
.history-reference { max-width: 360px; display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.history-reference img { width: 34px; height: 34px; flex: 0 0 auto; display: block; object-fit: cover; border-radius: 3px; background: #111; }
.history-reference small, .history-reference-empty { color: var(--muted); font-size: 8px; line-height: 1.45; }
.history-reference-empty { display: block; margin-top: 4px; color: #a54835; }
.history-result-expired { width: 100%; height: 100%; display: grid; place-items: center; padding: 14px; background: #2b2f2c; color: #d7dcda; font-size: 10px; text-align: center; }
.block-result-history-item.expired { border-style: dashed; }
.shot-result-empty.expired-result { background: #fff8eb; }
.history-result-detail { min-width: 0; display: grid; gap: 4px; }
.history-result-detail > div { display: flex; align-items: center; gap: 7px; }
.history-result-detail strong { font-size: 11px; font-weight: 500; }
.history-result-detail > span, .history-result-detail small { overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.history-result-action { align-self: center; }

dialog { width: min(680px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 8px; background: var(--surface); box-shadow: 0 16px 44px rgba(12,18,14,.24); }
dialog::backdrop { background: rgba(12,18,14,.62); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.dialog-head strong { font-size: 14px; font-weight: 500; }
.dialog-body { padding: 17px; }
.asset-detail-dialog { width: min(940px, calc(100% - 30px)); }
.prompt-editor-dialog { width: min(1120px, calc(100% - 30px)); }
.prompt-editor-dialog .dialog-body { display: grid; gap: 13px; }
.prompt-editor-dialog textarea { min-height: min(48vh, 520px); resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.65; }
.prompt-editor-dialog .mount-picker-section { min-height: 0; }
.prompt-editor-dialog .mount-asset-grid { max-height: 300px; }
.position-inline-reference-preview { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.position-inline-reference-preview > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.position-inline-reference-preview > header strong { font-size: 10px; }
.position-inline-reference-preview > header span { color: var(--muted); font-size: 8px; }
.position-prompt-reference-preview { max-height: 220px; overflow: auto; padding: 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 2.15; white-space: pre-wrap; overflow-wrap: anywhere; }
.position-prompt-reference-preview .prompt-reference-chip.compact { max-width: min(320px, 80vw); }
.asset-generation-summary { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.asset-generation-summary strong { color: var(--green-dark); font-size: 10px; font-weight: 500; }
.asset-generation-summary span { color: var(--muted); font-size: 9px; }
.asset-generation-summary b { font-size: 9px; font-weight: 500; text-align: right; }
.asset-generation-prompt-check { display: grid; gap: 8px; padding: 11px; border: 1px solid #b9d4c3; border-radius: 5px; background: var(--green-soft); }
.asset-generation-prompt-check > strong, .prompt-source-row strong { font-size: 10px; font-weight: 500; }
.asset-generation-prompt-check > span, .prompt-source-row span { color: var(--muted); font-size: 9px; line-height: 1.6; }
.prompt-source-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.error-text { color: var(--coral); }
.job-prompt-preview { width: 100%; min-height: min(62vh, 620px); resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.65; }
.job-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.job-progress { width: 92px; height: 5px; margin-top: 7px; overflow: hidden; border-radius: 3px; background: var(--line); }
.job-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .2s ease; }
.team-summary-grid { margin-bottom: 14px; }
.team-invite-section { margin-bottom: 14px; }
.team-inline-form { display: grid; grid-template-columns: minmax(220px, 420px) auto; align-items: end; gap: 8px; }
.team-credit-editor { display: grid; grid-template-columns: 92px auto auto; gap: 6px; align-items: center; }
.team-credit-editor input { width: 92px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }
.team-member-table td:last-child { min-width: 280px; }
.team-assignment-table td:first-child { min-width: 260px; max-width: 420px; white-space: normal; }
.team-assignment-table tr.assignment-unread td { background: #fffaf0; }
.storyboard-assignment-empty { min-height: min(560px, 70vh); }
.prompt-source-note { color: var(--green) !important; }
.request-spec-note { color: var(--green-dark) !important; font-weight: 600; }
.upstream-completed-with-warning, .output-warning { color: var(--coral) !important; font-weight: 600; }
.character-detail-summary { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.character-detail-summary > div:first-child { aspect-ratio: 4/3; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.character-detail-summary img { width: 100%; height: 100%; display: block; object-fit: cover; }
.character-detail-summary span { color: var(--muted); font-size: 9px; }
.character-detail-summary strong { display: block; margin-top: 3px; font-size: 18px; font-weight: 500; }
.character-detail-summary p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.character-detail-summary-meta .button { width: fit-content; margin-top: 10px; }
.character-detail-section + .character-detail-section { margin-top: 16px; }
.character-detail-section > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.character-detail-section > header strong { font-size: 11px; font-weight: 500; }
.character-detail-section > header span { min-width: 22px; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: 9px; text-align: center; }
.character-detail-section-actions { display: flex; align-items: center; gap: 6px; }
.character-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.asset-detail-tile { min-width: 0; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.asset-detail-tile img, .asset-detail-tile video, .asset-detail-tile .asset-audio-thumb, .asset-detail-placeholder { width: 84px; height: 66px; display: grid; place-items: center; object-fit: cover; border-radius: 4px; background: #e7ece8; color: var(--muted); font-size: 9px; }
.asset-detail-preview { position: relative; width: 84px; height: 66px; padding: 0; overflow: hidden; border: 0; border-radius: 4px; background: #e7ece8; cursor: zoom-in; }
.asset-detail-preview img, .asset-detail-preview video, .asset-detail-preview .asset-audio-thumb { width: 100%; height: 100%; }
.asset-detail-preview > span { position: absolute; right: 4px; bottom: 4px; margin: 0; padding: 2px 4px; border-radius: 3px; background: rgba(18,24,20,.78); color: white; font-size: 7px; }
.character-cover-preview { width: 100%; height: 100%; border-radius: 0; }
.asset-detail-tile strong { display: block; overflow: hidden; font-size: 10px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.costume-range { display: inline-block !important; width: fit-content; margin-top: 4px !important; padding: 2px 5px; border-radius: 3px; background: #e1f0e7; color: #256542 !important; font-size: 8px !important; line-height: 1.35; }
.costume-range.pending { background: #f5ead5; color: #8a621a !important; }
.asset-detail-tile span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.asset-detail-tile .asset-detail-preview > span { position: absolute; right: 4px; bottom: 4px; display: block; margin: 0; padding: 2px 4px; border-radius: 3px; background: rgba(18,24,20,.78); color: white; font-size: 7px; }
.asset-detail-tile p { max-height: 34px; margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.5; }
.asset-detail-actions { display: grid; gap: 5px; }
.single-asset-detail { display: grid; gap: 12px; }
.single-asset-detail dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 5px; }
.single-asset-detail dl div { padding: 10px; border-right: 1px solid var(--line); }
.single-asset-detail dl div:last-child { border-right: 0; }
.single-asset-detail dt { color: var(--muted); font-size: 8px; }
.single-asset-detail dd { margin: 4px 0 0; font-size: 10px; overflow-wrap: anywhere; }
.asset-variant-section { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.asset-variant-section > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.asset-variant-section > header strong, .asset-variant-section > header span { display: block; }
.asset-variant-section > header strong { font-size: 11px; font-weight: 500; }
.asset-variant-section > header span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.asset-variant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.asset-variant-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.asset-variant-card.selected { border-color: #4f9468; box-shadow: inset 0 0 0 1px #4f9468; }
.asset-variant-image { position: relative; width: 100%; aspect-ratio: 4/3; padding: 0; overflow: hidden; border: 0; background: var(--surface-2); cursor: zoom-in; }
.asset-variant-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.asset-variant-image span { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; border-radius: 3px; background: rgba(24,72,43,.88); color: white; font-size: 7px; }
.asset-variant-body { display: grid; gap: 3px; padding: 8px; }
.asset-variant-body strong { font-size: 9px; font-weight: 500; }
.asset-variant-body small, .asset-variant-body time { color: var(--muted); font-size: 7px; overflow-wrap: anywhere; }
.asset-variant-body .button { margin-top: 4px; }
.asset-variant-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.asset-variant-actions .button { min-width: 0; }
.reference-preview-description { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.mount-auto-summary { margin-bottom: 12px; padding: 10px; border: 1px solid #b9d4c3; border-radius: 6px; background: var(--green-soft); }
.mount-auto-summary > strong { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 500; }
.mount-auto-summary > div { display: flex; gap: 6px; overflow-x: auto; }
.mount-picker-section, .mount-upload-section { border: 1px solid var(--line); border-radius: 6px; }
.mount-upload-section { margin-top: 12px; }
.mount-picker-section > header, .mount-upload-section > header { padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mount-picker-section > header strong, .mount-picker-section > header span, .mount-upload-section > header strong, .mount-upload-section > header span { display: block; }
.mount-picker-section > header strong, .mount-upload-section > header strong { font-size: 10px; font-weight: 500; }
.mount-picker-section > header span, .mount-upload-section > header span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.position-asset-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border-bottom: 1px solid var(--line); background: var(--surface); }
.position-asset-search input { min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }
.position-asset-search span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.mount-asset-grid { max-height: 360px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: auto; padding: 9px; }
.mount-picker-card { min-width: 0; display: grid; grid-template-columns: 15px 54px minmax(0, 1fr); gap: 7px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; }
.mount-picker-card.selected { border-color: #5c9a70; background: var(--green-soft); }
.mount-picker-card input { width: 14px; height: 14px; margin: 0; }
.mount-picker-image, .mount-picker-image img, .mount-picker-image video, .mount-picker-image .asset-audio-thumb { width: 54px; height: 42px; display: grid; place-items: center; object-fit: cover; border-radius: 3px; background: var(--surface-2); }
.mount-picker-image b { color: var(--muted); font-size: 7px; font-weight: 500; text-align: center; overflow-wrap: anywhere; }
.mount-picker-card > span:last-child { min-width: 0; }
.mount-picker-card strong, .mount-picker-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mount-picker-card strong { font-size: 9px; font-weight: 500; }
.mount-picker-card small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.mount-upload-section .form-grid { padding: 10px; }
.continuity-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.continuity-summary strong { font-size: 12px; font-weight: 500; }
.continuity-summary span { color: var(--muted); font-size: 9px; }
.continuity-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.continuity-table { min-width: 820px; margin: 0; }
.continuity-table td:nth-child(5) { max-width: 340px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.continuity-source { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 5px; }
.continuity-source > div:first-child { display: grid; gap: 3px; min-width: 0; }
.continuity-source span, .continuity-source small { color: var(--muted); font-size: 9px; }
.continuity-source strong { font-size: 12px; overflow-wrap: anywhere; }
.skill-package-dialog { width: min(880px, calc(100vw - 32px)); }
.skill-package-dialog .dialog-head > div { display: grid; gap: 3px; }
.skill-package-dialog .dialog-head small { color: var(--muted); font-size: 9px; font-weight: 400; }
.skill-package-slots { display: grid; gap: 8px; }
.skill-package-slot { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 78px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.skill-package-slot.missing { border-style: dashed; }
.skill-package-slot.selected { border-color: var(--green); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.skill-package-slot.focus { outline: 2px solid color-mix(in srgb, var(--green) 35%, transparent); outline-offset: 2px; }
.skill-package-index { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 700; }
.skill-package-slot.stored .skill-package-index, .skill-package-slot.selected .skill-package-index { background: var(--green); color: #fff; }
.skill-package-copy { display: grid; gap: 3px; min-width: 0; }
.skill-package-copy > span { color: var(--muted); font-size: 8px; }
.skill-package-copy strong { font-size: 12px; }
.skill-package-copy small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.skill-package-actions { display: flex; align-items: center; gap: 6px; }
.skill-package-summary { display: grid; gap: 3px; padding: 10px 12px; border-left: 3px solid var(--green); background: var(--surface-2); }
.skill-package-summary strong { font-size: 10px; }
.skill-package-summary span { color: var(--muted); font-size: 9px; }
.skill-package-summary.error { border-left-color: var(--coral); background: var(--coral-soft); }
.skill-package-summary.error strong, .skill-package-summary.error span { color: var(--coral); }
.skill-file-viewer-dialog { width: min(1180px, calc(100vw - 24px)); }
.skill-file-view-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.skill-file-text { width: 100%; min-height: min(70vh, 760px); resize: vertical; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; line-height: 1.65; }
.workbook-view-toolbar { display: grid; grid-template-columns: minmax(160px, 240px) minmax(240px, 1fr) auto; align-items: center; gap: 8px; }
.workbook-view-toolbar span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.workbook-view-table { max-height: 68vh; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.workbook-data-table { min-width: 100%; margin: 0; font-size: 9px; }
.workbook-data-table th, .workbook-data-table td { min-width: 110px; max-width: 360px; white-space: pre-wrap; vertical-align: top; line-height: 1.5; }
.workbook-data-table tr:first-child th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
@media (max-width: 720px) {
  .skill-package-slot { grid-template-columns: 26px minmax(0, 1fr); }
  .skill-package-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .continuity-source { align-items: flex-start; flex-direction: column; }
  .workbook-view-toolbar { grid-template-columns: 1fr; }
}
.import-preview { padding: 12px; border: 1px solid #b9d4c3; border-radius: 6px; background: var(--green-soft); }
.import-preview > strong { font-size: 11px; font-weight: 500; }
.import-preview > small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.import-completeness { display: grid; gap: 3px; margin: -12px -12px 10px; padding: 10px 12px; border-bottom: 1px solid #b9d4c3; }
.import-completeness strong { font-size: 10px; font-weight: 500; }
.import-completeness span { color: var(--muted); font-size: 9px; }
.import-completeness.warning { background: #fff6df; color: #73561a; }
.import-file-roles { display: grid; gap: 5px; margin-bottom: 10px; }
.import-file-role { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 6px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.import-file-role span { color: var(--green-dark); font-size: 8px; }
.import-file-role b { overflow: hidden; font-size: 9px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.import-file-role small { color: var(--muted); font-size: 8px; }
.episode-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; }
.episode-preview-grid div { display: grid; gap: 2px; padding: 7px 8px; border: 1px solid #c8ddd0; border-radius: 4px; background: white; }
.episode-preview-grid b { font-size: 10px; }
.episode-preview-grid span, .episode-preview-grid p { margin: 0; color: var(--muted); font-size: 9px; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); background: var(--bg); }
.admin-nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #202823; color: white; }
.admin-brand { height: 70px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid #344038; }
.admin-brand .auth-mark { width: 34px; height: 34px; }
.admin-brand strong { display: block; font-size: 13px; font-weight: 500; }
.admin-brand small { color: #8f9c94; font-size: 9px; }
.admin-tabs { display: grid; gap: 4px; padding: 15px 9px; }
.admin-tabs button { min-height: 42px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: #b6c0ba; text-align: left; }
.admin-tabs button.active { background: var(--lime); color: #17201b; }
.admin-user { margin-top: auto; padding: 14px 17px; border-top: 1px solid #344038; }
.admin-user strong { display: block; font-size: 11px; font-weight: 500; }
.admin-user small { color: #8f9c94; font-size: 9px; }
.admin-main { min-width: 0; padding: 22px 24px 32px; }
.pricing-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 11px 13px; border-left: 3px solid var(--green); background: var(--green-soft); color: var(--green-dark); font-size: 10px; line-height: 1.6; }
.pricing-notice strong { flex: 0 0 auto; font-weight: 500; }
.preset-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-head h1 { margin: 3px 0 0; font-size: 23px; font-weight: 500; }
.admin-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-grid .wide { grid-column: 1 / -1; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 500; background: #f8faf8; }
.data-table td strong { font-weight: 500; }
.library-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.library-card:last-child { border-bottom: 0; }
.library-card strong { display: block; font-size: 11px; font-weight: 500; }
.library-card p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.billing-user { align-items: center; }
.billing-user-summary { min-width: 0; }
.billing-user-tools { display: grid; gap: 7px; justify-items: end; }
.credit-form { display: grid; grid-template-columns: 88px minmax(120px, 180px) auto; gap: 6px; }
.credit-form input { min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; }
.account-manage-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.password-form { display: grid; grid-template-columns: minmax(170px, 220px) auto; gap: 6px; }
.password-input-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.password-input-control input { min-width: 0; height: 30px; padding: 0 8px; border: 0; border-radius: 0; background: transparent; color: var(--ink); outline: 0; }
.password-input-control:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.password-input-control .password-visibility-button { min-width: 44px; height: 30px; border: 0; border-left: 1px solid var(--line); border-radius: 0; color: var(--green-dark); }
.credit-minus { color: var(--coral); font-weight: 500; }
.credit-plus { color: var(--green); font-weight: 500; }
.billing-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(520px, 1.25fr); gap: 14px; margin-top: 14px; }
.billing-policy-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--line); }
.billing-policy-strip > div { min-width: 0; padding: 11px 12px; background: var(--surface); }
.billing-policy-strip strong { display: block; margin-bottom: 4px; color: var(--green-dark); font-size: 10px; font-weight: 500; }
.billing-policy-strip span { color: var(--muted); font-size: 9px; line-height: 1.55; }
.billing-policy-strip p { grid-column: 1 / -1; margin: 0; padding: 9px 12px; background: var(--green-soft); color: var(--muted); font-size: 9px; line-height: 1.55; }
.billing-policy-strip p strong { display: inline; margin: 0; }
.billing-inline-notice { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 9px 11px; border-left: 3px solid var(--green); background: var(--green-soft); }
.billing-inline-notice strong { flex: 0 0 auto; color: var(--green-dark); font-size: 10px; font-weight: 500; }
.billing-inline-notice span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.billing-estimate { color: var(--green-dark); font-size: 9px; font-weight: 500; white-space: nowrap; }
.historical-unbilled { margin-bottom: 3px; white-space: nowrap; }
.rate-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rate-row:last-child { border-bottom: 0; }
.rate-row strong { font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
.rate-row p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.cell-note { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.skill-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.skill-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.skill-card header strong { font-size: 13px; font-weight: 500; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 150px 140px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 9px; }
.audit-row time, .audit-row span { color: var(--muted); }

.folder-picker { position: relative; min-height: 104px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer; }
.folder-picker:hover { border-color: var(--green); }
.folder-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.folder-picker strong { color: var(--ink); font-size: 12px; font-weight: 500; }
.folder-picker small { font-size: 9px; }
.folder-picker-icon, .tree-file-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; }
.director-layout { grid-template-columns: minmax(300px, .7fr) minmax(520px, 1.3fr); }
.library-tree-list { display: grid; gap: 9px; }
.library-version { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.library-version > summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; }
.library-version > summary::-webkit-details-marker { display: none; }
.library-version > summary strong { font-size: 11px; font-weight: 500; }
.library-version > summary p, .merge-summary { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.library-version-body { padding: 12px; border-top: 1px solid var(--line); }
.tree-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tree-columns > section { min-width: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.tree-columns > section > header { padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 9px; }
.director-tree { max-height: 380px; overflow: auto; padding: 7px; }
.director-tree-folder { margin-left: 8px; }
.director-tree-folder > summary { display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: 0 7px; color: var(--ink); font-size: 10px; cursor: pointer; }
.director-tree-folder > summary small { color: var(--muted); }
.director-tree-leaf { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 38px; margin-left: calc(var(--tree-depth) * 7px); padding: 5px 7px; border-top: 1px solid var(--line); }
.director-tree-leaf strong, .director-tree-leaf small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.director-tree-leaf strong { font-size: 9px; font-weight: 500; }
.director-tree-leaf small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.provider-simple-card { align-self: start; }
.provider-preset-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.provider-preset-summary div { min-width: 0; }
.provider-preset-summary span { display: block; color: var(--muted); font-size: 8px; }
.provider-preset-summary strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: 10px; font-weight: 500; }
.provider-preset-summary p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--green-dark); font-size: 9px; }
.provider-key { margin-bottom: 12px; }
.provider-advanced { border-top: 1px solid var(--line); }
.provider-advanced > summary { padding: 11px 0; color: var(--muted); font-size: 10px; cursor: pointer; }
.provider-advanced > .form-grid { padding-top: 3px; }
.provider-route-pricing { margin: 0 0 13px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.provider-route-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 11px; background: var(--surface-2); }
.provider-route-heading strong { font-size: 10px; font-weight: 500; }
.provider-route-heading span { color: var(--muted); font-size: 9px; }
.provider-route-scroll { overflow-x: auto; }
.provider-route-pricing table { width: 100%; min-width: 760px; border-collapse: collapse; }
.provider-route-pricing th, .provider-route-pricing td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 9px; }
.provider-route-pricing th { color: var(--muted); font-weight: 500; background: var(--surface); }
.provider-route-pricing td strong, .provider-route-pricing td small { display: block; }
.provider-route-pricing td strong { font-weight: 500; }
.provider-route-pricing td small { max-width: 290px; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.provider-route-pricing .pricing-pending { background: color-mix(in srgb, #b67d15 7%, var(--surface)); }
.provider-route-pricing .route-toggle { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; color: var(--ink); font-size: 9px; }
.provider-route-pricing .route-toggle input { width: 14px; height: 14px; margin: 0; }
.route-feature-badge { display: inline-flex !important; margin: 5px 0 0 6px; font-style: normal; vertical-align: middle; }
.provider-key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.provider-key-row input { min-width: 0; }
.provider-master-toggle { margin-top: 2px; }
.provider-fallback-box { padding: 10px; border: 1px solid #c4d9ca; border-radius: 6px; background: var(--green-soft); }
.provider-fallback-box > .switch { margin-bottom: 9px; }
.provider-fallback-box > small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.storage-summary .summary strong { font-size: 16px; overflow-wrap: anywhere; }
.storage-provider-card { align-self: start; }
.storage-lifecycle { display: grid; gap: 3px; margin-bottom: 12px; padding: 9px 10px; border-left: 3px solid var(--green); background: var(--green-soft); }
.storage-lifecycle strong { color: var(--green-dark); font-size: 9px; font-weight: 500; }
.storage-lifecycle span { color: var(--muted); font-size: 8px; }
.storage-secret-actions { margin-top: -3px; }
.storage-enable-switch { margin-top: 3px; }
.storage-test-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.storage-test-status strong { font-size: 9px; font-weight: 500; }
.storage-test-status span, .storage-test-status time { color: var(--muted); font-size: 8px; }
.storage-test-status time { white-space: nowrap; }
.storage-test-status.success { border-color: #a8cbb5; background: var(--green-soft); }
.storage-test-status.success strong { color: var(--green-dark); }
.storage-test-status.error { border-color: #e0b7ad; background: #fff1ed; }
.storage-test-status.error strong { color: #a54835; }
.video-route-select { max-width: min(430px, 100%); }
.shot-controls .video-route-select { width: min(330px, 100%); min-width: 220px; }
.client-video-pricing { display: grid; gap: 0; }
.client-video-pricing > strong { margin-bottom: 7px; font-size: 10px; font-weight: 500; }
.client-video-pricing > div { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(190px, 1.3fr) auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.client-video-pricing span, .client-video-pricing b { font-size: 9px; }
.client-video-pricing small { color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.client-video-pricing b { font-weight: 500; text-align: right; }
.client-video-pricing .route-feature-badge { margin: 0 0 0 6px; }
.skill-guide { margin-bottom: 14px; border: 1px solid #b9d4c3; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); }
.skill-guide > summary { padding: 11px 13px; font-size: 10px; font-weight: 500; cursor: pointer; }
.skill-guide > div { padding: 0 13px 12px; font-size: 10px; line-height: 1.7; }
.skill-guide-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 12px; }
.skill-guide-grid section { min-width: 0; }
.skill-guide ol { margin: 7px 0; padding-left: 20px; }
.skill-guide p { margin: 7px 0 0; }
.skill-guide-warning { padding: 10px 11px; border: 1px solid color-mix(in srgb, #b67d15 38%, var(--line)); border-radius: 5px; background: var(--surface); color: var(--ink); }
.skill-guide-warning .button { margin-top: 9px; }
.skill-field-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 11px; padding-top: 10px !important; border-top: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.skill-field-guide span { min-width: 0; }
.skill-field-guide strong { display: block; }
.skill-recommendation { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; margin-bottom: 12px; padding: 9px 10px; border: 1px solid #b9d4c3; border-radius: 5px; background: var(--green-soft); color: var(--green-dark); }
.skill-recommendation span { grid-row: 1 / span 2; padding: 3px 6px; border-radius: 4px; background: var(--green); color: #fff; font-size: 8px; }
.skill-recommendation strong { font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
.skill-recommendation small { font-size: 8px; }
.skill-enable-switch { padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.skill-meta-details { border-top: 1px solid var(--line); }
.skill-meta-details > summary { padding: 11px 0; color: var(--muted); font-size: 10px; cursor: pointer; }
.skill-meta-details > .form-grid { padding: 3px 0 11px; }
.skill-bundle-summary { grid-column: 1 / -1; display: grid; gap: 3px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.skill-bundle-summary strong { font-size: 10px; font-weight: 500; }
.skill-bundle-summary span, .skill-bundle-summary small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.compact-select { min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 10px; }

:root[data-theme="dark"] .auth-panel,
:root[data-theme="dark"] .auth-hint,
:root[data-theme="dark"] .deliverable,
:root[data-theme="dark"] .compact-empty,
:root[data-theme="dark"] .story-workbench,
:root[data-theme="dark"] .shot-prompt,
:root[data-theme="dark"] .mount-add,
:root[data-theme="dark"] .data-table th,
:root[data-theme="dark"] .episode-preview-grid div { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .project-item:hover { background: var(--surface-2); }
:root[data-theme="dark"] .story-script-text { color: var(--ink); }
:root[data-theme="dark"] .story-toolbar { background: rgba(23,28,25,.97); }
:root[data-theme="dark"] .shot-controls select,
:root[data-theme="dark"] .story-script-head select { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .mount-card { background: var(--surface); }
:root[data-theme="dark"] .prompt-reference-chip { border-color: #466b54; background: #20372a; color: #b8dfc5; }
:root[data-theme="dark"] .prompt-reference-chip.missing { border-color: #755f34; background: #382f1e; color: #e0c88c; }
:root[data-theme="dark"] .prompt-reference-chip.position { border-color: #45627d; background: #203246; color: #bfd5eb; }
:root[data-theme="dark"] .position-route-note,
:root[data-theme="dark"] .provider-fallback-box,
:root[data-theme="dark"] .storage-lifecycle,
:root[data-theme="dark"] .mount-auto-summary { background: var(--surface-2); }
:root[data-theme="dark"] .storage-test-status.success { border-color: #466b54; background: #20372a; }
:root[data-theme="dark"] .storage-test-status.error { border-color: #755044; background: #382722; }
:root[data-theme="dark"] .assignment-notice { border-color: #755f34; border-left-color: #c98918; background: #382f1e; color: #e0c88c; }
:root[data-theme="dark"] .team-assignment-table tr.assignment-unread td { background: #2d291d; }
:root[data-theme="dark"] dialog { color: var(--ink); }
:root[data-theme="dark"] .asset-placeholder,
:root[data-theme="dark"] .asset-detail-placeholder { background: var(--surface-2); color: var(--muted); }

@media (max-width: 1280px) {
  .story-toolbar { align-items: flex-start; flex-direction: column; }
  .story-toolbar .page-actions { width: 100%; }
}

@media (max-width: 1100px) {
  .client-shell { grid-template-columns: 185px minmax(0, 1fr); }
  .workflow-steps button { padding: 0 8px; }
  .story-workbench { grid-template-columns: 250px minmax(520px, 1fr); }
  .shot-block { grid-template-columns: minmax(0, 1fr) 180px; }
  .asset-wall { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .billing-layout { grid-template-columns: 1fr; }
  .director-layout { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid .wide { grid-column: auto; }
}

@media (max-width: 820px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { min-height: 290px; padding: 28px; border-right: 0; border-bottom: 1px solid #2a342e; }
  .auth-message h1 { font-size: 25px; }
  .client-shell { display: block; }
  .client-header { min-height: 64px; flex-wrap: wrap; padding: 10px 12px; }
  .header-account { max-width: 100%; flex-wrap: wrap; }
  .workflow-steps { order: 3; width: 100%; overflow-x: auto; }
  .workflow-steps button { flex: 1 0 auto; }
  .client-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-list { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .sidebar-footer { display: none; }
  .page { padding: 16px 12px 24px; }
  .assignment-notice { align-items: flex-start; flex-direction: column; margin: 12px 12px -2px; }
  .assignment-notice .button { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-layout, .recommend-grid { grid-template-columns: 1fr; }
  .art-toolbar { position: static; margin: -16px -12px 12px; }
  .character-detail-grid { grid-template-columns: 1fr; }
  .character-detail-summary { grid-template-columns: 96px minmax(0, 1fr); }
  .single-asset-detail dl { grid-template-columns: 1fr; }
  .single-asset-detail dl div { border-right: 0; border-bottom: 1px solid var(--line); }
  .single-asset-detail dl div:last-child { border-bottom: 0; }
  .asset-variant-grid, .mount-asset-grid { grid-template-columns: 1fr; }
  .position-asset-search { grid-template-columns: 1fr; }
  .position-asset-search span { white-space: normal; }
  .asset-variant-section > header { align-items: flex-start; flex-direction: column; }
  .story-workbench { display: block; margin: -16px -12px -24px; }
  .story-script { position: static; height: auto; max-height: 380px; border-right: 0; border-bottom: 1px solid var(--line); }
  .shot-block { grid-template-columns: 1fr; }
  .shot-result { min-height: 220px; }
  .block-result-history-item { grid-template-columns: 1fr; }
  .history-result-media { width: 100%; height: min(52vw, 280px); }
  .history-result-action .button { width: 100%; }
  .admin-shell { display: block; }
  .admin-nav { position: static; height: auto; }
  .admin-tabs { display: flex; overflow-x: auto; }
  .admin-tabs button { flex: 0 0 auto; }
  .admin-user { display: none; }
  .admin-main { padding: 17px 13px 26px; }
  .admin-grid, .form-grid { grid-template-columns: 1fr; }
  .admin-grid .wide, .form-grid .wide { grid-column: auto; }
  .inline-field, .credit-form, .password-form { grid-template-columns: 1fr; }
  .billing-user { grid-template-columns: 1fr; align-items: stretch; }
  .billing-user-tools { justify-items: stretch; }
  .account-manage-row { align-items: stretch; flex-direction: column; }
  .team-inline-form, .team-credit-editor { grid-template-columns: 1fr; }
  .team-credit-editor input { width: 100%; }
  .pricing-notice { align-items: flex-start; flex-direction: column; }
  .billing-policy-strip { grid-template-columns: 1fr; }
  .billing-policy-strip p { grid-column: auto; }
  .billing-inline-notice { align-items: flex-start; flex-direction: column; }
  .storage-test-status { grid-template-columns: 1fr; }
  .skill-guide-grid, .skill-field-guide { grid-template-columns: 1fr; }
  .tree-columns, .provider-preset-summary { grid-template-columns: 1fr; }
  .provider-preset-summary p { grid-column: auto; }
  .provider-route-heading { align-items: flex-start; flex-direction: column; }
  .client-video-pricing > div { grid-template-columns: 1fr; }
  .client-video-pricing b { text-align: left; }
  .shot-controls .video-route-select { min-width: 100%; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .data-table thead, .data-table tbody { display: table; width: max-content; min-width: 100%; table-layout: auto; }
  .data-table th, .data-table td { min-width: 92px; }
  .data-table th:first-child, .data-table td:first-child { min-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}


/* ICP filing footer */
#icp-footer{position:fixed;left:0;right:0;bottom:0;z-index:50;text-align:center;padding:7px 12px;font-size:12px;line-height:18px;background:rgba(17,17,17,.92);color:#d8d8d8;pointer-events:auto}
#icp-footer a{color:#d8d8d8;text-decoration:none}
#icp-footer a:hover{text-decoration:underline}
