:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: #18191c;
  --panel2: #1d1f22;
  --line: #2c2e32;
  --line2: #383a3e;
  --text: #eeeff0;
  --muted: #909398;
  --soft: #b7b9bd;
  --white: #f2f3f4;
  --accent: #dce1e6;
  --track-width: 204px;
  --radius: 8px;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 1px solid #d6d8db;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.app {
  height: 100dvh;
  min-height: 520px;
  display: grid;
  grid-template-rows: 56px 1fr;
  background: var(--bg);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #151619;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 214px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border: 1px solid #d7dade;
  border-radius: 7px;
  display: grid;
  place-items: center;
  position: relative;
}
.brand-mark:before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.5px solid #d7dade;
  transform: rotate(45deg);
  display: block;
}
.brand-name {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.17em;
}
.brand-sub {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-top: 2px;
}
.project-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.project-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.save-status {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.save-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b9c0c6;
}
.top-spacer {
  flex: 1;
}
.top-action {
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--soft);
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
}
.top-action:hover {
  background: #25272a;
  color: white;
}
.top-action.icon-only {
  width: 30px;
  padding: 0;
  font-size: 15px;
}
.export-btn {
  background: #e3e5e7;
  color: #151619;
  border: 0;
  font-weight: 700;
  padding: 0 14px;
}
.export-btn:hover {
  background: white;
}
.avatar {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #c3c5c8;
}
.app-shell {
  min-height: 0;
  display: grid;
  --layers-width: 254px;
  --inspector-width: 270px;
  --timeline-height: 292px;
  grid-template-columns: minmax(160px, var(--layers-width)) minmax(320px, 1fr) minmax(190px, var(--inspector-width));
  grid-template-rows: minmax(180px, 1fr) minmax(160px, var(--timeline-height));
  gap: 1px;
  background: var(--line);
}
.panel {
  background: var(--panel);
  min-width: 0;
  min-height: 0;
  position: relative;
}
.layers-panel {
  grid-column: 1;
  grid-row: 1/3;
  display: flex;
  flex-direction: column;
}
.viewport-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.inspector-panel {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
}
.timeline-panel {
  grid-column: 2/4;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.panel-head {
  height: 44px;
  flex: 0 0 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.panel-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #aaaeb3;
}
.head-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tiny-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 26px;
  height: 25px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.tiny-btn:hover {
  border-color: var(--line2);
  background: #24262a;
  color: white;
}
.tool-divider {
  height: 15px;
  width: 1px;
  background: var(--line);
  margin: 0 3px;
}
.searchbox {
  height: 29px;
  margin: 10px 11px 7px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
}
.searchbox input {
  width: 100%;
  outline: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
}
.searchbox input::placeholder {
  color: #696c71;
}
.layer-list {
  flex: 1;
  overflow: auto;
  padding: 2px 6px 6px;
}
.layer-group-label {
  height: 27px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: #72757a;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.layer-group-label .count {
  margin-left: auto;
  color: #676a6e;
}
.layer-row {
  min-height: 39px;
  display: grid;
  grid-template-columns: 10px 14px 24px minmax(0, 1fr) 20px 20px;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  margin: 2px 0;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: grab;
  user-select: none;
}
.layer-row:hover {
  background: #202226;
}
.layer-row.selected {
  background: #292b2f;
  border-color: #3d4044;
}
.layer-row.multi-selected {
  box-shadow: inset 2px 0 0 #d1d5d8;
}
.layer-row.dragging {
  opacity: 0.35;
}
.layer-row.drop-target {
  border-top: 1px solid #eef0f2;
}
.layer-indent {
  width: 15px;
}
.layer-expand {
  width: 16px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #707379;
  padding: 0;
  font-size: 10px;
}
.layer-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #36393d;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #c5c9cd;
  font-size: 12px;
  background: #202226;
}
.layer-icon.camera {
  color: #e2e4e6;
}
.layer-icon.character {
  color: #c0c3c6;
}
.layer-icon.object {
  color: #b8bdc1;
}
.layer-icon.light {
  color: #d3d5d7;
}
.layer-icon.null {
  color: #92969a;
}
.layer-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.layer-name {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e1e2e4;
}
.layer-meta {
  font-size: 8px;
  color: #777a7e;
  letter-spacing: 0.035em;
}
.layer-action {
  width: 22px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #65696e;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 11px;
  padding: 0;
}
.layer-action:hover,
.layer-action.active {
  color: #e0e2e4;
  background: #33353a;
}
.layer-action.dim {
  opacity: 0.34;
}
.layers-footer {
  border-top: 1px solid var(--line);
  padding: 10px 11px 12px;
}
.group-btn {
  width: 100%;
  height: 31px;
  text-align: left;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #1c1e21;
  border-radius: 6px;
  color: #a9adb1;
  font-size: 10px;
}
.group-btn:hover {
  background: #26282b;
  color: #eee;
}
.group-btn span {
  margin-right: 7px;
  font-size: 14px;
  vertical-align: -1px;
}
.layers-count {
  font-size: 9px;
  color: #6f7277;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}
.viewport-top {
  height: 45px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
}
.view-label {
  font-size: 9px;
  color: #777b80;
  letter-spacing: 0.13em;
  font-weight: 700;
}
.shot-select-wrap {
  position: relative;
}
.shot-select {
  height: 27px;
  border: 1px solid var(--line2);
  background: #202226;
  border-radius: 5px;
  color: #e0e2e4;
  padding: 0 9px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.shot-select:hover {
  background: #292b2f;
}
.chev {
  color: #85898e;
  font-size: 9px;
}
.shot-menu {
  position: absolute;
  top: 32px;
  left: 0;
  width: 220px;
  background: #202226;
  border: 1px solid #3a3c40;
  border-radius: 7px;
  box-shadow: 0 16px 38px #0009;
  z-index: 9;
  padding: 5px;
  display: none;
}
.shot-menu.open {
  display: block;
}
.shot-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #d3d5d8;
  text-align: left;
  font-size: 10px;
}
.shot-option:hover,
.shot-option.active {
  background: #303236;
}
.shot-option small {
  color: #7f8388;
  font-size: 9px;
}
.view-switch {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px;
  background: #17181b;
}
.switch-btn {
  border: 0;
  background: transparent;
  color: #82868a;
  font-size: 9px;
  padding: 5px 9px;
  border-radius: 4px;
}
.switch-btn.active {
  background: #34363a;
  color: #f2f3f4;
}
.viewport-tools {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.view-tool {
  height: 26px;
  min-width: 27px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  color: #92969a;
  font-size: 12px;
}
.view-tool:hover,
.view-tool.active {
  background: #292b2f;
  border-color: #36383d;
  color: #eff0f2;
}
.camera-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9da1a5;
  font-size: 9px;
  border-left: 1px solid var(--line);
  padding-left: 11px;
  margin-left: 1px;
  white-space: nowrap;
}
.live-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9dde0;
  box-shadow: 0 0 8px #d9dde066;
}
.viewport-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #0d0f12;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.scene-art {
  position: absolute;
  inset: 0;
  background: #101216;
  overflow: hidden;
}
.scene-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
  transform: scale(1.035);
  transition:
    filter 0.25s ease,
    transform 0.12s linear;
  filter: brightness(0.8) saturate(0.82);
}
.viewport-wrap.scene-mode .scene-art img {
  filter: brightness(0.74) saturate(0.58) grayscale(0.35);
}
.scene-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      #08090c55 0%,
      transparent 18%,
      transparent 65%,
      #090a0da6 100%
    ),
    linear-gradient(
      90deg,
      #07080a22,
      transparent 15%,
      transparent 85%,
      #07080a22
    );
  pointer-events: none;
}
.viewport-wrap:after {
  content: "";
  position: absolute;
  inset: 7.4% 8%;
  border: 1px solid #f4f5f622;
  pointer-events: none;
}
.viewport-wrap.scene-mode:after {
  inset: 3%;
  border-style: dashed;
  border-color: #e8eaec42;
}
.frame-label {
  position: absolute;
  top: 12px;
  left: 13px;
  z-index: 1;
  font-size: 8px;
  color: #e5e7e9b8;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 8px #000;
}
.focus-reticle {
  position: absolute;
  left: 54%;
  top: 49%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  transition:
    left 0.3s,
    top 0.3s;
}
.focus-reticle:before,
.focus-reticle:after {
  content: "";
  position: absolute;
  background: #e7e9ebba;
}
.focus-reticle:before {
  width: 1px;
  height: 100%;
  left: 50%;
}
.focus-reticle:after {
  height: 1px;
  width: 100%;
  top: 50%;
}
.reticle-ring {
  position: absolute;
  inset: 10px;
  border: 1px solid #e7e9ebbc;
  border-radius: 50%;
}
.reticle-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.safe-guides {
  position: absolute;
  inset: 16%;
  border: 1px dashed #ffffff29;
  z-index: 1;
  pointer-events: none;
}
.safe-guides:before,
.safe-guides:after {
  content: "";
  position: absolute;
  background: #ffffff18;
}
.safe-guides:before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
}
.safe-guides:after {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
}
.viewport-wrap.scene-mode .safe-guides {
  display: none;
}
.cam-frustum {
  position: absolute;
  left: 20%;
  top: 27%;
  width: 100px;
  height: 86px;
  border: 1px solid #e3e6e855;
  transform: perspective(160px) rotateY(14deg) skewY(-8deg);
  z-index: 1;
  pointer-events: none;
}
.cam-frustum:before,
.cam-frustum:after {
  content: "";
  position: absolute;
  height: 1px;
  width: 80px;
  background: #e3e6e855;
  top: 50%;
  left: 100%;
  transform-origin: left;
}
.cam-frustum:before {
  transform: rotate(-22deg);
}
.cam-frustum:after {
  transform: rotate(22deg);
}
.viewport-wrap.camera-mode .cam-frustum {
  display: none;
}
.scene-hud {
  position: absolute;
  left: 12px;
  bottom: 11px;
  z-index: 2;
  display: flex;
  gap: 13px;
  align-items: center;
  color: #e4e6e8b8;
  font:
    9px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-shadow: 0 1px 8px #000;
}
.scene-hud span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hud-sep {
  height: 12px;
  width: 1px;
  background: #ffffff44;
}
.scene-right-hud {
  position: absolute;
  right: 12px;
  bottom: 11px;
  z-index: 2;
  color: #e4e6e8b5;
  font:
    9px ui-monospace,
    monospace;
}
.scene-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  background: #0c0d0fa0;
  border: 1px solid #ffffff24;
  border-radius: 4px;
  padding: 5px 7px;
  color: #eceef0;
  font-size: 8px;
  letter-spacing: 0.1em;
  backdrop-filter: blur(5px);
}
.motion-chip {
  position: absolute;
  left: 12px;
  top: 38px;
  z-index: 2;
  color: #eceef0;
  background: #15171ab8;
  border: 1px solid #ffffff22;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 8px;
  letter-spacing: 0.06em;
}
.center-play {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 5px;
  align-items: center;
}
.center-play button {
  width: 26px;
  height: 24px;
  background: #101114b0;
  border: 1px solid #ffffff28;
  color: #f4f5f6;
  border-radius: 5px;
  font-size: 10px;
}
.center-play button:hover {
  background: #25272c;
}
.mobile-hint {
  display: none;
}
.inspector-tabs {
  height: 39px;
  display: flex;
  gap: 15px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}
