:root {
  --bg: #0a0908;
  --bg-elevated: #14110e;
  --bg-panel: #1c1612;
  --border: #2a211c;
  --text: #f5f0e8;
  --text-muted: #a39a90;
  --accent: #c45c26;
  --accent-hot: #b33a2b;
  --accent-amber: #d4a017;
  --sysbar-h: 0px;
  --topbar-h: 48px;
  --donor-h: 0px;
  --director-collapsed-h: 80px;
  --director-h: 80px;
  --director-pad: 0px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
  /* Default workspace sizes */
  --layout-col-left: 28%;
  --layout-ayar-w: 22%;
  --layout-gap: 10px;
  --layout-font-scale: 1;
  --layout-prompt-h: 64px;
  --layout-scene-h: auto;
  --layout-batch-h: 100px;
  --layout-batch-list-h: 120px;
  --layout-queue-h: 120px;
  --layout-player-h: 280px;
}

* { box-sizing: border-box; }
* {
  scrollbar-width: thin;
  scrollbar-color: #6b5749 #1c1612;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: #1c1612; border-radius: 999px; }
*::-webkit-scrollbar-thumb {
  background: #6b5749;
  border: 2px solid #1c1612;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: #a87850; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: #1c1612; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
body {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(196, 92, 38, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(179, 58, 43, 0.1), transparent 45%),
    var(--bg);
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 9, 8, 0.92);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand span { color: var(--accent-amber); font-style: italic; }

.donor-ticker {
  height: var(--donor-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 10, 8, 0.94);
  overflow: hidden;
  flex-shrink: 0;
}
.donor-ticker.hidden {
  display: none;
}
body.has-donors {
  --donor-h: 26px;
}
.donor-ticker-label,
.donor-ticker-join {
  flex-shrink: 0;
  border: 0;
  background: none;
  color: var(--accent-amber);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.donor-ticker-join {
  color: var(--text-muted);
}
.donor-ticker-label:hover,
.donor-ticker-join:hover {
  color: var(--text);
}
.donor-ticker-mask {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.donor-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 1.75rem;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.82rem;
  animation: donor-marquee 42s linear infinite;
}
.donor-ticker-track span {
  opacity: 0.92;
}
@keyframes donor-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .donor-ticker-track { animation: none; }
}

.support-sponsor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.support-donors h3 {
  margin: 14px 0 6px;
  font-size: 1rem;
}
.support-donors-list {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}
.workspace-switch {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.workspace-switch .chip {
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.workspace-switch .chip.on {
  background: var(--accent-amber);
  color: #1a1208;
}
.workspace-switch .chip-director.on {
  background: var(--accent-hot);
  color: #fff;
}
.panel-workspace-director {
  padding: 4px 0 8px;
}
.panel-workspace-director h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.15rem;
}
.director-landing-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
}
.director-landing-steps {
  margin: 12px 0 16px;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}
body.ws-director .zone-prompt .gen-actions,
body.ws-director .zone-prompt #gen-hint {
  opacity: 0.45;
  pointer-events: none;
}
.menu { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.lang-switch {
  display: flex;
  gap: 0;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.lang-switch .chip {
  border: 0;
  border-radius: 0;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
}
.lang-switch .chip.on {
  background: var(--accent-amber);
  color: #1a1208;
}
.menu-btn, .btn-secondary, .btn-ghost, .chip, .cta {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.85rem;
}
.menu-btn:hover, .btn-secondary:hover { border-color: var(--accent); }
.menu-btn.link { text-decoration: none; display: inline-flex; align-items: center; }
.comfy-pill {
  display: none;
}
.comfy-pill.on { border-color: var(--accent-amber); color: var(--text); }
.comfy-pill.off { border-color: var(--accent-hot); }

/* Named zones (user colors):
   scene (sol üst) | player yeşil (sağ üst, 2 kolon)
   prompt pembe    | ayar mavi     | prod mor
*/
.workspace {
  flex: 1 1 0;
  display: grid;
  grid-template-columns:
    minmax(200px, var(--layout-col-left))
    minmax(160px, var(--layout-ayar-w))
    minmax(0, 1fr);
  grid-template-rows: minmax(220px, 1.1fr) minmax(0, 1fr);
  grid-template-areas:
    "scene  player player"
    "prompt ayar   prod";
  align-content: stretch;
  align-items: stretch;
  gap: var(--layout-gap, 10px);
  padding: 10px 12px 8px;
  font-size: calc(1rem * var(--layout-font-scale, 1));
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}
.zone {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  position: relative;
  z-index: 0;
  overflow: hidden;
}
.zone-scene {
  grid-area: scene;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
body.director-modal-open .zone-scene {
  position: relative;
  z-index: 101;
}
.zone-player {
  grid-area: player;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  z-index: 1;
  min-height: 0;
}
.zone-prompt {
  grid-area: prompt;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Stay above overlapping chrome when scrolling workspace */
  z-index: 2;
}
.zone-ayar {
  grid-area: ayar;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.zone-prod {
  grid-area: prod;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.director {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(28, 22, 18, 0.98);
  overflow: hidden;
  box-sizing: border-box;
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(1200px, 96vw);
  height: 100dvh;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(102%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 280ms;
}
.director.modal-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
  border-radius: 16px 0 0 16px;
  border: 1px solid var(--border);
  border-right: 0;
  background: rgba(28, 22, 18, 0.98);
  color: var(--text);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.55);
}
.director.modal-open .director-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.director.modal-open .director-chat {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 80px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: none;
}
.director-actions:not(:has(button:not(.hidden))) {
  display: none !important;
}
.director-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.director-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(28, 22, 18, 0.98);
  z-index: 2;
}
.director-config {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.director-config-item {
  display: flex;
  flex: 1 0 92px;
  flex-direction: column;
  gap: 4px;
  min-width: 76px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.1;
}
.director-config-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.director-config-provider { flex: 1.15 0 132px; }
.director-config-model { flex: 2 0 240px; min-width: 180px; }
.director-config-purpose { flex-basis: 104px; }
.director-config-style { flex-basis: 100px; }
.director-config-clip { flex-basis: 100px; }
.director-config-post { flex-basis: 92px; }
.director-config-chain { flex-basis: 124px; }
.director-config-mode { flex-basis: 92px; }
.director-config-item select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  height: 40px;
  padding: 6px 26px 6px 9px;
  background-position: right 8px center;
  background-size: 13px, auto;
  font-size: 0.78rem;
}
.director-music {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 4px 0 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.director-music .music-file.file-pick {
  margin: 0;
}
.director-music .file-pick-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
}
.director-music #music-meta {
  font-size: 0.75rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.director-music #music-concept,
.director-music #music-lyrics {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 280px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 0.78rem;
}
.director-music #music-concept { height: 28px; }
.director-music #music-lyrics {
  min-height: 48px;
  resize: vertical;
  line-height: 1.35;
}
.director-music #music-final-link {
  font-size: 0.78rem;
  text-decoration: underline;
}
.director-music.music-mode {
  border-color: rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.06);
}
.music-lyric-timeline {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 6px 0 3px;
  border-top: 1px dashed rgba(212, 160, 23, 0.25);
}
#cinema-music-slot { min-width: 0; }
#cinema-music-slot .director-music {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 12px;
}
.music-workflow-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}
.music-upload-row,
.music-workflow-actions,
.music-finish-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.music-upload-row #music-meta {
  flex: 1 1 120px;
  max-width: none;
}
.music-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.77rem;
  font-weight: 650;
}
#cinema-music-slot .director-music #music-concept,
#cinema-music-slot .director-music #music-lyrics {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  padding: 8px;
  color: var(--text);
  line-height: 1.4;
}
#cinema-music-slot .director-music #music-concept { min-height: 68px; }
#cinema-music-slot .music-lyrics-field {
  flex: 1 1 auto;
  min-height: 170px;
}
#cinema-music-slot .director-music #music-lyrics {
  flex: 1 1 auto;
  min-height: 170px;
  height: 100%;
}
#cinema-music-slot .music-workflow-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
#cinema-music-slot .music-workflow-actions .cta,
#cinema-music-slot .music-workflow-actions .btn-ghost {
  width: 100%;
  min-height: 36px;
}
#cinema-music-slot .music-lyric-timeline {
  padding-top: 10px;
}
.music-lyric-timeline-head {
  color: var(--muted);
  font-size: 0.75rem;
}
.music-lyric-row {
  display: grid;
  grid-template-columns: 58px 58px minmax(180px, 1fr);
  gap: 6px;
  align-items: center;
}
.music-lyric-row input,
.music-lyric-row textarea {
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font: inherit;
  font-size: 0.76rem;
}
.music-lyric-row textarea { min-height: 32px; resize: vertical; }
.director-project {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-amber, #d4a017);
}
.director-resize {
  display: none !important;
}
.director-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
  /* Dim only — do not steal clicks from Sahne / Proje (left column). */
  pointer-events: none;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  position: relative;
  z-index: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scene label, .drawer-body label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 8px 0 4px;
  max-width: 100%;
}
.zone-ayar .drawer-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.zone-ayar input[type="number"],
.zone-ayar select {
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
.zone-ayar > h2,
.zone-prod > h2 {
  margin: 0 0 8px;
  flex-shrink: 0;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.wrap { flex-wrap: wrap; }
.scene-project {
  margin-top: 10px;
  margin-bottom: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.scene-project .mode-hint { margin-top: 8px; margin-bottom: 0; }
.settings-panel input.key-saved {
  border-color: rgba(143, 186, 122, 0.45);
}
.settings-panel input.key-saved::placeholder {
  color: #8fba7a;
  opacity: 1;
}
.director-llm-tab {
  position: fixed;
  right: 0;
  top: calc(var(--topbar-h) + 22%);
  z-index: 34;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 16px 8px;
  border-radius: 8px 0 0 8px;
  border: 1px solid #8f3f24;
  border-right: 0;
  background: #b25330;
  color: #fff;
  touch-action: none;
  user-select: none;
}
body:has(.overlay:not(.hidden)) .director-llm-tab,
body.director-modal-open .director-llm-tab {
  visibility: hidden;
  pointer-events: none;
}
.lora-prod-pick {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.rewriter-toggle { margin-top: 12px; }
.lora-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}
.lora-url-row input[type="url"] {
  flex: 1 1 220px;
  min-width: 0;
}
.cinema-character-rebuild-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.85rem;
}
.cinema-character-rebuild-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.cinema-ios-track {
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  padding: 2px;
  border-radius: 999px;
  background: #4b4540;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: background 160ms ease;
}
.cinema-ios-track > span {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #f6f4ef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease;
}
.cinema-character-rebuild-toggle input:checked + .cinema-ios-track {
  background: var(--accent);
}
.cinema-character-rebuild-toggle input:checked + .cinema-ios-track > span {
  transform: translateX(17px);
}
.cinema-character-rebuild-toggle:focus-within {
  border-color: var(--accent);
}
.lora-prod-pick #btn-lora-apply {
  margin-top: 8px;
  width: 100%;
}
.lora-shop-title {
  margin: 0 0 6px;
}
.lora-shop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  max-height: 240px;
  overflow: auto;
}
.settings-panel .lora-shop {
  max-height: min(42vh, 380px);
  margin-top: 8px;
}
.lora-shop-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.lora-shop-item:hover {
  border-color: var(--accent);
}
.lora-shop-item.is-ready {
  border-color: #3d4a32;
}
.lora-shop-item.is-busy {
  opacity: 0.75;
  cursor: wait;
}
.lora-shop-name {
  font-weight: 600;
  font-size: 0.88rem;
}
.lora-shop-meta {
  grid-column: 1;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.lora-shop-status {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-amber);
  white-space: nowrap;
}
.lora-shop-item.is-ready .lora-shop-status {
  color: #9ccc65;
}
.llm-settings {
  max-width: 640px;
}
.llm-settings-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}
.h3-models-advanced {
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  padding-top: 0.75rem;
}
.h3-models-advanced > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  margin-bottom: 0.5rem;
}
.h3-models-advanced > summary::-webkit-details-marker {
  display: none;
}
.h3-models-advanced > summary::before {
  content: "▸ ";
  opacity: 0.7;
}
.h3-models-advanced[open] > summary::before {
  content: "▾ ";
}
.h3-models-advanced select {
  width: 100%;
  max-width: 100%;
}
.settings-panel label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.settings-panel input[type="password"],
.settings-panel input[type="text"],
.settings-panel input[type="url"],
.settings-panel select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}
/* Kill browser autofill white boxes on API keys / tokens */
.settings-panel input[type="password"]::-webkit-autofill,
.settings-panel input[type="password"]::-webkit-autofill:hover,
.settings-panel input[type="password"]::-webkit-autofill:focus,
.settings-panel input[type="text"]::-webkit-autofill,
.settings-panel input[type="text"]::-webkit-autofill:hover,
.settings-panel input[type="text"]::-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg) inset;
  transition: background-color 99999s ease-out;
}
.settings-panel .check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 8px 8px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text) !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.settings-panel .check:hover {
  border-color: var(--accent);
}
.settings-panel .check:has(input:checked) {
  border-color: var(--accent-amber);
  background: rgba(212, 160, 23, 0.18);
}
.settings-panel .check span {
  font-size: 0.82rem;
  color: var(--text);
}
.settings-panel .check input[type="checkbox"] {
  width: 14px;
  height: 14px;
}
.settings-panel .check input[type="checkbox"]:checked::after {
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
}
#btn-llm-save {
  margin-top: 10px;
  width: 100%;
}
.drawer-body small.muted,
.settings-panel small.muted {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
}
.chip.on,
.chip[aria-pressed="true"] {
  background: rgba(212, 160, 23, 0.18);
  border-color: var(--accent-amber);
}
#scene-purpose-chips .chip.on,
#scene-style-chips .chip.on,
#scene-purpose-chips .chip[aria-pressed="true"],
#scene-style-chips .chip[aria-pressed="true"] {
  background: rgba(212, 160, 23, 0.22);
  border-color: var(--accent-amber);
  color: var(--text);
}
.chip.warn.on {
  background: rgba(179, 58, 43, 0.2);
  border-color: var(--accent-hot);
}
select, input[type="number"], input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}
.prompt {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
.prompt-fields {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.prompt-field-label {
  display: block;
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.prompt-camera-block,
.prompt-preset-block {
  display: grid;
  gap: 6px;
}
.prompt-camera-select-wrap,
.prompt-preset-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.prompt-camera-select-wrap select,
.prompt-preset-select-wrap select,
#prompt-camera-select,
#prompt-location-select,
#prompt-lighting-select,
#prompt-voice-select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--text);
  background: #0a0908;
  border: 1px solid #3d322a;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  appearance: auto;
}
.prompt-camera-select-wrap select:hover,
.prompt-preset-select-wrap select:hover,
#prompt-camera-select:hover,
#prompt-location-select:hover,
#prompt-lighting-select:hover,
#prompt-voice-select:hover {
  border-color: #53463c;
}
.prompt-camera-select-wrap select:focus,
.prompt-preset-select-wrap select:focus,
#prompt-camera-select:focus,
#prompt-location-select:focus,
#prompt-lighting-select:focus,
#prompt-voice-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.22);
}
.prompt-camera-custom-wrap,
.prompt-preset-custom-wrap {
  margin: 0;
}
.prompt-lipsync-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.prompt-lipsync-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.prompt-lipsync-toggle input:checked + .cinema-ios-track {
  background: var(--accent);
}
.prompt-lipsync-toggle input:checked + .cinema-ios-track > span {
  transform: translateX(17px);
}
.prompt-lipsync-toggle:focus-within {
  border-color: var(--accent);
}
.prompt-fields-audio {
  display: grid;
  gap: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.prompt-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.prompt-fields input,
.prompt-fields textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--text);
  background: #0a0908;
  border: 1px solid #3d322a;
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.prompt-fields input:hover,
.prompt-fields textarea:hover {
  border-color: #53463c;
}
.prompt-fields input:focus,
.prompt-fields textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.22);
}
.prompt-compose-cache {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}
.prompt-compose-fold {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  flex-shrink: 0;
}
.prompt-compose-fold summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.prompt-compose-preview {
  margin: 8px 0 0;
  padding: 8px 10px;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-muted);
  border: 1px solid #3d322a;
  border-radius: 6px;
  background: #0a0908;
}
.prompt textarea {
  flex: 1 1 auto;
  resize: none;
  width: 100%;
  min-height: var(--layout-prompt-h);
  max-height: none;
  line-height: 1.35;
  overflow-y: auto;
}
.prompt .gen-actions,
.prompt .gen-hint {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.prompt .gen-actions {
  margin-top: 8px;
  background: var(--bg-panel);
  box-shadow: 0 -10px 14px var(--bg-panel);
  padding-bottom: 2px;
}
.prompt .cta {
  margin-top: 0;
}
.prompt .gen-hint {
  padding-bottom: 2px;
  background: var(--bg-panel);
}
.gen-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gen-actions .cta { margin-top: 0; }
.gen-hint { margin: 8px 0 0; font-size: 0.78rem; }
.mode-hint { margin: 6px 0 10px; font-size: 0.78rem; line-height: 1.35; }
.panel.scene label { display: block; margin-top: 10px; margin-bottom: 4px; font-size: 0.8rem; color: var(--text-muted); }
.panel.scene label:first-of-type { margin-top: 0; }
.continue-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.continue-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  background: #000;
  border-radius: 2px;
}
.ref-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.ref-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111;
}
.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.ref-thumb .ref-ord {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 0.65rem;
  background: rgba(0,0,0,0.7);
  padding: 1px 4px;
  border-radius: 3px;
}
.ref-thumb button {
  position: absolute;
  right: 2px;
  top: 2px;
  border: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
}
#ref-files, #face-files {
  width: 100%;
  font-size: 0.8rem;
  margin: 4px 0 2px;
}
.cta {
  margin-top: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 12px 16px;
  letter-spacing: 0.04em;
}
.cta:hover { filter: brightness(1.08); }
.cta.small { padding: 8px 12px; font-size: 0.85rem; }
.cta:disabled { opacity: 0.5; cursor: not-allowed; }
#btn-cinema-produce.is-ready {
  box-shadow: 0 0 0 2px var(--accent-hot, #e8a54b);
}

