.fp-workspace {
  min-width: 0;
}
/* The whole-film entry is a quiet action beside the section navigation. */
.fp-film-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; flex: none; white-space: nowrap; }
.fp-editor .fp-dialog:is([data-insert-film],[data-assembly]) { width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;overflow:hidden; }
.fp-editor .fp-dialog:is([data-insert-film],[data-assembly])[open] { display:flex;flex-direction:column; }
.fp-editor .fp-dialog:is([data-insert-film],[data-assembly])>header { flex:none;margin:0;padding:16px;gap:12px;border-bottom:1px solid var(--fp-line); }
.fp-editor .fp-dialog:is([data-insert-film],[data-assembly])>header h2 { min-width:0;font-size:20px;margin:0; }
.fp-editor .fp-dialog:is([data-insert-film],[data-assembly])>.fp-dialog-body { min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px; }
.fp-editor .fp-dialog[data-insert-film]>.fp-batch-footer>.btn { width:100%;margin:0;min-height:48px; }
.fp-film-trigger .fp-icon { width: 16px; height: 16px; }
.fp-editor .fp-film-dialog { width: min(580px,100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; margin-block: 0; margin-inline: auto 0; padding: 0; border-radius: 18px 0 0 18px; overflow: hidden; }
[dir=rtl] .fp-editor .fp-film-dialog { border-radius: 0 18px 18px 0; }
.fp-editor .fp-film-dialog[open] { display: flex; flex-direction: column; }
.fp-editor .fp-film-dialog>header { flex: none; padding: 16px 22px; border-bottom: 1px solid var(--line); margin: 0; }
.fp-editor .fp-film-dialog>header h2 { margin: 0; font-size: 22px; }
.fp-editor .fp-film-dialog>.fp-dialog-body { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; padding: 18px 22px; }
.fp-film-dialog .fp-film-intro,.fp-film-mode>p,.fp-film-dialog .fp-production>p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.fp-film-dialog .fp-film-intro { margin: 0 0 18px; }
.fp-film-mode { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.fp-film-mode .fp-field { margin: 0; }
.fp-film-mode>p { margin: 8px 0 0; }
.fp-editor .fp-film-dialog .fp-production { margin: 18px 0 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
.fp-editor .fp-film-dialog .fp-production h2 { font-size: 17px; margin: 0 0 6px; }
.fp-film-dialog .fp-production .fp-field { max-width: none; margin: 18px 0 8px; }
.fp-film-dialog .fp-production .fp-check { margin-block: 20px; align-items: flex-start; line-height: 1.5; }
.fp-film-dialog .fp-production .fp-check input { flex: none; margin-top: 3px; }
.fp-film-footer { flex: none; max-height: 45dvh; overflow: auto; padding: 14px 22px max(16px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-solid); }
.fp-film-footer .fp-status { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.fp-film-footer .fp-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.fp-film-footer .btn { min-height: 46px; min-width: 0; padding: 10px 12px; line-height: 1.4; }
@media (max-width:760px) {
  .fp-editor .fp-film-dialog,[dir=rtl] .fp-editor .fp-film-dialog { width: 100vw; border-radius: 0; }
  .fp-editor .fp-film-dialog>header { padding: 12px 16px; }
  .fp-editor .fp-film-dialog>.fp-dialog-body { padding: 16px; }
  .fp-film-footer { padding-inline: 16px; }
}
.fp-continuity-reason { border-left: 2px solid var(--accent); padding-left: 12px; }
.fp-quote-details { width: 100%; }
.fp-toolbar,
.fp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.fp-toolbar [aria-pressed='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.fp-toolbar [data-save] {
  margin-left: auto;
}
.fp-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}
.fp-scenes {
  align-self: start;
  position: sticky;
  top: 12px;
  max-height: 75vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
}
.fp-scenes section {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.fp-scenes small {
  color: var(--muted);
}
.fp-scenes button {
  text-align: left;
  white-space: normal;
}
.fp-scenes [aria-current='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.fp-inspector {
  min-width: 0;
  padding: 24px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.fp-field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  min-width: 0;
}
.fp-field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.fp-field input,
.fp-field select,
.fp-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface2);
  color: var(--ink);
  border: 1px solid var(--ui-control-border);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
}
.fp-field textarea {
  resize: vertical;
  min-height: 90px;
}
.fp-preview {
  display: grid;
  place-items: center;
  min-height: 200px;
  background: var(--bg);
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
}
.fp-preview img,
.fp-preview video {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
}
.fp-preview p {
  padding: 24px;
  color: var(--muted);
}
.fp-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.fp-check input {
  width: 18px;
  height: 18px;
  flex: none;
}
.fp-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.fp-asset {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  overflow: hidden;
}
.fp-asset img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 8px;
}
.fp-asset audio {
  width: 100%;
  min-width: 0;
}
.fp-asset strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.fp-asset p {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
}
.fp-cast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 18px;
}
.fp-status {
  min-height: 24px;
  white-space: pre-wrap;
  color: var(--accent);
}
.fp-production {
  margin-top: 22px;
}
.fp-editable {
  margin: 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.fp-editable > .btn {
  font-size: 12px;
  min-height: 38px;
}
.fp-inputs {
  border-top: 1px solid var(--line);
  margin: 20px 0;
  padding-top: 14px;
}
.fp-inputs > div:not(.fp-assets):not(.fp-action-row) {
  display: inline-block;
  vertical-align: top;
  width: calc(50% - 12px);
  margin-right: 12px;
}
.fp-inputs input[type='file'] {
  max-width: 100%;
  margin: 12px 0;
}
.fp-timing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.fp-track {
  margin: 16px 0;
}
.fp-track > .fp-asset {
  max-width: 460px;
}
.fp-dialog {
  width: min(850px, calc(100vw - 28px));
  max-height: 88vh;
  overflow: auto;
  box-sizing: border-box;
  border: 1px solid var(--ui-control-border);
  border-radius: 18px;
  background: var(--surface-solid);
  color: var(--ink);
  padding: 22px;
}
.fp-dialog::backdrop {
  background: var(--ui-overlay);
}
.fp-dialog > header > .btn { flex:0 0 auto;white-space:nowrap }
.fp-dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.fp-dialog-body > img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.fp-dialog-body > audio {
  width: 100%;
}
.fp-dialog-body > .btn {
  margin: 12px 0;
}
.fp-dialog-body > small {
  display: block;
  color: var(--muted);
}
.fp-workspace video {
  max-width: 100%;
  max-height: 440px;
}
.fp-workspace button:focus-visible,
.fp-workspace input:focus-visible,
.fp-workspace select:focus-visible,
.fp-workspace textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.fp-workspace[aria-busy='true'] {
  cursor: progress;
}
@media (max-width: 850px) {
  .fp-layout {
    grid-template-columns: 1fr;
  }
  .fp-scenes {
    position: static;
    max-height: 230px;
    display: flex;
    gap: 18px;
  }
  .fp-scenes section {
    min-width: 180px;
  }
  .fp-inspector {
    padding: 16px;
  }
  .fp-timing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fp-toolbar [data-save] {
    margin-left: 0;
  }
  .fp-inputs > div:not(.fp-assets):not(.fp-action-row) {
    display: block;
    width: 100%;
    margin-right: 0;
  }
}

.fd-workbench .fp-check input[type='checkbox'] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  flex: 0 0 20px;
  accent-color: var(--accent);
}
.fp-inspector fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 16px 0;
  min-width: 0;
}
.fp-inspector legend {
  padding: 0 8px;
  color: var(--muted);
}