.inspector-tab {
  height: 31px;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: #7e8287;
  padding: 0 2px;
  font-size: 9px;
}
.inspector-tab.active {
  color: #e5e7e9;
  border-color: #e3e5e7;
}
.inspector-scroll {
  padding: 12px 13px 15px;
  overflow: auto;
  flex: 1;
}
.inspector-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.inspector-heading .layer-icon {
  width: 27px;
  height: 27px;
}
.inspector-title {
  font-size: 11px;
  font-weight: 650;
}
.inspector-subtitle {
  font-size: 8px;
  color: #767a7f;
  margin-top: 3px;
}
.section {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.section:first-child {
  border-top: 0;
  padding-top: 0;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  color: #aeb2b6;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title small {
  color: #6e7277;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.field-label {
  display: block;
  font-size: 9px;
  color: #85898e;
  margin-bottom: 6px;
}
.select-control {
  height: 30px;
  width: 100%;
  background: #202226;
  border: 1px solid #34363a;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 10px;
  color: #d7d9dc;
}
.target-row {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.small-outline {
  flex: 1;
  height: 28px;
  background: #202226;
  border: 1px solid var(--line2);
  border-radius: 5px;
  color: #b7bbc0;
  font-size: 9px;
}
.small-outline:hover {
  background: #2a2c30;
  color: white;
}
.small-outline.active {
  border-color: #73777c;
  color: #f0f1f2;
}
.inline-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #84888d;
  font-size: 9px;
  margin-top: 7px;
}
.inline-stat strong {
  color: #d8dadd;
  font-weight: 500;
}
.segmented {
  display: flex;
  gap: 4px;
  background: #151619;
  border: 1px solid #2c2e32;
  padding: 3px;
  border-radius: 6px;
}
.segmented button {
  flex: 1;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #85898e;
  padding: 6px 4px;
  font-size: 9px;
}
.segmented button.active {
  color: #edeff1;
  background: #33363a;
}
.motion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.motion-card {
  height: 46px;
  position: relative;
  text-align: left;
  padding: 7px 8px;
  background: #1d1f22;
  border: 1px solid #303236;
  border-radius: 6px;
  color: #c0c3c7;
}
.motion-card:hover {
  background: #26282c;
  border-color: #515459;
}
.motion-card.active {
  border-color: #aeb4ba;
  background: #292b2f;
}
.motion-card .motion-icon {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
  color: #e5e7e9;
}
.motion-card span:last-child {
  font-size: 8px;
  color: #a4a8ac;
}
.motion-card small {
  position: absolute;
  right: 7px;
  top: 8px;
  color: #767b80;
  font-size: 7px;
}
.pose-details {
  margin-top: 8px;
  border-top: 1px solid #2c2e32;
  padding-top: 7px;
}
.pose-details summary {
  font-size: 8px;
  color: #94989d;
  cursor: pointer;
}
.pose-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 7px;
}
.pose-inputs label {
  font-size: 8px;
  color: #7f8489;
}
.pose-inputs input {
  width: 100%;
  height: 23px;
  margin-top: 3px;
  padding: 0 4px;
  border: 1px solid #35383d;
  border-radius: 4px;
  background: #202226;
  color: #d6d9dc;
  font:
    9px ui-monospace,
    monospace;
}
.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-row input[type="range"] {
  flex: 1;
  height: 2px;
  accent-color: #d8dadd;
}
.range-value {
  font:
    9px ui-monospace,
    monospace;
  color: #d5d8da;
  min-width: 35px;
  text-align: right;
}
.char-palette {
  display: flex;
  gap: 7px;
  align-items: center;
}
.color-swatch {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px #45484d;
  cursor: pointer;
}
.color-swatch.active {
  box-shadow: 0 0 0 1px #e4e7e9;
  border-color: #1b1d20;
}
.accessory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.accessory {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #1e2023;
  color: #969a9f;
  font-size: 9px;
  text-align: left;
  padding: 0 8px;
}
.accessory.active {
  border-color: #777b80;
  color: #e1e3e5;
  background: #292b2f;
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.preset-tile {
  min-height: 65px;
  border: 1px solid #303236;
  border-radius: 6px;
  background: #1c1e21;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #bbbfc3;
  font-size: 8px;
}
.preset-tile:hover,
.preset-tile.active {
  border-color: #a4a8ac;
  background: #27292d;
}
.preset-shape {
  width: 21px;
  height: 21px;
  border: 1px solid #c2c6ca;
  display: block;
}
.shape-cube {
  transform: rotate(30deg) skew(-5deg);
  border-radius: 2px;
}
.shape-ball {
  border-radius: 50%;
  box-shadow: inset -4px -3px 0 #777;
}
.shape-ring {
  border-radius: 50%;
  border-width: 4px;
}
.saved-preset .layer-action {
  width: 50px;
  font-size: 8px;
}
.saved-preset {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 5px;
  color: #b3b7bb;
  font-size: 8px;
}
.save-preset-btn {
  height: 28px;
  width: 100%;
  margin-top: 8px;
  border: 1px dashed #44474b;
  border-radius: 5px;
  background: transparent;
  color: #95999d;
  font-size: 9px;
}
.save-preset-btn:hover {
  border-color: #a5a9ad;
  color: #e3e5e7;
}
.empty-note {
  font-size: 9px;
  line-height: 1.5;
  color: #777b80;
  padding: 8px 2px;
}
.timeline-top {
  height: 41px;
  flex: 0 0 41px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}
.timeline-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #aeb2b6;
}
.timeline-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.timeline-tools .tiny-btn {
  height: 23px;
}
.timecode {
  font:
    10px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  background: #111214;
  border: 1px solid #2f3135;
  border-radius: 4px;
  padding: 5px 7px;
  color: #e2e4e6;
}
.fps {
  font-size: 8px;
  color: #73777b;
  margin-left: 3px;
}
.timeline-body {
  display: grid;
  grid-template-columns: var(--track-width) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
  position: relative;
}
.track-labels {
  border-right: 1px solid var(--line);
  min-width: 0;
}
.tracks-header {
  height: 27px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #777b80;
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.track-header-actions {
  color: #85898d;
  font-size: 11px;
}
.track-row {
  height: 24px;
  border-bottom: 1px solid #25272a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  color: #95999d;
  font-size: 9px;
}
.track-row:hover {
  background: #202226;
}
.track-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.track-symbol {
  font-size: 9px;
  color: #b9bdc0;
  width: 11px;
  text-align: center;
}
.track-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-key-toggle {
  border: 0;
  background: transparent;
  color: #676b70;
  font-size: 11px;
  padding: 3px 1px;
}
.track-key-toggle:hover,
.track-key-toggle.keyed {
  color: #e0e3e5;
}
.timeline-grid {
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.ruler {
  height: 27px;
  position: relative;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(12.5% - 1px),
    #34363a calc(12.5% - 1px),
    #34363a 12.5%
  );
}
.ruler-tick {
  position: absolute;
  top: 5px;
  transform: translateX(-50%);
  color: #82868a;
  font:
    8px ui-monospace,
    monospace;
}
.ruler-tick:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  height: 5px;
  width: 1px;
  background: #62666a;
}
.track-lane {
  height: 24px;
  position: relative;
  border-bottom: 1px solid #25272a;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(12.5% - 1px),
    #2a2c30 calc(12.5% - 1px),
    #2a2c30 12.5%
  );
}
.track-lane:hover {
  background-color: #1e2023;
}
.key-diamond {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid #d9dcdf;
  background: #292b2f;
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: 2;
  border-radius: 1px;
  padding: 0;
}
.key-diamond:hover {
  background: #f0f1f2;
  box-shadow: 0 0 8px #fff5;
}
.key-diamond.playhead-key {
  background: #e9ecee;
}
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e5e7e9;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 7px #fff5;
}
.timeline-playhead:before {
  content: "";
  position: absolute;
  top: 25px;
  left: -4px;
  width: 9px;
  height: 9px;
  background: #e6e8ea;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.timeline-footer {
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border-top: 1px solid var(--line);
  font-size: 8px;
  color: #777b80;
}
.timeline-footer .hint {
  color: #9ca0a4;
}
.play-button {
  width: 23px;
  height: 23px;
  border: 1px solid #3a3c40;
  background: #24262a;
  border-radius: 5px;
  color: #e7e9eb;
  font-size: 10px;
}
.play-button:hover {
  background: #34363a;
}
.keyframe-add {
  color: #e1e4e6 !important;
}
.select-label {
  font-size: 9px;
  color: #8a8e92;
  margin-left: 4px;
}
.popover {
  position: fixed;
  z-index: 30;
  background: #222428;
  border: 1px solid #3a3d41;
  border-radius: 7px;
  padding: 5px;
  box-shadow: 0 18px 40px #0009;
  min-width: 160px;
  display: none;
}
.popover.open {
  display: block;
}
.menu-item {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c5c8cb;
  font-size: 10px;
  border-radius: 4px;
}
.menu-item:hover {
  background: #34363a;
  color: white;
}
.menu-item span {
  width: 20px;
  display: inline-block;
  color: #969a9e;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 70px;
  z-index: 50;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  background: #e6e8ea;
  color: #151619;
  border-radius: 7px;
  padding: 9px 13px;
  font-size: 10px;
  box-shadow: 0 7px 25px #0008;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.mobilebar {
  display: none;
}
@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: minmax(160px, var(--layers-width)) minmax(320px, 1fr) minmax(190px, var(--inspector-width));
    grid-template-rows: minmax(180px, 1fr) minmax(160px, var(--timeline-height));
  }
  .brand {
    min-width: 180px;
  }
  .camera-tag {
    display: none;
  }
  .inspector-scroll {
    padding-left: 10px;
    padding-right: 10px;
  }
  .motion-card {
    height: 43px;
  }
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .app {
    grid-template-rows: 52px 1fr 59px;
    min-height: 540px;
  }
  .topbar {
    grid-row: 1;
    height: 52px;
    padding: 0 10px;
    gap: 8px;
  }
  .brand {
    min-width: auto;
  }
  .brand-name {
    font-size: 10px;
  }
  .brand-sub {
    display: none;
  }
  .brand-mark {
    width: 24px;
    height: 24px;
  }
  .project-title {
    margin-left: 3px;
  }
  .project-name {
    font-size: 10px;
  }
  .save-status {
    font-size: 0;
    gap: 0;
  }
  .save-dot {
    width: 6px;
    height: 6px;
  }
  .topbar .top-action.icon-only {
    display: none;
  }
  .topbar .export-btn {
    height: 27px;
    padding: 0 9px;
    font-size: 9px;
  }
  .avatar {
    display: none;
  }
  .app-shell {
    grid-row: 2;
    grid-template-columns: 1fr;
    --layers-width: min(330px, 88vw);
    --inspector-width: min(330px, 88vw);
    grid-template-rows: minmax(150px, 1fr) minmax(120px, var(--timeline-height));
    gap: 1px;
    overflow: hidden;
  }
  .viewport-panel {
    grid-column: 1;
    grid-row: 1;
  }
  .timeline-panel {
    grid-column: 1;
    grid-row: 2;
  }
  .layers-panel,
  .inspector-panel {
    display: none;
  }
  .app-shell.mobile-layers-open .layers-panel,
  .app-shell.mobile-inspector-open .inspector-panel {
    display: flex;
    position: fixed;
    top: 52px;
    bottom: 59px;
    z-index: 22;
    box-shadow: 0 10px 40px #000a;
  }
  .app-shell.mobile-layers-open .layers-panel {
    left: 0;
    width: min(var(--layers-width), 88vw);
  }
  .app-shell.mobile-inspector-open .inspector-panel {
    right: 0;
    width: min(var(--inspector-width), 88vw);
  }
  .app-shell.mobile-layers-open:after,
  .app-shell.mobile-inspector-open:after {
    content: "";
    position: fixed;
    inset: 52px 0 59px;
    background: #0008;
    z-index: 21;
  }
  .viewport-top {
    height: 40px;
    flex-basis: 40px;
    padding: 0 9px;
    gap: 6px;
  }
  .view-label {
    font-size: 8px;
  }
  .shot-select {
    height: 25px;
    font-size: 9px;
    padding: 0 6px;
  }
  .switch-btn {
    padding: 5px 7px;
    font-size: 8px;
  }
  .viewport-tools {
    gap: 2px;
  }
  .view-tool {
    min-width: 24px;
  }
  .viewport-wrap:after {
    inset: 6% 5%;
  }
  .safe-guides {
    inset: 17%;
  }
  .timeline-top {
    height: 37px;
    flex-basis: 37px;
    padding: 0 8px;
  }
  .timeline-title {
    font-size: 8px;
  }
  .timeline-body {
    --track-width: 138px;
    grid-template-columns: 138px minmax(0, 1fr);
  }
  .track-row {
    padding: 0 6px;
    font-size: 8px;
  }
  .track-name-wrap {
    gap: 4px;
  }
  .tracks-header {
    padding: 0 6px;
  }
  .timeline-footer {
    padding: 0 7px;
    font-size: 7px;
  }
  .fps {
    display: none;
  }
  .mobilebar {
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #17181b;
    border-top: 1px solid var(--line);
    z-index: 25;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav {
    height: 47px;
    min-width: 62px;
    background: transparent;
    border: 0;
    color: #7f8388;
    font-size: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .mobile-nav b {
    font-size: 16px;
    font-weight: 400;
    color: #b9bdc0;
  }
  .mobile-nav.active {
    color: #f0f1f2;
  }
  .mobile-nav.active b {
    color: #fff;
  }
  .mobile-hint {
    display: block;
    font-size: 7px;
    color: #c9cdd0;
  }
  .scene-hud {
    font-size: 8px;
    gap: 8px;
  }
  .scene-right-hud {
    font-size: 8px;
  }
  .center-play {
    bottom: 9px;
  }
  .frame-label {
    font-size: 7px;
    top: 9px;
    left: 9px;
  }
  .motion-chip {
    top: 31px;
    left: 9px;
    font-size: 7px;
  }
  .scene-badge {
    top: 8px;
    right: 8px;
  }
  .timeline-playhead:before {
    top: 35px;
  }
}
@media (max-width: 480px) {
  .app {
    min-height: 570px;
  }
  .topbar {
    gap: 6px;
  }
  .brand-mark {
    width: 21px;
    height: 21px;
  }
  .brand-name {
    font-size: 9px;
    letter-spacing: 0.12em;
  }
  .project-title {
    max-width: 112px;
    overflow: hidden;
  }
  .project-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .export-btn {
    padding: 0 7px;
  }
  .viewport-top {
    gap: 5px;
  }
  .view-label {
    display: none;
  }
  .viewport-tools .view-tool:nth-child(3) {
    display: none;
  }
  .switch-btn {
    padding: 5px 6px;
  }
  .shot-select {
    max-width: 113px;
    overflow: hidden;
    white-space: nowrap;
  }
  .timeline-body {
    --track-width: 120px;
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .timeline-top .timeline-title {
    letter-spacing: 0.06em;
  }
  .timeline-tools {
    gap: 2px;
  }
  .timecode {
    font-size: 8px;
    padding: 5px;
  }
  .track-name {
    max-width: 80px;
  }
  .scene-hud span:nth-child(3) {
    display: none;
  }
  .center-play {
    bottom: 6px;
  }
  .safe-guides {
    inset: 19%;
  }
  .viewport-wrap:after {
    inset: 7% 4%;
  }
}

#renderHost {
  touch-action: none;
}
#renderHost canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
}
.scene-art {
  inset: 0;
}
.scene-vignette {
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #08090c30,
    transparent 30%,
    transparent 70%,
    #090a0d60
  );
}
.frame-label,
.motion-chip,
.scene-badge,
.scene-hud,
.scene-right-hud {
  pointer-events: none;
}
.viewport-wrap:after {
  inset: 5.5% 5.5%;
  border-color: #f4f5f622;
}
.safe-guides {
  inset: 17%;
  opacity: 0.6;
}
.brand {
  min-width: 135px;
}
.topbar {
  gap: 13px;
}
.save-status {
  font-size: 9px;
}
.project-title {
  gap: 9px;
}
.timeline-grid {
  overflow-x: auto;
  overflow-y: hidden;
}
.timeline-content {
  height: 100%;
  position: relative;
  min-width: 100%;
}
.track-active {
  background: #27292d;
  color: #e6e8ea;
}
.autokey-btn {
  height: 23px;
  font-size: 7px;
  letter-spacing: 0.04em;
  padding: 0 6px;
  border: 1px solid #3a3d41;
  color: #7c8186;
  background: #1c1e21;
  border-radius: 4px;
  white-space: nowrap;
}
.autokey-btn.active {
  color: #e1e5e8;
  border-color: #8e959b;
}
.layer-indent {
  font-size: 9px;
  color: #60666b;
}
.layer-row {
  margin: 4px 0;
  min-height: 43px;
}
.layer-list {
  padding-top: 8px;
}
.layers-footer {
  margin-top: auto;
}
.pose-inputs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pose-details {
  margin-top: 10px;
}
.pose-details summary {
  font-size: 9px;
}
.pose-inputs input {
  height: 25px;
}
.saved-preset .layer-action {
  width: 44px;
  font-size: 8px;
}
.engine-error {
  padding: 30px;
  font-size: 12px;
  line-height: 1.7;
  color: #ccc;
  text-align: center;
}
.timeline-footer .hint {
  font-size: 7px;
}
.tutorial-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #080a0dcc;
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.tutorial-overlay.open {
  display: flex;
}
.tutorial-card {
  width: min(470px, 100%);
  background: #1a1d20;
  border: 1px solid #50565c;
  border-radius: 15px;
  padding: 24px;
  box-shadow: 0 35px 100px #0009;
  position: relative;
}
.tutorial-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #777f86;
  font-size: 9px;
  letter-spacing: 0.1em;
}
.tutorial-skip {
  border: 0;
  background: none;
  color: #929ba3;
  font-size: 10px;
  padding: 4px;
}
.tutorial-symbol {
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 43px;
  color: #dde3e8;
  position: relative;
  margin-top: 8px;
}
.tutorial-symbol:before {
  content: "";
  position: absolute;
  inset: 19px calc(50% - 39px);
  border: 1px solid #424950;
  border-radius: 17px;
  transform: rotate(-9deg);
}
.tutorial-card h1 {
  font-size: 23px;
  font-weight: 650;
  margin: 13px 0 10px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.tutorial-subtitle {
  color: #c6cdd3;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.tutorial-body {
  font-size: 11px;
  line-height: 1.85;
  color: #8f99a2;
  min-height: 79px;
}
.tutorial-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #30363b;
  margin-top: 20px;
  padding-top: 17px;
}
.tutorial-dots {
  display: flex;
  gap: 5px;
}
.tutorial-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #454c52;
}
.tutorial-dots i.active {
  width: 17px;
  border-radius: 4px;
  background: #d4dce2;
}
.tutorial-buttons {
  display: flex;
  gap: 7px;
}
.tutorial-btn {
  height: 31px;
  border: 1px solid #3d464d;
  border-radius: 6px;
  background: #22272b;
  color: #b7c1c9;
  padding: 0 10px;
  font-size: 10px;
}
.tutorial-btn.primary {
  border-color: #e0e5e9;
  background: #e0e5e9;
  color: #161b1e;
  font-weight: 700;
}
.tutorial-step {
  font-size: 8px;
  color: #737d85;
  margin-left: auto;
  margin-right: 16px;
}
#projectMenu {
  min-width: 210px;
}
#projectMenu .menu-item {
  font-size: 10px;
}
@media (max-width: 1120px) {
  .brand {
    min-width: 110px;
  }
  .project-name {
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar {
    gap: 9px;
  }
  .save-status {
    display: none;
  }
  .inspector-scroll {
    padding-left: 10px;
    padding-right: 10px;
  }
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .brand {
    min-width: auto;
  }
  .topbar {
    gap: 7px;
  }
  .project-name {
    max-width: 150px;
  }
  .topbar #previewBtn {
    font-size: 9px;
    padding: 0 7px;
    height: 27px;
  }
  .topbar #projectMenuBtn {
    font-size: 9px;
    padding: 0 7px;
    height: 27px;
  }
  .autokey-btn {
    font-size: 6px;
    padding: 0 4px;
  }
  .timeline-top {
    gap: 5px;
  }
  .tutorial-card {
    padding: 20px;
  }
  .tutorial-card h1 {
    font-size: 21px;
  }
  .tutorial-body {
    min-height: 100px;
  }
  .topbar .project-title {
    margin: 0;
  }
  .topbar .brand-name {
    font-size: 10px;
  }
}
@media (max-width: 520px) {
  .project-title {
    display: none;
  }
  .topbar .top-spacer {
    flex: 1;
  }
  .brand {
    margin-right: 4px;
  }
  .topbar #previewBtn {
    display: none;
  }
  .topbar #projectMenuBtn {
    margin-left: auto;
  }
  .topbar .export-btn {
    padding: 0 9px;
  }
  .timeline-title {
    display: none;
  }
  .timeline-top #timelineAddLayer {
    display: none;
  }
  .timeline-top .tool-divider {
    display: none;
  }
  .timeline-top .fps {
    display: none;
  }
  .tutorial-card h1 {
    font-size: 21px;
  }
  .tutorial-symbol {
    height: 79px;
  }
  .tutorial-body {
    min-height: 120px;
  }
  .timeline-footer .hint {
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.layer-touch-actions {
  display: flex;
  gap: 5px;
  margin-top: 7px;
}
.layer-touch-actions button {
  height: 29px;
  border: 1px solid #34383c;
  background: #202327;
  color: #aab2b9;
  border-radius: 5px;
  padding: 0 9px;
  font-size: 10px;
}
.layer-touch-actions button:nth-child(3) {
  flex: 1;
}
.key-diamond {
  width: 23px;
  height: 23px;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  touch-action: none;
  box-shadow: none;
}
.key-diamond:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #2b2f33;
  border: 1px solid #d5dde3;
  border-radius: 1px;
}
.key-diamond:hover {
  background: transparent;
  box-shadow: none;
}
.key-diamond:hover:after,
.key-diamond.playhead-key:after {
  background: #e8edf1;
  box-shadow: 0 0 8px #fff4;
}
.track-key-toggle {
  min-width: 23px;
  min-height: 23px;
  touch-action: manipulation;
}
.timeline-grid {
  touch-action: pan-x;
}
.layer-row {
  touch-action: pan-y;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .layer-row {
    min-height: 48px;
    grid-template-columns: 8px 20px 27px minmax(0, 1fr) 31px 31px;
    gap: 4px;
  }
  .layer-action {
    width: 31px;
    height: 33px;
    font-size: 13px;
  }
  .layer-expand {
    height: 34px;
    width: 20px;
    font-size: 14px;
  }
  .layer-name {
    font-size: 11px;
  }
  .layer-meta {
    font-size: 9px;
  }
  .layer-touch-actions button {
    height: 36px;
    font-size: 12px;
    min-width: 38px;
  }
  .pose-inputs input {
    font-size: 16px;
    height: 34px;
  }
  .select-control {
    font-size: 13px;
    height: 36px;
  }
  .small-outline {
    height: 36px;
    font-size: 10px;
  }
  .accessory {
    height: 37px;
    font-size: 10px;
  }
  .color-swatch {
    width: 29px;
    height: 29px;
  }
  .tutorial-btn {
    height: 39px;
    font-size: 11px;
  }
  .tutorial-skip {
    min-height: 36px;
  }
  .inspector-tab {
    font-size: 11px;
    height: 35px;
  }
  .timeline-top .tiny-btn,
  .play-button {
    width: 29px;
    height: 29px;
  }
  .timeline-top {
    height: 40px;
    flex-basis: 40px;
  }
  .motion-card {
    height: 54px;
  }
  .motion-card span:last-child {
    font-size: 10px;
  }
  .preset-tile {
    min-height: 73px;
  }
  .autokey-btn {
    height: 28px;
    font-size: 7px;
  }
  .save-preset-btn {
    height: 36px;
  }
  .menu-item {
    height: 39px;
    font-size: 12px;
  }
  .shot-option {
    min-height: 39px;
  }
  .searchbox {
    height: 35px;
  }
  .searchbox input {
    font-size: 13px;
  }
  .track-lane,
  .track-row {
    height: 26px;
  }
  .key-diamond {
    width: 26px;
    height: 26px;
  }
  .key-diamond:after {
    width: 9px;
    height: 9px;
  }
  .tutorial-overlay {
    overscroll-behavior: contain;
  }
  .tutorial-card {
    max-height: 92dvh;
    overflow: auto;
  }
}

