/* Shared UI system */
.card-head {
  padding: 16px var(--space-panel);
}
.card-body {
  padding: var(--space-panel);
}
.card-title {
  font-size: var(--fs-title);
}
.card-sub {
  color: var(--muted-soft);
  font-size: var(--fs-caption);
}
.field label {
  color: var(--text-secondary);
  font-size: var(--fs-control);
}
.field input,
.field textarea,
.field select {
  font-size: var(--fs-body);
}
.field input,
.field select {
  min-height: 42px;
}
.field .hint,
.lyrics-tools,
.audio-copy > span,
.concept-settings-title small {
  color: var(--muted);
  font-size: var(--fs-small);
}
.btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--control-radius);
  font-size: var(--fs-control);
  line-height: 1.2;
}
.btn.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: var(--fs-small);
}
.audio-title-row .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: var(--fs-small);
}
.audio-copy {
  display: grid;
  gap: 0;
}
.audio-source-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.audio-source-actions .item-delete-icon {
  flex: 0 0 32px;
}
.audio-copy > span {
  margin-top: 7px;
}
.audio-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
}
.audio-review-grid .lrc-editor {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}
.audio-review-grid .lrc-lines {
  flex: 1;
  max-height: 420px;
}
.audio-review-grid .audio-storyboard-live {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 13px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #32405a;
  border-radius: 11px;
  background: #0a1019;
}
.audio-review-grid .audio-storyboard-frame {
  width: 100%;
  max-height: 420px;
}
.audio-review-grid .audio-storyboard-info {
  margin-top: 10px;
  text-align: center;
}
.audio-review-grid .audio-storyboard-info small {
  margin: 0;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 750;
}
html[data-theme="light"] .audio-review-grid .audio-storyboard-live {
  border-color: #cbd5e1;
  background: #f8fafc;
}
html[data-theme="light"] .audio-review-grid .audio-storyboard-info small {
  color: #334155;
}
.audio-analysis-workstation {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid #30384b;
  border-radius: 13px;
  background: #080c13;
}
.audio-analysis-controls {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 10px 14px;
}
.audio-analysis-controls .audio-transport {
  gap: 12px;
}
.audio-analysis-controls .audio-play-toggle {
  width: 46px;
  height: 46px;
  border-color: #7569ae;
  background: linear-gradient(145deg, #6d4cff, #4931b5);
  box-shadow: 0 8px 24px #6d4cff3a;
  color: #fff;
  font-size: 17px;
}
.audio-analysis-controls .audio-play-toggle:hover:not(:disabled) {
  border-color: #a99eff;
  background: linear-gradient(145deg, #7c5cff, #5638ca);
}
.audio-analysis-controls .audio-transport-time {
  min-width: 112px;
  color: #d8deea;
  font-size: 12px;
  font-weight: 700;
}
.audio-analysis-workstation .audio-review-grid {
  margin: 0;
  padding: 12px;
}
.audio-analysis-workstation .lrc-editor,
.audio-analysis-workstation .audio-storyboard-live {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.audio-analysis-workstation .audio-timeline {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.audio-analysis-workstation .audio-timeline-head,
.audio-analysis-workstation .audio-timeline-readout {
  display: none;
}
html[data-theme="light"] .audio-analysis-workstation {
  border-color: #cbd5e1;
  background: #fff;
}
html[data-theme="light"] .audio-analysis-controls .audio-transport-time {
  color: #334155;
}
.audio-structure-counts {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
  padding: 12px 14px 14px;
  flex-wrap: wrap;
}
.audio-structure-counts .recommendation {
  max-width: min(100%, 620px);
}
.btn[data-shot-image],
.btn[data-char-image] {
  border-color: #9b87f555;
  background: linear-gradient(115deg, #7c3aed, #6265e9);
  box-shadow: 0 8px 22px #6d28d936;
  color: #fff;
}
.actions,
.panel-toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-toolbar);
  flex-wrap: wrap;
}
.panel-toolbar {
  margin: 0;
}
.actions .push,
.panel-toolbar .push {
  margin-left: auto;
}
.scene-controls .btn {
  align-self: flex-end;
}
.panel-description {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.7;
}
.scene-structure-workflow {
  display: grid;
  gap: 9px;
}
.structure-count-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.structure-count-row .recommendation {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  margin: 0;
}
.structure-action-row {
  display: flex;
  align-items: center;
}
.structure-action-row .btn {
  min-width: 230px;
}
.shot-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shot-details-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.empty,
.library-empty {
  padding: 42px 20px;
  border: 1px dashed #303a4f;
  border-radius: 15px;
  background: linear-gradient(135deg, #10141c88, #0a0d1288);
  color: var(--muted);
  font-size: var(--fs-body);
  text-align: center;
}
.empty strong,
.library-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
}
.library-toolbar input,
.library-toolbar select {
  min-height: 40px;
  font-size: var(--fs-body);
}
.library-count {
  color: var(--muted);
  font-size: var(--fs-small);
}
.view-toolbar .view-label,
.view-toggle button {
  font-size: var(--fs-small);
}
.scene-toolbar {
  padding: 8px;
}
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: var(--rail) minmax(0, 1fr);
  }
  .bottom-dock {
    right: 20px;
  }
}
@media (max-width: 760px) {
  :root {
    --rail: 0px;
  }
  .shell {
    padding: 0 12px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 66px;
    z-index: 25;
    background: #080b11d9;
    backdrop-filter: blur(16px);
    margin: 0 -12px 12px;
    padding: 8px 12px;
  }
  .step-nav {
    display: flex;
  }
  .step-link {
    width: auto;
    min-width: 64px;
    height: 50px;
    flex: 1;
  }
  .project-title {
    display: none;
  }
  .save-state {
    display: none;
  }
  .bottom-dock {
    left: 12px;
    right: 12px;
    bottom: 8px;
  }
  .dock-stage {
    display: none;
  }
  .dock-primary {
    min-width: 0;
    flex: 1;
  }
  .scene-list.view-table .shot-card,
  .shot-card {
    grid-template-columns: 1fr;
  }
  .top-actions {
    gap: 6px;
  }
  .hero p {
    font-size: 12px;
  }
}
/* Requested refinements */
@media (min-width: 901px) {
  .concept-settings {
    grid-template-columns: minmax(140px, 0.55fr) minmax(170px, 1fr) minmax(
        170px,
        1fr
      ) minmax(130px, 0.7fr);
  }
}
.concept-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 17px;
  align-items: stretch;
}
.lyrics-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.concept-editor-right {
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto;
  gap: 20px;
}
.concept-editor-grid .lyrics-label,
.concept-editor-grid .field-title-row {
  min-height: 32px;
  margin-bottom: 8px;
}
.field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.field-title-row label {
  margin: 0;
}
.lyrics-field .text-window {
  display: flex;
  flex: 1;
  min-height: 0;
}
.lyrics-field #lyrics {
  flex: 1;
  height: auto;
  min-height: 680px;
}
.concept-editor-right #direction {
  height: 260px;
  min-height: 260px;
}
.concept-editor-right #story {
  height: 360px;
  min-height: 360px;
}
#story-wrap {
  min-width: 0;
}
.creative-treatment {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #2c3446;
  border-radius: 14px;
  background: linear-gradient(145deg, #111722, #0b1018);
}
.creative-treatment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.creative-treatment-head strong {
  font-size: 13px;
}
.creative-treatment-head span {
  color: var(--muted);
  font-size: 10px;
}
.creative-treatment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.creative-treatment-grid .wide {
  grid-column: 1/-1;
}
.creative-treatment-grid textarea {
  min-height: 96px;
}
.emotional-arc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.emotional-arc-grid textarea {
  min-height: 82px;
}
.creative-motifs {
  display: grid;
  gap: 8px;
}
.creative-motif-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1.3fr) auto;
  gap: 8px;
  align-items: end;
}
.creative-motif-row .btn {
  height: 42px;
}
.creative-treatment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.lyric-relation {
  width: 160px;
  min-width: 145px;
  margin: 0;
}
.text-window {
  position: relative;
  min-width: 0;
}
.text-window textarea {
  padding-right: 84px;
}
.text-window-tools {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.text-window-action {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid #39445a;
  border-radius: 8px;
  background: #111722e8;
  color: #aeb8ca;
  box-shadow: 0 5px 16px #0007;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition:
    border-color 0.16s,
    background 0.16s,
    color 0.16s,
    transform 0.16s;
}
.text-window-action:hover {
  border-color: #8b7cf0;
  background: #292345;
  color: #fff;
  transform: translateY(-1px);
}
.text-window-action:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}
.text-window-action.danger:hover {
  border-color: #fb7185;
  background: #451a25;
  color: #fecdd3;
}
.text-window-action .ico {
  width: 15px;
  height: 15px;
}
.hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 8px 14px;
  min-height: 38px;
}
.hero:after {
  display: none;
}
.hero .eyebrow {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0.16em;
}
.hero h1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.35;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.hero h1 br {
  display: none;
}
.hero p,
.hero-meta {
  display: none;
}
.layout {
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding-right: calc(var(--queue-width) + 18px);
  transition: padding-right 0.25s;
}
.drawer {
  width: var(--queue-width);
}
.scene-list.view-visual .shot-card {
  grid-template-columns: 560px minmax(0, 1fr);
}
body.queue-collapsed .layout {
  padding-right: 66px;
}
body.queue-collapsed .drawer {
  width: 48px;
}
body.queue-collapsed .drawer-head {
  height: 100%;
  padding: 10px 7px;
  border: 0;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
}
body.queue-collapsed .drawer-head strong,
body.queue-collapsed .drawer-head .queue-count,
body.queue-collapsed .drawer-head .queue-cancel-pending,
body.queue-collapsed .queue-list {
  display: none !important;
}
body.queue-collapsed .drawer-head .queue-toggle {
  display: inline-flex;
  margin: 0;
}
@media (max-width: 1300px) {
  .layout {
    padding-right: 0;
  }
  body.queue-collapsed .layout {
    padding-right: 64px;
  }
  .drawer {
    width: min(390px, calc(100vw - 32px));
  }
  body.queue-collapsed .drawer {
    width: 48px;
  }
  .drawer-head {
    height: auto;
    padding: 17px;
    border-bottom: 1px solid #ffffff10;
    align-items: center;
    justify-content: flex-start;
  }
  .drawer-head strong,
  .drawer-head .queue-toggle,
  .queue-list {
    display: flex;
  }
  .queue-list {
    display: grid;
  }
  body.queue-collapsed .drawer-head {
    height: 100%;
    padding: 10px 7px;
    border: 0;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  body.queue-collapsed .layout {
    padding-right: 0;
  }
  .scene-list.view-visual .shot-card {
    grid-template-columns: 1fr;
  }
  .library-toolbar {
    grid-template-columns: 1fr;
  }
  .library-grid {
    grid-template-columns: 1fr;
  }
  .panel-toolbar {
    align-items: stretch;
  }
  .panel-toolbar .push {
    margin-left: 0;
  }
  .scene-controls .btn {
    align-self: stretch;
  }
  .structure-count-row {
    align-items: stretch;
  }
  .structure-count-row .recommendation {
    flex-basis: auto;
  }
  .structure-action-row .btn {
    width: 100%;
    min-width: 0;
  }
  .shot-details-note {
    font-size: 9px;
  }
  .concept-editor-grid,
  .creative-treatment-grid,
  .emotional-arc-grid {
    grid-template-columns: 1fr;
  }
  .creative-treatment-grid .wide {
    grid-column: auto;
  }
  .creative-motif-row {
    grid-template-columns: 1fr;
  }
  .lyrics-field #lyrics {
    height: 360px;
    min-height: 360px;
  }
  .concept-editor-right #direction {
    height: 260px;
    min-height: 260px;
  }
  .concept-editor-right #story {
    height: 360px;
    min-height: 360px;
  }
  .hero {
    padding: 0 3px 10px;
  }
  .hero .eyebrow {
    display: none;
  }
  .hero h1 {
    font-size: 15px;
    white-space: normal;
    flex-wrap: wrap;
    gap: 2px 5px;
  }
}
.character-grid.result-flash {
  animation: result-flash 0.55s ease;
}
@keyframes result-flash {
  0% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.22);
    transform: translateY(-2px);
  }
  100% {
    filter: brightness(1);
    transform: none;
  }
}
.edit-guidance {
  border-color: #f59e0b55 !important;
  background: linear-gradient(180deg, #171207, #11100b) !important;
  color: #fde7b0 !important;
}
.edit-guidance-note {
  color: #fbbf24;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.mv-name-field {
  display: flex;
  align-items: center;
  min-width: 0;
  border-left: 1px solid #ffffff14;
}
.mv-name-field label {
  padding-left: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.mv-name-field .project-title {
  border-left: 0;
  width: min(25vw, 280px);
  padding-left: 8px;
}
.mv-action {
  white-space: nowrap;
}
.compact-label {
  display: none;
}
.new-mv-form {
  display: grid;
  gap: 14px;
}
.new-mv-error {
  min-height: 18px;
  color: #fda4af;
  font-size: 12px;
}
.previewable-image {
  cursor: zoom-in;
  transition:
    filter 0.18s,
    transform 0.18s;
}
.previewable-image:hover {
  filter: brightness(1.08);
}
.previewable-image:focus-visible {
  outline: 3px solid #a78bfa;
  outline-offset: -3px;
}
.image-preview-modal {
  z-index: 180;
  background: #020308ed;
  padding: 18px;
}
.image-preview-dialog {
  position: relative;
  width: min(94vw, 1600px);
  height: min(90vh, 1000px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid #ffffff22;
  border-radius: 20px;
  background: #090c12;
  box-shadow: 0 35px 120px #000;
  overflow: hidden;
}
.image-preview-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle, #1a2030, #07090d 70%);
}
.image-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.image-preview-caption {
  min-height: 52px;
  padding: 14px 68px 14px 20px;
  color: #cbd2df;
  font-size: 13px;
  border-top: 1px solid #ffffff12;
  background: #10151e;
}
.image-preview-close {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 14px;
  background: #0a0d13dc;
  backdrop-filter: blur(12px);
}
body.preview-open {
  overflow: hidden;
}
@media (max-width: 1220px) {
  .wide-label {
    display: none;
  }
  .compact-label {
    display: inline;
  }
  .mv-name-field .project-title {
    width: min(22vw, 220px);
  }
}
@media (max-width: 760px) {
  .mv-name-field {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.shot-card.shot-generating {
  border-color: #38bdf866;
}
.shot-card.shot-generated {
  border-color: #34d399;
  box-shadow: 0 0 0 2px #34d39925;
}
.shot-image-status {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  padding: 5px 8px;
  border: 1px solid #67e8f966;
  border-radius: 7px;
  background: #07131ee8;
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 6px 18px #0008;
}
.shot-image-status.error {
  border-color: #fb718566;
  color: #fecdd3;
  background: #211016e8;
}
.shot-card .scene-image img.just-generated {
  animation: shot-reveal 0.45s ease-out;
}
@keyframes shot-reveal {
  from {
    opacity: 0.15;
    filter: blur(8px);
    transform: scale(1.025);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
.shot-background-population {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(220px, 1fr);
  gap: 8px;
  margin: 8px 0;
}
.shot-background-population label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
}
.shot-background-population select,
.shot-background-population input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #33405a;
  border-radius: 7px;
  background: #0c1017;
  color: #cbd5e1;
  padding: 7px 9px;
  font-size: 10px;
}
html[data-theme="light"] .shot-background-population select,
html[data-theme="light"] .shot-background-population input {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}
.environment-mode {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #8e98aa;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.environment-mode select,
.mini-actions select {
  border: 1px solid #343d52;
  background: #0b0f16;
  color: #dce2ee;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
  outline: 0;
}
.environment-mode select:focus,
.mini-actions select:focus {
  border-color: #8b5cf6;
}
.environment-mode-note {
  min-height: 18px;
  margin-top: 9px;
  color: #7e899d;
  font-size: 10px;
}
.environment-mode-note.warning {
  color: #fbbf24;
}
.environment-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: #67e8f9;
  font-size: 10px;
}
.environment-progress:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 9px #22d3ee;
}
.environment-view-count {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border: 1px solid #34d39944;
  border-radius: 99px;
  color: #6ee7b7;
  font-size: 9px;
  font-weight: 800;
}
.environment-visual.environment-five-grid {
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  background: #080b11;
}
.environment-view {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid #30394c;
  border-radius: 8px;
  background: #111722;
}
.environment-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.environment-view span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 3px 6px;
  border: 1px solid #ffffff1f;
  border-radius: 5px;
  background: #07090ddd;
  color: #dce6f4;
  font-size: 8px;
  font-weight: 800;
  pointer-events: none;
}
.environment-view-regenerate {
  position: absolute;
  z-index: 2;
  right: 6px;
  top: 6px;
  padding: 5px 8px;
  border: 1px solid #a78bfa88;
  border-radius: 7px;
  background: #171124e8;
  color: #ddd6fe;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 14px #0008;
}
.environment-view-regenerate:hover {
  border-color: #c4b5fd;
  background: #312e81;
  color: #fff;
}
.environment-view-regenerate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.theme-toggle {
  font-size: 19px;
  line-height: 1;
}
.theme-toggle span {
  display: block;
  transform: translateY(-1px);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #fff;
  --panel2: #f6f8fb;
  --line: #d7dee9;
  --text: #172033;
  --text-secondary: #44516a;
  --muted: #65728a;
  --muted-soft: #7b879b;
  --shadow: 0 22px 65px #4755691f;
  --surface: #f7f9fc;
  --surface-raised: #fff;
  --glass: #fffffff0;
  --accent: #6d4aff;
  --accent2: #0891b2;
}
html[data-theme="light"] body {
  background:
    radial-gradient(80% 60% at 72% -10%, #bfdbfe80, transparent 62%),
    radial-gradient(50% 40% at 0 18%, #ddd6fe80, transparent 70%), #eef2f7;
  color: var(--text);
}
html[data-theme="light"] body:before {
  opacity: 0.018;
}
html[data-theme="light"] .topbar {
  background: #ffffffdc;
  border-bottom-color: #cbd5e1;
  box-shadow: 0 8px 28px #64748b18;
}
html[data-theme="light"] .project-title {
  color: #172033;
  border-left-color: #cbd5e1;
}
html[data-theme="light"] .project-title:focus {
  background: #eef2ff;
}
html[data-theme="light"] .save-state {
  color: #64748b;
}
html[data-theme="light"] .provider-pill {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px #fff;
}
html[data-theme="light"] .btn {
  background: linear-gradient(180deg, #fff, #f1f5f9);
  color: #273449;
  border-color: #cbd5e1;
  box-shadow:
    0 5px 14px #64748b18,
    inset 0 1px #fff;
}
html[data-theme="light"] .btn:hover {
  background: linear-gradient(180deg, #fff, #e9eef6);
  border-color: #94a3b8;
  box-shadow: 0 8px 18px #64748b24;
}
html[data-theme="light"] .btn.primary,
html[data-theme="light"] .btn.green {
  color: #fff;
}
html[data-theme="light"] .btn.danger {
  color: #be123c;
}
html[data-theme="light"]
  :is(
    .card,
    .character,
    .environment,
    .scene-group,
    .shot-card,
    .audio-panel,
    .concept-settings,
    .output,
    .empty,
    .side-note,
    .queue-job,
    .snapshot-item,
    .project-item,
    .command-item,
    .library-card,
    .preflight-panel,
    .audio-timeline
  ) {
  background: #fff;
  border-color: #d7dee9;
  color: #263349;
  box-shadow: 0 14px 36px #64748b12;
}
html[data-theme="light"] .card:before {
  opacity: 0.7;
}
html[data-theme="light"] :is(.card-head, .scene-group-head, .drawer-head) {
  background: linear-gradient(90deg, #f8fafc, #fff);
  border-color: #dbe2ec;
}
html[data-theme="light"] .scene-group-head input {
  color: #1e293b;
}
html[data-theme="light"] .audio-timeline-head strong,
html[data-theme="light"] .audio-timeline-readout b {
  color: #334155;
}
html[data-theme="light"] .audio-timeline .timeline-axis-label {
  fill: #64748b;
}
html[data-theme="light"] .audio-timeline .timeline-playhead {
  stroke: #0f172a;
}
html[data-theme="light"]
  :is(
    .field input,
    .field textarea,
    .field select,
    .character-role,
    .scene-meta input,
    .scene-meta select,
    .shot-fields input,
    .scene-content textarea,
    .shot-part-type,
    .shot-environment select,
    .shot-timecode input,
    .library-toolbar input,
    .library-toolbar select,
    .snapshot-create input,
    .new-mv-form input,
    .environment-mode select,
    .mini-actions select
  ) {
  background: #fff;
  color: #273449;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px 3px #64748b12;
}
html[data-theme="light"]
  :is(.field input, .field textarea, .field select):focus {
  background: #fff;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px #7c5cff1f;
}
html[data-theme="light"]
  :is(.scene-meta, .shot-list, .card-head, .drawer-head) {
  border-color: #dbe2ec;
}
html[data-theme="light"]
  :is(.shot-environment, .shot-timecode, .recommendation) {
  background: #f5f7ff;
  border-color: #c7d2fe;
}
html[data-theme="light"] .video-prompt {
  background: #f0f9ff !important;
  color: #164e63 !important;
  border-color: #67e8f9 !important;
}
html[data-theme="light"] .edit-guidance {
  background: #fffbeb !important;
  color: #78350f !important;
  border-color: #fbbf24 !important;
}
html[data-theme="light"]
  :is(.character-visual, .environment-visual, .scene-image) {
  background: linear-gradient(135deg, #e9eef6, #f8fafc);
  color: #64748b;
}
html[data-theme="light"] .step-link {
  color: #64748b;
}
html[data-theme="light"] .step-link:hover {
  background: #e8edf5;
  color: #263449;
}
html[data-theme="light"] .step-link.active {
  background: linear-gradient(145deg, #ede9fe, #e0f2fe);
  border-color: #a78bfa;
  color: #5b21b6;
}
html[data-theme="light"] .view-toggle {
  background: #e9eef6;
  border-color: #cbd5e1;
}
html[data-theme="light"] .view-toggle button.active {
  background: #fff;
  color: #273449;
  box-shadow: 0 2px 8px #64748b20;
}
html[data-theme="light"] .drawer {
  background: #fffffff2;
  border-color: #cbd5e1;
  box-shadow: 0 28px 80px #4755692e;
}
html[data-theme="light"] .bottom-dock {
  background: #fffffff0;
  border-color: #cbd5e1;
  box-shadow: 0 18px 50px #4755692e;
}
html[data-theme="light"] .modal-backdrop {
  background: #33415580;
}
html[data-theme="light"] .modal {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 28px 90px #1e293b40;
}
html[data-theme="light"] .modal-head,
html[data-theme="light"] .modal-foot {
  border-color: #dbe2ec;
}
html[data-theme="light"] .sidebar {
  background: transparent;
}
html[data-theme="light"] .text-window-action {
  background: #fff;
  color: #475569;
  border-color: #cbd5e1;
  box-shadow: 0 5px 14px #64748b20;
}
html[data-theme="light"] .environment-visual.environment-five-grid {
  background: #e8edf5;
}
html[data-theme="light"] .environment-view {
  background: #f8fafc;
  border-color: #cbd5e1;
}
html[data-theme="light"] .btn.primary {
  background: linear-gradient(115deg, #7c3aed, #5b5bd6);
  border-color: #6d4aff;
  color: #fff;
  box-shadow:
    0 8px 20px #6d28d933,
    inset 0 1px #ffffff55;
}
html[data-theme="light"] .btn.primary:hover {
  background: linear-gradient(115deg, #6d28d9, #4f46c8);
  border-color: #5b21b6;
  color: #fff;
  box-shadow: 0 11px 26px #6d28d944;
}
html[data-theme="light"] .btn.green {
  background: linear-gradient(110deg, #047857, #0f766e);
  border-color: #047857;
  color: #fff;
  box-shadow:
    0 8px 20px #0478572e,
    inset 0 1px #ffffff40;
}
html[data-theme="light"] .btn.green:hover {
  background: linear-gradient(110deg, #065f46, #115e59);
  color: #fff;
}
html[data-theme="light"] .btn.ghost {
  background: transparent;
  color: #334155;
  border-color: transparent;
  box-shadow: none;
}
html[data-theme="light"] .btn.danger {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
html[data-theme="light"] .btn.danger:hover {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}
html[data-theme="light"] .icon-btn {
  color: #475569;
}
html[data-theme="light"] .icon-btn:hover {
  color: #111827;
}
html[data-theme="light"] .theme-toggle {
  background: #eef2ff;
  color: #5b21b6;
  border-color: #c4b5fd;
}
html[data-theme="light"] .theme-toggle:hover {
  background: #e0e7ff;
  color: #4c1d95;
  border-color: #a78bfa;
}
html[data-theme="light"]
  :is(
    .card-title,
    .modal-head h2,
    .character input,
    .environment input,
    .snapshot-item strong,
    .project-item strong,
    .empty strong,
    .concept-settings-title strong,
    .audio-copy strong
  ) {
  color: #1e293b;
}
html[data-theme="light"]
  :is(
    .card-sub,
    .panel-description,
    .field .hint,
    .view-toolbar .view-label,
    .library-count,
    .save-state,
    .lyrics-tools,
    .environment-mode,
    .environment-mode-note,
    .side-note,
    .command-item small,
    .concept-settings-title small,
    .audio-copy > span
  ) {
  color: #64748b;
}
html[data-theme="light"] .audio-file {
  color: #6d28d9 !important;
}
html[data-theme="light"] :is(.field label, .scene-content label, .meta-check) {
  color: #475569;
}
html[data-theme="light"]
  :is(
    .field input,
    .field textarea,
    .field select,
    .character input,
    .character textarea,
    .environment input,
    .environment textarea,
    .scene-content textarea
  )::placeholder {
  color: #94a3b8;
  opacity: 1;
}
html[data-theme="light"] .badge {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}
html[data-theme="light"] .shot-badge {
  color: #0369a1;
}
html[data-theme="light"] .step-num {
  background: #eef2ff;
  color: #5b21b6;
  border-color: #c7d2fe;
}
html[data-theme="light"] .shot-environment label {
  color: #4338ca !important;
}
html[data-theme="light"] .shot-duration {
  color: #0e7490;
}
html[data-theme="light"] .video-prompt-note {
  color: #0369a1;
}
html[data-theme="light"] .edit-guidance-note {
  color: #a16207;
}
html[data-theme="light"] .notice {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}
html[data-theme="light"] .preflight-count.error {
  background: #ffe4e6;
  color: #be123c;
}
html[data-theme="light"] .preflight-count.warning {
  background: #fef3c7;
  color: #92400e;
}
html[data-theme="light"] .preflight-count.ok {
  background: #d1fae5;
  color: #047857;
}
html[data-theme="light"] .preflight-list {
  color: #475569;
}
html[data-theme="light"] .preflight-list li.error {
  color: #be123c;
}
html[data-theme="light"] .preflight-list li.warning {
  color: #92400e;
}
html[data-theme="light"] .queue-job-cancel {
  color: #be123c;
  background: transparent;
  border-radius: 6px;
  padding: 3px 6px;
}
html[data-theme="light"] .queue-job-cancel:hover {
  color: #881337;
  background: #ffe4e6;
  box-shadow: inset 0 0 0 1px #fda4af;
}
html[data-theme="light"] .queue-job-cancel:focus-visible {
  color: #881337;
  background: #fff1f2;
  outline-color: #e11d48;
}
html[data-theme="light"] .queue-cancel-pending {
  color: #be123c !important;
  background: #fff1f2 !important;
  border-color: #fda4af !important;
}
html[data-theme="light"] .queue-cancel-pending:hover {
  color: #881337 !important;
  background: #ffe4e6 !important;
  border-color: #e11d48 !important;
}
html[data-theme="light"] .text-window-action:hover {
  background: #ede9fe;
  color: #4c1d95;
  border-color: #a78bfa;
}
html[data-theme="light"] .text-window-action.danger:hover {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fb7185;
}
html[data-theme="light"] .queue-job-head span {
  background: #e2e8f0;
  color: #475569;
}
html[data-theme="light"] ::selection {
  background: #7c3aed35;
  color: #1e293b;
}
@media (max-width: 760px) {
  html[data-theme="light"] .sidebar {
    background: #f8fafce8;
  }
}
@media (max-width: 620px) {
  .provider-pill {
    display: inline-flex;
    padding: 8px 10px;
    font-size: 10px;
  }
  .top-actions {
    gap: 5px;
  }
}
.toast-region {
  position: fixed;
  z-index: 260;
  left: 50%;
  bottom: 24px;
  width: min(560px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #475569;
  border-radius: 13px;
  background: #111827;
  color: #f8fafc;
  box-shadow:
    0 18px 55px #000a,
    inset 0 1px #ffffff18;
  pointer-events: auto;
  animation: toast-in 0.22s ease-out;
}
.toast-item.success {
  background: #102b25;
  border-color: #34d39980;
  color: #ecfdf5;
}
.toast-item.info {
  background: #10243a;
  border-color: #38bdf880;
  color: #eff6ff;
}
.toast-item.warning {
  background: #382711;
  border-color: #fbbf2488;
  color: #fffbeb;
}
.toast-item.error {
  background: #38151d;
  border-color: #fb718599;
  color: #fff1f2;
}
.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff14;
  font-size: 12px;
  font-weight: 900;
}
.toast-message {
  min-width: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.toast-close {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover {
  opacity: 1;
}
.toast-item.leaving {
  animation: toast-out 0.18s ease-in forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
@media (max-width: 620px) {
  .toast-region {
    bottom: 16px;
    width: calc(100vw - 24px);
  }
}
