.live-studio {
  --studio-edge: clamp(16px, 3vw, 44px);
  --studio-gap: clamp(12px, 2vw, 24px);
  margin: 0;
  min-height: 100svh;
}
.live-studio > header:empty { display: none; }
.live-studio[data-studio-loading] > :not(.fauna-app-header) { visibility: hidden; }
.live-studio[data-studio-load-error] #studio-status { visibility: visible; }

.studio-tools, #world-grid, #world-detail, #preserved-previews {
  box-sizing: border-box;
  width: min(100%, 1420px);
  margin-inline: auto;
  padding-inline: var(--studio-edge);
}
.studio-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-block: 24px 16px;
}
.live-studio:has(#world-detail:not([hidden])) .studio-tools { padding-block: 14px 12px; }
.studio-tools h1 {
  margin: 0;
  font: 400 clamp(32px, 4vw, 50px)/1.06 var(--fauna-display, Baskerville, Georgia, serif);
  letter-spacing: -.025em;
}
#studio-status { flex: 1; color: var(--muted); font-size: 13px; }
#studio-status:empty { display: none; }
.studio-tools #studio-commissions { margin-inline-start: auto; }
#world-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--studio-gap);
  padding-block: 8px 32px;
}
.world-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-align: start;
  border: 1px solid var(--line);
  border-radius: var(--fauna-card-radius, 18px);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  box-shadow: var(--fauna-card-shadow, none);
}
button.world-card { width: 100%; }
button.world-card:hover { border-color: var(--green); }
.world-card-copy { display: grid; gap: 6px; padding: 16px 20px; }
.world-card-title { font: 400 clamp(21px, 2.4vw, 30px)/1.15 var(--fauna-display, Georgia, serif); }
.world-card-credit { color: var(--muted); font-size: 13px; }
.world-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--wash);
  color: var(--muted);
}
.world-media[data-revision=""] {
  aspect-ratio: auto;
  min-height: clamp(108px, 14vw, 172px);
  padding: 16px;
  text-align: center;
  font-size: 14px;
}
.world-media iframe { display: block; width: 100%; height: 100%; border: 0; }
.world-card .world-media iframe { pointer-events: none; }
.empty-slot { align-items: flex-start; justify-content: center; min-height: 130px; padding: 18px 20px; background: #edf0e8; box-shadow: none; }
.empty-slot h2 { margin: 0 0 8px; font: 400 23px/1.2 var(--fauna-display, Georgia, serif); }
.empty-slot a { color: var(--green); font-size: 14px; }

#world-detail { padding-block-end: 24px; }
.studio-detail-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-block: 2px 20px;
}
#detail-credit {
  margin: 7px 0 0;
  color: var(--muted);
  font: 600 14px/1.3 system-ui, sans-serif;
  letter-spacing: .025em;
}
#detail-title {
  margin: 0;
  font: italic 400 clamp(27px, 3.45vw, 41px)/1.1 var(--fauna-display, Baskerville, Georgia, serif);
  letter-spacing: -.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
#detail-title:focus { outline: none; }
.studio-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
#detail-options { position: relative; margin: 0; padding: 0; border: 0; }
#detail-options > summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--green);
  font: 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
