:root {
  color-scheme: dark;
  --scene-width: 220px;
  --bg: #070407;
  --panel: #140a12;
  --panel-2: #1f101b;
  --panel-3: #2b1624;
  --line: #5a2c49;
  --line-soft: #351a2b;
  --text: #fff1fb;
  --muted: #be9aad;
  --accent: #ff4fc3;
  --accent-2: #ff9bdc;
  --hot: #ff2e88;
  --accent-rgb: 255, 79, 195;
  --accent-2-rgb: 255, 155, 220;
  --hot-rgb: 255, 46, 136;
  --warn: #ffca55;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button {
  color: inherit;
  font: inherit;
}

.app {
  position: relative;
  display: grid;
  grid-template-rows: 52px 1fr;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    radial-gradient(circle at 12% 0%, rgba(var(--accent-rgb), 0.12), transparent 26rem),
    var(--bg);
}

.app[data-theme="love"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    radial-gradient(circle at 12% 0%, rgba(var(--accent-rgb), 0.15), transparent 26rem),
    radial-gradient(circle at 82% 8%, rgba(255, 194, 233, 0.08), transparent 22rem),
    var(--bg);
}

.app[data-theme="energy"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    radial-gradient(circle at 12% 0%, rgba(85, 240, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 84% 4%, rgba(255, 216, 79, 0.08), transparent 21rem),
    var(--bg);
}

.app[data-theme="fight"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    radial-gradient(circle at 12% 0%, rgba(255, 77, 46, 0.14), transparent 26rem),
    radial-gradient(circle at 84% 4%, rgba(255, 177, 61, 0.08), transparent 21rem),
    var(--bg);
}

.app[data-theme="dream"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    radial-gradient(circle at 12% 0%, rgba(156, 247, 212, 0.13), transparent 26rem),
    radial-gradient(circle at 84% 4%, rgba(179, 136, 255, 0.09), transparent 21rem),
    var(--bg);
}

.chrome {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(13, 13, 12, 0.74);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.left-tools,
.project-tools,
.right-tools,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.left-tools {
  justify-self: start;
}

.project-tools {
  justify-self: center;
  min-width: 0;
}

.mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.7);
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 43%, rgba(var(--accent-rgb), 0.92) 43% 57%, transparent 57%),
    linear-gradient(0deg, transparent 43%, rgba(var(--accent-rgb), 0.92) 43% 57%, transparent 57%),
    #160911;
  color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.mark svg {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.mark:hover {
  border-color: rgba(var(--accent-2-rgb), 0.95);
  background:
    linear-gradient(90deg, transparent 43%, rgba(var(--accent-2-rgb), 0.95) 43% 57%, transparent 57%),
    linear-gradient(0deg, transparent 43%, rgba(var(--accent-2-rgb), 0.95) 43% 57%, transparent 57%),
    #1d0b17;
  box-shadow:
    0 0 0 4px rgba(var(--accent-rgb), 0.14),
    0 0 24px rgba(var(--accent-rgb), 0.22);
  transform: translateY(-1px);
}

.right-tools {
  justify-self: end;
  min-width: 0;
  max-width: 100%;
}

.toolbar {
  min-width: 0;
  overflow: hidden;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.theme-dock {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding-left: 8px;
  border-left: 1px solid var(--line-soft);
}

.project-title {
  width: min(300px, 30vw);
  min-width: 116px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.project-title:focus {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(255, 255, 255, 0.075);
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 241, 230, 0.28);
  background: rgba(255, 255, 255, 0.075);
}

.icon-button:active {
  transform: translateY(0);
}

.vn-toggle {
  display: grid;
  grid-template-columns: 14px auto;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.vn-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.vn-toggle:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.68);
  color: var(--accent-2);
  background: rgba(var(--accent-rgb), 0.09);
}

.theme-control {
  display: grid;
  align-items: center;
  height: 34px;
}

.theme-control select {
  width: 96px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  outline: none;
  cursor: pointer;
}

.theme-control select:focus {
  border-color: rgba(var(--accent-2-rgb), 0.76);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.individual-theme-toggle {
  min-width: 62px;
  padding-inline: 7px;
}

.project-size {
  display: grid;
  place-items: center;
  height: 34px;
  min-width: 64px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.icon-button.primary {
  border-color: rgba(var(--accent-rgb), 0.56);
  color: var(--accent);
}

.icon-button.danger {
  color: var(--hot);
}

.icon-button:disabled {
  opacity: 0.34;
  cursor: default;
  transform: none;
}

.chrome .icon-button::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  width: max-content;
  max-width: 150px;
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(12, 4, 10, 0.96);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  z-index: 40;
}

.chrome .icon-button:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mode-toggle.active {
  border-color: rgba(var(--accent-2-rgb), 0.64);
  color: var(--accent-2);
}

.stage {
  position: relative;
  min-height: 0;
}

.timeline-scroll {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 44px 40px 70px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-color: var(--accent) rgba(var(--accent-rgb), 0.09);
  scrollbar-width: thin;
}

.timeline-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.timeline-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
}

.timeline-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--line), var(--accent));
  background-clip: padding-box;
}