/* Actions stay together; the host's generic block buttons must not stack flush. */
.fp-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.fd-workbench .fp-action-row > .btn,
.fp-dialog .fp-action-row > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 11px 16px;
  white-space: normal;
}
.fp-view-section {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.fp-view-section h3 { margin: 0 0 12px; font-size: 16px; }
.fp-batch-intro { margin-bottom: 20px; }
.fp-batch-intro p { max-width: 70ch; line-height: 1.6; margin-bottom: 18px; }
.fp-batch-summary { display:grid;gap:10px;padding:0;margin:16px 0;list-style:none; }
.fp-batch-summary li { padding:12px;border:1px solid var(--line);border-radius:10px;overflow-wrap:anywhere; }
.fp-character-advice { margin-top:20px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--bg); }
.fp-character-advice h3 { margin:0 0 10px;font-size:16px; }
.fp-character-advice p { line-height:1.6;overflow-wrap:anywhere; }
.fp-batch-matrix { display: grid; gap: 16px; margin: 20px 0; }
.fp-batch-character { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.fp-batch-character legend { padding: 0 8px; font-weight: 700; }
.fp-batch-character .fp-check { min-height: 44px; padding: 8px; }
.fp-batch-prices details { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fp-batch-prices summary { cursor: pointer; min-height: 32px; }
.fp-batch-prices p { line-height: 1.6; overflow-wrap: anywhere; }
.fp-previous-clip { display: block; max-width: 100%; width: 360px; max-height: 230px; margin-top: 16px; border-radius: 10px; }
@media (max-width: 520px) { .fp-batch-character { grid-template-columns: 1fr; } }
.fp-view-section .hint { min-height: 40px; margin-bottom: 16px; }
.fp-view-section .btn { margin-top: 12px; }
.fp-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px dashed var(--line, var(--ui-control-border));
  border-radius: 10px;
  color: var(--text, var(--ink));
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
}
.fp-workspace .fp-upload input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.fp-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.fp-inputs .fp-upload { margin: 12px 0; }
.fp-cast .fp-assets { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fp-operation-notice {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
  background: var(--panel, var(--surface-solid));
}

.fp-operation-notice p { margin: 8px 0 14px; line-height: 1.6; }
.fp-status[data-state='running'] {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 1.7;
}
.fp-status[data-state='running']::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-inline-end: 10px;
  vertical-align: middle;
  animation: fp-spin 1s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fp-status[data-state='running']::before { animation: none; } }
@media (max-width: 520px) {
  .fp-action-row { align-items: stretch; }
  .fp-action-row > .btn, .fp-action-row > .fp-upload { flex: 1 1 100%; }
}

/* The same prepared film has a compact mobile navigation; no graph or draft is rebuilt. */
.fp-mobile-tab,.fp-mobile-shot{display:none}
@media (max-width:760px),(max-height:500px) and (pointer:coarse){
 .fp-workspace .fp-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 .fp-toolbar>[data-preparation-tab]{display:none!important}
 .fp-mobile-tab,.fp-mobile-shot{display:grid;margin:0 0 10px}
 .fp-mobile-tab select,.fp-mobile-shot select{min-height:48px;font-size:16px}
 .fp-toolbar>.btn{width:100%;min-height:48px;margin:0;white-space:normal}
 .fp-layout>.fp-scenes{display:none}
 .fp-layout{gap:12px}
 .fp-workspace :is(.fp-preview,.fp-preview img,.fp-preview video){min-height:0;max-height:200px}
 .fp-workspace .fp-timing{grid-template-columns:1fr}
 .fp-workspace .fp-actions>.btn{min-height:48px;white-space:normal}
 .fp-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 24px);padding:16px}
}
.fp-dialog:is([data-character-batch=all],[data-scoped-production])[open]{display:flex;flex-direction:column;padding:0;overflow:hidden}
.fp-dialog:is([data-character-batch=all],[data-scoped-production])>header{flex:0 0 auto;padding:16px 18px;margin:0;gap:12px;border-bottom:1px solid var(--line)}
.fp-dialog:is([data-character-batch=all],[data-scoped-production])>header h2{font-size:20px;margin:0;min-width:0}
.fp-dialog:is([data-character-batch=all],[data-scoped-production])>header>.btn{flex:0 0 auto;min-width:72px;padding:10px 12px;white-space:nowrap}
.fp-dialog:is([data-character-batch=all],[data-scoped-production])>.fp-dialog-body{overflow:auto;min-height:0;padding:0 18px;overscroll-behavior:contain}
.fp-scoped-actions{margin:0 0 16px}
.fp-batch-footer{flex:0 0 auto;padding:12px 18px;border-top:1px solid var(--line);background:var(--surface-solid)}
.fp-batch-footer .fp-status{margin:0 0 10px;line-height:1.5}
.fp-batch-footer .fp-action-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin:0;gap:10px}
.fp-batch-footer .fp-action-row>.btn{margin:0;min-width:0;min-height:48px;white-space:normal}