#detail-options > summary::-webkit-details-marker { display: none; }
#detail-options[open] .studio-options-menu {
  position: absolute;
  z-index: 2;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  background: var(--white);
  width: min(18rem, 82vw);
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  display: grid;
  gap: .6rem;
}
.studio-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--studio-gap);
}
.studio-artwork, #studio-chat-panel { min-width: 0; }
#detail-preview {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--fauna-card-shadow, none);
}
#detail-preview[data-immersive] {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #172820;
}
#detail-preview[data-immersive]::backdrop { background: #172820; }
#detail-preview[data-immersive] #detail-media {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}
#studio-enter-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #fffefb;
}
#studio-enter-scene > span, #studio-exit-scene, #scene-direct {
  position: absolute;
  inset-block-start: max(12px, env(safe-area-inset-top));
  inset-inline-start: max(12px, env(safe-area-inset-left));
  padding: 8px 12px;
  border: 1px solid #ffffff55;
  border-radius: 99px;
  background: #172820ec;
  color: #fffefb;
  font: 600 13px/1.3 system-ui, sans-serif;
}
#studio-enter-scene:hover > span, #studio-enter-scene:focus-visible > span, #studio-exit-scene:hover {
  background: #305642;
}
#studio-enter-scene:focus-visible { outline-offset: -4px; }
#scene-direct { inset-inline-start: auto; inset-inline-end: max(12px, env(safe-area-inset-right)); }
#detail-preview:not([data-immersive]) #scene-direct { display: none; }
#studio-exit-scene span { margin-inline-start: 4px; }
.studio-stage #detail-media:not([data-revision=""]) {
  max-height: max(260px, calc(100svh - 230px));
}
.studio-notes { margin-block: 20px 14px; }
.studio-notes h2 { margin: 0 0 10px; font: 400 25px/1.2 var(--fauna-display, Georgia, serif); }
.studio-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}
.studio-note {
  min-width: 0;
  padding: 13px 16px;
  border: 1px solid #20372c13;
  border-radius: 14px;
  background: #f0ece5;
  color: #574e41;
  font-size: 13px;
}
.studio-note-preview { background: #e9eafa; color: #423b68; }
.studio-note[data-tone="studio"] { background: #e4efe2; color: #2c513c; }
.studio-note[data-tone="waiting"] { background: #f8ecd9; color: #71491b; }
.studio-note p { margin: 4px 0 0; overflow-wrap: anywhere; }
#detail-update time { font-variant-numeric: tabular-nums; }
.studio-replies { margin-block: 19px 0; }
.studio-replies h2 { margin: 0 0 10px; font: 400 23px/1.2 var(--fauna-display, Georgia, serif); }
.studio-replies h3 { margin: 16px 0 8px; font: 400 20px/1.2 var(--fauna-display, Georgia, serif); }
.studio-reply-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.studio-reply-grid button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  text-align: start;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font: 600 13px/1.25 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.studio-reply-grid button:hover:not(:disabled) { border-color: var(--green); background: var(--wash); }
.studio-reply-grid-long button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  background: #fff;
}
.studio-reply-expands {
  border-radius: 99px;
  padding: 2px 6px;
  background: #dce7d7;
  color: #355244;
  font: 650 10px/1.2 system-ui, sans-serif;
}
#studio-source {
  width: min(1080px, calc(100vw - 28px));
  max-height: min(88svh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 64px #13271e38;
}
#studio-source::backdrop { background: #162c23a0; }
.studio-source-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
}
.studio-source-heading h2 { margin: 0; font: 400 25px/1.05 var(--fauna-display, Georgia, serif); }
.studio-source-heading p { margin: 4px 0 0; color: var(--muted); font: 12px/1.2 ui-monospace, monospace; }
#studio-source-status { margin: 0; padding: 10px 16px 18px; color: var(--muted); font-size: 14px; }
#studio-source-status:empty { display: none; }
#studio-source-body {
  max-height: calc(88svh - 76px);
  overflow: auto;
  margin: 0;
  padding: clamp(12px, 2vw, 22px);
  background: #1e2c25;
  color: #f2f3e9;
  font: 12px/1.65 ui-monospace, Menlo, monospace;
  tab-size: 4;
}
#studio-source-body code { font: inherit; }
#studio-chat-panel {
  margin-block: var(--studio-gap);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--fauna-card-shadow, none);
}
.studio-chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.studio-chat-heading h2 { margin: 0; font: 400 19px/1.2 Georgia, serif; }
#artist-chat {
  display: block;
  width: 100%;
  height: clamp(480px, calc(100svh - 220px), 850px);
  border: 0;
  background: var(--white);
}
#artist-chat[hidden] { display: none; }
.studio-chat-access { margin: 12px 14px; }