.player {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.player-stage {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 140px;
  max-height: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.player-stage:not(.has-video),
.player-stage.cleared {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.player-stage video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.player-stage.cleared video { display: none; }
.player-empty {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.player-stage.cleared .player-empty,
.player-stage:not(.has-video) .player-empty {
  display: flex;
}
.player-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(10, 9, 8, 0.85);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.player-close:hover {
  border-color: var(--accent-hot);
  color: #fff;
}
.player-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(18, 16, 14, 0.76);
  color: #fff;
  font-size: 2rem;
  font-weight: 300;
  line-height: 30px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}
.player-nav-next { left: 12px; }
.player-nav-prev { right: 12px; }
.player-nav:hover:not(:disabled) {
  background: rgba(232, 165, 75, 0.92);
  border-color: rgba(255, 255, 255, 0.62);
  transform: translateY(-50%) scale(1.06);
}
.player-nav:disabled { opacity: 0.3; cursor: default; }
.player-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.clip-prompt-panel {
  max-width: 860px;
}
.clip-prompt-full {
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
  max-height: calc(80vh - 80px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.prod-info {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 10px 12px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.prod-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prod-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.prod-top #prod-text {
  flex: 1;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.progress-box.hidden { display: none; }
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.progress-track {
  flex: 1;
  min-width: 0;
  height: 10px;
  border-radius: 999px;
  background: #0a0908;
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-amber));
  transition: width 0.35s ease;
}
#progress-pct {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 700;
  min-width: 3.2em;
  text-align: right;
  font-size: 0.8rem;
}
#progress-label {
  font-size: 0.75rem;
  line-height: 1.3;
  min-height: 1em;
}
.job-list .job-prog {
  display: inline-block;
  min-width: 2.5em;
  color: var(--accent-amber);
  font-variant-numeric: tabular-nums;
}
.btn-ghost { background: transparent; }

.drawer-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 4px;
}
.zone-ayar,
.zone-prod {
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
.drawer-body-production {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 8px;
}
.drawer-body-production .batch-row {
  display: none;
}
.queue-toolbar {
  flex-shrink: 0;
}
.clip-prompt-seed {
  margin: 8px 16px 16px;
  font-variant-numeric: tabular-nums;
}
.prod-lane-tabs {
  margin-bottom: 8px;
}
.prod-lane-tabs .chip.on {
  font-weight: 600;
}
.job-queue {
  margin-top: 0;
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  overflow: hidden;
}
.batch-row { display: flex; flex-direction: column; gap: 8px; }
.batch-row > .cta.small {
  width: 100%;
  flex-shrink: 0;
}
.batch-add-label {
  margin: 0 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
}
.batch-list-wrap {
  position: relative;
  height: var(--layout-batch-list-h);
  max-height: var(--layout-batch-list-h);
  min-height: 40px;
  overflow: hidden;
}
.batch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Sahne / Proje: içerik kadar, kesilmesin */
.panel.scene {
  height: auto;
  max-height: none;
  min-width: 0;
}
.batch-list:empty { display: none; }
.batch-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  min-width: 0;
}
.batch-num {
  font-weight: 700;
  color: var(--accent-amber);
  font-size: 0.85rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  width: 28px;
  text-align: right;
  padding-right: 2px;
}
.batch-item textarea {
  min-height: 52px;
  resize: vertical;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.batch-item .btn-ghost { padding: 2px 8px; font-size: 0.75rem; }
.batch-add-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.batch-add-row .batch-add-label { flex: 1 1 auto; }
.batch-empty { margin: 0; }
/* Custom file picker — hides native OS chrome */
.file-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}
.file-pick-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}
.file-pick-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text);
  pointer-events: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.file-pick:hover .file-pick-btn,
