/* SMAU FILE
 * Path: css/smau-studio.css
 * Owns: Creator Studio workspace (shell mode) — stage split, topbar,
 *       sidebar, timeline region chrome, inspector, beat picker.
 * Invariants:
 *   - Studio visibility truth is #studio-root[data-state] + html[data-smau-mode]
 *   - The phone shell keeps rendering live at the left; Studio never covers it
 *     on wide screens.
 *   - Timeline internals are styled in css/smau-studio-timeline.css (stl-*).
 */

:root {
  --studio-bg: #0b0d14;
  --studio-bg-raised: rgba(255, 255, 255, 0.035);
  --studio-bg-topbar: linear-gradient(180deg, #131722, #0d1018);
  --studio-border: rgba(255, 255, 255, 0.09);
  --studio-ink: rgba(238, 240, 248, 0.94);
  --studio-muted: rgba(238, 240, 248, 0.55);
  --studio-accent: var(--creator-accent, #ffcc66);
  --studio-accent-soft: rgba(255, 204, 102, 0.14);
  --studio-danger: var(--creator-danger, #ff5c5c);
  --studio-radius: 12px;
}

/* ── Stage split: phone left, workspace right ──────────────────── */

.studio-root { display: none; }

html[data-smau-mode="studio"] #smau-stage {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
  padding: 0;
  background: var(--studio-bg);
}

html[data-smau-mode="studio"] #studio-root[data-state="open"] { margin: 0; }

html[data-smau-mode="studio"] .smau-shell-wrap {
  flex: 0 0 auto;
  width: clamp(300px, 34vw, 440px);
  height: 100%;
}

html[data-smau-mode="studio"] #studio-root[data-state="open"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  color: var(--studio-ink);
  font-family: var(--smau-font-stack, system-ui, sans-serif);
  border-left: 1px solid var(--studio-border);
  animation: studio-enter 0.22s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes studio-enter {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

#studio-root, #studio-root *, #studio-root *::before, #studio-root *::after {
  box-sizing: border-box;
}

/* :where() keeps this reset at type-selector specificity, so ordinary class
   rules (.s2-card, .s2-btn, …) can restyle a button without fighting the id. */
:where(#studio-root) button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Topbar ────────────────────────────────────────────────────── */

.studio-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--studio-bg-topbar);
  border-bottom: 1px solid var(--studio-border);
}

.studio-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--studio-border);
  background: var(--studio-bg-raised);
  color: var(--studio-ink);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.studio-exit-btn:hover { background: rgba(255, 255, 255, 0.08); }

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.studio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--studio-accent);
  box-shadow: 0 0 10px rgba(255, 204, 102, 0.55);
  flex: 0 0 auto;
}

.studio-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.studio-sub {
  font-size: 11px;
  color: var(--studio-muted);
  white-space: nowrap;
}

.studio-toolbar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.studio-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--studio-border);
  background: var(--studio-bg-raised);
  color: var(--studio-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.studio-tool-btn:hover { background: rgba(255, 255, 255, 0.08); }
.studio-tool-btn:active { transform: translateY(1px); }
.studio-tool-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.studio-tool-btn--accent {
  background: var(--studio-accent-soft);
  border-color: rgba(255, 204, 102, 0.45);
  color: var(--studio-accent);
}

.studio-tool-btn--accent:hover { background: rgba(255, 204, 102, 0.22); }

.studio-tool-icon { font-size: 13px; line-height: 1; }

/* ── Body: sidebar | timeline | inspector ──────────────────────── */

.studio-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  min-height: 0;
}

/* Sidebar */

.studio-sidebar {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px 12px;
  border-right: 1px solid var(--studio-border);
  overflow-y: auto;
  min-height: 0;
}

.studio-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--studio-muted);
  padding: 0 4px 7px;
}

.studio-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--studio-ink);
  border: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.studio-list button:hover { background: rgba(255, 255, 255, 0.06); }

.studio-list button[data-state="open"] {
  background: var(--studio-accent-soft);
  border-color: rgba(255, 204, 102, 0.35);
  color: var(--studio-accent);
  font-weight: 600;
}

/* Sidebar rows: [ name | ✎ | ✕ ] — actions stay quiet until hovered so the
   list still reads as a simple list. */
.studio-row {
  display: flex;
  gap: 2px;
  align-items: stretch;
  min-width: 0;
}

