:root {
  --bg: #0D0F11;
  --bg-deep: #090B0C;
  --surface: rgba(21, 24, 27, .94);
  --surface-solid: #16191C;
  --surface-raised: #202428;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --text: #F4F5F3;
  --muted: #A7ADB1;
  --dim: #737B80;
  --accent: #79DCC9;
  --accent-ink: #06231D;
  --accent-soft: rgba(121, 220, 201, .13);
  --image: #E5B878;
  --video: #8FD9CE;
  --audio: #C8A9F3;
  --violet: #A896F0;
  --danger: #EC8D8D;
  --nav-h: 54px;
  --dock-h: 310px;
  --dock-collapsed-h: 52px;
  --sans: "IBM Plex Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Fraunces, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 13, .92);
  backdrop-filter: blur(22px) saturate(1.15);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--dim);
  font: 500 13.5px var(--sans);
  text-decoration: none;
  transition: color .15s, background .15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface-raised);
  color: var(--text);
}

.nav .brand {
  letter-spacing: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.save-state {
  color: var(--dim);
  font: 500 10px/1 var(--mono);
}

.save-state.saving {
  color: var(--image);
}

.save-state.error {
  color: var(--danger);
}

.icon-btn,
.primary-btn,
.secondary-btn,
.danger-btn,
.zoom-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}

.icon-btn {
  width: 40px;
  padding: 0;
}

.icon-btn:hover,
.secondary-btn:hover,
.zoom-value:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.primary-btn {
  gap: 7px;
  padding: 0 15px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.primary-btn:hover {
  background: #95E6D6;
  transform: translateY(-1px);
}

.primary-btn:disabled {
  cursor: default;
  opacity: .42;
  transform: none;
}

.secondary-btn,
.danger-btn {
  padding: 0 15px;
}

.danger-btn {
  border-color: rgba(236, 141, 141, .35);
  color: var(--danger);
}

.icon-btn svg,
.primary-btn svg,
.secondary-btn svg,
.danger-btn svg,
.segmented svg,
.search-box svg,
.board-empty svg,
.mix-launch svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.board-viewport {
  position: fixed;
  inset: var(--nav-h) 0 var(--dock-h);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background-color: #101315;
  background-image:
    radial-gradient(circle at 50% -20%, rgba(121, 220, 201, .08), transparent 42%),
    radial-gradient(rgba(225, 230, 229, .13) .8px, transparent .8px);
  background-size: auto, 24px 24px;
  background-position: center, 0 0;
  transition: bottom .2s ease;
}

.board-viewport::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(to bottom, rgba(9, 11, 12, .32), transparent 180px);
  content: "";
  pointer-events: none;
}

.board-viewport.panning {
  cursor: grabbing;
}

.board-tools {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 24, 27, .9);
  backdrop-filter: blur(16px);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 232px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 24, 27, .9);
  color: var(--dim);
  backdrop-filter: blur(16px);
}

.scope-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 24, 27, .9);
  color: var(--muted);
  cursor: pointer;
  font: 500 10px/1 var(--mono);
  backdrop-filter: blur(16px);
}

.scope-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.scope-toggle svg {
  width: 15px;
  height: 15px;
}

.search-box:focus-within {
  border-color: rgba(121, 220, 201, .45);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 11px var(--mono);
}

.search-box input::placeholder {
  color: var(--dim);
}

.search-box svg {
  flex: 0 0 auto;
}

.board-tools > .icon-btn {
  min-height: 42px;
  width: 42px;
  background: rgba(21, 24, 27, .9);
  backdrop-filter: blur(16px);
}

.board-tools > .drop-guide-toggle[aria-expanded="true"] {
  border-color: rgba(121, 220, 201, .48);
  background: var(--accent-soft);
  color: var(--accent);
}

.board-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
  color: #7D8589;
  font: 500 10px/1 var(--mono);
}

.board-hint svg {
  width: 14px;
  height: 14px;
}

.hint-dot {
  color: #4F575B;
}

.drop-guide {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 48;
  width: min(390px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(17, 20, 22, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  backdrop-filter: blur(22px);
}

.drop-guide > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 15px 12px;
  border-bottom: 1px solid var(--line);
}

.drop-guide > header > span {
  display: grid;
  gap: 3px;
}

.drop-guide > header strong {
  color: var(--text);
  font-size: 13px;
}

.drop-guide > header small {
  color: var(--dim);
  font-size: 10px;
}

.drop-guide > header .icon-btn {
  width: 30px;
  min-height: 30px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
}

.drop-guide-rules {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.drop-rule {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
}

.drop-rule > svg {
  width: 17px;
  height: 17px;
  justify-self: center;
}

.drop-rule > span {
  display: grid;
  gap: 2px;
}

.drop-rule strong {
  color: var(--text);
  font-size: 10.5px;
}

.drop-rule small {
  color: var(--dim);
  font-size: 9px;
}

.image-rule > svg { color: var(--image); }
.video-rule > svg { color: var(--video); }
.audio-rule > svg { color: var(--audio); }

.drop-guide > footer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 9px/1.35 var(--mono);
}

.drop-guide > footer svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--accent);
}

