.neo-tool-panel {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid rgba(127, 127, 127, .35);
  border-radius: 14px;
}
.neo-tool-panel h4 { margin: 0 0 8px; }
.neo-tool-panel details { margin: 14px 0; }
.neo-tool-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.neo-tool-filters input { min-width: min(100%, 240px); }
.neo-tool-choices {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 280px; overflow-y: auto;
}
.neo-tool-contract { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: rgba(127,127,127,.09); }
.neo-tool-contract p { margin: 0; overflow-wrap: anywhere; }
.neo-tool-field { display: grid; gap: 4px; min-width: 0; }
.neo-tool-field input, .neo-tool-field select { width: 100%; max-width: 480px; }
.neo-tool-field small { opacity: .7; }
.neo-tool-estimate { margin-top: 16px; }
.studio-chain-source-choice { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
/* Neo Studio Visual V4. Everything is intentionally scoped to Studio. */
[data-neo-visual="v4"] {
  --nv-bg:#07101e;
  --nv-panel:#0d1b2c;
  --nv-raised:#132239;
  --nv-text:#f1f5ff;
  --nv-muted:#b0bfd5;
  --nv-line:#627792;
  --nv-accent:#8298ff;
  --nv-primary:#4658d5;
  --nv-focus:#b8d7ff;
  --nv-success:#a9e4c7;
  --nv-warning:#ffd897;
  --nv-error:#ffb5be;
  --nv-radius:14px;
  color:var(--nv-text);
  font-family:inherit;
  line-height:1.5;
  min-inline-size:0;
}
html:not([data-theme="dark"]) [data-neo-visual="v4"],
[data-theme="light"] [data-neo-visual="v4"] {
  --nv-bg:#f3f6fc;
  --nv-panel:#fff;
  --nv-raised:#e9eff8;
  --nv-text:#142238;
  --nv-muted:#4d6078;
  --nv-line:#71849c;
  --nv-accent:#394caf;
  --nv-primary:#394caf;
  --nv-focus:#284aae;
  --nv-success:#19613e;
  --nv-warning:#79500c;
  --nv-error:#a52b42;
}
[data-neo-visual="v4"] *,
[data-neo-visual="v4"] *::before,
[data-neo-visual="v4"] *::after { box-sizing:border-box; }
[data-neo-visual="v4"] :is(button,input,textarea,select) { font:inherit; }
[data-neo-visual="v4"] :is(button,a,input,textarea,select):focus-visible {
  outline:2px solid var(--nv-focus);
  outline-offset:3px;
}
.studio-panel .studio-primary-toolbar {
  padding-top: 76px;
}
.studio-panel .neo-mode-error:not(:empty) {
  margin: 8px 0;
  color: var(--nv-error);
  font-size: 13px;
}
@media (max-width: 768px) {
  /* The shell and workspace already reserve space below the fixed mobile
     header/menu strip; don't add a second header-sized offset here. */
  .studio-panel .studio-primary-toolbar { padding-top: 0; }
}

/* Guest entry */
[data-neo-visual="v4"].studio-entry-guest {
  min-height:100dvh;
  color:var(--nv-text);
  background:var(--nv-bg) !important;
  isolation:isolate;
}
[data-neo-visual="v4"].studio-entry-guest::before {
  content:"";
  position:absolute;
  z-index:0;
  inset:0 0 auto;
  height:410px;
  pointer-events:none;
  opacity:1;
  background:
    linear-gradient(90deg,#07101e 0%,rgba(7,16,30,.90) 30%,rgba(7,16,30,.34) 54%,rgba(7,16,30,.08) 78%,rgba(7,16,30,.02) 100%),
    url("/assets/neo-studio-v4/backgrounds/home-background-desktop.png") right top/auto 410px no-repeat;
  -webkit-mask-image:linear-gradient(to bottom,#000 0 84%,transparent 100%);
  mask-image:linear-gradient(to bottom,#000 0 84%,transparent 100%);
}
[data-neo-visual="v4"].studio-entry-guest::after { display:none; }
/* Guest entry replaces the authenticated toolbar, rather than hiding its text
   under the cinematic backdrop while retaining a full empty grid row. */
#studioRoot.studio-entry-guest { padding-top:0; }
#studioRoot.studio-entry-guest > .studio-primary-toolbar { display:none; }
html:not([data-theme="dark"]) #studioRoot.studio-entry-guest .studio-entry-label {
  color:var(--nv-text);
  background:var(--nv-bg);
  border-radius:6px;
  padding:4px 6px;
}
[data-neo-visual="v4"] .studio-entry {
  max-width:1180px;
  padding:28px 32px 64px;
  position:relative;
  z-index:1;
}
[data-neo-visual="v4"] .studio-entry-hero {
  min-height:146px;
  max-width:680px;
  margin:0 0 14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
[data-neo-visual="v4"] .studio-entry-hero-mark { display:none; }
[data-neo-visual="v4"] .studio-entry-eyebrow {
  color:#aebeff;
  font-size:11px;
  font-weight:750;
  letter-spacing:.16em;
}
[data-neo-visual="v4"] .studio-entry h1 {
  max-width:18ch;
  margin:7px 0 8px;
  color:#f6f8ff;
  font-family:inherit;
  font-size:clamp(40px,4vw,48px);
  font-weight:720;
  line-height:1.1;
  letter-spacing:-.035em;
}
[data-neo-visual="v4"] .studio-entry-subtitle {
  color:#c2cde0;
  font-size:16px;
}
[data-neo-visual="v4"] .studio-entry-idea-label,
[data-neo-visual="v4"] .studio-entry-direction-label { color:#f1f5ff; }
[data-neo-visual="v4"] .studio-entry-prompt {
  min-height:70px;
  padding:14px 16px;
  border:1px solid var(--nv-line);
  border-radius:12px;
  color:#f1f5ff;
  background:rgba(9,23,43,.88);
  box-shadow:0 14px 34px rgba(0,0,0,.18);
}
[data-neo-visual="v4"] .studio-entry-prompt:focus {
  border-color:var(--nv-focus);
  box-shadow:0 0 0 3px rgba(184,215,255,.18);
}
[data-neo-visual="v4"] .studio-entry-direction-label {
  margin-top:20px;
  font-size:18px;
}
[data-neo-visual="v4"] .studio-entry-tasks {
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
[data-neo-visual="v4"] .studio-entry-task {
  min-height:0;
  overflow:hidden;
  border:1px solid var(--nv-line);
  border-radius:var(--nv-radius);
  color:#f1f5ff;
  background:var(--nv-panel);
  box-shadow:0 10px 26px rgba(0,0,0,.18);
  transform:none;
}
[data-neo-visual="v4"] .studio-entry-task::after { display:none; }
[data-neo-visual="v4"] .studio-entry-task:hover {
  border-color:var(--nv-accent);
  box-shadow:0 12px 30px rgba(0,0,0,.24);
  transform:none;
}
[data-neo-visual="v4"] .studio-entry-task.is-selected {
  border-color:var(--nv-accent);
  box-shadow:0 0 0 2px rgba(130,152,255,.52),0 12px 30px rgba(0,0,0,.24);
}
[data-neo-visual="v4"] .studio-entry-task.is-selected::before {
  content:"✓";
  position:absolute;
  z-index:3;
  top:8px;
  right:8px;
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:50%;
  color:#07101e;
  background:#aebeff;
  font-size:13px;
  font-weight:800;
}
[data-neo-visual="v4"] .studio-entry-task-art {
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:2.1/1;
  background-position:center;
  background-size:cover;
  filter:none;
  transform:none;
}
[data-neo-visual="v4"] .studio-entry-task:hover .studio-entry-task-art {
  filter:none;
  transform:none;
}
[data-neo-visual="v4"] .studio-entry-task-copy {
  position:static;
  display:grid;
  grid-template-columns:20px minmax(0,1fr) 16px;
  gap:9px;
  align-items:center;
  min-height:64px;
  padding:9px 11px;
  background:rgba(7,17,31,.96);
}
[data-neo-visual="v4"] .studio-entry-task-icon {
  position:static;
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border:0;
  border-radius:0;
  background:transparent;
}
[data-neo-visual="v4"] .studio-entry-task-icon img,
[data-neo-visual="v4"] .neo-studio-flow img,
[data-neo-visual="v4"] .neo-workspace-links img {
  display:block;
  width:100%;
  height:100%;
  filter:brightness(0) invert(1);
  opacity:.86;
}
[data-neo-visual="v4"] .studio-entry-task-text,
[data-neo-visual="v4"] .studio-entry-task-text strong,
[data-neo-visual="v4"] .studio-entry-task-text > span { display:block; min-width:0; }
[data-neo-visual="v4"] .studio-entry-task-text strong {
  color:#fff;
  font-size:15px;
  line-height:1.22;
  overflow-wrap:normal;
  word-break:normal;
}
[data-neo-visual="v4"] .studio-entry-task-text > span {
  margin-top:3px;
  color:#b6c4d9;
  font-size:11px;
  line-height:1.25;
}
[data-neo-visual="v4"] .studio-entry-task-arrow {
  position:static;
  color:#aebeff;
  font-size:16px;
}
[data-neo-visual="v4"] .studio-entry-brief {
  max-width:none;
  border-color:var(--nv-line);
  border-radius:var(--nv-radius);
  color:var(--nv-text);
  background:var(--nv-panel);
}
[data-neo-visual="v4"] .studio-entry-selected-description {
  display:none;
  margin:0 0 10px;
  color:var(--nv-muted);
  font-size:13px;
}
[data-neo-visual="v4"] .studio-entry-field input,
[data-neo-visual="v4"] .studio-entry-field textarea,
[data-neo-visual="v4"] .studio-entry-field select {
  border-color:var(--nv-line);
  color:var(--nv-text);
  background:var(--nv-raised);
}
[data-neo-visual="v4"] .studio-entry-actions button { border-radius:9px; }
[data-neo-visual="v4"] .studio-entry-primary {
  color:#fff;
  background:var(--nv-primary);
  box-shadow:none;
}
[data-neo-visual="v4"] .studio-entry-primary:disabled {
  opacity:.6;
  cursor:wait;
}

/* Authenticated production room */
[data-neo-visual="v4"] .neo-studio-workspace {
  display:flex;
  flex-direction:column;
  gap:0;
  padding:22px;
  border:1px solid var(--nv-line);
  border-radius:var(--nv-radius);
  color:var(--nv-text);
  background:
    radial-gradient(760px 300px at 88% -4%,rgba(70,88,213,.20),transparent 68%),
    var(--nv-bg);
}
[data-neo-visual="v4"] .neo-studio-workspace-head { order:1; }
[data-neo-visual="v4"] .neo-studio-flow { order:2; }
[data-neo-visual="v4"] .neo-action-error { order:3; }
[data-neo-visual="v4"] .neo-workspace-links { order:4; }
[data-neo-visual="v4"] .neo-studio-workspace-body { order:5; }
[data-neo-visual="v4"] .neo-studio-workspace-head h2 {
  margin:4px 0 0;
  color:var(--nv-text);
  font-family:inherit;
  font-size:clamp(30px,3vw,36px);
  font-weight:720;
  line-height:1.12;
  letter-spacing:-.025em;
}
[data-neo-visual="v4"] .neo-studio-workspace-head p {
  max-width:760px;
  margin:7px 0 0;
  color:var(--nv-muted);
}
[data-neo-visual="v4"] .neo-workspace-episode,
[data-neo-visual="v4"] .neo-card-kicker,
[data-neo-visual="v4"] .neo-eyebrow {
  color:var(--nv-accent);
}
[data-neo-visual="v4"] .neo-demo-project-badge {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  margin-top:8px;
  padding:3px 8px;
  border:1px solid color-mix(in srgb,var(--nv-accent) 52%,transparent);
  border-radius:999px;
  color:var(--nv-text);
  background:color-mix(in srgb,var(--nv-accent) 12%,transparent);
  font-size:11px;
  font-weight:650;
  letter-spacing:.02em;
}
[data-neo-visual="v4"] .neo-save-state {
  border:1px solid transparent;
}
[data-neo-visual="v4"] .neo-save-state.saved { color:var(--nv-success); }
[data-neo-visual="v4"] .neo-save-state.saving { color:var(--nv-warning); }
[data-neo-visual="v4"] .neo-save-state.conflict { color:var(--nv-error); }
[data-neo-visual="v4"] .neo-studio-flow {
  position:static;
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin:18px 0 14px;
  padding:0 0 8px;
  border-bottom:1px solid var(--nv-line);
  background:transparent;
  backdrop-filter:none;
}
[data-neo-visual="v4"] .neo-studio-flow-arrow { display:none; }
[data-neo-visual="v4"] .neo-studio-flow button {
  display:inline-flex;
  flex:1 1 auto;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:44px;
  padding:8px 10px;
  border:0;
  border-bottom:2px solid transparent;
  color:var(--nv-muted);
  background:transparent;
}
[data-neo-visual="v4"] .neo-studio-flow button img {
  width:18px;
  height:18px;
  filter:brightness(0) invert(1);
}
[data-neo-visual="v4"] .neo-studio-flow button.active {
  border-bottom-color:var(--nv-accent);
  color:var(--nv-text);
}
[data-neo-visual="v4"] .neo-workspace-links {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin:0 0 16px;
  padding:8px;
  border:1px solid var(--nv-line);
  border-radius:10px;
  background:rgba(13,27,44,.78);
}
[data-neo-visual="v4"] .neo-workspace-links > span {
  margin:0 4px;
  color:var(--nv-muted);
}
[data-neo-visual="v4"] .neo-workspace-links button {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:38px;
  border:1px solid var(--nv-line);
  border-radius:8px;
  color:var(--nv-text);
  background:transparent;
}
[data-neo-visual="v4"] .neo-workspace-links button img {
  width:17px;
  height:17px;
}
[data-neo-visual="v4"] .neo-v4-overview {
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(260px,1fr);
  grid-template-areas:"media world" "details world" "story story" "tools tools";
  gap:16px;
  min-width:0;
}
[data-neo-visual="v4"] .neo-v4-media { grid-area:media; min-width:0; margin:0; }
[data-neo-visual="v4"] .neo-overview-preview {
  width:100%;
  min-height:0;
  aspect-ratio:16/9;
  overflow:hidden;
  border:1px solid var(--nv-line);
  border-radius:var(--nv-radius);
  background:#03070d;
}
[data-neo-visual="v4"] .neo-overview-preview img,
[data-neo-visual="v4"] .neo-overview-preview video {
  display:block;
  width:100%;
  height:100%;
  min-height:0;
}
[data-neo-visual="v4"] .neo-overview-image img {
  object-fit:contain;
  object-position:center;
  background:#03070d;
}
[data-neo-visual="v4"] .neo-overview-video video { object-fit:contain; background:#03070d; }
[data-neo-visual="v4"] .neo-overview-audio {
  display:flex;
  align-items:center;
  padding:18px;
}
[data-neo-visual="v4"] .neo-overview-audio audio { width:100%; margin:0; }
[data-neo-visual="v4"] .neo-v4-details {
  grid-area:details;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:10px 2px 0;
  color:var(--nv-muted);
}
[data-neo-visual="v4"] .neo-v4-details strong { color:var(--nv-text); }
[data-neo-visual="v4"] .neo-v4-details small { color:var(--nv-muted); }
[data-neo-visual="v4"] .neo-v4-overview > .neo-workspace-links {
  grid-area:tools;
  margin-bottom:0;
}
[data-neo-visual="v4"] .neo-v4-world {
  grid-area:world;
  min-width:0;
  padding:13px;
  border:1px solid var(--nv-line);
  border-radius:var(--nv-radius);
  background:var(--nv-panel);
}
[data-neo-visual="v4"] .neo-v4-section-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:11px;
}
[data-neo-visual="v4"] .neo-v4-characters {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
[data-neo-visual="v4"] .neo-v4-profile {
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  grid-template-rows:auto auto;
  gap:0 8px;
  min-width:0;
  padding:7px;
  border:1px solid rgba(98,119,146,.55);
  border-radius:10px;
  background:var(--nv-raised);
}
[data-neo-visual="v4"] .neo-v4-profile img,
[data-neo-visual="v4"] .neo-v4-profile-fallback {
  grid-row:1/3;
  display:grid;
  place-items:center;
  width:46px;
  height:58px;
  border-radius:8px;
  object-fit:cover;
  color:var(--nv-text);
  background:#203453;
  font-size:18px;
  font-weight:750;
}
[data-neo-visual="v4"] .neo-v4-profile strong {
  align-self:end;
  overflow:hidden;
  color:var(--nv-text);
  font-size:13px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-neo-visual="v4"] .neo-v4-profile small { color:var(--nv-muted); }
[data-neo-visual="v4"] .neo-v4-location {
  display:grid;
  grid-template-columns:90px minmax(0,1fr);
  align-items:center;
  gap:9px;
  margin-top:10px;
}
[data-neo-visual="v4"] .neo-v4-location > img,
[data-neo-visual="v4"] .neo-v4-location-fallback {
  display:grid;
  place-items:center;
  width:90px;
  height:50px;
  border-radius:8px;
  object-fit:cover;
  background:#203453;
}
[data-neo-visual="v4"] .neo-v4-location-fallback img {
  width:20px;
  height:20px;
  filter:brightness(0) invert(1);
}
[data-neo-visual="v4"] .neo-v4-location strong,
[data-neo-visual="v4"] .neo-v4-location small { display:block; color:var(--nv-text); }
[data-neo-visual="v4"] .neo-v4-location small { color:var(--nv-muted); }
[data-neo-visual="v4"] .neo-v4-style-chip {
  display:inline-block;
  margin-top:10px;
  padding:6px 9px;
  border:1px solid var(--nv-line);
  border-radius:999px;
  color:var(--nv-muted);
  font-size:12px;
}
[data-neo-visual="v4"] .neo-v4-story {
  grid-area:story;
  min-width:0;
  padding:13px;
  border:1px solid var(--nv-line);
  border-radius:var(--nv-radius);
  background:var(--nv-panel);
}
[data-neo-visual="v4"] .neo-overview-strip {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:0;
  overflow:visible;
}
[data-neo-visual="v4"] .neo-overview-frame {
  display:block;
  width:auto;
  min-width:0;
  padding:0;
  border:0;
  color:var(--nv-text);
  background:transparent;
  text-align:left;
  cursor:pointer;
}
[data-neo-visual="v4"] .neo-overview-frame img,
[data-neo-visual="v4"] .neo-overview-frame > span {
  display:grid;
  place-items:center;
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  border-radius:9px;
  object-fit:cover;
  color:var(--nv-muted);
  background:var(--nv-raised);
}
[data-neo-visual="v4"] .neo-overview-frame small {
  display:block;
  margin-top:7px;
  overflow:visible;
  color:var(--nv-muted);
  line-height:1.3;
  text-overflow:clip;
  white-space:normal;
}
[data-neo-visual="v4"] .neo-v4-empty {
  margin:8px 0;
  color:var(--nv-muted);
}
[data-neo-visual="v4"] .neo-frame-strip {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
[data-neo-visual="v4"] .neo-frame-strip > .ws-filter-btn { grid-column:1/-1; justify-self:start; }
[data-neo-visual="v4"] .neo-frame-strip article { width:auto; min-width:0; }
[data-neo-visual="v4"] .neo-frame-preview { height:auto; aspect-ratio:16/9; }

/* Storyboard: the saved frame precedes editing and remains large enough to inspect. */
[data-neo-visual="v4"] .neo-frame-strip {
  margin:14px 0 4px;
  border:0;
  padding:0;
}
[data-neo-visual="v4"] .neo-frame-strip article {
  grid-column:1/-1;
  max-width:720px;
}
[data-neo-visual="v4"] .neo-frame-strip > .ws-filter-btn {
  grid-row:2;
}
[data-neo-visual="v4"] .neo-frame-strip .neo-frame-preview {
  width:100%;
  height:auto;
  max-height:400px;
  aspect-ratio:16/9;
  padding:0;
  overflow:hidden;
}
[data-neo-visual="v4"] .neo-frame-strip .neo-frame-preview img,
[data-neo-visual="v4"] .neo-frame-strip .neo-frame-preview video {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  background:#07101e;
}
/* Older generic rules applied pale ink to white controls and white ink to
   selected shots. Override only Studio, not Portal's shared controls. */
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-scene-picker select,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-shot-form :is(input,textarea),
[data-theme="light"] [data-neo-visual="v4"] .neo-scene-picker select,
[data-theme="light"] [data-neo-visual="v4"] .neo-shot-form :is(input,textarea) {
  color:#172331;
  -webkit-text-fill-color:#172331;
  background:#fff;
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-shot-form label,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-scene-picker label,
[data-theme="light"] [data-neo-visual="v4"] .neo-shot-form label,
[data-theme="light"] [data-neo-visual="v4"] .neo-scene-picker label {
  color:#40516a;
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-shot-list button.active,
[data-theme="light"] [data-neo-visual="v4"] .neo-shot-list button.active {
  color:#172331;
  background:#dce8fb;
  border-color:#5368e8;
}
[data-neo-visual="v4"] .neo-shot-form :is(input,textarea)::placeholder {
  color:#78879a;
  -webkit-text-fill-color:#78879a;
  opacity:1;
}
[data-theme="dark"] [data-neo-visual="v4"] .neo-shot-form :is(input,textarea),
[data-theme="dark"] [data-neo-visual="v4"] .neo-scene-picker select {
  color:#eaf0fb;
  -webkit-text-fill-color:#eaf0fb;
  background:#0d1a2f;
}
[data-theme="dark"] [data-neo-visual="v4"] .neo-shot-form label,
[data-theme="dark"] [data-neo-visual="v4"] .neo-scene-picker label {
  color:#b9c9e3;
}
[data-theme="dark"] [data-neo-visual="v4"] .neo-shot-list button.active {
  color:#f1f5ff;
  background:#213958;
  border-color:#8daeff;
}
[data-theme="dark"] [data-neo-visual="v4"] .neo-shot-form :is(input,textarea)::placeholder {
  color:#91a5c5;
  -webkit-text-fill-color:#91a5c5;
}

html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-task-copy,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-task-copy {
  background:var(--nv-panel);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-prompt,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-prompt {
  border-color:var(--nv-line);
  color:var(--nv-text);
  background:rgba(255,255,255,.94);
  box-shadow:0 14px 34px rgba(20,34,56,.14);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-task-text strong,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-task-text > span,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-task-arrow,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-task-text strong,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-task-text > span,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-task-arrow {
  color:var(--nv-text);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-task-text > span,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-task-text > span {
  color:var(--nv-muted);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-task-icon img,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-task-icon img {
  filter:none;
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-brief-title,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-field label,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-brief-title,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-field label {
  color:var(--nv-text);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-entry-secondary,
[data-theme="light"] [data-neo-visual="v4"] .studio-entry-secondary {
  color:var(--nv-text);
  background:var(--nv-panel);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-studio-workspace,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-v4-world,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-v4-story,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-workspace-links,
[data-theme="light"] [data-neo-visual="v4"] .neo-studio-workspace,
[data-theme="light"] [data-neo-visual="v4"] .neo-v4-world,
[data-theme="light"] [data-neo-visual="v4"] .neo-v4-story,
[data-theme="light"] [data-neo-visual="v4"] .neo-workspace-links {
  color:var(--nv-text);
  background:var(--nv-panel);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-studio-flow button img,
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-workspace-links img,
[data-theme="light"] [data-neo-visual="v4"] .neo-studio-flow button img,
[data-theme="light"] [data-neo-visual="v4"] .neo-workspace-links img {
  filter:none;
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-v4-profile,
[data-theme="light"] [data-neo-visual="v4"] .neo-v4-profile {
  background:var(--nv-raised);
}

@media (max-width:768px) {
  /* A project already has its own identity and workflow navigation. */
  #studioRoot:has(#neoStudioWorkspaceHost .neo-studio-workspace) > .studio-primary-toolbar {
    display:none;
  }
  [data-neo-visual="v4"].studio-entry-guest::before {
    height:430px;
    background:
      linear-gradient(90deg,rgba(7,16,30,.82) 0%,rgba(7,16,30,.52) 48%,rgba(7,16,30,.08) 100%),
      url("/assets/neo-studio-v4/backgrounds/home-background-mobile.png") center top/100% auto no-repeat;
    -webkit-mask-image:linear-gradient(to bottom,#000 0 96%,transparent 100%);
    mask-image:linear-gradient(to bottom,#000 0 96%,transparent 100%);
  }
  [data-neo-visual="v4"] .studio-entry {
    padding:16px 16px 48px;
  }
  [data-neo-visual="v4"] .studio-entry-hero {
    min-height:132px;
    max-width:100%;
    margin-bottom:8px;
  }
  [data-neo-visual="v4"] .studio-entry h1 {
    max-width:17ch;
    font-size:clamp(28px,8vw,32px);
  }
  [data-neo-visual="v4"] .studio-entry-subtitle {
    max-width:26ch;
    font-size:14px;
  }
  [data-neo-visual="v4"] .studio-entry-prompt {
    min-height:80px;
    font-size:16px;
  }
  [data-neo-visual="v4"] .studio-entry-tasks {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  [data-neo-visual="v4"] .studio-entry-task-art { aspect-ratio:1.4/1; }
  [data-neo-visual="v4"] .studio-entry-task-copy {
    grid-template-columns:16px minmax(0,1fr);
    min-height:58px;
    gap:6px;
    padding:8px;
  }
  [data-neo-visual="v4"] .studio-entry-task-icon,
  [data-neo-visual="v4"] .studio-entry-task-icon img {
    width:16px;
    height:16px;
  }
  [data-neo-visual="v4"] .studio-entry-task-text strong {
    font-size:13px;
    line-height:1.25;
  }
  [data-neo-visual="v4"] .studio-entry-task-text > span { display:none; }
  [data-neo-visual="v4"] .studio-entry-selected-description { display:block; }
  [data-neo-visual="v4"] .studio-entry-task-arrow { display:none; }
  [data-neo-visual="v4"] .studio-entry-field input,
  [data-neo-visual="v4"] .studio-entry-field textarea,
  [data-neo-visual="v4"] .studio-entry-field select { font-size:16px; }
  [data-neo-visual="v4"] .neo-studio-workspace { padding:13px; }
  [data-neo-visual="v4"] .neo-studio-workspace-head { order:1; }
  [data-neo-visual="v4"] .neo-studio-flow { order:2; }
  [data-neo-visual="v4"] .neo-studio-workspace-body { order:3; }
  [data-neo-visual="v4"] .neo-workspace-links { order:4; margin:16px 0 0; }
  [data-neo-visual="v4"] .neo-action-error { order:2; }
  [data-neo-visual="v4"] .neo-studio-workspace-head {
    flex-direction:column;
    gap:8px;
  }
  [data-neo-visual="v4"] .neo-studio-workspace-head h2 { font-size:30px; }
  [data-neo-visual="v4"] .neo-studio-flow {
    margin:12px -13px 12px;
    padding:5px 13px 8px;
  }
  [data-neo-visual="v4"] .neo-studio-flow button {
    flex:1 1 calc(33.333% - 6px);
    min-width:0;
    padding:6px 4px;
    font-size:11px;
    line-height:1.2;
  }
  [data-neo-visual="v4"] .neo-studio-flow button img {
    width:16px;
    height:16px;
  }
  [data-neo-visual="v4"] .neo-v4-overview {
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"media" "story" "world" "tools" "details";
  }
  [data-neo-visual="v4"] .neo-overview-strip {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  [data-neo-visual="v4"] .neo-workspace-links > span { flex:1 0 100%; }
  [data-neo-visual="v4"] .neo-workspace-links button {
    flex:1 1 calc(50% - 8px);
    min-height:44px;
  }
  [data-neo-visual="v4"] .neo-frame-strip {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:700px) {
  html[data-theme="dark"] body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle {
    color:#f4f7ff;
    background:rgba(10,24,44,.92);
    border-color:rgba(184,215,255,.34);
  }
  html[data-theme="dark"] body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle:hover,
  html[data-theme="dark"] body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle.active {
    color:#b8d7ff;
    border-color:rgba(184,215,255,.62);
  }
  html[data-theme="dark"] body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle:focus,
  html[data-theme="dark"] body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle:focus-visible {
    outline:3px solid #b8d7ff;
    outline-offset:2px;
  }
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle {
    color:#172238;
    background:rgba(255,255,255,.94);
    border-color:rgba(23,34,56,.34);
  }
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle:hover,
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle.active {
    color:#263e92;
    border-color:rgba(38,62,146,.56);
  }
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle:focus,
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle:focus-visible {
    outline:3px solid #263e92;
    outline-offset:2px;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"]) .mobile-menu-toggle svg {
    stroke:currentColor;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"].studio-entry-guest) .neo-ecosystem-mobile-home-link {
    color:#f4f7ff;
    text-shadow:0 1px 3px rgba(0,0,0,.85);
  }
  body:has(#studio.panel.active [data-neo-visual="v4"].studio-entry-guest) .neo-ecosystem-mobile-home-link:hover {
    color:#b8d7ff;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"].studio-entry-guest) .neo-ecosystem-mobile-home-link:focus-visible {
    outline-color:#b8d7ff;
  }
}

@media (max-width:340px) {
  [data-neo-visual="v4"] .studio-entry-tasks { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion:reduce) {
  [data-neo-visual="v4"] .studio-entry-task,
  [data-neo-visual="v4"] .studio-entry-task-art,
  [data-neo-visual="v4"] .neo-studio-workspace button { transition:none; }
}

/* Final production-room pass.  Keep this file Studio-scoped: the Portal's
   ecosystem header and brand remain untouched everywhere else. */
[data-neo-visual="v4"] .neo-studio-workspace {
  max-width: 100%;
  padding: 18px;
  border-color: color-mix(in srgb, var(--nv-line) 78%, transparent);
}
[data-neo-visual="v4"] .neo-studio-workspace-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
[data-neo-visual="v4"] .neo-studio-workspace-head p {
  margin-bottom:0;
  line-height:1.45;
}
[data-neo-visual="v4"] .neo-studio-flow {
  margin-top:12px;
  margin-bottom:12px;
}
[data-neo-visual="v4"] .neo-v4-world {
  min-height:100%;
}
[data-neo-visual="v4"] .neo-v4-characters {
  align-items:stretch;
}
[data-neo-visual="v4"] .neo-v4-profile {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:5px;
  padding:8px;
}
[data-neo-visual="v4"] .neo-v4-profile img,
[data-neo-visual="v4"] .neo-v4-profile-fallback {
  grid-row:auto;
  width:100%;
  height:auto;
  aspect-ratio:3 / 4;
  min-height:104px;
  border-radius:8px;
}
[data-neo-visual="v4"] .neo-v4-profile strong {
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  line-height:1.25;
}
[data-neo-visual="v4"] .neo-v4-profile small {
  line-height:1.2;
}
[data-neo-visual="v4"] .neo-v4-location > img,
[data-neo-visual="v4"] .neo-v4-location-fallback {
  width:106px;
  height:66px;
}
[data-neo-visual="v4"] .neo-overview-frame small {
  min-height:2.6em;
  font-size:12px;
}

/* The theme toggle uses the absence of data-theme for light mode and the
   literal "dark" value for dark mode.  The contrast correction is scoped to
   the active Studio panel only. */
@media (max-width:700px) {
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .neo-ecosystem-mobile-home-link {
    color:#172238;
    text-shadow:0 1px 3px rgba(255,255,255,.9);
  }
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) .neo-ecosystem-mobile-home-link:hover {
    color:#263e92;
  }
  [data-neo-visual="v4"] .neo-studio-flow {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:4px;
    margin:7px 0 9px;
    padding:0 0 7px;
  }
  [data-neo-visual="v4"] .neo-studio-flow button {
    min-width:0;
    min-height:44px;
    padding:5px 3px;
    border:1px solid color-mix(in srgb, var(--nv-line) 68%, transparent);
    border-radius:8px;
    font-size:10.5px;
  }
  [data-neo-visual="v4"] .neo-studio-flow button.active {
    border-color:var(--nv-accent);
    background:color-mix(in srgb, var(--nv-accent) 12%, transparent);
  }
  [data-neo-visual="v4"] .neo-studio-flow-arrow {
    display:none;
  }
  [data-neo-visual="v4"] .neo-studio-workspace {
    padding:10px;
  }
  [data-neo-visual="v4"] .neo-studio-workspace-head {
    position:relative;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
  }
  [data-neo-visual="v4"] .neo-studio-workspace-head > div {
    min-width:0;
    padding-right:52px;
  }
  [data-neo-visual="v4"] .neo-eyebrow {
    max-width:none;
    white-space:nowrap;
    font-size:9px;
    letter-spacing:.1em;
  }
  [data-neo-visual="v4"] .neo-studio-workspace-head h2 {
    margin-top:2px;
    font-size:25px;
  }
  [data-neo-visual="v4"] .neo-studio-workspace-head p {
    display:-webkit-box;
    margin-top:4px;
    overflow:hidden;
    font-size:12px;
    line-height:1.35;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  [data-neo-visual="v4"] .neo-save-state {
    position:static;
    align-self:flex-start;
    max-width:100%;
    min-height:24px;
    padding:5px 6px;
    font-size:10px;
    line-height:1.2;
    overflow-wrap:anywhere;
    text-align:left;
  }
  [data-neo-visual="v4"] .neo-demo-project-badge {
    display:inline-flex;
    min-height:20px;
    margin:2px 0 0 6px;
    padding:2px 7px;
    font-size:10px;
  }
  [data-neo-visual="v4"] .neo-workspace-episode {
    display:inline-flex;
    font-size:11px;
  }
  [data-neo-visual="v4"] .neo-v4-overview {
    gap:10px;
  }
  [data-neo-visual="v4"] .neo-v4-details {
    padding-top:7px;
  }
  [data-neo-visual="v4"] .neo-v4-profile img,
  [data-neo-visual="v4"] .neo-v4-profile-fallback {
    min-height:120px;
  }
}

@media (min-width:769px) {
  [data-neo-visual="v4"] .neo-overview-preview {
    height:clamp(260px,19.8vw,285px);
    aspect-ratio:2.55 / 1;
  }
  [data-neo-visual="v4"] .neo-studio-workspace-head p {
    margin-top:4px;
  }
  [data-neo-visual="v4"] .neo-workspace-links {
    margin-bottom:10px;
    padding:6px;
  }
  [data-neo-visual="v4"] .neo-v4-profile img,
  [data-neo-visual="v4"] .neo-v4-profile-fallback {
    min-height:0;
    height:clamp(112px,11vw,154px);
    aspect-ratio:auto;
    object-fit:cover;
    object-position:center 22%;
  }
}
/* Persisted I2V / TTS controls: dense production instrumentation. */
[data-neo-visual="v4"] .neo-media-card{margin-top:14px;padding:14px;border:1px solid var(--nv-line);border-radius:var(--nv-radius);background:var(--nv-panel);min-width:0}
[data-neo-visual="v4"] .neo-media-picker{margin-top:12px;padding:10px;border:1px solid color-mix(in srgb,var(--nv-line) 72%,transparent);border-radius:10px;background:var(--nv-raised);min-width:0}
[data-neo-visual="v4"] .neo-media-picker-head{display:flex;justify-content:space-between;gap:8px;align-items:center;color:var(--nv-text);font-size:12px}
[data-neo-visual="v4"] .neo-media-picker select,[data-neo-visual="v4"] .neo-media-params select,[data-neo-visual="v4"] .neo-media-params input{width:100%;min-width:0;padding:7px;border:1px solid var(--nv-line);border-radius:7px;color:var(--nv-text);background:var(--nv-panel)}
[data-neo-visual="v4"] .neo-media-picker select{margin-bottom:7px}
[data-neo-visual="v4"] .neo-media-loading{color:var(--nv-muted);font-size:11px}
[data-neo-visual="v4"] .neo-media-reason,[data-neo-visual="v4"] .neo-media-result-note{margin-top:7px;color:var(--nv-muted);font-size:12px;overflow-wrap:anywhere}
[data-neo-visual="v4"] .neo-media-all-tools summary,[data-neo-visual="v4"] .neo-media-unavailable summary{color:var(--nv-accent);cursor:pointer;font-size:11px}
[data-neo-visual="v4"] .neo-media-all-tools>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
[data-neo-visual="v4"] .neo-media-all-tools button{max-width:100%;padding:5px 7px;border:1px solid var(--nv-line);border-radius:6px;color:var(--nv-text);background:transparent;overflow-wrap:anywhere;text-align:left}
[data-neo-visual="v4"] .neo-media-all-tools button.is-selected{border-color:var(--nv-accent);background:color-mix(in srgb,var(--nv-accent) 15%,transparent)}
[data-neo-visual="v4"] .neo-media-unavailable{margin-top:7px;color:var(--nv-muted);font-size:11px}
[data-neo-visual="v4"] .neo-media-unavailable ul{margin:5px 0 0 17px;padding:0}
[data-neo-visual="v4"] .neo-media-params{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin-top:10px}
[data-neo-visual="v4"] .neo-media-params>strong{grid-column:1/-1;color:var(--nv-text);font-size:12px}
[data-neo-visual="v4"] .neo-media-params label{display:grid;gap:4px;color:var(--nv-muted);font-size:11px;min-width:0}
[data-neo-visual="v4"] .neo-media-param-value{display:block;min-height:32px;padding:7px;border:1px solid color-mix(in srgb,var(--nv-line) 65%,transparent);border-radius:7px;color:var(--nv-text);background:var(--nv-panel);overflow-wrap:anywhere}
[data-neo-visual="v4"] .neo-media-warning{margin-top:8px;padding:7px 9px;border-left:3px solid var(--nv-warning);color:var(--nv-warning);font-size:11px;overflow-wrap:anywhere}
[data-neo-visual="v4"] .neo-media-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
[data-neo-visual="v4"] .neo-media-head h3{margin:2px 0 0;color:var(--nv-text);font-size:18px;line-height:1.2}
[data-neo-visual="v4"] .neo-media-status{padding:3px 8px;border:1px solid var(--nv-line);border-radius:999px;color:var(--nv-muted);font-size:11px;text-transform:capitalize;white-space:nowrap}
[data-neo-visual="v4"] .neo-media-source{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;align-items:center;padding:9px;border:1px solid color-mix(in srgb,var(--nv-line) 72%,transparent);border-radius:10px;background:var(--nv-raised)}
[data-neo-visual="v4"] .neo-media-source img{width:112px;height:68px;object-fit:cover;border-radius:7px;background:#091222}
[data-neo-visual="v4"] .neo-media-source strong,[data-neo-visual="v4"] .neo-media-source span,[data-neo-visual="v4"] .neo-media-source small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-neo-visual="v4"] .neo-media-source span{color:var(--nv-text);font-size:13px}.neo-media-source small{color:var(--nv-muted);font-size:11px}
[data-neo-visual="v4"] .neo-media-specs{display:flex;flex-wrap:wrap;gap:6px;margin:11px 0}.neo-media-specs span{padding:6px 8px;border:1px solid color-mix(in srgb,var(--nv-line) 65%,transparent);border-radius:7px;color:var(--nv-muted);font-size:11px}.neo-media-specs b{color:var(--nv-muted);font-weight:600}.neo-media-specs em{color:var(--nv-text);font-style:normal}
[data-neo-visual="v4"] .neo-media-quote{display:flex;justify-content:space-between;gap:12px;padding:9px 10px;margin:10px 0;border-left:3px solid var(--nv-accent);background:color-mix(in srgb,var(--nv-accent) 9%,transparent);font-size:12px}.neo-media-quote strong{color:var(--nv-text)}
[data-neo-visual="v4"] .neo-media-actions{display:flex;flex-wrap:wrap;gap:8px}.neo-media-actions button:disabled{opacity:.5;cursor:not-allowed}.neo-media-error{margin:10px 0;padding:8px 10px;border:1px solid var(--nv-error);border-radius:7px;color:var(--nv-error);font-size:12px}
[data-neo-visual="v4"] .neo-media-label{display:block;margin:8px 0 5px;color:var(--nv-muted);font-size:12px;font-weight:650}.neo-media-card textarea{display:block;width:100%;min-height:76px;resize:vertical;padding:9px;border:1px solid var(--nv-line);border-radius:8px;color:var(--nv-text);background:var(--nv-raised)}.neo-media-counter{text-align:right;color:var(--nv-muted);font-size:11px;margin-top:3px}

/* Authenticated Studio Home: keep controls, search, and direction states legible. */
#studioRoot > .studio-primary-toolbar {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(160px,220px) max-content;
  align-items:center;
  column-gap:16px;
  row-gap:10px;
  padding-bottom:16px;
}
#studioRoot > .studio-primary-toolbar .studio-heading { min-width:0; }
#studioRoot > .studio-primary-toolbar .studio-heading-description {
  max-width:680px;
  color:var(--neo-muted);
  font-size:13px;
  line-height:1.45;
}
#studioRoot #studioProjectSelect { width:100%; min-width:0; }
#studioRoot > .studio-archive-search-toolbar {
  margin:0;
  padding:0 28px 12px;
  border-bottom:1px solid var(--neo-line);
}
#studioRoot > .studio-archive-search-toolbar .ws-search-wrap {
  width:100%;
  max-width:620px;
  min-width:0;
}
#studioRoot #studioArchiveSearchInput { width:100%; min-width:0; }
#studioRoot .neo-direction-card.is-selected {
  border-color:#9db3ff;
  box-shadow:0 0 0 2px rgba(157,179,255,.42),0 14px 30px rgba(14,27,53,.24);
}
/* The approved direction artwork keeps its dark overlay in both themes.
   Shared light-theme typography must not turn these labels dark. */
#studioRoot .studio-start-here h3,
#studioRoot .neo-direction-copy strong {
  color:#f1f5ff !important;
}
html[data-theme="light"] #studioRoot #studioProjectSelect,
html[data-theme="light"] #studioRoot #studioArchiveSearchInput {
  color:#172235 !important;
  background:#edf2f8 !important;
  border-color:#71849c;
}
html[data-theme="light"] #studioRoot #studioArchiveSearchInput::placeholder {
  color:#4d6078;
  opacity:1;
}
@media (min-width:769px) {
  body:has(#studio.panel.active) #studioRoot > .studio-primary-toolbar {
    /* The shared account avatar floats over the far-right of both the
       project workspace and the start-here screen. Keep the CTA clear. */
    padding-inline-end:190px;
  }
}
#studioRoot .neo-direction-availability {
  color:#ffe2a8;
  font-weight:650;
}
#studioRoot .neo-direction-availability[hidden] { display:none; }
#studioRoot .neo-mode-brief {
  margin:18px 0 26px;
  padding:18px;
  border:1px solid var(--neo-line);
  border-radius:14px;
  background:var(--neo-paper);
  color:var(--neo-ink);
}
#studioRoot .neo-mode-brief h4 {
  margin:0 0 12px;
  color:var(--neo-ink);
  font:700 20px/1.2 Georgia,'Times New Roman',serif;
}
#studioRoot .neo-mode-brief .studio-entry-field label { color:var(--neo-ink); }
#studioRoot .neo-mode-brief .studio-entry-field input,
#studioRoot .neo-mode-brief .studio-entry-field textarea,
#studioRoot .neo-mode-brief .studio-entry-field select {
  border-color:var(--neo-line);
  background:var(--neo-paper);
  color:var(--neo-ink);
}
#studioRoot .neo-mode-brief #studioAnimationPicker select {
  border-color:var(--neo-line);
  background:var(--neo-paper);
  color:var(--neo-ink);
}
#studioRoot .neo-mode-brief .studio-entry-field input::placeholder,
#studioRoot .neo-mode-brief .studio-entry-field textarea::placeholder { color:var(--neo-muted); }
#studioRoot .neo-mode-availability {
  margin:12px 0 8px;
  padding:10px 12px;
  border-left:3px solid var(--neo-blue);
  background:color-mix(in srgb,var(--neo-blue) 9%,transparent);
  color:var(--neo-ink);
  font-size:13px;
  line-height:1.5;
}
#studioRoot .neo-mode-free-note {
  margin:8px 0 14px;
  color:var(--neo-muted);
  font-size:12px;
  line-height:1.5;
}
#studioRoot .neo-mode-create { min-height:42px; }
@media (max-width:1000px) {
  #studioRoot > .studio-primary-toolbar { grid-template-columns:minmax(0,1fr) max-content; }
  #studioRoot > .studio-primary-toolbar .studio-heading { grid-column:1/-1; }
  #studioRoot #studioProjectSelect { max-width:220px; }
}
@media (max-width:768px) {
  #studioRoot > .studio-primary-toolbar { padding-inline:16px; }
  #studioRoot > .studio-archive-search-toolbar { padding-inline:16px; }
  #studioRoot > .studio-archive-search-toolbar .ws-search-wrap { max-width:none; }
}
@media (max-width:540px) {
  #studioRoot > .studio-primary-toolbar { grid-template-columns:minmax(0,1fr); }
  #studioRoot > .studio-primary-toolbar .studio-heading { grid-column:auto; }
  #studioRoot #studioProjectSelect { max-width:none; }
  #studioRoot > .studio-primary-toolbar .studio-new-project-btn { width:100%; justify-content:center; }
}
@media(max-width:390px){[data-neo-visual="v4"] .neo-media-source{grid-template-columns:82px minmax(0,1fr)}[data-neo-visual="v4"] .neo-media-source img{width:82px;height:58px}[data-neo-visual="v4"] .neo-media-actions button{flex:1 1 100%}[data-neo-visual="v4"] .neo-media-head h3{font-size:16px}}

/* Small, native controls for the saved local assembly contract. */
[data-neo-visual="v4"] .neo-edit-help {
  margin:6px 0 10px;
  color:var(--nv-muted);
  font-size:12px;
  line-height:1.45;
}
[data-neo-visual="v4"] .neo-edit-toggle {
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  align-items:start;
  gap:4px 8px;
  margin:8px 0 12px;
  color:var(--nv-text);
  line-height:1.4;
}
[data-neo-visual="v4"] .neo-edit-toggle input { grid-row:1/3; margin:3px 0 0; }
[data-neo-visual="v4"] .neo-edit-toggle small {
  display:block;
  color:var(--nv-muted);
  font-size:12px;
}

/* The shared account header is also used on non-Studio Portal surfaces.
   Reserve the real hamburger width and theme the guest brand only while
   Studio is active; never restyle the Portal, Business, or Academy header. */
@media (max-width:768px) {
  body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar {
    left:62px;
    right:8px;
  }
}
/* At phone widths the shared header's leading group has min-width:max-content
   while its controls are unshrinkable. Keeping both on one row makes their
   combined intrinsic width spill left of #profileTopBar and under the fixed
   hamburger (the 375/390px screenshots show this despite the parent's left
   offset). Stack brand and controls into separate rows for Studio only. */
@media (max-width:430px) {
  body:has(#studio.panel.active [data-neo-visual="v4"]) #neoAgentFloat {
    top:104px;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar > [data-neo-unified-header] {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto;
    align-items:start;
    gap:4px;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar .neo-unified-header {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto;
    align-content:start;
    justify-content:stretch;
    gap:4px 0;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar .neo-unified-leading {
    grid-column:1;
    grid-row:1;
    width:100%;
    min-width:0;
    flex:0 1 auto;
    justify-content:flex-start;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar .neo-unified-controls {
    grid-column:1;
    grid-row:2;
    width:100%;
    min-width:0;
    justify-content:flex-end;
  }
  body:has(#studio.panel.active [data-neo-visual="v4"]) .main-content {
    padding-top:76px !important;
  }
}
html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"].studio-entry-guest) #profileTopBar .neo-unified-brand,
[data-theme="light"] body:has(#studio.panel.active [data-neo-visual="v4"].studio-entry-guest) #profileTopBar .neo-unified-brand {
  min-height:36px;
  padding:4px 8px;
  border:1px solid rgba(23,34,56,.28);
  border-radius:9px;
  color:#172238;
  background:rgba(255,255,255,.96);
}
html[data-theme="dark"] body:has(#studio.panel.active [data-neo-visual="v4"].studio-entry-guest) #profileTopBar .neo-unified-brand {
  min-height:36px;
  padding:4px 8px;
  border:1px solid rgba(184,215,255,.34);
  border-radius:9px;
  color:#f4f7ff;
  background:rgba(10,24,44,.94);
}
@media (min-width:701px) {
  html:not([data-theme="dark"]) body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar .neo-unified-brand,
  [data-theme="light"] body:has(#studio.panel.active [data-neo-visual="v4"]) #profileTopBar .neo-unified-brand {
    min-height:36px;
    padding:4px 8px;
    border:1px solid rgba(23,34,56,.28);
    border-radius:9px;
    color:#172238;
    background:rgba(255,255,255,.96);
  }
}