.studio-list .studio-row .studio-row-name {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.studio-list .studio-row .studio-row-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 0;
  font-size: 12px;
  opacity: 0.45;
}

.studio-list .studio-row .studio-row-action:hover,
.studio-list .studio-row .studio-row-action:focus-visible {
  opacity: 1;
}

.studio-add-btn {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px dashed var(--studio-border);
  color: var(--studio-muted);
  font-size: 12.5px;
  text-align: left;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.studio-add-btn:hover {
  color: var(--studio-accent);
  border-color: rgba(255, 204, 102, 0.4);
}

/* Timeline panel */

.studio-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.studio-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
}

.studio-scene-title {
  /* `overflow: hidden` sets this item's automatic minimum size to zero, so on
     a 390px header the scene name was the first thing to be crushed out of
     existence entirely — the one label that says WHERE YOU ARE. It ellipsizes
     now instead of vanishing, and the badges beside it give way first. */
  flex: 1 1 auto;
  min-width: 5em;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-badge {
  font-size: 11px;
  color: var(--studio-muted);
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* "You are only looking at one phone." It exists only while a phone filter is
   on, sits right next to the beat count it just changed, and clears the filter
   when tapped — a filter you have to go hunting for is a filter that will make
   you think your story lost 1,800 beats. */
.studio-phone-filter {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #241c08;
  background: var(--studio-accent);
  border: 1px solid var(--studio-accent);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  max-width: 44vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-phone-filter[data-state="on"] { display: inline-flex; }
.studio-phone-filter:hover { filter: brightness(1.08); }
.studio-phone-filter:focus-visible { outline: 2px solid var(--studio-accent); outline-offset: 2px; }

.studio-fab {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--studio-accent);
  color: #241c08;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 204, 102, 0.25);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.studio-fab:hover { box-shadow: 0 6px 18px rgba(255, 204, 102, 0.4); }
.studio-fab:active { transform: translateY(1px) scale(0.98); }
.studio-fab-icon { font-size: 15px; line-height: 1; }

.studio-timeline-region {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  margin: 0 16px 16px;
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Beat picker popover */

/* The Add Beat picker is the Studio 2.0 bottom sheet now — all of its styling
   lives in css/smau-studio2.css (.studio-picker* rules there). */

/* Inspector */

.studio-inspector {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--studio-border);
  overflow-y: auto;
}

.studio-editor { display: none; }

.studio-editor[data-state="open"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

#creator-editor[data-state="open"] + .studio-inspector-empty { display: none; }

.studio-inspector-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--studio-muted);
  font-size: 13px;
  text-align: center;
}

.studio-inspector-empty-icon { font-size: 26px; opacity: 0.7; }
.studio-inspector-empty p { margin: 0; max-width: 200px; line-height: 1.5; }

.studio-editor-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--studio-border);
}

.studio-editor-title { font-size: 13.5px; font-weight: 700; }

.studio-editor-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--studio-muted);
  font-size: 17px;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}

.studio-editor-close:hover { background: rgba(255, 255, 255, 0.07); color: var(--studio-ink); }

.studio-editor-fields {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* Fields rendered by creator.forms.js */

.studio-editor-fields .creator-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.studio-editor-fields label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.studio-editor-fields input,
.studio-editor-fields textarea,
.studio-editor-fields select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--studio-ink);
  font-size: 13px;
}

.studio-editor-fields textarea { min-height: 68px; resize: vertical; }

.studio-editor-fields input:focus,
.studio-editor-fields textarea:focus,
.studio-editor-fields select:focus {
  outline: none;
  border-color: rgba(255, 204, 102, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 204, 102, 0.12);
}

.studio-editor-fields .creator-conditions {
  border-top: 1px solid var(--studio-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-editor-fields .creator-conditions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-editor-fields .creator-cond-add {
  font-size: 12px;
  color: var(--studio-accent);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 204, 102, 0.35);
}

.studio-editor-fields .creator-cond-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-editor-fields .creator-cond-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.studio-editor-fields .creator-cond-row input,
.studio-editor-fields .creator-cond-row select { flex: 1 1 auto; min-width: 0; }

/* "Continue the chain" action inside the message editor */
.studio-editor-fields .creator-thread-tools {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--studio-border);
}

.studio-editor-fields .creator-thread-add {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--studio-accent);
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 204, 102, 0.4);
  background: rgba(255, 204, 102, 0.06);
  cursor: pointer;
}

