/* Permanent Studio UI shell. */

:root {
  --studio-font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --studio-font-ui: 'DM Sans', sans-serif;
  --studio-font-data: 'JetBrains Mono', monospace;
  --studio-ink: #0a0d0f;
  --studio-panel: #11161a;
  --studio-panel-raised: #171d22;
  --studio-rule: #2b343b;
  --studio-rule-strong: #46515a;
  --studio-text: #eef1eb;
  --studio-text-muted: #8f9aa1;
  --studio-cobalt: #6b82ff;
  --studio-cobalt-deep: #4d65df;
  --studio-vermilion: #ff6247;
  --studio-vermilion-hover: #ff806b;
  --studio-vermilion-ink: #121416;
  --studio-danger: #e15d78;
  /* Semantic roles keep component rules independent from the pigment names. */
  --studio-primary: var(--studio-cobalt);
  --studio-signal: var(--studio-vermilion);
  --studio-header-height: 76px;
  --studio-rail-width: 58px;
  --studio-queue-rail-width: 56px;
  --studio-inspector-width: clamp(340px, 27vw, 410px);
  --studio-queue-workbench-width: clamp(300px, 25vw, 390px);
}

#studio-command-header,
#studio-tool-rail,
#studio-queue-action-rail,
#studio-queue-workbench-mount {
  display: none;
}

body[data-ui-shell='studio'] {
  --background-color: #0a0d0f;
  --text-color: var(--studio-text);
  --text-color-light: var(--studio-text-muted);
  --input-background: var(--studio-panel);
  --canvas-bg: #0d1114;
  --border-color: var(--studio-rule);
  --border-color-dark: var(--studio-rule-strong);
  --button-bg: var(--studio-panel-raised);
  --button-bg-hover: #20282e;
  --button-text: var(--studio-text);
  --primary-color: var(--studio-cobalt);
  --primary-color-dark: var(--studio-cobalt-deep);
  --primary-color-r: 107;
  --primary-color-g: 130;
  --primary-color-b: 255;
  --accent-color: var(--studio-vermilion);
  --accent-color-dark: var(--studio-vermilion-hover);
  --section-header-bg: transparent;
  --section-header-color: var(--studio-text-muted);
  --section-header-border: var(--studio-rule-strong);
  background:
    radial-gradient(circle at 42% 20%, rgba(38, 49, 56, 0.2), transparent 38%),
    var(--studio-ink);
  color: var(--studio-text);
  font-family: var(--studio-font-ui);
}

body[data-ui-shell='studio']:not(.dark-mode) {
  --background-color: #e8e3d8;
  --text-color: #171a1c;
  --text-color-light: #60696d;
  --input-background: #f2eee5;
  --canvas-bg: #d8d3c9;
  --border-color: #c1bbb0;
  --border-color-dark: #777e80;
  --button-bg: #262b2e;
  --button-bg-hover: #353c40;
  --button-text: #f7f2e8;
  --studio-ink: #d8d2c7;
  --studio-panel: #eee9df;
  --studio-panel-raised: #f7f3eb;
  --studio-rule: #c2bbb0;
  --studio-rule-strong: #8d908d;
  --studio-text: #171a1c;
  --studio-text-muted: #62696c;
  --studio-cobalt: #2f50c9;
  --studio-cobalt-deep: #223da6;
  --studio-vermilion: #b93a26;
  --studio-vermilion-hover: #a83220;
  --studio-vermilion-ink: #fffaf2;
  --studio-danger: #b1284d;
  --studio-primary: var(--studio-cobalt);
  --studio-signal: var(--studio-vermilion);
  --primary-color-r: 47;
  --primary-color-g: 80;
  --primary-color-b: 201;
  background:
    linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)),
    #ddd7cc;
}

body[data-ui-shell='studio'] #studio-command-header {
  display: flex;
  flex: 0 0 var(--studio-header-height);
  min-height: var(--studio-header-height);
  align-items: center;
  gap: 24px;
  padding: 0 124px 0 28px;
  border-bottom: 1px solid var(--studio-rule);
  background: rgba(10, 13, 15, 0.96);
  box-sizing: border-box;
  position: relative;
  z-index: 120;
}

body[data-ui-shell='studio']:not(.dark-mode) #studio-command-header {
  background: rgba(238, 233, 223, 0.97);
}

body[data-ui-shell='studio'] .studio-wordmark {
  flex: 0 0 auto;
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-wordmark::after {
  content: 'Generative art studio';
  display: block;
  margin-top: 5px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 7px;
  letter-spacing: 0.2em;
}

body[data-ui-shell='studio'] .studio-header-actions {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  height: 100%;
}

body[data-ui-shell='studio'] .studio-action {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font: inherit;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  box-shadow: none;
  text-shadow: none;
}

body[data-ui-shell='studio'] .studio-action::after {
  content: '';
  position: absolute;
  pointer-events: none;
  background: var(--studio-primary);
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 140ms ease, transform 140ms ease;
}

body[data-ui-shell='studio'] .studio-action:hover,
body[data-ui-shell='studio'] .studio-action:focus-visible {
  background: rgba(255, 255, 255, 0.035);
  color: var(--studio-text);
  outline: none;
}

body[data-ui-shell='studio']:not(.dark-mode) .studio-action:hover,
body[data-ui-shell='studio']:not(.dark-mode) .studio-action:focus-visible {
  background: rgba(20, 24, 27, 0.05);
}

body[data-ui-shell='studio'] .studio-action:focus-visible {
  box-shadow: inset 0 0 0 1px var(--studio-primary);
}

body[data-ui-shell='studio'] .studio-action.is-active,
body[data-ui-shell='studio'] .studio-action.active,
body[data-ui-shell='studio'] .studio-action[aria-pressed='true'],
body[data-ui-shell='studio'] .studio-action[aria-expanded='true'] {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-action.is-active::after,
body[data-ui-shell='studio'] .studio-action.active::after,
body[data-ui-shell='studio'] .studio-action[aria-pressed='true']::after,
body[data-ui-shell='studio'] .studio-action[aria-expanded='true']::after {
  opacity: 1;
  transform: scaleX(1);
}

body[data-ui-shell='studio'] .studio-action:disabled,
body[data-ui-shell='studio'] .studio-action.is-unavailable {
  color: color-mix(in srgb, var(--studio-text-muted) 46%, transparent);
  cursor: not-allowed;
  opacity: 0.56;
}

body[data-ui-shell='studio'] .studio-action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
}

body[data-ui-shell='studio'] .studio-action[hidden] {
  display: none !important;
}

/* Fullscreen transition surfaces use the same Studio signal language and stay
   discoverable on keyboard, touch, and pointer input. */
body[data-ui-shell='studio'] #fullscreen-loading-overlay {
  gap: 14px;
  background:
    linear-gradient(rgba(6, 9, 11, 0.92), rgba(6, 9, 11, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(255, 98, 71, 0.05) 71px 72px) !important;
  color: var(--studio-text) !important;
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-shadow: none;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] #fullscreen-loading-overlay .loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 !important;
  border: 1px solid var(--studio-rule-strong);
  border-top-color: var(--studio-signal);
  border-left-color: var(--studio-signal);
  border-radius: 50%;
}

body[data-ui-shell='studio'] #exit-fullscreen {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-panel) 88%, transparent);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 17px;
  opacity: 0;
  transform: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

body[data-ui-shell='studio'].fullscreen-mode #exit-fullscreen {
  display: grid;
  opacity: 0.78;
  pointer-events: auto;
}

body[data-ui-shell='studio'].fullscreen-mode #exit-fullscreen:hover,
body[data-ui-shell='studio'].fullscreen-mode #exit-fullscreen:focus-visible,
body[data-ui-shell='studio'].fullscreen-mode #exit-fullscreen.visible {
  border-color: var(--studio-signal);
  background: color-mix(in srgb, var(--studio-panel) 94%, var(--studio-signal) 6%);
  color: var(--studio-signal);
  opacity: 1 !important;
  outline: 1px solid var(--studio-signal);
  outline-offset: 2px;
  transform: none;
}

body[data-ui-shell='studio'] #mobile-fullscreen-help {
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: min(340px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-panel) 91%, transparent);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] #fullscreen-loading-overlay,
  body[data-ui-shell='studio'] #fullscreen-loading-overlay .loading-spinner,
  body[data-ui-shell='studio'] #mobile-fullscreen-help {
    transition: none !important;
    animation-duration: 1ms !important;
  }
}

/* --------------------------------------------------------------------------
   Studio Library — shared saved Preset / Board / future Playlist browser
   -------------------------------------------------------------------------- */

