/* AI 导演台 · 先锋撞色视觉层
   Loaded after every feature stylesheet so the global direction is consistent. */
:root {
  --bg-page: #090c12;
  --bg-card: #121722;
  --bg-subtle: #0e131d;
  --bg-tag: #1b2230;
  --bg-input: #0d121b;
  --coral: #ff4268;
  --coral-hover: #ff6685;
  --coral-light: rgba(255, 66, 104, .13);
  --coral-border: rgba(255, 66, 104, .55);
  --ocean-blue: #6f8cff;
  --ocean-blue-light: rgba(111, 140, 255, .14);
  --ocean-blue-border: rgba(111, 140, 255, .5);
  --sage-green: #c7f36b;
  --sage-green-light: rgba(199, 243, 107, .13);
  --sage-green-border: rgba(199, 243, 107, .52);
  --gold-amber: #ffbf69;
  --gold-amber-light: rgba(255, 191, 105, .13);
  --gold-amber-border: rgba(255, 191, 105, .5);
  --text-title: #f6f8fb;
  --text-body: #d7deea;
  --text-muted: #b2bfd0;
  --text-subtle: #9caac0;
  --border-light: #232c3b;
  --border-medium: #334055;
  --border-active: #ff4268;
  --shadow-warm-sm: 0 8px 24px rgba(0, 0, 0, .18);
  --shadow-warm-md: 0 16px 40px rgba(0, 0, 0, .28);
  --shadow-card: 0 24px 80px rgba(0, 0, 0, .45);
}

html, body { background: var(--bg-page); color: var(--text-body); }
body { background-image: radial-gradient(circle at 86% 6%, rgba(111, 140, 255, .13), transparent 28rem), radial-gradient(circle at 10% 100%, rgba(255, 66, 104, .09), transparent 32rem); }
html { color-scheme: dark; }
.app-shell { background: transparent; }