.drag-coach {
  position: absolute;
  right: 50%;
  bottom: 18px;
  z-index: 54;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(620px, calc(100vw - 36px));
  padding: 10px 13px 10px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(10, 12, 13, .94);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .42);
  transform: translateX(50%);
  backdrop-filter: blur(18px);
  pointer-events: none;
}

.drag-coach-kind {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--card-accent, var(--accent-soft));
  color: var(--text);
  font: 700 9px/1 var(--mono);
  text-transform: uppercase;
}

.drag-coach strong {
  overflow: hidden;
  color: var(--muted);
  font: 500 10px/1.3 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drag-coach.image { --card-accent: rgba(229, 184, 120, .2); }
.drag-coach.video { --card-accent: rgba(143, 217, 206, .18); }
.drag-coach.audio { --card-accent: rgba(200, 169, 243, .19); }

.board-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 12000px;
  height: 12000px;
  transform-origin: 0 0;
  will-change: transform;
}

.lane-guides {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.stage-lane {
  position: absolute;
  top: 320px;
  width: 318px;
  height: 3350px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.image-lane {
  left: 164px;
}

.video-lane {
  left: 514px;
}

.audio-lane {
  left: 864px;
}

.board-world.archive-view .lane-guides {
  display: none;
}

.lane-heading {
  position: absolute;
  top: -18px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 9px 0 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(17, 20, 22, .92);
  color: var(--muted);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(14px);
}

.lane-heading:hover,
.lane-heading.active {
  border-color: var(--line-strong);
  background: rgba(29, 34, 36, .96);
  color: var(--text);
}

.lane-heading.active {
  box-shadow: inset 2px 0 var(--card-accent, var(--accent)), 0 8px 24px rgba(0, 0, 0, .2);
}

.lane-index {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .045);
  color: var(--card-accent, var(--dim));
  font: 600 8px/1 var(--mono);
}

.lane-heading strong {
  font-size: 11px;
  font-weight: 600;
}

.lane-count {
  min-width: 20px;
  color: var(--dim);
  font: 600 9px/1 var(--mono);
  text-align: right;
}

.mix-launch.active {
  color: var(--text);
}

.image-lane { --card-accent: var(--image); }
.video-lane { --card-accent: var(--video); }
.audio-lane { --card-accent: var(--audio); }

.lane-drop-action {
  position: absolute;
  top: 34px;
  right: 8px;
  left: 8px;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px dashed color-mix(in srgb, var(--card-accent) 58%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-accent) 8%, transparent);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .15s, transform .15s;
}

.lane-drop-action b {
  color: var(--text);
  font-size: 10px;
}

.lane-drop-action small {
  color: var(--muted);
  font-size: 8.5px;
}

.stage-lane.drop-eligible {
  border-color: color-mix(in srgb, var(--card-accent) 58%, transparent);
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--card-accent) 8%, transparent),
    transparent 720px);
}

.stage-lane.drop-eligible .lane-drop-action {
  opacity: 1;
  transform: none;
}

.stage-lane.drop-hover {
  border-color: var(--card-accent);
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--card-accent) 14%, transparent),
    transparent 840px);
}

.lane-heading.drop-eligible,
.mix-launch.drop-eligible {
  border-color: rgba(121, 220, 201, .38);
  background: rgba(121, 220, 201, .09);
  box-shadow: inset 0 0 0 1px rgba(121, 220, 201, .1), 0 8px 24px rgba(0, 0, 0, .2);
}

.lane-heading.drop-hover,
.mix-launch.drop-hover {
  border-color: var(--accent);
  background: rgba(121, 220, 201, .16);
  box-shadow: inset 0 0 0 2px rgba(121, 220, 201, .24), 0 0 34px rgba(121, 220, 201, .1);
}

.connections {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.connection-shadow,
.connection-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.connection-line.audio-connection {
  stroke: var(--audio);
  stroke-dasharray: 2 4;
}

.connection-shadow {
  stroke: rgba(0, 0, 0, .66);
  stroke-width: 7;
}

.connection-line {
  stroke: var(--accent);
  stroke-width: 2;
  opacity: .76;
  stroke-dasharray: 5 4;
}

.node-layer {
  position: absolute;
  inset: 0;
}

.media-node {
  --card-accent: var(--accent);
  position: absolute;
  width: 248px;
  height: 276px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #141719;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .32);
  cursor: grab;
  user-select: none;
  touch-action: none;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 248px 276px;
  transition: border-color .15s, box-shadow .15s, filter .15s;
}

.media-node.image-node {
  --card-accent: var(--image);
}

.media-node.video-node {
  --card-accent: var(--video);
}

.media-node.audio-node {
  --card-accent: var(--audio);
}

.media-node:hover {
  border-color: rgba(255, 255, 255, .3);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .4);
}

.media-node.selected {
  border-color: var(--card-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-accent) 18%, transparent), 0 24px 60px rgba(0, 0, 0, .43);
  z-index: 3;
}

.media-node.approved {
  border-color: rgba(134, 210, 167, .45);
}

.media-node.approved::after {
  position: absolute;
  top: 10px;
  right: 42px;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(154, 225, 184, .35);
  border-radius: 999px;
  background: rgba(13, 35, 24, .86);
  color: #9AE1B8;
  content: "✓";
  font: 700 11px/1 var(--sans);
  pointer-events: none;
}