body[data-ui-shell='studio'] .studio-library-dialog.modal-overlay {
  z-index: 16500;
  box-sizing: border-box;
  padding: 12px;
  background: color-mix(in srgb, var(--studio-ink) 84%, transparent);
  backdrop-filter: blur(12px);
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-container {
  width: min(1480px, calc(100vw - 24px));
  height: min(940px, calc(100dvh - 24px));
  box-sizing: border-box;
  max-width: none !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
  box-shadow: 0 28px 80px color-mix(in srgb, var(--studio-ink) 55%, transparent);
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 12px 16px 11px 20px;
  border-bottom: 1px solid var(--studio-rule-strong);
  background: var(--studio-panel);
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-title {
  margin: 0;
  color: var(--studio-text);
  font: 400 31px/1 var(--studio-font-display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-title::before {
  content: attr(data-library-kicker);
  display: block;
  min-height: 8px;
  margin-bottom: 5px;
  color: var(--studio-primary);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.16em;
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-left: auto;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font: 300 26px/1 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-close:hover,
body[data-ui-shell='studio'] .studio-library-dialog .modal-close:focus-visible {
  border-color: var(--studio-signal);
  color: var(--studio-text);
  outline: 1px solid var(--studio-signal);
  outline-offset: -3px;
}

body[data-ui-shell='studio'] .studio-library-dialog .modal-content {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--studio-panel);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-content {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-tabs {
  position: static;
  z-index: auto;
  display: flex;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-tabs[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-tab.active,
body[data-ui-shell='studio'] .studio-library-dialog .pb-tab:hover,
body[data-ui-shell='studio'] .studio-library-dialog .pb-tab:focus-visible {
  background: color-mix(in srgb, var(--studio-primary) 12%, transparent);
  color: var(--studio-text);
  box-shadow: inset 0 -2px 0 var(--studio-primary);
  outline: none;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar {
  position: static;
  z-index: auto;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--studio-rule);
  background: var(--studio-panel);
  box-shadow: none;
  backdrop-filter: none;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 9px;
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-search, .pb-filter) {
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-text);
  font: 500 12px/1 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-search, .pb-filter):focus {
  border-color: var(--studio-primary);
  outline: 1px solid var(--studio-primary);
  box-shadow: none;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-filter {
  --pb-mode-accent: var(--studio-primary);
  min-width: 172px;
  min-height: 44px;
  padding: 5px 12px 5px 10px;
  border-color: color-mix(in srgb, var(--pb-mode-accent) 38%, var(--studio-rule-strong));
  border-radius: 0;
  background: color-mix(in srgb, var(--pb-mode-accent) 5%, var(--studio-ink));
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-filter:hover,
body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-filter:focus-visible,
body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-filter.active {
  border-color: var(--pb-mode-accent);
  background: color-mix(in srgb, var(--pb-mode-accent) 11%, var(--studio-ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pb-mode-accent) 25%, transparent);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-eyebrow {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-name {
  color: var(--studio-text);
  font: 600 11px/1.1 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-fav-btn, .pb-select-btn, .pb-btn, .pb-page-btn) {
  min-height: 44px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-fav-btn, .pb-select-btn).active,
body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-fav-btn, .pb-select-btn):hover,
body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-fav-btn, .pb-select-btn):focus-visible {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 10%, transparent);
  color: var(--studio-text);
  outline: none;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-bulk-bar {
  position: static;
  z-index: auto;
  min-height: 50px;
  margin: 0;
  padding: 6px 14px;
  border: 0;
  border-bottom: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-primary) 8%, var(--studio-panel-raised));
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-grid {
  width: auto;
  box-sizing: border-box;
  min-height: 0;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  align-content: start;
  grid-auto-rows: max-content;
  gap: 14px;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(color-mix(in srgb, var(--studio-rule) 42%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--studio-rule) 42%, transparent) 1px, transparent 1px),
    var(--studio-ink);
  background-size: 32px 32px;
  scrollbar-color: var(--studio-rule-strong) transparent;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-card {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  box-shadow: none;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-card:hover,
body[data-ui-shell='studio'] .studio-library-dialog .pb-card:focus,
body[data-ui-shell='studio'] .studio-library-dialog .pb-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--studio-primary);
  box-shadow: 0 0 0 1px var(--studio-primary);
  outline: none;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-card:focus .pb-card-overlay,
body[data-ui-shell='studio'] .studio-library-dialog .pb-card:focus-within .pb-card-overlay {
  opacity: 1;
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-badge, .pb-card-action-btn, .pb-card-checkbox) {
  border-radius: 0;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-card-action-apply,
body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-apply-btn {
  border: 1px solid var(--studio-primary);
  border-radius: 0;
  background: var(--studio-primary);
  color: var(--studio-primary-ink, #111);
  font-family: var(--studio-font-data);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-pagination {
  min-height: 54px;
  padding: 8px 14px;
  border-top: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-preview {
  grid-row: 1 / -1;
  align-self: stretch;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  padding: 12px 18px 16px;
  background: var(--studio-ink);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-close,
body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-preview-nav, .pb-preview-action-btn) {
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-img,
body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-placeholder {
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  box-shadow: 0 22px 70px color-mix(in srgb, var(--studio-ink) 60%, transparent);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-bar {
  padding-top: 12px;
  border-top-color: var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-preview-name, .pb-board-meta-value) {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-preview-date, .pb-preview-text, .pb-board-meta-label, .pb-cell-chip-label, .pb-page-info) {
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-cell-chip, .pb-preview-mode-badge, .pb-rename-input) {
  border-radius: 0;
  border-color: var(--studio-rule-strong);
  background: var(--studio-panel-raised);
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog[data-library-collection='palettes'] .pb-toolbar-inner {
  flex-wrap: wrap;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-sources {
  flex: 1 0 100%;
  gap: 0;
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-palette-source, .pb-palette-create) {
  min-height: 40px;
  padding-inline: 14px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: .07em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-source + .pb-palette-source { border-left: 0; }

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-source.active {
  background: color-mix(in srgb, var(--studio-primary) 12%, transparent);
  color: var(--studio-text);
  box-shadow: inset 0 -2px 0 var(--studio-primary);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-create {
  margin-left: auto;
  border-color: var(--studio-signal);
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-card {
  min-height: 276px;
  aspect-ratio: auto;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-card-body { background: var(--studio-panel-raised); }

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-card-title strong {
  color: var(--studio-text);
  font: 500 13px/1.2 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-palette-card-title span, .pb-palette-card-meta) {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-active-mark {
  border: 1px solid var(--studio-primary);
  background: var(--studio-ink);
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-notice {
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-subview {
  grid-row: 1 / -1;
  align-self: stretch;
  background:
    linear-gradient(color-mix(in srgb, var(--studio-rule) 35%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--studio-rule) 35%, transparent) 1px, transparent 1px),
    var(--studio-ink);
  background-size: 32px 32px;
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-palette-form-heading h2, .pb-palette-delete-shell h2) {
  color: var(--studio-text);
  font: 400 34px/1 var(--studio-font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-form-kicker {
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-palette-form-name input, .pb-palette-color-field, .pb-palette-delete-shell) {
  border-radius: 0;
  border-color: var(--studio-rule-strong);
  background: var(--studio-panel);
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-color-field label,
body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-form-name {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-form-actions .pb-btn { min-height: 44px; }

@media (max-width: 768px) {
  body[data-ui-shell='studio'] .studio-library-dialog.modal-overlay {
    padding: 0;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .modal-container {
    width: 100%;
    height: 100%;
    margin: 0;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .modal-header {
    min-height: 64px;
    padding: 10px 10px 9px 14px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .modal-title {
    font-size: 24px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-tab {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 44px;
    padding-inline: 10px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-tabs { overflow-x: auto; }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar {
    padding: 8px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar-inner {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-sources { overflow-x: auto; }

  body[data-ui-shell='studio'] .studio-library-dialog :is(.pb-palette-source, .pb-palette-create) {
    min-height: 44px;
    flex: 0 0 auto;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar-controls > * {
    min-width: 0;
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-current-mode-filter {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    background-size: 24px 24px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-card-overlay-actions {
    display: flex;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-card-action-btn:not(.pb-card-action-apply) {
    display: none;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-palette-card .pb-card-action-fav {
    display: inline-flex;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-card-action-apply {
    min-height: 44px;
    padding-inline: 10px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview {
    padding: 8px 10px max(12px, env(safe-area-inset-bottom));
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-body {
    gap: 4px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-nav {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-action-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-apply-btn {
    min-width: 44px;
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview-bar {
    gap: 8px;
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  body[data-ui-shell='studio'] .studio-library-dialog .pb-toolbar-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-card-overlay {
    padding: 8px;
  }

  body[data-ui-shell='studio'] .studio-library-dialog .pb-card-overlay-actions {
    right: 7px;
    bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] .studio-library-dialog .pb-card,
  body[data-ui-shell='studio'] .studio-library-dialog .pb-preview {
    animation: none;
    transition: none;
  }
}

body[data-ui-shell='studio'] .studio-action-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

body[data-ui-shell='studio'] .studio-action[data-studio-action='mobile-create'] {
  display: none !important;
}

body[data-ui-shell='studio'] #studio-mobile-inspector-close[hidden],
body[data-ui-shell='studio'] #studio-mobile-inspector-expand[hidden],
body[data-ui-shell='studio'] #studio-mobile-inspector-handle[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .studio-action-label {
  display: block;
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .studio-action-badge {
  display: none;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--studio-signal);
  color: #101315;
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

body[data-ui-shell='studio'] .studio-action-badge:not(:empty) {
  display: inline-flex;
}

body[data-ui-shell='studio'] .studio-action[data-studio-action='preview-board'] .studio-action-icon .studio-action-badge {
  position: absolute;
  z-index: 1;
  top: -7px;
  right: -7px;
  width: 15px;
  min-width: 15px;
  padding: 0;
  font-size: 8px;
  letter-spacing: 0;
}

body[data-ui-shell='studio'] .studio-header-actions .studio-action {
  min-width: 82px;
  height: 100%;
  padding: 10px 13px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

body[data-ui-shell='studio'] .studio-header-actions .studio-action::after {
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
}

body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child {
  min-width: 132px;
  height: 48px;
  margin: auto 12px auto 0;
  padding: 0 22px;
  flex-direction: row;
  gap: 10px;
  background: var(--studio-signal);
  color: var(--studio-vermilion-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--studio-vermilion) 42%, transparent), 0 7px 18px rgba(0, 0, 0, 0.24);
}

body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child:hover,
body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child:focus-visible {
  background: var(--studio-vermilion-hover);
  color: var(--studio-vermilion-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--studio-vermilion) 72%, transparent), 0 9px 22px rgba(0, 0, 0, 0.3);
}

body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child::after {
  display: none;
}

body[data-ui-shell='studio'] .studio-header-actions .studio-action-badge {
  position: absolute;
  top: 12px;
  right: 8px;
}

body[data-ui-shell='studio'] .studio-theme-action,
body[data-ui-shell='studio'] .studio-shortcuts-action {
  position: fixed;
  top: 18px;
  z-index: 301;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--studio-rule-strong);
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  line-height: 1;
  overflow: hidden;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

body[data-ui-shell='studio'] .studio-theme-action {
  right: 20px;
}

body[data-ui-shell='studio'] .studio-shortcuts-action {
  right: 68px;
}

body[data-ui-shell='studio'] .studio-theme-action:hover,
body[data-ui-shell='studio'] .studio-theme-action:focus-visible,
body[data-ui-shell='studio'] .studio-shortcuts-action:hover,
body[data-ui-shell='studio'] .studio-shortcuts-action:focus-visible {
  color: var(--studio-text);
  border-color: var(--studio-primary);
}

body[data-ui-shell='studio'].dark-mode .studio-theme-action {
  color: var(--studio-signal);
}

body[data-ui-shell='studio']:not(.dark-mode) .studio-theme-action {
  color: #293035;
}

body[data-ui-shell='studio'] .studio-theme-action .studio-action-icon svg,
body[data-ui-shell='studio'] .studio-shortcuts-action .studio-action-icon svg {
  width: 17px;
  height: 17px;
  transition: transform 180ms ease;
}

body[data-ui-shell='studio'] .studio-theme-action:hover .studio-action-icon svg {
  transform: rotate(12deg);
}

body[data-ui-shell='studio'] .studio-theme-action .studio-action-label,
body[data-ui-shell='studio'] .studio-theme-action::after,
body[data-ui-shell='studio'] .studio-shortcuts-action .studio-action-label,
body[data-ui-shell='studio'] .studio-shortcuts-action .studio-action-badge,
body[data-ui-shell='studio'] .studio-shortcuts-action::after {
  display: none;
}

/* Studio utility dialog: compact industrial reference card, kept separate from
   the creation-command hierarchy while reusing the canonical shortcut owner. */
body[data-ui-shell='studio'] .shortcuts-overlay {
  padding: 24px;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(4, 7, 9, 0.82), rgba(4, 7, 9, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, 0.025) 31px 32px);
  backdrop-filter: blur(14px);
}

body[data-ui-shell='studio'] .shortcuts-panel {
  width: min(620px, 100%);
  min-width: 0;
  max-width: 620px;
  max-height: min(760px, calc(100vh - 48px));
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-top: 3px solid var(--studio-signal);
  border-radius: 0;
  background: var(--studio-panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

body[data-ui-shell='studio'] .shortcuts-header {
  flex: 0 0 auto;
  margin: 0;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .shortcuts-header h3 {
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
}

body[data-ui-shell='studio'] .shortcuts-header h3::before {
  content: 'Reference index';
  display: block;
  margin-bottom: 5px;
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

body[data-ui-shell='studio'] .shortcuts-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 15px;
}

body[data-ui-shell='studio'] .shortcuts-close:hover,
body[data-ui-shell='studio'] .shortcuts-close:focus-visible {
  border-color: var(--studio-signal);
  background: color-mix(in srgb, var(--studio-signal) 10%, transparent);
  color: var(--studio-signal);
  outline: none;
}

body[data-ui-shell='studio'] .shortcuts-list {
  min-height: 0;
  padding: 14px 20px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  overflow-y: auto;
  scrollbar-color: var(--studio-rule-strong) transparent;
}

body[data-ui-shell='studio'] .shortcut-item {
  min-width: 0;
  min-height: 48px;
  padding: 7px 0;
  gap: 11px;
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .shortcut-item kbd {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 6px 8px;
  border: 1px solid var(--studio-rule-strong);
  border-left: 3px solid var(--studio-primary);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  box-shadow: none;
}

body[data-ui-shell='studio'] .shortcut-item span {
  min-width: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.35;
}

body[data-ui-shell='studio'] .shortcuts-footer {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 20px 14px;
  border-top: 1px solid var(--studio-rule);
  color: var(--studio-text-muted);
  background: var(--studio-panel-raised);
  font-family: var(--studio-font-data);
  font-size: 9px;
  letter-spacing: 0.05em;
}

body[data-ui-shell='studio'] .shortcuts-footer kbd {
  border-color: var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
}

/* Quick board preview remains image-first, but now reads as a Studio lightbox
   rather than an unframed browser overlay. */
body[data-ui-shell='studio'] .cb-preview-overlay {
  padding: 68px 28px 58px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 45%, rgba(35, 44, 50, 0.44), transparent 52%),
    rgba(4, 7, 9, 0.94);
  cursor: zoom-out;
  backdrop-filter: blur(14px);
}

body[data-ui-shell='studio'] .cb-preview-overlay::before {
  content: 'COMPOSITION BOARD  /  PREVIEW';
  position: fixed;
  top: 24px;
  left: 28px;
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

body[data-ui-shell='studio'] .cb-preview-overlay::after {
  content: 'CLICK OR ESC TO CLOSE';
  position: fixed;
  right: 28px;
  bottom: 24px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

body[data-ui-shell='studio'] .cb-preview-image {
  max-width: min(100%, 1440px);
  max-height: 100%;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

/* Continuous Studio inspector: one scroll surface, no nested navigation. */
body[data-ui-shell='studio'] .studio-inspector-intro,
body[data-ui-shell='studio'] .studio-inspector-heading {
  margin: -2px 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .studio-inspector-eyebrow {
  margin: 0 0 7px;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-inspector-title {
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-inspector-status {
  margin: 8px 0 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  letter-spacing: 0.035em;
}

body[data-ui-shell='studio'] .studio-inspector-status-label {
  margin-right: 8px;
  color: var(--studio-text-muted);
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-inspector-status-label::after {
  content: ' /';
}

body[data-ui-shell='studio'] .studio-inspector-active-mode {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .header-controls {
  margin: 0;
  padding: 0 2px 9px;
  display: block;
}

body[data-ui-shell='studio'] .header-controls .slider-label-row {
  align-items: center;
  gap: 12px;
}

body[data-ui-shell='studio'] #instructions {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.55;
}

body[data-ui-shell='studio'] #instructions::before {
  content: 'Prompt';
  display: block;
  margin-bottom: 3px;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .textarea-container {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

body[data-ui-shell='studio']:not(.dark-mode) .textarea-container {
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .textarea-container:focus-within {
  border-color: var(--studio-primary);
  box-shadow: inset 3px 0 0 var(--studio-primary);
}

body[data-ui-shell='studio'] #input-text {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-height: 104px;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 11px;
  line-height: 1.55;
  resize: vertical;
}

body[data-ui-shell='studio'] #input-text:focus {
  outline: 0;
  box-shadow: none;
}

body[data-ui-shell='studio'] #input-text::placeholder {
  color: color-mix(in srgb, var(--studio-text-muted) 62%, transparent);
}

body[data-ui-shell='studio'] .textarea-container .character-counter {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 37px;
  margin: 0;
  padding: 0 8px 0 12px;
  display: flex;
  align-items: center;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  opacity: 1;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .textarea-container .character-counter > span {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .textarea-container .manage-phrases-btn {
  width: 29px;
  min-width: 29px;
  height: 29px;
  min-height: 29px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  box-shadow: none;
  transform: none;
}

body[data-ui-shell='studio'] .textarea-container .manage-phrases-btn:hover,
body[data-ui-shell='studio'] .textarea-container .manage-phrases-btn:focus-visible {
  background: color-mix(in srgb, var(--studio-primary) 9%, transparent);
  color: var(--studio-primary);
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--studio-primary);
  transform: none;
}

body[data-ui-shell='studio'] .textarea-container .manage-phrases-icon {
  width: 15px;
  height: 15px;
}

body[data-ui-shell='studio'] .textarea-container .button-stack {
  position: static;
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: row;
  gap: 0;
  border-left: 1px solid var(--studio-rule);
  z-index: auto;
}

body[data-ui-shell='studio'] .textarea-container .prompt-tool-btn {
  width: 37px;
  min-width: 37px;
  height: 37px;
  min-height: 37px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  box-shadow: none;
  transform: none;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .textarea-container .prompt-tool-btn + .prompt-tool-btn {
  border-left: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .textarea-container .prompt-tool-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

body[data-ui-shell='studio'] .textarea-container #random-phrase-btn:hover,
body[data-ui-shell='studio'] .textarea-container #random-phrase-btn:focus,
body[data-ui-shell='studio'] .textarea-container #random-phrase-btn:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--studio-signal) 12%, transparent);
  color: var(--studio-signal);
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--studio-signal);
  transform: none;
}

body[data-ui-shell='studio'] .textarea-container #clear-btn:hover,
body[data-ui-shell='studio'] .textarea-container #clear-btn:focus,
body[data-ui-shell='studio'] .textarea-container #clear-btn:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--studio-danger) 12%, transparent);
  color: var(--studio-danger);
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--studio-danger);
  transform: none;
}

body[data-ui-shell='studio'] .textarea-container .prompt-tool-btn:active {
  transform: none;
  box-shadow: none;
}

body[data-ui-shell='studio'] #slider-toolbar {
  display: none !important;
}

body[data-ui-shell='studio'] .section-chevron {
  display: block;
}

body[data-ui-shell='studio'] #controls-wrapper {
  display: block !important;
  padding: 0 0 30px;
}

body[data-ui-shell='studio'] #controls,
body[data-ui-shell='studio'] #slider-controls,
body[data-ui-shell='studio'] #custom-color-controls {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-ui-shell='studio'] #controls {
  padding: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

body[data-ui-shell='studio'] #controls > .control-group {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 11px 0 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--studio-rule) 68%, transparent);
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='custom-color'] {
  grid-column: span 1;
  min-height: 0;
  padding: 14px 8px 16px 0;
  display: block;
  grid-template-rows: none;
  gap: 0;
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='custom-color'] > .control-switch-row {
  display: grid;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 0;
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='color-randomizer'] {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 6px 0 8px;
  display: block;
  grid-template-rows: none;
  gap: 0;
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='color-randomizer'] > .control-switch-row {
  display: grid;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 0;
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='full-width-canvas'] {
  display: none !important;
}

/* Preset actions live in the Studio rail; keep their canonical owners mounted
   for event proxying without duplicating the oversized legacy panel buttons. */
body[data-ui-shell='studio'] #preset-controls {
  display: none !important;
}

body[data-ui-shell='studio'] .control-group > label,
body[data-ui-shell='studio'] .slider-label-row > label,
body[data-ui-shell='studio'] .slider-container > label {
  margin: 0 0 7px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .slider-label-row > label {
  margin-bottom: 0;
}

body[data-ui-shell='studio'] select.control-input,
body[data-ui-shell='studio'] .section-content select,
body[data-ui-shell='studio'] #custom-color-controls select {
  width: 100%;
  min-height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background-color: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  box-shadow: none;
}

body[data-ui-shell='studio'] select.control-input:focus,
body[data-ui-shell='studio'] .section-content select:focus,
body[data-ui-shell='studio'] #custom-color-controls select:focus {
  border-color: var(--studio-primary);
  outline: none;
}

body[data-ui-shell='studio'] .studio-palette-section {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 0 15px;
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .studio-palette-heading,
body[data-ui-shell='studio'] .studio-ratio-heading {
  margin: 0 0 8px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-palette-section #palette-swatch-bar {
  width: 100%;
  max-width: none !important;
  height: 46px;
  margin: 0;
  padding: 0;
  display: flex !important;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--studio-rule-strong);
  background: var(--studio-ink);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .studio-palette-section .palette-swatch {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 44px;
  max-height: none;
  margin: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

body[data-ui-shell='studio'] .studio-palette-section .palette-library-launch {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-left: 1px solid var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .studio-palette-section .palette-swatch:last-child {
  border-right: 0;
}

body[data-ui-shell='studio'] .studio-palette-section .palette-swatch:hover,
body[data-ui-shell='studio'] .studio-palette-section .palette-swatch:focus-visible {
  z-index: 1;
  outline: 2px solid var(--studio-primary);
  outline-offset: 1px;
  transform: translateY(-2px);
}

/* Palette workspace: a compact pigment bench inside the continuous inspector. */
body[data-ui-shell='studio'] .studio-palette-section {
  display: grid;
  gap: 10px;
}

body[data-ui-shell='studio'] .studio-palette-summary {
  display: grid;
  gap: 9px;
}

body[data-ui-shell='studio'] .studio-palette-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

body[data-ui-shell='studio'] .studio-palette-source,
body[data-ui-shell='studio'] .studio-palette-policy {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-palette-source::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  background: var(--studio-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--studio-primary) 30%, transparent);
}

body[data-ui-shell='studio'] .studio-palette-policy[data-policy='held'] {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .studio-palette-name {
  overflow: hidden;
  color: var(--studio-text);
  font-family: var(--studio-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .studio-palette-summary-actions,
body[data-ui-shell='studio'] .studio-palette-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

body[data-ui-shell='studio'] .studio-palette-editor-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-ui-shell='studio'] .studio-palette-action {
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .055em;
  line-height: 1.2;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-palette-action:hover,
body[data-ui-shell='studio'] .studio-palette-action:focus-visible {
  border-color: var(--studio-primary);
  color: var(--studio-text);
  outline: 0;
  box-shadow: inset 0 -2px 0 var(--studio-primary);
}

body[data-ui-shell='studio'] .studio-palette-action--primary {
  border-color: color-mix(in srgb, var(--studio-primary) 58%, var(--studio-rule));
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .studio-palette-action--signal {
  border-color: var(--studio-signal);
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .studio-palette-action:disabled {
  cursor: not-allowed;
  opacity: .42;
}

body[data-ui-shell='studio'] #custom-color-controls.studio-palette-editor {
  display: grid;
  gap: 12px;
  margin: 2px 0 0;
  padding: 13px 0 0;
  border-top: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] #custom-color-controls.studio-palette-editor[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .studio-palette-editor .color-picker-header {
  margin: 0;
  color: var(--studio-primary);
  font-family: var(--studio-font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-palette-name-field {
  display: grid;
  gap: 6px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-palette-name-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 11px;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .studio-palette-editor .color-pickers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 6px;
}

body[data-ui-shell='studio'] .studio-palette-editor .color-picker-container {
  display: grid;
  min-width: 0;
  gap: 5px;
}

body[data-ui-shell='studio'] .studio-palette-editor .color-picker-container label,
body[data-ui-shell='studio'] .studio-palette-editor .slider-container label {
  overflow: hidden;
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .studio-palette-editor input[type='color'] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
}

body[data-ui-shell='studio'] .studio-palette-editor .color-alpha-controls {
  display: grid;
  gap: 5px;
}

body[data-ui-shell='studio'] .studio-palette-editor .slider-container {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}

body[data-ui-shell='studio'] .studio-palette-editor .slider-container span {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  text-align: right;
}

body[data-ui-shell='studio'] .studio-palette-status {
  min-height: 13px;
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  letter-spacing: .045em;
}

body[data-ui-shell='studio'] .studio-palette-section[data-palette-stale='true'] .studio-palette-status,
body[data-ui-shell='studio'] .studio-palette-section[data-palette-status='unavailable'] .studio-palette-status {
  color: var(--studio-danger);
}

@media (max-width: 520px) {
  body[data-ui-shell='studio'] .studio-palette-editor .color-pickers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .studio-palette-action {
    min-height: 46px;
  }
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='ratio'] > select {
  position: absolute;
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body[data-ui-shell='studio'] #controls > .control-group[data-studio-control-group='ratio'] {
  min-height: 0;
  grid-template-rows: 18px auto;
}

body[data-ui-shell='studio'] #studio-ratio-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

body[data-ui-shell='studio'] .studio-ratio-button {
  min-height: 31px;
  padding: 0 4px;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  cursor: pointer;
}

body[data-ui-shell='studio'] .studio-ratio-button:hover,
body[data-ui-shell='studio'] .studio-ratio-button:focus-visible {
  border-color: var(--studio-primary);
  color: var(--studio-text);
  outline: none;
}

body[data-ui-shell='studio'] .studio-ratio-button.is-active,
body[data-ui-shell='studio'] .studio-ratio-button[aria-checked='true'] {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 13%, transparent);
  color: var(--studio-text);
  box-shadow: inset 0 -2px 0 var(--studio-primary);
}

body[data-ui-shell='studio'] #slider-controls {
  display: block !important;
  padding: 0;
}

body[data-ui-shell='studio'] .slider-container.section-header {
  min-height: 44px;
  margin: 18px 0 10px;
  padding: 0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-top: 1px solid var(--studio-rule-strong);
  border-bottom: 1px solid var(--studio-rule);
  cursor: default;
}

body[data-ui-shell='studio'] .slider-container.section-header:hover {
  opacity: 1;
}

body[data-ui-shell='studio'] .slider-container.section-header::after {
  display: none;
}

body[data-ui-shell='studio'] .slider-container.section-header > span {
  padding: 0 0 0 9px;
  border-left-width: 2px;
  background: transparent !important;
  color: var(--studio-text) !important;
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .section-reset-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted) !important;
  opacity: 0.7;
}

body[data-ui-shell='studio'] .slider-container.section-header[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .section-reset-btn:hover,
body[data-ui-shell='studio'] .section-reset-btn:focus-visible {
  border-color: var(--studio-primary);
  background: transparent;
  color: var(--studio-text) !important;
  opacity: 1;
  outline: none;
}

body[data-ui-shell='studio'] .section-content {
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  opacity: 1 !important;
}

body[data-ui-shell='studio'] .section-content.collapsed,
body[data-ui-shell='studio'] .section-content[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .control-switch-row {
  position: relative;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--studio-rule) 62%, transparent);
  color: var(--studio-text);
  cursor: pointer;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .control-switch-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .control-switch-copy :is(small, .control-switch-detail) {
  color: var(--studio-text-muted);
  font-size: 8px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: none;
}

body[data-ui-shell='studio'] .control-switch-row input[type='checkbox'][role='switch'] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .control-switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--studio-panel-raised) 60%, transparent);
  transition: border-color 140ms ease, background-color 140ms ease;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .control-switch-track::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 0;
  background: var(--studio-text-muted);
  transition: transform 140ms ease, background-color 140ms ease;
}

body[data-ui-shell='studio'] .control-switch-row:has(input[type='checkbox'][role='switch']:checked) .control-switch-track,
body[data-ui-shell='studio'] .control-switch-row input[type='checkbox'][role='switch']:checked + .control-switch-track {
  border-color: var(--studio-signal);
  background: color-mix(in srgb, var(--studio-panel) 72%, var(--studio-signal) 28%);
}

body[data-ui-shell='studio'] .control-switch-row:has(input[type='checkbox'][role='switch']:checked) .control-switch-track::before,
body[data-ui-shell='studio'] .control-switch-row input[type='checkbox'][role='switch']:checked + .control-switch-track::before {
  background: var(--studio-signal);
  transform: translateX(18px);
}

body[data-ui-shell='studio'] .control-switch-row:hover .control-switch-copy,
body[data-ui-shell='studio'] .control-switch-row:has(input[type='checkbox'][role='switch']:focus-visible) .control-switch-copy {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .control-switch-row:has(input[type='checkbox'][role='switch']:focus-visible) {
  outline: 1px solid var(--studio-primary);
  outline-offset: -1px;
}

body[data-ui-shell='studio'] .control-switch-row:has(input[type='checkbox'][role='switch']:disabled),
body[data-ui-shell='studio'] .control-dependency-inactive {
  opacity: 0.42;
  filter: saturate(0.45);
}

body[data-ui-shell='studio'] .control-switch-row:has(input[type='checkbox'][role='switch']:disabled),
body[data-ui-shell='studio'] .control-dependency-inactive :is(label, input, select, button) {
  cursor: not-allowed;
}

body[data-ui-shell='studio'] .slider-container .slider-value-tooltip {
  grid-column: 1 / -1 !important;
  pointer-events: none;
}

body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) {
  margin: 0;
  padding: 10px 0 12px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 43px;
  align-items: center;
  gap: 7px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--studio-rule) 56%, transparent);
}

body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) .slider-label-row {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) input[type='range'] {
  grid-column: 1;
  width: 100%;
  height: 3px;
  margin: 0;
  border-radius: 0;
  background: var(--studio-rule-strong);
  box-shadow: none;
  accent-color: var(--studio-primary);
}

body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) > span[id$='-value'] {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  text-align: right;
}

body[data-ui-shell='studio'] .section-content .slider-container input[type='range']::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--studio-panel);
  border-radius: 0;
  background: var(--studio-primary);
  box-shadow: 0 0 0 1px var(--studio-primary);
}

body[data-ui-shell='studio'] .section-content .slider-container input[type='range']::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--studio-panel);
  border-radius: 0;
  background: var(--studio-primary);
  box-shadow: 0 0 0 1px var(--studio-primary);
}

body[data-ui-shell='studio'] .slider-lock-btn {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: var(--studio-text-muted);
  font-size: 10px;
  opacity: 0.55;
  box-shadow: none !important;
}

body[data-ui-shell='studio'] .slider-lock-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

body[data-ui-shell='studio'].shuffle-mode-active .slider-lock-btn {
  display: inline-grid;
  place-items: center;
}

body[data-ui-shell='studio'] .slider-lock-btn:hover,
body[data-ui-shell='studio'] .slider-lock-btn:focus-visible {
  color: var(--studio-text);
  opacity: 1;
  background: transparent !important;
}

body[data-ui-shell='studio'] .slider-lock-btn:focus-visible {
  outline: 1px solid var(--studio-primary);
  outline-offset: 2px;
}

body[data-ui-shell='studio'] .slider-lock-btn.locked {
  border: 0 !important;
  background: transparent !important;
  color: var(--studio-signal) !important;
  opacity: 1;
  box-shadow: none !important;
}

body[data-ui-shell='studio'] .tf-revision-lock-btn {
  appearance: none;
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin: 0;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--studio-text-muted) !important;
  cursor: pointer;
  opacity: 0.68;
  box-shadow: none !important;
  touch-action: manipulation;
}

body[data-ui-shell='studio'] .tf-revision-lock-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

body[data-ui-shell='studio'] .tf-revision-lock-btn:hover {
  border-color: var(--studio-rule-strong) !important;
  color: var(--studio-text) !important;
  opacity: 1;
}

body[data-ui-shell='studio'] .tf-revision-lock-btn:focus-visible {
  outline: 1px solid var(--studio-primary);
  outline-offset: 2px;
  color: var(--studio-primary) !important;
  opacity: 1;
}

body[data-ui-shell='studio'] .tf-revision-lock-btn.locked {
  border-color: color-mix(in srgb, var(--studio-primary) 68%, var(--studio-rule)) !important;
  background: color-mix(in srgb, var(--studio-panel) 76%, var(--studio-primary) 24%) !important;
  color: var(--studio-primary) !important;
  opacity: 1;
}

body[data-ui-shell='studio'] .control-manual-badge {
  min-width: 42px;
  padding: 3px 5px 2px;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 55%, var(--studio-rule));
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .section-toggle-btn {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 10px 0 0;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--studio-text);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

body[data-ui-shell='studio'] .section-toggle-btn:not(:has(.section-index)) {
  grid-template-columns: minmax(0, 1fr) auto 16px;
  padding-left: 14px;
}

body[data-ui-shell='studio'] .section-toggle-btn:not(:has(.section-index)) .section-title {
  grid-column: 1;
}

body[data-ui-shell='studio'] .section-toggle-btn:not(:has(.section-index)) .section-manual-badge {
  grid-column: 2;
}

body[data-ui-shell='studio'] .section-toggle-btn:not(:has(.section-index)) .section-chevron {
  grid-column: 3;
}

body[data-ui-shell='studio'] .section-toggle-btn:not(:has(.section-index)):not(:has(.section-manual-badge)) {
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 6px;
  padding-right: 6px;
}

body[data-ui-shell='studio'] .section-toggle-btn:not(:has(.section-index)):not(:has(.section-manual-badge)) .section-chevron {
  grid-column: 2;
}

body[data-ui-shell='studio'] .section-toggle-btn > span {
  flex: none;
  border-left: 0;
  background: transparent;
}

body.dark-mode[data-ui-shell='studio'] .section-toggle-btn > span {
  border-left-color: transparent;
  background: transparent;
}

body.dark-mode[data-ui-shell='studio'] .section-toggle-btn > .section-index,
body.dark-mode[data-ui-shell='studio'] .section-toggle-btn > .section-manual-badge {
  color: var(--studio-primary);
}

body.dark-mode[data-ui-shell='studio'] .section-toggle-btn > .section-title {
  color: var(--studio-text);
}

body.dark-mode[data-ui-shell='studio'] .section-toggle-btn > .section-chevron {
  color: var(--studio-text-muted);
}

body.dark-mode[data-ui-shell='studio'] .section-toggle-btn:hover > .section-chevron,
body.dark-mode[data-ui-shell='studio'] .section-toggle-btn:focus-visible > .section-chevron {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .section-toggle-btn:hover {
  background: color-mix(in srgb, var(--studio-primary) 7%, transparent);
}

body[data-ui-shell='studio'] .section-toggle-btn:focus-visible {
  outline: 1px solid var(--studio-primary);
  outline-offset: -1px;
}

body[data-ui-shell='studio'] .section-index {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--studio-rule);
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
}

body[data-ui-shell='studio'] .section-title {
  min-width: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .section-manual-badge {
  grid-column: 3;
  min-width: 0;
  padding: 4px 6px 3px;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 52%, var(--studio-rule));
  border-radius: 0;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .section-toggle-btn .section-chevron {
  grid-column: 4;
  width: 16px;
  color: var(--studio-text-muted);
  font-size: 11px;
  line-height: 1;
  text-align: center;
  transform: rotate(0deg);
  transition: transform 150ms ease, color 150ms ease;
}

body[data-ui-shell='studio'] .section-toggle-btn[aria-expanded='false'] .section-chevron,
body[data-ui-shell='studio'] .section-header.collapsed .section-toggle-btn .section-chevron {
  transform: rotate(-90deg);
}

body[data-ui-shell='studio'] .section-toggle-btn:hover .section-chevron,
body[data-ui-shell='studio'] .section-toggle-btn:focus-visible .section-chevron {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .slider-container.section-header[data-section$='digital-expressionism-live-motion'],
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='typoflow-live-painting'],
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='typoflow-revision-layers'] {
  margin-top: 2px !important;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--studio-signal) 58%, var(--studio-rule));
  border-bottom: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 11%, transparent), transparent 68%),
    var(--studio-panel-raised) !important;
}

body[data-ui-shell='studio'] .slider-container.section-header.collapsed[data-section$='digital-expressionism-live-motion'] {
  border-bottom: 1px solid color-mix(in srgb, var(--studio-signal) 58%, var(--studio-rule));
}

body[data-ui-shell='studio'] .slider-container.section-header.collapsed[data-section$='typoflow-live-painting'],
body[data-ui-shell='studio'] .slider-container.section-header.collapsed[data-section$='typoflow-revision-layers'] {
  border-bottom: 1px solid color-mix(in srgb, var(--studio-signal) 58%, var(--studio-rule));
}

body[data-ui-shell='studio'] .slider-container.section-header[data-section$='digital-expressionism-live-motion'] .section-index,
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='digital-expressionism-live-motion'] .section-chevron,
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='typoflow-live-painting'] .section-index,
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='typoflow-live-painting'] .section-chevron,
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='typoflow-revision-layers'] .section-index,
body[data-ui-shell='studio'] .slider-container.section-header[data-section$='typoflow-revision-layers'] .section-chevron {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .section-content[data-section-content$='digital-expressionism-live-motion'],
body[data-ui-shell='studio'] .section-content[data-section-content$='typoflow-live-painting'],
body[data-ui-shell='studio'] .section-content[data-section-content$='typoflow-revision-layers'] {
  padding: 0 10px 12px !important;
  border: 1px solid color-mix(in srgb, var(--studio-signal) 58%, var(--studio-rule));
  border-top: 0;
  background: color-mix(in srgb, var(--studio-panel-raised) 92%, var(--studio-signal) 8%);
}

body[data-ui-shell='studio'] .de-motion-status,
body[data-ui-shell='studio'] .tf-painting-status {
  min-height: 35px;
  margin: 0 -10px 2px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--studio-primary) 40%, var(--studio-rule));
  border-bottom: 1px solid var(--studio-rule);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.045em;
}

body[data-ui-shell='studio'] .de-motion-status-dot,
body[data-ui-shell='studio'] .tf-painting-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--studio-text-muted);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-text-muted) 20%, transparent);
}

body[data-ui-shell='studio'] .section-content.is-de-motion-running .de-motion-status,
body[data-ui-shell='studio'] .section-content.is-tf-painting-running .tf-painting-status {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .section-content.is-de-motion-running .de-motion-status-dot,
body[data-ui-shell='studio'] .section-content.is-tf-painting-running .tf-painting-status-dot {
  background: var(--studio-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 22%, transparent);
  animation: de-motion-pulse 1.5s ease-in-out infinite;
}

body[data-ui-shell='studio'] .section-content .de-animation-toggle,
body[data-ui-shell='studio'] .section-content .de-animation-save,
body[data-ui-shell='studio'] .section-content .tf-animation-toggle,
body[data-ui-shell='studio'] .section-content .tf-animation-save {
  width: 100%;
  min-height: 44px;
  margin-top: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
}

body[data-ui-shell='studio'] .section-content .de-animation-toggle,
body[data-ui-shell='studio'] .section-content .tf-animation-toggle {
  border: 1px solid var(--studio-signal) !important;
  background: var(--studio-signal) !important;
  color: #fff !important;
}

body[data-ui-shell='studio'] .section-content .de-animation-toggle[data-state='running'],
body[data-ui-shell='studio'] .section-content .tf-animation-toggle[data-state='running'] {
  border-color: var(--studio-signal) !important;
  background: color-mix(in srgb, var(--studio-panel) 76%, var(--studio-signal) 24%) !important;
  color: var(--studio-text) !important;
}

body[data-ui-shell='studio'] .section-content .tf-animation-save {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 72%, var(--studio-rule)) !important;
  background: color-mix(in srgb, var(--studio-panel-raised) 90%, var(--studio-primary) 10%) !important;
  color: var(--studio-text) !important;
  box-shadow: inset 3px 0 0 var(--studio-primary);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

body[data-ui-shell='studio'] .section-content .tf-painting-export-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

body[data-ui-shell='studio'] .section-content .tf-painting-export-row > .control-group {
  min-width: 0;
  margin: 0;
}

body[data-ui-shell='studio'] .section-content .tf-painting-export-row .tf-painting-export-action {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding-inline: 8px;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .section-content .tf-painting-export-action[data-state='blocked'] {
  cursor: wait;
  opacity: 0.42;
}

body[data-ui-shell='studio'] .section-content .tf-animation-save::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--studio-primary) 18%, transparent) 48%, transparent 100%);
  transform: translateX(-105%);
}

body[data-ui-shell='studio'] .section-content .tf-animation-save:hover,
body[data-ui-shell='studio'] .section-content .tf-animation-save:focus-visible {
  border-color: var(--studio-primary) !important;
  background: color-mix(in srgb, var(--studio-panel-raised) 80%, var(--studio-primary) 20%) !important;
  box-shadow: inset 3px 0 0 var(--studio-primary), 0 0 0 1px color-mix(in srgb, var(--studio-primary) 24%, transparent);
}

body[data-ui-shell='studio'] .section-content .tf-animation-save:active {
  transform: translateY(1px);
}

body[data-ui-shell='studio'] .section-content .tf-animation-save:is(
  [aria-busy='true'],
  [data-state='active'],
  [data-state='recording'],
  [data-state='rendering'],
  [data-state='encoding'],
  [data-state='saving'],
  .recording,
  .is-recording,
  .is-saving
) {
  border-color: var(--studio-signal) !important;
  background: color-mix(in srgb, var(--studio-panel-raised) 74%, var(--studio-signal) 26%) !important;
  color: var(--studio-text) !important;
  box-shadow: inset 3px 0 0 var(--studio-signal), 0 0 0 1px color-mix(in srgb, var(--studio-signal) 20%, transparent);
}

body[data-ui-shell='studio'] .section-content .tf-animation-save:is(
  [aria-busy='true'],
  [data-state='active'],
  [data-state='recording'],
  [data-state='rendering'],
  [data-state='encoding'],
  [data-state='saving'],
  .recording,
  .is-recording,
  .is-saving
)::before {
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--studio-signal) 32%, transparent) 48%, transparent 100%);
  animation: studio-tf-gif-scan 1.8s linear infinite;
}

body[data-ui-shell='studio'] .section-content .tf-animation-save:is(
  [data-state='cancel'],
  [data-state='cancelling'],
  .is-cancel,
  .is-cancelling
) {
  border-color: var(--studio-danger) !important;
  background: color-mix(in srgb, var(--studio-panel-raised) 74%, var(--studio-danger) 26%) !important;
  box-shadow: inset 3px 0 0 var(--studio-danger);
}

body[data-ui-shell='studio'] .section-content .tf-animation-save:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

body[data-ui-shell='studio'] .section-content .tf-painting-export-action:disabled[data-state='blocked'] {
  opacity: 0.42;
}

@keyframes studio-tf-gif-scan {
  from { transform: translateX(-105%); }
  to { transform: translateX(105%); }
}

body[data-ui-shell='studio'] #typoflow-gif-progress,
body[data-ui-shell='studio'] .typoflow-gif-progress {
  position: fixed;
  z-index: 10000;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100vw - 40px));
  min-width: 0;
  padding: 0 18px 18px;
  box-sizing: border-box;
  border: 1px solid var(--studio-rule-strong);
  border-top-color: var(--studio-signal);
  border-radius: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--studio-primary) 7%, transparent), transparent 48%),
    var(--studio-panel);
  color: var(--studio-text);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.48), inset 0 3px 0 var(--studio-signal);
  font-family: var(--studio-font-data);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 10px));
  transition: opacity 180ms ease, visibility 0s linear 180ms, transform 180ms ease;
}

body[data-ui-shell='studio'] #typoflow-gif-progress.active,
body[data-ui-shell='studio'] .typoflow-gif-progress.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, visibility 0s linear 0s, transform 180ms ease;
}

body[data-ui-shell='studio'] .typoflow-progress-title {
  min-height: 48px;
  margin: 0 -18px 18px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--studio-rule);
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .typoflow-progress-title::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--studio-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 18%, transparent);
  animation: de-motion-pulse 1.5s ease-in-out infinite;
}

body[data-ui-shell='studio'] .typoflow-progress-bar-bg {
  width: 100%;
  height: 7px;
  margin: 0 0 13px;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-ink) 74%, var(--studio-panel-raised) 26%);
}

body[data-ui-shell='studio'] .typoflow-progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: 0;
  background: var(--studio-primary);
  box-shadow: 0 0 14px color-mix(in srgb, var(--studio-primary) 42%, transparent);
  transition: width 220ms linear, background-color 160ms ease;
}

body[data-ui-shell='studio'] .typoflow-progress-bar-fill.is-indeterminate {
  animation: studio-tf-gif-progress 1.15s ease-in-out infinite alternate;
}

@keyframes studio-tf-gif-progress {
  from { transform: translateX(-105%); }
  to { transform: translateX(455%); }
}

body[data-ui-shell='studio'] .typoflow-progress-bar-fill.mid-progress {
  background: var(--studio-signal);
  box-shadow: 0 0 14px color-mix(in srgb, var(--studio-signal) 42%, transparent);
}

body[data-ui-shell='studio'] .typoflow-progress-bar-fill.complete {
  background: var(--studio-primary);
  box-shadow: 0 0 18px color-mix(in srgb, var(--studio-primary) 55%, transparent);
}

body[data-ui-shell='studio'] .typoflow-progress-text {
  min-height: 18px;
  margin: 0;
  color: var(--studio-text-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .typoflow-progress-cancel {
  width: 100%;
  min-height: 40px;
  margin: 16px 0 0;
  padding: 0 16px;
  border: 1px solid var(--studio-danger);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-panel-raised) 88%, var(--studio-danger) 12%);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

body[data-ui-shell='studio'] .typoflow-progress-cancel:hover,
body[data-ui-shell='studio'] .typoflow-progress-cancel:focus-visible {
  background: var(--studio-danger);
  color: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--studio-danger) 30%, transparent);
}

@media (max-width: 600px) {
  body[data-ui-shell='studio'] #typoflow-gif-progress,
  body[data-ui-shell='studio'] .typoflow-gif-progress {
    top: max(50%, calc(env(safe-area-inset-top) + 180px));
    width: calc(100vw - 24px);
    padding: 0 14px 14px;
  }

  body[data-ui-shell='studio'] .typoflow-progress-title {
    min-height: 44px;
    margin-right: -14px;
    margin-bottom: 14px;
    margin-left: -14px;
    padding: 0 14px;
    font-size: 17px;
  }

  body[data-ui-shell='studio'] .typoflow-progress-cancel {
    min-height: 44px;
    margin-top: 14px;
  }
}

body[data-ui-shell='studio'] .section-content .tf-revision-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  gap: 6px;
  align-items: stretch;
  margin-top: 9px;
}

body[data-ui-shell='studio'] .section-content .tf-revision-command-row > .control-group {
  min-width: 0;
  margin: 0;
  padding: 0;
}

body[data-ui-shell='studio'] .section-content .tf-revision-toolbar-action {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  border: 1px solid var(--studio-rule-strong) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--studio-text-muted) !important;
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .section-content .tf-revision-random-toggle[aria-pressed='true'] {
  border-color: var(--studio-signal) !important;
  background: color-mix(in srgb, var(--studio-panel) 82%, var(--studio-signal) 18%) !important;
  color: var(--studio-signal) !important;
}

body[data-ui-shell='studio'] .section-content .tf-revision-icon-action {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--studio-text-muted) !important;
}

body[data-ui-shell='studio'] .section-content .tf-revision-icon-action .control-button-icon {
  display: grid;
  place-items: center;
}

body[data-ui-shell='studio'] .section-content .tf-revision-icon-action svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

body[data-ui-shell='studio'] .section-content .tf-revision-toolbar-action:hover:not(:disabled),
body[data-ui-shell='studio'] .section-content .tf-revision-toolbar-action:focus-visible {
  border-color: var(--studio-signal) !important;
  color: var(--studio-text) !important;
}

body[data-ui-shell='studio'] .section-content .tf-revision-toolbar-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

body[data-ui-shell='studio'] .section-content .de-animation-save {
  border: 1px solid var(--studio-rule-strong) !important;
  background: transparent !important;
  color: var(--studio-text) !important;
}

@keyframes de-motion-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] .section-content.is-de-motion-running .de-motion-status-dot,
  body[data-ui-shell='studio'] .section-content.is-tf-painting-running .tf-painting-status-dot,
  body[data-ui-shell='studio'] .section-content .tf-animation-save::before,
  body[data-ui-shell='studio'] .typoflow-progress-title::before,
  body[data-ui-shell='studio'] .typoflow-progress-bar-fill.is-indeterminate {
    animation: none;
  }
}

/* Canonical action owners remain in the DOM for Studio proxies, but the retired
   toolbar must never re-enter the responsive layout. */
body[data-ui-shell='studio'] #generate-save-controls {
  display: none !important;
}

@media (min-width: 1025px) {
  body[data-ui-shell='studio'] > .app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
  }

  body[data-ui-shell='studio'] .main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--studio-rail-width) var(--studio-inspector-width);
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100vh - var(--studio-header-height));
    overflow: hidden;
  }

  body[data-ui-shell='studio'] .canvas-column {
    grid-column: 1;
    min-width: 0;
    min-height: 0;
    padding: 16px 18px 18px;
    overflow: hidden;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
      linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px);
    background-size: 32px 32px;
  }

  body[data-ui-shell='studio']:not(.dark-mode) .canvas-column {
    background:
      linear-gradient(90deg, rgba(22, 27, 30, 0.035) 1px, transparent 1px),
      linear-gradient(rgba(22, 27, 30, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
  }

  body[data-ui-shell='studio'] #studio-tool-rail {
    grid-column: 2;
    display: flex;
    min-width: var(--studio-rail-width);
    min-height: 0;
    border-left: 1px solid var(--studio-rule);
    border-right: 1px solid var(--studio-rule);
    background: var(--studio-panel);
    position: relative;
    z-index: 80;
  }

  body[data-ui-shell='studio'] .studio-rail-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action {
    width: 100%;
    min-height: 82px;
    padding: 11px 3px 9px;
    border-bottom: 1px solid var(--studio-rule);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action::after {
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
    transform: scaleY(0.3);
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action.is-active::after,
  body[data-ui-shell='studio'] .studio-rail-actions .studio-action.active::after,
  body[data-ui-shell='studio'] .studio-rail-actions .studio-action[aria-pressed='true']::after,
  body[data-ui-shell='studio'] .studio-rail-actions .studio-action[aria-expanded='true']::after {
    transform: scaleY(1);
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action-group-start {
    border-top: 7px solid var(--studio-ink);
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action-label {
    max-width: 50px;
    font-size: 7px;
    line-height: 1.25;
    letter-spacing: 0.055em;
    text-align: center;
    white-space: normal;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action-badge {
    position: absolute;
    top: 8px;
    right: 4px;
  }

  body[data-ui-shell='studio'] .controls-column {
    grid-column: 3;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    padding: 18px 16px 36px;
    border: 0;
    background: var(--studio-panel);
    backdrop-filter: none;
    box-shadow: none;
    position: relative;
    top: auto;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-rule-strong) transparent;
  }

  body[data-ui-shell='studio'] .controls-column::-webkit-scrollbar,
  body[data-ui-shell='studio'] .studio-rail-actions::-webkit-scrollbar {
    width: 6px;
  }

  body[data-ui-shell='studio'] .controls-column::-webkit-scrollbar-thumb,
  body[data-ui-shell='studio'] .studio-rail-actions::-webkit-scrollbar-thumb {
    background: var(--studio-rule-strong);
    border-radius: 0;
  }

  body[data-ui-shell='studio'] .canvas-outer-container,
  body[data-ui-shell='studio'] #canvas-wrapper {
    min-height: 0;
  }

  body[data-ui-shell='studio'] #canvas-wrapper {
    border: 1px solid var(--studio-rule);
    border-radius: 1px;
    background: var(--studio-ink);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }

  body[data-ui-shell='studio'] .header-container {
    min-height: 0;
    height: 0;
    margin: 0;
    overflow: visible;
  }

  body[data-ui-shell='studio'] .header-container > * {
    display: none !important;
  }

}

@media (max-width: 1024px) {
  body[data-ui-shell='studio'] .section-content .tf-revision-command-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }

  body[data-ui-shell='studio'] .section-content .tf-revision-toolbar-action {
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .tf-revision-lock-btn {
    flex-basis: 44px;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  body[data-ui-shell='studio'] .tf-revision-lock-btn svg {
    width: 16px;
    height: 16px;
  }

  body[data-ui-shell='studio'] .section-toggle-btn,
  body[data-ui-shell='studio'] .section-reset-btn,
  body[data-ui-shell='studio'] .control-switch-row {
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .section-title,
  body[data-ui-shell='studio'] .control-switch-copy,
  body[data-ui-shell='studio'] .section-content .slider-label-row > label {
    font-size: 10px;
  }

  body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) {
    min-height: 72px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) input[type='range'] {
    min-height: 44px;
    height: 44px;
    background: linear-gradient(var(--studio-rule-strong), var(--studio-rule-strong)) center / 100% 3px no-repeat;
  }

  body[data-ui-shell='studio'] .section-content .slider-container input[type='range']::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  body[data-ui-shell='studio'] .section-content .slider-container input[type='range']::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  body[data-ui-shell='studio'] .section-content .slider-container:has(input[type='range']) > span[id$='-value'],
  body[data-ui-shell='studio'] .de-motion-status {
    font-size: 10px;
  }

  body[data-ui-shell='studio'] .section-content select,
  body[data-ui-shell='studio'] .control-switch-group {
    min-height: 44px;
  }

  body[data-ui-shell='studio'] {
    overflow-y: auto;
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  body[data-ui-shell='studio'] #studio-command-header {
    flex: 0 0 58px;
    min-height: 58px;
    height: 58px;
    padding: 0 118px 0 12px;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  body[data-ui-shell='studio'] .studio-wordmark {
    font-size: 20px;
  }

  body[data-ui-shell='studio'] .studio-wordmark::after {
    display: none;
  }

  body[data-ui-shell='studio'] .studio-theme-action,
  body[data-ui-shell='studio'] .studio-shortcuts-action {
    top: 7px;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
  }

  body[data-ui-shell='studio'] .studio-theme-action {
    right: 12px;
  }

  body[data-ui-shell='studio'] .studio-shortcuts-action {
    right: 64px;
  }

  body[data-ui-shell='studio'] .studio-header-actions {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-ui-shell='studio'] .studio-header-actions::-webkit-scrollbar {
    display: none;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action {
    min-width: 56px;
    padding-right: 8px;
    padding-left: 8px;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child {
    min-width: 52px;
    width: 52px;
    height: 42px;
    margin-right: 4px;
    padding: 0;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action-label,
  body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child .studio-action-label {
    display: none;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action[data-studio-action='create'] {
    display: none !important;
  }

  body[data-ui-shell='studio'] .main-content {
    display: block;
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  body[data-ui-shell='studio'] .canvas-column {
    width: 100%;
    min-height: calc(100vh - 124px);
    padding: 12px 10px 18px;
    box-sizing: border-box;
  }

  body[data-ui-shell='studio'] .canvas-outer-container {
    align-items: flex-start;
    justify-content: center;
  }

  body[data-ui-shell='studio'] #studio-tool-rail {
    display: flex !important;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 910;
    width: 100%;
    height: calc(66px + env(safe-area-inset-bottom));
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    border-top: 1px solid var(--studio-rule-strong);
    background: color-mix(in srgb, var(--studio-panel) 96%, transparent);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
  }

  body[data-ui-shell='studio'] .studio-rail-actions {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  body[data-ui-shell='studio'] .studio-rail-actions::-webkit-scrollbar {
    display: none;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action,
  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle {
    flex: 0 0 70px;
    min-width: 70px;
    height: 65px;
    padding: 8px 4px 6px;
    border: 0;
    border-right: 1px solid var(--studio-rule);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--studio-text-muted);
    scroll-snap-align: start;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action::after {
    right: 13px;
    bottom: 0;
    left: 13px;
    height: 2px;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action-icon svg,
  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: square;
    stroke-linejoin: miter;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action-label,
  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle .studio-action-label {
    display: block;
    max-width: 66px;
    color: inherit;
    font-family: var(--studio-font-data);
    font-size: 6.5px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.045em;
    text-align: center;
    text-transform: uppercase;
    white-space: normal;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action-badge {
    position: absolute;
    top: 7px;
    right: 5px;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle {
    appearance: none;
    cursor: pointer;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action[data-studio-action='mobile-create'] {
    display: flex !important;
    flex-basis: 78px;
    min-width: 78px;
    border-right-color: color-mix(in srgb, var(--studio-signal) 48%, var(--studio-rule));
    background: var(--studio-signal);
    color: var(--studio-vermilion-ink);
    box-shadow: inset 0 2px 0 color-mix(in srgb, #fff 24%, transparent);
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action[data-studio-action='mobile-create']:hover,
  body[data-ui-shell='studio'] .studio-rail-actions .studio-action[data-studio-action='mobile-create']:focus-visible {
    background: var(--studio-vermilion-hover);
    color: var(--studio-vermilion-ink);
    outline: none;
  }

  body[data-ui-shell='studio'] .studio-rail-actions .studio-action[data-studio-action='mobile-create']::after {
    display: none;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle:hover,
  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle:focus-visible,
  body[data-ui-shell='studio'] #studio-mobile-inspector-toggle[aria-expanded='true'] {
    color: var(--studio-text);
    background: color-mix(in srgb, var(--studio-primary) 10%, transparent);
    outline: none;
    box-shadow: inset 0 -2px 0 var(--studio-primary);
  }

  body[data-ui-shell='studio'] .controls-column {
    display: block !important;
    position: fixed;
    top: 58px;
    right: 0;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 940;
    width: min(420px, 100vw);
    max-width: 100vw;
    height: auto;
    min-height: 0;
    padding: 0 18px 44px;
    border: 0;
    border-left: 1px solid var(--studio-rule-strong);
    background: var(--studio-panel);
    box-shadow: -22px 0 48px rgba(0, 0, 0, 0.38);
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(calc(100% + 24px));
    transition: transform 190ms ease;
    visibility: hidden;
    pointer-events: none;
    box-sizing: border-box;
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-open .controls-column {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body[data-ui-shell='studio'] #controls-wrapper {
    display: block !important;
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-open {
    overflow: hidden;
  }

  body[data-ui-shell='studio'] .controls-column .studio-inspector-heading {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 6px 12px;
    margin: 0 -18px 18px;
    padding: 14px 14px 14px 18px;
    border-bottom: 1px solid var(--studio-rule-strong);
    background: color-mix(in srgb, var(--studio-panel) 97%, transparent);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(16px) saturate(0.9);
  }

  body[data-ui-shell='studio'] .controls-column .studio-inspector-title,
  body[data-ui-shell='studio'] .controls-column .studio-inspector-status {
    grid-column: 1;
    min-width: 0;
  }

  body[data-ui-shell='studio'] .controls-column .studio-inspector-status {
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-close {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0 !important;
    border: 1px solid var(--studio-rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--studio-text-muted);
    line-height: 0;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: none;
    transform: none !important;
    overflow: visible;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-close::before,
  body[data-ui-shell='studio'] #studio-mobile-inspector-expand::before,
  body[data-ui-shell='studio'] #studio-mobile-inspector-handle::before {
    display: none;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-close svg,
  body[data-ui-shell='studio'] #studio-mobile-inspector-expand svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: square;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-close:hover,
  body[data-ui-shell='studio'] #studio-mobile-inspector-close:focus-visible {
    border-color: var(--studio-primary);
    color: var(--studio-text);
    outline: none;
  }

  body[data-ui-shell='studio'] #studio-mobile-scrim {
    position: fixed;
    inset: 58px 0 calc(66px + env(safe-area-inset-bottom));
    z-index: 930;
    display: block;
    border: 0;
    background: rgba(4, 7, 9, 0.68);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 190ms ease, visibility 190ms ease;
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-open #studio-mobile-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 600px) {
  body[data-ui-shell='studio'] #studio-command-header {
    padding-right: 108px;
    padding-left: 6px;
  }

  body[data-ui-shell='studio'] .studio-wordmark {
    display: none;
  }

  body[data-ui-shell='studio'] .studio-theme-action {
    right: 8px;
  }

  body[data-ui-shell='studio'] .studio-shortcuts-action {
    right: 60px;
  }

  body[data-ui-shell='studio'] .shortcuts-overlay {
    padding: 10px;
  }

  body[data-ui-shell='studio'] .shortcuts-panel {
    max-height: calc(100vh - 20px);
  }

  body[data-ui-shell='studio'] .shortcuts-list {
    grid-template-columns: 1fr;
    padding-right: 16px;
    padding-left: 16px;
  }

  body[data-ui-shell='studio'] .shortcuts-header,
  body[data-ui-shell='studio'] .shortcuts-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  body[data-ui-shell='studio'] .cb-preview-overlay {
    padding: 58px 12px 48px;
  }

  body[data-ui-shell='studio'] .cb-preview-overlay::before {
    top: 20px;
    left: 12px;
  }

  body[data-ui-shell='studio'] .cb-preview-overlay::after {
    right: 12px;
    bottom: 18px;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action {
    min-width: 50px;
  }

  body[data-ui-shell='studio'] .controls-column {
    top: auto !important;
    right: 0 !important;
    bottom: calc(66px + env(safe-area-inset-bottom));
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: var(--studio-mobile-sheet-height, min(52dvh, 520px));
    max-height: calc(100dvh - 66px - env(safe-area-inset-bottom) - max(12px, env(safe-area-inset-top)));
    min-height: min(300px, calc(100dvh - 66px - env(safe-area-inset-bottom)));
    padding-top: 0;
    padding-right: 14px;
    padding-bottom: 40px;
    padding-left: 14px;
    border-top: 1px solid var(--studio-rule-strong);
    border-left: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.46), 0 -1px 0 color-mix(in srgb, var(--studio-primary) 20%, transparent);
    transform: translateY(calc(100% + 24px));
    transition: transform 240ms cubic-bezier(0.2, 0.75, 0.25, 1),
      height 240ms cubic-bezier(0.2, 0.75, 0.25, 1);
    box-sizing: border-box !important;
    overscroll-behavior: contain;
  }

  /* 2D canvases retain pinch/scroll gestures without browser double-tap zoom.
     OrbitControls keeps its inline touch-action:none authority for Three modes. */
  body[data-ui-shell='studio'] #canvas-container canvas {
    touch-action: manipulation;
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-open .controls-column {
    transform: translateY(0);
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-expanded .controls-column {
    height: calc(100dvh - 66px - env(safe-area-inset-bottom) - max(12px, env(safe-area-inset-top)));
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-dragging .controls-column {
    transition: none;
  }

  body[data-ui-shell='studio'] .controls-column .studio-inspector-heading {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: 28px auto auto;
    gap: 4px 8px;
    margin-right: -14px;
    margin-left: -14px;
    padding: 4px 10px 12px 14px;
    border-radius: 16px 16px 0 0;
  }

  body[data-ui-shell='studio'] .controls-column .studio-inspector-title {
    grid-column: 1;
    grid-row: 2;
    font-size: 20px;
  }

  body[data-ui-shell='studio'] .controls-column .studio-inspector-status {
    grid-column: 1;
    grid-row: 3;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-handle {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    height: 28px;
    min-height: 28px;
    margin: 0;
    padding: 0 !important;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--studio-text-muted);
    box-shadow: none;
    transform: none !important;
    overflow: visible;
    cursor: ns-resize;
    touch-action: none;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-handle > span {
    width: 48px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--studio-text-muted) 62%, transparent);
    transition: width 150ms ease, background-color 150ms ease;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-handle:hover > span,
  body[data-ui-shell='studio'] #studio-mobile-inspector-handle:focus-visible > span {
    width: 58px;
    background: var(--studio-primary);
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-expand {
    appearance: none;
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 !important;
    display: grid;
    place-items: center;
    border: 1px solid var(--studio-rule-strong);
    border-radius: 0;
    background: transparent;
    color: var(--studio-text-muted);
    line-height: 0;
    box-sizing: border-box;
    box-shadow: none;
    transform: none !important;
    overflow: visible;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-close {
    grid-column: 3;
    grid-row: 2 / span 2;
  }

  body[data-ui-shell='studio'] #studio-mobile-inspector-expand:hover,
  body[data-ui-shell='studio'] #studio-mobile-inspector-expand:focus-visible,
  body[data-ui-shell='studio'] #studio-mobile-inspector-expand[aria-expanded='true'] {
    border-color: var(--studio-primary);
    color: var(--studio-text);
    outline: none;
  }

  body[data-ui-shell='studio'] #studio-mobile-scrim {
    background: linear-gradient(to bottom, transparent 0 54%, rgba(4, 7, 9, 0.14) 100%);
    backdrop-filter: none;
  }

  body[data-ui-shell='studio'].studio-mobile-inspector-expanded #studio-mobile-scrim {
    background: rgba(4, 7, 9, 0.34);
  }
}

/* Presentation consoles */
body[data-ui-shell='studio'] .presentation-dialog-overlay {
  position: fixed;
  z-index: 11200;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(rgba(4, 7, 9, 0.8), rgba(4, 7, 9, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(107, 130, 255, 0.038) 71px 72px);
  backdrop-filter: blur(8px) saturate(0.78);
}

body[data-ui-shell='studio'] .presentation-dialog-overlay[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'].presentation-dialog-open {
  overflow: hidden;
}

body[data-ui-shell='studio'] .presentation-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1100px, 100%);
  max-height: min(780px, calc(100dvh - 56px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--studio-primary) 5%, transparent), transparent 34%),
    var(--studio-panel);
  color: var(--studio-text);
  color-scheme: dark;
  box-shadow:
    0 38px 96px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(0, 0, 0, 0.46);
  animation: studio-presentation-dialog-in 160ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

body[data-ui-shell='studio'] .presentation-dialog::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -1px;
  left: -1px;
  width: 152px;
  height: 2px;
  background: var(--studio-primary);
  pointer-events: none;
}

body[data-ui-shell='studio'] .live-console::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: -1px;
  left: 151px;
  width: 24px;
  height: 2px;
  background: var(--studio-signal);
  pointer-events: none;
}

@keyframes studio-presentation-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body[data-ui-shell='studio'] .presentation-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 94px;
  padding: 18px 20px 17px 24px;
  border-bottom: 1px solid var(--studio-rule);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 8%, transparent), transparent 46%),
    color-mix(in srgb, var(--studio-panel-raised) 50%, transparent);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .live-console-header {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 7%, transparent), transparent 32%),
    color-mix(in srgb, var(--studio-panel-raised) 50%, transparent);
}

body[data-ui-shell='studio'] .presentation-dialog-heading {
  min-width: 0;
}

body[data-ui-shell='studio'] .presentation-dialog-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .live-console .presentation-dialog-kicker {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .presentation-dialog-heading h2 {
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .presentation-dialog-heading p {
  max-width: 660px;
  margin: 7px 0 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 12px;
  line-height: 1.45;
}

body[data-ui-shell='studio'] .presentation-dialog-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}

body[data-ui-shell='studio'] .presentation-dialog-close {
  appearance: none;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-panel-raised) 56%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: border-color 130ms ease, color 130ms ease, box-shadow 130ms ease, background-color 130ms ease;
}

body[data-ui-shell='studio'] .presentation-dialog-close:hover {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 9%, var(--studio-panel-raised));
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .presentation-dialog-close:focus-visible,
body[data-ui-shell='studio'] .presentation-dialog button:focus-visible,
body[data-ui-shell='studio'] .presentation-dialog select:focus-visible,
body[data-ui-shell='studio'] .presentation-dialog input:focus-visible,
body[data-ui-shell='studio'] .presentation-dialog textarea:focus-visible {
  outline: 2px solid var(--studio-primary);
  outline-offset: 3px;
}

body[data-ui-shell='studio'] .live-console button:focus-visible,
body[data-ui-shell='studio'] .live-console input:focus-visible,
body[data-ui-shell='studio'] .live-console textarea:focus-visible {
  outline-color: var(--studio-signal);
}

body[data-ui-shell='studio'] .presentation-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 24px;
  scrollbar-color: var(--studio-rule-strong) transparent;
  scrollbar-width: thin;
}

body[data-ui-shell='studio'] .presentation-dialog-body::-webkit-scrollbar {
  width: 6px;
}

body[data-ui-shell='studio'] .presentation-dialog-body::-webkit-scrollbar-thumb {
  background: var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .live-console-state {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 176px;
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .live-console-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--studio-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .live-console-status::before {
  content: '';
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--studio-text-muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-text-muted) 15%, transparent);
}

body[data-ui-shell='studio'] .live-console-status[data-status='live']::before,
body[data-ui-shell='studio'] .live-console-status[data-status='connected']::before {
  background: var(--studio-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 18%, transparent);
}

body[data-ui-shell='studio'] .live-console-status[data-status='syncing']::before {
  background: #e9aa58;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e9aa58 18%, transparent);
}

body[data-ui-shell='studio'] .live-console-status[data-status='synced']::before {
  background: var(--studio-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-primary) 18%, transparent);
}

body[data-ui-shell='studio'] .live-console-status[data-status='blocked-popup']::before,
body[data-ui-shell='studio'] .live-console-status[data-status='degraded']::before,
body[data-ui-shell='studio'] .live-console-status[data-status='error']::before {
  background: var(--studio-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-danger) 18%, transparent);
}

body[data-ui-shell='studio'] .live-console-status-detail {
  max-width: 230px;
  overflow: hidden;
  color: var(--studio-text-muted);
  font-size: 9px;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .live-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(230px, 0.75fr));
  gap: 1px;
  border: 1px solid var(--studio-rule);
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .presentation-console-section {
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--studio-primary) 3%, transparent), transparent 42%),
    var(--studio-panel);
}

body[data-ui-shell='studio'] .live-console-draft {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--studio-signal) 4%, transparent), transparent 44%),
    var(--studio-panel);
}

body[data-ui-shell='studio'] .presentation-section-heading {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .presentation-section-heading > span {
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

body[data-ui-shell='studio'] .live-console-draft .presentation-section-heading > span {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .presentation-section-heading h3 {
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .presentation-section-heading p {
  margin: 4px 0 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 10px;
  line-height: 1.35;
}

body[data-ui-shell='studio'] .live-console-text-status {
  min-height: 0;
  margin: 8px 0 0;
  padding: 9px 11px;
  border-left: 2px solid var(--studio-signal);
  background: color-mix(in srgb, var(--studio-panel-raised) 58%, transparent);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 11px;
  line-height: 1.55;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .live-console-input-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] #live-console-input {
  width: 100%;
  min-height: 132px;
  padding: 14px 15px;
  resize: vertical;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  outline: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 5%, transparent), transparent 38%),
    color-mix(in srgb, var(--studio-ink) 80%, var(--studio-panel));
  color: var(--studio-text);
  caret-color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
  letter-spacing: 0.018em;
  box-sizing: border-box;
  transition: border-color 130ms ease, box-shadow 130ms ease, background-color 130ms ease;
}

body[data-ui-shell='studio'] #live-console-input::placeholder {
  color: color-mix(in srgb, var(--studio-text-muted) 72%, transparent);
}

body[data-ui-shell='studio'] #live-console-input:hover {
  border-color: color-mix(in srgb, var(--studio-signal) 62%, var(--studio-rule-strong));
}

body[data-ui-shell='studio'] #live-console-input:focus {
  border-color: var(--studio-signal);
  box-shadow: inset 3px 0 0 var(--studio-signal), 0 0 0 1px color-mix(in srgb, var(--studio-signal) 24%, transparent);
}