#commission-choice {
  width: min(760px, calc(100% - 2 * var(--studio-edge)));
  margin: 8px auto 20px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
#choice-title { margin-block-start: 0; }
#choice-brief, #choice-status { color: var(--muted); }
#choice-status:empty { display: none; }
#commission-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
#commission-form label { display: grid; gap: 6px; min-width: min(190px, 100%); }
#commission-artist { font: inherit; min-height: 44px; padding: 8px; max-width: 100%; }

@media (max-width: 760px) {
  .studio-reply-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #artist-chat { height: max(420px, 67svh); }
}
@media (max-width: 440px) {
  #world-grid { grid-template-columns: minmax(0, 1fr); }
  .studio-tools { padding-block-start: 14px; }
  .studio-tools #studio-commissions { margin-inline-start: 0; }
}

#studio-artist-note { text-align: start; }
#studio-artist-detail:not([hidden]) { display: block; margin-top: 4px; overflow-wrap: anywhere; }

#palette { margin: 1rem 0; }
#palette summary, #palette button { cursor: pointer; }
#palette textarea { display: block; width: 100%; height: 10em; font: 14px/1.5 monospace; margin: .4rem 0; }
#metrics { display: block; margin: .5rem 0; font-variant-numeric: tabular-nums; }
#shader-status { white-space: pre-wrap; }

#studio-quick-sends button { display:inline-flex; align-items:center; gap:.9rem; margin-top:.5rem; padding:.65rem 1rem; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); min-height:44px; }
#studio-quick-sends button small { font:600 .75rem system-ui,sans-serif; }

#studio-quick-sends { display:flex; flex-wrap:wrap; gap:.5rem; }
#studio-quick-sends button { text-align:start; white-space:normal; }
#studio-quick-sends small { white-space:nowrap; }