.topbar {
  height: 68px;
  padding: 0 30px;
  background: rgba(9, 12, 18, .88);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .2);
}
.topbar-brand { gap: 13px; }
.traffic-lights { gap: 5px; }
.light-dot { width: 8px; height: 8px; }
.dot-yellow { background: var(--sage-green); }
.dot-green { background: var(--ocean-blue); }
.brand-text-logo { color: var(--text-title); font-size: 17px; letter-spacing: .04em; }
.brand-text-logo::after { content: ' / AI VIDEO OPS'; color: var(--coral); font: 700 9px var(--font-mono); margin-left: 10px; letter-spacing: .14em; }
.top-nav { gap: 2px; min-width: 0; overflow-x: auto; padding: 3px; background: #121722; border: 1px solid var(--border-light); border-radius: 10px; scrollbar-width: thin; }
.top-nav-item { flex: 0 0 auto; padding: 7px 15px; border-radius: 7px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.top-nav-item:hover { color: var(--text-title); background: rgba(255,255,255,.05); }
.top-nav-item.is-active { background: var(--coral); color: #fff; box-shadow: 0 5px 18px rgba(255, 66, 104, .3); }
.topbar-brand, .topbar-actions { flex: 0 0 auto; }
.top-create-button { white-space: nowrap; }
@media (max-width: 1400px) {
  .topbar { gap: 12px; padding-inline: 20px; }
  .brand-text-logo::after { display: none; }
  .top-nav-item { padding-inline: 11px; }
  .studio-account-entry { max-width: 135px; }
}
.compact-health { color: var(--text-muted); background: var(--bg-card); border-color: var(--border-light); }
.icon-button { color: var(--text-muted); background: var(--bg-card); border-color: var(--border-light); border-radius: 9px; }
.icon-button:hover { color: var(--sage-green); background: var(--sage-green-light); border-color: var(--sage-green-border); }
.warm-coral-btn, .primary-button { background: var(--coral); box-shadow: 0 8px 22px rgba(255, 66, 104, .24); }
.warm-coral-btn:hover:not(:disabled), .primary-button:hover:not(:disabled) { background: var(--coral-hover); }
.secondary-button { color: var(--text-body); background: #151c29; border-color: var(--border-medium); box-shadow: none; }
.secondary-button:hover:not(:disabled) { color: var(--sage-green); background: var(--sage-green-light); border-color: var(--sage-green-border); }

.content { padding: 22px 30px 34px; }
.page-caption-bar { margin-bottom: 18px; }
.caption-left { display: grid; gap: 4px; min-width: 0; }
.page-heading-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.page-kicker { color: var(--coral); font: 700 10px var(--font-mono); letter-spacing: .14em; white-space: nowrap; }
#pageTitle { min-width: 0; overflow: hidden; color: var(--text-title); font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.caption-subline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.caption-quote { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.page-description { overflow: hidden; color: var(--text-subtle); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.page-description::before { content: '·'; margin-right: 10px; color: var(--ocean-blue); }
.caption-status { color: var(--sage-green); font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; }
.caption-right { display: flex; align-items: center; gap: 7px; }

.metrics-grid { gap: 12px; margin-bottom: 14px; }
.metric-card { min-height: 98px; padding: 16px 18px; background: linear-gradient(135deg, #151c29, #10151f); border-color: var(--border-light); border-radius: 12px; box-shadow: var(--shadow-warm-sm); overflow: hidden; }
.metric-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--coral); }
.metric-card:nth-child(2)::before { background: var(--sage-green); }
.metric-card:nth-child(3)::before { background: var(--ocean-blue); }
.metric-card:nth-child(4)::before { background: var(--gold-amber); }
.metric-label { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.metric-value { color: var(--text-title); font-size: 27px; }
.metric-note { right: 15px; bottom: 14px; color: var(--text-muted); background: var(--bg-tag); border: 1px solid var(--border-light); }

.workflow-guide { display: grid; grid-template-columns: minmax(190px, .8fr) 2fr minmax(220px, .9fr); align-items: center; gap: 20px; margin-bottom: 16px; padding: 14px 18px; background: linear-gradient(105deg, rgba(255,66,104,.1), rgba(111,140,255,.08) 58%, rgba(199,243,107,.08)); border: 1px solid var(--border-light); border-radius: 12px; }
.workflow-guide-heading { display: grid; gap: 2px; }
.workflow-guide-kicker { color: var(--coral); font: 700 10px var(--font-mono); letter-spacing: .12em; }
.workflow-guide-heading strong { color: var(--text-title); font-size: 13px; }
.workflow-guide-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; }
.workflow-guide-steps li { min-width: 0; border: 1px solid var(--border-light); border-radius: 8px; background: rgba(8, 12, 18, .42); }
.workflow-guide-step { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 8px 9px; color: inherit; text-align: left; }
.workflow-guide-step:hover { background: rgba(255, 255, 255, .05); }
.workflow-guide-step:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: -2px; border-radius: 8px; }
.workflow-guide-step > span { color: var(--text-subtle); font: 700 10px var(--font-mono); }
.workflow-guide-step div { display: grid; min-width: 0; }
.workflow-guide-steps strong { color: var(--text-body); font-size: 11px; white-space: nowrap; }
.workflow-guide-steps small { overflow: hidden; color: var(--text-subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-guide-steps li.is-active { border-color: var(--coral-border); background: var(--coral-light); }
.workflow-guide-steps li.is-active > .workflow-guide-step > span, .workflow-guide-steps li.is-active strong { color: var(--coral); }
.workflow-guide-steps li.is-complete { border-color: var(--sage-green-border); background: var(--sage-green-light); }
.workflow-guide-steps li.is-complete > .workflow-guide-step > span { color: var(--sage-green); }
.workflow-guide-steps li.is-complete.is-active { border-color: var(--coral-border); background: var(--coral-light); }
.workflow-guide-tip { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }

.workspace-readiness {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid var(--gold-amber-border);
  border-left: 3px solid var(--gold-amber);
  border-radius: 12px;
  background: linear-gradient(105deg, rgba(255, 191, 105, .12), rgba(255, 66, 104, .06));
}
.workspace-readiness.is-error { border-color: var(--coral-border); border-left-color: var(--coral); background: rgba(255, 66, 104, .09); }
.workspace-readiness.is-ready { border-color: var(--sage-green-border); border-left-color: var(--sage-green); background: rgba(199, 243, 107, .08); }
.workspace-readiness-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold-amber-border);
  border-radius: 9px;
  color: var(--gold-amber);
  background: var(--gold-amber-light);
  font: 800 13px var(--font-mono);
}
.workspace-readiness.is-error .workspace-readiness-mark { border-color: var(--coral-border); color: var(--coral); background: var(--coral-light); }
.workspace-readiness.is-ready .workspace-readiness-mark { border-color: var(--sage-green-border); color: var(--sage-green); background: var(--sage-green-light); }
.workspace-readiness-copy { display: grid; min-width: 0; gap: 2px; }
.workspace-readiness-copy strong { color: var(--text-title); font-size: 13px; }
.workspace-readiness-copy p { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.workspace-readiness-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.workspace-readiness-items span { padding: 3px 7px; border: 1px solid var(--gold-amber-border); border-radius: 999px; color: var(--gold-amber); background: rgba(255, 191, 105, .08); font: 700 9px var(--font-mono); white-space: nowrap; }
.workspace-readiness-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workspace-readiness-actions .link-button { white-space: nowrap; }
.workspace-readiness-actions .secondary-button { white-space: nowrap; }

.workspace-layout { grid-template-columns: 316px minmax(0, 1fr); gap: 14px; min-height: 600px; }
.task-rail, .detail-pane, .history-page, .provider-page { background: rgba(18, 23, 34, .92); border-color: var(--border-light); border-radius: 14px; box-shadow: var(--shadow-warm-md); }
.mobile-nav-backdrop { display: none; }
.rail-header { padding: 16px 18px 13px; border-color: var(--border-light); }
.rail-header-actions { display: flex; align-items: center; gap: 8px; }
.rail-btn-close { display: none; width: 28px; height: 28px; border: 1px solid var(--border-medium); border-radius: 8px; color: var(--text-muted); font-size: 20px; line-height: 1; }
.rail-btn-close:hover { color: var(--coral); border-color: var(--coral-border); }
.rail-title h2 { color: var(--text-title); letter-spacing: .02em; }
.rail-counter { color: var(--text-subtle); font-family: var(--font-mono); }
.rail-btn-create { background: var(--coral-light); color: var(--coral); border: 1px solid var(--coral-border); border-radius: 8px; }
.rail-btn-create:hover { background: var(--coral); }
.task-filters { padding: 11px 13px; background: #0e131d; border-color: var(--border-light); }
.rail-status-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rail-status-filters button { min-height: 31px; padding: 5px 3px; border: 1px solid var(--border-medium); border-radius: 7px; background: #151c29; color: var(--text-muted); font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.rail-status-filters button:hover { border-color: var(--ocean-blue-border); color: var(--text-title); }
.rail-status-filters button[aria-pressed="true"] { border-color: var(--coral-border); background: var(--coral-light); color: var(--coral-hover); }
.rail-status-filters button:focus-visible, .rail-advanced-filters summary:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: 2px; }
.rail-advanced-filters { border-top: 1px solid var(--border-light); padding-top: 8px; }
.rail-advanced-filters summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-body); font-size: 11px; font-weight: 650; cursor: pointer; list-style-position: inside; }
.rail-advanced-filters summary span { color: var(--text-subtle); font-size: 10px; font-weight: 400; }
.rail-advanced-filters .filter-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.rail-advanced-filters .filter-select, .rail-advanced-filters .filter-btn-toggle { min-width: 0; width: 100%; min-height: 30px; border-radius: 7px; }
.rail-advanced-filters .date-range-panel { margin-top: 8px; }
.task-list-empty #railClearFiltersButton { display: block; margin: 0 auto 8px; }
.search-box, .filter-select, .filter-btn-toggle { background: #111823; border-color: var(--border-medium); color: var(--text-body); box-shadow: none; }
.search-box:focus-within { border-color: var(--coral); box-shadow: 0 0 0 2px rgba(255,66,104,.15); }
.search-box input { color: var(--text-title); background: transparent; }
.search-box input::placeholder { color: var(--text-subtle); }
.task-list { padding: 11px 10px; }
.task-item { padding: 11px; background: #151c29; border-color: var(--border-light); box-shadow: none; }
.task-item:hover { background: #1a2331; border-color: var(--ocean-blue-border); }
.task-item.is-selected { background: linear-gradient(90deg, rgba(255,66,104,.18), rgba(255,66,104,.04)); border-color: var(--coral); box-shadow: inset 3px 0 var(--coral), 0 8px 18px rgba(0,0,0,.16); }
.task-item-title { color: var(--text-title); }
.task-item-meta { color: var(--text-subtle); }
.task-item-draft-badge { display: inline-flex; align-self: flex-start; width: fit-content; margin-top: 5px; padding: 3px 6px; border: 1px solid var(--gold-amber-border); border-radius: 999px; color: var(--gold-amber); background: var(--gold-amber-light); font-size: 9px; line-height: 1.2; }
.detail-placeholder { color: var(--text-muted); }
.detail-placeholder h2, .detail-placeholder h3 { color: var(--text-title); }
.empty-icon-box { background: var(--coral-light); border-color: var(--coral-border); }
.quick-start-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; width: min(680px, 100%); margin: 4px 0 2px; }
.quick-start-card { display: grid; gap: 3px; min-width: 0; padding: 12px 13px; border: 1px solid var(--border-medium); border-radius: 10px; background: #151c29; color: var(--text-body); text-align: left; }
.quick-start-card:hover, .quick-start-card:focus-visible { border-color: var(--ocean-blue-border); background: var(--ocean-blue-light); outline: none; }
.quick-start-card strong { color: var(--text-title); font-size: 12px; }
.quick-start-card small { color: var(--text-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.quick-start-card.is-primary { border-color: var(--coral-border); background: var(--coral-light); }
.quick-start-card.is-primary strong { color: var(--coral); }
.placeholder-secondary-action { margin-top: 2px; }

.detail-header, .detail-tabs { border-color: var(--border-light); }
.detail-header { padding: 20px 22px 14px; background: linear-gradient(135deg, rgba(255,66,104,.08), transparent 45%); }
.detail-tabs { background: #121722; }
.detail-title-line h2, .provider-page-heading h2 { color: var(--text-title); }
.live-processing, .status-pill { white-space: nowrap; }
.detail-meta-row { color: var(--text-muted); }
.detail-meta-row strong { color: var(--text-subtle); }
.detail-tab { color: var(--text-muted); }
.detail-tab:hover { color: var(--text-title); }
.detail-tab:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: -2px; }
.detail-tab.is-active { color: var(--coral); border-color: var(--coral); }
.detail-body { padding: 18px 22px 28px; }
.production-step { background: #151c29; border-color: var(--border-light); }
.production-step-copy strong { color: var(--text-body); }
.production-step.is-current { background: var(--coral-light); border-color: var(--coral-border); box-shadow: 0 0 0 2px rgba(255,66,104,.1); }
.production-step.is-current .production-step-number { background: var(--coral); }
.production-step.is-complete { background: var(--sage-green-light); border-color: var(--sage-green-border); }
.production-step.is-complete .production-step-number { background: var(--sage-green); color: #0a0e12; }
.next-step-card, .friendly-input-bar, .task-editor-section, .shot-inspector-pane, .director-monitor-pane, .version-history, .empty-state-card { background: #151c29; border-color: var(--border-light); box-shadow: none; }
.next-step-card.is-download {
  background: linear-gradient(115deg, #182538, #172032 58%, #1e2b3c);
  border-color: var(--sage-green-border);
  color: var(--text-body);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}
.next-step-card.is-download .eyebrow { color: var(--sage-green); }
.next-step-card.is-download .next-step-copy h2 { color: var(--text-title); }
.next-step-card.is-download .next-step-copy p { color: var(--text-muted); }
.friendly-input-editor { color: var(--text-body); background: #151c29; border-color: var(--border-light); }
.friendly-input-editor > summary { color: var(--text-title); }
.friendly-error { color: var(--text-body); background: var(--coral-light); border: 1px solid var(--coral-border); }
.friendly-error strong { color: var(--coral-hover); }
.version-link { color: var(--text-body); background: #111823; }
.version-link:hover { color: var(--text-title); background: var(--ocean-blue-light); }
.version-artifact-row { background: #111823; border-color: var(--border-light); }
.next-step-copy h2, .section-heading-row h3, .friendly-section-heading h3 { color: var(--text-title); }
.next-step-copy p, .friendly-section-heading p, .friendly-input-bar p { color: var(--text-muted); }
.next-step-button[aria-busy="true"] { cursor: wait; opacity: .82; }
.next-step-button[aria-busy="true"]::after { width: 12px; height: 12px; margin-left: 8px; border: 2px solid rgba(255, 255, 255, .42); border-top-color: #fff; border-radius: 50%; content: ''; animation: studio-spin .7s linear infinite; }
@keyframes studio-spin { to { transform: rotate(360deg); } }
.friendly-shot-card, .artifact-card, .provider-card, .library-card { background: #151c29; border-color: var(--border-light); box-shadow: none; }
.friendly-shot-card:hover, .artifact-card:hover, .library-card:hover { border-color: var(--ocean-blue-border); }
.friendly-change-input, .field-group textarea, .field-group input, .create-form input, .create-form textarea, .create-form select { color: var(--text-title); background: var(--bg-input); border-color: var(--border-medium); }
.friendly-change-input::placeholder, .field-group input::placeholder, .field-group textarea::placeholder { color: var(--text-subtle); }
.field-group textarea:focus, .field-group input:focus, .create-form input:focus, .create-form textarea:focus { border-color: var(--ocean-blue); box-shadow: 0 0 0 2px rgba(111,140,255,.16); outline: none; }
.scope-choice, .quick-idea { color: var(--text-muted); background: #111823; border-color: var(--border-medium); }
.scope-choice.is-selected { color: var(--coral); background: var(--coral-light); border-color: var(--coral-border); }
.quick-idea:hover { color: var(--sage-green); border-color: var(--sage-green-border); }
.friendly-approved-label { color: var(--sage-green); }
.friendly-shot-primary-actions { margin: 0 0 8px; }
.friendly-shot-edit-panel { margin-top: 10px; padding: 0 12px; border: 1px solid var(--border-medium); border-radius: 10px; background: #111823; }
.friendly-shot-edit-panel[open] { padding-bottom: 12px; border-color: var(--ocean-blue-border); }
.friendly-shot-edit-panel > summary { cursor: pointer; padding: 11px 0; color: var(--ocean-blue); font-size: 11px; font-weight: 700; }
.friendly-shot-edit-panel > summary:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: 3px; border-radius: 3px; }
.friendly-shot-edit-panel > label { display: block; margin: 6px 0; color: var(--text-body); font-size: 11px; font-weight: 700; }
.friendly-shot-edit-panel > .provider-note { margin: 5px 0 10px; }
.friendly-shot-edit-panel .advanced-shot-settings { border-color: var(--border-light); }
.status-draft { color: var(--text-muted); background: #1b2230; border-color: var(--border-medium); }

.draft-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid var(--gold-amber-border);
  border-left: 3px solid var(--gold-amber);
  border-radius: 11px;
  background: var(--gold-amber-light);
}
.draft-status-copy { min-width: 0; }
.draft-status-copy strong { color: var(--gold-amber); font-size: 13px; }
.draft-status-copy p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.draft-status-items { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.draft-status-items span { padding: 4px 7px; border: 1px solid var(--gold-amber-border); border-radius: 999px; color: var(--gold-amber); background: rgba(255, 191, 105, .08); font: 700 10px var(--font-mono); white-space: nowrap; }
.draft-status-card > button { white-space: nowrap; }

.preflight-issues li { color: var(--text-body); background: #151c29; border-color: var(--border-medium); }
.preflight-issue-icon { flex: 0 0 18px; background: var(--coral); color: #fff; }
.preflight-issue-copy { display: grid; min-width: 0; gap: 3px; }
.preflight-issue-copy strong { color: var(--text-title); font-size: 12px; font-weight: 600; }
.preflight-issue-copy small { color: var(--gold-amber); font-size: 10px; }
.preflight-notice { color: var(--text-muted); }

.provider-setup-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; align-items: start; padding: 20px; border: 1px solid var(--ocean-blue-border); border-radius: 13px; background: linear-gradient(135deg, rgba(111, 140, 255, .1), rgba(18, 23, 34, .9)); }
.provider-setup-card > div { min-width: 0; }
.provider-setup-card h3 { margin: 0 0 5px; color: var(--text-title); font-size: 16px; }
.provider-setup-card > div > p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.provider-setup-steps { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 2px 0 0; padding: 0; list-style: none; }
.provider-setup-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; min-width: 0; padding: 11px; border: 1px solid var(--border-light); border-radius: 9px; background: rgba(9, 12, 18, .45); }
.provider-setup-number { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--coral); color: #fff; font: 700 11px var(--font-mono); }
.provider-setup-steps strong { color: var(--text-title); font-size: 11px; }
.provider-setup-steps p { margin: 4px 0 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.provider-setup-card > button { grid-column: 1 / -1; justify-self: start; }

.provider-page-heading { border-color: var(--border-light); }
.provider-page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.provider-config-button { min-height: 42px; padding: 9px 18px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.provider-check-all-button { min-height: 42px; white-space: nowrap; }
.provider-batch-status { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--ocean-blue-border); border-radius: 9px; background: var(--ocean-blue-light); }
.provider-batch-status.is-attention { border-color: var(--gold-amber-border); background: var(--gold-amber-light); }
.provider-batch-status.is-complete { border-color: var(--sage-green-border); background: var(--sage-green-light); }
.provider-batch-status-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.provider-batch-status-copy strong { color: var(--text-title); font-size: 11px; }
.provider-batch-status-copy small { color: var(--text-muted); font-size: 10px; line-height: 1.4; text-align: right; }
.provider-batch-progress { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(9, 12, 18, .45); }
.provider-batch-progress span { display: block; height: 100%; border-radius: inherit; background: var(--ocean-blue); transition: width .2s ease; }
.provider-batch-status.is-attention .provider-batch-progress span { background: var(--gold-amber); }
.provider-batch-status.is-complete .provider-batch-progress span { background: var(--sage-green); }
.provider-readiness { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--border-light); border-radius: 12px; background: linear-gradient(120deg, rgba(255, 66, 104, .08), rgba(111, 140, 255, .06) 52%, rgba(199, 243, 107, .06)); }
.provider-readiness-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.provider-readiness-heading h3 { margin: 2px 0 0; color: var(--text-title); font-size: 14px; }
.provider-readiness-heading p { max-width: 420px; margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; text-align: right; }
.section-kicker { color: var(--coral); font: 700 9px var(--font-mono); letter-spacing: .14em; }
.provider-readiness-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.provider-readiness-card { display: grid; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--border-light); border-radius: 10px; background: rgba(9, 12, 18, .46); }
.provider-readiness-card.is-ready { border-color: var(--sage-green-border); background: rgba(199, 243, 107, .07); }
.provider-readiness-card.is-partial, .provider-readiness-card.is-unverified { border-color: var(--gold-amber-border); background: rgba(255, 191, 105, .06); }
.provider-readiness-card.is-attention { border-color: var(--coral-border); background: rgba(255, 66, 104, .07); }
.provider-readiness-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.provider-readiness-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid currentColor; border-radius: 8px; font: 700 10px var(--font-mono); }
.provider-readiness-icon.is-coral { color: var(--coral); background: var(--coral-light); }
.provider-readiness-icon.is-blue { color: var(--ocean-blue); background: var(--ocean-blue-light); }
.provider-readiness-icon.is-green { color: var(--sage-green); background: var(--sage-green-light); }
.provider-readiness-pill { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.provider-readiness-pill.is-ready { color: var(--sage-green); background: var(--sage-green-light); }
.provider-readiness-pill.is-partial, .provider-readiness-pill.is-unverified { color: var(--gold-amber); background: var(--gold-amber-light); }
.provider-readiness-pill.is-attention { color: var(--coral); background: var(--coral-light); }
.provider-readiness-pill.is-missing { color: var(--text-muted); background: var(--bg-tag); }
.provider-readiness-card h4 { margin: 0; color: var(--text-title); font-size: 13px; }
.provider-readiness-card > strong { color: var(--text-body); font: 700 11px var(--font-mono); }
.provider-readiness-card p, .provider-readiness-card small { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.45; }
.provider-readiness-card small { color: var(--text-subtle); }
.provider-readiness-card > button { justify-self: start; margin-top: 2px; }
.operations-dialog .ops-capacity { background: var(--coral-light); border: 1px solid var(--coral-border); color: var(--text-body); }
.operations-dialog .ops-readiness { background: #111823; border-color: var(--border-light); }
.operations-dialog .ops-readiness-item { background: #151c29; border-color: var(--border-light); }
.operations-dialog .ops-restore pre { color: var(--text-body); background: #0d121b; border: 1px solid var(--border-light); }
.provider-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.provider-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.provider-identity > span:last-child { display: grid; gap: 3px; min-width: 0; }
.provider-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-logo { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border: 1px solid var(--ocean-blue-border); border-radius: 9px; color: var(--ocean-blue); background: var(--ocean-blue-light); font: 800 12px var(--font-mono); }
.provider-pill { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 5px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.provider-pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.provider-pill.is-good { color: var(--sage-green); background: var(--sage-green-light); }
.provider-pill.is-bad { color: var(--coral); background: var(--coral-light); }
.provider-pill.is-muted { color: var(--text-muted); background: var(--bg-tag); }
.provider-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.provider-details > div { min-width: 0; padding: 7px 8px; border: 1px solid var(--border-light); border-radius: 7px; background: rgba(9, 12, 18, .3); }
.provider-details dt { color: var(--text-subtle); font-size: 9px; }
.provider-details dd { margin: 2px 0 0; overflow-wrap: anywhere; color: var(--text-body); font-size: 10px; }
.provider-error { margin: 10px 0 0; padding: 8px 9px; border-left: 2px solid var(--coral); color: var(--coral-hover); background: var(--coral-light); font-size: 10px; line-height: 1.45; }
.provider-card-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.provider-card, .health-card, .trace-card { background: #151c29 !important; border-color: var(--border-light) !important; }
.provider-name, .provider-details, .provider-card strong, .provider-card h4, .health-card-title h3 { color: var(--text-title); }
.provider-note, .provider-card small, .provider-details, .health-grid span { color: var(--text-muted); }

/* Feature pages also inherit the global theme. These selectors cover the
   white surfaces defined in library.css and production.css. */
.library-page, .production-page { color: var(--text-body); }
.library-page h2, .production-page h2, .production-page h3 { color: var(--text-title); }
.library-field input, .library-field select, .library-field textarea,
.production-page select, .production-field input, .production-field select, .production-field textarea {
  color: var(--text-title); background: var(--bg-input); border-color: var(--border-medium);
}
.library-card, .library-version, .library-chip, .library-picker-footer,
.production-count, .production-trend, .production-projects, .production-categories span {
  color: var(--text-body); background: #151c29; border-color: var(--border-light);
}
.library-preview { background: #0a0e15; }
.library-picker-footer { box-shadow: 0 -12px 20px rgba(0, 0, 0, .18); }
.library-card h3, .production-project strong { color: var(--text-title); }
.library-card .provider-note, .production-count span, .production-project small { color: var(--text-muted); }
.library-card:hover, .library-pick-card.is-selected { background: var(--coral-light); }
.production-count.is-selected { background: var(--coral-light); border-color: var(--coral); }
.production-project:hover { background: rgba(255, 255, 255, .04); }
.production-state { color: var(--text-body); background: var(--bg-tag); }
.state-review { color: var(--gold-amber); background: var(--gold-amber-light); }
.state-attention { color: var(--coral-hover); background: var(--coral-light); }
.state-completed { color: var(--sage-green); background: var(--sage-green-light); }
.batch-preview, .ops-restore pre { color: var(--text-body); background: #0e131d; border: 1px solid var(--border-light); }
.ops-capacity { color: var(--text-title); }

/* Creation shortcuts are real keyboard-accessible controls, not light-theme spans. */
.sample-tag-btn, .chip-item {
  color: var(--text-muted);
  background: #111823;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  min-height: 32px;
  padding: 5px 11px;
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
}
.sample-tag-btn:hover, .chip-item:hover {
  color: var(--sage-green);
  background: var(--sage-green-light);
  border-color: var(--sage-green-border);
}
.sample-tag-btn:focus-visible, .chip-item:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: 2px; }
.create-source-help, .library-create-picker { color: var(--text-muted); }
.library-create-picker { background: rgba(111, 140, 255, .06); border-color: var(--ocean-blue-border); }
.model-free-route-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--sage-green-border);
  border-left: 3px solid var(--sage-green);
  border-radius: 9px;
  color: var(--text-muted);
  background: linear-gradient(105deg, rgba(199, 243, 107, .09), rgba(111, 140, 255, .05));
  font-size: 11px;
  line-height: 1.55;
}
.model-free-route-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--sage-green-border);
  border-radius: 999px;
  color: var(--sage-green);
  background: var(--sage-green-light);
  font: 700 9px var(--font-mono);
  white-space: nowrap;
}

.create-dialog, .version-dialog, .studio-account-dialog { color: var(--text-body); background: #121722; border: 1px solid var(--border-medium); box-shadow: var(--shadow-card); }
.create-dialog::backdrop, .version-dialog::backdrop, .studio-account-dialog::backdrop { background: rgba(2, 4, 8, .78); backdrop-filter: blur(10px); }
.dialog-header, .dialog-actions-bar { border-color: var(--border-light); }
.dialog-header h2, .form-section-header h3 { color: var(--text-title); }
.dialog-header p, .field-help, .tab-desc { color: var(--text-muted); }
.source-tab { background: #151c29; border-color: var(--border-medium); }
.source-tab.is-selected { background: var(--coral-light); border-color: var(--coral); }
.source-tab.is-selected .tab-badge { color: var(--coral); }
.source-tab:focus-visible, .dropzone-label:focus-visible, .dropzone-label-horizontal:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: 3px; }
.upload-dropzone { background: #0e131d; border-color: var(--border-medium); }
.upload-dropzone.has-file { border-color: var(--sage-green-border); background: var(--sage-green-light); }
.toast { color: var(--text-title); background: #151c29; border-color: var(--coral-border); box-shadow: var(--shadow-card); }

@media (max-width: 1100px) {
  .workflow-guide { grid-template-columns: 1fr; gap: 10px; }
  .workflow-guide-tip { display: none; }
  .workspace-readiness { grid-template-columns: auto minmax(0, 1fr); }
  .workspace-readiness-actions { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 960px) {
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 28px; }
  .brand-text-logo::after { display: none; }
  .task-rail { top: 68px; width: min(340px, 86vw); border-radius: 0 14px 14px 0; }
  .rail-btn-close { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-nav-backdrop { display: block; position: fixed; inset: 68px 0 0; z-index: 45; width: 100%; height: auto; padding: 0; background: rgba(2, 4, 8, .66); backdrop-filter: blur(3px); cursor: pointer; }
  .mobile-nav-backdrop[hidden] { display: none; }
}
@media (max-width: 600px) {
  .topbar { height: auto; min-height: 68px; padding: 9px 12px; }
  .top-nav { overflow-x: auto; justify-content: flex-start; }
  .top-nav-item { padding: 7px 11px; white-space: nowrap; }
  .content { padding: 14px 10px 24px; }
  /* Put the active project and its next action above dashboard counters on phones. */
  .metrics-grid { display: none; }
  #pageTitle { font-size: 18px; }
  .page-kicker { font-size: 9px; }
  .caption-subline { display: block; }
  .page-description { display: none; }
  .workflow-guide { padding: 12px; }
  .quick-start-actions { grid-template-columns: 1fr; width: 100%; }
  .quick-start-card { padding: 10px 12px; }
  .workflow-guide-steps { grid-template-columns: repeat(2, 1fr); }
  .workflow-guide-step { padding: 7px; }
  .model-free-route-note { display: grid; gap: 5px; }
  .workspace-readiness { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px; }
  .workspace-readiness-copy strong { font-size: 12px; }
  .workspace-readiness-copy p { font-size: 10px; }
  .workspace-readiness-items { gap: 4px; }
  .workspace-readiness-actions { grid-column: 1 / -1; width: 100%; }
  .workspace-readiness-actions > * { flex: 1 1 auto; justify-content: center; }
  .detail-body { padding: 14px 13px 22px; }
  .detail-header { padding: 16px 14px 12px; }
  .detail-title-line { flex-wrap: wrap; gap: 8px 10px; }
  .detail-title-line > div:not(.detail-status-wrap) { flex: 1; min-width: 0; }
  .detail-title-line h2 { overflow-wrap: anywhere; font-size: 18px; line-height: 1.3; }
  .detail-status-wrap { flex: 0 0 100%; margin-left: 0; flex-wrap: wrap; gap: 6px; }
  .detail-meta-row { gap: 6px 14px; margin-top: 10px; }
  .detail-tabs { padding: 0 10px; gap: 4px; }
  .detail-tab { flex: 1; justify-content: center; padding: 10px 7px; font-size: 12px; }
  .history-page, .provider-page { min-width: 0; padding: 16px; gap: 16px; }
  .provider-page-heading { align-items: stretch; flex-direction: column; gap: 14px; }
  .provider-page-heading > div { min-width: 0; }
  .provider-page-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .provider-page-actions > button { width: 100%; justify-content: center; }
  .provider-batch-status-copy { align-items: flex-start; flex-direction: column; gap: 3px; }
  .provider-batch-status-copy small { text-align: left; }
  .provider-readiness-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .provider-readiness-heading p { max-width: none; text-align: left; }
  .provider-readiness-grid { grid-template-columns: 1fr; }
  .provider-readiness-card > button { width: 100%; justify-content: center; }
  .provider-card-header { flex-direction: column; }
  .provider-pill { align-self: flex-start; }
  .provider-details { grid-template-columns: 1fr; }
  .health-card { padding: 14px; }
  .health-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .health-grid > div { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-light); }
  .health-grid > div:last-child { border-bottom: 0; }
  .health-grid strong { max-width: 58%; text-align: right; overflow-wrap: anywhere; }
  .draft-status-card { grid-template-columns: 1fr; gap: 9px; }
  .draft-status-items { justify-content: flex-start; }
  .draft-status-card > button { width: 100%; justify-content: center; }
  .provider-setup-card { grid-template-columns: auto minmax(0, 1fr); padding: 15px; }
  .provider-setup-steps { grid-template-columns: 1fr; }
  .provider-setup-card > button { width: 100%; justify-content: center; }
}

/* No-model delivery path: a small, touch-friendly storyboard editor. */
.manual-storyboard-card {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--ocean-blue-border, #2b587b);
  border-left: 4px solid var(--gold-amber, #ffbf69);
  border-radius: 14px;
  background: #111b29;
  color: var(--text-body, #d8e1ed);
}
.manual-storyboard-heading, .manual-storyboard-row-top, .manual-storyboard-actions, .manual-storyboard-row-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.manual-storyboard-heading-meta { display: grid; justify-items: end; gap: 6px; flex: 0 0 auto; }
.manual-storyboard-heading h3 { margin: 4px 0; color: var(--text-title, #f4f7fb); font-size: 17px; }
.manual-storyboard-heading p { max-width: 680px; margin: 0; color: var(--text-muted, #94a4b8); font-size: 12px; line-height: 1.65; }
.manual-storyboard-count { flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--gold-amber-border, #80623a); border-radius: 999px; color: var(--gold-amber, #ffbf69); font: 700 10px var(--font-mono, monospace); white-space: nowrap; }
.manual-storyboard-summary { color: var(--text-subtle, #718096); font: 10px var(--font-mono, monospace); white-space: nowrap; }
.manual-storyboard-checklist {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--sage-green-border, #647d42);
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(199, 243, 107, .08), rgba(111, 140, 255, .06));
}
.manual-storyboard-check-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.manual-storyboard-check-heading > div { display: grid; gap: 3px; min-width: 0; }
.manual-storyboard-check-heading strong { color: var(--text-title, #f4f7fb); font-size: 12px; }
.manual-storyboard-check-hint { color: var(--text-muted, #94a4b8); font-size: 11px; line-height: 1.45; }
.manual-storyboard-check-progress { flex: 0 0 auto; color: var(--sage-green, #c7f36b); font: 700 10px var(--font-mono, monospace); white-space: nowrap; }
.manual-storyboard-check-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.manual-storyboard-check-item { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 9px; border: 1px solid var(--border-light, #28384b); border-radius: 8px; background: rgba(9, 12, 18, .35); }
.manual-storyboard-check-mark { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; color: var(--text-subtle, #718096); background: var(--bg-tag, #1b2230); font: 700 9px var(--font-mono, monospace); }
.manual-storyboard-check-copy { overflow: hidden; color: var(--text-muted, #94a4b8); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.manual-storyboard-check-item.is-complete { border-color: var(--sage-green-border, #647d42); background: var(--sage-green-light, rgba(199, 243, 107, .13)); }
.manual-storyboard-check-item.is-complete .manual-storyboard-check-mark { color: #0b1208; background: var(--sage-green, #c7f36b); }
.manual-storyboard-check-item.is-complete .manual-storyboard-check-copy { color: var(--sage-green, #c7f36b); font-weight: 700; }
.manual-storyboard-check-item.is-pending .manual-storyboard-check-mark { border: 1px solid var(--border-medium, #3a4c62); }
.manual-template-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 128, 109, .3);
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(255, 128, 109, .1), rgba(114, 201, 255, .07));
}
.manual-template-picker-copy { display: grid; gap: 3px; min-width: 0; }
.manual-template-picker-copy strong { color: var(--text-title, #f4f7fb); font-size: 12px; }
.manual-template-picker-copy span { color: var(--text-muted, #94a4b8); font-size: 11px; line-height: 1.45; }
.manual-template-options { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.manual-template-option {
  padding: 7px 10px;
  border: 1px solid rgba(255, 128, 109, .45);
  border-radius: 999px;
  color: var(--coral, #ff806d);
  background: rgba(255, 128, 109, .08);
  font-size: 11px;
  white-space: nowrap;
}
.manual-template-option:hover, .manual-template-option:focus-visible { border-color: var(--coral, #ff806d); color: #fff; background: rgba(255, 128, 109, .2); }
.manual-script-split-option { border-color: var(--sage-green-border, rgba(199, 243, 107, .52)); color: var(--sage-green, #c7f36b); background: var(--sage-green-light, rgba(199, 243, 107, .12)); }
.manual-script-split-option:hover, .manual-script-split-option:focus-visible { border-color: var(--sage-green, #c7f36b); color: #10170a; background: var(--sage-green, #c7f36b); }
.manual-template-option:disabled { opacity: .55; cursor: wait; }
.manual-storyboard-list { display: grid; gap: 10px; }
.manual-storyboard-row { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--border-light, #28384b); border-radius: 11px; background: #172333; }
.manual-storyboard-row-top strong { color: var(--text-title, #f4f7fb); font-size: 12px; white-space: nowrap; }
.manual-storyboard-row-top { flex-wrap: wrap; }
.manual-storyboard-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.manual-storyboard-row-actions button { white-space: nowrap; }
.manual-storyboard-row label { display: grid; gap: 5px; min-width: 0; color: var(--text-muted, #94a4b8); font-size: 11px; }
.manual-storyboard-row input, .manual-storyboard-row textarea { width: 100%; box-sizing: border-box; min-width: 0; padding: 9px 10px; border: 1px solid var(--border-medium, #3a4c62); border-radius: 8px; background: #0e1622; color: var(--text-title, #f4f7fb); font: inherit; font-size: 12px; }
.manual-storyboard-row textarea { resize: vertical; line-height: 1.55; }
.manual-storyboard-row input:focus-visible, .manual-storyboard-row textarea:focus-visible { outline: 2px solid var(--ocean-blue, #72c9ff); outline-offset: 1px; border-color: var(--ocean-blue, #72c9ff); }
.manual-storyboard-row-foot { align-items: flex-end; }
.manual-duration-field { flex: 0 0 110px; }
.manual-camera-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 1px; }
.manual-camera-presets-label { color: var(--text-subtle, #718096); font-size: 10px; }
.manual-camera-preset { padding: 3px 7px; border: 1px solid var(--border-light, #28384b); border-radius: 999px; color: var(--text-muted, #94a4b8); background: rgba(114, 201, 255, .04); font-size: 10px; }
.manual-camera-preset:hover, .manual-camera-preset[aria-pressed="true"] { border-color: var(--ocean-blue, #72c9ff); color: var(--ocean-blue, #72c9ff); background: rgba(114, 201, 255, .1); }
.manual-storyboard-actions { align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.manual-storyboard-actions .primary-button { margin-left: auto; }
.manual-saved-field { display: grid; gap: 5px; margin-top: 10px; color: var(--text-muted, #94a4b8); font-size: 11px; }
.manual-saved-field input { box-sizing: border-box; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--border-medium, #3a4c62); border-radius: 8px; background: #0e1622; color: var(--text-title, #f4f7fb); font: inherit; font-size: 12px; }
.manual-saved-field input:focus-visible { outline: 2px solid var(--ocean-blue, #72c9ff); outline-offset: 1px; }
.friendly-section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.friendly-section-actions > span { color: var(--coral, #ff806d); font-size: 12px; font-weight: 700; white-space: nowrap; }
.storyboard-download-link { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 600px) {
  .manual-storyboard-card { padding: 14px; }
  .manual-storyboard-heading { flex-direction: column; }
  .manual-storyboard-heading-meta { justify-items: start; }
  .manual-storyboard-count { align-self: flex-start; }
  .manual-template-picker { align-items: stretch; flex-direction: column; }
  .manual-template-options { justify-content: flex-start; }
  .manual-template-option { flex: 1 1 auto; }
  .manual-storyboard-check-list { grid-template-columns: 1fr; }
  .manual-storyboard-check-heading { flex-direction: column; gap: 5px; }
  .manual-storyboard-row-foot { flex-direction: column; align-items: stretch; }
  .manual-storyboard-row-top { flex-direction: column; gap: 8px; }
  .manual-storyboard-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .manual-storyboard-row-actions button { min-height: 36px; padding: 7px 9px; border: 1px solid var(--border-medium); border-radius: 6px; }
  .manual-duration-field { flex-basis: auto; }
  .manual-storyboard-actions > button { flex: 1 1 100%; justify-content: center; }
  .manual-storyboard-actions .primary-button { margin-left: 0; }
  .friendly-section-actions { justify-content: flex-start; width: 100%; }
}

.create-recovery-notice {
  margin-top: 16px;
  padding: 15px 17px;
  border: 1px solid var(--ocean-blue-border);
  border-left: 4px solid var(--ocean-blue);
  border-radius: 10px;
  background: #101d30;
  color: var(--text-title);
}
.create-recovery-notice[hidden] { display: none; }
.create-recovery-notice[data-kind="draft"] { border-color: var(--sage-green-border); border-left-color: var(--sage-green); background: #172419; }
.create-recovery-notice p { margin: 0 0 12px; line-height: 1.6; }
.create-recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
  .create-recovery-actions > button { flex: 1 1 100%; justify-content: center; }
}

/* Project archive: visible filters and legible cards instead of the old white table. */
.history-kicker { display: block; margin-bottom: 5px; color: var(--coral); font: 700 10px var(--font-mono); letter-spacing: .13em; }
.history-filters { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(125px, 150px) minmax(125px, 150px) auto auto; align-items: center; gap: 10px; }
.history-filters > input, .history-filters > select, .history-advanced-fields input, .history-advanced-fields select { width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-medium); border-radius: 9px; outline: none; background: var(--bg-input); color: var(--text-title); font: inherit; }
.history-filters input:focus-visible, .history-filters select:focus-visible, .history-advanced summary:focus-visible, .history-card button:focus-visible { outline: 2px solid var(--ocean-blue); outline-offset: 2px; }
.history-filters input::placeholder { color: var(--text-subtle); }
.history-clear { white-space: nowrap; justify-content: center; }
.history-draft-filter { min-height: 42px; justify-content: center; border: 1px solid var(--gold-amber-border); color: var(--gold-amber); background: var(--gold-amber-light); white-space: nowrap; }
.history-draft-filter[aria-pressed="true"] { color: #111722; background: var(--gold-amber); border-color: var(--gold-amber); box-shadow: 0 6px 18px rgba(255, 191, 105, .2); }
.history-draft-filter:hover:not(:disabled) { color: #111722; background: var(--gold-amber); border-color: var(--gold-amber); }
.history-advanced { grid-column: 1 / -1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border-light); border-radius: 9px; background: #101722; }
.history-advanced summary { color: var(--text-muted); cursor: pointer; font-size: 12px; }
.history-advanced-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; margin-top: 13px; }
.history-filter-field { display: grid; min-width: 0; gap: 6px; }
.history-filter-field label { color: var(--text-muted); font-size: 11px; }
.history-count { margin: 0 0 11px; color: var(--text-muted); font-size: 12px; }
.history-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.history-card { display: grid; min-width: 0; gap: 12px; padding: 18px; border: 1px solid var(--border-light); border-left: 3px solid var(--ocean-blue); border-radius: 11px; background: #151c29; }
.history-card:nth-child(3n + 2) { border-left-color: var(--coral); }
.history-card:nth-child(3n) { border-left-color: var(--sage-green); }
.history-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.history-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.history-card-title h3 { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--text-title); font-size: 15px; line-height: 1.45; }
.history-card-meta { margin: 0; overflow-wrap: anywhere; color: var(--text-muted); font-size: 12px; }
.history-draft-badge { display: inline-flex; width: fit-content; margin-left: 7px; padding: 3px 6px; border: 1px solid var(--gold-amber-border); border-radius: 999px; color: var(--gold-amber); background: var(--gold-amber-light); font-size: 9px; line-height: 1.2; vertical-align: middle; white-space: nowrap; }
.history-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px solid var(--border-light); color: var(--text-subtle); font-size: 11px; }
.history-card-foot button { flex-shrink: 0; }
.history-feedback { display: grid; justify-items: start; gap: 8px; padding: 30px 20px; border: 1px dashed var(--border-medium); border-radius: 11px; color: var(--text-muted); background: #101722; }
.history-feedback p { margin: 0; }
.history-feedback strong { color: var(--text-title); }
.history-more { display: flex; justify-content: center; margin: 16px auto 0; }
@media (max-width: 900px) {
  .history-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .history-filters > input, .history-advanced { grid-column: 1 / -1; }
  .history-clear { grid-column: 1 / -1; }
  .history-advanced-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .history-card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .history-card-head { flex-wrap: wrap; }
  .history-card-foot { flex-wrap: wrap; }
  .history-card-foot button { width: 100%; justify-content: center; }
}

/* Final readability overrides: kept at the end so feature styles cannot
   silently shrink the controls again. */
html, body { font-size: 15px; line-height: 1.7; }
button, input, select, textarea { font-size: inherit; }
.top-nav .top-nav-item { flex: 0 0 auto; min-height: 42px; font-size: 14px; font-weight: 700; }
.warm-coral-btn, .primary-button, .secondary-button { min-height: 42px; font-size: 14px; }
.warm-coral-btn, .primary-button, .studio-account-button,
.top-nav-item.is-active { color: #090c12; font-weight: 700; }
.primary-button.small, .secondary-button.small { min-height: 36px; font-size: 13px; }
#pageTitle { font-size: 26px; }
.metric-label, .workflow-guide-kicker, .page-kicker, .caption-status { font-size: 12px; }
.metric-value { font-size: 30px; }
.caption-quote, .page-description { font-size: 13px; }
.workflow-guide-heading strong, .workflow-guide-steps strong { font-size: 14px; }
.workflow-guide-steps small { white-space: normal; }
.workflow-guide-steps small, .workflow-guide-tip { font-size: 12px; }
.task-item { padding: 13px; }
.task-item-title { font-size: 14px; }
.task-item-meta, .task-list-empty span { font-size: 12px; }
.detail-body { font-size: 14px; }
.detail-meta-row, .next-step-copy p, .friendly-section-heading p, .friendly-input-bar p { font-size: 13px; }
.section-heading-row h3, .friendly-section-heading h3 { font-size: 17px; }
.field-group label, .field-item label, .group-label { font-size: 13px; }
.field-group textarea, .field-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.create-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .create-form textarea,
.create-form select, .field-item input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field-item textarea, .manual-storyboard-row input, .manual-storyboard-row textarea,
.manual-saved-field input { min-height: 44px; padding: 10px 12px; font-size: 15px; }
.provider-details dt { font-size: 12px; }
.dialog-header h2 { font-size: 21px; }
.dialog-header p { font-size: 13px; }
.field-item input:focus-visible, .field-item textarea:focus-visible, .field-group input:focus-visible,
.field-group textarea:focus-visible, .create-form input:focus-visible, .create-form textarea:focus-visible,
.create-form select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(111, 140, 255, .8);
  outline-offset: 2px;
}
.studio-account-notice { padding: 9px 11px; border: 1px solid rgba(255, 66, 104, .5); border-radius: 8px; background: rgba(255, 66, 104, .12); color: #ff9ab0; font-weight: 700; }
.studio-account-field input { min-height: 48px; font-size: 15px; }
.studio-account-help, .studio-account-member > p { color: var(--text-muted); }
.studio-account-dialog :focus-visible, .studio-account-entry:focus-visible {
  outline: 3px solid var(--ocean-blue); outline-offset: 3px;
}
.field-help, .tab-desc, .workspace-readiness-copy p, .manual-storyboard-heading p,
.manual-storyboard-row label, .manual-saved-field, .manual-template-picker-copy span,
.manual-storyboard-check-hint, .manual-storyboard-check-copy, .history-card-meta,
.history-card-foot, .history-count, .provider-note, .provider-error, .provider-details dd,
.billing-description, .billing-heading-meta, .billing-section-heading p, .billing-muted,
.billing-summary-card small, .billing-order-row small, .billing-ledger-row,
.billing-settlement-field, .billing-settlement-confirm, .billing-settlement-feedback,
.ops-readiness-copy p, .ops-readiness-scope, .ops-readiness-scope small,
.ops-readiness-item-copy span, .ops-readiness-guide, .ops-next-step-copy p,
.ops-replica-guide, .storyboard-preview-notice, .storyboard-preview-timeline-item span {
  font-size: 13px; line-height: 1.65;
}
.workspace-readiness-copy strong, .manual-storyboard-row-top strong,
.manual-template-picker-copy strong, .manual-storyboard-check-heading strong,
.billing-summary-card span, .billing-order-row strong, .ops-readiness-item-copy strong {
  font-size: 14px;
}
.manual-storyboard-count, .manual-storyboard-summary, .manual-camera-presets-label,
.manual-storyboard-check-progress, .history-draft-badge, .billing-order-status,
.ops-readiness-pill { font-size: 12px; }
.manual-template-option, .manual-camera-preset, .text-button { min-height: 36px; font-size: 13px; }
.library-card .library-actions button, .library-chip button { min-height: 36px; font-size: 13px; }
.production-day small { font-size: 12px; }
input::placeholder, textarea::placeholder { color: var(--text-subtle); opacity: 1; }
button:disabled { cursor: not-allowed; }
.warm-coral-btn:disabled, .primary-button:disabled {
  background: #2a3547;
  border-color: #43516a;
  color: #d7deea;
  opacity: 1;
  filter: none;
  box-shadow: none;
}
.secondary-button:disabled {
  background: #202a3a;
  border-color: #3a475c;
  color: #aebbd0;
  opacity: 1;
  filter: none;
  box-shadow: none;
}
.storyboard-preview-dialog button:disabled,
.studio-account-dialog button:disabled,
.ops-readiness-tools .text-button:disabled,
.manual-template-option:disabled,
.scope-choice:disabled {
  opacity: 1;
  filter: none;
}
.storyboard-preview-dialog button:disabled {
  background: #202a3a;
  border-color: #3a475c;
  color: #aebbd0;
}
.studio-account-dialog button:disabled {
  background: #2a3547;
  border-color: #43516a;
  color: #d7deea;
}
.ops-readiness-tools .text-button:disabled {
  color: #aebbd0;
  background: transparent;
}
.manual-template-option:disabled {
  border-color: #3a475c;
  color: #aebbd0;
  background: #202a3a;
}
.scope-choice:disabled {
  border-color: #3a475c;
  color: #aebbd0;
  background: #202a3a;
}
@media (max-width: 900px) {
  .topbar { padding-inline: 16px; }
  .content { padding: 18px 18px 28px; }
  .workflow-guide { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 600px) {
  html, body { font-size: 15px; }
  .topbar { min-height: 60px; padding-inline: 12px; }
  .top-nav { display: flex; overflow-x: auto; }
  .content { padding: 16px 12px 24px; }
  #pageTitle { font-size: 22px; }
  .caption-subline { align-items: flex-start; flex-direction: column; gap: 2px; }
  .page-description::before { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-layout { grid-template-columns: minmax(0, 1fr); }
  .rail-status-filters button { min-height: 38px; }
  .quick-start-actions { grid-template-columns: 1fr; }
}