body[data-ui-shell='studio'] .live-console-typing-controls {
  display: grid;
  gap: 1px;
  margin-top: 12px;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .live-console-debounce,
body[data-ui-shell='studio'] .live-console-delay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  margin: 0;
  padding: 8px 10px;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  cursor: pointer;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .live-console-debounce strong,
body[data-ui-shell='studio'] .live-console-delay strong,
body[data-ui-shell='studio'] .live-console-debounce small,
body[data-ui-shell='studio'] .live-console-delay small {
  display: block;
}

body[data-ui-shell='studio'] .live-console-debounce strong,
body[data-ui-shell='studio'] .live-console-delay strong {
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.035em;
}

body[data-ui-shell='studio'] .live-console-debounce small,
body[data-ui-shell='studio'] .live-console-delay small {
  margin-top: 3px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  line-height: 1.35;
}

body[data-ui-shell='studio'] #live-typing-debounce-toggle {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--studio-signal);
}

body[data-ui-shell='studio'] .live-console-delay-control {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 50px;
  align-items: center;
  gap: 9px;
  min-width: 176px;
}

body[data-ui-shell='studio'] #live-typing-delay-slider {
  width: 100%;
  margin: 0;
  accent-color: var(--studio-signal);
}

body[data-ui-shell='studio'] #live-typing-delay-value {
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