#hotel-visit:not([hidden]) { box-sizing:border-box; display:flex; align-items:center; justify-content:space-between; gap:16px; width:min(100%,1420px); margin:0 auto; padding:0 var(--studio-edge) 32px; }
.live-studio:has(#world-detail:not([hidden])) #hotel-visit { display:none; }
#hotel-visit h2, #hotel-room h2, #preserved-previews-title, #preserved-preview-title { margin:0; font:400 clamp(20px,2.3vw,30px)/1.15 var(--fauna-display,Georgia,serif); }
#hotel-visit p { margin:4px 0; color:var(--muted); }
#preserved-previews { padding-block-end:32px; }
#preserved-preview-list { display:flex; flex-wrap:wrap; gap:8px; list-style:none; padding:0; margin:12px 0 0; }
#preserved-preview-list button { min-height:42px; text-align:start; }
:is(#hotel-room,#preserved-preview-room)[open] { display:grid; grid-template-rows:auto minmax(0,1fr); width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; background:var(--paper); color:var(--ink); }
:is(#hotel-room,#preserved-preview-room)>div { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; padding: max(8px,env(safe-area-inset-top)) var(--studio-edge) 8px; }
:is(#hotel-room,#preserved-preview-room) iframe { width:100%; height:100%; border:0; }

/* ---- the wider Studio: open studios, artists, the reference library and the source reader */
#open-studio, #studio-artists, #reference-library {
  box-sizing: border-box;
  width: min(100%, 1420px);
  margin-inline: auto;
  padding: 8px var(--studio-edge) 28px;
}
#open-studio h2, #studio-artists h2, #reference-library h2 {
  margin: 0 0 12px;
  font: 400 clamp(22px, 2.4vw, 30px)/1.15 var(--fauna-display, Georgia, serif);
}
#reference-library > p { margin: -4px 0 16px; color: var(--muted); font-size: 14px; }
:is(#open-studio-form, #ocean-form) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--fauna-card-radius, 18px);
  background: var(--white);
}
:is(#open-studio-form, #ocean-form) label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
:is(#open-studio-form, #ocean-form) select, :is(#open-studio-form, #ocean-form) input, :is(#open-studio-form, #ocean-form) textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 inherit;
}
:is(#open-studio-form, #ocean-form) textarea { resize: vertical; min-height: 132px; }
:is(#open-studio-form, #ocean-form) .open-instructions, :is(#open-studio-form, #ocean-form) > p, :is(#open-studio-form, #ocean-form) > div { grid-column: 1 / -1; }
:is(#open-studio-form, #ocean-form) > p { margin: 0; color: var(--muted); font-size: 14px; }
:is(#open-studio-form, #ocean-form) > div { display: flex; flex-wrap: wrap; gap: 10px; }
#open-status, #artist-status { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
#open-status:empty, #artist-status:empty { display: none; }

#artist-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#artist-list li {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 1.4fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
#artist-list li.artist-empty { background: transparent; border-style: dashed; }
#artist-list strong { font-weight: 600; overflow-wrap: anywhere; }
#artist-list .artist-piece { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
#artist-list select { max-width: none; width: 100%; height: 44px; }

#reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--studio-gap); }
.reference-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--fauna-card-radius, 18px);
  background: var(--white);
}
.reference-card h3 { margin: 0; font: 400 clamp(21px, 2.4vw, 30px)/1.15 var(--fauna-display, Georgia, serif); }
.reference-card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.reference-kind { font-size: 12px !important; letter-spacing: .04em; }
.reference-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

#reference-room {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #03050b;
  color: #e8eef8;
}
#reference-room[open] { display: flex; flex-direction: column; }
.reference-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
}
.reference-heading h2 { margin: 0; color: inherit; font: 400 22px/1.1 var(--fauna-display, Georgia, serif); }
.reference-heading p { margin: 2px 0 0; color: #a9b6cc; font-size: 12px; }
.reference-heading > div:last-child { display: flex; gap: 8px; }
#reference-stage { flex: 1; min-height: 0; }
#reference-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #03050b; }
#reference-note { margin: 0; padding: 8px 16px max(10px, env(safe-area-inset-bottom)); color: #a9b6cc; font-size: 12px; line-height: 1.5; }
#reference-note:empty { display: none; }

.studio-source-reader { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); min-height: 0; flex: 1; }
#studio-source-files { overflow: auto; padding: 4px 8px 16px 12px; border-inline-end: 1px solid var(--line); }
#studio-source-files p { margin: 12px 0 4px; color: var(--muted); font: 11px/1.2 ui-monospace, monospace; overflow-wrap: anywhere; }
#studio-source-files button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: 13px/1.25 ui-monospace, monospace;
  text-align: start;
  overflow-wrap: anywhere;
}
#studio-source-files button[aria-current=true] { background: var(--ink); color: #fff; }
@media (max-width: 760px) {
  :is(#open-studio-form, #ocean-form), #reference-list { grid-template-columns: 1fr; }
  #artist-list li { grid-template-columns: 1fr 1fr; }
  .studio-source-reader { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  #studio-source-files { display: flex; gap: 6px; padding: 0 12px 10px; border: 0; white-space: nowrap; }
  #studio-source-files p { margin: 9px 0 0 6px; }
  #studio-source-files button { width: auto; }
}
#studio-source[open] { display: flex; flex-direction: column; height: min(88svh, 900px); }
#studio-source .studio-source-heading, #studio-source-status { flex: none; }
.studio-source-reader #studio-source-body { max-height: none; min-height: 0; }
.artist-controls { display: flex; gap: 8px; justify-content: flex-end; }
#artist-list strong small { color: var(--green); font-weight: 400; }

/* ---- the benches */
.open-freedom { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 10px; font-size: 14px !important; font-weight: 400 !important; color: var(--ink) !important; }
.open-freedom input { width: 20px !important; min-height: 20px !important; height: 20px; padding: 0 !important; }
#studio-bench { box-sizing: border-box; width: min(100%, 1420px); margin-inline: auto; padding: 8px var(--studio-edge) 28px; }
#studio-bench h2 { margin: 0 0 12px; font: 400 clamp(22px, 2.4vw, 30px)/1.15 var(--fauna-display, Georgia, serif); }
#studio-bench > p { margin: -4px 0 16px; color: var(--muted); font-size: 14px; }
#bench-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.bench-card { display: grid; gap: 4px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); font: inherit; text-align: start; }
.bench-card:hover { border-color: var(--green); }
.bench-card.closed { background: transparent; }
.bench-card strong { font: 400 19px/1.2 var(--fauna-display, Georgia, serif); overflow-wrap: anywhere; }
.bench-card span { color: var(--muted); font-size: 13px; }
.bench-card .bench-news { color: var(--green); font-weight: 600; }
#bench-room { box-sizing: border-box; width: min(1280px, calc(100vw - 24px)); height: min(92svh, 980px); max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); }
#bench-room[open] { display: flex; flex-direction: column; }
.bench-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.bench-heading h2 { margin: 2px 0; font: 400 26px/1.1 var(--fauna-display, Georgia, serif); }
.bench-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.bench-kind { font-size: 11px !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.bench-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.bench-buttons a { display: inline-flex; align-items: center; text-decoration: none; }
.bench-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; flex: 1; min-height: 0; padding: 0 18px 18px; }
.bench-stage { display: grid; place-items: center; min-height: 240px; border-radius: 12px; background: #10171c; color: #b7c2c9; overflow: hidden; }
.bench-stage iframe { width: 100%; height: 100%; border: 0; }
.bench-stage p { margin: 0; padding: 24px; font-size: 14px; }
.bench-side { overflow: auto; min-height: 0; }
.bench-side h3 { margin: 14px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.bench-side h3:first-child { margin-top: 0; }
#bench-items { margin: 0; padding-inline-start: 18px; font-size: 14px; line-height: 1.6; }
#bench-items span { color: var(--muted); }
#bench-report { margin: 0; padding: 12px; border-radius: 10px; background: var(--paper); font: 13px/1.55 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
#bench-tell { display: grid; gap: 8px; margin-top: 16px; }
#bench-tell label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
#bench-tell textarea { box-sizing: border-box; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 15px/1.5 inherit; resize: vertical; }
#bench-tell button { justify-self: start; }
#bench-status { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
#bench-status:empty { display: none; }
.bench-outcome { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .bench-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 46svh) auto; overflow: auto; } .bench-side { overflow: visible; } }
#detail-controls { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---- the phrase dock */
.phrases-open { padding-bottom: 150px; }
#phrase-dock {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--white) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#phrase-dock[hidden] { display: none; }
#phrase-dock #studio-quick-sends { flex: 1; flex-wrap: nowrap; min-width: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
#phrase-dock #studio-quick-sends::-webkit-scrollbar { display: none; }
#phrase-dock #studio-quick-sends button { flex: none; max-width: min(70vw, 420px); margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
#phrase-dock #studio-quick-sends small { display: none; }
#phrase-dock.editing #studio-quick-sends button { border-style: dashed; color: #8a2f1f; }
.phrase-tools { display: flex; gap: 6px; }
.phrase-tools .quiet { min-height: 40px; padding: 8px 14px; }
#phrase-form { display: flex; gap: 8px; flex: 1 1 100%; order: -1; }
#phrase-form[hidden] { display: none; }
#phrase-form input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 16px; }
#phrase-status { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 13px; }
#phrase-status:empty { display: none; }
.artist-crew { min-height: 36px; padding: 6px 10px; font-size: 12px; color: #8a2f1f; }
#detail-frames, .frames { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
#reference-frames { padding: 4px 16px 0; color: #a9b6cc; }

/* ---- prompts */
#prompt-room { box-sizing: border-box; width: min(860px, calc(100vw - 24px)); height: min(88svh, 900px); max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); }
#prompt-room[open] { display: flex; flex-direction: column; }
.prompt-heading { display: flex; align-items: center; gap: 12px; padding: 16px 18px 8px; }
.prompt-heading h2 { margin: 0; font: 400 28px/1.1 var(--fauna-display, Georgia, serif); }
.prompt-heading input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 16px; }
#prompt-lede { margin: 0; padding: 0 18px 10px; color: var(--muted); font-size: 14px; }
#prompt-list { flex: 1; min-height: 0; overflow: auto; padding: 0 18px 18px; }
#prompt-list h3 { position: sticky; top: 0; margin: 0; padding: 12px 0 8px; background: var(--white); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.prompt-group { display: grid; gap: 8px; }
.prompt-card { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; text-align: start; }
.prompt-card:hover { border-color: var(--green); }
.prompt-card strong { font: 400 18px/1.2 var(--fauna-display, Georgia, serif); }
.prompt-card span { color: var(--ink); font-size: 15px; line-height: 1.5; }

/* ---- who is in each studio, whether they are working, and what the piece looks like */
.world-card-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.world-card-credit { color: var(--ink); font-size: 15px; font-weight: 600; }
.world-card-state { padding: 3px 9px; border-radius: 999px; background: var(--wash); color: var(--muted); font: 600 11px/1.3 system-ui, sans-serif; letter-spacing: .04em; }
.world-card-state[data-working=true] { background: var(--green); color: #fff; }
.world-card .world-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- artists ready: the way in */
#studio-ready { box-sizing: border-box; width: min(100%, 1420px); margin-inline: auto; padding: 0 var(--studio-edge) 18px; }
#studio-ready h2 { margin: 0 0 12px; font: 400 clamp(22px, 2.4vw, 30px)/1.15 var(--fauna-display, Georgia, serif); }
#ready-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ready-card { display: grid; gap: 6px; justify-items: start; min-height: 104px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); color: var(--ink); font: inherit; text-align: start; box-shadow: var(--fauna-card-shadow, none); }
.ready-card:hover { border-color: var(--green); }
.ready-card strong { font: 400 24px/1.1 var(--fauna-display, Georgia, serif); }
.ready-state { padding: 3px 9px; border-radius: 999px; background: #e4ede0; color: var(--ink); font: 600 11px/1.3 system-ui, sans-serif; letter-spacing: .04em; }
.ready-card.in-studio .ready-state { background: var(--wash); color: var(--muted); }
.ready-state[data-working=true] { background: var(--green) !important; color: #fff !important; }
.ready-piece { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ready-card:not(.in-studio) .ready-piece { color: var(--green); font-weight: 600; }
#ready-status { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
#ready-status:empty { display: none; }
/* Empty studios are not drawn; a studio appears when a session or commission begins. */
#world-grid .world-card.empty-slot { display: none; }
#world-grid:not(:has(button.world-card, li.world-card)) { display: none; }

.world-card-room { font-size: 13px; color: var(--muted); }

.world-card .world-media > .preview-reason:not(:empty) {
  position: absolute;
  inset: auto auto 8px 8px;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 3px;
  background: #222a26;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
}
.world-card .world-media > .preview-reason:empty { display: none; }

#studio-archive { margin: 1.5rem auto; width: min(94%, 80rem); }
#archive-list { list-style: none; padding: 0; }
#archive-list li { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; padding: .8rem 0; }
#archive-list p { margin: 0; }
#archive-options form { display: grid; gap: .5rem; padding: .75rem; }

#studio-feedback { flex-basis: 100%; }
#studio-feedback summary { cursor: pointer; }
#rating-form { display: grid; max-width: 32rem; gap: .6rem; padding-block: .7rem; }
#rating-form label { display: grid; gap: .25rem; }
#rating-form button, #rating-score { justify-self: start; }
#rating-status:empty { display: none; }

#studio-fps { position: absolute; z-index: 2; top: max(12px,env(safe-area-inset-top)); right: max(12px,env(safe-area-inset-right)); background: #172820e8; color: white; padding: .4rem .65rem; border-radius: .45rem; font: 600 .8rem/1.3 ui-monospace,monospace; pointer-events: none; }
#detail-preview[data-immersive] #studio-fps {
  top: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
}
.viewpoint-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
.viewpoint-tools input { min-width: min(18rem,100%); flex: 1; }

.studio-piece-card { min-width: 0; }
.studio-stop-note { padding: .35rem .8rem .8rem; }
.studio-stop-note p { margin: .4rem 0 .65rem; overflow-wrap: anywhere; }

#studio-final-words { margin: .65rem 1rem; overflow-wrap: anywhere; }

.director-dialog { width:min(90vw,34rem); max-height:85dvh; overflow:auto; border:1px solid var(--line); border-radius:1rem; padding:1.4rem; background:var(--white,#fff); color:var(--ink); }
.director-dialog form { float:right; }
.director-dialog h2 { margin:.2rem 0 1rem; }
.director-dialog label, .director-dialog textarea, .director-dialog select { display:block; width:100%; box-sizing:border-box; margin:.4rem 0 .8rem; }
.director-dialog textarea,.director-dialog select { padding:.55rem; font:inherit; }
.director-dialog details,.director-dialog article { border-top:1px solid var(--line); margin-top:1rem; padding-top:.8rem; }
.director-dialog button { margin:.2rem; }

.studio-tools .astra-balance {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .35em .6em;
  min-height: 44px; padding: .6em .9em; border: 1px solid var(--line, #ccd4ca);
  border-radius: 14px; background: var(--white, white); color: var(--ink);
  font: inherit; cursor: pointer; font-variant-numeric: tabular-nums;
}
.astra-balance .astra-label { font: italic 1.1em Georgia, serif; }
#astra-credits { font-weight: 600; }
#astra-week { border-inline-start: 1px solid var(--line); padding-inline-start: .7em; color: var(--muted); }
#resident-previews { max-width:1420px; margin:0 auto; box-sizing:border-box; padding:0 var(--studio-edge) 1rem; }
body[data-piece-open] #resident-previews { display:none; }
.resident-preview-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap:.75rem; }
.resident-preview-grid article { display:grid; align-content:start; gap:.4rem; padding:.7rem; border:1px solid var(--line); border-radius:.6rem; background:var(--white); }
.resident-preview-grid h3 { margin:0; font:500 1.1rem var(--fauna-display,Georgia,serif); }
.resident-preview-grid img { width:100%; aspect-ratio:3/2; object-fit:contain; }
.resident-preview-grid select { max-width:100%; min-height:40px; font:inherit; }
.unassigned-previews { margin-block: 1rem; }
.unassigned-previews summary { cursor: pointer; color: var(--muted); }
.unassigned-previews > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: 1rem; margin-top: 1rem; }
.unassigned-previews h3 { margin: 0 0 .3rem; font: inherit; }
.unassigned-previews select { width: 100%; min-height: 44px; }

.resident-studio main { max-width: none; margin: 0; padding: 0; }
.resident-studio #desk-source { flex: 1; color: var(--muted); font-size: 13px; }
.resident-studio .desk-heading, .resident-studio .desk-section {
  box-sizing: border-box;
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: 8px var(--studio-edge);
}
.resident-studio .desk-heading { font: 400 24px/1.2 var(--fauna-display, Georgia, serif); }
.resident-studio #world-grid { margin-block: 0; list-style: none; }
.resident-studio summary { cursor: pointer; }
.resident-studio summary:focus-visible { outline-offset: -3px; }
.resident-studio .world-card-state { justify-self: start; }
.resident-studio .world-card code { overflow-wrap: anywhere; }
.resident-studio #ocean-form [hidden] { display: none; }
.resident-studio #ocean-form button { justify-self: start; }