.file-pick:focus-within .file-pick-btn {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.file-pick-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.file-pick-name.has-file {
  color: var(--text);
}
.file-pick-inline {
  margin: 0;
  gap: 6px;
}

/* Custom checkboxes (settings + mode options) */
.check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  cursor: pointer;
  user-select: none;
  margin: 6px 0;
  width: fit-content;
  max-width: 100%;
}
.check span {
  font-size: 0.88rem;
  line-height: 1.35;
}
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.check input[type="checkbox"]:hover {
  border-color: var(--accent);
}
.check input[type="checkbox"]:focus-visible {
  outline: 1px solid var(--accent-amber);
  outline-offset: 2px;
}
.check input[type="checkbox"]:checked {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
}
.check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.job-queue-head {
  flex-shrink: 0;
  padding: 6px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.job-list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.job-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}
.job-list li:first-child { border-top: none; }
.job-list li.job-running {
  background: rgba(196, 92, 38, 0.12);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}
.job-list li button { font-size: 0.75rem; padding: 2px 8px; }
.job-list .btn-job-stop { color: var(--accent-hot); border-color: color-mix(in srgb, var(--accent-hot) 48%, var(--border)); }
.job-list .job-order { white-space: nowrap; color: var(--text-muted); }
.job-list .st-done { color: var(--accent-amber); }
.job-list .st-run { color: var(--accent); }
.job-list .st-err { color: var(--accent-hot); }
.job-list .job-sira {
  display: inline-block;
  min-width: 1.6em;
  color: var(--muted, #9a8b7a);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.director-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.director-head h2 { margin: 0; flex-shrink: 0; }
.director-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dir-tool {
  font-family: inherit;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.dir-tool:hover { border-color: var(--accent); }
.dir-tool.on {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.director-head #director-status.on { color: var(--accent-amber); }
.director-head #director-status.off { color: var(--accent-hot); }
.director-bible {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 12px;
  max-height: 55vh;
  overflow: auto;
}
.director-bible label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.director-bible textarea,
.director-bible input,
.director-bible select {
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
}
.director-bible.hidden { display: none !important; }
.director-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 10px;
  min-height: 0;
  flex: 1 1 auto;
}
.director-plan.hidden { display: none !important; }
.dir-plan-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.dir-plan-shots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  max-height: 42vh;
  padding-right: 4px;
}
.director.modal-open .dir-plan-shots { max-height: min(52vh, 560px); }
.dir-plan-shot {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-elevated, rgba(255,255,255,0.03));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dir-plan-shot-head {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dir-plan-shot-del {
  font-size: 0.72rem;
  padding: 2px 8px;
}
.dir-plan-shot label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dir-plan-shot input,
.dir-plan-shot select,
.dir-plan-shot textarea {
  font-family: inherit;
  font-size: 0.82rem;
  background: var(--bg, #12110f);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
}
.dir-plan-shot textarea[data-field="h3Prompt"] {
  min-height: 140px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.dir-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ref-thumb video {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}
.director-chat {
  flex: 1 1 auto;
  min-height: 80px;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 0.9rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dir-msg {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  line-height: 1.4;
  white-space: pre-wrap;
}
.dir-msg.user { border-color: rgba(212, 160, 23, 0.35); }
.dir-msg.assistant { background: rgba(255,255,255,0.02); }

.dir-ask {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(212, 160, 23, 0.35);
  border-radius: 8px;
  background: rgba(212, 160, 23, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dir-ask.is-done {
  opacity: 0.72;
  pointer-events: none;
}
.dir-ask-head {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-amber, #d4a017);
}
.dir-ask-q {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dir-ask-prompt {
  font-size: 0.92rem;
  color: var(--text, #e8e4dc);
}
.dir-ask-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dir-ask-opt.on {
  border-color: var(--accent-amber, #d4a017);
  background: rgba(212, 160, 23, 0.18);
}
.dir-ask-opt.is-recommended {
  border-color: rgba(212, 160, 23, 0.55);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.2);
}
.dir-ask-custom {
  margin-top: 2px;
}
.dir-ask-custom-input {
  width: 100%;
  max-width: 420px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text, #e8e4dc);
}
.dir-ask-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.dir-ask-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dir-ask-outline .dir-outline-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.dir-outline-revise {
  order: 0;
}
.dir-ask-outline .dir-ask-submit {
  order: 1;
}
.dir-msg .dir-markdown {
  white-space: normal;
  overflow-wrap: anywhere;
}
.dir-markdown > :first-child { margin-top: 0; }
.dir-markdown > :last-child { margin-bottom: 0; }
.dir-markdown p { margin: 0.45em 0; }
.dir-markdown h1,
.dir-markdown h2,
.dir-markdown h3,
.dir-markdown h4 {
  margin: 0.8em 0 0.35em;
  line-height: 1.3;
  color: var(--text, #e8e4dc);
}
.dir-markdown h1 { font-size: 1.2em; }
.dir-markdown h2 { font-size: 1.1em; }
.dir-markdown h3,
.dir-markdown h4 { font-size: 1em; }
.dir-markdown ul,
.dir-markdown ol { margin: 0.4em 0; padding-left: 1.45em; }
.dir-markdown li + li { margin-top: 0.2em; }
.dir-markdown blockquote {
  margin: 0.55em 0;
  padding: 0.1em 0 0.1em 0.75em;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}
.dir-markdown code {
  padding: 0.08em 0.3em;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}
.dir-markdown pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0.55em 0;
  padding: 0.65em 0.75em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0,0,0,0.22);
  white-space: pre;
}
.dir-markdown pre code { padding: 0; background: none; }
.dir-markdown table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0.55em 0;
}
.dir-markdown th,
.dir-markdown td {
  padding: 0.3em 0.55em;
  border: 1px solid var(--border);
  text-align: left;
}
.dir-markdown a { color: var(--accent-amber, #d4a017); }
.dir-markdown hr { border: 0; border-top: 1px solid var(--border); }
.dir-msg.thinking {
  border-color: rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.06);
}
.dir-msg.thinking .who {
  color: var(--accent-amber, #d4a017);
}
.dir-msg .think-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dir-msg .think-dots {
  animation: dir-pulse 1.1s ease-in-out infinite;
}
@keyframes dir-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.dir-msg .think-body {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.dir-msg.thinking.answering .think-body {
  color: var(--text, #e8e4dc);
}
.dir-msg .who {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.director-shot-slot:empty {
  display: none;
}
.director-shot-slot {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(38vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 4px;
}
.director-shot-slot:has(.dir-shot-panel.is-collapsed) {
  max-height: none;
  overflow: visible;
}
.director-shot-slot .dir-shot-panel {
  margin-top: 0;
}
.director-shot-slot .dir-shot-list {
  max-height: none;
  overflow: visible;
}
.dir-shot-panel {
  margin-top: 8px;
  border: 1px solid rgba(212, 160, 23, 0.4);
  border-radius: 8px;
  background: rgba(212, 160, 23, 0.06);
  overflow: visible;
}
.dir-shot-panel.is-collapsed {
  background: rgba(212, 160, 23, 0.04);
}
.dir-shot-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 10px;
}
.dir-shot-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.dir-shot-toggle:hover .dir-shot-sum-main {
  color: #f0c94d;
}
.dir-shot-chevron {
  flex: 0 0 auto;
  width: 1em;
  margin-top: 2px;
  color: var(--accent-amber, #e0b84a);
  font-size: 0.85rem;
  line-height: 1.2;
}
.dir-shot-header-text {
  min-width: 0;
  flex: 1 1 auto;
}
.dir-shot-accept-all {
  flex: 0 0 auto;
  align-self: center;
}
.dir-shot-sum-main {
  font-weight: 600;
  color: var(--accent-amber, #e0b84a);
  font-size: 0.92rem;
}
.dir-shot-sum-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.dir-shot-body {
  padding: 0 10px 10px;
  border-top: 1px solid rgba(212, 160, 23, 0.25);
}
.dir-shot-body[hidden] {
  display: none !important;
}
.dir-shot-title {
  margin: 8px 0 4px;
  font-size: 0.88rem;
  color: var(--text, #e8e4dc);
}
.dir-shot-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}
.dir-shot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  margin-top: 8px;
}
.dir-shot-item {
  border: 1px solid rgba(232, 228, 220, 0.18);
  border-radius: 8px;
  background: rgba(18, 16, 14, 0.72);
  padding: 10px 12px;
}
.dir-shot-item.is-accepted {
  border-color: rgba(120, 180, 140, 0.5);
  background: rgba(28, 40, 32, 0.85);
}
.dir-shot-item.is-empty {
  opacity: 0.72;
}
.dir-shot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.dir-shot-head {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--accent-amber, #e0b84a);
}
.dir-shot-badge {
  flex: 0 0 auto;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(212, 160, 23, 0.45);
  color: var(--accent-amber, #e0b84a);
  background: rgba(212, 160, 23, 0.12);
}
.dir-shot-badge.is-done {
  border-color: rgba(120, 180, 140, 0.55);
  color: #b6e0c4;
  background: rgba(90, 160, 110, 0.2);
}
.dir-shot-summary {
  font-size: 0.92rem;
  font-weight: 560;
  color: #f2efe8;
  margin: 0 0 6px;
  line-height: 1.4;
}
.dir-shot-cam {
  font-size: 0.78rem;
  color: #c8c2b6;
  margin-bottom: 6px;
  line-height: 1.35;
}
.dir-shot-prompt {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
  line-height: 1.45;
  max-height: none;
  overflow: visible;
  color: #ddd7cb;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.dir-shot-empty {
  margin: 0;
  font-size: 0.75rem;
}
.dir-shot-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.dir-shot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.dir-shot-actions .cta,
.dir-shot-actions .btn-ghost {
  font-size: 0.8rem;
  padding: 6px 10px;
}
.director-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.director-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.dir-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
}
.dir-tab.on {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 140, 60, 0.12);
}
.dir-tab-close {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
}
.dir-tab-close:hover {
  opacity: 1;
}
.director-input {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  align-items: flex-end;
  min-height: 40px;
}
.director-input input,
.director-input textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  max-height: 96px;
  resize: vertical;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.director-input #btn-director-send {
  flex-shrink: 0;
  min-height: 36px;
}
.director-input input:disabled,
.director-input input[readonly] {
  opacity: 1;
  color: var(--text);
  cursor: text;
}
.director-input input:not([readonly]) {
  cursor: text;
}
.muted { color: var(--text-muted); font-size: 0.85rem; }
.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  pointer-events: auto;
}
#view-clip-prompt,
#view-error-logs,
#view-gallery,
#view-settings,
#view-support,
#view-cinema {
  z-index: 92;
}
/* Prompt must sit above gallery when opened from a gallery card */
#view-clip-prompt {
  z-index: 96;
}
.gallery-panel {
  width: min(1280px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 80px);
}
.gallery-panel header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 0;
  background: var(--bg-elevated);
  box-shadow: 0 8px 14px -14px rgba(0, 0, 0, 0.9);
  flex-wrap: wrap;
}
.gallery-kind-switch { flex: 0 0 auto; }
.gallery-order-hint {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
}
.support-panel {
  width: min(820px, 100%);
}
.support-sponsor {
  margin: 4px 0 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.support-sponsor h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.support-sponsor .mode-hint {
  margin: 0 0 12px;
  line-height: 1.55;
}
.support-sponsor-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
@keyframes support-rainbow-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.support-rainbow-btn {
  background-image: linear-gradient(
    90deg,
    #ff4d6d,
    #ff9f1c,
    #ffd60a,
    #2ec4b6,
    #4cc9f0,
    #7b2cbf,
    #f72585,
    #ff4d6d
  );
  background-size: 200% 100%;
  animation: support-rainbow-shift 2.8s linear infinite;
  box-shadow: 0 8px 24px rgba(247, 37, 133, 0.28);
  border-color: transparent !important;
  color: #fff !important;
}
.support-rainbow-btn:hover {
  filter: brightness(1.06);
  border-color: transparent !important;
  color: #fff !important;
}
.menu.menu .support-rainbow-btn.menu-btn {
  font-weight: 700;
}
.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 16px;
}
.support-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg);
}
.support-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.support-card p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted, #9aa);
}
@media (max-width: 640px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.gallery-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  position: relative;
}
.gallery-card .gallery-ord {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--accent-amber);
}
.gallery-card .gallery-del {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #e8c4c0;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-card .gallery-del:hover {
  background: rgba(179, 58, 43, 0.9);
  color: #fff;
  border-color: transparent;
}
.gallery-card .gallery-thumb {
  position: relative;
}
.gallery-card .gallery-cont {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #f5f0e8;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.gallery-card .gallery-cont:hover {
  background: rgba(196, 92, 38, 0.92);
  border-color: transparent;
}
.gallery-card .gallery-prompt {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--accent-amber);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-card .gallery-prompt:hover {
  background: rgba(40, 40, 36, 0.95);
  color: #fff;
}
.gallery-card video, .gallery-card .ph {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
  display: block;
}
.gallery-card .gallery-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.gallery-photo-card { cursor: zoom-in; }
.gallery-card .meta { padding: 8px; font-size: 0.75rem; color: var(--text-muted); }
.gallery-card .gallery-thumb {
  position: relative;
}
.gallery-merge-mode .gallery-ord {
  display: none;
}
.gallery-merge-mode .gallery-card {
  cursor: pointer;
}
.gallery-merge-mode .gallery-card.is-merge-picked {
  outline: 2px solid var(--accent, #6ea8fe);
  outline-offset: 2px;
}
.gallery-merge-pick {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.gallery-merge-pick.hidden {
  display: none;
}
.gallery-merge-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}
.gallery-merge-ring.is-on {
  border-color: var(--accent, #6ea8fe);
  background: rgba(110, 168, 254, 0.35);
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.35);
}
.gallery-merge-ring.is-on::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.gallery-merge-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent, #6ea8fe);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.gallery-merge-badge:not(.is-on) {
  display: none;
}
.gallery-merge-hint,
.gallery-merge-count {
  font-size: 0.82rem;
}
.gallery-panel header .cta {
  font-weight: 600;
}
.gallery-merge-mode .gallery-cont,
.gallery-merge-mode .gallery-still,
.gallery-merge-mode .gallery-prompt,
.gallery-merge-mode .gallery-del {
  opacity: 0.35;
  pointer-events: none;
}

.sysbar {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  height: 30px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #080706;
  overflow: hidden;
}
.sys-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
}
.sys-item:last-child { border-right: none; }
.sys-item span {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.62rem;
  flex-shrink: 0;
}
.sys-item b {
  color: var(--text);
  font-weight: 600;
  font-size: 0.72rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sys-item.comfy-on b { color: #8fd18f; }
.sys-item.comfy-off b { color: var(--accent-hot); }
@media (max-width: 1280px) {
  .sys-item span { display: none; }
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "scene"
      "player"
      "prompt"
      "ayar"
      "prod";
  }
  :root { --director-h: var(--director-collapsed-h, 80px); }
  body.ws-director .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(160px, 42vh) minmax(0, 1fr);
    grid-template-areas:
      "player"
      "prod";
  }
  body.ws-director #view-cinema.cinema-dock:not(.hidden) {
    right: 0;
    bottom: 42vh;
  }
}

#view-cinema {
  align-items: flex-start;
}
#view-cinema .cinema-panel {
  width: min(1440px, 100%);
  display: flex;
  flex-direction: column;
  overflow: auto;
  max-height: calc(100vh - 80px);
}