#multiSelectBtn.active {
  background: #41484e;
  color: #fff;
  border-color: #9ba5ad;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  #multiSelectBtn,
  #groupTopBtn,
  #addLayerBtn {
    width: 32px;
    height: 32px;
  }
}
/* Keep editor controls reachable on short phones and mobile landscape. */
.popover {
  width: 200px;
  max-width: calc(100vw - 16px);
}
#projectMenu {
  width: 220px;
  min-width: 0;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .app {
    min-height: 0;
  }
  .app-shell {
    grid-template-rows: minmax(0, 1fr) minmax(120px, var(--timeline-height));
  }
  .timeline-body {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .track-labels,
  .timeline-grid {
    min-height: max-content;
  }
  .frame-label {
    font-size: 7px;
  }
  .viewport-wrap {
    min-height: 0;
  }
  .mobilebar {
    min-height: 0;
  }
}
@media (max-height: 500px) and (max-width: 1024px) {
  .app {
    grid-template-rows: 44px 1fr 43px;
  }
  .topbar {
    height: 44px;
  }
  .mobile-nav {
    height: 40px;
    gap: 1px;
  }
  .app-shell {
    grid-template-rows: minmax(0, 1fr) minmax(100px, var(--timeline-height));
  }
  .timeline-top {
    height: 34px;
    flex-basis: 34px;
  }
  .timeline-footer {
    height: 18px;
    flex: 0 0 18px;
  }
  .app-shell.mobile-layers-open .layers-panel,
  .app-shell.mobile-inspector-open .inspector-panel {
    top: 44px;
    bottom: 43px;
  }
  .app-shell.mobile-layers-open:after,
  .app-shell.mobile-inspector-open:after {
    inset: 44px 0 43px;
  }
  .scene-hud,
  .scene-right-hud,
  .motion-chip,
  .scene-badge,
  .frame-label,
  .safe-guides,
  .focus-reticle,
  .viewport-wrap:after {
    display: none !important;
  }
  .viewport-top {
    height: 32px;
    flex-basis: 32px;
  }
  .center-play {
    bottom: 5px;
  }
}