.studio-editor-fields .creator-thread-add:hover {
  background: rgba(255, 204, 102, 0.12);
}

.studio-editor-fields .creator-thread-hint {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--studio-muted, rgba(255, 255, 255, 0.55));
}

/* Media-library picker under path fields */
.studio-editor-fields .creator-media-pick {
  margin-top: 6px;
  width: 100%;
  font-size: 12px;
}

/* Lived-in filler generator: app checkbox grid */
.studio-editor-fields .creator-gen-domains {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}

.studio-editor-fields .creator-gen-domain {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--studio-text, rgba(255, 255, 255, 0.85));
}

.studio-editor-fields .creator-gen-domain input {
  width: auto;
  margin: 0;
  accent-color: var(--studio-accent, #fc6);
}

.studio-editor-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--studio-border);
}

/* Phone-content editors save live — the event Save/Delete footer is meaningless
   there and must not act on a stale event id. */
#creator-editor[data-mode="content"] .studio-editor-actions {
  display: none;
}

/* Phone-content list + form (characters, threads, posts, articles…) */
.studio-editor-fields .creator-content-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.studio-editor-fields .creator-content-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.studio-editor-fields .creator-content-item {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--studio-ink);
  border: 1px solid var(--studio-border);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-editor-fields .creator-content-item[data-state="open"] {
  background: var(--studio-accent-soft);
  border-color: rgba(255, 204, 102, 0.35);
  color: var(--studio-accent);
  font-weight: 600;
}

.studio-editor-fields .creator-content-del {
  flex: 0 0 auto;
  width: 30px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  color: var(--studio-muted);
  font-size: 15px;
}

.studio-editor-fields .creator-content-del:hover {
  color: #ff8484;
  border-color: rgba(255, 132, 132, 0.4);
}

.studio-editor-fields .creator-content-view {
  flex: 0 0 auto;
  width: 34px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  color: var(--studio-muted);
  font-size: 14px;
}

.studio-editor-fields .creator-content-view:hover {
  color: var(--studio-accent);
  border-color: rgba(255, 204, 102, 0.35);
}

.studio-editor-fields .creator-content-add {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed var(--studio-border);
  color: var(--studio-muted);
  font-size: 12.5px;
  text-align: left;
}

.studio-editor-fields .creator-content-add:hover {
  color: var(--studio-accent);
  border-color: rgba(255, 204, 102, 0.4);
}

.studio-editor-fields .creator-content-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--studio-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Thread message rows: chat-like sender pill + text */
.studio-editor-fields .creator-msg-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.studio-editor-fields .creator-msg-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.studio-editor-fields .creator-msg-who {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--studio-border);
  color: var(--studio-muted);
}

.studio-editor-fields .creator-msg-row[data-sender="me"] .creator-msg-who {
  background: var(--studio-accent-soft);
  border-color: rgba(255, 204, 102, 0.35);
  color: var(--studio-accent);
}

.studio-editor-fields .creator-msg-text {
  flex: 1 1 auto;
  min-width: 0;
}

.studio-editor-fields .creator-msg-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--studio-border);
}

.studio-editor-fields .creator-msg-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Landed here via a tap on the live phone (content-edit bridge,
   js/creator/creator.phone.js openEditorForTap) — briefly call out which
   message the panel jumped to. */
.studio-editor-fields .creator-msg-item-tapped {
  animation: creator-msg-tapped-pulse 1.6s ease-out 1;
  border-radius: 8px;
}

@keyframes creator-msg-tapped-pulse {
  0% { background-color: rgba(255, 204, 102, 0.28); }
  100% { background-color: transparent; }
}

.studio-editor-fields .creator-msg-subrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-left: 8px;
}

.studio-editor-fields .creator-msg-ts {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  background: transparent;
  color: var(--studio-muted);
}

.studio-editor-fields .creator-msg-media-pick {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  background: transparent;
  color: var(--studio-muted);
}

.studio-editor-fields .creator-msg-media-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 auto;
}

.studio-editor-fields .creator-msg-addrow {
  display: flex;
  gap: 6px;
}

.studio-editor-fields .creator-msg-addrow .creator-content-add {
  flex: 1 1 0;
  margin-top: 2px;
}

/* In-app "＋" creator button on the live phone (only while Studio is open and
   the foreground app has a content editor). */