/* Direktör = Sahne gibi gömülü: sol sinema, sağ player + prod */
body.ws-director {
  --director-rail: clamp(300px, 34vw, 460px);
}
body.ws-director #view-cinema.cinema-dock:not(.hidden) {
  position: fixed;
  top: calc(var(--topbar-h) + var(--donor-h));
  left: 0;
  right: var(--director-rail);
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 8px 8px 8px 10px;
  background: var(--bg);
  pointer-events: auto;
}
body.ws-director #view-cinema.cinema-dock:not(.hidden) .cinema-panel {
  width: 100%;
  max-width: none;
  max-height: none;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
}
body.ws-director .workspace {
  grid-template-columns: 1fr var(--director-rail);
  grid-template-rows: minmax(220px, 1fr) minmax(0, 1.05fr);
  grid-template-areas:
    ". player"
    ". prod";
  padding-right: 8px;
}
body.ws-director .zone-scene,
body.ws-director .zone-prompt,
body.ws-director .zone-ayar {
  display: none !important;
}
body.ws-director .zone-player {
  grid-area: player;
  min-width: 0;
  gap: 8px;
}
body.ws-director .zone-prod {
  grid-area: prod;
}
body.ws-director .zone-player .player-stage {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(42vh, 380px);
}
body.ws-director .zone-player .player-actions {
  flex-wrap: wrap;
  gap: 6px;
}
body.ws-director .zone-player .player-actions .btn-secondary,
body.ws-director .zone-player .player-actions .btn-ghost {
  font-size: 0.75rem;
  padding: 5px 9px;
}
.cinema-panel header #cinema-title {
  flex: 1;
  min-width: 120px;
  max-width: 280px;
}
.cinema-panel header #cinema-film-select {
  max-width: 180px;
  font-size: 0.82rem;
}
.cinema-setup-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
  overflow: visible;
}
#view-cinema .cinema-panel > header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
}
#view-cinema .cinema-panel > header h2 {
  margin: 0;
}
#view-cinema .cinema-wizard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
#view-cinema .cinema-wizard .chip {
  width: 100%;
  justify-content: center;
  text-align: center;
}
.cinema-wizard .chip.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cinema-wizard-foot {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cinema-timeline-dock {
  flex-shrink: 0;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.cinema-timeline-dock > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.cinema-timeline-dock > summary::-webkit-details-marker {
  display: none;
}
.cinema-timeline-dock > summary::before {
  content: "▸";
  color: var(--text-muted);
  font-size: 0.8rem;
}
.cinema-timeline-dock[open] > summary::before {
  content: "▾";
}
.cinema-timeline-dock #cinema-timeline-total {
  margin-left: auto;
}
.cinema-timeline-dock .cinema-timeline {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--border);
  max-height: min(240px, 32vh);
}
.cinema-wizard-move {
  display: flex;
  gap: 8px;
}
.cinema-step {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}
.cinema-panel[data-wizard-step="name"] .cinema-step[data-step="name"],
.cinema-panel[data-wizard-step="setup"] .cinema-step[data-step="setup"],
.cinema-panel[data-wizard-step="cast"] .cinema-step[data-step="cast"],
.cinema-panel[data-wizard-step="script"] .cinema-step[data-step="script"],
.cinema-panel[data-wizard-step="produce"] .cinema-step[data-step="produce"] {
  display: flex;
}
.cinema-panel[data-wizard-step="name"] .cinema-step,
.cinema-panel[data-wizard-step="setup"] .cinema-step,
.cinema-panel[data-wizard-step="produce"] .cinema-step {
  justify-content: safe center;
  align-items: center;
}
.wizard-board {
  display: grid;
  gap: 12px;
  flex: 0 0 auto;
  width: min(920px, 100%);
  align-items: start;
}
.wizard-board-name {
  width: min(760px, 100%);
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.8fr);
  align-items: stretch;
}
.wizard-board-setup {
  grid-template-columns: minmax(0, 1fr);
  width: min(560px, 100%);
}
.wizard-board-produce {
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
}
.wizard-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.wizard-card-title #cinema-title {
  width: 100%;
  max-width: none;
  font-size: 1.2rem;
  font-weight: 650;
  padding: 12px 14px;
}
.wizard-card-title #cinema-name-hint,
.wizard-card-go #cinema-produce-progress {
  margin: 0;
}
.wizard-card-films #cinema-film-select,
.wizard-card-look select,
.wizard-card-params select,
.wizard-card-params input[type="number"] {
  width: 100%;
  max-width: none;
}
.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wizard-card-title #cinema-logline {
  width: 100%;
  max-width: none;
  min-height: 96px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.5;
}
.wizard-duration {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wizard-duration select {
  flex: 1;
}
.wizard-card-look .film-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.wizard-card-look .film-pill {
  width: 100%;
  min-width: 0;
}
.wizard-card-look #cinema-setup-hint {
  margin: 0;
}
.cinema-panel[data-wizard-step="cast"] .cinema-grid {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  height: auto;
}
.cinema-panel[data-wizard-step="cast"] .cinema-col-stack {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  height: auto;
  overflow: visible;
  background: transparent;
  border: 0;
  padding: 0;
}
.cinema-panel[data-wizard-step="cast"] .cinema-stack {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.cinema-panel[data-wizard-step="script"] .cinema-script-col {
  flex: 0 0 auto;
  width: 100%;
  max-height: none;
  overflow: visible;
}
.cinema-panel[data-wizard-step="script"] #cinema-shot-draft {
  width: 100%;
  max-width: none;
  min-height: 96px;
}
.cinema-panel[data-wizard-step="script"] .cinema-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
  overflow: auto;
}
.wizard-card-picture .chips,
.wizard-card-params {
  align-items: stretch;
}
.wizard-card-params label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.wizard-card-params .cinema-seamless-label {
  flex-direction: row;
  align-items: center;
}
.wizard-card-go {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wizard-card-go #cinema-produce-progress {
  margin: 0;
}
.wizard-card-go #btn-cinema-produce {
  min-height: 40px;
  padding-inline: 18px;
}
.cinema-advanced {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.cinema-advanced > summary {
  cursor: pointer;
  margin-bottom: 10px;
}
@media (max-width: 1100px) {
  .wizard-board-name,
  .wizard-board-setup,
  .wizard-board-produce,
  .cinema-panel[data-wizard-step="cast"] .cinema-col-stack {
    grid-template-columns: 1fr;
  }
  .cinema-panel[data-wizard-step="cast"] .cinema-step,
  .cinema-panel[data-wizard-step="cast"] .cinema-col-stack {
    overflow: auto;
    height: auto;
  }
  .wizard-card-look .film-pills,
  .cinema-panel[data-wizard-step="script"] .cinema-shots {
    grid-template-columns: 1fr;
  }
}
.film-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.film-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.film-pill[data-setup="look"] {
  min-width: 168px;
  border-color: rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.08);
}
.film-pill:hover,
.film-pill.open {
  border-color: #4a3d34;
  background: rgba(255, 255, 255, 0.04);
}
.film-pill-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.film-pill-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.film-pill-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.film-pill-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.film-pill-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.film-pill-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: 280px;
  overflow: auto;
  z-index: 8;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #161210;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.film-pill.open .film-pill-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.film-pill-option {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
}
.film-pill-option:hover,
.film-pill-option.on {
  background: rgba(196, 92, 38, 0.22);
}
.cinema-knobs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cinema-knobs label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.cinema-knobs input[type="number"] {
  width: 64px;
}
.cinema-quality-chips button.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cinema-audio-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.cinema-audio-bar #cinema-score-name {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cinema-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(340px, 1.2fr);
  gap: 12px;
  min-height: 420px;
  flex: 1 0 auto;
  overflow: visible;
}
.cinema-panel.is-mode-seamless .cinema-grid {
  grid-template-columns: 1fr;
}
.cinema-panel.is-mode-seamless .cinema-col-stack {
  display: none;
}
.cinema-panel.is-mode-assets .cinema-col-stack {
  display: flex;
}
.cinema-panel.is-mode-assets.is-music-video .cinema-grid {
  grid-template-columns: minmax(250px, 0.86fr) minmax(340px, 1.2fr) minmax(270px, 0.9fr);
}
.cinema-panel.is-music-video .cinema-music-col {
  display: flex;
}
.cinema-studio-mode {
  flex: 1 1 220px;
}
.cinema-studio-mode .chip {
  font-weight: 600;
}
.cinema-script-col .cinema-col-head {
  gap: 10px;
}
.cinema-script-col .cinema-col-head .cta {
  flex-shrink: 0;
}
.cinema-col-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cinema-col-head-actions .btn-ghost {
  font-size: 0.8rem;
  padding: 6px 10px;
}
#cinema-mode-hint {
  flex: 1 1 100%;
  margin: 0;
}
.cinema-col {
  min-height: 0;
  overflow: auto;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-start;
}
.cinema-col-stack {
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
}
.cinema-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  position: relative;
}
.cinema-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
button.cinema-fold-toggle {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 10px;
}
button.cinema-fold-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
.cinema-fold-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cinema-fold-chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}
.cinema-stack.is-collapsed .cinema-fold-chevron {
  transform: rotate(-90deg);
}
.cinema-stack.is-collapsed .cinema-fold-body {
  display: none;
}
.cinema-stack:not(.is-collapsed) .cinema-fold-summary {
  display: none;
}
.cinema-fold-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}
.cinema-fold-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cinema-fold-chip {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cinema-col-head h3,
.cinema-fold-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.cinema-add-btn {
  width: 100%;
  flex-shrink: 0;
}
.cinema-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  overflow: visible;
}
.cinema-card {
  display: grid;
  grid-template-columns: minmax(176px, 240px) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 0;
}
.cinema-folder-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cinema-folder-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 6px 0;
}
.cinema-folder-tab b {
  color: var(--text);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cinema-folder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  min-height: 108px;
  padding: 6px;
  border-radius: 0 8px 8px 8px;
  background: #14110f;
  border: 1px dashed #5a4a3c;
}
.cinema-folder.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The Director handle stays visible without competing with the video preview. */
#btn-director-llm-tab {
  border-color: #9b512f;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #b25330, #8e3e25);
  color: #fff;
  animation: director-tab-heartbeat 9s ease-in-out infinite;
}
#btn-director-llm-tab:hover {
  background: linear-gradient(180deg, #c26238, #9b4729);
}
@keyframes director-tab-heartbeat {
  0%, 4%, 8%, 100% { box-shadow: 0 0 0 0 rgba(224, 111, 48, 0), 0 8px 20px rgba(0, 0, 0, 0.2); }
  2%, 6% { box-shadow: 0 0 0 5px rgba(224, 111, 48, 0.22), 0 0 18px rgba(224, 111, 48, 0.35); }
}
@media (max-width: 600px) {
  .director, .director.modal-open { width: 100vw; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #btn-director-llm-tab { animation: none; }
  .director, .director.modal-open { transition: none; }
}

/* iOS-inspired control system: keeps the warm cinema palette, softens the UI. */
:root {
  --control-surface: linear-gradient(180deg, rgba(42, 35, 30, 0.96), rgba(24, 20, 17, 0.98));
  --control-hover: linear-gradient(180deg, rgba(56, 46, 39, 0.98), rgba(31, 26, 22, 0.98));
  --control-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset, 0 7px 20px rgba(0, 0, 0, 0.16);
}

.menu-btn, .btn-secondary, .btn-ghost, .chip, .cta,
.film-pill, .film-pill-option, .cinema-fold-toggle {
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease, filter 150ms ease;
}

.menu-btn, .btn-secondary, .btn-ghost {
  min-height: 32px;
  border-radius: 10px;
  border-color: rgba(255, 232, 210, 0.11);
  background: var(--control-surface);
  box-shadow: var(--control-shadow);
}
.menu-btn:hover, .btn-secondary:hover, .btn-ghost:hover {
  border-color: rgba(222, 139, 82, 0.72);
  background: var(--control-hover);
  transform: translateY(-1px);
}
.menu-btn:active, .btn-secondary:active, .btn-ghost:active, .chip:active, .cta:active {
  transform: translateY(1px) scale(0.985);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.cta {
  min-height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #df7137, #b7422d);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 8px 20px rgba(155, 51, 25, 0.25);
}
.cta:hover {
  filter: brightness(1.09) saturate(1.05);
  transform: translateY(-1px);
}

.chip {
  min-height: 30px;
  border-radius: 999px;
  border-color: rgba(255, 232, 210, 0.1);
  background: rgba(255, 255, 255, 0.028);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
.chip:hover {
  border-color: rgba(212, 160, 23, 0.62);
  background: rgba(212, 160, 23, 0.09);
}
.chip.on, .chip[aria-pressed="true"] {
  color: #fff8ed;
  border-color: rgba(231, 164, 68, 0.78);
  background: linear-gradient(135deg, rgba(218, 142, 47, 0.34), rgba(184, 67, 39, 0.25));
  box-shadow: 0 0 0 1px rgba(255, 192, 104, 0.08) inset, 0 5px 14px rgba(0,0,0,0.16);
}
.workspace-switch, .lang-switch {
  border-radius: 12px;
  padding: 2px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
.workspace-switch .chip, .lang-switch .chip {
  min-height: 28px;
  border-radius: 9px;
}

select, input[type="number"], input[type="text"], input[type="password"], textarea,
.settings-panel input[type="url"] {
  border-radius: 10px;
  border-color: rgba(255, 232, 210, 0.12);
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.82), rgba(18, 14, 12, 0.98));
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.34), 0 1px 0 rgba(255,255,255,0.025);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
select:hover, input[type="number"]:hover, input[type="text"]:hover,
input[type="password"]:hover, textarea:hover {
  border-color: rgba(221, 141, 80, 0.38);
}
select:focus, input[type="number"]:focus, input[type="text"]:focus,
input[type="password"]:focus, textarea:focus {
  outline: none;
  border-color: rgba(226, 135, 69, 0.92);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.14), inset 0 1px 2px rgba(0,0,0,0.32);
}

.panel, .continue-preview, .cinema-folder {
  border-radius: 14px;
  border-color: rgba(255, 232, 210, 0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.025) inset, 0 10px 26px rgba(0,0,0,0.12);
}
.panel {
  background: linear-gradient(145deg, rgba(33, 26, 22, 0.98), rgba(22, 17, 14, 0.98));
}
.cinema-folder {
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(26, 20, 17, 0.96), rgba(16, 13, 11, 0.98));
}

button:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(244, 177, 84, 0.92);
  outline-offset: 2px;
}

.image-studio-bridge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 10px;
  padding: 7px 8px;
  border: 1px solid #4d3a2a;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(166, 90, 36, 0.12), rgba(20, 17, 15, 0.2));
}
.image-studio-bridge .muted {
  font-size: 0.72rem;
}

.frame-source-card {
  margin: 5px 0 7px;
  padding: 8px;
  border: 1px solid #4d3a2a;
  border-radius: 10px;
  background: #161210;
}
.ios-segment {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  margin-bottom: 8px;
  border: 1px solid #514238;
  border-radius: 999px;
  background: #0d0b0a;
}
.ios-segment button {
  border: 0;
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 0.73rem;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.ios-segment button.on {
  color: #fff4e9;
  background: linear-gradient(135deg, #d25d29, #a9441e);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
}
.frame-source-card .file-pick { margin: 0; }
.frame-prompt {
  display: block;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 52px;
  margin: 0 0 7px;
}
.frame-generate-btn { width: 100%; }
.image-studio-quality { margin: 0 0 7px; }
.frame-generate-status {
  display: block;
  min-height: 1.2em;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.cinema-asset {
  margin: 0;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}
.cinema-asset img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.cinema-img-zoom,
.cinema-img-dl {
  position: absolute;
  top: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
  line-height: 18px;
  font-size: 11px;
  text-align: center;
  text-decoration: none;
  padding: 0;
}
.cinema-img-zoom { right: 22px; }
.cinema-img-dl { right: 42px; }
.cinema-still-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 24px;
}
.cinema-still-modal.hidden { display: none; }
.cinema-still-dialog {
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cinema-still-dialog img {
  max-width: 96vw;
  max-height: 78vh;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
}
.cinema-asset figcaption {
  font-size: 0.68rem;
  text-align: center;
  padding: 3px 4px;
  color: #f3e6c8;
  background: rgba(0,0,0,0.78);
  cursor: pointer;
  user-select: all;
  font-family: ui-monospace, Consolas, monospace;
}
.cinema-img-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 12px;
}
.cinema-img-cap {
  font-size: 0.72rem;
}
.cinema-role-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
}
.cinema-role-block textarea {
  min-height: 120px;
  resize: vertical;
}
#btn-cinema-ingest,
#btn-cinema-director {
  width: 100%;
  margin-bottom: 8px;
}
#btn-cinema-generate-shots {
  width: 100%;
  margin-bottom: 8px;
}
.cinema-card .thumb {
  width: 88px;
  height: 88px;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  align-self: start;
  flex-shrink: 0;
}
.cinema-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cinema-card .thumb .empty {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}
.cinema-card .fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cinema-field-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.cinema-card input,
.cinema-card select,
.cinema-card textarea {
  width: 100%;
  font-size: 0.8rem;
}
.cinema-card textarea {
  min-height: 56px;
  resize: vertical;
}
.cinema-card .row-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  align-items: center;
}
.cinema-card .row-btns .file-pick {
  flex: 0 0 auto;
  overflow: hidden;
}
.cinema-card .cinema-del {
  position: relative;
  z-index: 3;
}
.cinema-character-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}
.cinema-character-modal.hidden {
  display: none;
}
.cinema-character-dialog {
  width: min(460px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.cinema-character-dialog header,
.cinema-character-dialog .row-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cinema-character-dialog h3 {
  margin: 0;
}
.cinema-character-dialog label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}
.cinema-character-dialog input,
.cinema-character-dialog select,
.cinema-character-dialog textarea {
  width: 100%;
  box-sizing: border-box;
}
.cinema-character-dialog .row-btns {
  justify-content: flex-end;
  margin-top: 16px;
}
.cinema-scene-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.66);
}
.cinema-scene-modal.hidden {
  display: none;
}
.cinema-scene-dialog {
  width: min(720px, 100%);
  max-height: min(900px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px 18px 14px;
  border: 1px solid #3a2f28;
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}
.cinema-scene-dialog header,
.cinema-scene-dialog .row-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cinema-scene-dialog h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
}
.cinema-scene-dialog .row-btns {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding-top: 12px;
  background: linear-gradient(transparent, var(--bg-elevated) 28%);
  justify-content: flex-end;
}
.cinema-scene-hint {
  margin: 8px 0 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.cinema-scene-fields {
  display: grid;
  gap: 12px;
}
.cinema-scene-group {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
}
.cinema-scene-group-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-amber);
}
.cinema-scene-row {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 180px);
  gap: 10px;
  align-items: start;
}
.cinema-scene-group:has(.cinema-scene-row) .cinema-scene-row:has(.cinema-scene-grow + .cinema-scene-grow) {
  grid-template-columns: 1fr 1fr;
}
.cinema-scene-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.cinema-scene-fields label:last-child {
  margin-bottom: 0;
}
.cinema-scene-fields .cinema-scene-row label {
  margin-bottom: 0;
}
.cinema-scene-fields input,
.cinema-scene-fields select,
.cinema-scene-fields textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--text);
  background: #0a0908;
  border: 1px solid #3d322a;
  border-radius: 6px;
  padding: 9px 11px;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cinema-scene-fields input:hover,