/* A prepared shot is the primary workspace. Detailed controls retain their owners. */
.fp-studio-simple .fp-film-summary{margin:0 0 12px;color:var(--muted);font-size:13px}
.fp-studio-simple .fp-toolbar{gap:8px;margin-bottom:14px}
.fp-studio-simple .fp-toolbar>.btn{font-size:13px;padding:9px 12px}
.fp-studio-simple .fp-plan-head{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:12px}
.fp-studio-simple .fp-plan-head h2{font-size:24px;margin:0}
.fp-plan-badge{padding:5px 10px;border-radius:20px;border:1px solid var(--line);background:var(--surface2);font-size:12px;color:var(--muted);white-space:nowrap}
.fp-studio-simple .fp-scenes button{display:flex;align-items:center;gap:9px;text-align:start}
.fp-studio-simple .fp-scenes button[aria-current='true']{border-color:var(--accent);box-shadow:inset 3px 0 var(--accent);background:var(--surface2)}
.fp-shot-thumb{width:38px;height:42px;flex:none;border-radius:7px;overflow:hidden;background:var(--surface2);border:1px solid var(--line)}
.fp-shot-thumb img{width:100%;height:100%;object-fit:cover}
.fp-shot-thumb-empty{border-style:dashed}
.fp-shot-thumb-empty::after{content:'＋';display:grid;place-items:center;height:100%;color:var(--muted);font-weight:400}
.fp-image-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.fp-image-head h3{margin:0 auto 0 0;font-size:14px}
.fp-image-head>.btn{font-size:12px;padding:8px 10px;min-height:44px}
.fp-studio-simple .fp-preview{margin:12px 0;min-height:150px}
.fp-studio-simple .fp-preview img,.fp-studio-simple .fp-preview video{max-height:290px}
.fp-studio-simple .fp-scoped-actions{margin:12px 0 16px}
.fp-scoped-actions .hint{font-size:12px;margin:7px 0}
.fp-studio-simple .fp-shot-settings,.fp-studio-simple .fp-scene-settings{margin:12px 0;border-top:1px solid var(--line);padding-top:10px}
.fp-shot-settings>summary,.fp-scene-settings>summary{cursor:pointer;font-size:13px;min-height:44px;padding:9px 0}
.fp-duration-summary{font-size:12px;color:var(--muted)}
.fp-reference-status{padding:10px 12px;background:var(--surface2);border:1px solid var(--line);border-radius:10px;font-size:13px;line-height:1.5}
.fp-scope-conflict{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface2);margin:12px 0;overflow-wrap:anywhere}
.fp-scope-conflict[hidden]{display:none}
.fp-scope-conflict h3{font-size:16px;margin:0 0 10px}
.fp-scope-conflict p{font-size:13px;line-height:1.5;margin:8px 0}
.fp-scope-conflict .fp-action-row{flex-wrap:wrap}
.fp-scope-conflict button{white-space:normal;min-width:0;max-width:100%}
.fp-launch-image{display:flex;gap:14px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}
.fp-launch-image img{width:64px;height:64px;object-fit:contain;border-radius:8px;flex:none}
.fp-launch-image p{font-size:13px;margin:0;color:var(--muted)}
.fp-launch-prompt{border:1px solid var(--line);border-radius:12px;padding:12px;margin:14px 0;background:var(--surface2);min-width:0}
.fp-launch-prompt textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:140px;line-height:1.5}
.fp-prompt-count{font-size:13px;text-align:end;margin:5px 0 10px;font-variant-numeric:tabular-nums}
.fp-prompt-count[data-invalid=true]{color:var(--danger,#a43c29);font-weight:600}
.fp-launch-prompt button{white-space:normal;max-width:100%}
.fp-launch-durations .hint{margin:4px 0 12px;font-size:12px}
.fp-studio-simple .fp-dialog .provider-picker-inline-providers,.fp-studio-simple .fp-dialog .provider-picker-current{display:none}
.fp-targeted-dock{display:none}
.project-workshop:has(.fp-studio-simple)>.project-view-tabs{display:none}
.project-workshop:has(.fp-studio-simple) .project-workshop-head{padding:12px 18px;min-height:68px;margin-bottom:12px}
.project-workshop:has(.fp-studio-simple) .project-workshop-head h1{font-size:25px;margin:0}
.project-workshop:has(.fp-studio-simple) .fd-path{margin-bottom:12px}
.project-workshop:has(.fp-studio-simple) .fd-steps button{min-height:38px;padding:6px 10px;font-size:12px}
.project-workshop:has(.fp-studio-simple) .fd-project-bar{margin-bottom:10px}
@media(max-width:760px),(max-height:500px) and (pointer:coarse){
 .fp-studio-simple .fp-toolbar{display:flex;flex-wrap:wrap;align-items:center}
 .fp-studio-simple .fp-toolbar .fp-mobile-tab{flex:1;margin:0;min-width:140px}
 .fp-studio-simple .fp-toolbar>.btn{width:auto;min-height:44px;font-size:12px}
 .fp-studio-simple .fp-toolbar .fp-preview-storyboard{display:none}
 .fp-studio-simple .fp-toolbar [data-save]{flex:0 1 auto;max-width:48%;margin:0}
 .fp-studio-simple .fp-inspector{padding:14px}
 .fp-studio-simple .fp-scoped-actions .fp-action-row>.btn:first-child{display:none}
 .fp-studio-simple .fp-scoped-actions .fp-action-row>.btn{flex:0 1 auto;font-size:12px}
 .fp-studio-simple .fp-preview img,.fp-studio-simple .fp-preview video{max-height:210px}
 .fp-targeted-dock:not([hidden]){display:flex;position:fixed;inset-inline:0;bottom:64px;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border-top:1px solid var(--line);background:var(--surface-solid);z-index:12}
 .fp-targeted-dock>span{color:var(--muted);font-size:12px}
 .fp-targeted-dock>.btn{flex:1;min-height:44px;font-size:13px;white-space:normal}
 .screen[hidden] .fp-targeted-dock{display:none}
 .fp-studio-simple{padding-bottom:72px}
 .fp-image-head{gap:6px}
 .fp-image-head h3{width:100%;margin:0}
 .fp-image-head>.btn{flex:1;font-size:11px}
 .fp-plan-badge{font-size:11px}
 .fp-studio-simple .fp-film-summary{font-size:11px}
 .fp-batch-footer .fp-action-row{grid-template-columns:1fr}
}
body[data-mobile-keyboard] .fp-targeted-dock{display:none}
.fp-prompt-tools{display:flex;align-items:end;gap:10px;margin-top:12px;min-width:0}
.fp-prompt-tools>.fp-field{flex:1;min-width:0;margin:0;gap:6px}
.fp-prompt-tools>.btn{flex:0 0 auto;margin:0;height:44px;min-height:44px;padding:8px 12px;font-size:12px;box-sizing:border-box}
.fp-prompt-tools .provider-model-picker{margin:0}
.fp-prompt-tools .provider-picker-trigger{height:44px;min-height:44px;padding:6px 9px;gap:8px;border-radius:10px;box-sizing:border-box}
.fp-prompt-tools .provider-picker-trigger>.provider-picker-logo{height:28px;width:28px;flex-basis:28px}
.fp-prompt-tools .provider-picker-copy{gap:0;overflow:hidden}
.fp-prompt-tools .provider-picker-copy strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fp-prompt-tools .provider-picker-copy small{display:none}
.fp-inline-assistant{padding:12px;border:1px solid var(--line);border-radius:12px;margin-top:12px;background:var(--surface-solid);min-width:0}
.fp-inline-assistant>.fp-action-row:first-child{justify-content:flex-end;margin:0}
.fp-missing-frame{border:1px solid var(--line);border-radius:16px;padding:16px;margin:12px 0}.fp-missing-frame p{margin-top:0}
.fp-frame-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}
.fp-frame-card{min-width:0;border:1px solid var(--line);border-radius:12px;background:var(--surface2);padding:12px;overflow-wrap:anywhere}
.fp-frame-card h3{font-size:13px;margin:0 0 10px}
.fp-frame-card img{width:100%;height:100px;object-fit:contain;border-radius:8px}
.fp-frame-card .fp-action-row{flex-wrap:wrap;gap:6px;margin-bottom:0}
.fp-frame-card .btn,.fp-frame-card input[type=file]{font-size:11px;max-width:100%;min-width:0;min-height:44px;box-sizing:border-box;white-space:normal}
.fp-frame-card input[type=file]{width:100%}
.fp-frame-inputs>.hint{grid-column:1/-1;font-size:12px;margin:0}
.fp-dialog[data-plan-batch][open]{display:flex;flex-direction:column;padding:0;overflow:hidden}
.fp-dialog[data-plan-batch]>header{padding:16px 18px;gap:12px;border-bottom:1px solid var(--line);margin:0;flex:none}
.fp-dialog[data-plan-batch]>.fp-dialog-body{overflow:auto;min-height:0;padding:0 18px}
.fp-plan-batch-list{display:grid;gap:12px;margin:12px 0}
.fp-plan-batch-row{min-width:0;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface2)}
.fp-plan-batch-row>.fp-check{font-weight:600;margin-top:0;min-height:44px}
.fp-batch-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.fp-batch-images>div{min-width:0;display:flex;flex-direction:column;gap:6px}
.fp-batch-images img{width:100%;height:80px;object-fit:contain}
.fp-batch-images .btn{font-size:12px;min-height:44px;white-space:normal;margin:0}
@media(max-width:380px){.fp-prompt-tools{display:grid;grid-template-columns:minmax(0,1fr)}.fp-prompt-tools>.btn{width:100%}.fp-frame-card{padding:8px}.fp-frame-card .btn{width:100%}}

