:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: #111722;
  --panel-strong: #171f2e;
  --line: #2a3445;
  --text: #eef4ff;
  --muted: #9aa9bd;
  --primary: #00e5ff;
  --accent: #ff2f92;
  --danger: #ff4b5c;
  --ok: #2ee59d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0b0b0b;
  color: var(--text);
  font-family: Raleway, Arial, Helvetica, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

header {
  background: rgba(0, 0, 0, 0.9);
  padding: 15px 20px;
  position: sticky;
  width: 100%;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #222;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: #ff8800;
  font-size: 1.8em;
  font-weight: 700;
}

.tagline {
  color: #aaa;
  font-size: 0.9em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 15px;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: inherit;
  padding: 8px 10px;
  text-decoration: none;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #ff8800;
}

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #000;
  border: 1px solid #222;
  padding: 10px;
  z-index: 1000;
  min-width: 180px;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content ul {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-content ul li {
  margin-bottom: 5px;
}

.dropdown-content ul li a {
  display: block;
  padding: 6px 10px;
}

.mobile-menu {
  display: none;
  position: relative;
}

.hamburger {
  color: #ff8800;
  cursor: pointer;
  display: none;
  font-size: 1.5em;
}

.app-shell {
  width: min(100%, 1040px);
  margin: 12px auto 48px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-panel {
  background: #000;
  border: 2px solid #444;
  border-radius: 8px;
  box-shadow: none;
}

.stage-panel {
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
}

.visualizer-titlebar {
  padding: 9px 12px;
  background: linear-gradient(90deg, #111, #171717);
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.visualizer-title {
  color: #ff8800;
  font-size: 16px;
  font-weight: 700;
}

.titlebar-export {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
}

.titlebar-export__label {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.titlebar-presets {
  flex: 0 0 auto;
  position: relative;
}

.titlebar-presets summary {
  align-items: center;
  background: #0c0c0c;
  border: 1px solid #333;
  border-radius: 6px;
  color: #ff8800;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 28px;
  appearance: none;
  -webkit-appearance: none;
  list-style: none;
  list-style-type: none;
  padding: 0 10px;
  white-space: nowrap;
}

.titlebar-presets summary::-webkit-details-marker {
  display: none;
}

.titlebar-presets summary::marker {
  content: "";
  display: none;
}

.titlebar-presets[open] summary,
.titlebar-presets summary:hover {
  border-color: #ff8800;
  color: #fff;
}

.titlebar-presets__menu {
  background: rgba(5, 5, 5, 0.98);
  border: 1px solid rgba(255, 136, 0, 0.42);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  min-width: 285px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.titlebar-presets__row,
.titlebar-presets__actions {
  display: grid;
  gap: 8px;
}

.titlebar-presets__row {
  grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1.2fr);
  margin-bottom: 8px;
}

.titlebar-presets__actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.titlebar-presets select,
.titlebar-presets input[type="text"],
.titlebar-button {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 8px;
}

.titlebar-button {
  min-height: 30px;
  width: 100%;
}

.titlebar-presets__status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin: 8px 0 0;
}

.stage-toolbar,
.timeline,
.export-panel {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #333;
}

.timeline {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  padding: 10px;
}

.timeline span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: center;
}

.timeline input {
  width: 100%;
}

.timeline-play {
  min-width: 64px;
  padding: 7px 10px;
}

.mobile-transport-step { display: none; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.stage:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

.stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

.stage.is-bg-move-mode {
  cursor: grab;
  touch-action: none;
}

.stage.is-bg-dragging {
  cursor: grabbing;
}

#visualizerCanvas,
#backgroundVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#backgroundVideo {
  display: none;
}

.stage-fullscreen-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 8;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
  padding: 0;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.stage-fullscreen-toggle:hover,
.stage-fullscreen-toggle.is-active {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(255, 136, 0, 0.82);
  opacity: 1;
}

.fullscreen-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.fullscreen-icon::before,
.fullscreen-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-color: currentColor;
  border-style: solid;
}

.fullscreen-icon::before {
  border-width: 2px 0 0 2px;
}

.fullscreen-icon::after {
  border-width: 0 2px 2px 0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.control-section-title {
  color: #ff8800;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 16px 0 10px;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
}

.control-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.control-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: -4px 0 14px;
}

.check-control {
  min-height: 36px;
  background: #090909;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.check-control input {
  accent-color: #ff8800;
}

.settings-drawer {
  border-top: 1px solid #2a2a2a;
  margin-top: 14px;
  padding-top: 10px;
}

.settings-drawer summary {
  color: #ff8800;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.settings-bar {
  width: 100%;
  height: 40px;
  background: #111;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.settings-icon {
  min-width: 44px;
  min-height: 30px;
  background: transparent;
  border: 0;
  color: #ff8800;
  cursor: pointer;
  font-weight: 700;
}

.settings-icon:hover,
.settings-icon.active {
  color: #fff;
}

.settings-panel-dock {
  background: #050505;
}

.settings-panel {
  display: none;
  position: static;
  width: 100%;
  background: rgba(0, 0, 0, 0.72);
  border-bottom: 1px solid rgba(255, 136, 0, 0.38);
  max-height: 320px;
  padding: 12px;
  overflow-y: auto;
}

.settings-panel.active {
  display: block;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input[type="text"],
select {
  width: 100%;
  min-height: 40px;
  background: #090909;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.toolbar-select {
  width: auto;
  min-width: 170px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.position-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 22px;
}

.position-slider-wrap .position-slider {
  position: relative;
  z-index: 1;
}

.position-slider-reset {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.position-slider-reset::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 2px;
  transform: translateX(-50%);
  background: #ff8800;
  box-shadow: 0 0 6px rgba(255, 136, 0, 0.75);
}

.position-slider-reset:hover::before {
  background: #fff;
}

input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0f17;
}

.button,
.file-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #111;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover,
.file-button:hover {
  border-color: #ff8800;
}

.button.is-active {
  border-color: #ff8800;
  color: #ff8800;
  box-shadow: inset 0 0 0 1px rgba(255, 136, 0, 0.28);
}

.button--primary {
  background: #ff8800;
  border-color: transparent;
  color: #140900;
  font-weight: 700;
}

.button.is-recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.file-button input {
  display: none;
}

.file-button--quiet {
  width: 100%;
  background: #090909;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-panel {
  display: block;
  border-bottom: 0;
}

.export-panel[hidden] {
  display: none;
}

.export-panel__title {
  font-weight: 700;
  margin-bottom: 8px;
}

.export-message {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.export-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-links a {
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  text-decoration: none;
}

.export-links a:hover {
  border-color: var(--primary);
}

@media (max-width: 980px) {
  .app-shell {
    margin-top: 12px;
  }
}

@media (max-width: 760px) {
  header { padding: 6px 10px; }
  header .nav-container { align-items: center; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) 44px; position: relative; }
  .top-header { align-items: center; flex-direction: row; min-width: 0; }
  header .site-header-logo { min-width: 0; }
  header .site-header-logo img { display: block; height: auto; max-height: 32px; max-width: min(250px, 100%); object-fit: contain; }
  header .tagline { display: none; }

  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .visualizer-titlebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 7px 8px;
  }

  .visualizer-title {
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .visualizer-titlebar .status-text {
    display: none;
  }

  .visualizer-titlebar .titlebar-actions {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
    text-align: right;
  }

  .visualizer-titlebar .titlebar-export {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    text-align: right;
  }

  .visualizer-titlebar .titlebar-export__label {
    font-size: 11px;
    line-height: 1;
  }

  .visualizer-titlebar .titlebar-presets summary {
    font-size: 0;
    height: 26px;
    justify-content: center;
    overflow: hidden;
    padding: 0 8px;
    width: 50px;
  }

  .visualizer-titlebar .titlebar-presets summary::after {
    content: "Save";
    font-size: 11px;
    line-height: 1;
  }

  .titlebar-presets__menu {
    left: auto;
    min-width: min(310px, 90vw);
    right: 0;
    transform: none;
  }

  .stage-toolbar .button,
  .stage-toolbar .file-button,
  .stage-toolbar .toolbar-select {
    width: 100%;
    text-align: center;
    text-align-last: center;
  }

  .nav-container > nav.desktop-menu {
    display: none;
  }

  .mobile-menu {
    display: block;
    justify-self: end;
    position: relative;
    width: 44px;
  }

  .hamburger {
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--studio-accent) 28%, var(--studio-line));
    border-radius: 10px;
    display: flex;
    height: 44px;
    justify-content: center;
    line-height: 1;
    width: 44px;
  }

  .mobile-menu nav ul {
    border: 1px solid var(--studio-line);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .58);
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
    max-height: min(72vh, 540px);
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(320px, calc(100vw - 20px));
    border-radius: 8px;
    padding: 10px 0;
    z-index: 120;
  }

  .mobile-menu nav ul.show {
    display: flex;
  }

  .dropdown-content {
    position: static;
    background: #000;
    border: none;
    padding: 0;
    min-width: 0;
  }

  .dropdown-content ul {
    display: none;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .stage-panel {
    width: 95%;
  }

  .settings-panel {
    max-height: 360px;
  }
}

@media (max-width: 900px) {
  .stage-fullscreen-toggle {
    display: none;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    padding-top: 0;
    background: #000;
  }

  header,
  .visualizer-titlebar,
  .settings-bar,
  .settings-panel-dock,
  .timeline,
  .stage-toolbar,
  .export-panel {
    display: none !important;
  }

  .app-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    max-width: none;
    padding: 0;
  }

  .stage-panel {
    position: fixed;
    inset: 0;
    z-index: 3000;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
  }

  .stage-fullscreen-toggle {
    display: none;
  }
}