.cinema-scene-fields select:hover,
.cinema-scene-fields textarea:hover {
  border-color: #53463c;
}
.cinema-scene-fields input:focus,
.cinema-scene-fields select:focus,
.cinema-scene-fields textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.22);
}
.cinema-scene-fields select {
  cursor: pointer;
  appearance: auto;
}
.cinema-scene-preview-fold {
  margin: 14px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
}
.cinema-scene-preview-fold summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.cinema-scene-preview {
  margin: 8px 0 0;
  padding: 10px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  border: 1px solid #3d322a;
  border-radius: 6px;
  background: #0a0908;
}
@media (max-width: 560px) {
  .cinema-scene-row,
  .cinema-scene-group:has(.cinema-scene-row) .cinema-scene-row:has(.cinema-scene-grow + .cinema-scene-grow) {
    grid-template-columns: 1fr;
  }
}
.cinema-json-dialog {
  width: min(760px, 100%);
}
.cinema-json-file-label {
  display: inline-flex;
  margin: 0 0 10px;
}
.cinema-json-paste-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.cinema-json-paste-label textarea {
  width: 100%;
  min-height: 220px;
  box-sizing: border-box;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text);
  background: #0a0908;
  border: 1px solid #3d322a;
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
}
.cinema-json-paste-label textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.22);
}
.cinema-json-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 0 4px;
}
.cinema-json-opts .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.82rem;
}
.cinema-shot-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted, #9aa3ad);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cinema-shot-title {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
  color: inherit;
}
.cinema-shot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cinema-shot .cinema-shot-edit {
  margin-left: auto;
}
.clip-merge-dialog {
  width: min(720px, 100%);
  max-height: min(85vh, 820px);
  display: flex;
  flex-direction: column;
}
.clip-merge-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0 8px;
}
.clip-merge-list {
  flex: 1;
  min-height: 120px;
  max-height: min(52vh, 480px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.clip-merge-row {
  display: grid;
  grid-template-columns: auto auto 96px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.clip-merge-row.is-selected {
  border-color: var(--accent, #6ea8fe);
  background: rgba(110, 168, 254, 0.08);
}
.clip-merge-check input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.clip-merge-order {
  min-width: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.clip-merge-row video {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
}
.clip-merge-meta {
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}
.clip-merge-move {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.clip-merge-move .btn-ghost {
  padding: 2px 8px;
  min-width: 2rem;
  line-height: 1.2;
}
.cinema-film-mode {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.cinema-film-mode summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.cinema-film-mode-body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-top: 10px;
}
.cinema-film-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.cinema-film-field input,
.cinema-film-field select {
  width: 100%;
  box-sizing: border-box;
}

/* Native select popups follow the app's dark palette instead of Windows white. */
select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-height: 38px;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23e7b466' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(180deg, rgba(8, 7, 6, 0.82), rgba(18, 14, 12, 0.98));
  background-repeat: no-repeat, no-repeat;
  background-position: right 11px center, center;
  background-size: 16px, auto;
}
select option,
select optgroup {
  color: #f5f0e8;
  background: #19130f;
}
select option:checked {
  color: #fff8ed;
  background: #b9522f;
}
select option:disabled {
  color: #887d72;
}
.cinema-film-stills-warn {
  flex: 1 1 100%;
  color: #e8b86d;
}
.cinema-shot-link {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cinema-script-col #cinema-shot-draft {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
}
.cinema-shot-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cinema-shots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}
.cinema-preview-fold {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.22);
}
.cinema-preview-fold summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.cinema-preview-text {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #e8dcc8;
}
.cinema-shot-binds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0;
}
.cinema-bind {
  font-size: 0.68rem;
  font-family: ui-monospace, Consolas, monospace;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(212, 160, 23, 0.35);
}
.cinema-shot-job {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}
.cinema-shot-job.is-run { color: #e0a050; }
.cinema-shot-job.is-ok { color: #8fba7a; }
.cinema-shot-job.is-err { color: #d07070; }
#cinema-prod-hint {
  flex: 1 1 100%;
  margin: 0;
}
.gallery-still {
  position: absolute;
  left: 6px;
  bottom: 28px;
  z-index: 2;
  font-size: 0.68rem;
  padding: 2px 6px;
}
.cinema-shot {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cinema-shot.is-disabled {
  opacity: 0.55;
}
.error-logs-panel {
  width: min(980px, 100%);
}
.error-logs-text {
  margin: 0;
  padding: 14px;
  max-height: min(66vh, 680px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #140f0c;
  color: #f2e6d8;
  font: 12px/1.45 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.lora-check-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  max-height: 132px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 4px 6px 0;
}
.lora-check-list label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  cursor: pointer;
}
.lora-check-list input[type="checkbox"] { flex: 0 0 auto; }
.cinema-shot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cinema-shot-head .idx {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 52px;
}
.cinema-shot-mode {
  display: inline-flex;
  gap: 4px;
}
.cinema-shot-mode button {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.cinema-shot-mode button.on.t2v {
  background: rgba(196, 92, 38, 0.28);
  color: var(--text);
  border-color: var(--accent);
}
.cinema-shot-mode button.on.continue {
  background: rgba(212, 160, 23, 0.22);
  color: var(--text);
  border-color: var(--accent-amber);
}
.cinema-shot textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-size: 0.84rem;
}
.cinema-produce {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cinema-timeline { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0, 0, 0, 0.24); overflow-x: auto; }
.cinema-timeline-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.cinema-timeline-head h3 { margin: 2px 0 0; font-size: 1rem; }
.eyebrow { color: var(--accent-amber); font: 0.65rem ui-monospace, Consolas, monospace; letter-spacing: 0.08em; }
.timeline-ruler, .timeline-lane { position: relative; min-width: 560px; }
.timeline-ruler { height: 22px; margin-left: 112px; border-bottom: 1px solid var(--border); }
.timeline-ruler span { position: absolute; bottom: 3px; transform: translateX(-50%); font: 0.65rem ui-monospace, Consolas, monospace; color: var(--text-muted); }
.timeline-track { display: grid; grid-template-columns: 104px minmax(560px, 1fr); gap: 8px; min-height: 48px; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.06); }
.timeline-track-label { color: var(--text-muted); font-size: 0.72rem; }
.timeline-lane { height: 34px; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5%); }
.timeline-clip, .timeline-audio-clip { position: absolute; top: 3px; height: 28px; min-width: 28px; overflow: hidden; border: 1px solid rgba(212,160,23,0.58); border-radius: 4px; background: rgba(196,92,38,0.68); color: #fff; text-align: left; padding: 3px 12px 3px 7px; cursor: pointer; }
.timeline-clip b { margin-right: 5px; font-size: 0.68rem; }
.timeline-clip span, .timeline-audio-clip span { font-size: 0.68rem; white-space: nowrap; }
.timeline-track[data-track="dialogue"] .timeline-clip { background: rgba(84,123,153,0.7); border-color: rgba(150,210,235,0.58); }
.timeline-audio-clip { position: relative; display: flex; justify-content: space-between; align-items: center; width: 100%; background: rgba(74,132,96,0.68); border-color: rgba(140,210,160,0.56); }
.timeline-audio-clip em { color: rgba(255,255,255,0.65); font-size: 0.62rem; }
.timeline-empty { padding: 8px; color: var(--text-muted); font-size: 0.7rem; }
@media (max-width: 980px) {
  .cinema-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }
}


/* restored cinema asset tabs */
.cinema-cast-lock-banner {
  display: none;
  gap: 8px 14px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 0 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(196, 92, 38, 0.45);
  background: linear-gradient(120deg, rgba(196, 92, 38, 0.18), rgba(22, 18, 16, 0.9));
}
.cinema-panel.is-mode-assets .cinema-cast-lock-banner {
  display: flex;
}
.cinema-cast-lock-banner strong {
  font-size: 0.92rem;
  color: #f0d2b8;
}
.cinema-cast-lock-banner span {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 52rem;
  line-height: 1.35;
}
.cinema-asset-tabs {
  margin: 0 0 8px;
}
.cinema-asset-tab-panel input,
.cinema-asset-tab-panel textarea {
  width: 100%;
  margin: 0 0 8px;
  box-sizing: border-box;
}
.cinema-asset-tab-panel .cta {
  width: 100%;
  margin-top: 4px;
}
.cinema-folder-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cinema-folder-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 6px 0;
}
.cinema-folder-tab b {
  color: var(--text);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cinema-folder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  min-height: 108px;
  padding: 6px;
  border-radius: 0 8px 8px 8px;
  background: #14110f;
  border: 1px dashed #5a4a3c;
}
.cinema-folder.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