#creator-app-fab {
  position: absolute;
  right: 14px;
  /* High enough to clear apps' own bottom-right FABs (Contacts, InstaSham…) */
  bottom: 138px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #1a1406;
  background: linear-gradient(180deg, #ffd97a, #f2b83d);
  border: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

#creator-app-fab[data-state="shown"] {
  display: flex;
}

.studio-editor-btn {
  flex: 1 1 auto;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--studio-border);
  transition: filter 0.12s ease, transform 0.1s ease;
}

.studio-editor-btn:active { transform: translateY(1px); }

.studio-editor-btn--primary {
  background: var(--studio-accent);
  color: #241c08;
  border-color: transparent;
}

.studio-editor-btn--primary:hover { filter: brightness(1.08); }

.studio-editor-btn--danger {
  background: rgba(255, 92, 92, 0.12);
  color: var(--studio-danger);
  border-color: rgba(255, 92, 92, 0.35);
}

.studio-editor-btn--danger:hover { background: rgba(255, 92, 92, 0.2); }

/* ── Responsive ────────────────────────────────────────────────── */

/* Mid: inspector floats over the timeline instead of docking */
@media (max-width: 1180px) {
  .studio-inspector {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    width: min(320px, 86vw);
    background: #10131c;
    box-shadow: -14px 0 34px rgba(0, 0, 0, 0.45);
    transform: translateX(102%);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.2, 1);
  }
  .studio-body { position: relative; }
  .studio-inspector:has(#creator-editor[data-state="open"]) { transform: translateX(0); }
  .studio-inspector-empty { display: none; }
}

/* Narrow: studio takes the whole screen; ‹ Phone exits back to the shell */
@media (max-width: 900px) {
  html[data-smau-mode="studio"] .smau-shell-wrap { display: none; }
  html[data-smau-mode="studio"] #studio-root[data-state="open"] { border-left: none; }
  .studio-sidebar { flex-basis: 150px; }
  .studio-sub { display: none; }
}

/* The stories/chapters collapse toggle only exists on phones, where the sidebar
   would otherwise eat vertical space that belongs to the timeline. */
.studio-sidebar-toggle {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  color: var(--studio-ink);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.04);
}

/* Phones: the sidebar is GONE, not squeezed.
   It used to be re-laid-out here as a horizontal scrolling strip — three
   190px columns of desktop furniture shoved sideways through a 390px
   viewport. Every name clipped mid-word, the app column ran off the right
   edge, and the sections fought each other for a 150px minimum. The ☰ opens
   js/creator/creator.buildsheet.js instead, which is a sheet built for this
   width rather than a column apologising for it. */
@media (max-width: 640px) {
  .studio-body { flex-direction: column; }
  .studio-sidebar { display: none; }
  .studio-sidebar-toggle { display: inline-flex; }
  .studio-sidebar-toggle[aria-expanded="true"] {
    background: var(--studio-accent-soft);
    border-color: rgba(255, 204, 102, 0.4);
    color: var(--studio-accent);
  }
  .studio-toolbar { gap: 5px; }
  .studio-tool-btn { padding: 7px 9px; font-size: 11.5px; }
  .studio-brand-text { display: none; }
  .studio-fab-label { display: none; }
  /* Five things share a 390px header. The two badges are the ones that can
     afford to lose a pixel; the scene name is not. */
  .studio-panel-header { gap: 7px; padding: 12px 12px 10px; }
  .studio-badge { padding: 3px 7px; }
  .studio-phone-filter { padding: 3px 7px; max-width: 46vw; }
  /* The 🕒/☰ glyph and its tooltip carry this; the word does not fit. */
  #creator-view-toggle-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-smau-mode="studio"] #studio-root[data-state="open"],
  .studio-picker[data-state="open"],
  .studio-inspector,
  .studio-tool-btn,
  .studio-fab {
    animation: none !important;
    transition: none !important;
  }
}

/* ── GFO Library editor rows ── */
.creator-lib-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.creator-lib-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-lib-del {
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}