/* Film workspace: quiet navigation, one opaque work surface, themed actions. */
.fp-editor {
  --fp-line: color-mix(in srgb, var(--ink) 12%, var(--surface-solid));
  --fp-muted-surface: color-mix(in srgb, var(--ink) 4%, var(--surface-solid));
  min-width: 0; padding: 12px 18px; border: 1px solid var(--fp-line);
  border-radius: 16px; background: var(--surface-solid); color: var(--ink);
}
.fp-editor [hidden] { display: none !important; }
.fp-editor > .fp-status:empty { display: none; }
.fp-editor > .fp-status { margin: 0 0 12px; font-size: 13px; }
.fp-editor .fp-film-summary { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.fp-editor :is(.fp-section-tab,.fp-plan-tab,.fp-shot-tab,.fp-tool,.fp-context-link,.fp-text-action,.fp-ai-action) {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 0; margin: 0; padding: 8px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
  text-decoration: none; box-shadow: none; line-height: 1.5;
}
.fp-editor :is(.fp-tool,.fp-context-link,.fp-text-action,.fp-ai-action):hover:not(:disabled) { background: var(--fp-muted-surface); }
.fp-icon { display: block; width: 18px; height: 18px; flex: 0 0 18px; }
.fp-editor .fp-short-label { display: none; }
.fp-editor .fp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 0; margin: 0 0 16px; border-bottom: 1px solid var(--fp-line); }
.fp-editor .fp-section-tabs { display: flex; align-items: center; gap: 20px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.fp-editor .fp-section-tab { position: relative; flex: none; min-height: 48px; padding: 10px 0; border-radius: 0; color: var(--muted); font-weight: 500; white-space: nowrap; }
.fp-editor .fp-section-tab[aria-selected='true'] { color: var(--accent); font-weight: 650; }
.fp-editor .fp-section-tab[aria-selected='true']::after { content: ''; position: absolute; bottom: 0; inset-inline: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.fp-editor .fp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-inline-start: auto; }
.fp-editor .fp-tool { padding-inline: 8px; font-size: 12px; color: var(--muted); white-space: normal; }
.fp-editor .fp-film-trigger { color: var(--accent); font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.fp-editor .fp-tools > [data-save] { margin: 0; }
.fp-editor[data-dirty='true'] .fp-tools > [data-save] { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-solid)); }
.fp-editor[data-dirty='false'] .fp-tools > [data-save]::before { content: '✓'; }
.fp-editor .fp-tools > [data-undo-edit]:disabled { display: none; }
.fp-more-tools { position: relative; }
.fp-editor .fp-more-tools > summary { min-height: 44px; padding: 12px 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.fp-more-items { position: absolute; z-index: 15; top: 100%; inset-inline-end: 0; width: 250px; max-width: calc(100vw - 40px); padding: 12px; border: 1px solid var(--fp-line); border-radius: 12px; background: var(--surface-solid); box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 14%, transparent); }
.fp-editor .fp-more-items > .fp-tool { display: flex; width: 100%; justify-content: flex-start; padding: 10px 8px; }
.fp-editor .fp-more-items .fp-film-summary { padding: 4px 8px 8px; line-height: 1.6; }
.fp-editor .fp-mobile-tab { display: none !important; }
.fp-editor .fp-layout { display: grid; grid-template-columns: 154px minmax(0, 1fr); gap: 18px; align-items: start; }
.fp-editor .fp-mobile-shot { display: none; }
.fp-editor .fp-scenes { background: transparent; border: 0; border-inline-end: 1px solid var(--fp-line); border-radius: 0; padding: 0; padding-inline: 0 12px; max-height: calc(100dvh - 160px); top: 88px; }
.fp-editor .fp-scenes h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; }
.fp-editor .fp-scenes section { display: grid; gap: 4px; margin: 0 0 16px; }
.fp-editor .fp-scenes section > strong { font-size: 12px; font-weight: 600; line-height: 1.5; }
.fp-editor .fp-scenes section > small { font-size: 10px; margin-bottom: 8px; color: var(--muted); }
.fp-editor .fp-scenes .fp-plan-tab { width: 100%; display: flex; padding: 8px 6px; gap: 8px; text-align: start; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; }
.fp-editor .fp-scenes .fp-plan-tab:hover { background: var(--fp-muted-surface); }
.fp-editor .fp-scenes .fp-plan-tab[aria-selected='true'] { background: color-mix(in srgb, var(--accent) 9%, var(--surface-solid)); box-shadow: inset 3px 0 var(--accent); }
[dir='rtl'] .fp-editor .fp-scenes .fp-plan-tab[aria-selected='true'] { box-shadow: inset -3px 0 var(--accent); }
.fp-editor .fp-plan-caption { display: grid; gap: 4px; min-width: 0; }
.fp-editor .fp-plan-caption strong { font-size: 13px; font-weight: 650; }
.fp-editor .fp-plan-caption small { font-size: 10px; line-height: 1.5; font-weight: 400; }
.fp-editor .fp-plan-tab > .fp-icon { width: 14px; height: 14px; flex-basis: 14px; margin-inline-start: auto; color: var(--accent); }
.fp-editor .fp-shot-thumb { width: 44px; height: 42px; flex: 0 0 44px; border-radius: 8px; border-color: var(--fp-line); }
.fp-editor .fp-shot-thumb-empty { background: var(--fp-muted-surface); }
.fp-editor .fp-shot-thumb-empty::after { content: '▧'; font-size: 20px; }
.fp-editor .fp-inspector { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.fp-editor .fp-breadcrumb { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.fp-editor .fp-plan-head { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; scroll-margin-top: 72px; }
.fp-plan-title { margin-inline-end: auto; }
.fp-editor .fp-plan-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.fp-editor .fp-plan-head .fp-action-row { display: flex; gap: 4px; margin: 0; }
.fp-editor .fp-plan-head .btn { min-width: 44px; padding: 8px; }
.fp-editor .fp-plan-badge { border: 0; padding: 5px 9px; background: var(--fp-muted-surface); font-size: 11px; }
.fp-shot-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,34%); gap: 20px; align-items: start; }
.fp-editor-column,.fp-media-column { min-width: 0; }
.fp-media-column { border-inline-start: 1px solid var(--fp-line); padding-inline-start: 18px; }
.fp-editor .fp-image-head { margin: 0; }
.fp-editor .fp-image-head h3 { margin: 0 auto 0 0; font-size: 11px; font-weight: 400; color: var(--muted); }
.fp-editor .fp-image-head:has(.fp-icon) { justify-content:flex-start; gap:8px; }
.fp-editor .fp-image-head:has(.fp-icon) h3 { width:auto; font-size:14px; font-weight:600; color:var(--text); }
.fp-editor .fp-preview[data-media-kind] { position:relative; }
.fp-media-type { position:absolute; top:8px; inset-inline-start:8px; max-width:calc(100% - 16px); box-sizing:border-box; padding:5px 9px; border:1px solid #ffffff40; border-radius:7px; background:#071722e6; color:#fff; font-size:11px; line-height:1.35; pointer-events:none; }
.fp-editor .fp-video-play { position:absolute; inset-inline-start:50%; top:50%; transform:translate(-50%,-50%); display:flex; align-items:center; justify-content:center; gap:8px; min-height:48px; width:max-content; max-width:calc(100% - 24px); padding:10px 16px; border:1px solid #ffffff80; border-radius:999px; color:#fff; background:#071722e6; box-shadow:0 2px 18px #0005; font:inherit; font-size:14px; font-weight:600; cursor:pointer; }
[dir=rtl] .fp-editor .fp-video-play { transform:translate(50%,-50%); }
.fp-editor .fp-video-play[hidden],.fp-preview[data-playing=true] .fp-media-type { display:none; }
.fp-editor .fp-video-play:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.fp-editor .fp-video-play .fp-icon { width:22px; height:22px; flex:none; }
.fp-prompt-preparation { color:var(--muted); font-size:13px; line-height:1.5; }
.fp-insert-trigger { display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:1px solid var(--fp-line);border-radius:10px;background:var(--bg);color:var(--text);font:inherit;font-size:25px;cursor:pointer; }
.fp-insert-trigger:focus-visible { outline:3px solid var(--accent);outline-offset:2px; }
.fp-insert-kinds { display:flex;gap:6px;padding:4px;margin-bottom:16px;border:1px solid var(--fp-line);border-radius:12px; }
.fp-insert-kinds>.btn { flex:1;min-width:0;min-height:44px;border:0;background:transparent; }
.fp-insert-kinds>.btn[aria-pressed=true] { background:var(--accent);color:var(--on-accent,var(--bg)); }
.fp-insert-fields { display:grid;gap:12px;min-width:0; }
.fp-insert-fields .hint { margin:0; }
.fp-film-trigger[data-film-state=assemble] { font-weight:700; }
.fp-editor .fp-preview { width: 100%; aspect-ratio: 16 / 9; min-height: 0; max-height: 280px; margin: 8px 0 12px; border: 1px solid var(--fp-line); border-radius: 12px; background: var(--bg); }
.fp-editor .fp-preview :is(img,video) { width: 100%; height: 100%; max-height: 280px; object-fit: contain; }
.fp-editor .fp-preview p { padding: 24px; font-size: 14px; line-height: 1.6; }
.fp-editor .fp-shot-tabs { display: flex; align-items: stretch; gap: 2px; max-width: 100%; padding: 3px; margin: 0 0 8px; border: 0; border-radius: 12px; background: var(--fp-muted-surface); overflow-x: auto; scrollbar-width: thin; }
.fp-editor .fp-shot-tabs .fp-shot-tab { flex: 1 0 auto; gap: 5px; padding: 8px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.fp-shot-tabs [data-compact-label] .fp-long-label { display: none; }
.fp-editor .fp-shot-tabs .fp-short-label { display: inline; }
.fp-editor .fp-shot-tabs .fp-shot-tab:hover { color: var(--ink); }
.fp-editor .fp-shot-tabs .fp-shot-tab[aria-selected='true'] { background: var(--surface-solid); color: var(--accent); font-weight: 650; box-shadow: 0 1px 4px color-mix(in srgb, var(--ink) 12%, transparent); }
.fp-editor .fp-shot-tab .fp-icon { width: 16px; height: 16px; flex-basis: 16px; }
.fp-shot-panel { min-width: 0; }
.fp-editor .fp-shot-panel > h3 { margin: 0 0 16px; font-size: 16px; }
.fp-editor .fp-shot-panel .fp-editable { position: relative; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.fp-editor .fp-editable .fp-field { margin: 0; gap: 0; }
.fp-editor .fp-editable .fp-field > span { display: flex; align-items: center; min-height: 44px; padding-inline-end: 145px; color: var(--ink); font-size: 13px; font-weight: 600; }
.fp-editor .fp-editable .fp-ai-action { position: absolute; top: 0; inset-inline-end: 0; display: flex; width: fit-content; margin: 0; padding: 8px 4px; font-size: 11px; color: var(--accent); }
.fp-editor .fp-shot-panel textarea { font-size: 14px; line-height: 1.6; min-height: 84px; border-color: var(--fp-line); border-radius: 10px; background: var(--fp-muted-surface); }
.fp-editor .fp-shot-panel textarea:focus { border-color: var(--accent); }
.fp-editor [data-shot-panel='description'] { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 14px; }
.fp-editor [data-shot-panel='description'] > .fp-editable:not(:has([data-film-field='Action'])) .fp-ai-action { position: static; margin-inline: auto 0; }
.fp-editor [data-shot-panel='description'] > .fp-editable:not(:has([data-film-field='Action'])) .fp-field > span { padding-inline-end: 0; }
.fp-editor [data-shot-panel='description'] > :is(details,.fp-editable:has([data-film-field='Action'])) { grid-column: 1 / -1; }
.fp-editor .fp-shot-panel details { padding: 0; border-block-start: 1px solid var(--fp-line); }
.fp-editor .fp-shot-panel summary { min-height: 44px; padding: 10px 0; font-size: 13px; line-height: 1.5; }
.fp-action-summary { font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.fp-plan-context { min-width: 0; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--fp-line); }
.fp-editor .fp-plan-context h3 { margin: 0 0 6px; font-size: 13px; font-weight: 650; }
.fp-context-summary { display: grid; gap: 4px; }
.fp-editor .fp-context-link { display: grid; grid-template-columns: 36px minmax(0,1fr) 16px; gap: 2px 8px; width: 100%; padding: 6px 0; text-align: start; border: 0; background: transparent; overflow-wrap: anywhere; }
.fp-context-link img { grid-row: 1 / 3; width: 36px; height: 40px; object-fit: cover; border-radius: 8px; }
.fp-context-title { grid-column: 2; grid-row: 1; font-size: 13px; font-weight: 600; }
.fp-context-link small { grid-column: 2; grid-row: 2; font-size: 11px; color: var(--muted); font-weight: 400; }
.fp-context-link > .fp-icon { grid-column: 3; grid-row: 1 / 3; width: 16px; height: 16px; color: var(--muted); align-self: center; }
.fp-editor .fp-context-link:not(:has(img)) { grid-template-columns: minmax(0,1fr) 16px; }
.fp-context-link:not(:has(img)) :is(.fp-context-title,small) { grid-column: 1; }
.fp-context-link:not(:has(img)) > .fp-icon { grid-column: 2; }
.fp-context-fields { margin: 8px 0 0; padding: 4px 0 16px; }
.fp-context-more > summary { min-height: 44px; padding: 12px 0; font-size: 12px; color: var(--muted); cursor: pointer; }
.fp-editor .fp-context-fields h4 { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fp-context-fields fieldset { padding: 0; border: 0; }
.fp-context-fields legend { font-size: 13px; color: var(--muted); }
.fp-context-continuity { padding: 12px 0 0; border-top: 1px solid var(--fp-line); }
.fp-context-continuity p { margin: 0 0 8px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; color: var(--muted); }
.fp-editor .fp-text-action { justify-content: flex-start; padding: 8px 0; color: var(--accent); font-size: 12px; text-align: start; }
.fp-editor .fp-text-action > .fp-icon { width: 14px; height: 14px; flex-basis: 14px; margin-inline-start: auto; }
.fp-context-controls { padding: 0; }
.fp-context-controls .fp-action-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.fp-editor .fp-context-controls .btn { width: 100%; min-height: 44px; padding: 12px; font-size: 13px; line-height: 1.4; white-space: normal; }
.fp-editor .fp-context-controls[data-has-clip='true'] .fp-scoped-actions .fp-action-row > button:first-child { display: none; }
.fp-editor .fp-context-controls .hint { margin: 4px 0; font-size: 11px; line-height: 1.6; }
.fp-draft-note { padding: 12px; background: var(--fp-muted-surface); border-inline-start: 2px solid var(--accent); border-radius: 8px; }
.fp-current-take { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--fp-muted-surface); }
.fp-current-take > .fp-icon { color: var(--accent); }
.fp-current-take strong { font-size: 13px; font-weight: 600; }
.fp-current-take p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.fp-empty-state { display: flex; flex-direction: column; align-items: center; padding: 28px 20px; text-align: center; }
.fp-empty-state > .fp-icon { width: 28px; height: 28px; margin-bottom: 12px; color: var(--muted); }
.fp-empty-state strong { font-size: 13px; font-weight: 600; }
.fp-empty-state p { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.fp-text-comparison,.fp-take-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 16px 0; }
.fp-text-comparison > section,.fp-take-comparison > section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.fp-text-comparison > section:last-child { background: var(--surface2); border-color: var(--accent); }
.fp-text-comparison p { white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.fp-take-comparison :is(img,video) { width: 100%; max-height: 300px; object-fit: contain; }
.fp-editor :is(textarea,input,select) { scroll-margin-block: 80px 140px; }
.project-workshop:has(.fp-editor) .fd-path > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px; cursor: pointer; font-size: 12px; }
.project-workshop:has(.fp-editor) .fd-path:not([open]) > .fd-steps { display: none; }
.project-workshop:has(.fp-editor) .project-workshop-head { min-height: 52px; padding-block: 8px; }
.project-workshop:has(.fp-editor) .project-film-heading { position: relative; }
.project-workshop:has(.fp-editor) .project-film-heading .fd-path { flex: 0 0 auto; margin: 0; border: 0; background: transparent; }
.project-workshop:has(.fp-editor) .project-film-heading .fd-path > summary { padding-inline: 8px; }
.project-workshop:has(.fp-editor) .project-film-heading .fd-path > summary > span { display: none; }
.project-workshop:has(.fp-editor) .project-film-heading .fd-path[open] > .fd-steps { position: absolute; inset-inline-end: 0; top: 100%; z-index: 20; width: min(560px,100%); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); box-shadow: 0 8px 28px color-mix(in srgb,var(--ink) 14%,transparent); }
.project-workshop:has(.fp-editor) .fd-message:empty { display: none; }
@media (min-width: 761px) {
  .project-workshop:has(.fp-editor) .project-film-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
  .project-workshop:has(.fp-editor) .project-film-heading .project-workshop-head { flex: 0 0 auto; min-height: 44px; margin: 0 !important; padding: 0 !important; border: 0; border-radius: 0; background: transparent; box-shadow: none; flex-wrap: nowrap; }
  .project-workshop:has(.fp-editor) .project-film-heading .project-workshop-head::before { display: none; }
  .project-workshop:has(.fp-editor) .project-film-heading .eyebrow { display: none; }
  .project-workshop:has(.fp-editor) .fd-project-bar { flex: 1; margin: 0; }
}
@media (min-width: 761px) and (max-width: 1200px) {
  .fp-editor .fp-layout { grid-template-columns: minmax(0,1fr); }
  .fp-editor .fp-scenes { display: none; }
  .fp-editor .fp-mobile-shot { display: grid; flex: 1; margin: 0; max-width: 380px; }
  .fp-editor .fp-mobile-shot > span,.fp-editor .fp-plan-title { display: none; }
  .fp-editor .fp-shot-tab .fp-icon { display: none; }
  .fp-editor .fp-shot-body { grid-template-columns: minmax(0,1fr) 260px; }
  .project-workshop:has(.fp-editor) .project-film-heading { flex-wrap: wrap; gap: 4px 12px; }
}
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .fp-editor { padding: 4px 12px 80px; border-radius: 14px; }
  .fp-editor .fp-toolbar { position: relative; gap: 0; margin-bottom: 10px; }
  .fp-editor .fp-section-tabs { width: 100%; gap: 2px; justify-content: space-between; }
  .fp-editor .fp-section-tab { min-height: 44px; min-width: 44px; font-size: 12px; }
  .fp-editor [data-compact-label] .fp-long-label { display: none; }
  .fp-editor .fp-short-label { display: inline; }
  .fp-editor .fp-tools { width: 100%; margin: 0; justify-content: flex-end; }
  .fp-editor .fp-more-tools { position: static; margin-inline-end: 0; }
  .fp-editor .fp-tools>.fp-film-trigger { margin-inline-end: auto; padding-inline: 0; }
  .fp-editor .fp-tools>[data-save] { flex: 0 1 auto; min-width: 0; }
  .fp-editor .fp-more-items { inset-inline: 0; width: auto; max-width: none; max-height: 55dvh; overflow-y: auto; }
  .fp-editor .fp-tool { min-height: 44px; padding-inline: 4px; font-size: 12px; }
  .fp-editor .fp-tools > [data-save] { max-width: none; }
  .fp-editor .fp-layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .fp-editor .fp-layout > .fp-scenes { display: none; }
  .fp-editor .fp-mobile-shot { display: grid; flex: 1; min-width: 0; margin: 0; }
  .fp-editor .fp-mobile-shot > span,.fp-editor .fp-plan-title,.fp-editor .fp-plan-head > .fp-plan-badge { display: none; }
  .fp-editor .fp-mobile-shot select { width: 100%; min-width: 0; min-height: 44px; height: 44px; padding-inline: 8px 24px; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .fp-editor .fp-inspector { padding: 0; }
  .fp-editor .fp-plan-head { margin-bottom: 10px; gap: 6px; }
  .fp-editor .fp-plan-head .fp-action-row { flex-wrap: nowrap; }
  .fp-editor .fp-plan-head .fp-action-row > .btn { flex: 0 0 44px; width: 44px; padding: 8px; }
  .fp-editor .fp-shot-body { display: flex; flex-direction: column; gap: 0; }
  .fp-editor .fp-editor-column { display: contents; }
  .fp-editor .fp-media-column { display: contents; }
  .fp-editor .fp-image-head { width: 100%; order: 1; }
  .fp-editor .fp-preview { order: 2; }
  .fp-editor .fp-shot-panel { width: 100%; order: 3; }
  .fp-editor .fp-context-controls { width: 100%; order: 4; }
  .fp-editor .fp-plan-context { width: 100%; order: 5; }
  .fp-editor:not([data-shot-view='overview']) .fp-media-column { display: none; }
  .fp-editor .fp-preview { max-height: 220px; min-height: 0; margin: 8px 0 12px; border-radius: 12px; }
  .fp-editor .fp-preview :is(img,video) { max-height: 240px; }
  .fp-editor .fp-shot-tabs { width: 100%; order: 0; margin-bottom: 8px; padding: 3px; gap: 2px; }
  .fp-editor .fp-shot-tabs .fp-shot-tab { flex: 1 0 auto; padding-inline: 7px; font-size: 12px; }
  .fp-editor .fp-shot-tab .fp-icon { display: none; }
  .fp-editor .fp-plan-context { padding-top: 12px; }
  .fp-editor .fp-shot-panel textarea { font-size: 16px; }
  .fp-editor [data-shot-panel='description'] { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .fp-editor [data-shot-panel='description'] > .fp-editable:not(:has([data-film-field='Action'])) .fp-ai-action { position: absolute; margin: 0; }
  .fp-editor .fp-editable .fp-field > span,.fp-editor [data-shot-panel='description'] > .fp-editable:not(:has([data-film-field='Action'])) .fp-field > span { padding-inline-end: 56px; }
  .fp-editor .fp-editable .fp-ai-action { min-width: 48px; font-size: 12px; }
  .fp-editor .fp-shot-panel textarea { min-height: 80px; }
  .project-workshop:has(.fp-editor) .project-film-heading { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin-bottom: 8px; }
  .project-workshop:has(.fp-editor) .project-film-heading .project-workshop-head { display: none; }
  .project-workshop:has(.fp-editor) .project-film-heading .fd-project-bar { grid-column: 1 / -1; margin: 0; padding: 0; }
  .project-workshop:has(.fp-editor) .project-film-heading .fd-path { grid-column: 1 / -1; }
  .project-workshop:has(.fp-editor) .project-film-heading .fd-path > summary { min-height: 44px; padding-block: 10px; }
  .fp-text-comparison,.fp-take-comparison { grid-template-columns: 1fr; }
  .fp-editor .fp-context-controls .fp-scoped-actions .fp-action-row > .btn:first-child { display: inline-flex; }
}

/* Character workspace follows the approved portrait-tab mockup. */
.fp-editor .fp-cast-bulk { display: flex; align-items: center; gap: 18px; margin: 4px 0 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb,var(--surface-solid) 80%,white 3%); }
.fp-editor .fp-cast-bulk > .fp-icon { flex: 0 0 48px; width: 48px; height: 48px; padding: 11px; color: var(--accent); background: color-mix(in srgb,var(--accent) 8%,var(--surface-solid)); border-radius: 50%; }
.fp-cast-bulk-copy { flex: 1; min-width: 0; }
.fp-editor .fp-cast-bulk h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.4; letter-spacing: -.02em; }
.fp-editor .fp-cast-bulk p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.fp-editor .fp-cast-bulk .fp-action-row { flex: 0 0 auto; display: flex; gap: 10px; margin: 0; }
.fp-editor .fp-cast-bulk .btn { width: auto; min-height: 44px; margin: 0; padding: 10px 16px; font-size: 13px; }
.fp-editor .fp-cast-heading { display: flex; align-items: center; gap: 18px; margin: 0 0 12px; }
.fp-editor .fp-cast-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.fp-editor .fp-cast-heading > span { color: var(--muted); font-size: 13px; }
.fp-editor .fp-character-tabs { display: flex; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.fp-editor .fp-character-tab { position: relative; display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-width: 180px; max-width: 280px; min-height: 76px; margin: 0; padding: 12px 18px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: transparent; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.fp-editor .fp-character-tab:hover { background: var(--fp-muted-surface); }
.fp-editor .fp-character-tab[aria-selected='true'] { background: color-mix(in srgb,var(--accent) 6%,var(--surface-solid)); }
.fp-editor .fp-character-tab[aria-selected='true']::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--accent); }
.fp-character-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: var(--fp-muted-surface); color: var(--muted); }
.fp-character-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fp-character-avatar > .fp-icon { width: 26px; height: 26px; flex-basis: 26px; }
.fp-character-caption { display: grid; gap: 5px; min-width: 0; }
.fp-character-caption strong { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-character-caption small { color: var(--muted); font-size: 12px; }
.fp-editor .fp-cast { display: block; }
.fp-editor .fp-character-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: transparent; min-width: 0; scroll-margin-top: 90px; }
.fp-character-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.fp-character-head .fp-character-avatar { width: 54px; height: 54px; flex-basis: 54px; }
.fp-editor .fp-character-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.fp-character-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid color-mix(in srgb,var(--ui-success) 25%,transparent); border-radius: 8px; background: color-mix(in srgb,var(--ui-success) 7%,var(--surface-solid)); color: var(--ui-success); font-size: 12px; }
.fp-character-status .fp-icon { width: 15px; height: 15px; flex-basis: 15px; }
.fp-character-body { display: grid; grid-template-columns: minmax(200px,30%) minmax(0,1fr); gap: 24px; }
.fp-character-identity { min-width: 0; padding-inline-end: 24px; border-inline-end: 1px solid var(--fp-line); }
.fp-editor .fp-character-identity > .fp-field { margin: 0 0 18px; gap: 8px; }
.fp-editor .fp-character-identity .fp-field > span { display: block; min-height: 0; padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.fp-editor .fp-character-identity .fp-editable { margin: 0; padding: 0; border: 0; }
.fp-editor .fp-character-identity textarea { --ui-control-height: 140px; min-height: 140px; resize: vertical; line-height: 1.6; }
.fp-editor .fp-character-identity :is(input,textarea) { border-radius: 10px; background: transparent; border-color: var(--line); }
.fp-editor .fp-character-identity .fp-ai-action { position: static; margin: 6px 0 0; padding-inline: 0; font-size: 13px; }
.fp-character-visuals { min-width: 0; }
.fp-character-visuals>summary { display: none; }
.fp-editor .fp-character-visuals h3 { margin: 0 0 5px; font-size: 17px; }
.fp-editor .fp-character-visuals > .hint { margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.fp-character-views { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.fp-character-view { display: flex; flex-direction: column; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.fp-editor .fp-character-view h4 { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
.fp-editor .fp-character-view > img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 7px; background: var(--fp-muted-surface); }
.fp-editor .fp-character-view .fp-action-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2px; margin: auto 0 0; }
.fp-view-ready { display: inline-flex; gap: 4px; align-items: center; color: var(--ui-success); font-size: 11px; }
.fp-view-ready .fp-icon { width: 14px; height: 14px; flex-basis: 14px; }
.fp-editor .fp-cast-link { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 0; border: 0; border-radius: 6px; background: transparent; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.fp-editor .fp-view-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; aspect-ratio: 1; min-height: 100px; padding: 12px 4px; border: 0; border-radius: 7px; background: var(--fp-muted-surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.fp-editor .fp-view-placeholder > .fp-icon { width: 44px; height: 44px; flex-basis: 44px; color: color-mix(in srgb,var(--muted) 55%,var(--surface-solid)); }
.fp-editor .fp-character-visuals > .btn { margin: 14px 0 0; min-height: 44px; font-size: 13px; }
.fp-character-extras { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 12px; margin-top: 18px; }
.fp-character-references,.fp-character-voice { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fp-character-extras header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fp-editor .fp-character-extras h3 { margin: 0; font-size: 15px; }
.fp-character-extras header>.fp-cast-link { margin-inline-start: auto; padding: 0; }
.fp-editor .fp-character-extras .hint { margin: 4px 0 10px; font-size: 12px; line-height: 1.5; }
.fp-editor .fp-character-refs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 8px; margin-top: 10px; }
.fp-character-refs .fp-ref-item { min-width: 0; }
.fp-editor .fp-character-refs .fp-asset { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; width: auto; border: 0; background: none; }
.fp-editor .fp-character-refs .fp-asset img { width: 100%; height: 94px; object-fit: cover; border-radius: 8px; }
.fp-editor .fp-character-refs .fp-asset strong { display: block; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-ref-primary { position: absolute; inset-inline-start: 5px; top: 65px; max-width: calc(100% - 10px); overflow: hidden; text-overflow: ellipsis; padding: 3px 6px; border-radius: 5px; background: var(--surface-solid); color: var(--accent); font-size: 10px; }
.fp-ref-controls { display: grid; gap: 6px; padding-top: 8px; }
.fp-ref-controls .fp-field { margin: 0; min-width: 0; }
.fp-ref-controls .btn { min-width: 0; min-height: 44px; padding: 7px; font-size: 11px; }
.fp-character-references:not([data-managing=true]) .fp-ref-controls,.fp-character-references:not([data-managing=true]) .fp-ref-item:nth-child(n+4) { display: none; }
.fp-editor .fp-character-refs>.fp-upload { min-width: 0; min-height: 94px; padding: 8px; display: flex; flex-direction: column; gap: 7px; text-align: center; font-size: 12px; color: var(--accent); }
.fp-upload-plus { font-size: 28px; line-height: 1; }
.fp-character-voice header>.fp-icon { width: 22px; height: 22px; color: var(--accent); }
.fp-voice-state { margin-inline-start: auto; font-size: 11px; padding: 4px 7px; border-radius: 6px; background: var(--fp-muted-surface); color: var(--muted); }
.fp-editor .fp-character-voice>.fp-field { margin: 16px 0 8px; }
.fp-character-voice>.fp-field>span { font-size: 12px; }
.fp-character-voice>.fp-field .provider-picker-inline-providers,.fp-character-voice>.fp-field .provider-picker-current { display: none; }
.fp-character-voice small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.fp-character-guidance { padding: 10px 12px 0; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.fp-character-guidance-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fp-character-guidance-head>.fp-icon { width: 20px; height: 20px; color: var(--accent); }
.fp-character-guidance-head>strong { flex: 1; font-size: 12px; }
.fp-character-guidance-head>.fp-cast-link { padding: 0; }
.fp-character-guidance-head>.fp-cast-link:disabled { display: none; }
.fp-character-view-options>summary { display: flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 12px; cursor: pointer; }
.fp-character-view-options .fp-character-advice { margin: 8px 0; padding: 12px; }
@media (max-width:760px) {
  .fp-character-visuals>summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer; font-size: 13px; }
  .fp-character-visuals>summary>span { color: var(--muted); font-size: 12px; }
  .fp-character-visuals>summary::after { content: '›'; font-size: 22px; }
  .fp-character-visuals[open]>summary::after { transform: rotate(90deg); }
  .fp-editor .fp-character-visuals>h3 { display: none; }
  .fp-character-extras { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .fp-character-references,.fp-character-voice { padding: 12px; }
  .fp-editor .fp-character-extras h3 { font-size: 14px; }
  .fp-character-references[data-managing=true] .fp-character-refs { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width:1101px) {
  .fp-editor .fp-character-head { margin-bottom: 14px; }
  .fp-editor .fp-character-identity>.fp-field { margin-bottom: 12px; }
  .fp-editor .fp-character-identity textarea { --ui-control-height: 110px; min-height: 110px; }
  .fp-editor .fp-character-view>img { height: 112px; aspect-ratio: auto; }
  .fp-editor .fp-view-placeholder { height: 112px; min-height: 112px; aspect-ratio: auto; }
  .fp-editor .fp-character-visuals>.hint { margin-bottom: 10px; }
}
.fp-location-workspace { min-width: 0; }
.fp-location-grid { display: block; }
@media (max-width:1100px) {
  .fp-editor .fp-cast-bulk { flex-wrap: wrap; gap: 12px; }
  .fp-editor .fp-cast-bulk .fp-action-row { margin-inline-start: 60px; }
  .fp-character-body { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .fp-character-identity { padding: 0; border: 0; display: grid; grid-template-columns: minmax(140px,1fr) minmax(0,2fr); gap: 18px; align-items: start; }
  .fp-editor .fp-character-identity textarea { --ui-control-height: 90px; min-height: 90px; }
}

/* The same reference workspace is used for characters and film settings. */
.fp-editor .fp-section-number { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-end: 7px; border-radius: 50%; background: var(--fp-muted-surface); color: var(--muted); font-size: 11px; }
.fp-editor .fp-section-tab[aria-selected='true'] .fp-section-number { background: var(--accent); color: var(--on-accent); }
.fp-editor .fp-location-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.fp-location-avatar { border-radius: 10px; }
.fp-editor .fp-location-tab { min-width: 210px; }
.fp-location-visuals { min-width: 0; }
.fp-editor .fp-location-visuals h3 { margin: 0 0 6px; font-size: 17px; }
.fp-editor .fp-location-visuals > .hint { margin: 0 0 14px; font-size: 13px; }
.fp-editor .fp-location-visuals > .btn { margin: 14px 0 10px; }
.fp-location-primary { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.fp-editor .fp-location-primary h4 { margin: 0 0 10px; font-size: 13px; }
.fp-location-primary > img { width: 100%; height: 220px; object-fit: contain; border-radius: 8px; background: var(--fp-muted-surface); }
.fp-location-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; min-height: 170px; border-radius: 8px; background: var(--fp-muted-surface); color: var(--muted); font-size: 13px; }
.fp-location-placeholder .fp-icon { width: 40px; height: 40px; flex-basis: 40px; }
.fp-editor .fp-plan-sequence { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.fp-generation-label { display:block; margin-bottom:8px; font-size:12px; font-weight:650; color:var(--muted); }
.fp-generation-steps { padding-inline-start:22px; line-height:1.8; }
.fp-generation-settings { border-block:1px solid var(--line); margin:16px 0; padding:8px 0; }
.fp-generation-settings>summary { min-height:44px; align-content:center; cursor:pointer; font-weight:600; }
.fp-video-only-actions>summary { min-height:44px; align-content:center; font-size:13px; color:var(--muted); cursor:pointer; }
.fp-editor .fp-preview:not(:has(img,video)) { min-height:112px; aspect-ratio:auto; }
.fp-editor .fp-dialog[data-scoped-production=automatic] .fp-batch-footer .fp-action-row { display:grid!important; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)!important; gap:8px; }
.fp-editor .fp-dialog[data-scoped-production=automatic] .fp-batch-footer .btn { min-width:0; padding:10px 8px; font-size:13px; line-height:1.3; }
.fp-editor .fp-scoped-actions .fp-action-row { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
.fp-editor .fp-scoped-actions .fp-action-row>.btn { width:100%; min-height:44px; margin:0; white-space:normal; }
.fp-editor .fp-scoped-actions .hint { font-size:12px; margin:8px 0; }
@media (max-width:760px), (max-height:500px) and (pointer:coarse) {
  .fp-targeted-dock:not([hidden]) { gap:8px; padding:8px 12px; }
  .fp-targeted-dock>.btn { flex:1 1 0; min-width:0; padding:8px; line-height:1.25; }
  .fp-dialog[data-scoped-production=automatic]>header h2 { font-size:18px; }
  .fp-dialog[data-scoped-production=automatic] .fp-batch-footer { padding:10px 12px; }
  .fp-dialog[data-scoped-production=automatic] .fp-batch-footer .btn { padding:8px; font-size:13px; line-height:1.3; }
  .fp-dialog[data-scoped-production=automatic] .fp-batch-footer .fp-status { font-size:13px; margin-bottom:8px; }
  .fp-editor .fp-section-number { display: none; }
  .fp-editor .fp-location-card { padding: 14px 12px; }
  .fp-editor .fp-location-tab { min-width: 180px; max-width: 230px; }
  .fp-location-primary > img { height: 170px; }
  .fp-location-placeholder { min-height: 140px; }
}
@media (max-width:760px), (max-height:500px) and (pointer:coarse) {
  .fp-editor .fp-cast-bulk { padding: 12px; margin-bottom: 18px; gap: 10px; }
  .fp-editor .fp-cast-bulk > .fp-icon { flex-basis: 36px; width: 36px; height: 36px; padding: 7px; }
  .fp-editor .fp-cast-bulk h2 { font-size: 15px; }
  .fp-editor .fp-cast-bulk p { font-size: 12px; }
  .fp-editor .fp-cast-bulk .fp-action-row { width: 100%; margin: 0; gap: 8px; }
  .fp-editor .fp-cast-bulk .btn { flex: 1; min-width: 0; padding: 8px; font-size: 12px; white-space: normal; }
  .fp-editor .fp-cast-heading { gap: 12px; }
  .fp-editor .fp-cast-heading h2 { font-size: 20px; }
  .fp-editor .fp-character-tab { min-width: 160px; max-width: 230px; min-height: 66px; padding: 10px 12px; gap: 8px; }
  .fp-character-avatar { width: 36px; height: 36px; flex-basis: 36px; }
  .fp-editor .fp-character-card { padding: 14px 12px; }
  .fp-character-head { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 5px 10px; margin-bottom: 18px; }
  .fp-character-head .fp-character-avatar { width: 40px; height: 40px; flex-basis: 40px; grid-row: 1 / span 2; align-self: start; }
  .fp-editor .fp-character-head h2 { min-width: 0; font-size: 19px; }
  .fp-character-status { grid-column: 2; justify-self: start; font-size: 11px; padding: 3px 7px; }
  .fp-character-identity { display: block; }
  .fp-character-views { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fp-editor .fp-character-identity .fp-ai-action { font-size: 13px; }
  .fp-editor .fp-character-identity .fp-long-label { display: inline; }
  .fp-editor .fp-character-identity .fp-short-label { display: none; }
}