.media-node.dragging {
  z-index: 20;
  cursor: grabbing;
  filter: brightness(1.04);
  box-shadow: 0 28px 72px rgba(0, 0, 0, .52);
  will-change: transform;
}

.media-node.drop-candidate {
  border-color: rgba(200, 169, 243, .54);
  box-shadow: 0 0 0 2px rgba(200, 169, 243, .13), 0 22px 58px rgba(0, 0, 0, .4);
}

.media-node.drop-hover {
  border-color: var(--audio);
  box-shadow: 0 0 0 4px rgba(200, 169, 243, .22), 0 26px 66px rgba(0, 0, 0, .5);
}

body.media-dragging .board-viewport,
body.media-dragging .media-node {
  cursor: grabbing;
}

.node-media {
  position: absolute;
  inset: 0 0 auto;
  display: block;
  width: 100%;
  height: 142px;
  overflow: hidden;
  background: var(--bg-deep);
}

.node-media img,
.node-media video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-deep);
}

.node-media video {
  cursor: pointer;
}

.audio-preview {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: 42px 12px 12px;
  background:
    radial-gradient(circle at 50% 35%, rgba(200, 169, 243, .22), transparent 42%),
    linear-gradient(145deg, #171521, #111518 70%);
}

.audio-kind-icon {
  position: absolute;
  top: 45px;
  left: calc(50% - 22px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(200, 169, 243, .3);
  border-radius: 14px;
  background: rgba(200, 169, 243, .09);
  color: var(--audio);
}

.audio-kind-icon svg {
  width: 20px;
  height: 20px;
}

.audio-preview audio {
  position: relative;
  z-index: 4;
  display: block;
  width: 100%;
  height: 30px;
  filter: invert(.9) hue-rotate(150deg) saturate(.55);
}

.node-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(6, 7, 8, .68), transparent 38%, transparent 68%, rgba(6, 7, 8, .42));
}

.node-head {
  position: absolute;
  inset: 9px 9px auto;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  pointer-events: none;
}

.node-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 7px;
  background: rgba(8, 10, 11, .7);
  color: #FFF;
  backdrop-filter: blur(8px);
}

.node-kind svg {
  width: 13px;
  height: 13px;
}

.node-label {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .9);
  font: 500 9px/1.2 var(--mono);
  text-overflow: ellipsis;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .86);
  white-space: nowrap;
}

.node-enhanced {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--image);
}

.node-enhanced svg {
  width: 13px;
  height: 13px;
}

.node-drag,
.node-more {
  display: inline-flex;
  margin-left: auto;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: rgba(8, 10, 11, .56);
  color: rgba(255, 255, 255, .62);
  backdrop-filter: blur(8px);
}

.node-drag svg,
.node-more svg {
  width: 14px;
  height: 14px;
}

.node-more {
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  cursor: pointer;
  pointer-events: auto;
}

.node-more:hover,
.node-more:focus-visible {
  background: rgba(12, 15, 16, .9);
  color: #FFF;
}

.board-viewport.panning .media-node {
  pointer-events: none;
}

.node-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(121, 220, 201, .15), transparent 48%), var(--bg-deep);
  color: var(--muted);
  text-align: center;
}

.node-state > span {
  display: grid;
  justify-items: center;
  gap: 9px;
  font: 500 10px/1.3 var(--mono);
  text-transform: uppercase;
}

.node-state svg {
  width: 23px;
  height: 23px;
  color: var(--accent);
}

.node-state.generating svg,
.node-progress svg {
  animation: spin 1.2s linear infinite;
}