/* Visualizer Studio V2 ----------------------------------------------------- */
:root {
  --studio-radius: 14px;
  --studio-line: color-mix(in srgb, var(--studio-text) 12%, transparent);
  --studio-line-strong: color-mix(in srgb, var(--studio-text) 22%, transparent);
  --studio-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

body {
  background:
    radial-gradient(circle at 20% -10%, color-mix(in srgb, var(--studio-accent) 14%, transparent), transparent 32rem),
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--studio-accent-2) 10%, transparent), transparent 28rem),
    var(--studio-bg);
  color: var(--studio-text);
}

header {
  background: color-mix(in srgb, var(--studio-bg) 92%, transparent);
  border-bottom-color: var(--studio-line);
  backdrop-filter: blur(18px);
  padding: 10px 18px;
}

header .nav-container { max-width: 1680px; }
header .tagline { color: var(--studio-muted); }

.app-shell {
  display: block;
  margin: 0 auto;
  max-width: 1800px;
  padding: 14px;
  width: 100%;
}

.studio-topbar,
.studio-sidebar,
.preview-card,
.transport-card,
.studio-timeline {
  background: color-mix(in srgb, var(--studio-surface) 94%, transparent);
  border: 1px solid var(--studio-line);
  box-shadow: var(--studio-shadow);
}

.studio-topbar {
  align-items: center;
  border-radius: var(--studio-radius);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  margin-bottom: 12px;
  min-height: 68px;
  padding: 10px 12px 10px 16px;
}

.project-identity { min-width: 0; }
.project-eyebrow,
.panel-kicker {
  color: var(--studio-accent);
  display: block;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
  line-height: 1;
}

#projectName {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--studio-text);
  font-size: 16px;
  font-weight: 800;
  min-height: 24px;
  padding: 2px 0;
}

#projectName:focus { outline: 0; }
.autosave-state { color: var(--studio-muted); display: block; font-size: 10px; }

.studio-topbar__center,
.studio-topbar__actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.studio-topbar__actions { justify-content: flex-end; }
.project-template { white-space: nowrap; }
.studio-topbar-menu { position: relative; }
.studio-topbar-menu > summary { list-style: none; }
.studio-topbar-menu > summary::-webkit-details-marker { display: none; }
.studio-topbar-menu > summary::after { content: " ▾"; font-size: 9px; opacity: .72; }
.studio-topbar-menu[open] > summary { border-color: var(--studio-accent); color: var(--studio-text); }
.studio-topbar-menu__panel {
  background: color-mix(in srgb, var(--studio-surface) 97%, transparent);
  border: 1px solid var(--studio-line-strong);
  border-radius: 11px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .44);
  display: grid;
  gap: 6px;
  min-width: 210px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 7px);
  z-index: 80;
}
.studio-topbar-menu--project .studio-topbar-menu__panel { left: 0; }
.studio-topbar-menu--format .studio-topbar-menu__panel { left: 0; }
.studio-topbar-menu--export .studio-topbar-menu__panel { right: 0; }
.studio-topbar-menu__panel .button { justify-content: flex-start; width: 100%; }
.studio-topbar-menu__panel .button[hidden] { display: none; }
.studio-topbar-menu__panel label { align-items: center; display: grid; gap: 8px; grid-template-columns: 58px minmax(0, 1fr); }
.studio-topbar-menu__panel label > span { color: var(--studio-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.studio-topbar-menu__panel select { min-width: 0; width: 100%; }
.studio-topbar-menu__panel .studio-render { justify-content: center; }
.studio-frame-export {
  min-height: 36px;
  min-width: 88px;
  white-space: nowrap;
}

.studio-frame-export:disabled {
  cursor: wait;
  opacity: .62;
}
.compact-field { align-items: center; display: flex; gap: 7px; }
.compact-field span { color: var(--studio-muted); font-size: 10px; text-transform: uppercase; }
.studio-format-controls { align-items: center; display: flex; gap: 8px; }

.compact-field select,
#exportFormat,
#exportQuality {
  background: var(--studio-panel);
  border: 1px solid var(--studio-line);
  color: var(--studio-text);
  min-height: 36px;
  padding: 5px 28px 5px 9px;
  width: auto;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--studio-line);
  border-radius: 9px;
  color: var(--studio-muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.icon-button:hover { border-color: var(--studio-accent); color: var(--studio-text); }
.mobile-add-media-label { display: none; }
.icon-button svg,
.capture-button svg,
.button svg,
.empty-state svg,
.inspector-empty svg,
.asset-add svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.studio-render {
  background: linear-gradient(135deg, var(--studio-accent), color-mix(in srgb, var(--studio-accent) 68%, var(--studio-accent-2)));
  border: 0;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--studio-accent) 22%, transparent);
  color: #120904;
  font-weight: 900;
  min-width: 108px;
}

.studio-render.rendering { background: #e85757; color: white; }

.auto-sync-motion { align-items: center; border-color: color-mix(in srgb, var(--studio-accent-2) 44%, var(--studio-line)); color: var(--studio-text); display: inline-flex; flex: 0 0 auto; font-size: 9px; gap: 7px; min-height: 32px; padding: 5px 9px; white-space: nowrap; }
.auto-sync-motion__pulse { background: var(--studio-accent-2); border-radius: 999px; box-shadow: 0 0 0 0 color-mix(in srgb, var(--studio-accent-2) 65%, transparent); height: 7px; width: 7px; }
.auto-sync-motion:hover { border-color: var(--studio-accent-2); color: var(--studio-accent-2); }
.auto-sync-motion.syncing .auto-sync-motion__pulse { animation: auto-sync-pulse 1s ease-out infinite; }
.auto-sync-motion:disabled { cursor: wait; opacity: .78; }
@keyframes auto-sync-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--studio-accent-2) 68%, transparent); } 75%, 100% { box-shadow: 0 0 0 8px transparent; } }