.timeline-track {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  min-height: 100%;
  padding-right: 42vw;
}

.timeline-bar {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 16px;
  width: calc(100% - 48px);
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  appearance: none;
  background: transparent;
  z-index: 14;
}

.timeline-bar::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
}

.timeline-bar::-webkit-slider-thumb {
  width: 72px;
  height: 12px;
  margin-top: -1px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, var(--line), var(--accent));
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.22);
}

.timeline-bar.disabled {
  opacity: 0;
  pointer-events: none;
}

.flex-mode .timeline-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 34px 34px 52px;
}

.flex-mode .timeline-track {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding-right: 0;
}

.start-node {
  position: relative;
  width: 32px;
  height: 160px;
  margin-right: 10px;
}

.start-node::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #0d0d0c;
  box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0.1);
  transform: translateY(-50%);
}

.scene-card,
.add-card {
  position: relative;
  width: clamp(150px, var(--scene-width), 380px);
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scene-card {
  cursor: grab;
}

.scene-card:active {
  cursor: grabbing;
}

.scene-card.drag-over {
  border-color: var(--accent-2);
}

.scene-card.active {
  border-color: rgba(var(--accent-rgb), 0.82);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.22),
    var(--shadow);
}

.empty-scene {
  display: grid;
  place-items: center;
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(var(--accent-rgb), 0.035);
}

.empty-scene-add {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 8px;
  background: rgba(12, 2, 10, 0.74);
  color: var(--accent);
  cursor: pointer;
}

.empty-scene-add:hover {
  border-color: var(--accent-2);
  background: rgba(var(--accent-rgb), 0.1);
}

.empty-scene-add svg {
  width: 28px;
  height: 28px;
}

.scene-name-input {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  z-index: 7;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: 0;
  background: rgba(7, 1, 6, 0.46);
  color: rgba(255, 241, 251, 0.74);
  font-size: 11px;
  line-height: 1;
  text-align: center;
}

.scene-name-input:focus {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(7, 1, 6, 0.78);
  color: var(--text);
}

.scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #050505;
}

.scene-controls {
  position: absolute;
  inset: 8px 8px auto 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 16;
}

.scene-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.scene-control {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(245, 241, 230, 0.16);
  border-radius: 7px;
  background: rgba(7, 7, 6, 0.68);
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.scene-control:hover,
.scene-control.active {
  border-color: rgba(var(--accent-rgb), 0.72);
  color: var(--accent);
}

.scene-control.remove:hover {
  border-color: rgba(255, 92, 122, 0.72);
  color: var(--hot);
}

.scene-control svg {
  width: 15px;
  height: 15px;
}

.touch-move {
  position: absolute;
  inset: auto 8px 8px auto;
  display: none;
  gap: 6px;
  z-index: 18;
}

.touch-move-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 8px;
  background: rgba(7, 7, 6, 0.74);
  color: var(--accent-2);
  backdrop-filter: blur(12px);
}

.touch-move-button svg {
  width: 18px;
  height: 18px;
}