.node-state.failed,
.node-state.failed svg {
  color: var(--danger);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.node-details {
  position: absolute;
  inset: 142px 0 auto;
  height: 75px;
  padding: 11px 12px 8px;
}

.node-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.node-stage {
  color: var(--card-accent);
  font: 600 9px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.node-status {
  position: relative;
  padding-left: 10px;
  color: var(--dim);
  font: 500 9px/1 var(--mono);
}

.node-status::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.node-status.ready {
  color: #86D2A7;
}

.node-status.active {
  color: var(--accent);
}

.node-status.failed {
  color: var(--danger);
}

.node-prompt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #C7CCCF;
  font-size: 11.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.node-actions {
  position: absolute;
  right: 9px;
  bottom: 9px;
  left: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 42px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.node-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s, color .14s;
}

.node-actions svg {
  width: 14px;
  height: 14px;
}

.node-actions .node-primary {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 10px;
  background: color-mix(in srgb, var(--card-accent) 16%, transparent);
  color: var(--card-accent);
  font-size: 11px;
  font-weight: 650;
}

.node-actions .node-primary:hover {
  background: color-mix(in srgb, var(--card-accent) 25%, transparent);
}

.node-actions .node-primary.in-cut {
  color: #9AE1B8;
}

.node-actions .node-secondary {
  width: 34px;
  flex: 0 0 34px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
}

.node-actions .node-secondary:hover {
  background: rgba(255, 255, 255, .09);
  color: var(--text);
}

.node-actions .node-secondary.approve {
  color: #9AE1B8;
}

.node-actions .node-reject {
  flex: 0 0 auto;
  padding: 0 8px;
  background: transparent;
  color: #858B8F;
  font-size: 10px;
}

.node-actions .node-reject:hover {
  background: rgba(236, 141, 141, .09);
  color: var(--danger);
}

.node-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 34px;
  flex: 1 1 auto;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.line-port {
  position: absolute;
  top: calc(50% - 6px);
  z-index: 4;
  width: 12px;
  height: 12px;
  border: 3px solid #101315;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(121, 220, 201, .5);
  pointer-events: none;
}

.line-port.in {
  left: -7px;
}

.line-port.out {
  right: -7px;
}

.trim-editor {
  position: absolute;
  right: 9px;
  bottom: 142px;
  left: 9px;
  z-index: 6;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 7px;
  background: rgba(8, 10, 11, .84);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(11px);
  transition: opacity .14s;
}

.media-node.selected.video-node .trim-editor {
  opacity: 1;
  pointer-events: auto;
}

.trim-track {
  position: absolute;
  inset: 4px;
  overflow: hidden;
  border-radius: 4px;
  background-color: #2B2D31;
  background-position: center;
  background-size: cover;
}

.trim-dim {
  position: absolute;
  inset-block: 0;
  background: rgba(5, 6, 7, .68);
  pointer-events: none;
}

.trim-dim.left { left: 0; }
.trim-dim.right { right: 0; }

.trim-range {
  position: absolute;
  inset-block: 0;
  border-top: 2px solid var(--image);
  border-bottom: 2px solid var(--image);
  pointer-events: none;
}

.trim-handle {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 11px;
  border: 0;
  border-radius: 3px;
  background: var(--image);
  cursor: ew-resize;
  transform: translateX(-50%);
}

.trim-handle::after {
  position: absolute;
  top: 9px;
  left: 4px;
  width: 3px;
  height: 9px;
  border-right: 1px solid rgba(30, 30, 30, .7);
  border-left: 1px solid rgba(30, 30, 30, .7);
  content: "";
}

.trim-time {
  position: absolute;
  top: -18px;
  right: 0;
  color: rgba(255, 255, 255, .84);
  font: 500 9px/1 var(--mono);
  text-shadow: 0 1px 4px #000;
}

.zoom-tools {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 24, 27, .9);
  backdrop-filter: blur(16px);
}

.zoom-tools .icon-btn {
  width: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
}

.zoom-value {
  min-width: 54px;
  min-height: 32px;
  border: 0;
  background: transparent;
  font: 500 10px/1 var(--mono);
}

.board-empty {
  position: absolute;
  inset: 150px 0 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 11px;
  color: var(--muted);
  text-align: center;
}

.board-empty > svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.board-empty strong {
  color: var(--text);
  font: 600 20px/1.2 var(--serif);
}

.board-empty small {
  max-width: 360px;
  margin-bottom: 8px;
  color: var(--dim);
}

.edit-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  height: var(--dock-h);
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(13, 15, 17, .97);
  box-shadow: 0 -18px 56px rgba(0, 0, 0, .28);
  backdrop-filter: blur(22px);
  overflow: hidden;
  transition: height .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.edit-dock.collapsed {
  height: var(--dock-collapsed-h);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .2);
}

.edit-dock.collapsed .timeline-shell {
  display: none;
}

body.edit-collapsed .board-viewport {
  bottom: var(--dock-collapsed-h);
}

.edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.edit-head::-webkit-scrollbar {
  display: none;
}

.edit-dock.collapsed .edit-head {
  height: var(--dock-collapsed-h);
  border-bottom-color: transparent;
}

.edit-dock.collapsed .edit-selection,
.edit-dock.collapsed .edit-actions {
  display: none;
}

.edit-title,
.edit-selection,
.edit-actions {
  flex: 0 0 auto;
}

.edit-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
}

.editor-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  cursor: pointer;
}

.editor-toggle:hover,
.editor-toggle:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.editor-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform .18s ease;
}

.editor-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.editor-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(121, 220, 201, .2);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.editor-mark svg {
  width: 15px;
  height: 15px;
}

.edit-title-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.edit-title-copy strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.1;
}

.edit-title-copy small {
  overflow: hidden;
  max-width: 230px;
  color: var(--dim);
  font: 500 9px/1.2 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-selection {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-right: auto;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.edit-selection > strong {
  min-width: 52px;
  color: var(--muted);
  font: 600 9px/1 var(--mono);
  text-transform: uppercase;
}

.edit-field {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--dim);
  font: 600 8px/1 var(--mono);
  text-transform: uppercase;
}

.edit-field input {
  width: 55px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 10px/1 var(--mono);
}

.edit-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.edit-tool:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.edit-tool.danger:hover:not(:disabled) {
  border-color: rgba(236, 141, 141, .25);
  background: rgba(236, 141, 141, .09);
  color: var(--danger);
}

.edit-tool:disabled {
  opacity: .4;
  cursor: default;
}

.edit-tool svg {
  width: 13px;
  height: 13px;
}

.mix-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 24, 27, .9);
  color: var(--muted);
  cursor: pointer;
  font: 500 11px/1 var(--sans);
  backdrop-filter: blur(16px);
  transition: border-color .15s, background .15s, color .15s;
}