/* Explicit camera-height controls: touch-sized, reachable over the preview, and hidden in Scene view. */
.camera-height-pad {
  position: absolute;
  z-index: 8;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 62px;
  padding: 7px 5px;
  border: 1px solid #ffffff32;
  border-radius: 10px;
  background: #111317d9;
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 18px #0006;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}
.camera-height-pad[hidden] {
  display: none !important;
}
.viewport-wrap:not(.camera-mode) .camera-height-pad {
  display: none;
}
.camera-height-pad .pad-label {
  font-size: 7px;
  letter-spacing: 0.08em;
  color: #aeb5bc;
  white-space: nowrap;
}
.camera-height-pad output {
  font:
    8px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: #f0f2f4;
  white-space: nowrap;
}
.camera-height-pad button,
.height-nudge {
  width: 44px;
  height: 40px;
  min-height: 40px;
  border: 1px solid #454b51;
  border-radius: 7px;
  background: #272b30;
  color: #f2f4f6;
  font-size: 19px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.camera-height-pad button:hover,
.height-nudge:hover {
  background: #383e44;
  border-color: #707982;
}
.height-control-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.height-control-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #dce1e6;
  touch-action: pan-x;
}
.height-control-row .height-nudge {
  width: 38px;
  height: 36px;
  min-height: 36px;
  font-size: 16px;
}
.camera-height-inspector {
  margin: 12px 0 3px;
  padding: 10px 9px;
  border: 1px solid #34383d;
  border-radius: 7px;
  background: #1b1e21;
}
.camera-height-inspector .field-label {
  margin-bottom: 7px;
  color: #c1c6cb;
}
.height-help {
  font-size: 8px;
  line-height: 1.5;
  color: #777f86;
  margin-top: 6px;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .viewport-tools .view-tool {
    width: 36px;
    min-width: 36px;
    height: 36px;
    touch-action: manipulation;
  }
  .camera-height-pad {
    right: 8px;
    width: 58px;
    padding: 6px 4px;
    gap: 5px;
  }
  .camera-height-pad button {
    width: 46px;
    height: 44px;
    min-height: 44px;
    font-size: 20px;
  }
  .camera-height-pad output {
    font-size: 8px;
  }
  .height-control-row .height-nudge {
    width: 42px;
    height: 42px;
    min-height: 42px;
    font-size: 18px;
  }
  .camera-height-inspector {
    padding: 12px 10px;
  }
  .height-help {
    font-size: 9px;
  }
}
@media (max-height: 500px) and (max-width: 1024px) {
  .camera-height-pad {
    top: 48%;
    gap: 2px;
    padding: 4px;
  }
  .camera-height-pad button {
    height: 36px;
    min-height: 36px;
    width: 40px;
  }
}

/* The playhead triangle is a dedicated drag handle, not just a passive marker. */
.timeline-playhead:before {
  display: none;
}
.playhead-handle {
  position: absolute;
  top: 0;
  left: -22px;
  z-index: 5;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
  cursor: ew-resize;
  -webkit-tap-highlight-color: transparent;
}
.playhead-handle:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #e6e8ea;
  filter: drop-shadow(0 0 4px #fff5);
}
.key-diamond {
  z-index: 6;
}
.viewport-tools .add-layer-quick {
  width: auto;
  min-width: 60px;
  height: 27px;
  padding: 0 7px;
  border: 1px solid #45494e;
  color: #dce1e6;
  font-size: 9px;
  white-space: nowrap;
  touch-action: manipulation;
}
.viewport-tools .add-layer-quick:hover {
  background: #30343a;
  border-color: #69727a;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .playhead-handle {
    left: -22px;
    width: 44px;
    height: 44px;
  }
  .viewport-tools .add-layer-quick {
    height: 36px;
    min-width: 64px;
    font-size: 10px;
  }
}
@media (max-width: 480px) {
  .viewport-top {
    gap: 4px;
  }
  .viewport-tools .view-tool {
    width: 29px;
    min-width: 29px;
    height: 32px;
    padding: 0;
  }
  .viewport-tools .add-layer-quick {
    width: auto;
    min-width: 46px;
    height: 32px;
    padding: 0 4px;
    font-size: 8px;
  }
}