.ios-shell .touch-move {
  display: flex;
}

.ios-shell .scene-name,
.ios-shell .scene-card:hover .scene-name {
  opacity: 1;
}

.ios-shell .empty-scene .scene-name-input {
  right: 86px;
}

.crop-presets {
  display: flex;
  gap: 5px;
  pointer-events: auto;
}

.crop-preset {
  color: var(--muted);
}

.scene-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  z-index: 4;
  overflow: hidden;
  color: rgba(245, 241, 230, 0.72);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.scene-badges {
  position: absolute;
  left: 9px;
  bottom: 8px;
  display: flex;
  gap: 5px;
  z-index: 5;
  pointer-events: none;
}

.scene-badge {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 7px;
  background: rgba(7, 4, 7, 0.7);
  color: var(--accent);
  backdrop-filter: blur(10px);
}

.scene-badge svg {
  width: 12px;
  height: 12px;
}

.conclusion-badge {
  color: var(--accent-2);
}

.media-badge {
  color: var(--muted);
}

.fit-badge {
  color: var(--warn);
}

.vn-badge {
  color: var(--accent-2);
}

.vn-preview {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 8;
  padding: 7px 9px;
  border: 1px solid var(--vn-border-color);
  border-radius: var(--vn-radius);
  background: var(--vn-box-color);
  color: var(--vn-text-color);
  font-family: var(--vn-font);
  font-size: max(10px, calc(var(--vn-font-size) * 0.46));
  line-height: 1.22;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.vn-preview.top {
  top: 8px;
  bottom: auto;
}

.vn-preview-name {
  margin-bottom: 3px;
  color: var(--vn-name-color);
  font-size: max(9px, calc(var(--vn-name-size) * 0.48));
  font-weight: 700;
}

.vn-preview-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap;
}

.scene-card:hover .scene-name {
  opacity: 1;
}

.add-card {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(var(--accent-rgb), 0.045);
  cursor: pointer;
}

.add-card svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.28));
}

.add-card:hover,
.add-card.drop-ready {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.09);
}

.connector {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 160px;
  flex: 0 0 auto;
}

.connector::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.connector-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #10100e;
  color: var(--accent);
  cursor: pointer;
  z-index: 2;
}

.connector-button svg {
  width: 13px;
  height: 13px;
}

.connector-button.has-transition {
  color: var(--accent-2);
  border-color: rgba(var(--accent-2-rgb), 0.62);
}

.connector-menu {
  position: absolute;
  top: calc(50% + 18px);
  left: 50%;
  display: none;
  grid-template-columns: repeat(4, 30px);
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(18, 18, 16, 0.94);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  z-index: 12;
}

.connector.open .connector-menu {
  display: grid;
}

.menu-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.menu-button:hover,
.menu-button.active {
  border-color: rgba(var(--accent-rgb), 0.58);
  color: var(--accent);
}

.menu-button svg {
  width: 15px;
  height: 15px;
}

.trim-editor {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 24px;
  z-index: 10;
}

.trim-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(245, 241, 230, 0.18);
}

.trim-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.trim-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 24px;
  border: 1px solid rgba(245, 241, 230, 0.24);
  border-radius: 5px;
  background: #12120f;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
}

.trim-handle::before {
  content: "";
  position: absolute;
  inset: 5px 5px;
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}

.crop-box {
  position: absolute;
  display: none;
  border: 1px solid var(--accent);
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(0, 0, 0, 0.6) inset;
  z-index: 9;
  pointer-events: auto;
  cursor: move;
}

.scene-card.crop-active .crop-box {
  display: block;
}

.crop-handle {
  position: absolute;
  border: 0;
  background: transparent;
  touch-action: none;
  z-index: 3;
}

.crop-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: #10100e;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08);
  transform: translate(-50%, -50%);
}

.crop-handle.nw,
.crop-handle.ne,
.crop-handle.se,
.crop-handle.sw {
  width: 28px;
  height: 28px;
  z-index: 4;
}

.crop-handle.nw,
.crop-handle.sw {
  left: -14px;
}

.crop-handle.ne {
  right: -14px;
}