.mix-launch:hover,
.mix-launch[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.mix-launch > svg:first-child {
  color: var(--accent);
}

.clip-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .065);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
}

.edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-actions .icon-btn {
  min-height: 38px;
  width: 38px;
}

.publish-btn {
  gap: 7px;
  min-height: 40px;
  color: var(--text);
}

.publish-btn svg {
  width: 16px;
  height: 16px;
}

.export-btn {
  min-height: 40px;
}

.export-btn.rendering svg {
  animation: spin 1.2s linear infinite;
}

.timeline-shell {
  position: relative;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr) minmax(0, 1fr);
  height: calc(var(--dock-h) - 58px);
  overflow: hidden;
}

.timeline-transport {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 10, .62);
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border-right: 1px solid var(--line);
}

.timeline-play {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(121, 220, 201, .24);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.timeline-play:hover:not(:disabled),
.timeline-play:focus-visible {
  border-color: rgba(121, 220, 201, .5);
  background: rgba(121, 220, 201, .2);
}

.timeline-play:disabled {
  opacity: .35;
  cursor: default;
}

.timeline-play svg {
  width: 12px;
  height: 12px;
}

.timeline-time {
  overflow: hidden;
  min-width: 0;
  color: var(--muted);
  font: 500 7px/1 var(--mono);
  white-space: nowrap;
}

.timeline-ruler {
  position: relative;
  min-width: 0;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.timeline-ruler::before {
  position: absolute;
  right: 14px;
  bottom: 6px;
  left: 14px;
  height: 1px;
  background: rgba(255, 255, 255, .13);
  content: "";
}

.timeline-ruler:focus-visible {
  outline-offset: -2px;
}

.timeline-ruler-ticks {
  position: absolute;
  inset: 0 14px;
  pointer-events: none;
}

.timeline-ruler-ticks span {
  position: absolute;
  bottom: 6px;
  width: 1px;
  height: 6px;
  background: rgba(255, 255, 255, .2);
  transform: translateX(-.5px);
}

.timeline-ruler-ticks span::after {
  position: absolute;
  bottom: 8px;
  left: 0;
  color: var(--dim);
  content: attr(data-label);
  font: 500 7px/1 var(--mono);
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-ruler-ticks span:first-child::after {
  transform: none;
}

.timeline-ruler-ticks span:last-child::after {
  transform: translateX(-100%);
}

.timeline-progress {
  position: absolute;
  bottom: 5px;
  left: 14px;
  width: 0;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  opacity: .38;
  pointer-events: none;
}

.timeline-playhead {
  position: absolute;
  top: 3px;
  left: 14px;
  width: 2px;
  height: calc(var(--dock-h) - 68px);
  background: var(--accent);
  box-shadow: 0 0 12px rgba(121, 220, 201, .4);
  pointer-events: none;
  transform: translateX(-1px);
}

.timeline-playhead::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 3px 3px 5px 5px;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  content: "";
  transform: translateX(-50%);
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.timeline-track:last-child {
  border-bottom: 0;
}

.timeline-track.drop-eligible {
  background: color-mix(in srgb, var(--drop-color, var(--accent)) 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--drop-color, var(--accent)) 24%, transparent);
}

.timeline-track.drop-hover {
  background: color-mix(in srgb, var(--drop-color, var(--accent)) 12%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--drop-color, var(--accent)) 52%, transparent);
}

.picture-track { --drop-color: var(--video); }
.audio-track { --drop-color: var(--audio); }

.track-label {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  color: var(--dim);
  font: 600 8px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.track-label svg {
  width: 16px;
  height: 16px;
}

.picture-track .track-label svg {
  color: var(--video);
}

.audio-track .track-label svg {
  color: var(--audio);
}

.timeline-list {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  height: 100%;
  padding: 11px 20px;
  overflow-x: auto;
  overflow-y: hidden;
}

.timeline-clip {
  position: relative;
  width: 126px;
  height: 76px;
  flex: 0 0 auto;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--bg-deep);
  cursor: grab;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}

.timeline-clip:hover {
  border-color: rgba(143, 217, 206, .48);
}

.timeline-clip.selected {
  border-color: var(--video);
  box-shadow: 0 0 0 3px rgba(143, 217, 206, .16);
  transform: translateY(-2px);
}

.timeline-clip.playhead-active {
  border-color: rgba(121, 220, 201, .72);
}

.timeline-clip.playing {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(121, 220, 201, .22);
}

.timeline-clip.drop-candidate {
  border-color: rgba(200, 169, 243, .52);
  box-shadow: 0 0 0 2px rgba(200, 169, 243, .12);
}

.timeline-clip.drop-hover {
  border-color: var(--audio);
  box-shadow: 0 0 0 4px rgba(200, 169, 243, .22);
}

.timeline-clip:not(:last-child)::after {
  position: absolute;
  top: 37px;
  right: -17px;
  width: 16px;
  height: 2px;
  background: rgba(121, 220, 201, .45);
  content: "";
}

.timeline-clip.sortable-ghost {
  opacity: .25;
}

.timeline-clip.sortable-chosen {
  border-color: var(--accent);
  cursor: grabbing;
}

.timeline-clip img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.timeline-index {
  position: absolute;
  top: -8px;
  left: -8px;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  border: 2px solid #0D0F11;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 9px/1 var(--mono);
}

.timeline-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(8, 9, 10, .8);
  color: #FFF;
  font: 500 9px/1 var(--mono);
}