body[data-ui-shell='studio'] .presentation-summary-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

body[data-ui-shell='studio'] .presentation-summary-list > div {
  display: grid;
  grid-template-columns: minmax(76px, 0.72fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  min-height: 40px;
  padding: 10px 0;
  border-bottom: 1px solid var(--studio-rule);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .presentation-summary-list > div:last-child {
  border-bottom: 0;
}

body[data-ui-shell='studio'] .presentation-summary-list dt,
body[data-ui-shell='studio'] .presentation-summary-list dd {
  margin: 0;
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.4;
}

body[data-ui-shell='studio'] .presentation-summary-list dt {
  color: var(--studio-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .presentation-summary-list dd {
  overflow-wrap: anywhere;
  color: var(--studio-text);
  font-weight: 700;
  text-align: right;
}

body[data-ui-shell='studio'] #live-console-output-health[data-status='synced'] {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] #live-console-output-health[data-status='degraded'],
body[data-ui-shell='studio'] #live-console-output-health[data-status='error'] {
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .live-console-direction-toggles {
  display: grid;
  gap: 1px;
  margin-top: 14px;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .live-console-direction-toggles label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  box-sizing: border-box;
  cursor: pointer;
}

body[data-ui-shell='studio'] .live-console-direction-toggles input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--studio-primary);
}

body[data-ui-shell='studio'] .presentation-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 20px 14px 24px;
  border-top: 1px solid var(--studio-rule);
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--studio-primary) 4%, transparent)),
    var(--studio-panel-raised);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .live-console-primary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

body[data-ui-shell='studio'] .presentation-action,
body[data-ui-shell='studio'] .display-routing-dialog .ss-playlist-btn {
  appearance: none;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 130ms ease, background-color 130ms ease, color 130ms ease, box-shadow 130ms ease;
}

body[data-ui-shell='studio'] .presentation-action:hover,
body[data-ui-shell='studio'] .display-routing-dialog .ss-playlist-btn:hover {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 10%, var(--studio-panel));
  color: var(--studio-text);
  transform: none;
}

body[data-ui-shell='studio'] .presentation-action-primary,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-primary {
  border-color: var(--studio-primary);
  background: var(--studio-primary);
  color: #f5f7ff;
}

body[data-ui-shell='studio'] .presentation-action-primary:hover,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-primary:hover {
  border-color: var(--studio-cobalt-deep);
  background: var(--studio-cobalt-deep);
  color: var(--studio-vermilion-ink);
}

body[data-ui-shell='studio'] .live-console-toggle {
  min-width: 124px;
  border-color: var(--studio-signal);
  background: var(--studio-signal);
  color: var(--studio-vermilion-ink);
}

body[data-ui-shell='studio'] .live-console-toggle:hover,
body[data-ui-shell='studio'] .live-console-toggle[aria-pressed='true'] {
  border-color: var(--studio-vermilion-hover);
  background: var(--studio-vermilion-hover);
  color: var(--studio-vermilion-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 17%, transparent);
}

body[data-ui-shell='studio'] .presentation-action:disabled,
body[data-ui-shell='studio'] .display-routing-dialog .ss-playlist-btn:disabled {
  border-color: var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 72%, transparent);
  color: var(--studio-text-muted);
  opacity: 0.72;
  cursor: not-allowed;
}

body[data-ui-shell='studio'] .display-routing-dialog {
  width: min(920px, 100%);
}