.crop-handle.se {
  right: -14px;
}

.crop-handle.nw,
.crop-handle.ne {
  top: -14px;
}

.crop-handle.sw,
.crop-handle.se {
  bottom: -14px;
}

.crop-handle.w,
.crop-handle.e {
  top: -14px;
  bottom: -14px;
  width: 28px;
  z-index: 2;
}

.crop-handle.w {
  left: -14px;
}

.crop-handle.e {
  right: -14px;
}

.crop-handle.n,
.crop-handle.s {
  left: -14px;
  right: -14px;
  height: 28px;
  z-index: 2;
}

.crop-handle.n {
  top: -14px;
}

.crop-handle.s {
  bottom: -14px;
}

.crop-handle.nw,
.crop-handle.se {
  cursor: nwse-resize;
}

.crop-handle.ne,
.crop-handle.sw {
  cursor: nesw-resize;
}

.crop-handle.n,
.crop-handle.s {
  cursor: ns-resize;
}

.crop-handle.w,
.crop-handle.e {
  cursor: ew-resize;
}

.status {
  position: fixed;
  left: 50%;
  bottom: 48px;
  min-width: 0;
  max-width: min(520px, calc(100vw - 32px));
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 16, 14, 0.9);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  z-index: 30;
}

.status.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.inspector {
  position: fixed;
  right: 14px;
  bottom: 52px;
  width: min(340px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(14, 7, 12, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 22;
}

.inspector.empty {
  width: auto;
  padding: 8px;
}

.inspector-empty,
.inspector-add {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

.inspector-add {
  cursor: pointer;
}

.inspector svg {
  width: 16px;
  height: 16px;
}

.inspector-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inspector-thumb {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
}

.inspector-title,
.conclusion-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.task-button,
.small-button,
.wide-button {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
}

.task-button {
  height: 32px;
}

.task-button.active,
.wide-button.active,
.small-button:hover,
.wide-button:hover {
  border-color: rgba(var(--accent-rgb), 0.68);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.task-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.field input,
.field select,
.field textarea,
.vn-panel-head select,
.title-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(5, 2, 5, 0.68);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.field input,
.field select,
.vn-panel-head select,
.title-input {
  height: 30px;
}

.field input,
.field textarea,
.title-input {
  padding: 0 9px;
}

.field textarea {
  min-height: 58px;
  padding-top: 7px;
  resize: vertical;
  line-height: 1.28;
}

.field select {
  padding: 0 6px;
}

.field input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.angle-control {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.angle-dial {
  position: relative;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, #080208 0 42%, transparent 43%),
    conic-gradient(from -90deg, rgba(var(--accent-rgb), 0.88), rgba(var(--accent-2-rgb), 0.18), rgba(var(--accent-rgb), 0.88));
  color: var(--accent-2);
  cursor: grab;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.angle-dial:active {
  cursor: grabbing;
}

.angle-dial::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 241, 251, 0.16);
  border-radius: 50%;
  background: rgba(5, 2, 5, 0.76);
}

.angle-needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.66);
  transform: rotate(var(--angle)) translateX(5px);
  transform-origin: 0 50%;
}

.angle-number {
  min-width: 0;
}

.slider-drag-toggle {
  width: auto;
  min-width: 72px;
}

.wide-field,
.vn-panel .wide-field {
  grid-column: 1 / -1;
}

.media-panel {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 7px;
  margin-top: 10px;
}

.media-panel .mini-readout {
  align-self: end;
}

.vn-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.vn-panel-head {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 7px;
  grid-column: 1 / -1;
}

.check-field {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
}

.check-field input {
  position: absolute;
  opacity: 0;
}

.check-field span {
  display: grid;
  place-items: center;
}

.check-field:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.68);
  color: var(--accent-2);
  background: rgba(var(--accent-rgb), 0.09);
}

.task-complete-field {
  width: auto;
  min-width: 84px;
  justify-self: end;
  padding: 0 8px;
  font-size: 11px;
  text-transform: lowercase;
}

.conclusion-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.conclusion-row.drop-ready {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.08);
}