.timeline-trim {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(8, 9, 10, .8);
  color: rgba(255, 255, 255, .68);
  font: 500 8px/1 var(--mono);
}

.track-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  height: 46px;
  margin: auto 0;
  padding: 0 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--dim);
  font-size: 10px;
}

.track-empty svg {
  width: 15px;
  height: 15px;
}

.picture-track .track-empty svg {
  color: var(--video);
}

.audio-track .track-empty svg {
  color: var(--audio);
}

.timeline-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(8, 9, 10, .8);
  color: #FFF;
  cursor: pointer;
  opacity: 0;
}

.timeline-clip:hover .timeline-remove,
.timeline-clip:focus-within .timeline-remove {
  opacity: 1;
}

.timeline-remove svg {
  width: 13px;
  height: 13px;
}

.soundtrack-list {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
  padding: 10px 20px;
  overflow-x: auto;
  overflow-y: hidden;
}

.soundtrack-item {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 44px 104px 70px 88px 30px;
  align-items: center;
  gap: 8px;
  min-width: 472px;
  height: 82px;
  flex: 0 0 auto;
  padding: 8px 9px;
  border: 1px solid rgba(200, 169, 243, .24);
  border-radius: 11px;
  background: rgba(200, 169, 243, .055);
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background .14s;
}

.soundtrack-item:hover {
  border-color: rgba(200, 169, 243, .42);
  background: rgba(200, 169, 243, .08);
}

.soundtrack-item.selected {
  border-color: var(--audio);
  background: rgba(200, 169, 243, .1);
  box-shadow: 0 0 0 3px rgba(200, 169, 243, .13);
}

.soundtrack-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.soundtrack-identity > span:last-child {
  display: grid;
  min-width: 0;
}

.soundtrack-identity strong,
.soundtrack-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soundtrack-identity strong {
  color: var(--text);
  font-size: 10px;
}

.soundtrack-identity small {
  color: var(--dim);
  font-size: 8px;
}

.soundtrack-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid rgba(200, 169, 243, .25);
  border-radius: 9px;
  color: var(--audio);
}

.soundtrack-icon svg {
  width: 14px;
  height: 14px;
}

.soundtrack-duration {
  justify-self: center;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(200, 169, 243, .09);
  color: var(--audio);
  font: 500 8px/1 var(--mono);
}

.soundtrack-control {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--dim);
  font: 500 8px/1 var(--mono);
}

.soundtrack-control select,
.soundtrack-control input[type="number"] {
  width: 100%;
  height: 30px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #111416;
  color: var(--text);
  font: 500 9px var(--mono);
}

.soundtrack-control input[type="number"] {
  padding: 0 7px;
}

.soundtrack-control.compact {
  position: relative;
}

.soundtrack-control.compact small {
  position: absolute;
  right: 6px;
  bottom: 11px;
  color: var(--dim);
  font-size: 7px;
  pointer-events: none;
}

.soundtrack-control.volume input {
  width: 100%;
  accent-color: var(--audio);
}

.soundtrack-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, .05);
  color: var(--dim);
  cursor: pointer;
}

.soundtrack-remove:hover {
  background: rgba(236, 141, 141, .1);
  color: var(--danger);
}

.soundtrack-remove svg {
  width: 13px;
  height: 13px;
}

.sheet,
.review-sheet,
.publish-sheet,
.confirm-sheet {
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #171A1D;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .68);
}

.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: min(740px, calc(100dvh - 28px));
}

.sheet::backdrop,
.review-sheet::backdrop,
.publish-sheet::backdrop,
.confirm-sheet::backdrop {
  background: rgba(4, 5, 6, .72);
  backdrop-filter: blur(8px);
}

.review-sheet,
.publish-sheet {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
}

.review-shell,
.publish-shell {
  padding: 22px;
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.review-head h2 {
  margin: 0;
  font: 600 24px/1.2 var(--serif);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
  gap: 20px;
  min-height: 560px;
}

.review-media {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 45%, rgba(121, 220, 201, .08), transparent 46%),
    #0A0C0D;
}

.review-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: contain;
}

.review-decision {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(9, 11, 12, .82);
  color: var(--image);
  font: 600 9px/1 var(--mono);
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.review-decision.approved {
  border-color: rgba(154, 225, 184, .35);
  background: rgba(13, 35, 24, .88);
  color: #9AE1B8;
}

.review-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--dim);
  font: 500 9px/1.3 var(--mono);
}

.review-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .02);
}

.rating-block > div:first-child {
  display: grid;
  gap: 2px;
}

.rating-block strong {
  font-size: 12px;
}

.rating-block small {
  color: var(--dim);
  font-size: 10px;
}

.review-rating {
  display: flex;
  gap: 2px;
}

.review-rating button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #596064;
  cursor: pointer;
}

.review-rating button:hover,
.review-rating button.active {
  background: rgba(229, 184, 120, .11);
  color: var(--image);
}