/* Live tour: spotlight the actual control while leaving the editor visible and usable. */
.tutorial-open-btn {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: #d9dfe4;
  border-color: #3c4248;
  white-space: nowrap;
}
.help-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid #7d858c;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.tutorial-overlay.open {
  display: block;
  position: fixed;
  inset: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
.tutorial-spotlight {
  display: none;
  position: fixed;
  z-index: 101;
  border: 2px solid #e5edf2;
  border-radius: 8px;
  box-shadow:
    0 0 0 9999px #080b0dc9,
    0 0 18px #d8e3e966;
  pointer-events: none;
  transition:
    top 0.18s ease,
    left 0.18s ease,
    width 0.18s ease,
    height 0.18s ease;
}
.tutorial-card {
  position: fixed;
  z-index: 102;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 16px 18px;
  border-radius: 11px;
  background: #1a1d20;
  border: 1px solid #65717a;
  box-shadow: 0 15px 50px #000c;
  pointer-events: auto;
}
.tutorial-card h1 {
  font-size: 18px;
  line-height: 1.2;
  margin: 8px 0 5px;
}
.tutorial-symbol {
  display: inline-grid;
  width: 30px;
  height: 30px;
  margin: 10px 0 0;
  place-items: center;
  border: 1px solid #424950;
  border-radius: 8px;
  font-size: 17px;
}
.tutorial-symbol:before {
  display: none;
}
.tutorial-subtitle {
  font-size: 11px;
  margin: 0 0 7px;
}
.tutorial-body {
  min-height: 0;
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
  color: #b0b9c0;
}
.tutorial-bottom {
  margin-top: 12px;
  padding-top: 11px;
}
.tutorial-btn {
  height: 36px;
  touch-action: manipulation;
}
.tutorial-skip {
  min-height: 32px;
  touch-action: manipulation;
}
@media (max-width: 820px) {
  .tutorial-open-btn {
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
    flex: 0 0 32px;
  }
  .tutorial-card {
    width: min(350px, calc(100vw - 20px));
    padding: 15px;
  }
  .tutorial-card h1 {
    font-size: 17px;
  }
  .tutorial-bottom {
    gap: 7px;
  }
  .tutorial-step {
    margin-left: auto;
    margin-right: 4px;
  }
}
.prompt-library-note {
  font-size: 9px;
  line-height: 1.55;
  color: #898e93;
  margin-top: 7px;
}
.prompt-card {
  border: 1px solid #34373b;
  border-radius: 7px;
  background: #1c1e21;
  padding: 9px;
  margin: 8px 0;
}
.prompt-card h3 {
  font-size: 10px;
  line-height: 1.35;
  margin: 0;
  color: #e2e5e8;
  font-weight: 650;
}
.prompt-subject {
  display: block;
  font-size: 8px;
  color: #81868b;
  margin-top: 4px;
}
.prompt-effect {
  font-size: 8px;
  line-height: 1.5;
  color: #a4a9ae;
  margin: 8px 0;
}
.prompt-effect b {
  color: #d2d6da;
  font-weight: 600;
}
.prompt-card details {
  border-top: 1px solid #303338;
  padding-top: 7px;
}
.prompt-card summary {
  font-size: 8px;
  color: #aab0b5;
  cursor: pointer;
}
.prompt-card textarea {
  width: 100%;
  height: 114px;
  resize: vertical;
  margin-top: 7px;
  padding: 7px;
  border: 1px solid #33373b;
  border-radius: 5px;
  background: #151619;
  color: #ccd1d5;
  font:
    8px/1.55 ui-sans-serif,
    system-ui,
    sans-serif;
}
.prompt-copy {
  width: 100%;
  height: 30px;
  margin-top: 8px;
  border: 1px solid #4a5056;
  border-radius: 5px;
  background: #292d31;
  color: #e0e4e7;
  font-size: 9px;
  touch-action: manipulation;
}
.prompt-copy:hover {
  background: #363b40;
}