.small-button {
  width: 32px;
  height: 30px;
  padding: 0;
}

.small-button.danger {
  color: var(--hot);
}

.wizard {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(4, 1, 4, 0.56);
  z-index: 40;
}

.wizard.open {
  display: grid;
}

.wizard-panel {
  width: min(640px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), transparent 120px),
    #0d050c;
  box-shadow: var(--shadow);
}

.wizard-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.logo-button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.logo-button.active,
.logo-button:hover {
  border-color: rgba(var(--accent-rgb), 0.78);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-2);
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.target-pill {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.target-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.target-pill:hover,
.target-pill:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.76);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text);
}

.upscale-field {
  margin-top: 10px;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.wide-button {
  grid-auto-flow: column;
  gap: 8px;
  height: 36px;
  min-width: 96px;
  padding: 0 12px;
  color: var(--accent);
}

.wide-button svg {
  width: 16px;
  height: 16px;
}

.studio-launch {
  grid-column: span 2;
  height: 31px;
}

.mini-readout {
  display: grid;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
}

.pan-panel,
.crop-panel {
  width: min(980px, 100%);
}

.collage-panel {
  width: min(1080px, 100%);
}

.collage-panel.drop-ready {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1), var(--shadow);
}

.preview-panel {
  width: min(1120px, calc(100vw - 40px));
  overflow: hidden;
}

.preview-shell {
  display: grid;
  place-items: center;
  width: 100%;
  height: min(630px, calc((100vw - 40px) * 0.5625), calc(100vh - 126px));
  min-height: min(320px, calc(100vh - 126px));
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #050205;
}

.preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050205;
}

.preview-loading {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(var(--accent-rgb), 0.44);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.preview-loading svg {
  width: 22px;
  height: 22px;
}

.stories-panel {
  width: min(760px, 100%);
}

.stories-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.story-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px 34px 34px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.story-play {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--accent-rgb), 0.44);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent-2);
  cursor: pointer;
}

.story-play svg {
  width: 20px;
  height: 20px;
}

.story-meta {
  min-width: 0;
}

.story-title {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-sub {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-empty {
  display: grid;
  grid-auto-flow: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 92px;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.story-empty svg {
  width: 18px;
  height: 18px;
}

.story-preview-panel .preview-shell {
  height: min(720px, calc(100vh - 126px));
}

.story-import-button {
  width: auto;
  min-width: 96px;
}

.story-editor-panel {
  width: min(620px, calc(100vw - 32px));
}

.story-editor-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.story-editor-body .wide-field,
.story-editor-body .story-empty,
.story-check {
  grid-column: 1 / -1;
}

.story-editor-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ios-shell .story-preview-panel,
.breeder-ios-native .story-preview-panel {
  width: 100vw;
  height: 100svh;
  max-height: none;
  border: 0;
  border-radius: 0;
}

.ios-shell .story-preview-panel .preview-shell,
.breeder-ios-native .story-preview-panel .preview-shell {
  height: calc(100svh - 58px - env(safe-area-inset-top));
  min-height: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.ios-shell {
  grid-template-rows: calc(56px + env(safe-area-inset-top)) 1fr;
}

.ios-shell .chrome {
  padding-top: calc(10px + env(safe-area-inset-top));
}

.ios-shell .timeline-scroll {
  -webkit-overflow-scrolling: touch;
}

.ios-shell .scene-card,
.ios-shell .add-card,
.ios-shell .connector-button,
.ios-shell .icon-button,
.ios-shell .wide-button,
.ios-shell .story-play {
  touch-action: manipulation;
}

.collage-choice-panel {
  width: min(430px, 100%);
}

.randomizer-panel {
  width: min(520px, 100%);
}

.randomizer-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.randomizer-copy,
.randomizer-readout {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.randomizer-progress {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.randomizer-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.32);
  transition: width 180ms ease;
}

.randomizer-export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.collage-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.choice-button {
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 112px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.choice-button.primary-choice,
.choice-button:hover {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent-2);
}

.choice-button svg {
  width: 26px;
  height: 26px;
}

.studio-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

.studio-title svg {
  width: 17px;
  height: 17px;
}

.studio-stage {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #050205;
  overflow: hidden;
}

.studio-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050205;
}

.studio-crop-box {
  position: absolute;
  border: 1px solid var(--accent);
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(0, 0, 0, 0.6) inset;
  z-index: 3;
  cursor: move;
}

.studio-timeline {
  position: relative;
  margin-top: 12px;
  padding-bottom: 18px;
}

.studio-time {
  width: 100%;
  accent-color: var(--accent);
}

.key-track {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 1px;
  height: 14px;
  pointer-events: none;
}

.key-dot {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.68);
  border-radius: 50%;
  background: #120812;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
}

.key-dot.active {
  background: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.48);
}

.studio-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.crop-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.collage-toolbar {
  display: grid;
  grid-template-columns: minmax(92px, auto) repeat(4, 34px) minmax(130px, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 12px;
}

.collage-zoom {
  min-width: 130px;
}

.collage-viewport {
  height: min(520px, calc(100vh - 260px));
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(rgba(var(--accent-rgb), 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.055) 1px, transparent 1px),
    #050205;
  background-size: 36px 36px;
  overflow: auto;
}

.collage-board {
  position: relative;
  width: 2200px;
  height: 1240px;
  transform-origin: 0 0;
}

.collage-frame {
  position: absolute;
  left: 560px;
  top: 280px;
  width: 1080px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed rgba(var(--accent-2-rgb), 0.52);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.035);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.10);
}