.creator-lib-del:hover {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════════════
   THE 2026-08-02 LOOK PASS
   Owner: "you didn't do any improvements to the flow, the visuals, the
   tooltips. I want it to look better than it does now."

   Root cause of the flatness, found while doing it: css/smau-creator.css
   scopes 127 rules to #modal-creator-backdrop — an element that no longer
   exists in index.html. A whole stylesheet of depth, elevation and hierarchy
   was landing on nothing, which is why every panel here was the same
   near-black rectangle. These rules live in the studio's OWN stylesheet,
   scoped to the element that is actually on the page.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Depth: three columns that read as three surfaces ───────────────────── */
.studio-root .studio-sidebar {
  background: rgba(7, 8, 16, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -14px 0 24px -22px rgba(0, 0, 0, 0.95);
}
.studio-root .studio-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.016), transparent 240px);
}
.studio-root .studio-inspector {
  background: rgba(19, 20, 33, 0.82);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: -18px 0 40px -30px rgba(0, 0, 0, 0.9);
}

/* Section labels were tiny grey caps competing with the list under them; a
   trailing rule turns them into headings instead of noise. */
.studio-root .studio-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.studio-root .studio-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.22;
}

/* ── Toolbar: a row of identical text links becomes a hierarchy ──────────── */
.studio-root .studio-toolbar { flex-wrap: nowrap; min-width: 0; gap: 2px; }
.studio-root .studio-tool-sep {
  width: 1px;
  align-self: stretch;
  margin: 7px 5px;
  background: rgba(255, 255, 255, 0.1);
}
.studio-root .studio-tool-btn { white-space: nowrap; padding-inline: 9px; }
.studio-root .studio-tool-btn:disabled { opacity: 0.3; }
/* Play is the payoff. It was the same weight as Import, which is why the eye
   had nowhere to go. Filled, not outlined — the studio's own accent token, so
   it tracks the theme rather than hard-coding a second gold. */
.studio-root #creator-btn-play,
.studio-root .studio-tool-btn--accent {
  /* Literal, not var(--studio-accent). That token is `var(--creator-accent,
     …)`, and --creator-accent is declared on #modal-creator-backdrop — an
     element that no longer exists — so the chain is invalid at computed-value
     time and the background silently fell back to transparent. Play looked
     identical to Import for exactly that reason. */
  background: #ffcc66;
  border-color: #ffcc66;
  color: #201704;
  font-weight: 700;
  padding-inline: 15px;
  box-shadow: 0 2px 12px -4px rgba(255, 204, 102, 0.55);
}
.studio-root #creator-btn-play .studio-tool-icon,
.studio-root .studio-tool-btn--accent .studio-tool-icon { color: #201704; }
.studio-root #creator-btn-play:hover:not(:disabled),
.studio-root .studio-tool-btn--accent:hover:not(:disabled) {
  background: #ffdb90;
  border-color: #ffdb90;
  color: #201704;
}
@media (max-width: 1240px) {
  /* Below this the LABELS give way, not the layout — a wrapped toolbar puts
     Play on a second row and buries the payoff. */
  .studio-root .studio-tool-btn { font-size: 0; padding-inline: 8px; }
  .studio-root .studio-tool-btn .studio-tool-icon { font-size: 14px; }
  .studio-root .studio-tool-btn--accent { font-size: 12.5px; }
}

/* Save is the outcome. Delete is not its peer. */
.studio-root .studio-editor-btn--danger {
  background: transparent;
  border: 1px solid transparent;
  color: #ff5c5c;
  font-weight: 500;
}
.studio-root .studio-editor-btn--danger:hover {
  border-color: #ff5c5c;
  background: rgba(255, 92, 92, 0.14);
}

/* ── The inspector is ~300px whatever the window does ────────────────────── */
.studio-root .creator-choice-row {
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-areas: "n label" ". flag" ". value";
  row-gap: 4px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}
.studio-root .creator-choice-row:last-child { border-bottom: 0; }
.studio-root .creator-choice-n { grid-area: n; align-self: start; margin-top: 8px; }
.studio-root .creator-choice-label { grid-area: label; }
.studio-root .creator-choice-flag { grid-area: flag; }
.studio-root .creator-choice-value { grid-area: value; justify-self: start; }

/* The header switch that brings every hint back inline at once. */
.studio-root #creator-btn-help-all {
  margin-left: auto;
  margin-right: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font: 600 10.5px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.studio-root #creator-btn-help-all:hover {
  color: var(--creator-accent, #ffcc66);
  border-color: var(--creator-accent, #ffcc66);
}
.studio-root #creator-btn-help-all[aria-pressed="true"] {
  color: var(--creator-accent, #ffcc66);
  border-color: var(--creator-accent, #ffcc66);
  background: rgba(255, 204, 102, 0.15);
}