.timeline-rangebar {
  min-height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-bottom: 1px solid var(--line);
  background: #151619;
  color: #8f9499;
  font-size: 8px;
}
.timeline-range-actions {
  display: flex;
  gap: 4px;
}
.range-jump,
.duration-step {
  height: 25px;
  min-width: 38px;
  padding: 0 7px;
  border: 1px solid #3a3d41;
  border-radius: 5px;
  background: #202226;
  color: #cbd0d4;
  font-size: 9px;
  touch-action: manipulation;
}
.range-jump:hover,
.duration-step:hover {
  background: #303338;
  color: #fff;
}
.timeline-range-readout {
  font:
    9px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: #e1e4e7;
  min-width: 104px;
  text-align: center;
}
.timeline-range-label {
  margin-left: auto;
  color: #7d8287;
}
.timeline-duration-input {
  width: 45px;
  height: 25px;
  padding: 0 4px;
  border: 1px solid #3a3d41;
  border-radius: 5px;
  background: #202226;
  text-align: center;
  font:
    9px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.timeline-seconds {
  color: #747a80;
}
.timeline-rangebar button,
.timeline-rangebar input {
  touch-action: manipulation;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .timeline-rangebar {
    min-height: 39px;
    flex-basis: 39px;
    padding: 5px 8px;
    gap: 4px;
  }
  .range-jump,
  .duration-step,
  .timeline-duration-input {
    height: 29px;
  }
  .range-jump {
    min-width: 42px;
  }
  .timeline-range-readout {
    min-width: 0;
    font-size: 8px;
  }
  .timeline-range-label {
    margin-left: auto;
  }
}
@media (max-width: 480px) {
  .timeline-rangebar {
    gap: 3px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .range-jump {
    min-width: 37px;
    padding: 0 5px;
  }
  .timeline-range-readout {
    font-size: 7px;
  }
  .timeline-range-label {
    font-size: 7px;
  }
  .timeline-duration-input {
    width: 39px;
  }
  .duration-step {
    min-width: 27px;
    padding: 0 5px;
  }
  .timeline-seconds {
    display: none;
  }
}
@media (max-height: 500px) and (max-width: 1024px) {
  .timeline-rangebar {
    min-height: 32px;
    flex-basis: 32px;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  .range-jump,
  .duration-step,
  .timeline-duration-input {
    height: 25px;
  }
}

/* Compact Scene-mode object nudge pad: confined to viewport, never over editor panels. */
.scene-move-pad {
  position: absolute;
  z-index: 8;
  right: 10px;
  bottom: 39px;
  width: 151px;
  padding: 6px 7px;
  border: 1px solid #ffffff35;
  border-radius: 8px;
  background: #121417e8;
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 20px #0007;
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}
.scene-move-pad[hidden] {
  display: none !important;
}
.scene-move-head {
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d9dde0;
  font-size: 7px;
  letter-spacing: 0.06em;
}
.scene-move-head span {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scene-move-head small {
  font-size: 7px;
  color: #858b91;
  white-space: nowrap;
}
.scene-move-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 5px;
}
.scene-move-row button {
  height: 25px;
  border: 1px solid #444a50;
  border-radius: 5px;
  background: #262a2e;
  color: #eef0f2;
  font-size: 13px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.scene-move-row button:hover {
  background: #393e43;
  border-color: #69727a;
}
.scene-move-row span {
  text-align: center;
  color: #aab1b7;
  font-size: 8px;
  letter-spacing: 0.08em;
}
.scene-move-row.depth span {
  font-size: 7px;
  letter-spacing: 0.04em;
}
/* Timeline stack: every layer has a movable clip, trimmable edges and expandable tracks. */
.timeline-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.track-labels,
.timeline-grid {
  min-height: max-content;
}
.timeline-content {
  height: auto;
  min-height: 100%;
}
.timeline-layer-label {
  height: 29px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 5px;
  border-bottom: 1px solid #25272a;
  color: #a6abb0;
  font-size: 8px;
  cursor: pointer;
  min-width: 0;
}
.timeline-layer-label:hover {
  background: #202226;
}
.timeline-layer-label.selected {
  background: #282b2f;
  color: #eef0f2;
}
.timeline-layer-expand {
  width: 18px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #9ca2a8;
  padding: 0;
  font-size: 12px;
  touch-action: manipulation;
}
.timeline-layer-glyph {
  width: 13px;
  text-align: center;
  color: #c5cbd0;
}
.timeline-layer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.timeline-layer-type {
  color: #656b71;
  font-size: 7px;
}
.layer-span-track {
  height: 29px;
  position: relative;
  border-bottom: 1px solid #25272a;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(12.5% - 1px),
    #2a2c30 calc(12.5% - 1px),
    #2a2c30 12.5%
  );
}
.layer-span-track.selected {
  background-color: #202226;
}
.layer-span {
  position: absolute;
  top: 4px;
  height: 21px;
  min-width: 8px;
  border: 1px solid #7b858d;
  border-radius: 4px;
  background: linear-gradient(90deg, #555d64, #33383d);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
}
.layer-span.selected {
  border-color: #d6dde2;
  background: linear-gradient(90deg, #747e86, #454c52);
}
.layer-span:active {
  cursor: grabbing;
}
.layer-span-text {
  display: block;
  height: 100%;
  padding: 3px 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #edf0f2;
  font-size: 8px;
  pointer-events: none;
}
.layer-span-edge {
  position: absolute;
  z-index: 2;
  top: -1px;
  bottom: -1px;
  width: 15px;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: none;
  cursor: ew-resize;
}
.layer-span-edge:after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: #d5dce1;
  opacity: 0.8;
}
.layer-span-edge.start {
  left: -2px;
}
.layer-span-edge.start:after {
  left: 3px;
}
.layer-span-edge.end {
  right: -2px;
}
.layer-span-edge.end:after {
  right: 3px;
}
.layer-span-edge:hover:after {
  width: 3px;
  opacity: 1;
}
.timeline-layer-label .timeline-layer-name {
  max-width: 145px;
}
.tutorial-open-label {
  display: inline !important;
}
.tutorial-open-btn {
  width: auto !important;
  min-width: 78px;
  flex: 0 0 auto;
  justify-content: center;
  background: #24272b;
  border-color: #68717a;
  color: #f0f2f4;
  font-weight: 650;
}
.tutorial-open-btn:hover {
  background: #32373c;
  border-color: #a6afb7;
}
@media (max-width: 820px), (max-width: 1024px) and (max-height: 500px) {
  .scene-move-pad {
    right: 7px;
    bottom: 38px;
    width: 158px;
    padding: 7px;
    gap: 5px;
  }
  .scene-move-row {
    grid-template-columns: 44px 1fr 44px;
    gap: 6px;
  }
  .scene-move-row button {
    height: 34px;
    min-height: 34px;
    font-size: 16px;
  }
  .scene-move-head {
    height: 16px;
  }
  .timeline-layer-label {
    height: 31px;
    padding: 0 3px;
    gap: 3px;
    font-size: 8px;
  }
  .timeline-layer-expand {
    min-width: 22px;
    min-height: 27px;
    font-size: 14px;
  }
  .timeline-layer-name {
    max-width: 75px;
  }
  .timeline-layer-type {
    font-size: 6px;
  }
  .layer-span-track {
    height: 31px;
  }
  .layer-span {
    top: 4px;
    height: 23px;
  }
  .layer-span-edge {
    width: 19px;
  }
  .layer-span-text {
    font-size: 8px;
    padding-top: 4px;
  }
  .tutorial-open-btn {
    height: 32px;
    min-width: 73px;
    padding: 0 6px;
    gap: 5px;
  }
  .tutorial-open-label {
    font-size: 9px;
  }
  .help-icon {
    width: 15px;
    height: 15px;
  }
}
@media (max-width: 480px) {
  .tutorial-open-btn {
    min-width: 66px;
    padding: 0 4px;
    gap: 4px;
  }
  .tutorial-open-label {
    font-size: 8px;
  }
  .help-icon {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }
  .scene-move-pad {
    width: 150px;
  }
  .timeline-layer-name {
    max-width: 60px;
  }
  .timeline-layer-type {
    display: none;
  }
}
@media (max-height: 500px) and (max-width: 1024px) {
  .scene-move-pad {
    bottom: 34px;
    right: 5px;
    padding: 4px 6px;
    gap: 3px;
  }
  .scene-move-row button {
    height: 29px;
    min-height: 29px;
  }
  .scene-move-head {
    height: 13px;
  }
}