.beat-director-panel { align-items: center; background: linear-gradient(90deg, color-mix(in srgb, var(--studio-accent-2) 9%, var(--studio-panel)), color-mix(in srgb, var(--studio-accent) 7%, var(--studio-panel))); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 28%, var(--studio-line)); border-radius: 10px; display: grid; gap: 8px; grid-template-columns: minmax(100px, .8fr) repeat(4, minmax(76px, 1fr)) auto; margin-top: 8px; padding: 9px 10px; }
.beat-director-panel__intro { display: grid; gap: 2px; min-width: 0; }
.beat-director-panel__intro span { color: var(--studio-accent-2); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.beat-director-panel__intro strong { color: var(--studio-muted); font-size: 7px; letter-spacing: .06em; white-space: nowrap; }
.beat-director-meters { display: grid; gap: 3px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 3px; }
.beat-director-meters i { background: color-mix(in srgb, var(--studio-bg) 78%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 15%, var(--studio-line)); border-radius: 99px; height: 5px; overflow: hidden; transition: border-color .08s ease, box-shadow .08s ease; }
.beat-director-meters i b { background: linear-gradient(90deg, var(--studio-accent-2), var(--studio-accent)); border-radius: inherit; display: block; height: 100%; transform: scaleX(.025); transform-origin: left center; transition: transform .055s linear; }
.beat-director-meters i.active { border-color: color-mix(in srgb, var(--studio-accent-2) 72%, var(--studio-line)); box-shadow: 0 0 8px color-mix(in srgb, var(--studio-accent-2) 38%, transparent); }
.beat-director-panel label { align-items: center; color: var(--studio-muted); display: grid; font-size: 8px; gap: 3px; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
.beat-director-panel label input { grid-column: 1 / -1; margin: 0; width: 100%; }
.beat-director-panel output { color: var(--studio-text); font: 800 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.beat-director-panel button { min-height: 34px; padding-inline: 10px; }
.beat-director-presets { align-items: center; border-top: 1px solid color-mix(in srgb, var(--studio-accent-2) 16%, var(--studio-line)); display: flex; gap: 7px; grid-column: 1 / -1; justify-content: flex-end; padding-top: 7px; }
.beat-director-presets > span { color: var(--studio-muted); font-size: 7px; font-weight: 900; letter-spacing: .12em; margin-right: auto; }
.beat-director-presets button { font-size: 8px; min-height: 28px; min-width: 68px; padding-block: 4px; }
.beat-director-presets button.active { background: color-mix(in srgb, var(--studio-accent-2) 18%, var(--studio-surface)); border-color: var(--studio-accent-2); box-shadow: 0 0 13px color-mix(in srgb, var(--studio-accent-2) 16%, transparent); color: var(--studio-accent-2); }

.render-progress-overlay { align-items: center; background: linear-gradient(180deg, rgba(2, 5, 10, .7), rgba(2, 5, 10, .9)); display: flex; inset: 0; justify-content: center; padding: 24px; position: absolute; z-index: 24; }
.render-progress-overlay[hidden] { display: none; }
.render-progress-card { backdrop-filter: blur(16px); background: color-mix(in srgb, var(--studio-surface) 90%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent) 48%, var(--studio-line)); border-radius: 14px; box-shadow: 0 20px 70px rgba(0, 0, 0, .58), 0 0 36px color-mix(in srgb, var(--studio-accent) 14%, transparent); display: grid; gap: 12px; max-width: 460px; padding: 18px; width: min(78%, 460px); }
.render-progress-heading { align-items: center; display: grid; gap: 10px; grid-template-columns: 22px minmax(0, 1fr) auto; }
.render-progress-heading strong { color: var(--studio-text); font-size: 14px; letter-spacing: .02em; }
.render-progress-heading b { color: var(--studio-accent); font: 900 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.render-progress-spinner { animation: render-progress-spin .85s linear infinite; border: 2px solid color-mix(in srgb, var(--studio-accent) 24%, transparent); border-radius: 50%; border-top-color: var(--studio-accent); height: 20px; width: 20px; }
.render-progress-bar { background: color-mix(in srgb, var(--studio-bg) 80%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent) 24%, var(--studio-line)); border-radius: 999px; height: 12px; overflow: hidden; position: relative; }
.render-progress-bar i { background: linear-gradient(90deg, var(--studio-accent), var(--studio-accent-2)); border-radius: inherit; box-shadow: 0 0 18px color-mix(in srgb, var(--studio-accent) 60%, transparent); display: block; height: 100%; transition: width .16s ease; width: 0; }
.render-progress-overlay.is-indeterminate .render-progress-bar i { animation: render-progress-scan 1.15s ease-in-out infinite; }
.render-progress-card small { color: var(--studio-muted); font-size: 10px; line-height: 1.45; }
@keyframes render-progress-spin { to { transform: rotate(360deg); } }
@keyframes render-progress-scan { 0% { margin-left: -38%; } 50% { margin-left: 52%; } 100% { margin-left: 100%; } }

.studio-workspace {
  display: grid;
  gap: 12px;
  grid-template-columns: 250px minmax(420px, 1fr) 310px;
  min-height: 610px;
}

.studio-sidebar,
.preview-card,
.transport-card {
  border-radius: var(--studio-radius);
  min-width: 0;
  overflow: hidden;
}

.studio-sidebar { max-height: 680px; padding: 14px; }
.panel-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 14px; }
.panel-heading h2 { font-size: 17px; line-height: 1.15; margin: 4px 0 0; }

.capture-actions { display: grid; gap: 7px; grid-template-columns: 1fr 1fr; }
.capture-button--title { grid-column: 1 / -1; min-height: 48px; }
.capture-button--title svg { color: #f472b6; }
.capture-button--captions { border-color: color-mix(in srgb, var(--studio-accent-2) 35%, var(--studio-line)); grid-column: 1 / -1; min-height: 48px; }
.capture-button--captions svg { color: var(--studio-accent-2); }
.caption-workflow-panel { background: color-mix(in srgb, var(--studio-accent-2) 7%, var(--studio-panel)); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 28%, var(--studio-line)); border-radius: 9px; display: grid; gap: 7px; padding: 8px; }
.caption-style-presets { display: grid; gap: 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.caption-style-presets button { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 6px; color: var(--studio-text); font-size: 8px; min-height: 29px; padding: 4px; }
.caption-style-presets button:hover { border-color: var(--studio-accent-2); color: var(--studio-accent-2); }
.caption-export { justify-content: center; width: 100%; }
.capture-button {
  align-items: center;
  background: color-mix(in srgb, var(--studio-panel) 80%, transparent);
  border: 1px solid var(--studio-line);
  border-radius: 10px;
  color: var(--studio-text);
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-height: 56px;
  padding: 8px;
  text-align: left;
}

.capture-button svg { color: var(--studio-accent); flex: 0 0 auto; }
.capture-button span { display: grid; min-width: 0; }
.capture-button strong { font-size: 11px; }
.capture-button small { color: var(--studio-muted); font-size: 9px; }
.capture-button:hover,
.capture-button.recording { border-color: var(--studio-accent); }
.capture-button.recording { background: rgba(222, 62, 71, .16); }

.capture-status {
  background: rgba(222, 62, 71, .12);
  border: 1px solid rgba(255, 93, 101, .35);
  border-radius: 9px;
  color: #ffb3b7;
  font-size: 10px;
  line-height: 1.4;
  margin-top: 9px;
  padding: 8px;
}

.record-dot {
  animation: record-pulse 1s ease-in-out infinite;
  background: #ff4f58;
  border-radius: 50%;
  display: inline-block;
  height: 7px;
  margin-right: 5px;
  width: 7px;
}

@keyframes record-pulse { 50% { opacity: .35; transform: scale(.8); } }

.asset-list { display: grid; gap: 7px; margin-top: 12px; max-height: 535px; overflow: auto; padding-right: 2px; }
.asset-card {
  align-items: center;
  background: color-mix(in srgb, var(--studio-panel) 72%, transparent);
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: grab;
  display: grid;
  gap: 8px;
  grid-template-columns: 50px minmax(0, 1fr) 28px;
  padding: 6px;
}

.asset-card:hover { border-color: var(--studio-line-strong); }
.asset-card--missing { border-color: color-mix(in srgb, var(--studio-accent) 58%, var(--studio-line)); cursor: default; }
.asset-thumb { align-items: center; background: #050608; border-radius: 7px; display: flex; height: 40px; justify-content: center; overflow: hidden; }
.asset-thumb--missing { background: color-mix(in srgb, var(--studio-accent) 12%, #050608); border: 1px dashed color-mix(in srgb, var(--studio-accent) 68%, transparent); }
.asset-missing-mark { color: var(--studio-accent); font-size: 18px; font-weight: 900; }
.asset-thumb img,
.asset-thumb video { height: 100%; object-fit: cover; width: 100%; }
.asset-meta { display: grid; min-width: 0; }
.asset-meta strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta small { color: var(--studio-muted); font-size: 8px; letter-spacing: .05em; }
.asset-add { align-items: center; background: transparent; border: 0; color: var(--studio-muted); cursor: pointer; display: inline-flex; justify-content: center; padding: 4px; }
.asset-add__label { display: none; }
.asset-add:hover { color: var(--studio-accent); }
.asset-relink { background: color-mix(in srgb, var(--studio-accent) 14%, transparent); border: 1px solid var(--studio-accent); border-radius: 6px; color: var(--studio-text); cursor: pointer; font-size: 8px; font-weight: 800; min-height: 28px; padding: 3px 5px; text-transform: uppercase; }
.wave-mini { background: linear-gradient(90deg, transparent 0 6%, var(--studio-accent-2) 6% 10%, transparent 10% 16%, var(--studio-accent-2) 16% 21%, transparent 21% 28%, var(--studio-accent-2) 28% 35%, transparent 35% 42%, var(--studio-accent-2) 42% 46%, transparent 46% 54%, var(--studio-accent-2) 54% 64%, transparent 64% 72%, var(--studio-accent-2) 72% 78%, transparent 78% 84%, var(--studio-accent-2) 84% 89%, transparent 89%); height: 20px; opacity: .8; width: 38px; }

.empty-state,
.inspector-empty {
  align-items: center;
  color: var(--studio-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  min-height: 180px;
  padding: 18px;
  text-align: center;
}

.empty-state span,
.inspector-empty span { color: var(--studio-accent); }
.empty-state strong,
.inspector-empty strong { color: var(--studio-text); font-size: 12px; }
.empty-state small,
.inspector-empty small { font-size: 10px; line-height: 1.5; }

.studio-center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mobile-creative-tools,
.mobile-creative-sheet-heading { display: none; }
.preview-card { background: #000; flex: 1; }
.preview-card .visualizer-titlebar { background: linear-gradient(90deg, color-mix(in srgb, var(--studio-panel) 96%, #000), color-mix(in srgb, var(--studio-surface) 95%, #000)); border-color: var(--studio-line); min-height: 44px; }
.preview-card .visualizer-title { color: var(--studio-accent); font-size: 13px; letter-spacing: .03em; }
.preview-card .stage { aspect-ratio: 16 / 9; max-height: 560px; }
.preview-card #visualizerCanvas { height: 100%; object-fit: contain; width: 100%; }
.preview-card #visualizerCanvas.direct-edit-ready { cursor: grab; outline: 1px dashed color-mix(in srgb, var(--studio-accent) 68%, transparent); outline-offset: -5px; touch-action: none; }
.preview-card #visualizerCanvas.direct-edit-ready:focus-visible { outline: 2px solid var(--studio-accent); outline-offset: -6px; }
.preview-card #visualizerCanvas.direct-edit-dragging { cursor: grabbing; outline-style: solid; }
.composition-guides { border: 1px solid color-mix(in srgb, var(--studio-text) 22%, transparent); box-sizing: border-box; pointer-events: none; position: absolute; z-index: 3; }
.composition-guides[hidden] { display: none; }
.composition-safe-frame { border: 1px dashed color-mix(in srgb, var(--studio-text) 35%, transparent); inset: 10%; position: absolute; }
.composition-guide { background: color-mix(in srgb, var(--studio-text) 16%, transparent); position: absolute; transition: background-color .1s ease, box-shadow .1s ease; }
.composition-guide--third-x,
.composition-guide--center-x { bottom: 0; top: 0; width: 1px; }
.composition-guide--third-y,
.composition-guide--center-y { height: 1px; left: 0; right: 0; }
.composition-guide--third-x-a { left: 33.333%; }
.composition-guide--third-x-b { left: 66.666%; }
.composition-guide--third-y-a { top: 33.333%; }
.composition-guide--third-y-b { top: 66.666%; }
.composition-guide--center-x { background: color-mix(in srgb, var(--studio-accent) 34%, transparent); left: 50%; }
.composition-guide--center-y { background: color-mix(in srgb, var(--studio-accent) 34%, transparent); top: 50%; }
.composition-guides.snap-x .composition-guide--center-x,
.composition-guides.snap-y .composition-guide--center-y { background: var(--studio-accent); box-shadow: 0 0 9px var(--studio-accent); }
.canvas-edit-hint { background: color-mix(in srgb, var(--studio-accent) 7%, transparent); border: 1px dashed color-mix(in srgb, var(--studio-accent) 28%, var(--studio-line)); border-radius: 7px; color: var(--studio-muted); display: block; line-height: 1.45; margin-top: 10px; padding: 7px 8px; }
.transport-card { box-shadow: none; }
.transport-card .timeline { background: color-mix(in srgb, var(--studio-surface) 88%, #000); border: 0; min-height: 56px; }
.transport-card .export-panel { border-top: 1px solid var(--studio-line); }
.legacy-recording-mode { display: none !important; }

.inspector-sidebar { overflow: auto; }
.inspector-section { border-bottom: 1px solid var(--studio-line); margin: 0 -14px 14px; padding: 0 14px 14px; }
.active-clip-title { align-items: center; display: flex; gap: 9px; margin-bottom: 12px; }
.active-clip-title > div { display: grid; min-width: 0; }
.active-clip-title small { color: var(--studio-muted); font-size: 8px; letter-spacing: .12em; }
.active-clip-title strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-type-dot { background: var(--track-color); border-radius: 50%; box-shadow: 0 0 10px var(--track-color); display: inline-block; flex: 0 0 auto; height: 8px; width: 8px; }
.inspector-grid { display: grid; gap: 8px; }
.inspector-grid.two { grid-template-columns: 1fr 1fr; }
.inspector-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.clip-inspector label { color: var(--studio-muted); display: grid; font-size: 9px; gap: 4px; margin-bottom: 8px; text-transform: uppercase; }
.clip-inspector input[type="number"],
.clip-inspector select,
.clip-inspector textarea {
  background: var(--studio-bg);
  border: 1px solid var(--studio-line);
  color: var(--studio-text);
  min-height: 34px;
  padding: 5px 7px;
  width: 100%;
}
.clip-inspector textarea { font: inherit; line-height: 1.4; min-height: 66px; resize: vertical; }
.clip-inspector input[type="color"] { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 6px; height: 34px; padding: 3px; width: 100%; }
.text-italic-toggle { background: color-mix(in srgb, #f472b6 8%, var(--studio-panel)); border: 1px solid var(--studio-line); border-radius: 7px; min-height: 31px; padding: 6px 8px; }
.clip-inspector .toggle-row { align-items: center; display: flex; text-transform: none; }
.motion-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--studio-accent) 8%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, var(--studio-accent) 26%, var(--studio-line)); border-radius: 10px; margin: 12px 0; padding: 10px; }
.motion-panel__heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 9px; }
.motion-panel__heading span { color: var(--studio-accent); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.motion-panel__heading strong { color: var(--studio-muted); font-size: 9px; }
.mobile-inspector-toggle { display: none; }
.text-style-panel { background: linear-gradient(145deg, color-mix(in srgb, #f472b6 8%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, #f472b6 24%, var(--studio-line)); border-radius: 10px; margin: 0 0 12px; padding: 10px; }
.text-style-panel .motion-panel__heading span { color: #f9a8d4; }
.audio-mix-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--studio-accent-2) 9%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 28%, var(--studio-line)); border-radius: 10px; margin: 12px 0; padding: 10px; }
.audio-mix-panel .motion-panel__heading span { color: var(--studio-accent-2); }
.audio-mix-panel .audio-toggle { background: color-mix(in srgb, var(--studio-accent-2) 7%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 20%, var(--studio-line)); border-radius: 7px; margin: 7px 0; padding: 7px 8px; }
.color-grade-panel { background: linear-gradient(145deg, color-mix(in srgb, #a78bfa 10%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, #a78bfa 28%, var(--studio-line)); border-radius: 10px; margin: 12px 0; padding: 10px; }
.color-grade-panel .motion-panel__heading span { color: #c4b5fd; }
.color-grade-panel .motion-panel__heading button { background: transparent; border: 1px solid color-mix(in srgb, #a78bfa 32%, var(--studio-line)); border-radius: 6px; color: var(--studio-muted); cursor: pointer; font-size: 8px; min-height: 24px; padding: 3px 8px; text-transform: uppercase; }
.color-grade-panel .motion-panel__heading button:hover { border-color: #a78bfa; color: var(--studio-text); }
.look-presets { display: grid; gap: 5px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 10px; }
.look-presets button { background: color-mix(in srgb, #a78bfa 7%, var(--studio-bg)); border: 1px solid color-mix(in srgb, #a78bfa 22%, var(--studio-line)); border-radius: 6px; color: var(--studio-muted); cursor: pointer; font-size: 8px; min-height: 28px; padding: 4px; text-transform: uppercase; }
.look-presets button:hover { background: color-mix(in srgb, #a78bfa 15%, var(--studio-bg)); border-color: #a78bfa; color: var(--studio-text); }
.position-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--studio-accent) 9%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, var(--studio-accent) 28%, var(--studio-line)); border-radius: 10px; margin: 0 0 12px; padding: 10px; }
.position-presets { display: grid; gap: 5px; grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.position-presets button { background: color-mix(in srgb, var(--studio-accent) 7%, var(--studio-bg)); border: 1px solid color-mix(in srgb, var(--studio-accent) 22%, var(--studio-line)); border-radius: 6px; cursor: pointer; min-height: 26px; position: relative; }
.position-presets button::after { background: var(--studio-muted); border-radius: 50%; content: ""; height: 5px; left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); width: 5px; }
.position-presets button:hover { background: color-mix(in srgb, var(--studio-accent) 16%, var(--studio-bg)); border-color: var(--studio-accent); }
.position-presets button:hover::after,
.position-presets__center::after { background: var(--studio-accent); box-shadow: 0 0 7px var(--studio-accent); }
.beat-motion-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--studio-accent-2) 11%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 30%, var(--studio-line)); border-radius: 10px; margin: 0 0 12px; padding: 10px; }
.beat-motion-panel .motion-panel__heading span { color: var(--studio-accent-2); }
.beat-motion-panel .motion-panel__heading strong { color: color-mix(in srgb, var(--studio-accent-2) 78%, var(--studio-text)); }
.composite-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--studio-accent-2) 7%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 24%, var(--studio-line)); border-radius: 10px; display: grid; gap: 9px; margin: 12px 0; padding: 10px; }
.composite-panel .motion-panel__heading span { color: var(--studio-accent-2); }
.composite-presets { display: grid; gap: 5px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.composite-presets button { background: color-mix(in srgb, var(--studio-accent-2) 7%, var(--studio-bg)); border: 1px solid color-mix(in srgb, var(--studio-accent-2) 22%, var(--studio-line)); border-radius: 6px; color: var(--studio-muted); cursor: pointer; font-size: 8px; min-height: 28px; padding: 4px; text-transform: uppercase; }
.composite-presets button:hover { background: color-mix(in srgb, var(--studio-accent-2) 15%, var(--studio-bg)); border-color: var(--studio-accent-2); color: var(--studio-text); }
.speed-panel { background: linear-gradient(145deg, color-mix(in srgb, #38bdf8 8%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, #38bdf8 26%, var(--studio-line)); border-radius: 10px; display: grid; gap: 9px; margin: 12px 0; padding: 10px; }
.speed-panel .motion-panel__heading span { color: #38bdf8; }
.speed-presets { display: grid; gap: 5px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.speed-presets button { background: color-mix(in srgb, #38bdf8 7%, var(--studio-bg)); border: 1px solid color-mix(in srgb, #38bdf8 22%, var(--studio-line)); border-radius: 6px; color: var(--studio-muted); cursor: pointer; font-size: 9px; min-height: 28px; padding: 4px 2px; }
.speed-presets button:hover { background: color-mix(in srgb, #38bdf8 15%, var(--studio-bg)); border-color: #38bdf8; color: var(--studio-text); }
.speed-presets .speed-presets__freeze { grid-column: 1 / -1; text-transform: uppercase; }
.framing-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--studio-accent) 8%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, var(--studio-accent) 24%, var(--studio-line)); border-radius: 10px; margin: 12px 0; padding: 10px; }
.framing-panel .motion-panel__heading span { color: var(--studio-accent); }
.framing-panel .motion-panel__heading button { background: transparent; border: 1px solid color-mix(in srgb, var(--studio-accent) 30%, var(--studio-line)); border-radius: 6px; color: var(--studio-muted); cursor: pointer; font-size: 8px; min-height: 24px; padding: 3px 8px; text-transform: uppercase; }
.framing-panel .motion-panel__heading button:hover { border-color: var(--studio-accent); color: var(--studio-text); }
.framing-panel .framing-toggle { background: color-mix(in srgb, var(--studio-accent) 6%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent) 18%, var(--studio-line)); border-radius: 7px; justify-content: center; min-height: 32px; padding: 6px; text-transform: none; }
.mask-panel { background: linear-gradient(145deg, color-mix(in srgb, #f472b6 9%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, #f472b6 28%, var(--studio-line)); border-radius: 10px; margin: 12px 0; padding: 10px; }
.mask-panel .motion-panel__heading span { color: #f9a8d4; }
.mask-panel .motion-panel__heading strong { color: color-mix(in srgb, #f9a8d4 82%, var(--studio-text)); }
.chroma-panel { background: linear-gradient(145deg, color-mix(in srgb, #22c55e 9%, var(--studio-panel)), color-mix(in srgb, var(--studio-panel) 92%, black)); border: 1px solid color-mix(in srgb, #22c55e 28%, var(--studio-line)); border-radius: 10px; margin: 12px 0; padding: 10px; }
.chroma-panel .motion-panel__heading span { color: #86efac; }
.chroma-panel .motion-panel__heading button { background: transparent; border: 1px solid color-mix(in srgb, #22c55e 34%, var(--studio-line)); border-radius: 6px; color: var(--studio-muted); cursor: pointer; font-size: 8px; min-height: 24px; padding: 3px 8px; text-transform: uppercase; }
.chroma-presets { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 9px; }
.chroma-presets button { background: color-mix(in srgb, #22c55e 7%, var(--studio-panel-2)); border: 1px solid color-mix(in srgb, #22c55e 24%, var(--studio-line)); border-radius: 7px; color: var(--studio-text); cursor: pointer; font-size: 9px; min-height: 30px; }
.chroma-presets button:last-child { background: color-mix(in srgb, #3b82f6 8%, var(--studio-panel-2)); border-color: color-mix(in srgb, #3b82f6 30%, var(--studio-line)); }
.chroma-toggle { background: color-mix(in srgb, #22c55e 7%, transparent); border: 1px solid color-mix(in srgb, #22c55e 18%, var(--studio-line)); border-radius: 7px; margin-bottom: 8px; padding: 7px 8px; text-transform: none; }
.motion-time { color: var(--studio-muted); display: block; font-size: 8px; line-height: 1.45; margin: 2px 0 8px; }
.motion-actions { display: grid; gap: 5px; grid-template-columns: 32px minmax(78px, 1fr) 32px 52px 42px; }
.motion-actions button { background: color-mix(in srgb, var(--studio-panel) 72%, transparent); border: 1px solid var(--studio-line); border-radius: 6px; color: var(--studio-text); cursor: pointer; font: inherit; font-size: 8px; min-height: 29px; padding: 4px; }
.motion-actions button:hover { border-color: var(--studio-accent); }
.motion-actions .motion-actions__primary { background: color-mix(in srgb, var(--studio-accent) 18%, var(--studio-panel)); border-color: color-mix(in srgb, var(--studio-accent) 54%, var(--studio-line)); color: var(--studio-text); font-weight: 800; }
.clip-actions { display: grid; gap: 7px; grid-template-columns: 1fr 1fr; margin-top: 10px; }
.clip-actions--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.clip-actions--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multi-selection-panel { background: color-mix(in srgb, var(--studio-accent) 9%, var(--studio-panel)); border-color: color-mix(in srgb, var(--studio-accent) 42%, var(--studio-line)); }
.multi-selection-panel .motion-panel__heading strong { color: var(--studio-accent); }
.clip-clipboard-panel { border-top: 1px solid var(--studio-line); margin-top: 12px; padding-top: 10px; }
.clip-clipboard-panel .clip-actions { margin-top: 7px; }
.clip-clipboard-panel .button { font-size: 9px; min-height: 34px; padding-inline: 6px; }
.clip-clipboard-panel .button:disabled { cursor: not-allowed; opacity: .42; }
.button--quiet { background: var(--studio-panel); border-color: var(--studio-line); }
.button--danger { background: rgba(255, 79, 109, .12); border-color: rgba(255, 79, 109, .35); color: #ff879a; }
.button--danger svg { height: 15px; width: 15px; }

.inspector-sidebar .settings-bar { background: transparent; border: 0; gap: 4px; height: auto; justify-content: flex-start; margin: 0 -4px 10px; }
.inspector-sidebar .settings-icon { background: var(--studio-panel); border: 1px solid var(--studio-line); border-radius: 8px; color: var(--studio-muted); flex: 1; font-size: 10px; min-width: 0; }
.inspector-sidebar .settings-icon.active { border-color: var(--studio-accent); color: var(--studio-accent); }
.inspector-sidebar .settings-panel-dock { background: transparent; }
.inspector-sidebar .settings-panel { background: transparent; border: 0; max-height: none; padding: 0; }
.inspector-sidebar .control-section-title,
.inspector-sidebar .settings-drawer summary { color: var(--studio-accent); }
.inspector-sidebar input[type="text"],
.inspector-sidebar select,
.inspector-sidebar .check-control { background: var(--studio-bg); border-color: var(--studio-line); }

.studio-timeline {
  border-radius: var(--studio-radius);
  margin-top: 12px;
  overflow: hidden;
}
.timeline-header { align-items: center; display: flex; justify-content: space-between; min-height: 52px; padding: 9px 14px; }
.timeline-header > div:first-child { display: grid; gap: 4px; }
.timeline-header strong { font-size: 11px; }
.timeline-tools { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.timeline-tools label { align-items: center; display: flex; font-size: 9px; gap: 6px; text-transform: uppercase; }
.timeline-tools input[type="number"] { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 7px; color: var(--studio-text); padding: 4px 5px; width: 54px; }
.timeline-tools .button { font-size: 9px; min-height: 30px; padding: 5px 8px; }
.timeline-search input { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 7px; color: var(--studio-text); font-size: 9px; height: 30px; padding: 5px 8px; width: 104px; }
.timeline-search input:focus { border-color: var(--studio-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 18%, transparent); outline: 0; }
.timeline-search input::placeholder { color: color-mix(in srgb, var(--studio-muted) 72%, transparent); }
.timeline-search-clear { font-size: 14px !important; min-width: 30px; padding-inline: 6px !important; }
.timeline-search-clear:disabled { cursor: not-allowed; opacity: .42; }
.find-tools-menu__panel { left: 0; right: auto; width: min(300px, calc(100vw - 28px)); }
.find-tools-menu__panel .timeline-search { align-items: stretch; display: grid; gap: 5px; grid-column: 1 / -1; }
.find-tools-menu__panel .timeline-search input { width: 100%; }
.find-tools-menu__navigation { display: grid; gap: 5px; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.find-tools-menu__navigation .button { justify-content: center; text-align: center; }
.timeline-selection-tools { position: relative; }
.timeline-selection-tools > summary { align-items: center; cursor: pointer; display: flex; gap: 7px; list-style: none; white-space: nowrap; }
.timeline-selection-tools > summary::-webkit-details-marker { display: none; }
.timeline-selection-tools > summary::after { color: var(--studio-muted); content: "▾"; font-size: 8px; transition: transform .16s ease; }
.timeline-selection-tools[open] > summary { background: color-mix(in srgb, var(--studio-accent) 13%, var(--studio-panel)); border-color: color-mix(in srgb, var(--studio-accent) 50%, var(--studio-line)); color: var(--studio-text); }
.timeline-selection-tools[open] > summary::after { transform: rotate(180deg); }
.timeline-selection-tools__menu { background: color-mix(in srgb, var(--studio-panel) 96%, #000); border: 1px solid color-mix(in srgb, var(--studio-accent) 32%, var(--studio-line)); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); display: grid; gap: 5px; grid-template-columns: repeat(2, minmax(112px, 1fr)); padding: 8px; position: absolute; right: 0; top: calc(100% + 6px); width: min(260px, calc(100vw - 28px)); z-index: 40; }
.timeline-selection-tools__menu .button { justify-content: flex-start; text-align: left; width: 100%; }
.timeline-selection-tools__menu .button:focus-visible, .timeline-selection-tools > summary:focus-visible { border-color: var(--studio-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 20%, transparent); outline: 0; }
.timeline-more-tools { display: none; }
.timeline-timing-tools__menu { left: 0; right: auto; }
.timeline-timing-tools__menu label { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 7px; justify-content: space-between; min-height: 30px; padding: 4px 7px; }
.timeline-timing-tools__menu input[type="number"] { width: 64px; }
.detect-bpm.analyzing { border-color: var(--studio-accent-2); color: var(--studio-accent-2); opacity: .82; }
.render-range-tools { position: relative; }
.render-range-tools .button.active { background: color-mix(in srgb, var(--studio-accent) 16%, var(--studio-panel)); border-color: var(--studio-accent); color: var(--studio-text); }
.navigation-tools-menu__panel { left: 0; right: auto; }
.navigation-tools-menu__panel label { display: grid; gap: 5px; grid-column: 1 / -1; }
.navigation-tools-menu__panel input { background: #05070c; border: 1px solid color-mix(in srgb, var(--studio-accent) 40%, var(--studio-line)); border-radius: 6px; color: var(--studio-text); font: 700 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .05em; padding: 7px; text-align: center; width: 100%; }
.navigation-tools-menu__panel input:focus { border-color: var(--studio-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 18%, transparent); outline: 0; }
.view-tools-menu__panel { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(286px, calc(100vw - 28px)); }
.view-tools-menu__panel #cycleTimelineFilter { grid-column: 1 / -1; }
.view-tools-menu__zoom { align-items: center; display: grid; gap: 6px; grid-column: 1 / -1; grid-template-columns: 34px minmax(0, 1fr) 34px; }
.view-tools-menu__zoom label { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 7px; display: grid; gap: 5px; min-width: 0; padding: 5px 7px; }
.view-tools-menu__zoom input { margin: 0; min-width: 0; width: 100%; }
#renderRangeSummary { color: var(--studio-muted); font-size: 8px; margin-left: 4px; min-width: 82px; white-space: nowrap; }
.marker-count { color: var(--studio-muted); font-size: 8px; white-space: nowrap; }
.marker-tools-menu__panel { grid-template-columns: minmax(0, 1fr) 42px 58px; }
.marker-tools-menu__navigation { display: grid; gap: 5px; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.marker-tools-menu__panel .button { justify-content: center; text-align: center; }
.marker-tools-menu__panel .marker-label { width: 100%; }
.marker-tools-menu__panel .marker-color { width: 42px; }
.marker-label { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 6px; color: var(--studio-text); font-size: 9px; height: 25px; padding: 3px 7px; width: 92px; }
.marker-color { background: var(--studio-bg); border: 1px solid var(--studio-line); border-radius: 6px; height: 25px; padding: 2px; width: 28px; }
.marker-tools-menu :disabled { cursor: not-allowed; opacity: .42; }
.timeline-scroll { background: var(--studio-timeline); border-top: 1px solid var(--studio-line); max-height: 330px; min-height: 175px; overflow: auto; position: relative; }
.timeline-ruler { background: color-mix(in srgb, var(--studio-panel) 90%, #000); border-bottom: 1px solid var(--studio-line); height: 38px; min-width: 100%; position: sticky; top: 0; z-index: 6; }
.track-gutter-label { align-items: center; border-right: 1px solid var(--studio-line); color: var(--studio-muted); display: flex; font-size: 8px; height: 30px; justify-content: center; left: 0; position: sticky; width: 120px; z-index: 7; }
.ruler-mark { color: var(--studio-muted); font-size: 8px; position: absolute; top: 8px; transform: translateX(-1px); }
.ruler-mark i { background: var(--studio-line-strong); display: block; height: 5px; left: 0; position: absolute; top: -8px; width: 1px; }
.timeline-marker { background: transparent; border: 0; bottom: 0; color: var(--marker-color); cursor: pointer; padding: 0; position: absolute; top: 0; transform: translateX(-50%); width: 15px; z-index: 7; }
.timeline-marker i { background: var(--marker-color); bottom: 0; box-shadow: 0 0 8px color-mix(in srgb, var(--marker-color) 55%, transparent); left: 7px; position: absolute; top: 8px; width: 1px; }
.timeline-marker i::before { background: var(--marker-color); clip-path: polygon(0 0, 100% 0, 50% 100%); content: ""; height: 8px; left: -4px; position: absolute; top: -3px; width: 9px; }
.timeline-marker span { background: color-mix(in srgb, var(--marker-color) 20%, var(--studio-panel)); border: 1px solid color-mix(in srgb, var(--marker-color) 58%, transparent); border-radius: 4px; color: var(--studio-text); display: none; font-size: 7px; left: 10px; max-width: 110px; overflow: hidden; padding: 2px 5px; position: absolute; text-overflow: ellipsis; top: 18px; white-space: nowrap; }
.timeline-marker:hover span,
.timeline-marker.selected span { display: block; }
.timeline-marker.selected i { box-shadow: 0 0 0 2px var(--studio-text), 0 0 13px var(--marker-color); width: 2px; }
.timeline-tracks { min-width: 100%; position: relative; }
.timeline-row { border-bottom: 1px solid var(--studio-line); display: grid; grid-template-columns: 120px 1fr; height: 52px; }
.track-label { align-content: center; background: color-mix(in srgb, var(--studio-panel) 82%, #000); border-right: 1px solid var(--studio-line); color: var(--studio-text); display: grid; gap: 2px; left: 0; min-width: 0; padding: 3px 5px; position: sticky; z-index: 5; }
.track-label.selected { background: color-mix(in srgb, var(--studio-accent) 11%, var(--studio-panel)); }
.track-label__select { align-items: center; background: transparent; border: 0; color: inherit; cursor: pointer; display: flex; gap: 6px; min-width: 0; padding: 0 2px; text-align: left; width: 100%; }
.track-label__select > span:last-child { display: grid; min-width: 0; }
.track-label strong { font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-label small { color: var(--studio-muted); font-size: 7px; text-transform: uppercase; }
.track-quick-actions { align-items: center; display: flex; gap: 2px; justify-content: flex-end; }
.track-quick-actions button { align-items: center; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--studio-muted); display: inline-flex; font-size: 7px; font-weight: 800; height: 16px; justify-content: center; padding: 0; width: 16px; }
.track-quick-actions button:hover { border-color: var(--studio-line-strong); color: var(--studio-text); }
.track-quick-actions button.active { background: color-mix(in srgb, var(--studio-accent) 20%, var(--studio-panel)); border-color: color-mix(in srgb, var(--studio-accent) 58%, transparent); color: var(--studio-text); }
.track-quick-actions svg { height: 10px; width: 10px; }
.timeline-row.track-inactive .timeline-clip { filter: grayscale(.75); opacity: .42; }
.timeline-row.track-locked .timeline-clip { cursor: not-allowed; }
.timeline-row.track-solo .track-type-dot { box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 65%, transparent), 0 0 12px var(--track-color); }
.track-lane { background-image: repeating-linear-gradient(90deg, transparent 0 calc(24px - 1px), color-mix(in srgb, var(--studio-text) 4%, transparent) calc(24px - 1px) 24px); position: relative; }
.timeline-clip { align-items: center; background: color-mix(in srgb, var(--clip-color) 18%, var(--studio-panel)); border: 1px solid color-mix(in srgb, var(--clip-color) 52%, transparent); border-radius: 7px; color: var(--studio-text); cursor: grab; display: flex; gap: 5px; height: 38px; min-width: 48px; overflow: hidden; padding: 4px 7px; position: absolute; top: 7px; }
.timeline-clip.selected { box-shadow: 0 0 0 2px var(--studio-text), 0 0 18px color-mix(in srgb, var(--clip-color) 24%, transparent); }
.timeline-row:has(.timeline-clip.selected) .track-label { background: color-mix(in srgb, var(--studio-accent) 11%, var(--studio-panel)); }
.timeline-clip strong { font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-clip small { color: color-mix(in srgb, var(--studio-text) 65%, transparent); font-size: 7px; margin-left: auto; }
.clip-waveform { height: 100%; inset: 0; opacity: .52; pointer-events: none; position: absolute; width: 100%; }
.clip-keyframe { background: var(--studio-text); border: 1px solid var(--studio-panel); box-shadow: 0 0 8px color-mix(in srgb, var(--clip-color) 70%, transparent); height: 7px; pointer-events: none; position: absolute; top: 3px; transform: translateX(-50%) rotate(45deg); width: 7px; z-index: 2; }
.timeline-clip strong,
.timeline-clip small,
.timeline-clip .clip-grip { position: relative; z-index: 1; }
.clip-handle { background: color-mix(in srgb, var(--studio-text) 82%, var(--clip-color)); cursor: ew-resize; height: 100%; opacity: 0; position: absolute; top: 0; transition: opacity .15s ease; width: 8px; z-index: 2; }
.clip-handle--start { left: 0; }
.clip-handle--end { right: 0; }
.timeline-clip:hover .clip-handle,
.timeline-clip.selected .clip-handle { opacity: .88; }
.clip-handle::after { background: var(--studio-panel); border-radius: 2px; content: ""; height: 14px; left: 3px; position: absolute; top: 11px; width: 2px; }
.timeline-scroll--compact .timeline-row { height: 34px; }
.timeline-scroll--compact .track-label { grid-template-columns: minmax(0, 1fr) auto; padding-block: 2px; }
.timeline-scroll--compact .track-label__select { grid-column: 1; grid-row: 1; }
.timeline-scroll--compact .track-label small { display: none; }
.timeline-scroll--compact .track-quick-actions { grid-column: 2; grid-row: 1; }
.timeline-scroll--compact .track-quick-actions button { height: 14px; width: 14px; }
.timeline-scroll--compact .timeline-clip { border-radius: 5px; height: 26px; padding-block: 2px; top: 4px; }
.timeline-scroll--compact .clip-grip { height: 14px; }
.timeline-scroll--compact .clip-handle::after { height: 10px; top: 7px; }
.timeline-scroll--compact .timeline-snap-guide span { top: 31px; }
.beat-mark { border-left: 1px solid color-mix(in srgb, var(--studio-accent-2) 18%, transparent); bottom: 0; pointer-events: none; position: absolute; top: 18px; z-index: 0; }
.beat-mark--bar { border-left-color: color-mix(in srgb, var(--studio-accent) 34%, transparent); }
.render-range-band { background: color-mix(in srgb, var(--studio-accent) 18%, transparent); bottom: 0; pointer-events: none; position: absolute; top: 18px; z-index: 1; }
.render-range-band--full { background: color-mix(in srgb, var(--studio-accent-2) 7%, transparent); }
.render-range-edge { border-left: 2px solid var(--studio-accent); bottom: 0; pointer-events: none; position: absolute; top: 15px; z-index: 2; }
.render-range-edge::before { background: var(--studio-accent); clip-path: polygon(0 0, 100% 0, 50% 100%); content: ""; height: 6px; left: -5px; position: absolute; top: 0; width: 8px; }
.render-range-edge--out { border-left-color: var(--studio-accent-2); }
.render-range-edge--out::before { background: var(--studio-accent-2); }
#snapBeat.active { background: color-mix(in srgb, var(--studio-accent-2) 18%, var(--studio-panel)); border-color: var(--studio-accent-2); color: var(--studio-text); }
#rippleMode.active { background: color-mix(in srgb, var(--studio-accent) 18%, var(--studio-panel)); border-color: var(--studio-accent); color: var(--studio-text); }
.timeline-snap-guide { border-left: 1px solid #f7ff63; bottom: 0; filter: drop-shadow(0 0 5px rgba(247,255,99,.74)); pointer-events: none; position: absolute; top: 0; width: 1px; z-index: 10; }
.timeline-snap-guide[hidden] { display: none; }
.timeline-snap-guide span { background: #f7ff63; border-radius: 4px; color: #090b0f; font: 800 8px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; left: 5px; max-width: 150px; overflow: hidden; padding: 3px 5px; position: absolute; text-overflow: ellipsis; top: 41px; white-space: nowrap; }
.project-new { min-height: 34px; padding-inline: 12px; }
.track-state-grid { display: grid; gap: 5px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.track-state-grid .toggle-row { background: color-mix(in srgb, var(--studio-panel) 74%, transparent); border: 1px solid var(--studio-line); border-radius: 7px; font-size: 9px; justify-content: center; margin: 0; min-height: 31px; padding: 5px; }
.clip-grip { border-left: 2px dotted color-mix(in srgb, var(--clip-color) 70%, white); height: 20px; width: 3px; }
.timeline-playhead { background: transparent; border: 0; bottom: 0; padding: 0; pointer-events: none; position: absolute; top: 0; width: 1px; z-index: 8; }
.timeline-playhead::before { background: var(--studio-accent); content: ""; inset: 0 auto 0 0; position: absolute; width: 1px; }
.timeline-playhead span { background: var(--studio-accent); clip-path: polygon(0 0, 100% 0, 50% 100%); height: 9px; left: -4px; position: absolute; top: 0; width: 9px; }
.timeline-empty { align-items: center; color: var(--studio-muted); display: flex; font-size: 10px; height: 110px; justify-content: center; }
.timeline-first-use { display: none; }
.mobile-workspace-tabs { display: none; }

.export-links a { color: var(--studio-accent); }
.export-panel { background: var(--studio-surface); }
.status-text { color: var(--studio-muted); }
.output-meter { align-items: center; display: flex; gap: 5px; min-width: 150px; }
.output-meter__label { color: var(--studio-muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.output-meter__rail { background: color-mix(in srgb, var(--studio-line) 74%, #000); border-radius: 999px; display: block; height: 6px; overflow: hidden; width: 68px; }
.output-meter__rail i { background: linear-gradient(90deg, var(--studio-accent-2), #80ff72 72%, #ffd43b); display: block; height: 100%; transform: scaleX(0); transform-origin: left center; transition: transform 45ms linear; width: 100%; }
.output-meter__rail i.near-limit { background: linear-gradient(90deg, #80ff72, #ffd43b 65%, #ff516b); }
.output-meter strong { color: var(--studio-muted); font-size: 8px; min-width: 43px; text-align: right; }
.button--primary { background: var(--studio-accent); }
input[type="range"] { accent-color: var(--studio-accent); }

@media (max-width: 1240px) {
  .studio-workspace { grid-template-columns: 215px minmax(380px, 1fr) 275px; }
  .studio-topbar { grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr); }
  .compact-field span { display: none; }
}

@media (max-width: 960px) {
  .app-shell { padding-bottom: 76px; }
  .studio-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .project-identity { grid-column: 1; grid-row: 1; }
  .studio-topbar__actions { grid-column: 2; grid-row: 1; }
  .studio-topbar__center { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: thin; }
  .studio-topbar__center > * { flex: 0 0 auto; }
  .studio-format-controls { display: none; }
  .studio-topbar-menu[open] > .studio-topbar-menu__panel {
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 12px;
    max-height: min(58vh, 430px);
    max-width: none;
    min-width: 0;
    overflow-y: auto;
    position: fixed;
    right: 12px;
    top: auto;
    width: auto;
    z-index: 100;
  }
  .studio-format-menu__panel .compact-field span { display: block; }
  .studio-format-menu__panel .compact-field select { width: 100%; }
  .studio-topbar-menu__panel .button,
  .studio-topbar-menu__panel select,
  .studio-topbar-menu__panel input:not([type="checkbox"]):not([type="range"]),
  .titlebar-presets__menu .titlebar-button,
  .titlebar-presets__menu select,
  .titlebar-presets__menu input,
  .timeline-selection-tools__menu .button,
  .timeline-selection-tools__menu select,
  .timeline-selection-tools__menu input:not([type="checkbox"]):not([type="range"]) { min-height: 44px; }
  #exportFormat,
  #exportQuality { min-height: 44px; }
  .marker-tools-menu__panel .marker-label,
  .marker-tools-menu__panel .marker-color { height: 44px; }
  .studio-workspace { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; }
  .studio-sidebar { display: none; max-height: none; }
  .studio-center { display: flex; }
  .mobile-creative-tools { background: color-mix(in srgb, var(--studio-surface) 94%, #000); border: 1px solid var(--studio-line); border-radius: 12px; display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px; }
  .mobile-creative-tool { align-items: center; background: color-mix(in srgb, var(--studio-panel) 86%, transparent); border: 1px solid var(--studio-line); border-radius: 9px; color: var(--studio-muted); display: grid; gap: 2px; justify-items: center; min-height: 50px; padding: 6px 8px; }
  .mobile-creative-tool strong { color: var(--studio-text); font-size: 11px; letter-spacing: .06em; }
  .mobile-creative-tool small { color: inherit; font-size: 8px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
  .mobile-creative-tool--primary { background: linear-gradient(135deg, color-mix(in srgb, var(--studio-accent) 28%, var(--studio-panel)), color-mix(in srgb, var(--studio-accent-2) 14%, var(--studio-panel))); border-color: color-mix(in srgb, var(--studio-accent) 68%, var(--studio-line)); box-shadow: 0 0 18px color-mix(in srgb, var(--studio-accent) 16%, transparent); }
  .mobile-creative-tool.active { background: color-mix(in srgb, var(--studio-accent) 22%, var(--studio-panel)); border-color: var(--studio-accent); color: var(--studio-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 18%, transparent); }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] .inspector-sidebar { background: color-mix(in srgb, var(--studio-surface) 97%, #000); border: 1px solid color-mix(in srgb, var(--studio-accent) 32%, var(--studio-line)); border-radius: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); box-shadow: 0 -18px 48px rgba(0, 0, 0, .62); display: block; left: 10px; max-height: min(35dvh, 330px); overflow: auto; padding: 0 10px 12px; position: fixed; right: 10px; z-index: 76; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] .inspector-sidebar > .panel-heading,
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] .inspector-sidebar > #clipInspector,
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector > .settings-bar { display: none; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector { margin: 0; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel { max-height: none; padding: 0; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel select,
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel input[type="color"] { height: 44px; min-height: 44px; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel input[type="range"] { min-height: 44px; touch-action: pan-x; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel input[type="range"]::-webkit-slider-thumb { height: 24px; width: 24px; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel input[type="range"]::-moz-range-thumb { height: 24px; width: 24px; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] #legacyInspector .settings-panel .button { min-height: 44px; }
  .mobile-creative-sheet-heading { align-items: center; background: color-mix(in srgb, var(--studio-surface) 94%, transparent); border-bottom: 1px solid var(--studio-line); display: none; justify-content: space-between; margin: 0 -10px 10px; padding: 9px 10px; position: sticky; top: 0; z-index: 2; }
  .mobile-creative-sheet-heading div { display: grid; gap: 2px; }
  .mobile-creative-sheet-heading span { color: var(--studio-accent); font-size: 8px; font-weight: 850; letter-spacing: .09em; }
  .mobile-creative-sheet-heading strong { color: var(--studio-text); font-size: 12px; }
  .mobile-creative-sheet-heading .button { min-height: 44px; min-width: 68px; }
  body[data-mobile-studio-panel="canvas"][data-mobile-creative-panel] .mobile-creative-sheet-heading { display: flex; }
  .mobile-workspace-tabs { backdrop-filter: blur(18px); background: color-mix(in srgb, var(--studio-surface) 92%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent) 22%, var(--studio-line)); border-radius: 14px; bottom: max(8px, env(safe-area-inset-bottom)); box-shadow: 0 14px 42px rgba(0, 0, 0, .48); display: grid; grid-template-columns: repeat(3, 1fr); left: 12px; padding: 5px; position: fixed; right: 12px; z-index: 80; }
  .mobile-workspace-tabs button { background: transparent; border: 0; border-radius: 10px; color: var(--studio-muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; min-height: 44px; position: relative; }
  .mobile-workspace-tabs button.active { background: color-mix(in srgb, var(--studio-accent) 12%, var(--studio-panel)); color: var(--studio-text); }
  .mobile-workspace-tabs button.active::after { background: var(--studio-accent); border-radius: 999px; bottom: 4px; content: ""; height: 2px; left: 34%; position: absolute; right: 34%; }
  .mobile-workspace-tabs button:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 24%, transparent); outline: 1px solid var(--studio-accent); }
  body[data-mobile-studio-panel="media"] .asset-sidebar,
  body[data-mobile-studio-panel="inspector"] .inspector-sidebar { display: block; }
  body[data-mobile-studio-panel="media"] .studio-center,
  body[data-mobile-studio-panel="inspector"] .studio-center { display: none; }
  #addMediaButton { background: color-mix(in srgb, var(--studio-accent) 14%, var(--studio-panel)); border-color: color-mix(in srgb, var(--studio-accent) 46%, var(--studio-line)); color: var(--studio-text); gap: 6px; height: auto; min-height: 44px; padding: 0 13px; width: auto; }
  #addMediaButton .mobile-add-media-label { display: inline; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  body[data-mobile-studio-panel="media"] .asset-list .empty-state { min-height: 88px; padding-block: 8px; }
  .asset-list { max-height: 52vh; }
  .asset-card { grid-template-columns: 50px minmax(0, 1fr) 64px; }
  .asset-add { background: color-mix(in srgb, var(--studio-accent) 13%, var(--studio-panel)); border: 1px solid color-mix(in srgb, var(--studio-accent) 44%, var(--studio-line)); border-radius: 9px; color: var(--studio-text); gap: 4px; min-height: 42px; padding: 7px 9px; }
  .asset-add__label { display: inline; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  .mobile-inspector-section { overflow: hidden; }
  .mobile-inspector-section.is-collapsed > :not(.motion-panel__heading) { display: none !important; }
  .mobile-inspector-section.is-collapsed > .motion-panel__heading { margin-bottom: 0; }
  .mobile-inspector-section > .motion-panel__heading { gap: 7px; justify-content: flex-start; }
  .mobile-inspector-section > .motion-panel__heading > strong,
  .mobile-inspector-section > .motion-panel__heading > button:not(.mobile-inspector-toggle) { margin-left: auto; }
  .mobile-inspector-toggle { align-items: center; background: color-mix(in srgb, var(--studio-text) 7%, transparent); border: 1px solid var(--studio-line); border-radius: 8px; color: var(--studio-text); display: inline-flex; flex: 0 0 36px; height: 36px; justify-content: center; margin-left: 0; padding: 0; }
  .mobile-inspector-toggle span { color: inherit; font-size: 17px; letter-spacing: 0; line-height: 1; transition: transform .16s ease; }
  .mobile-inspector-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
  body[data-mobile-studio-panel="inspector"] .clip-inspector { padding-bottom: 0; }
  body[data-mobile-studio-panel="inspector"] .clip-inspector:has(.mobile-clip-action-bar) { padding-bottom: 190px; }
  body[data-mobile-studio-panel="inspector"] .inspector-empty { min-height: 132px; padding-block: 12px; }
  .mobile-clip-action-bar { backdrop-filter: blur(16px); background: color-mix(in srgb, var(--studio-surface) 94%, transparent); border: 1px solid color-mix(in srgb, var(--studio-accent) 24%, var(--studio-line)); border-radius: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); box-shadow: 0 10px 30px rgba(0, 0, 0, .38); display: flex; gap: 6px; left: 12px; margin: 0; overflow-x: auto; overflow-y: hidden; padding: 7px; position: fixed; right: 12px; scroll-padding-inline: 7px; scroll-snap-type: x proximity; scrollbar-width: none; z-index: 70; }
  .mobile-clip-action-bar::-webkit-scrollbar { display: none; }
  .mobile-clip-action-bar .button { flex: 0 0 88px; font-size: 9px; font-weight: 800; line-height: 1.15; min-height: 44px; padding: 7px 5px; scroll-snap-align: start; }
  .mobile-clip-action-bar .button--danger { background: color-mix(in srgb, #ff4f6d 16%, var(--studio-panel)); border-color: color-mix(in srgb, #ff4f6d 48%, var(--studio-line)); }
  .timeline-tools > .timeline-secondary-tools { display: none; }
  .timeline-more-tools { display: block; order: 8; }
  .timeline-more-tools__menu { grid-template-columns: repeat(2, minmax(116px, 1fr)); right: 0; }
  .timeline-tools > .timeline-secondary-tools[open] { display: block; order: 9; position: static; }
  .timeline-tools > .timeline-secondary-tools[open] > summary { display: none; }
  .timeline-tools > .timeline-selection-tools[open] > .timeline-selection-tools__menu { bottom: calc(68px + env(safe-area-inset-bottom)); left: 12px; max-height: min(58vh, 430px); overflow-y: auto; position: fixed; right: 12px; top: auto; width: auto; z-index: 90; }
  .timeline-row,
  .timeline-scroll--compact .timeline-row { height: 64px; }
  .track-label,
  .timeline-scroll--compact .track-label { align-content: center; display: grid; grid-template-columns: 1fr; padding: 5px 6px; }
  .track-label small,
  .timeline-scroll--compact .track-label small { display: none; }
  .track-quick-actions,
  .timeline-scroll--compact .track-quick-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .track-quick-actions button,
  .timeline-scroll--compact .track-quick-actions button { border-color: var(--studio-line); border-radius: 6px; height: 24px; width: 24px; }
  .track-quick-actions button[data-track-action="down"],
  .track-quick-actions button[data-track-action="up"] { display: none; }
  .track-quick-actions svg { height: 13px; width: 13px; }
  .timeline-clip,
  .timeline-scroll--compact .timeline-clip { border-radius: 9px; height: 50px; min-width: 56px; padding: 6px 9px; top: 7px; }
  .timeline-clip.selected { background: color-mix(in srgb, var(--clip-color) 30%, var(--studio-panel)); border-color: color-mix(in srgb, var(--clip-color) 88%, white); box-shadow: 0 0 0 2px var(--studio-accent), 0 0 22px color-mix(in srgb, var(--clip-color) 42%, transparent); }
  .timeline-clip.selected strong { color: #fff; font-weight: 900; }
  .clip-handle { width: 12px; }
  .clip-handle::after { height: 20px; left: 5px; top: 14px; }
  .timeline-scroll--compact .clip-handle::after { height: 20px; top: 14px; }
}

@media (max-width: 680px) {
  header { position: relative; }
  .app-shell { padding: 8px 8px 76px; }
  .studio-topbar { border-radius: 11px; gap: 6px; min-height: 58px; padding: 7px 9px; }
  .project-eyebrow,
  .autosave-state { display: none; }
  #projectName { font-size: 13px; min-height: 44px; }
  .studio-topbar__actions .studio-render,
  .studio-topbar__center .icon-button { min-height: 44px; }
  .studio-topbar__center .icon-button { height: 44px; width: 44px; }
  .studio-topbar__center { gap: 7px; overflow-y: hidden; padding: 0; scrollbar-width: none; }
  .studio-topbar__center::-webkit-scrollbar { display: none; }
  .studio-topbar-menu > summary,
  .studio-topbar__center > .button { min-height: 44px; padding-block: 8px; }
  .studio-render { min-width: 88px; }
  .studio-render span { font-size: 11px; }
  .studio-workspace { min-height: 0; }
  .preview-card .visualizer-titlebar { min-height: 54px; }
  .preview-card .auto-sync-motion { min-height: 44px; }
  .beat-director-panel { gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .beat-director-panel__intro { grid-column: 1; grid-row: 1; }
  .beat-director-panel #resetBeatDirector { grid-column: 2; grid-row: 1; min-height: 44px; }
  .beat-director-presets { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; }
  .beat-director-presets > span { grid-column: 1 / -1; margin: 0; }
  .beat-director-presets button { min-height: 44px; min-width: 0; }
  .preview-card .titlebar-presets summary { height: 44px; min-height: 44px; width: 56px; }
  .output-meter { min-width: 78px; }
  .output-meter__label,
  .output-meter strong { display: none; }
  .output-meter__rail { width: 74px; }
  .preview-card .stage { max-height: none; }
  .transport-card .timeline { gap: 5px; min-height: 48px; padding: 7px; }
  .timeline-play { min-width: 52px; }
  .studio-timeline { border-radius: 11px; margin-top: 8px; }
  .timeline-header { align-items: center; flex-direction: row; gap: 8px; min-height: 56px; padding: 6px 8px; }
  .timeline-header > div:first-child { flex: 0 0 auto; }
  .timeline-tools { flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-start; min-width: 0; overflow-x: auto; padding-bottom: 0; scrollbar-width: none; width: auto; }
  .timeline-tools::-webkit-scrollbar { display: none; }
  .timeline-tools > * { flex: 0 0 auto; }
  .timeline-tools > .button,
  .timeline-tools > details > summary.button { min-height: 44px; }
  .marker-tools-menu { order: 5; }
  .navigation-tools-menu { order: 4; }
  .view-tools-menu { order: 6; }
  .find-tools-menu { order: 7; }
  .marker-label { flex: 1 0 90px; }
  #renderRangeSummary { display: none; }
  .timeline-tools label:last-child { flex: 1; }
  .timeline-tools label:last-child input { flex: 1; }
  .timeline-scroll {
    -webkit-overflow-scrolling: touch;
    max-height: 245px;
    overscroll-behavior: contain;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
  }
  .timeline-scroll::-webkit-scrollbar { display: none; height: 0; width: 0; }
  .timeline-tracks { padding-bottom: 70px; }
  .titlebar-presets__menu { max-width: calc(100vw - 32px); }
}

@media (max-width: 360px) {
  .preview-card .visualizer-title { font-size: 0; overflow: visible; text-overflow: clip; }
  .preview-card .visualizer-title::after { content: "Preview"; font-size: 12px; }
}

/* Cancel the legacy mobile-landscape kiosk mode; V2 remains fully editable. */
@media (max-width: 900px) and (orientation: landscape) {
  html,
  body { height: auto; overflow: auto; width: auto; }
  body { background: var(--studio-bg); padding-top: 0; }
  header,
  .visualizer-titlebar,
  .settings-bar,
  .settings-panel-dock,
  .timeline,
  .export-panel { display: initial; }
  header { display: block; }
  .visualizer-titlebar { display: grid !important; }
  .settings-bar { display: flex; }
  .timeline { display: flex !important; }
  .app-shell { height: auto; margin: 0 auto; max-width: 1800px; padding: 8px; width: 100%; }
  .stage-panel { position: static; }
  .stage { aspect-ratio: 16 / 9; height: auto; width: 100%; }
  .preview-card .stage { aspect-ratio: auto; height: min(48vh, 300px); }
}

@media (max-width: 420px) {
  header .site-header-logo-text { font-size: clamp(1.1rem, 6.4vw, 1.5rem); letter-spacing: -.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 680px) {
  .transport-card .studio-transport {
    align-items: center;
    background: color-mix(in srgb, var(--studio-surface) 94%, #000);
    border-top: 1px solid color-mix(in srgb, var(--studio-accent) 18%, var(--studio-line));
    display: grid !important;
    gap: 7px 9px;
    grid-template-columns: 1fr minmax(142px, 2.2fr) 1fr;
    grid-template-rows: 44px 44px;
    min-height: 106px;
    padding: 7px 10px 8px;
  }
  .studio-transport #currentTime {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
  }
  .studio-transport #seekSlider {
    accent-color: var(--studio-accent);
    grid-column: 2;
    grid-row: 1;
    min-height: 44px;
    touch-action: pan-x;
    width: 100%;
  }
  .studio-transport #seekSlider::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
  }
  .studio-transport #seekSlider::-moz-range-thumb {
    height: 24px;
    width: 24px;
  }
  .studio-transport #durationTime {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
  }
  .studio-transport .timeline-play {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    min-height: 44px;
    min-width: 104px;
    padding: 9px 22px;
  }
  .mobile-transport-step {
    border-radius: 999px;
    display: inline-flex;
    font-size: 10px;
    font-weight: 850;
    justify-content: center;
    min-height: 44px;
    min-width: 58px;
    padding: 8px 12px;
  }
  .mobile-transport-step--back {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
  }
  .mobile-transport-step--forward {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
  }
  .studio-transport > span {
    font-size: 10px;
    min-width: 36px;
  }
  .timeline-empty--first-use {
    background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--studio-accent) 12%, transparent), transparent 68%);
    height: 122px;
    justify-content: flex-start;
    left: 0;
    position: sticky;
    width: min(359px, calc(100vw - 18px));
  }
  .timeline-empty__desktop { display: none; }
  .timeline-first-use {
    align-items: center;
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 9px 18px 10px;
    text-align: center;
    width: 100%;
  }
  .timeline-first-use__icon {
    align-items: center;
    background: color-mix(in srgb, var(--studio-accent) 13%, var(--studio-panel));
    border: 1px solid color-mix(in srgb, var(--studio-accent) 38%, var(--studio-line));
    border-radius: 999px;
    color: var(--studio-accent);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
  }
  .timeline-first-use__icon { display: none; }
  .timeline-first-use__icon svg { height: 17px; width: 17px; }
  .timeline-first-use strong { color: var(--studio-text); font-size: 12px; }
  .timeline-first-use small { color: var(--studio-muted); font-size: 9px; line-height: 1.35; max-width: 270px; }
  .timeline-first-use .button {
    align-items: center;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    gap: 7px;
    justify-content: center;
    margin-top: 0;
    min-height: 44px;
    min-width: 174px;
    padding: 9px 18px;
  }
  .timeline-first-use .button svg { height: 15px; width: 15px; }
}