.review-rating button.active svg {
  fill: currentColor;
}

.review-rating svg {
  width: 16px;
  height: 16px;
}

.review-notes {
  margin-top: 13px;
}

.review-panel .field textarea {
  min-height: 94px;
}

.review-notes textarea {
  min-height: 78px !important;
}

.review-actions-secondary,
.review-actions-primary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-actions-secondary {
  margin-top: auto;
  padding-top: 16px;
}

.review-actions-primary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.review-actions-secondary .secondary-btn,
.review-actions-primary > button {
  gap: 7px;
  min-height: 42px;
}

.review-actions-primary > button {
  flex: 1 1 0;
}

.approve-btn.approved {
  border-color: rgba(154, 225, 184, .35);
  background: rgba(154, 225, 184, .1);
  color: #9AE1B8;
}

.danger-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  margin-right: auto;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #858B8F;
  cursor: pointer;
}

.danger-link:hover {
  background: rgba(236, 141, 141, .09);
  color: var(--danger);
}

.danger-link svg {
  width: 15px;
  height: 15px;
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr);
  gap: 20px;
}

.publish-preview {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #090B0C;
}

.publish-preview video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: contain;
}

.publish-preview > span {
  position: absolute;
  top: 13px;
  left: 13px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(8, 10, 11, .78);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
}

.publish-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.publish-panel .field textarea {
  min-height: 126px;
}

.publish-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.publish-primary button {
  gap: 7px;
  min-height: 44px;
}

.channel-block {
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.channel-block > div:first-child {
  display: grid;
  gap: 2px;
  margin-bottom: 11px;
}

.channel-block strong {
  font-size: 12px;
}

.channel-block small {
  color: var(--dim);
  font-size: 10px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.channel-grid button {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  text-align: left;
}

.channel-grid button:disabled {
  opacity: .55;
}

.sheet form {
  overflow-y: auto;
  max-height: inherit;
  padding: 22px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.sheet-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font: 600 9px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sheet-head h2,
.confirm-sheet h2 {
  margin: 0;
  font: 600 24px/1.2 var(--serif);
}

.source-preview {
  position: relative;
  height: 138px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-deep);
}

.source-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-preview span {
  position: absolute;
  left: 9px;
  bottom: 9px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(8, 9, 10, .78);
  font: 500 9px/1 var(--mono);
}

.mode-switch {
  width: fit-content;
  margin-bottom: 17px;
}

.mode-switch button {
  min-width: 98px;
}

.source-preview:not([hidden]) + .mode-switch {
  display: none;
}

.field {
  display: block;
  min-width: 0;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.field textarea,
.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #0F1113;
  color: var(--text);
}

.field textarea:focus,
.field input:focus,
.field select:focus {
  border-color: rgba(121, 220, 201, .58);
  box-shadow: 0 0 0 3px rgba(121, 220, 201, .08);
}

.field textarea {
  min-height: 126px;
  padding: 13px;
  resize: vertical;
  line-height: 1.5;
}

.field input {
  height: 46px;
  padding: 0 12px;
}

.field select {
  height: 46px;
  padding: 0 11px;
}

.prompt-field {
  margin-bottom: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 11px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: 13px;
  color: var(--text);
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.quote {
  color: var(--muted);
  font: 500 11px/1.4 var(--mono);
}

.quote.ready {
  color: var(--accent);
}

.generate-submit {
  min-width: 136px;
  min-height: 44px;
}

.form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.confirm-sheet {
  width: min(410px, calc(100vw - 28px));
}

.confirm-sheet form {
  padding: 24px;
}

.confirm-sheet p {
  margin: 12px 0 22px;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  z-index: 300;
  max-width: min(440px, calc(100vw - 24px));
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(25, 28, 31, .97);
  color: var(--text);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity .16s, transform .16s;
}

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

.context-menu {
  position: fixed;
  z-index: 120;
  width: 260px;
  max-width: calc(100vw - 16px);
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  background: rgba(18, 21, 23, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58), 0 0 0 1px rgba(0, 0, 0, .32);
  color: var(--text);
  contain: layout paint;
  transform-origin: top left;
  animation: context-in .1s ease-out;
}

.context-menu[hidden] {
  display: none;
}

@keyframes context-in {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(.985);
  }
}

.context-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.context-head > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.context-head strong,
.context-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-head strong {
  font-size: 12px;
  font-weight: 650;
}

.context-head small {
  color: var(--dim);
  font: 500 9px/1.2 var(--mono);
}

.context-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(132, 222, 204, .22);
  border-radius: 8px;
  background: rgba(132, 222, 204, .08);
  color: var(--accent);
}

.context-icon.video {
  border-color: rgba(158, 178, 232, .22);
  background: rgba(158, 178, 232, .08);
  color: var(--video);
}

.context-icon.audio {
  border-color: rgba(200, 169, 243, .26);
  background: rgba(200, 169, 243, .09);
  color: var(--audio);
}

.context-icon svg {
  width: 15px;
  height: 15px;
}

.context-actions {
  display: grid;
  gap: 2px;
  padding: 6px 0 2px;
}

.context-actions button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 35px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #DCE1E2;
  font-size: 11px;
  text-align: left;
}