.collage-base,
.collage-base img,
.collage-base video {
  width: 100%;
  height: 100%;
}

.collage-base img,
.collage-base video {
  display: block;
  object-fit: cover;
}

.collage-layer {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
  cursor: move;
}

.collage-layer.selected {
  border-color: var(--accent-2);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.26),
    0 12px 36px rgba(0, 0, 0, 0.34);
}

.collage-media,
.collage-media img,
.collage-media video {
  width: 100%;
  height: 100%;
}

.collage-media img,
.collage-media video {
  display: block;
  object-fit: cover;
}

.collage-media .contain {
  object-fit: contain;
  background: #050205;
}

.collage-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: rgba(8, 2, 8, 0.84);
  cursor: nwse-resize;
}

.collage-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 90px;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
}

.file-picker,
.video-pool {
  display: none;
}

.drag-shield {
  outline: 1px solid rgba(var(--accent-rgb), 0.46);
  outline-offset: -7px;
}

@media (max-width: 720px) {
  .chrome {
    grid-template-columns: auto minmax(84px, 1fr) auto;
    gap: 6px;
    padding: 9px 8px;
  }

  .left-tools,
  .project-tools,
  .right-tools,
  .toolbar {
    gap: 5px;
  }

  .mark,
  .project-size {
    display: none;
  }

  .mark.add-frame-button {
    display: grid;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .project-title {
    width: min(168px, 26vw);
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .vn-toggle {
    height: 30px;
    padding: 0 7px;
  }

  .theme-dock {
    gap: 4px;
    padding-left: 5px;
  }

  .theme-control,
  .theme-control select {
    height: 30px;
  }

  .theme-control select {
    width: 82px;
    padding: 0 6px;
  }

  .individual-theme-toggle {
    min-width: 52px;
  }

  .timeline-scroll {
    padding: 28px 18px 58px;
  }

  .scene-card,
  .add-card {
    width: clamp(150px, var(--scene-width), 82vw);
  }

  .connector {
    width: 48px;
  }

  .inspector {
    left: 12px;
    right: 12px;
    bottom: 46px;
    width: auto;
  }

  .logo-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .preview-panel,
  .story-preview-panel {
    width: 100vw;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .preview-panel .preview-shell,
  .story-preview-panel .preview-shell {
    height: calc(100svh - 58px);
    min-height: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }

  .story-editor-body {
    grid-template-columns: 1fr;
  }

  .story-card {
    grid-template-columns: 40px minmax(0, 1fr) 32px 32px;
  }

  .story-card [data-story-action="share"] {
    display: none;
  }
}