body[data-ui-shell='studio'] .display-routing-body {
  padding: 0;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-kicker {
  display: block;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-top: 7px;
  padding: 0 8px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status[data-status='display-synced'] {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 11%, var(--studio-panel-raised));
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status[data-status='syncing'] {
  border-color: #bd8239;
  color: #e9aa58;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status[data-status='display-error'] {
  border-color: var(--studio-danger);
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-detail {
  min-height: 38px;
  padding: 10px 12px;
  border-left: 2px solid var(--studio-primary);
  background: color-mix(in srgb, var(--studio-panel-raised) 62%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.55;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions .ss-playlist-btn {
  min-width: 0;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions .ss-playlist-btn.active {
  border-color: var(--studio-text);
  background: var(--studio-text);
  color: var(--studio-panel);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 0;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > label {
  display: flex;
  grid-column: span 2;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > .live-display-wall-target,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > .live-display-wall-mode {
  grid-column: span 3;
  justify-content: space-between;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles input[type='checkbox'] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--studio-primary);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-target select,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-mode select,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout input {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: none;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-target select {
  width: min(190px, 58%);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-mode select {
  width: min(154px, 58%);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout {
  display: grid !important;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  background: var(--studio-panel-raised);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout > span {
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  background: transparent;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout label span {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout input {
  width: 52px;
  text-align: center;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-detect-btn {
  min-width: 72px;
  height: 34px;
  min-height: 34px;
  padding: 0 10px !important;
  font-size: 9px !important;
}

body[data-ui-shell='studio']:not(.dark-mode) .presentation-dialog-overlay {
  background:
    linear-gradient(rgba(35, 38, 39, 0.43), rgba(35, 38, 39, 0.58)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(47, 80, 201, 0.05) 71px 72px);
}

body[data-ui-shell='studio']:not(.dark-mode) .presentation-dialog {
  color-scheme: light;
  box-shadow:
    0 34px 82px rgba(45, 41, 35, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.34);
}

body[data-ui-shell='studio']:not(.dark-mode) #live-console-input {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 5%, transparent), transparent 38%),
    #ece7de;
}

/* The Live Director is a modeless canvas-stage surface on desktop. */
body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded {
  position: absolute;
  z-index: 32;
  inset: 0;
  display: grid;
  place-items: stretch;
  padding: clamp(10px, 1.35vw, 20px);
  overflow: hidden;
  overscroll-behavior: contain;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 4%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--studio-primary) 4%, transparent) 1px, transparent 1px),
    color-mix(in srgb, var(--studio-ink) 94%, transparent);
  background-size: 72px 72px;
  backdrop-filter: none;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded .live-console {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  box-shadow: 0 26px 64px color-mix(in srgb, var(--studio-ink) 52%, transparent);
  animation-name: studio-live-director-in;
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded .live-console-header {
  min-height: 86px;
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded .live-console-body {
  padding: clamp(14px, 1.55vw, 24px);
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded .live-console-grid {
  grid-template-columns: minmax(0, 1.48fr) minmax(250px, 0.72fr);
  grid-template-rows: repeat(3, minmax(min-content, auto));
  min-height: 100%;
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded .live-console-draft {
  display: flex;
  grid-row: 1 / span 3;
  flex-direction: column;
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded .live-console-input-field {
  flex: 1;
  grid-template-rows: auto minmax(150px, 1fr);
}

body[data-ui-shell='studio'] .live-console-overlay.live-console-embedded #live-console-input {
  min-height: 170px;
  resize: none;
}

body[data-ui-shell='studio']:not(.dark-mode) .live-console-overlay.live-console-embedded {
  background:
    linear-gradient(90deg, rgba(47, 80, 201, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(47, 80, 201, 0.045) 1px, transparent 1px),
    rgba(221, 215, 204, 0.96);
  background-size: 72px 72px;
}

@keyframes studio-live-director-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (min-width: 1440px) {
  body[data-ui-shell='studio'] .live-console {
    width: min(1180px, 100%);
  }

  body[data-ui-shell='studio'] .display-routing-dialog {
    width: min(980px, 100%);
  }

  body[data-ui-shell='studio'] .presentation-dialog-body {
    padding: 24px 28px 28px;
  }

  body[data-ui-shell='studio'] .display-routing-body {
    padding: 0;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
    padding: 28px;
  }
}

@media (max-width: 1025px) {
  body[data-ui-shell='studio'] .presentation-dialog-overlay {
    padding: 20px;
  }

  body[data-ui-shell='studio'] .presentation-dialog {
    max-height: calc(100dvh - 40px);
  }

  body[data-ui-shell='studio'] .live-console-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .live-console-draft {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  body[data-ui-shell='studio'] .presentation-dialog-overlay {
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .presentation-dialog {
    max-height: calc(100dvh - max(28px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  }

  body[data-ui-shell='studio'] .presentation-dialog-close,
  body[data-ui-shell='studio'] .presentation-action,
  body[data-ui-shell='studio'] .display-routing-dialog .ss-playlist-btn {
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-close {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

@media (max-width: 768px) {
  body[data-ui-shell='studio'] .presentation-dialog-overlay {
    place-items: end center;
    padding:
      max(8px, env(safe-area-inset-top))
      0
      0;
    background: rgba(4, 7, 9, 0.76);
    backdrop-filter: blur(5px);
  }

  body[data-ui-shell='studio'] .presentation-dialog {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: 0 -24px 66px rgba(0, 0, 0, 0.58);
  }

  body[data-ui-shell='studio'] .presentation-dialog-header {
    gap: 14px;
    min-height: 82px;
    padding: 14px 14px 13px 16px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-heading h2 {
    font-size: 29px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-heading p {
    max-width: 44ch;
    font-size: 11px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-body {
    padding: 14px 16px 18px;
  }

  body[data-ui-shell='studio'] .live-console-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .live-console-draft {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .presentation-dialog-actions {
    align-items: stretch;
    padding:
      12px
      max(16px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .live-console-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  }

  body[data-ui-shell='studio'] .live-console-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .presentation-action {
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
  }

  body[data-ui-shell='studio'] .live-console-toggle {
    min-width: 0;
  }

  body[data-ui-shell='studio'] .live-console-state {
    min-width: 0;
  }

  body[data-ui-shell='studio'] .live-console-status-detail {
    display: none;
  }

  body[data-ui-shell='studio'] .display-routing-body {
    padding: 0;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
    gap: 14px;
    padding: 16px;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > label,
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > .live-display-wall-target,
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > .live-display-wall-mode {
    grid-column: 1 / -1;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-target select,
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-mode select {
    width: min(196px, 58%);
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  body[data-ui-shell='studio'] .presentation-dialog-header {
    align-items: start;
  }

  body[data-ui-shell='studio'] .live-console-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-ui-shell='studio'] .live-console-header .presentation-dialog-header-tools {
    gap: 8px;
  }

  body[data-ui-shell='studio'] .live-console-status {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-shell='studio'] .live-console-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .live-console-primary-actions {
    grid-row: 1;
  }

  body[data-ui-shell='studio'] .live-console-debounce,
  body[data-ui-shell='studio'] .live-console-delay {
    min-height: 60px;
  }

  body[data-ui-shell='studio'] .live-console-delay {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .live-console-delay-control {
    width: 100%;
    min-width: 0;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout label {
    justify-content: space-between;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-detect-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  body[data-ui-shell='studio'] .presentation-dialog-overlay {
    place-items: stretch center;
    padding: 0;
  }

  body[data-ui-shell='studio'] .presentation-dialog {
    width: 100%;
    max-height: 100dvh;
    border-top: 0;
    border-bottom: 0;
  }

  body[data-ui-shell='studio'] .presentation-dialog-header {
    min-height: 68px;
    padding-block: 10px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-heading p {
    margin-top: 4px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-body {
    padding-block: 12px;
  }

  body[data-ui-shell='studio'] .presentation-dialog-actions {
    min-height: 58px;
    padding-block: 7px;
  }
}

@media (max-width: 680px) {
  body:not(.live-presenter-mode) #live-presenter-btn,
  body:not(.live-presenter-mode) [data-studio-action='live'] {
    display: none !important;
  }
}

@media (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  body:not(.live-presenter-mode) #live-presenter-btn,
  body:not(.live-presenter-mode) [data-studio-action='live'] {
    display: none !important;
  }
}

/* Replay capture console */
body[data-ui-shell='studio'] .replay-dialog-overlay {
  z-index: 11000;
  background:
    linear-gradient(rgba(4, 7, 9, 0.78), rgba(4, 7, 9, 0.88)),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(107, 130, 255, 0.035) 63px 64px);
  backdrop-filter: blur(7px) saturate(0.82);
}

body[data-ui-shell='studio'] .replay-dialog {
  position: relative;
  border-color: var(--studio-rule-strong);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(107, 130, 255, 0.035), transparent 38%),
    var(--studio-panel);
  color: var(--studio-text);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(0, 0, 0, 0.42);
}

body[data-ui-shell='studio'] .replay-dialog::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: -1px;
  left: -1px;
  width: 138px;
  height: 2px;
  background: var(--studio-primary);
}

body[data-ui-shell='studio'] .replay-settings-header {
  min-height: 82px;
  border-color: var(--studio-rule);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 7%, transparent), transparent 44%),
    color-mix(in srgb, var(--studio-panel-raised) 46%, transparent);
}

body[data-ui-shell='studio'] .replay-dialog-kicker {
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .replay-settings-header h2 {
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 31px;
  font-weight: 400;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .replay-dialog-status {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .replay-dialog-status > span {
  background: var(--studio-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-primary) 16%, transparent);
}

body[data-ui-shell='studio'] .replay-settings-close {
  border-color: var(--studio-rule-strong);
  background: color-mix(in srgb, var(--studio-panel-raised) 52%, transparent);
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .replay-settings-close:hover,
body[data-ui-shell='studio'] .replay-settings-close:focus-visible {
  border-color: var(--studio-primary);
  color: var(--studio-text);
  box-shadow: inset 0 -2px 0 var(--studio-primary);
}

body[data-ui-shell='studio'] .replay-settings-body {
  scrollbar-color: var(--studio-rule-strong) transparent;
  scrollbar-width: thin;
}

body[data-ui-shell='studio'] .replay-settings-body::-webkit-scrollbar {
  width: 6px;
}

body[data-ui-shell='studio'] .replay-settings-body::-webkit-scrollbar-thumb {
  background: var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .replay-settings-section {
  background: color-mix(in srgb, var(--studio-panel-raised) 18%, transparent);
}

body[data-ui-shell='studio'] .replay-settings-section + .replay-settings-section,
body[data-ui-shell='studio'] .replay-section-heading,
body[data-ui-shell='studio'] .replay-setting,
body[data-ui-shell='studio'] .replay-settings-actions {
  border-color: var(--studio-rule);
}

body[data-ui-shell='studio'] .replay-section-index {
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .replay-section-heading h3 {
  color: var(--studio-text);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .replay-setting label,
body[data-ui-shell='studio'] .replay-setting output,
body[data-ui-shell='studio'] .replay-setting select,
body[data-ui-shell='studio'] .replay-capture-summary strong,
body[data-ui-shell='studio'] .replay-capture-summary small {
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .replay-setting label,
body[data-ui-shell='studio'] .replay-capture-summary small {
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .replay-setting output {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .replay-setting input[type='range'] {
  background: transparent;
}

body[data-ui-shell='studio'] .replay-setting input[type='range']::-webkit-slider-runnable-track,
body[data-ui-shell='studio'] .replay-setting input[type='range']::-moz-range-track {
  background: var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .replay-setting input[type='range']::-webkit-slider-thumb {
  border-color: var(--studio-panel);
  background: var(--studio-primary);
  box-shadow: 0 0 0 1px var(--studio-primary);
}

body[data-ui-shell='studio'] .replay-setting input[type='range']::-moz-range-thumb {
  border-color: var(--studio-panel);
  background: var(--studio-primary);
  box-shadow: 0 0 0 1px var(--studio-primary);
}

body[data-ui-shell='studio'] .replay-setting select {
  border-color: var(--studio-rule-strong);
  background-color: var(--studio-panel);
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .replay-setting select:hover,
body[data-ui-shell='studio'] .replay-setting select:focus-visible {
  border-color: var(--studio-primary);
}

body[data-ui-shell='studio'] .replay-settings-actions {
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--studio-primary) 3%, transparent)),
    var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .replay-capture-summary > span + span {
  border-color: var(--studio-rule);
}

body[data-ui-shell='studio'] .replay-capture-summary strong {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .replay-start-btn {
  border-color: var(--studio-signal);
  background: var(--studio-signal);
  color: var(--studio-vermilion-ink);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .replay-start-btn:hover,
body[data-ui-shell='studio'] .replay-start-btn:focus-visible {
  border-color: var(--studio-vermilion-hover);
  background: var(--studio-vermilion-hover);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 20%, transparent);
}

body[data-ui-shell='studio']:not(.dark-mode) .replay-dialog-overlay {
  background:
    linear-gradient(rgba(36, 39, 40, 0.44), rgba(36, 39, 40, 0.56)),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(47, 80, 201, 0.045) 63px 64px);
}

body[data-ui-shell='studio']:not(.dark-mode) .replay-dialog {
  background:
    linear-gradient(135deg, rgba(47, 80, 201, 0.04), transparent 38%),
    var(--studio-panel);
  box-shadow:
    0 30px 70px rgba(41, 38, 33, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.28);
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] .replay-dialog-overlay {
    background: rgba(4, 7, 9, 0.74);
    backdrop-filter: blur(4px);
  }

  body[data-ui-shell='studio'] .replay-dialog {
    border-top: 1px solid var(--studio-rule-strong);
    box-shadow: 0 -22px 58px rgba(0, 0, 0, 0.52);
  }

  body[data-ui-shell='studio'] .replay-dialog::before {
    width: 112px;
  }

  body[data-ui-shell='studio'] .replay-settings-header {
    min-height: 70px;
  }

  body[data-ui-shell='studio'] .replay-settings-section + .replay-settings-section {
    border-color: var(--studio-rule);
  }
}

@media (max-width: 1024px) {
  body[data-ui-shell='studio'].replay-dialog-open {
    overflow: hidden;
  }
}

body[data-ui-shell='studio'].fullscreen-mode #studio-command-header,
body[data-ui-shell='studio'].fullscreen-mode #studio-tool-rail,
body[data-ui-shell='studio'].fullscreen-mode .studio-theme-action,
body[data-ui-shell='studio'].live-presenter-mode #studio-command-header,
body[data-ui-shell='studio'].live-presenter-mode #studio-tool-rail,
body[data-ui-shell='studio'].live-presenter-mode .studio-theme-action {
  display: none !important;
}

body[data-ui-shell='studio'].fullscreen-mode .main-content,
body[data-ui-shell='studio'].live-presenter-mode .main-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
}

body[data-ui-shell='studio'].fullscreen-mode .canvas-column,
body[data-ui-shell='studio'].live-presenter-mode .canvas-column {
  grid-column: 1 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  padding: 0 !important;
}

body[data-ui-shell='studio'].fullscreen-mode .controls-column,
body[data-ui-shell='studio'].live-presenter-mode .controls-column,
body[data-ui-shell='studio'].canvas-only-mode .controls-column {
  display: none !important;
}

@media (min-width: 1025px) {
  /* Presenter and fullscreen hide the rail and need the entire viewport. */
  /* Keep specificity unchanged so the docked Queue layout can still override. */
  body[data-ui-shell='studio'].canvas-only-mode:where(:not(.fullscreen-mode):not(.live-presenter-mode)) .main-content {
    grid-template-columns: minmax(0, 1fr) var(--studio-rail-width) !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode:where(:not(.fullscreen-mode):not(.live-presenter-mode)) .canvas-column {
    grid-column: 1 !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode:where(:not(.fullscreen-mode):not(.live-presenter-mode)) #studio-tool-rail {
    grid-column: 2 !important;
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  body[data-ui-shell='studio'] {
    --studio-inspector-width: 340px;
  }

  body[data-ui-shell='studio'] #studio-command-header {
    gap: 12px;
    padding-left: 18px;
  }

  body[data-ui-shell='studio'] .studio-wordmark {
    font-size: 21px;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action {
    min-width: 67px;
    padding-right: 8px;
    padding-left: 8px;
  }

  body[data-ui-shell='studio'] .studio-header-actions .studio-action:first-child {
    min-width: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] *,
  body[data-ui-shell='studio'] *::before,
  body[data-ui-shell='studio'] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Slideshow Console — curated playback control desk. */
body[data-ui-shell='studio'] #slideshow-controls {
  position: fixed;
  z-index: 11200;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: auto;
  margin: 0;
  padding: 28px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(4, 7, 9, 0.82), rgba(4, 7, 9, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(107, 130, 255, 0.038) 71px 72px);
  box-shadow: none;
  backdrop-filter: blur(8px) saturate(0.78);
  overscroll-behavior: contain;
}

body[data-ui-shell='studio'] #slideshow-controls[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] #slideshow-controls:not([hidden]) {
  display: grid !important;
}

body[data-ui-shell='studio'].slideshow-console-open {
  overflow: hidden;
}

body[data-ui-shell='studio'] .slideshow-console {
  width: min(1240px, 100%);
  max-height: min(840px, calc(100dvh - 56px));
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .slideshow-console::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: -1px;
  left: 151px;
  width: 32px;
  height: 2px;
  background: var(--studio-signal);
  pointer-events: none;
}

body[data-ui-shell='studio'] .slideshow-console-header {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 10%, transparent), transparent 34%),
    color-mix(in srgb, var(--studio-panel-raised) 50%, transparent);
}

body[data-ui-shell='studio'] .slideshow-console-state {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 204px;
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .slideshow-console-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--studio-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .slideshow-console-status::before {
  content: '';
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--studio-text-muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-text-muted) 15%, transparent);
}

body[data-ui-shell='studio'] .slideshow-console-status[data-status='playing']::before,
body[data-ui-shell='studio'] .slideshow-console-status[data-status='connected']::before,
body[data-ui-shell='studio'] .slideshow-console-status[data-status='synced']::before,
body[data-ui-shell='studio'] .slideshow-console-status[data-status='complete']::before {
  background: var(--studio-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-primary) 18%, transparent);
}

body[data-ui-shell='studio'] .slideshow-console-status[data-status='paused']::before,
body[data-ui-shell='studio'] .slideshow-console-status[data-status='rendering']::before,
body[data-ui-shell='studio'] .slideshow-console-status[data-status='exporting']::before {
  background: #e9aa58;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e9aa58 18%, transparent);
}

body[data-ui-shell='studio'] .slideshow-console-status[data-status='degraded']::before,
body[data-ui-shell='studio'] .slideshow-console-status[data-status='error']::before {
  background: var(--studio-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-danger) 18%, transparent);
}

body[data-ui-shell='studio'] .slideshow-console-status-detail {
  max-width: 260px;
  overflow: hidden;
  color: var(--studio-text-muted);
  font-size: 9px;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .slideshow-console-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--studio-rule-strong) transparent;
  scrollbar-width: thin;
}

body[data-ui-shell='studio'] .slideshow-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.28fr);
  align-items: start;
  gap: 1px;
  border: 1px solid var(--studio-rule);
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .slideshow-console-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .slideshow-console-section {
  display: block;
  min-width: 0;
}

body[data-ui-shell='studio'] .slideshow-console-section:first-child,
body[data-ui-shell='studio'] .slideshow-console-section:last-child {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .slideshow-console-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

body[data-ui-shell='studio'] .slideshow-console-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 7px;
  min-width: 0;
  width: 100%;
  margin: 0;
}

body[data-ui-shell='studio'] #slideshow-controls .slideshow-console-field > label,
body[data-ui-shell='studio'] #slideshow-controls .slideshow-console-label-row label,
body[data-ui-shell='studio'] #slideshow-controls .slideshow-console-movie-grid > label {
  color: color-mix(in srgb, var(--studio-text) 72%, var(--studio-text-muted));
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .slideshow-console select,
body[data-ui-shell='studio'] .slideshow-console input[type='number'] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
}

body[data-ui-shell='studio'] .slideshow-console select {
  padding: 0 34px 0 10px;
}

body[data-ui-shell='studio'] .slideshow-console input[type='number'] {
  padding: 0 8px;
}

body[data-ui-shell='studio'] .slideshow-console select:hover,
body[data-ui-shell='studio'] .slideshow-console select:focus-visible,
body[data-ui-shell='studio'] .slideshow-console input:focus-visible,
body[data-ui-shell='studio'] .slideshow-console button:focus-visible {
  border-color: var(--studio-primary);
  outline: 2px solid var(--studio-primary);
  outline-offset: 2px;
}

body[data-ui-shell='studio'] .slideshow-console-inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

body[data-ui-shell='studio'] .slideshow-console-inline-control .presentation-action {
  white-space: nowrap;
}

body[data-ui-shell='studio'] .slideshow-playlist-origin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-top: 8px;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid var(--studio-rule);
  border-left: 2px solid var(--studio-primary);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 8%, transparent), transparent 42%),
    var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .slideshow-playlist-origin[data-kind='library'] {
  border-left-color: var(--studio-signal);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 9%, transparent), transparent 42%),
    var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .slideshow-playlist-origin[data-state='error'] {
  border-left-color: var(--studio-danger);
}

body[data-ui-shell='studio'] .slideshow-playlist-origin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 48%, var(--studio-rule));
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .slideshow-playlist-origin[data-kind='library'] .slideshow-playlist-origin-badge {
  border-color: color-mix(in srgb, var(--studio-signal) 52%, var(--studio-rule));
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .slideshow-playlist-origin p {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
}

body[data-ui-shell='studio'] .slideshow-playlist-origin strong,
body[data-ui-shell='studio'] .slideshow-playlist-origin p span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .slideshow-playlist-origin strong {
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
}

body[data-ui-shell='studio'] .slideshow-playlist-origin p span {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
}

body[data-ui-shell='studio'] .slideshow-playlist-origin .presentation-action {
  min-height: 36px;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .slideshow-playlist-control {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .slideshow-playlist-library-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--studio-rule);
  background: color-mix(in srgb, var(--studio-primary) 5%, var(--studio-panel-raised));
}

body[data-ui-shell='studio'] .slideshow-playlist-library-action p {
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  line-height: 1.45;
}

body[data-ui-shell='studio'] .slideshow-playlist-library-action .presentation-action {
  white-space: nowrap;
}

body[data-ui-shell='studio'] .slideshow-library-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .slideshow-library-pagination p {
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .slideshow-console-toggle-row {
  display: block;
  grid-column: 1 / -1;
  min-height: 54px;
  padding: 0;
  border: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .slideshow-console-toggle-row > .control-switch-row {
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border-bottom: 0;
}

body[data-ui-shell='studio'] .slideshow-console-toggle-row .control-switch-copy {
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: none;
}

body[data-ui-shell='studio'] .slideshow-console-toggle-row small {
  display: block;
  margin-top: 3px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

body[data-ui-shell='studio'] .slideshow-console-mode-selection {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 10px;
  border: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .slideshow-console-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

body[data-ui-shell='studio'] #slideshow-interval-number-value {
  margin: 0;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 11px;
  font-weight: 800;
}

body[data-ui-shell='studio'] #slideshow-interval-number-value::after {
  content: 's';
}

body[data-ui-shell='studio'] .slideshow-console .slideshow-interval-control .slider-container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
}

body[data-ui-shell='studio'] .slideshow-console .slideshow-interval-control .slider-container > span {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] #slideshow-interval-number {
  width: 100%;
  min-height: 40px;
  margin: 0;
  accent-color: var(--studio-primary);
}

body[data-ui-shell='studio'] .slideshow-console-sequence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  grid-column: 1 / -1;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .slideshow-console-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 9px 10px;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  cursor: pointer;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .slideshow-console-check strong,
body[data-ui-shell='studio'] .slideshow-console-check small {
  display: block;
}

body[data-ui-shell='studio'] .slideshow-console-check strong {
  font-family: var(--studio-font-data);
  font-size: 10px;
  line-height: 1.3;
}

body[data-ui-shell='studio'] .slideshow-console-check small {
  margin-top: 3px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

body[data-ui-shell='studio'] .slideshow-console-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--studio-primary);
}

body[data-ui-shell='studio'] .slideshow-console-output-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .slideshow-console-output-actions p,
body[data-ui-shell='studio'] .slideshow-console-exhibition p {
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  line-height: 1.45;
}

body[data-ui-shell='studio'] .slideshow-console-movie-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

body[data-ui-shell='studio'] .slideshow-console-movie-grid > label {
  display: grid;
  gap: 7px;
}

body[data-ui-shell='studio'] .slideshow-console-movie-grid > .ss-movie-format-control {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  align-items: center;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--studio-signal) 28%, var(--studio-line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 7%, transparent), transparent 52%),
    var(--studio-surface);
}

body[data-ui-shell='studio'] .slideshow-console-movie-grid > .ss-movie-format-control select {
  min-height: 42px;
}

body[data-ui-shell='studio'] .slideshow-console-movie-grid > label > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .ss-movie-export-preflight {
  position: relative;
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 11px 12px 11px 29px;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  background: color-mix(in srgb, var(--studio-surface) 82%, transparent);
}

body[data-ui-shell='studio'] .ss-movie-export-preflight::before {
  position: absolute;
  top: 14px;
  left: 12px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--studio-text-muted);
  border-radius: 50%;
  background: transparent;
  content: '';
}

body[data-ui-shell='studio'] .ss-movie-export-preflight strong,
body[data-ui-shell='studio'] .ss-movie-export-preflight span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-ui-shell='studio'] .ss-movie-export-preflight strong {
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

body[data-ui-shell='studio'] .ss-movie-export-preflight span {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  line-height: 1.45;
}

body[data-ui-shell='studio'] .ss-movie-export-preflight[data-state='ready'] {
  border-color: color-mix(in srgb, var(--studio-signal) 38%, var(--studio-line));
  background: color-mix(in srgb, var(--studio-signal) 5%, var(--studio-surface));
}

body[data-ui-shell='studio'] .ss-movie-export-preflight[data-state='ready']::before {
  border-color: var(--studio-signal);
  background: var(--studio-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 13%, transparent);
}

body[data-ui-shell='studio'] .ss-movie-export-preflight[data-state='warning'] {
  border-color: color-mix(in srgb, var(--studio-primary) 58%, var(--studio-line));
  background: color-mix(in srgb, var(--studio-primary) 8%, var(--studio-surface));
}

body[data-ui-shell='studio'] .ss-movie-export-preflight[data-state='warning']::before {
  border-color: var(--studio-primary);
  background: var(--studio-primary);
}

body[data-ui-shell='studio'] .slideshow-console .ss-movie-export-btn {
  width: 100%;
  height: auto;
  margin-top: 12px;
}

body[data-ui-shell='studio'] .ss-movie-export-cancel {
  min-height: 44px;
}

body[data-ui-shell='studio'] .ss-movie-export-cancel:disabled {
  cursor: wait;
  opacity: 0.58;
}

body[data-ui-shell='studio'] .slideshow-console-now {
  position: sticky;
  top: 0;
  align-self: start;
  min-width: 0;
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--studio-signal) 5%, transparent), transparent 46%),
    var(--studio-panel);
}

body[data-ui-shell='studio'] .slideshow-console-now .presentation-section-heading > span {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .slideshow-console-summary dd {
  max-width: 150px;
}

body[data-ui-shell='studio'] .slideshow-console-exhibition {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .slideshow-console-exhibition .presentation-action {
  width: 100%;
  height: auto;
}

body[data-ui-shell='studio'] .slideshow-console-transport {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(220px, 1fr) minmax(104px, auto) minmax(104px, auto);
  gap: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 5%, transparent), transparent 36%),
    var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .slideshow-console-primary-transport {
  display: grid;
  grid-template-columns: repeat(2, minmax(104px, 1fr));
  gap: 8px;
}

body[data-ui-shell='studio'] .slideshow-console-stop {
  border-color: color-mix(in srgb, var(--studio-signal) 58%, var(--studio-rule-strong));
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .slideshow-console-stop:not(:disabled):hover {
  border-color: var(--studio-signal);
  background: color-mix(in srgb, var(--studio-signal) 10%, var(--studio-panel));
}

body[data-ui-shell='studio'] .slideshow-console .presentation-action:disabled,
body[data-ui-shell='studio'] .slideshow-console .ss-playlist-btn:disabled {
  height: auto;
  border-color: var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 72%, transparent);
  color: var(--studio-text-muted);
  opacity: 0.58;
  cursor: not-allowed;
}

body[data-ui-shell='studio']:not(.dark-mode) #slideshow-controls {
  background:
    linear-gradient(rgba(35, 38, 39, 0.43), rgba(35, 38, 39, 0.58)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(47, 80, 201, 0.05) 71px 72px);
}

body[data-ui-shell='studio']:not(.dark-mode) .slideshow-console {
  color-scheme: light;
  box-shadow:
    0 34px 82px rgba(45, 41, 35, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.34);
}

@media (min-width: 1440px) {
  body[data-ui-shell='studio'] .slideshow-console {
    width: min(1320px, 100%);
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  body[data-ui-shell='studio'] .slideshow-console-grid {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.32fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-output-actions,
  body[data-ui-shell='studio'] .slideshow-console-toggle-row,
  body[data-ui-shell='studio'] .slideshow-console-sequence,
  body[data-ui-shell='studio'] .slideshow-library-pagination,
  body[data-ui-shell='studio'] .slideshow-console-mode-selection {
    grid-column: auto;
  }
}

@media (max-width: 1024px) {
  body[data-ui-shell='studio'] #slideshow-controls {
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .slideshow-console {
    max-height: calc(100dvh - max(28px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  }

  body[data-ui-shell='studio'] .slideshow-console-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-now {
    position: static;
    grid-row: 1;
  }

  body[data-ui-shell='studio'] .slideshow-console-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .slideshow-console-summary > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    border-right: 1px solid var(--studio-rule);
    border-bottom: 0;
    padding: 10px;
  }

  body[data-ui-shell='studio'] .slideshow-console-summary > div:last-child {
    border-right: 0;
  }

  body[data-ui-shell='studio'] .slideshow-console-summary dd {
    max-width: none;
    text-align: left;
  }

  body[data-ui-shell='studio'] .slideshow-console-exhibition {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  body[data-ui-shell='studio'] .slideshow-console select,
  body[data-ui-shell='studio'] .slideshow-console input[type='number'],
  body[data-ui-shell='studio'] .slideshow-console .presentation-action,
  body[data-ui-shell='studio'] .slideshow-console .ss-playlist-btn {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  body[data-ui-shell='studio'] #slideshow-controls {
    place-items: end center;
    padding: max(8px, env(safe-area-inset-top)) 0 0;
    background: rgba(4, 7, 9, 0.78);
    backdrop-filter: blur(5px);
  }

  body[data-ui-shell='studio'] .slideshow-console {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: 0 -24px 66px rgba(0, 0, 0, 0.58);
  }

  body[data-ui-shell='studio'] .slideshow-console-settings,
  body[data-ui-shell='studio'] .slideshow-console-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-section:first-child,
  body[data-ui-shell='studio'] .slideshow-console-section:last-child,
  body[data-ui-shell='studio'] .slideshow-console-output-actions,
  body[data-ui-shell='studio'] .slideshow-console-toggle-row,
  body[data-ui-shell='studio'] .slideshow-console-sequence,
  body[data-ui-shell='studio'] .slideshow-library-pagination,
  body[data-ui-shell='studio'] .slideshow-console-mode-selection {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .slideshow-console-movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .slideshow-console-movie-grid > .ss-movie-format-control {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-transport {
    grid-template-columns: minmax(82px, auto) minmax(0, 1fr) minmax(82px, auto);
    padding:
      10px
      max(12px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .slideshow-console-stop {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] #slideshow-console-output-target option[value='presenter'],
  body[data-ui-shell='studio'] #slideshow-console-output-target option[value='wall'],
  body[data-ui-shell='studio'] #slideshow-console-configure-output {
    display: none;
  }

  body[data-ui-shell='studio'] .slideshow-console-output-actions {
    display: block;
  }
}

@media (max-width: 520px) {
  body[data-ui-shell='studio'] .slideshow-console-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body[data-ui-shell='studio'] .slideshow-console-header .presentation-dialog-heading p,
  body[data-ui-shell='studio'] .slideshow-console-status-detail {
    display: none;
  }

  body[data-ui-shell='studio'] .slideshow-console-state {
    min-width: 0;
  }

  body[data-ui-shell='studio'] .slideshow-console-status {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-shell='studio'] .slideshow-console-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-summary > div {
    grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--studio-rule);
  }

  body[data-ui-shell='studio'] .slideshow-console-summary dd {
    text-align: right;
  }

  body[data-ui-shell='studio'] .slideshow-console-exhibition {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-inline-control,
  body[data-ui-shell='studio'] .slideshow-playlist-origin,
  body[data-ui-shell='studio'] .slideshow-playlist-library-action,
  body[data-ui-shell='studio'] .slideshow-console-output-actions,
  body[data-ui-shell='studio'] .slideshow-library-pagination,
  body[data-ui-shell='studio'] .slideshow-console-sequence {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .slideshow-playlist-origin {
    align-items: stretch;
    padding: 10px;
  }

  body[data-ui-shell='studio'] .slideshow-playlist-origin p span {
    overflow: visible;
    white-space: normal;
  }

  body[data-ui-shell='studio'] .slideshow-console-transport {
    grid-template-columns: minmax(72px, 0.8fr) minmax(0, 2fr) minmax(72px, 0.8fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-primary-transport {
    grid-template-columns: repeat(2, minmax(76px, 1fr));
  }
}

@media (max-height: 700px) and (orientation: portrait) {
  body[data-ui-shell='studio'] .slideshow-console-header {
    min-height: 70px;
    padding-block: 11px;
  }

  body[data-ui-shell='studio'] .slideshow-console-header .presentation-dialog-heading p {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  body[data-ui-shell='studio'] #slideshow-controls {
    place-items: stretch;
    padding:
      env(safe-area-inset-top)
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left);
  }

  body[data-ui-shell='studio'] .slideshow-console {
    width: 100%;
    max-height: 100dvh;
    border: 0;
  }

  body[data-ui-shell='studio'] .slideshow-console-header {
    min-height: 58px;
    padding: 8px 12px;
  }

  body[data-ui-shell='studio'] .slideshow-console-header .presentation-dialog-heading p,
  body[data-ui-shell='studio'] .slideshow-console-status-detail {
    display: none;
  }

  body[data-ui-shell='studio'] .slideshow-console-grid {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.38fr);
  }

  body[data-ui-shell='studio'] .slideshow-console-now {
    position: sticky;
    grid-row: auto;
  }

  body[data-ui-shell='studio'] .slideshow-console-body {
    padding: 10px 12px;
  }

  body[data-ui-shell='studio'] .slideshow-console-transport {
    min-height: 54px;
    padding: 5px max(10px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] #slideshow-console-output-target option[value='presenter'],
  body[data-ui-shell='studio'] #slideshow-console-output-target option[value='wall'],
  body[data-ui-shell='studio'] #slideshow-console-configure-output {
    display: none;
  }
}

/* Curated Slideshow Builder — nested Studio curation workbench. */
body[data-ui-shell='studio'].slideshow-builder-open {
  overflow: hidden;
}

body[data-ui-shell='studio'] .ss-playlist-modal {
  position: fixed;
  z-index: 12000;
  inset: 0;
  display: none;
  place-items: center;
  box-sizing: border-box;
  padding: 24px;
  overflow: hidden;
  overscroll-behavior: contain;
  background:
    linear-gradient(rgba(4, 7, 9, 0.86), rgba(4, 7, 9, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(107, 130, 255, 0.045) 71px 72px);
  backdrop-filter: blur(10px) saturate(0.76);
}

body[data-ui-shell='studio'] .ss-playlist-modal.ss-open {
  display: grid;
}

body[data-ui-shell='studio'] .ss-playlist-shell {
  position: relative;
  width: min(1180px, 100%);
  height: min(820px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--studio-primary) 6%, transparent), transparent 32%),
    var(--studio-panel);
  color: var(--studio-text);
  color-scheme: dark;
  box-shadow:
    0 38px 96px rgba(0, 0, 0, 0.66),
    0 0 0 1px rgba(0, 0, 0, 0.48);
  animation: studio-presentation-dialog-in 160ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

body[data-ui-shell='studio'] .ss-playlist-shell::before {
  content: '';
  position: absolute;
  z-index: 4;
  top: -1px;
  left: -1px;
  width: 172px;
  height: 2px;
  background: var(--studio-primary);
  pointer-events: none;
}

body[data-ui-shell='studio'] .ss-playlist-shell::after {
  content: '';
  position: absolute;
  z-index: 4;
  top: -1px;
  left: 171px;
  width: 28px;
  height: 2px;
  background: var(--studio-signal);
  pointer-events: none;
}

body[data-ui-shell='studio'] .ss-playlist-header {
  min-width: 0;
  min-height: 100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 18px 20px 17px 24px;
  border-bottom: 1px solid var(--studio-rule);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 8%, transparent), transparent 46%),
    color-mix(in srgb, var(--studio-panel-raised) 52%, transparent);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .ss-builder-heading {
  min-width: 0;
}

body[data-ui-shell='studio'] .ss-builder-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-playlist-title {
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-builder-heading p {
  max-width: 700px;
  margin: 7px 0 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 12px;
  line-height: 1.45;
}

body[data-ui-shell='studio'] .ss-builder-header-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

body[data-ui-shell='studio'] .ss-builder-status {
  position: relative;
  max-width: 220px;
  padding-left: 14px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-builder-status::before {
  content: '';
  position: absolute;
  top: 0.42em;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--studio-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-signal) 12%, transparent);
}

body[data-ui-shell='studio'] .ss-playlist-close {
  appearance: none;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  padding: 0 !important;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-panel-raised) 56%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

body[data-ui-shell='studio'] .ss-playlist-close::before,
body[data-ui-shell='studio'] .ss-playlist-btn::before,
body[data-ui-shell='studio'] .ss-playlist-icon-btn::before {
  display: none;
}

body[data-ui-shell='studio'] .ss-playlist-close:hover {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 9%, var(--studio-panel-raised));
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .ss-playlist-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(280px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 54%, transparent);
}

body[data-ui-shell='studio'] .ss-playlist-field,
body[data-ui-shell='studio'] .ss-library-search,
body[data-ui-shell='studio'] .ss-library-ratio {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 0;
}

body[data-ui-shell='studio'] .ss-playlist-field > span,
body[data-ui-shell='studio'] .ss-library-search > span,
body[data-ui-shell='studio'] .ss-library-ratio > span {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-playlist-toolbar select,
body[data-ui-shell='studio'] .ss-playlist-toolbar input,
body[data-ui-shell='studio'] .ss-library-search input,
body[data-ui-shell='studio'] .ss-library-ratio select {
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  padding: 0 11px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 11px;
  outline: none;
}

body[data-ui-shell='studio'] .ss-playlist-toolbar select,
body[data-ui-shell='studio'] .ss-library-ratio select {
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--studio-text-muted) 50%),
    linear-gradient(135deg, var(--studio-text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 17px,
    calc(100% - 10px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

body[data-ui-shell='studio'] .ss-playlist-toolbar input::placeholder,
body[data-ui-shell='studio'] .ss-library-search input::placeholder {
  color: color-mix(in srgb, var(--studio-text-muted) 72%, transparent);
}

body[data-ui-shell='studio'] .ss-playlist-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

body[data-ui-shell='studio'] .ss-playlist-btn {
  appearance: none;
  min-width: 92px !important;
  min-height: 40px !important;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px !important;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

body[data-ui-shell='studio'] .ss-playlist-btn:hover {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 9%, var(--studio-panel-raised));
}

body[data-ui-shell='studio'] .ss-playlist-btn-primary {
  border-color: var(--studio-primary);
  background: var(--studio-primary);
  color: #fff;
}

body[data-ui-shell='studio'] .ss-playlist-btn-primary:hover {
  border-color: color-mix(in srgb, var(--studio-primary) 82%, white);
  background: color-mix(in srgb, var(--studio-primary) 82%, white);
}

body[data-ui-shell='studio'] .ss-playlist-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

body[data-ui-shell='studio'] .ss-playlist-btn[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .ss-builder-mobile-tabs {
  display: none;
}

body[data-ui-shell='studio'] .ss-playlist-columns {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 0;
  overflow: hidden;
  background: var(--studio-ink);
}

body[data-ui-shell='studio'] .ss-playlist-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--studio-panel);
}

body[data-ui-shell='studio'] .ss-builder-library {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .ss-builder-sequence {
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--studio-primary) 4%, transparent), transparent 26%),
    var(--studio-panel);
}

body[data-ui-shell='studio'] .ss-builder-panel-heading {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .ss-builder-panel-heading > div {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

body[data-ui-shell='studio'] .ss-builder-panel-index {
  flex: 0 0 auto;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.08em;
}

body[data-ui-shell='studio'] .ss-builder-panel-heading h3 {
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-builder-panel-heading p {
  margin: 4px 0 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 10px;
  line-height: 1.35;
}

body[data-ui-shell='studio'] .ss-builder-count {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--studio-rule);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: end;
  gap: 8px;
}

body[data-ui-shell='studio'] .ss-builder-library-status {
  min-height: 14px;
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-builder-library-status[data-state='loading'] {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .ss-builder-library-status[data-state='error'] {
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .ss-playlist-hint {
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  line-height: 1.45;
}

body[data-ui-shell='studio'] .ss-playlist-list {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 5px 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--studio-rule-strong) transparent;
  scrollbar-width: thin;
}

body[data-ui-shell='studio'] .ss-playlist-list::-webkit-scrollbar {
  width: 5px;
}

body[data-ui-shell='studio'] .ss-playlist-list::-webkit-scrollbar-thumb {
  background: var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .ss-playlist-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-panel-raised) 52%, transparent);
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

body[data-ui-shell='studio'] .ss-playlist-item:hover {
  border-color: var(--studio-rule-strong);
  background: color-mix(in srgb, var(--studio-primary) 5%, var(--studio-panel-raised));
  transform: translateX(1px);
}

body[data-ui-shell='studio'] .ss-playlist-thumb {
  position: relative;
  width: 70px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--studio-primary) 17%, transparent), transparent),
    var(--studio-ink);
}

body[data-ui-shell='studio'] .ss-playlist-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-ui-shell='studio'] .ss-playlist-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-display);
  font-size: 21px;
  letter-spacing: 0.06em;
}

body[data-ui-shell='studio'] .ss-playlist-slot {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 24px;
  padding: 3px 4px;
  box-sizing: border-box;
  background: var(--studio-primary);
  color: #fff;
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

body[data-ui-shell='studio'] .ss-playlist-item-body {
  min-width: 0;
}

body[data-ui-shell='studio'] .ss-playlist-item-title {
  overflow: hidden;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .ss-playlist-item-meta {
  margin-top: 3px;
  overflow: hidden;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.3;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .ss-playlist-ratio-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 42%, var(--studio-rule));
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-primary) 8%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

body[data-ui-shell='studio'] .ss-playlist-actions {
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 3px;
}

body[data-ui-shell='studio'] .ss-playlist-icon-btn {
  appearance: none;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  display: grid;
  place-items: center;
  padding: 0 !important;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

body[data-ui-shell='studio'] .ss-playlist-icon-btn:hover {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 10%, var(--studio-panel));
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .ss-playlist-icon-btn[data-ss-action='add'] {
  border-color: var(--studio-primary);
  background: var(--studio-primary);
  color: #fff;
}

body[data-ui-shell='studio'] .ss-playlist-icon-btn[data-ss-action='remove']:hover {
  border-color: var(--studio-danger);
  background: color-mix(in srgb, var(--studio-danger) 12%, var(--studio-panel));
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .ss-playlist-empty {
  min-height: 126px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--studio-rule-strong);
  border-radius: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

body[data-ui-shell='studio'] .ss-playlist-pagination {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .ss-playlist-pagination > span {
  min-width: 0;
  overflow: hidden;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .ss-playlist-pagination > div {
  display: flex;
  gap: 6px;
}

body[data-ui-shell='studio'] .ss-playlist-pagination .ss-playlist-btn {
  min-width: 78px !important;
  height: 34px;
  min-height: 34px !important;
}

body[data-ui-shell='studio'] .ss-builder-footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 18px;
  border-top: 1px solid var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 58%, transparent);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .ss-builder-footer > span {
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .ss-builder-footer p {
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.35;
}

body[data-ui-shell='studio'] .ss-playlist-close:focus-visible,
body[data-ui-shell='studio'] .ss-playlist-shell button:focus-visible,
body[data-ui-shell='studio'] .ss-playlist-shell input:focus-visible,
body[data-ui-shell='studio'] .ss-playlist-shell select:focus-visible {
  outline: 2px solid var(--studio-primary);
  outline-offset: 2px;
}

body[data-ui-shell='studio']:not(.dark-mode) .ss-playlist-modal {
  background:
    linear-gradient(rgba(216, 210, 199, 0.84), rgba(216, 210, 199, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(47, 80, 201, 0.055) 71px 72px);
}

body[data-ui-shell='studio']:not(.dark-mode) .ss-playlist-shell {
  color-scheme: light;
  box-shadow:
    0 34px 88px rgba(44, 38, 31, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.5);
}

@media (max-width: 900px) {
  body[data-ui-shell='studio'] .ss-playlist-modal {
    padding: 14px;
  }

  body[data-ui-shell='studio'] .ss-playlist-shell {
    height: calc(100dvh - 28px);
    max-height: calc(100dvh - 28px);
  }

  body[data-ui-shell='studio'] .ss-playlist-header {
    min-height: 90px;
    padding: 14px 16px;
  }

  body[data-ui-shell='studio'] .ss-playlist-title {
    font-size: 31px;
  }

  body[data-ui-shell='studio'] .ss-builder-status {
    display: none;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar {
    grid-template-columns: minmax(180px, 0.72fr) minmax(220px, 1fr) auto;
    padding: 12px 14px;
  }

  body[data-ui-shell='studio'] .ss-playlist-item {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  body[data-ui-shell='studio'] .ss-playlist-thumb {
    width: 58px;
    height: 44px;
  }

  body[data-ui-shell='studio'] .ss-playlist-icon-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
  }
}

@media (max-width: 720px) {
  body[data-ui-shell='studio'] .ss-playlist-modal {
    place-items: end center;
    padding: 0;
  }

  body[data-ui-shell='studio'] .ss-playlist-shell {
    width: 100%;
    height: min(94dvh, 920px);
    max-height: 100dvh;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  body[data-ui-shell='studio'] .ss-playlist-header {
    min-height: 82px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 13px max(12px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .ss-builder-kicker {
    font-size: 7px;
  }

  body[data-ui-shell='studio'] .ss-playlist-title {
    font-size: 27px;
  }

  body[data-ui-shell='studio'] .ss-builder-heading p {
    margin-top: 5px;
    font-size: 10px;
  }

  body[data-ui-shell='studio'] .ss-builder-header-tools {
    gap: 0;
  }

  body[data-ui-shell='studio'] .ss-playlist-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
    padding: 10px max(12px, env(safe-area-inset-right)) 11px max(12px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar-actions .ss-playlist-btn {
    width: 100%;
    min-width: 0 !important;
    min-height: 44px !important;
    height: 44px;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar select,
  body[data-ui-shell='studio'] .ss-playlist-toolbar input,
  body[data-ui-shell='studio'] .ss-library-search input,
  body[data-ui-shell='studio'] .ss-library-ratio select {
    min-height: 44px;
    height: 44px;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar select,
  body[data-ui-shell='studio'] .ss-library-ratio select {
    background-position:
      calc(100% - 15px) 19px,
      calc(100% - 10px) 19px;
  }

  body[data-ui-shell='studio'] .ss-builder-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--studio-rule-strong);
    background: var(--studio-panel-raised);
  }

  body[data-ui-shell='studio'] .ss-builder-mobile-tabs button {
    appearance: none;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid var(--studio-rule);
    border-radius: 0;
    background: transparent;
    color: var(--studio-text-muted);
    font-family: var(--studio-font-data);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  body[data-ui-shell='studio'] .ss-builder-mobile-tabs button:last-child {
    border-right: 0;
  }

  body[data-ui-shell='studio'] .ss-builder-mobile-tabs button[aria-selected='true'] {
    background: color-mix(in srgb, var(--studio-primary) 10%, transparent);
    color: var(--studio-text);
    box-shadow: inset 0 -2px 0 var(--studio-primary);
  }

  body[data-ui-shell='studio'] .ss-builder-mobile-tabs span {
    min-width: 20px;
    padding: 3px 4px;
    background: var(--studio-rule);
    color: var(--studio-text);
    font-size: 8px;
    line-height: 1;
  }

  body[data-ui-shell='studio'] .ss-playlist-columns {
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  body[data-ui-shell='studio'] .ss-playlist-panel {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
    border: 0;
  }

  body[data-ui-shell='studio'] .ss-playlist-modal[data-mobile-view='library'] [data-ss-builder-panel='sequence'],
  body[data-ui-shell='studio'] .ss-playlist-modal[data-mobile-view='sequence'] [data-ss-builder-panel='library'] {
    display: none;
  }

  body[data-ui-shell='studio'] .ss-library-tools {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  body[data-ui-shell='studio'] .ss-playlist-item {
    grid-template-columns: 54px minmax(0, 1fr) 44px;
    padding: 7px;
  }

  body[data-ui-shell='studio'] .ss-playlist-thumb {
    width: 54px;
    height: 42px;
  }

  body[data-ui-shell='studio'] .ss-playlist-icon-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  body[data-ui-shell='studio'] .ss-playlist-item-playlist {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .ss-playlist-item-playlist .ss-playlist-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-ui-shell='studio'] .ss-playlist-item-playlist .ss-playlist-icon-btn {
    width: 100% !important;
  }

  body[data-ui-shell='studio'] .ss-playlist-pagination {
    align-items: flex-end;
  }

  body[data-ui-shell='studio'] .ss-playlist-pagination > div {
    flex: 0 0 auto;
  }

  body[data-ui-shell='studio'] .ss-playlist-pagination .ss-playlist-btn {
    min-height: 44px !important;
    height: 44px;
  }

  body[data-ui-shell='studio'] .ss-builder-footer {
    min-height: 42px;
    padding: 7px max(12px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .ss-builder-footer p {
    max-width: 68%;
    text-align: right;
  }
}

@media (max-width: 440px) {
  body[data-ui-shell='studio'] .ss-builder-heading p {
    display: none;
  }

  body[data-ui-shell='studio'] .ss-playlist-header {
    min-height: 68px;
  }

  body[data-ui-shell='studio'] .ss-playlist-title {
    font-size: 24px;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar-actions {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .ss-builder-panel-heading p,
  body[data-ui-shell='studio'] .ss-builder-count {
    display: none;
  }

  body[data-ui-shell='studio'] .ss-playlist-pagination > span {
    max-width: 144px;
  }
}

@media (max-height: 640px) and (min-width: 721px) {
  body[data-ui-shell='studio'] .ss-playlist-modal {
    padding: 8px;
  }

  body[data-ui-shell='studio'] .ss-playlist-shell {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  body[data-ui-shell='studio'] .ss-playlist-header {
    min-height: 66px;
    padding-top: 10px;
    padding-bottom: 9px;
  }

  body[data-ui-shell='studio'] .ss-builder-heading p,
  body[data-ui-shell='studio'] .ss-builder-status {
    display: none;
  }

  body[data-ui-shell='studio'] .ss-playlist-title {
    font-size: 28px;
  }

  body[data-ui-shell='studio'] .ss-playlist-toolbar {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  body[data-ui-shell='studio'] .ss-playlist-panel {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] .ss-playlist-shell {
    animation: none;
  }

  body[data-ui-shell='studio'] .ss-playlist-item {
    transition: none;
  }
}

/* Queue controller workbench: persistent desktop control surface with the
   canonical canvas and Composition Controls visible at the same time. */
@media (min-width: 1025px) {
  body[data-ui-shell='studio'].gq-workbench-open .main-content {
    grid-template-columns:
      var(--studio-queue-workbench-width)
      minmax(0, 1fr)
      var(--studio-rail-width)
      var(--studio-inspector-width);
  }

  body[data-ui-shell='studio'].gq-workbench-open #studio-queue-workbench-mount {
    grid-column: 1;
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid var(--studio-rule-strong);
    background: var(--studio-panel);
    position: relative;
    z-index: 90;
  }

  body[data-ui-shell='studio'].gq-workbench-open .canvas-column {
    grid-column: 2;
  }

  body[data-ui-shell='studio'].gq-workbench-open #studio-tool-rail {
    grid-column: 3;
  }

  body[data-ui-shell='studio'].gq-workbench-open .controls-column {
    grid-column: 4;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open .main-content {
    grid-template-columns:
      var(--studio-queue-workbench-width)
      minmax(0, 1fr)
      var(--studio-rail-width) !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open #studio-queue-workbench-mount {
    grid-column: 1 !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open .canvas-column {
    grid-column: 2 !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open #studio-tool-rail {
    grid-column: 3 !important;
  }

  body[data-ui-shell='studio'] .gq-console-overlay.gq-workbench-docked {
    position: relative;
    z-index: auto;
    inset: auto;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    place-items: stretch;
    background: var(--studio-panel);
    backdrop-filter: none;
    overscroll-behavior: contain;
  }

  body[data-ui-shell='studio']:not(.dark-mode) .gq-console-overlay.gq-workbench-docked {
    background: var(--studio-panel);
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    animation: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-header {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
    min-height: 0;
    padding: 15px 14px 13px;
    border-bottom: 1px solid var(--studio-rule-strong);
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .presentation-dialog-heading h2 {
    font-size: clamp(28px, 2.1vw, 32px);
    line-height: 0.94;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .presentation-dialog-heading p,
  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-status-detail {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-header-tools {
    align-self: start;
    gap: 8px;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-state {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-status {
    max-width: 126px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-workbench-now {
    display: grid;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-body {
    padding: 0;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-grid,
  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-settings,
  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-monitor,
  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console .gq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-settings {
    grid-row: 1;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-monitor {
    grid-row: 2;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-settings > .gq-console-section,
  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console .gq-checkbox:last-child:nth-child(odd) {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-preview-aperture {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-preview-action {
    width: 100%;
    margin-top: 12px;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console .gq-corpus-compact {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-corpus-edit {
    width: 100%;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-console-transport {
    display: block;
    min-height: 0;
    padding: 10px 12px 12px;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-transport-context {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-transport-actions {
    grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(62px, 0.8fr));
    gap: 5px;
  }

  body[data-ui-shell='studio'] .gq-workbench-docked .gq-transport-actions .presentation-action {
    min-width: 0;
    padding-inline: 7px;
  }

  body[data-ui-shell='studio'].fullscreen-mode #studio-queue-workbench-mount,
  body[data-ui-shell='studio'].fullscreen-mode #studio-queue-action-rail,
  body[data-ui-shell='studio'].live-presenter-mode #studio-queue-workbench-mount,
  body[data-ui-shell='studio'].live-presenter-mode #studio-queue-action-rail {
    display: none !important;
  }
}

@media (min-width: 1280px) {
  body[data-ui-shell='studio'].gq-workbench-open .main-content {
    grid-template-columns:
      var(--studio-queue-workbench-width)
      var(--studio-queue-rail-width)
      minmax(0, 1fr)
      var(--studio-rail-width)
      var(--studio-inspector-width);
  }

  body[data-ui-shell='studio'].gq-workbench-open #studio-queue-action-rail {
    grid-column: 2;
    display: flex;
    min-width: var(--studio-queue-rail-width);
    min-height: 0;
    border-right: 1px solid var(--studio-rule-strong);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--studio-signal) 5%, transparent), transparent 28%),
      var(--studio-ink);
    position: relative;
    z-index: 85;
  }

  body[data-ui-shell='studio'].gq-workbench-open .canvas-column {
    grid-column: 3;
  }

  body[data-ui-shell='studio'].gq-workbench-open #studio-tool-rail {
    grid-column: 4;
  }

  body[data-ui-shell='studio'].gq-workbench-open .controls-column {
    grid-column: 5;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open .main-content {
    grid-template-columns:
      var(--studio-queue-workbench-width)
      var(--studio-queue-rail-width)
      minmax(0, 1fr)
      var(--studio-rail-width) !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open #studio-queue-workbench-mount {
    grid-column: 1 !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open #studio-queue-action-rail {
    grid-column: 2 !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open .canvas-column {
    grid-column: 3 !important;
  }

  body[data-ui-shell='studio'].canvas-only-mode.gq-workbench-open #studio-tool-rail {
    grid-column: 4 !important;
  }

  body[data-ui-shell='studio'] .studio-queue-rail-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  body[data-ui-shell='studio'] .studio-queue-rail-actions .studio-action {
    display: flex;
    width: 100%;
    min-height: 88px;
    padding: 11px 3px 10px;
    border-bottom: 1px solid var(--studio-rule);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  body[data-ui-shell='studio'] .studio-queue-rail-actions .studio-action::after {
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
  }

  body[data-ui-shell='studio'] .studio-queue-rail-actions .studio-action-label {
    max-width: 50px;
    font-size: 7px;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-align: center;
    white-space: normal;
  }

  body[data-ui-shell='studio'] .studio-queue-rail-actions .studio-action-icon svg {
    width: 20px;
    height: 20px;
  }

  body[data-ui-shell='studio'].gq-workbench-open .gq-workbench-docked .gq-inline-actions {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] .slideshow-console,
  body[data-ui-shell='studio'] .slideshow-console *,
  body[data-ui-shell='studio'] .slideshow-console *::before,
  body[data-ui-shell='studio'] .slideshow-console *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Generative Queue Console */
body[data-ui-shell='studio'] .gq-console-overlay {
  overflow: hidden;
  padding:
    max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  background:
    linear-gradient(rgba(4, 7, 9, 0.82), rgba(4, 7, 9, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 71px, color-mix(in srgb, var(--studio-signal) 4%, transparent) 71px 72px);
}

body[data-ui-shell='studio'] .gq-console {
  width: min(1280px, 100%);
  max-height: calc(100dvh - max(48px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--studio-rule-strong);
  border-radius: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--studio-signal) 4%, transparent), transparent 31%),
    var(--studio-panel);
  color: var(--studio-text);
  color-scheme: dark;
  font-family: var(--studio-font-ui);
}

body[data-ui-shell='studio'] .gq-console::before {
  width: 186px;
  background: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: -1px;
  left: 185px;
  width: 34px;
  height: 2px;
  background: var(--studio-primary);
  pointer-events: none;
}

body[data-ui-shell='studio'] .gq-console-header {
  min-width: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 7%, transparent), transparent 34%),
    color-mix(in srgb, var(--studio-panel-raised) 50%, transparent);
}

body[data-ui-shell='studio'] .gq-console .presentation-dialog-kicker {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console-state {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 190px;
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .gq-console-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--studio-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .gq-console-status::before {
  content: '';
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--studio-text-muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-text-muted) 15%, transparent);
}

body[data-ui-shell='studio'] .gq-console-status[data-status='running']::before,
body[data-ui-shell='studio'] .gq-console-status[data-status='synced']::before,
body[data-ui-shell='studio'] .gq-console-status[data-status='complete']::before {
  background: var(--studio-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-primary) 18%, transparent);
}

body[data-ui-shell='studio'] .gq-console-status[data-status='transferring']::before,
body[data-ui-shell='studio'] .gq-console-status[data-status='paused']::before {
  background: #e9aa58;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e9aa58 18%, transparent);
}

body[data-ui-shell='studio'] .gq-console-status[data-status='degraded']::before,
body[data-ui-shell='studio'] .gq-console-status[data-status='error']::before {
  background: var(--studio-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-danger) 18%, transparent);
}

body[data-ui-shell='studio'] .gq-console-status-detail {
  max-width: 270px;
  overflow: hidden;
  color: var(--studio-text-muted);
  font-size: 9px;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .gq-workbench-now {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  min-width: 0;
  padding: 9px 10px 8px;
  border: 1px solid var(--studio-rule);
  border-left: 2px solid var(--studio-signal);
  background: color-mix(in srgb, var(--studio-ink) 82%, transparent);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .gq-workbench-now-label,
body[data-ui-shell='studio'] .gq-workbench-position {
  font-size: 7px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .gq-workbench-now-label {
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .gq-workbench-position {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-workbench-units {
  display: -webkit-box;
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--studio-text);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

body[data-ui-shell='studio'] .gq-workbench-runtime-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body[data-ui-shell='studio'] .gq-runtime-queue-readout {
  display: none !important;
}

body[data-ui-shell='studio'] .gq-console-body {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--studio-rule-strong) transparent;
  scrollbar-width: thin;
}

body[data-ui-shell='studio'] .gq-console-body::-webkit-scrollbar {
  width: 6px;
}

body[data-ui-shell='studio'] .gq-console-body::-webkit-scrollbar-thumb {
  background: var(--studio-rule-strong);
}

body[data-ui-shell='studio'] .gq-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.34fr);
  align-items: start;
  gap: 1px;
  min-width: 0;
  border: 1px solid var(--studio-rule);
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-console-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  min-width: 0;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-console-settings > .gq-console-section:nth-child(-n + 2) {
  grid-column: auto;
}

body[data-ui-shell='studio'] .gq-console-section,
body[data-ui-shell='studio'] .gq-monitor-section {
  min-width: 0;
  background: var(--studio-panel);
}

body[data-ui-shell='studio'] .gq-console-section .presentation-section-heading > span,
body[data-ui-shell='studio'] .gq-monitor-section .presentation-section-heading > span {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console .gq-corpus-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--studio-signal) 78%, transparent);
}

body[data-ui-shell='studio'] .gq-console .gq-corpus-info,
body[data-ui-shell='studio'] .gq-console .gq-corpus-head {
  min-width: 0;
}

body[data-ui-shell='studio'] .gq-console .gq-corpus-meta {
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 9px;
}

body[data-ui-shell='studio'] .gq-console .gq-corpus-summary {
  margin: 0;
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
  font-weight: 600;
}

body[data-ui-shell='studio'] .gq-console .gq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin-top: 14px;
}

body[data-ui-shell='studio'] .gq-console .gq-motion-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-ui-shell='studio'] .gq-console .gq-range,
body[data-ui-shell='studio'] .gq-console .gq-select-row {
  min-width: 0;
  gap: 7px 10px;
}

body[data-ui-shell='studio'] .gq-console .gq-label {
  color: color-mix(in srgb, var(--studio-text) 72%, var(--studio-text-muted));
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.07em;
}

body[data-ui-shell='studio'] .gq-console .gq-mode-picker-row {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .gq-console .am-canonical-select {
  display: none;
}

body[data-ui-shell='studio'] .gq-mode-selector-btn {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: var(--studio-text);
  text-align: left;
  background: var(--studio-panel-raised);
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

body[data-ui-shell='studio'] .gq-mode-selector-btn::before {
  display: none;
}

body[data-ui-shell='studio'] .gq-mode-selector-btn:hover,
body[data-ui-shell='studio'] .gq-mode-selector-btn:focus-visible {
  color: var(--studio-text);
  background: color-mix(in srgb, var(--studio-panel-raised) 88%, var(--studio-signal) 12%);
  border-color: var(--studio-signal);
  box-shadow: inset 0 0 0 1px var(--studio-signal);
  transform: none;
}

body[data-ui-shell='studio'] .gq-mode-selector-btn:focus-visible {
  outline: 2px solid var(--studio-signal);
  outline-offset: 2px;
}

body[data-ui-shell='studio'] .gq-mode-selector-thumb {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--studio-void);
  border-right: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-mode-selector-thumb img,
body[data-ui-shell='studio'] .gq-mode-selector-thumb .am-card-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body[data-ui-shell='studio'] .gq-mode-selector-thumb .am-card-placeholder {
  display: grid;
  place-items: center;
}

body[data-ui-shell='studio'] .gq-mode-selector-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px 14px;
}

body[data-ui-shell='studio'] .gq-mode-selector-copy strong,
body[data-ui-shell='studio'] .gq-mode-selector-copy small,
body[data-ui-shell='studio'] .gq-mode-selector-command {
  font-family: var(--studio-font-data);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

body[data-ui-shell='studio'] .gq-mode-selector-copy strong {
  overflow: hidden;
  color: var(--studio-text);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .gq-mode-selector-copy small {
  color: var(--studio-text-muted);
  font-size: 8px;
  font-weight: 700;
}

body[data-ui-shell='studio'] .gq-mode-selector-command {
  min-width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--studio-text-muted);
  border-left: 1px solid var(--studio-rule);
  font-size: 8px;
  font-weight: 800;
}

body[data-ui-shell='studio'] .gq-mode-selector-command b {
  color: var(--studio-signal);
  font-size: 12px;
}

body[data-ui-shell='studio'] .gq-mode-selector-btn:hover .gq-mode-selector-command {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .gq-console .gq-value {
  color: var(--studio-signal);
  font-family: var(--studio-font-data);
  font-size: 10px;
}

body[data-ui-shell='studio'] .gq-console select,
body[data-ui-shell='studio'] .gq-console input[type='number'] {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 10px;
}

body[data-ui-shell='studio'] .gq-console select {
  padding: 0 34px 0 10px;
}

body[data-ui-shell='studio'] .gq-console input[type='number'] {
  padding: 0 8px;
}

body[data-ui-shell='studio'] .gq-console .gq-number-input {
  width: 70px;
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console input[type='range'] {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  accent-color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console .gq-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-console .gq-checkbox {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 9px;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: var(--studio-panel-raised);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0.035em;
  cursor: pointer;
}

body[data-ui-shell='studio'] .gq-console .gq-checkbox:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .gq-console .gq-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-output-controls {
  display: grid;
  gap: 13px;
  margin-top: 14px;
}

body[data-ui-shell='studio'] .gq-output-target-control::after {
  content: 'Local';
  display: none;
}

body[data-ui-shell='studio'] .gq-output-summary {
  display: grid;
  gap: 10px;
}

body[data-ui-shell='studio'] .gq-output-summary p,
body[data-ui-shell='studio'] .gq-controller-preview-summary {
  margin: 0;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-ui);
  font-size: 9px;
  line-height: 1.5;
}

body[data-ui-shell='studio'] .gq-configure-output {
  appearance: none;
  justify-self: start;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

body[data-ui-shell='studio'] .gq-configure-output:hover {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console-monitor {
  display: grid;
  gap: 1px;
  min-width: 0;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-preview-section {
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--studio-signal) 5%, transparent), transparent 46%),
    var(--studio-panel);
}

body[data-ui-shell='studio'] .gq-preview-aperture {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.7fr 0.45fr;
  align-items: end;
  gap: 5px;
  height: 104px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--studio-rule);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--studio-primary) 16%, transparent), transparent 55%),
    var(--studio-ink);
}

body[data-ui-shell='studio'] .gq-preview-aperture::before {
  content: 'CTRL / PREVIEW';
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 9px;
  color: color-mix(in srgb, var(--studio-text-muted) 72%, transparent);
  font-family: var(--studio-font-data);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

body[data-ui-shell='studio'] .gq-preview-aperture::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, color-mix(in srgb, var(--studio-text) 4%, transparent) 9px 10px),
    linear-gradient(90deg, transparent 74%, color-mix(in srgb, var(--studio-signal) 7%, transparent));
  pointer-events: none;
}

body[data-ui-shell='studio'] .gq-preview-aperture span {
  display: block;
  background: color-mix(in srgb, var(--studio-primary) 72%, var(--studio-panel));
  box-shadow: 0 -10px 34px color-mix(in srgb, var(--studio-primary) 12%, transparent);
}

body[data-ui-shell='studio'] .gq-preview-aperture span:nth-child(1) { height: 58%; }
body[data-ui-shell='studio'] .gq-preview-aperture span:nth-child(2) { height: 84%; background: var(--studio-signal); }
body[data-ui-shell='studio'] .gq-preview-aperture span:nth-child(3) { height: 38%; }

body[data-ui-shell='studio'] .gq-controller-preview-summary {
  margin-top: 11px;
}

body[data-ui-shell='studio'] .gq-inline-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-inline-actions .presentation-action {
  min-width: 0;
  min-height: 42px;
  padding-inline: 7px;
  font-size: 8px;
  line-height: 1.25;
}

body[data-ui-shell='studio'] .gq-inline-actions .gq-preview-action,
body[data-ui-shell='studio'] .gq-inline-actions .gq-configure-action {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .gq-transfer-meter {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

body[data-ui-shell='studio'] .gq-transfer-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] #gq-transfer-progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 0;
  background: var(--studio-rule);
  accent-color: var(--studio-signal);
}

body[data-ui-shell='studio'] #gq-transfer-progress::-webkit-progress-bar { background: var(--studio-rule); }
body[data-ui-shell='studio'] #gq-transfer-progress::-webkit-progress-value { background: var(--studio-signal); }
body[data-ui-shell='studio'] #gq-transfer-progress::-moz-progress-bar { background: var(--studio-signal); }

body[data-ui-shell='studio'] .gq-console .gq-queue-text-readout,
body[data-ui-shell='studio'] .gq-console .gq-telemetry-readout {
  margin-top: 14px;
  border-color: var(--studio-rule);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-text-muted);
  box-shadow: none;
}

body[data-ui-shell='studio'] .gq-console .gq-queue-text-head {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .gq-console .gq-queue-text-head [data-gq-queue-cursor] {
  color: var(--studio-signal);
}

body[data-ui-shell='studio'] .gq-console .gq-queue-text-body {
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .gq-console .gq-timeline-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-color: var(--studio-rule);
}

body[data-ui-shell='studio'] .gq-display-telemetry-list {
  display: grid;
  gap: 1px;
  margin: 14px 0 0;
  padding: 1px;
  background: var(--studio-rule);
  list-style: none;
}

body[data-ui-shell='studio'] .gq-display-telemetry-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  padding: 9px 10px;
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.35;
}

body[data-ui-shell='studio'] .gq-display-telemetry-list strong {
  color: var(--studio-text);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .gq-display-telemetry-list strong[data-status='synced'],
body[data-ui-shell='studio'] .gq-display-telemetry-list strong[data-status='running'] {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .gq-display-telemetry-list strong[data-status='error'],
body[data-ui-shell='studio'] .gq-display-telemetry-list strong[data-status='degraded'] {
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .gq-session-state {
  margin-top: 10px;
  padding: 10px;
  border-left: 2px solid var(--studio-rule-strong);
  background: var(--studio-panel-raised);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.025em;
}

body[data-ui-shell='studio'] .gq-session-error {
  border-left-color: var(--studio-danger);
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .gq-console-transport {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  gap: 18px;
  min-width: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-signal) 6%, transparent), transparent 38%),
    var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .gq-transport-context {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

body[data-ui-shell='studio'] .gq-transport-label,
body[data-ui-shell='studio'] .gq-console .gq-status {
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .gq-transport-label {
  color: var(--studio-signal);
  font-weight: 800;
}

body[data-ui-shell='studio'] .gq-console .gq-status {
  min-height: 0;
  padding: 0;
}

body[data-ui-shell='studio'] .gq-transport-actions {
  display: grid;
  grid-template-columns: minmax(142px, 1.4fr) repeat(2, minmax(96px, 1fr));
  gap: 8px;
}

body[data-ui-shell='studio'] .gq-console .gq-primary-btn,
body[data-ui-shell='studio'] .gq-console .gq-secondary-btn,
body[data-ui-shell='studio'] .gq-console .gq-stop-btn {
  min-height: 40px;
  border-radius: 0;
  font-family: var(--studio-font-data);
  font-size: 9px;
}

body[data-ui-shell='studio'] .gq-console .gq-primary-btn {
  border-color: var(--studio-signal);
  background: var(--studio-signal);
  color: var(--studio-vermilion-ink);
}

body[data-ui-shell='studio'] .gq-console .gq-secondary-btn {
  border-color: var(--studio-rule-strong);
  background: var(--studio-panel-raised);
  color: var(--studio-text);
}

body[data-ui-shell='studio'] .gq-console .gq-stop-btn {
  border-color: color-mix(in srgb, var(--studio-danger) 68%, var(--studio-rule-strong));
  background: transparent;
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .gq-console .gq-primary-btn:hover:not(:disabled) {
  background: var(--studio-vermilion-hover);
}

body[data-ui-shell='studio'] .gq-console .gq-secondary-btn:hover:not(:disabled),
body[data-ui-shell='studio'] .gq-console .gq-stop-btn:hover:not(:disabled) {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 9%, var(--studio-panel-raised));
}

body[data-ui-shell='studio'] .gq-console button:disabled {
  border-color: var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 72%, transparent);
  color: var(--studio-text-muted);
  opacity: 0.56;
  cursor: not-allowed;
}

body[data-ui-shell='studio'] .gq-console button:focus-visible,
body[data-ui-shell='studio'] .gq-console input:focus-visible,
body[data-ui-shell='studio'] .gq-console select:focus-visible,
body[data-ui-shell='studio'] .gq-console textarea:focus-visible {
  border-color: var(--studio-signal);
  outline: 2px solid var(--studio-signal);
  outline-offset: 2px;
}

body[data-ui-shell='studio']:not(.dark-mode) .gq-console-overlay {
  background:
    linear-gradient(rgba(35, 38, 39, 0.45), rgba(35, 38, 39, 0.6)),
    repeating-linear-gradient(90deg, transparent 0 71px, color-mix(in srgb, var(--studio-signal) 5%, transparent) 71px 72px);
}

body[data-ui-shell='studio']:not(.dark-mode) .gq-console {
  color-scheme: light;
  box-shadow:
    0 34px 82px rgba(45, 41, 35, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.34);
}

@media (min-width: 1440px) {
  body[data-ui-shell='studio'] .gq-console {
    width: min(1360px, 100%);
  }
}

@media (max-width: 1120px) {
  body[data-ui-shell='studio'] .gq-console-grid {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.38fr);
  }

  body[data-ui-shell='studio'] .gq-console .gq-composition-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  body[data-ui-shell='studio'] .gq-console-overlay {
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .gq-console {
    max-height: calc(100dvh - max(28px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  }

  body[data-ui-shell='studio'] .gq-console-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-console-monitor {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .gq-console .gq-composition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .gq-console select,
  body[data-ui-shell='studio'] .gq-console input[type='number'],
  body[data-ui-shell='studio'] .gq-console .gq-checkbox,
  body[data-ui-shell='studio'] .gq-console .presentation-action,
  body[data-ui-shell='studio'] .gq-configure-output {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  body[data-ui-shell='studio'] .gq-console-overlay {
    place-items: end center;
    padding: max(8px, env(safe-area-inset-top)) 0 0;
    background: rgba(4, 7, 9, 0.78);
    backdrop-filter: blur(5px);
  }

  body[data-ui-shell='studio'] .gq-console {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: 0 -24px 66px rgba(0, 0, 0, 0.58);
  }

  body[data-ui-shell='studio'] .gq-console-monitor {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-mode-selector-btn {
    grid-template-columns: 80px minmax(0, 1fr) 48px;
  }

  body[data-ui-shell='studio'] .gq-mode-selector-command {
    min-width: 48px;
    padding: 0;
    font-size: 0;
  }

  body[data-ui-shell='studio'] .gq-console-transport {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 1.2fr);
    padding:
      10px
      max(12px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] .gq-output-target-control #gq-output-target {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-output-target-control::after {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid var(--studio-rule-strong);
    background: var(--studio-panel-raised);
    color: var(--studio-text);
    font-family: var(--studio-font-data);
    font-size: 10px;
  }

  body[data-ui-shell='studio'] .gq-output-summary {
    display: block;
  }
}

@media (max-width: 520px) {
  body[data-ui-shell='studio'] .gq-console-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 72px;
    padding: 10px 12px;
  }

  body[data-ui-shell='studio'] .gq-console-header .presentation-dialog-heading p,
  body[data-ui-shell='studio'] .gq-console-status-detail {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-console-header .presentation-dialog-heading h2 {
    font-size: 27px;
  }

  body[data-ui-shell='studio'] .gq-console-state {
    min-width: 0;
  }

  body[data-ui-shell='studio'] .gq-console-status {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-shell='studio'] .gq-console-body {
    padding: 10px 12px 14px;
  }

  body[data-ui-shell='studio'] .gq-console-settings,
  body[data-ui-shell='studio'] .gq-console .gq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-console-settings > .gq-console-section:nth-child(-n + 2) {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .gq-console .gq-corpus-compact {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-corpus-edit {
    width: 100%;
  }

  body[data-ui-shell='studio'] .gq-transport-context {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-console-transport {
    display: block;
  }

  body[data-ui-shell='studio'] .gq-transport-actions {
    grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(76px, 1fr));
  }
}

@media (max-width: 390px) {
  body[data-ui-shell='studio'] .gq-console .presentation-console-section {
    padding: 12px 10px;
  }

  body[data-ui-shell='studio'] .gq-console .gq-toggles {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-console .gq-checkbox:last-child:nth-child(odd) {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .gq-console .gq-timeline-actions {
    gap: 4px;
  }

  body[data-ui-shell='studio'] .gq-console .gq-timeline-actions .presentation-action {
    min-width: 0;
    padding-inline: 6px;
    font-size: 8px;
  }

  body[data-ui-shell='studio'] .gq-console-transport {
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .gq-transport-actions {
    gap: 5px;
  }

  body[data-ui-shell='studio'] .gq-transport-actions .presentation-action {
    min-width: 0;
    padding-inline: 6px;
  }
}

@media (max-height: 700px) and (orientation: portrait) {
  body[data-ui-shell='studio'] .gq-console-header {
    min-height: 68px;
    padding-block: 9px;
  }

  body[data-ui-shell='studio'] .gq-console-header .presentation-dialog-heading p {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  body[data-ui-shell='studio'] .gq-console-overlay {
    place-items: stretch;
    padding:
      env(safe-area-inset-top)
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left);
  }

  body[data-ui-shell='studio'] .gq-console {
    width: 100%;
    max-height: 100dvh;
    border: 0;
  }

  body[data-ui-shell='studio'] .gq-console-header {
    min-height: 58px;
    padding: 7px 12px;
  }

  body[data-ui-shell='studio'] .gq-console-header .presentation-dialog-heading p,
  body[data-ui-shell='studio'] .gq-console-status-detail,
  body[data-ui-shell='studio'] .gq-output-target-control #gq-output-target {
    display: none;
  }

  body[data-ui-shell='studio'] .gq-output-target-control::after {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid var(--studio-rule-strong);
    background: var(--studio-panel-raised);
    color: var(--studio-text);
    font-family: var(--studio-font-data);
    font-size: 10px;
  }

  body[data-ui-shell='studio'] .gq-console-body {
    padding: 9px 11px;
  }

  body[data-ui-shell='studio'] .gq-console-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.75fr);
  }

  body[data-ui-shell='studio'] .gq-console-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .gq-console-settings > .gq-console-section:nth-child(-n + 2) {
    grid-column: 1 / -1;
  }

  body[data-ui-shell='studio'] .gq-console-monitor {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .gq-console-transport {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 1fr);
    min-height: 54px;
    padding: 5px max(10px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-shell='studio'] .gq-console,
  body[data-ui-shell='studio'] .gq-console *,
  body[data-ui-shell='studio'] .gq-console *::before,
  body[data-ui-shell='studio'] .gq-console *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Phase 7: shared display routing and controller presentation surfaces. */
body[data-ui-shell='studio'] .presentation-dialog-overlay {
  overflow: hidden;
  overscroll-behavior: none;
}

body[data-ui-shell='studio'] .presentation-dialog-body {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body[data-ui-shell='studio'] .display-routing-dialog {
  width: min(1040px, 100%);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  gap: 12px;
  padding: 20px;
}

body[data-ui-shell='studio'] .display-routing-session-summary,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-header,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions {
  grid-column: 1 / -1;
}

body[data-ui-shell='studio'] .display-routing-dialog .presentation-section-heading {
  grid-template-columns: 52px minmax(0, 1fr);
}

body[data-ui-shell='studio'] .display-routing-session-summary {
  position: relative;
  padding: 17px 18px 16px;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  background:
    linear-gradient(102deg, color-mix(in srgb, var(--studio-primary) 10%, transparent), transparent 44%),
    color-mix(in srgb, var(--studio-panel-raised) 72%, var(--studio-panel));
}

body[data-ui-shell='studio'] .display-routing-session-summary::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--studio-primary);
}

body[data-ui-shell='studio'] .display-routing-summary-list {
  display: grid;
  grid-template-columns: 1.2fr 0.72fr 0.9fr 1.08fr 0.9fr;
  margin: 13px 0 0;
  padding: 0;
  border: 1px solid var(--studio-rule);
  background: var(--studio-rule);
  gap: 1px;
}

body[data-ui-shell='studio'] .display-routing-summary-list > div {
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--studio-panel) 88%, transparent);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .display-routing-summary-list dt,
body[data-ui-shell='studio'] .display-routing-summary-list dd {
  margin: 0;
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .display-routing-summary-list dt {
  color: var(--studio-text-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .display-routing-summary-list dd {
  margin-top: 7px;
  overflow: hidden;
  color: var(--studio-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .display-routing-capability {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--studio-signal);
  background: color-mix(in srgb, var(--studio-signal) 6%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  line-height: 1.55;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-header {
  padding: 13px 14px;
  border: 1px solid var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 62%, transparent);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status {
  position: relative;
  min-height: 26px;
  margin-top: 0;
  padding-left: 25px;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status::before {
  content: '';
  position: absolute;
  left: 9px;
  width: 6px;
  height: 6px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-status[data-status='display-degraded'],
body[data-ui-shell='studio'] .display-routing-dialog .live-display-status[data-status='no-display'] {
  border-color: color-mix(in srgb, var(--studio-danger) 58%, var(--studio-rule));
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-detail {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body[data-ui-shell='studio'] .display-routing-wall-controls,
body[data-ui-shell='studio'] .display-routing-display-status {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--studio-rule);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--studio-primary) 3%, transparent), transparent 46%),
    var(--studio-panel);
}

body[data-ui-shell='studio'] .display-routing-wall-controls {
  grid-column: 1;
}

body[data-ui-shell='studio'] .display-routing-display-status {
  grid-column: 2;
}

body[data-ui-shell='studio'] .display-routing-wall-controls .live-display-toggles {
  margin-top: 14px;
}

body[data-ui-shell='studio'] .display-routing-wall-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-target select,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-mode select,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout input,
body[data-ui-shell='studio'] .display-routing-dialog .live-display-detect-btn {
  min-height: 40px;
  height: 40px;
}

body[data-ui-shell='studio'] .display-routing-display-list {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

body[data-ui-shell='studio'] .display-routing-display-list > li,
body[data-ui-shell='studio'] .display-routing-display-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 12px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 60%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 10px;
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .display-routing-display-list > li[data-health='healthy'],
body[data-ui-shell='studio'] .display-routing-display-list > li.is-local {
  border-left: 2px solid var(--studio-primary);
}

body[data-ui-shell='studio'] .display-routing-display-list > li[data-health='stale'],
body[data-ui-shell='studio'] .display-routing-display-list > li[data-health='blocked'],
body[data-ui-shell='studio'] .display-routing-display-list > li[data-health='error'] {
  border-left: 2px solid var(--studio-danger);
}

body[data-ui-shell='studio'] .display-routing-display-identity {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-ui-shell='studio'] .display-routing-display-name {
  overflow: hidden;
  color: var(--studio-text);
  font-weight: 800;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .display-routing-display-meta {
  overflow: hidden;
  color: var(--studio-text-muted);
  font-size: 8px;
  letter-spacing: 0.055em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .display-routing-health {
  color: #e9aa58;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .display-routing-health[data-health='healthy'] {
  color: var(--studio-primary);
}

body[data-ui-shell='studio'] .display-routing-health[data-health='stale'],
body[data-ui-shell='studio'] .display-routing-health[data-health='blocked'],
body[data-ui-shell='studio'] .display-routing-health[data-health='closed'],
body[data-ui-shell='studio'] .display-routing-health[data-health='error'] {
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .display-routing-display-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body[data-ui-shell='studio'] .display-routing-row-action {
  appearance: none;
  min-width: 0;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
  font-family: var(--studio-font-data);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

body[data-ui-shell='studio'] .display-routing-row-action:hover {
  border-color: var(--studio-primary);
  background: color-mix(in srgb, var(--studio-primary) 9%, var(--studio-panel));
}

body[data-ui-shell='studio'] .display-routing-row-action.is-danger:hover {
  border-color: var(--studio-danger);
  background: color-mix(in srgb, var(--studio-danger) 9%, var(--studio-panel));
  color: var(--studio-danger);
}

body[data-ui-shell='studio'] .display-routing-row-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

body[data-ui-shell='studio'] .display-routing-fullscreen-guidance {
  position: relative;
  margin: 12px 0 0;
  padding: 11px 12px 11px 43px;
  border: 1px solid var(--studio-rule);
  background: color-mix(in srgb, var(--studio-panel-raised) 58%, transparent);
  color: var(--studio-text-muted);
  font-family: var(--studio-font-data);
  font-size: 9px;
  line-height: 1.5;
}

body[data-ui-shell='studio'] .display-routing-fullscreen-guidance::before {
  content: 'F';
  position: absolute;
  top: 11px;
  left: 11px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--studio-rule-strong);
  color: var(--studio-primary);
  font-size: 9px;
  font-weight: 900;
}

body[data-ui-shell='studio'] .display-routing-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body[data-ui-shell='studio'] .presentation-session-strip[hidden] {
  display: none !important;
}

body[data-ui-shell='studio'] .presentation-session-strip:not([hidden]) {
  position: sticky;
  z-index: 4;
  top: -1px;
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 12px 12px;
  border: 1px solid var(--studio-rule-strong);
  border-left: 3px solid var(--studio-primary);
  background:
    linear-gradient(112deg, color-mix(in srgb, var(--studio-primary) 9%, transparent), transparent 48%),
    color-mix(in srgb, var(--studio-panel) 96%, transparent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--studio-ink) 28%, transparent);
  box-sizing: border-box;
}

body[data-ui-shell='studio'] .presentation-session-strip[data-target='presenter'],
body[data-ui-shell='studio'] .presentation-session-strip[data-target='wall'] {
  border-left-color: var(--studio-signal);
}

body[data-ui-shell='studio'] .presentation-session-summary {
  min-width: 0;
}

body[data-ui-shell='studio'] .presentation-session-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .presentation-session-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--studio-rule);
}

body[data-ui-shell='studio'] .presentation-session-details > div {
  min-width: 0;
  padding: 7px 8px;
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .presentation-session-details dt,
body[data-ui-shell='studio'] .presentation-session-details dd {
  margin: 0;
  overflow: hidden;
  font-family: var(--studio-font-data);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .presentation-session-details dt {
  color: var(--studio-text-muted);
  font-size: 7px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .presentation-session-details dd {
  margin-top: 4px;
  color: var(--studio-text);
  font-size: 9px;
  font-weight: 800;
}

body[data-ui-shell='studio'] .presentation-session-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body[data-ui-shell='studio'] .presentation-session-actions .presentation-action {
  min-width: 0;
  padding-inline: 7px;
  font-size: 8px;
  white-space: normal;
}

body[data-ui-shell='studio'] .presentation-session-actions #presentation-session-stop {
  border-color: color-mix(in srgb, var(--studio-danger) 62%, var(--studio-rule));
}

body[data-ui-shell='studio']:not(.dark-mode) .display-routing-session-summary,
body[data-ui-shell='studio']:not(.dark-mode) .display-routing-wall-controls,
body[data-ui-shell='studio']:not(.dark-mode) .display-routing-display-status,
body[data-ui-shell='studio']:not(.dark-mode) .presentation-session-strip:not([hidden]) {
  box-shadow: 0 12px 28px rgba(53, 48, 40, 0.12);
}

body[data-ui-shell='studio'] .live-controller-primary-shell {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--studio-primary) 4%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--studio-primary) 4%, transparent) 1px, transparent 1px),
    color-mix(in srgb, var(--studio-ink) 94%, transparent);
  background-size: 72px 72px;
}

body[data-ui-shell='studio'] .live-controller-primary-card {
  border-color: var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
  box-shadow: 0 28px 70px color-mix(in srgb, var(--studio-ink) 60%, transparent);
}

body[data-ui-shell='studio'] .live-controller-primary-kicker,
body[data-ui-shell='studio'] .live-controller-primary-meta {
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .live-controller-primary-title {
  color: var(--studio-text);
  font-family: var(--studio-font-display);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 400;
  letter-spacing: 0.07em;
}

body[data-ui-shell='studio'] .live-controller-primary-copy,
body[data-ui-shell='studio'] .live-controller-primary-text em {
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .live-controller-primary-text {
  border-color: var(--studio-rule);
  border-radius: 0;
  background: color-mix(in srgb, var(--studio-ink) 76%, var(--studio-panel));
  color: var(--studio-text);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio']:not(.dark-mode) .live-controller-primary-shell {
  background:
    linear-gradient(90deg, rgba(47, 80, 201, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(47, 80, 201, 0.045) 1px, transparent 1px),
    rgba(221, 215, 204, 0.96);
  background-size: 72px 72px;
}

body[data-ui-shell='studio']:not(.dark-mode) .live-controller-primary-text {
  background: #e6e0d5;
}

body[data-ui-shell='studio'].live-presenter-mode #studio-command-header,
body[data-ui-shell='studio'].live-presenter-mode #studio-tool-rail,
body[data-ui-shell='studio'].live-presenter-mode #studio-mobile-inspector-toggle,
body[data-ui-shell='studio'].live-presenter-mode #studio-mobile-inspector-close,
body[data-ui-shell='studio'].live-presenter-mode #studio-mobile-scrim,
body[data-ui-shell='studio'].live-presenter-mode .studio-theme-action,
body[data-ui-shell='studio'].live-presenter-mode .header-container,
body[data-ui-shell='studio'].live-presenter-mode .desktop-header,
body[data-ui-shell='studio'].live-presenter-mode #generate-save-controls,
body[data-ui-shell='studio'].live-presenter-mode #replay-progress,
body[data-ui-shell='studio'].live-presenter-mode #replay-save-progress,
body[data-ui-shell='studio'].live-presenter-mode .palette-swatch-bar,
body[data-ui-shell='studio'].live-presenter-mode .am-drawer,
body[data-ui-shell='studio'].live-presenter-mode .pd-drawer,
body[data-ui-shell='studio'].live-presenter-mode .toast-container,
body[data-ui-shell='studio'].live-presenter-mode .presentation-session-strip,
body[data-ui-shell='studio'].live-presenter-mode .presentation-dialog-overlay,
body[data-ui-shell='studio'].live-presenter-mode [data-presentation-role='controller'] {
  display: none !important;
}

@media (max-width: 860px) {
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .display-routing-wall-controls,
  body[data-ui-shell='studio'] .display-routing-display-status {
    grid-column: 1;
  }

  body[data-ui-shell='studio'] .display-routing-summary-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .display-routing-summary-list > div:nth-child(4),
  body[data-ui-shell='studio'] .display-routing-summary-list > div:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-header-actions,
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions,
  body[data-ui-shell='studio'] .display-routing-dialog .display-routing-wall-controls,
  body[data-ui-shell='studio'] .display-routing-dialog .display-routing-display-actions,
  body[data-ui-shell='studio'] .display-routing-dialog .display-routing-fullscreen-guidance {
    display: none !important;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
    padding:
      14px
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  body[data-ui-shell='studio'] .display-routing-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] .display-routing-summary-list > div:first-child {
    grid-column: 1 / -1;
  }

  body[data-ui-shell='studio'] .presentation-session-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  body[data-ui-shell='studio'] .display-routing-summary-list {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .display-routing-summary-list > div:first-child {
    grid-column: auto;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-header {
    padding: 12px;
  }

  body[data-ui-shell='studio'] .display-routing-display-list > li {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-shell='studio'] .display-routing-health {
    justify-self: start;
  }
}

@media (pointer: coarse), (max-width: 768px) {
  body[data-ui-shell='studio'] .display-routing-dialog .ss-playlist-btn,
  body[data-ui-shell='studio'] .display-routing-row-action,
  body[data-ui-shell='studio'] .display-routing-dialog select,
  body[data-ui-shell='studio'] .display-routing-dialog input[type='number'],
  body[data-ui-shell='studio'] .presentation-session-actions .presentation-action {
    min-height: 44px;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-toggles > label,
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-wall-layout label {
    min-height: 44px;
  }
}

@media (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-header-actions,
  body[data-ui-shell='studio'] .display-routing-dialog .live-display-actions,
  body[data-ui-shell='studio'] .display-routing-dialog .display-routing-wall-controls,
  body[data-ui-shell='studio'] .display-routing-dialog .display-routing-display-actions,
  body[data-ui-shell='studio'] .display-routing-dialog .display-routing-fullscreen-guidance {
    display: none !important;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  body[data-ui-shell='studio'] .presentation-dialog-overlay {
    --presentation-safe-top: max(4px, env(safe-area-inset-top));
    --presentation-safe-right: max(4px, env(safe-area-inset-right));
    --presentation-safe-bottom: max(4px, env(safe-area-inset-bottom));
    --presentation-safe-left: max(4px, env(safe-area-inset-left));
    place-items: stretch center;
    padding:
      var(--presentation-safe-top)
      var(--presentation-safe-right)
      var(--presentation-safe-bottom)
      var(--presentation-safe-left);
  }

  body[data-ui-shell='studio'] .presentation-dialog {
    width: 100%;
    max-height: calc(100dvh - var(--presentation-safe-top) - var(--presentation-safe-bottom));
  }

  body[data-ui-shell='studio'] .display-routing-session-summary,
  body[data-ui-shell='studio'] .display-routing-wall-controls,
  body[data-ui-shell='studio'] .display-routing-display-status {
    padding: 12px;
  }

  body[data-ui-shell='studio'] .display-routing-dialog .live-display-control {
    padding: 10px;
  }
}

@media (max-width: 1024px) {
  body[data-ui-shell='studio'] > .presentation-session-strip:not([hidden]) {
    position: fixed;
    z-index: 11140;
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(292px, 0.6fr);
    align-items: end;
    gap: 8px;
    margin: 0;
    padding: 9px 10px;
    box-shadow: 0 18px 48px color-mix(in srgb, var(--studio-ink) 48%, transparent);
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-kicker {
    margin-bottom: 5px;
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-details {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-details > div {
    padding: 5px 7px;
  }
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] > .presentation-session-strip:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 8px;
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-kicker {
    display: none;
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-details > div:nth-child(4) {
    display: none;
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-details dt {
    font-size: 6px;
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-details dd {
    margin-top: 2px;
  }

  body[data-ui-shell='studio'] > .presentation-session-strip .presentation-session-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Save Preset follows the proof-first Save Composition dialog language. */
body[data-ui-shell='studio'] .studio-save-preset-dialog.modal-overlay {
  z-index: 16600;
  padding: 18px;
  background: color-mix(in srgb, var(--studio-ink) 82%, transparent);
  backdrop-filter: blur(12px);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-container {
  width: min(760px, calc(100vw - 36px));
  max-width: 760px !important;
  max-height: min(90dvh, 780px) !important;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-panel);
  color: var(--studio-text);
  box-shadow: 0 28px 80px color-mix(in srgb, var(--studio-ink) 62%, transparent);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 12px 14px 11px 20px;
  border-bottom: 1px solid var(--studio-rule-strong);
  background: var(--studio-panel);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-title {
  margin: 0;
  color: var(--studio-text);
  font: 400 31px/1 var(--studio-font-display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-title::before {
  content: attr(data-dialog-kicker);
  display: block;
  margin-bottom: 5px;
  color: var(--studio-primary);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.16em;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-left: auto;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-close:hover,
body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-close:focus-visible {
  border-color: var(--studio-signal);
  color: var(--studio-text);
  outline: 1px solid var(--studio-signal);
  outline-offset: -3px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-content {
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  background: var(--studio-panel);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-form {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px 20px;
  padding: 20px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-proof {
  grid-row: 1 / span 5;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-proof > span,
body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-field label {
  color: var(--studio-text-muted);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-preview-thumb {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  background:
    linear-gradient(color-mix(in srgb, var(--studio-rule) 40%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--studio-rule) 40%, transparent) 1px, transparent 1px),
    var(--studio-ink);
  background-size: 24px 24px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-preview-thumb img {
  width: 100%;
  height: 100%;
  max-height: 390px;
  display: block;
  object-fit: contain;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-preview-thumb-placeholder {
  color: var(--studio-text-muted);
  font: 400 72px/1 var(--studio-font-display);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border-left: 2px solid var(--studio-primary);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-summary strong {
  color: var(--studio-text);
  font: 800 9px/1.35 var(--studio-font-data);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-summary span,
body[data-ui-shell='studio'] .studio-save-preset-dialog :is(.sp-status, .sp-origin) {
  color: var(--studio-text-muted);
  font: 500 11px/1.45 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-origin {
  padding: 8px 10px;
  border: 1px solid var(--studio-rule);
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-origin[hidden] {
  display: none;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog :is(input, textarea) {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-text);
  font: 500 13px/1.4 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog input {
  min-height: 44px;
  padding: 0 12px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog :is(input, textarea):focus {
  border-color: var(--studio-primary);
  outline: 1px solid var(--studio-primary);
  box-shadow: none;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog :is(input, textarea)[aria-invalid='true'] {
  border-color: var(--studio-danger);
  outline-color: var(--studio-danger);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-error {
  min-height: 16px;
  margin: -4px 0 0;
  color: var(--studio-danger);
  font: 700 10px/1.4 var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-status {
  min-height: 32px;
  margin: -3px 0 0;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-actions button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-actions .btn-secondary {
  background: transparent;
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-actions .btn-primary {
  border-color: var(--studio-primary);
  background: var(--studio-primary);
  color: var(--studio-vermilion-ink);
}

body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-actions button:focus-visible {
  outline: 1px solid var(--studio-signal);
  outline-offset: 2px;
}

body[data-ui-shell='studio'] .studio-save-preset-dialog [disabled] {
  cursor: wait;
  opacity: 0.48;
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] .studio-save-preset-dialog.modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-container {
    width: 100vw;
    max-width: none !important;
    max-height: 100dvh !important;
    border-width: 1px 0 0;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-header {
    min-height: 66px;
    padding-inline: 14px 10px;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-title {
    font-size: 25px;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-proof {
    grid-row: auto;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-preview-thumb {
    min-height: 0;
    max-height: 28dvh;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-preview-thumb img {
    max-height: 28dvh;
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .modal-footer {
    padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  }

  body[data-ui-shell='studio'] .studio-save-preset-dialog .sp-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  }
}

/* Save Playlist uses the same proof-first library language as presets and boards. */
body[data-ui-shell='studio'] .studio-save-playlist-dialog.modal-overlay {
  z-index: 16600;
  padding: 18px;
  background: color-mix(in srgb, var(--studio-ink) 82%, transparent);
  backdrop-filter: blur(12px);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-container {
  width: min(760px, calc(100vw - 36px));
  max-width: 760px !important;
  max-height: min(90dvh, 780px) !important;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--studio-primary) 5%, transparent), transparent 36%),
    var(--studio-panel);
  color: var(--studio-text);
  box-shadow: 0 28px 80px color-mix(in srgb, var(--studio-ink) 62%, transparent);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 12px 14px 11px 20px;
  border-bottom: 1px solid var(--studio-rule-strong);
  background: color-mix(in srgb, var(--studio-panel) 92%, transparent);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-title {
  margin: 0;
  color: var(--studio-text);
  font: 400 31px/1 var(--studio-font-display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-title::before {
  content: attr(data-dialog-kicker);
  display: block;
  margin-bottom: 5px;
  color: var(--studio-primary);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.16em;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-left: auto;
  border: 1px solid var(--studio-rule);
  border-radius: 0;
  background: transparent;
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-close:hover,
body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-close:focus-visible {
  border-color: var(--studio-signal);
  color: var(--studio-text);
  outline: 1px solid var(--studio-signal);
  outline-offset: -3px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-content {
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  background: transparent;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-form {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px 20px;
  padding: 20px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof {
  grid-row: 1 / span 6;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-label,
body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-field label {
  color: var(--studio-text-muted);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: stretch;
  overflow: hidden;
  border: 1px solid var(--studio-rule-strong);
  background:
    linear-gradient(color-mix(in srgb, var(--studio-rule) 42%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--studio-rule) 42%, transparent) 1px, transparent 1px),
    var(--studio-ink);
  background-size: 50% 50%;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--studio-primary) 28%, transparent);
  pointer-events: none;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image :is(img, canvas) {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: block;
  object-fit: cover;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-details {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border-left: 2px solid var(--studio-primary);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-summary strong {
  color: var(--studio-text);
  font: 800 9px/1.35 var(--studio-font-data);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-summary span,
body[data-ui-shell='studio'] .studio-save-playlist-dialog :is(.spl-status, .spl-origin) {
  color: var(--studio-text-muted);
  font: 500 11px/1.45 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-item {
  min-width: 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 10px;
  border-right: 1px solid var(--studio-rule);
  border-bottom: 1px solid var(--studio-rule);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-item:nth-child(2n) {
  border-right: 0;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-item > span:first-child {
  color: var(--studio-text-muted);
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-item > :last-child {
  overflow: hidden;
  color: var(--studio-text);
  font: 700 10px/1.25 var(--studio-font-data);
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-origin {
  padding: 8px 10px;
  border: 1px solid var(--studio-rule);
  color: var(--studio-primary);
  font-family: var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-origin[hidden] {
  display: none;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-field input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  background: var(--studio-ink);
  color: var(--studio-text);
  font: 500 13px/1.4 var(--studio-font-ui);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-field input:focus {
  border-color: var(--studio-primary);
  outline: 1px solid var(--studio-primary);
  box-shadow: none;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-field input[aria-invalid='true'] {
  border-color: var(--studio-danger);
  outline-color: var(--studio-danger);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-error {
  min-height: 16px;
  margin: -4px 0 0;
  color: var(--studio-danger);
  font: 700 10px/1.4 var(--studio-font-data);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-status {
  min-height: 32px;
  margin: -3px 0 0;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--studio-rule);
  background: var(--studio-panel-raised);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-actions button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--studio-rule-strong);
  border-radius: 0;
  font: 800 8px/1 var(--studio-font-data);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-actions .btn-secondary {
  background: transparent;
  color: var(--studio-text-muted);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-actions .btn-primary {
  border-color: var(--studio-primary);
  background: var(--studio-primary);
  color: var(--studio-vermilion-ink);
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog :is(.modal-close, .spl-actions button, .spl-field input):focus-visible {
  outline: 1px solid var(--studio-signal);
  outline-offset: 2px;
}

body[data-ui-shell='studio'] .studio-save-playlist-dialog [disabled] {
  cursor: wait;
  opacity: 0.48;
}

@media (max-width: 680px) {
  body[data-ui-shell='studio'] .studio-save-playlist-dialog.modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-container {
    width: 100vw;
    max-width: none !important;
    max-height: 100dvh !important;
    border-width: 1px 0 0;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-header {
    min-height: 66px;
    padding-inline: 14px 10px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-title {
    font-size: 25px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof {
    grid-row: auto;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image,
  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image :is(img, canvas) {
    min-height: 0;
    max-height: 28dvh;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-footer {
    padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }
}

@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  body[data-ui-shell='studio'] .studio-save-playlist-dialog.modal-overlay {
    padding: 0;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-container {
    width: 100vw;
    max-width: none !important;
    max-height: 100dvh !important;
    border-width: 0;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-header {
    min-height: 54px;
    padding-block: 6px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-title {
    font-size: 22px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-form {
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
    gap: 10px 14px;
    padding: 10px 14px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image,
  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-proof-image :is(img, canvas) {
    min-height: 0;
    max-height: 42dvh;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .spl-runtime-item {
    min-height: 44px;
    padding-block: 6px;
  }

  body[data-ui-shell='studio'] .studio-save-playlist-dialog .modal-footer {
    padding: 6px max(14px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
}