.context-actions button:hover,
.context-actions button:focus-visible {
  background: rgba(255, 255, 255, .07);
  color: #FFF;
}

.context-actions button:disabled {
  color: #6C7376;
  cursor: default;
}

.context-actions button:disabled:hover {
  background: transparent;
}

.context-actions button.danger {
  color: #E29C9C;
}

.context-actions button svg {
  width: 14px;
  height: 14px;
}

.context-shortcut {
  color: #727A7E;
  font: 500 9px/1 var(--mono);
}

.context-separator {
  height: 1px;
  margin: 5px 7px;
  background: var(--line);
}

.context-menu footer {
  padding: 7px 8px 5px;
  color: #697175;
  font: 500 8px/1.2 var(--mono);
}

@media (hover: none) {
  .timeline-remove {
    opacity: 1;
  }

  .context-menu footer {
    display: none;
  }
}

@media (max-width: 920px) {
  .board-hint {
    display: none;
  }

  .search-box {
    width: 190px;
  }

  .save-state,
  .nav-studio {
    display: none;
  }

  .nav-voice {
    width: 40px;
    padding: 0;
  }

  .nav-voice span:last-child {
    display: none;
  }
}

@media (max-width: 700px) {
  :root {
    --nav-h: 92px;
    --dock-h: 286px;
  }

  .nav {
    align-content: flex-start;
    flex-wrap: wrap;
    height: var(--nav-h);
    padding: 8px 10px 6px;
    background: rgba(10, 12, 13, .98);
  }

  .nav .brand,
  .nav-right {
    height: 38px;
  }

  .nav-right .primary-btn {
    min-height: 38px;
    padding: 0 11px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 6px 8px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .board-tools {
    top: 8px;
    right: 8px;
    left: 8px;
  }

  .drop-guide {
    top: 60px;
    right: 8px;
    width: min(390px, calc(100vw - 16px));
  }

  .drag-coach {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
    border-radius: 12px;
    transform: none;
  }

  .drag-coach strong {
    white-space: normal;
  }

  .scope-toggle {
    width: 42px;
    padding: 0;
  }

  .scope-toggle span {
    display: none;
  }

  .segmented button {
    padding: 0 8px;
  }

  .segmented button span:last-child {
    display: none;
  }

  .mix-launch {
    width: 42px;
    padding: 0;
  }

  .mix-launch > span:not(:first-child) {
    display: none;
  }

  .search-box {
    width: 42px;
    margin-left: auto;
    padding: 0 12px;
    overflow: hidden;
    transition: width .18s;
  }

  .search-box:focus-within {
    width: min(210px, calc(100vw - 168px));
  }

  .search-box input {
    min-width: 170px;
    opacity: 0;
  }

  .search-box:focus-within input {
    opacity: 1;
  }

  .stage-lane {
    width: 318px;
  }

  .image-lane {
    left: 164px;
  }

  .video-lane {
    left: 544px;
  }

  .audio-lane {
    left: 924px;
  }

  .edit-head {
    gap: 8px;
    padding-right: 8px;
  }

  .edit-title {
    min-width: 172px;
  }

  .edit-dock:not(.collapsed) .edit-title {
    min-width: 34px;
  }

  .edit-dock:not(.collapsed) .editor-mark,
  .edit-dock:not(.collapsed) .edit-title-copy {
    display: none;
  }

  .edit-title-copy small {
    max-width: 150px;
  }

  .edit-selection {
    gap: 5px;
    padding-left: 6px;
  }

  .edit-selection > strong {
    min-width: 48px;
  }

  .edit-tool span:last-child {
    display: none;
  }

  .edit-tool {
    width: 36px;
    padding: 0;
  }

  .edit-actions .icon-btn {
    display: none;
  }

  .export-btn {
    padding: 0 11px;
  }

  .publish-btn {
    width: 40px;
    padding: 0;
  }

  .publish-btn span:last-child {
    display: none;
  }

  .timeline-list {
    padding-left: 15px;
  }

  .timeline-transport {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .transport-controls {
    justify-content: center;
    padding: 0;
  }

  .timeline-time {
    display: none;
  }

  .timeline-track {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .track-label {
    font-size: 0;
  }

  .soundtrack-item {
    grid-template-columns: 112px 44px 94px 68px 82px 28px;
    min-width: 462px;
  }

  .sheet {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .review-sheet,
  .publish-sheet {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 8px);
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .review-shell,
  .publish-shell {
    overflow-y: auto;
    max-height: calc(100dvh - 8px);
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .review-layout,
  .publish-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .review-media,
  .review-media img,
  .publish-preview,
  .publish-preview video {
    min-height: 280px;
    max-height: 48dvh;
  }

  .review-actions-secondary {
    margin-top: 16px;
  }

  .rating-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .publish-primary {
    grid-template-columns: 1fr;
  }

  .sheet form {
    padding: 18px 15px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .sheet-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .generate-submit {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .board-tools {
    gap: 5px;
  }

  .board-tools > .icon-btn {
    width: 38px;
  }

  .board-tools > #arrangeBoard {
    display: none;
  }

  .nav-right .primary-btn span:last-child {
    display: none;
  }

  .nav-right .primary-btn {
    width: 38px;
    padding: 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
