:root {
  --bg: #091017;
  --bg-soft: #0f1822;
  --panel: rgba(17, 25, 34, 0.84);
  --panel-strong: rgba(20, 31, 43, 0.98);
  --line: rgba(180, 208, 224, 0.16);
  --line-strong: rgba(209, 255, 102, 0.22);
  --text: #eef4f7;
  --muted: #98aebb;
  --accent: #d1ff66;
  --accent-soft: #9fd1ff;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(159, 209, 255, 0.12), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(209, 255, 102, 0.08), transparent 20%),
    linear-gradient(180deg, #081018 0%, #0c131b 55%, #111a24 100%);
}

a,
button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
ul,
dl {
  margin-top: 0;
}

.app-shell {
  width: min(1480px, calc(100vw - 24px));
  margin: 12px auto;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 16px;
  transition: grid-template-columns 220ms ease;
}

.sidebar,
.hero,
.section {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 24px);
  position: sticky;
  top: 12px;
  background:
    linear-gradient(180deg, rgba(19, 28, 38, 0.98), rgba(14, 22, 30, 0.96)),
    rgba(17, 25, 34, 0.84);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #84ffd6);
  color: #111;
  font-weight: 700;
  font-size: 1.12rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

h1 {
  margin-bottom: 0;
  font-size: 1.22rem;
}

.sidebar-project h3 {
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.sidebar-nav,
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-shell.editor-focus {
  grid-template-columns: 84px minmax(0, 1fr);
}

.app-shell.editor-focus .sidebar {
  padding: 16px 10px;
}

.app-shell.editor-focus .sidebar-stack {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-shell.editor-focus .brand-lockup {
  justify-content: center;
}

.app-shell.editor-focus .brand-lockup > div:last-child {
  display: none;
}

.app-shell.editor-focus .nav-meta {
  display: none;
}

.app-shell.editor-focus .nav-item {
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
}

.app-shell.editor-focus .nav-label {
  margin: 0;
  font-size: 0.66rem;
  text-align: center;
}

.canvas-shell > .section-head {
  display: none;
}

.nav-item,
.mode-chip,
.tab {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.nav-item {
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(209, 255, 102, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--text);
}

.nav-label,
.nav-meta {
  display: block;
}

.nav-label {
  margin-bottom: 4px;
  font-weight: 600;
}

.nav-meta {
  font-size: 0.88rem;
}

.sidebar-panel {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.compact-list,
.queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.compact-list li,
.queue-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.compact-list li:last-child,
.queue-list li:last-child {
  border-bottom: none;
}

.activity-feed li {
  color: var(--muted);
  line-height: 1.45;
}

.sidebar-note {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.sidebar-meter-stack {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.sidebar-meter {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.sidebar-meter span {
  color: var(--muted);
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-meter b {
  display: block;
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sidebar-meter b::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

.sidebar-save {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(209, 255, 102, 0.12);
}

#save-time {
  color: var(--accent-soft);
  margin-left: auto;
}

.content {
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeUp 320ms ease;
}

.hero,
.section {
  padding: 24px;
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.hero-topbar h2,
.section-head h3 {
  font-family: "Instrument Serif", serif;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 0;
}

.hero-topbar h2 {
  font-size: clamp(3rem, 5vw, 5rem);
  max-width: 11ch;
}

.section-head h3 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  max-width: 11ch;
}

.hero-top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
}

.button.primary {
  background: var(--accent);
  color: #111;
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.hero-grid,
.workspace-grid,
.canvas-layout,
.world-editor-layout {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: 1.05fr 0.95fr;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.metric-row {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-row li,
.system-card,
.project-card,
.canvas-toolbar,
.canvas-board,
.canvas-inspector,
.world-sidebar,
.world-viewport,
.tab-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.metric-row li {
  padding: 16px;
}

.metric-value {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
}

.metric-label,
.system-card-head,
.project-card p,
.project-time,
.tab-panel p,
.canvas-node p,
.world-panel p {
  color: var(--muted);
}

.system-card {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    var(--panel-strong);
}

.system-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(209, 255, 102, 0.1);
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.node-map,
.canvas-board {
  position: relative;
  min-height: 420px;
}

.node-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.node,
.canvas-node {
  position: relative;
  z-index: 2;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.node-type {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.node.world {
  transform: translateY(36px);
}

.node.asset {
  transform: translateY(20px);
}

.connector,
.canvas-link {
  position: absolute;
  z-index: 1;
  transform-origin: left center;
  border-top: 1px dashed rgba(209, 255, 102, 0.35);
  opacity: 0.4;
  transition:
    opacity 180ms ease,
    border-color 180ms ease;
}

.canvas-link.active {
  opacity: 1;
  border-top-color: rgba(209, 255, 102, 0.8);
}

.connector-a {
  width: 38%;
  top: 26%;
  left: 33%;
  transform: rotate(12deg);
}

.connector-b {
  width: 40%;
  top: 56%;
  left: 31%;
  transform: rotate(-10deg);
}

.connector-c {
  width: 30%;
  top: 70%;
  left: 48%;
  transform: rotate(18deg);
}

.section {
  margin-top: 16px;
}

.section-head {
  margin-bottom: 22px;
}

.section-head-inline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
}

.tab.active,
.mode-chip.active {
  background: var(--accent);
  color: #111;
  border-color: transparent;
}

.tab-panel {
  display: none;
  padding: 20px;
}

.tab-panel.active {
  display: block;
}

.signal-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.signal-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(159, 209, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.04);
}

.signal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.signal-head h4 {
  margin-bottom: 0;
}

.spark-bars {
  height: 130px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.spark-bars span {
  display: block;
  height: var(--h);
  min-height: 18px;
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, rgba(209, 255, 102, 0.92), rgba(159, 209, 255, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.signal-meta-row,
.legend-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dial-card {
  position: relative;
  width: 144px;
  height: 144px;
  margin: 4px auto 0;
}

.dial-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(9, 16, 23, 0.96) 0 42%, transparent 43%),
    conic-gradient(
      from -70deg,
      var(--accent) 0 38%,
      rgba(159, 209, 255, 0.88) 38% 66%,
      rgba(255, 255, 255, 0.12) 66% 100%
    );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.dial-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.dial-center strong {
  display: block;
  font-size: 1.8rem;
}

.dial-center span {
  color: var(--muted);
  font-size: 0.8rem;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}

.swatch-a {
  background: var(--accent);
}

.swatch-b {
  background: var(--accent-soft);
}

.swatch-c {
  background: rgba(255, 255, 255, 0.5);
}

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

.matrix-grid span {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-grid .hot {
  background: linear-gradient(180deg, rgba(209, 255, 102, 0.9), rgba(209, 255, 102, 0.18));
}

.matrix-grid .warm {
  background: linear-gradient(180deg, rgba(159, 209, 255, 0.8), rgba(159, 209, 255, 0.16));
}

.matrix-grid .cool {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
}

.workspace-grid {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
}

.project-card {
  padding: 20px;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.project-card[data-project-id] {
  cursor: pointer;
}

.project-card[data-project-id]:hover,
.project-card[data-project-id]:focus-visible {
  border-color: var(--line-strong);
  outline: none;
  transform: translateY(-1px);
}

.project-card.active {
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at top right, rgba(209, 255, 102, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.primary-card {
  background:
    radial-gradient(circle at top right, rgba(159, 209, 255, 0.12), transparent 35%),
    rgba(255, 255, 255, 0.04);
}

.project-card-head,
.project-tags,
.queue-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-tags {
  flex-wrap: wrap;
  margin-top: 20px;
}

.project-tags span {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.project-visual-card {
  background:
    radial-gradient(circle at top right, rgba(209, 255, 102, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.04);
}

.timeline-visual {
  position: relative;
  height: 118px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(8, 14, 20, 0.5);
  background-size: 100% 28px;
  overflow: hidden;
}

.timeline-bar {
  position: absolute;
  top: 18%;
  left: var(--x);
  width: var(--w);
  bottom: 16%;
  border-radius: 999px;
  background: var(--tone);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.queue-list strong {
  color: var(--text);
  font-size: 0.88rem;
}

.workspace-detail-list {
  margin: 18px 0 0;
}

.workspace-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.workspace-detail-list div:last-child {
  border-bottom: none;
}

.workspace-detail-list dt {
  color: var(--muted);
}

.dev-console-card,
.runtime-card,
.output-ledger-card {
  background:
    radial-gradient(circle at top right, rgba(209, 255, 102, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.04);
}

.dev-console-copy,
.runtime-note {
  color: var(--muted);
  line-height: 1.55;
}

.dev-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.dev-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.dev-button.primary {
  border-color: rgba(209, 255, 102, 0.45);
  color: #10150c;
  background: linear-gradient(135deg, var(--accent), #84ffd6);
}

.dev-task-list li,
.output-ledger-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.dev-task-list li span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent-soft);
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.dev-task-list li.is-done span {
  color: var(--accent);
  border-color: rgba(209, 255, 102, 0.26);
}

.runtime-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.runtime-provider-grid span {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
}

.runtime-provider-grid b {
  font-size: 1rem;
}

.runtime-provider-grid small {
  color: var(--muted);
}

.output-ledger-list a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-ledger-list strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 0.82rem;
}

.runs-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.runs-summary-card,
.runs-preview-card,
.runs-list-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(159, 209, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.035);
}

.runs-preview-card {
  grid-row: span 2;
}

.runs-summary-card h4,
.runs-preview-card h4,
.runs-list-card h4 {
  margin-bottom: 10px;
}

.runs-summary-card p {
  color: var(--muted);
  line-height: 1.55;
}

.runs-video-frame {
  height: 360px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(159, 209, 255, 0.1), rgba(209, 255, 102, 0.05)),
    rgba(0, 0, 0, 0.22);
}

.runs-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05080c;
}

.runs-metrics {
  margin-bottom: 0;
}

.runs-unified-card,
.runs-detail-card {
  min-height: 360px;
}

.runs-unified-list li {
  padding: 0;
}

.run-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.run-list-item span,
.run-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-list-item small {
  margin-top: 4px;
  color: var(--muted);
}

.run-list-item strong {
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.run-list-item.active span {
  color: var(--accent);
}

.runs-detail-meta {
  margin: 14px 0;
}

.runs-detail-field {
  margin-top: 12px;
}

.canvas-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "toolbar toolbar"
    "board inspector";
  align-items: stretch;
}

.canvas-toolbar,
.canvas-inspector,
.world-sidebar {
  padding: 16px;
}

.canvas-toolbar {
  grid-area: toolbar;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.canvas-toolbar button,
.mode-chip {
  min-height: 42px;
  border-radius: 14px;
}

.canvas-toolbar button {
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.canvas-toolbar button:hover {
  border-color: var(--line-strong);
  background: rgba(209, 255, 102, 0.08);
}

.canvas-board {
  grid-area: board;
  min-height: 700px;
  padding-top: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(159, 209, 255, 0.14), transparent 26%),
    radial-gradient(circle at 84% 78%, rgba(209, 255, 102, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(9, 15, 21, 0.96), rgba(12, 19, 28, 0.94));
  background-size: 32px 32px, 32px 32px, auto;
  overflow: hidden;
}

.canvas-board-studio {
  min-height: 840px;
  border-radius: 30px;
}

.canvas-command-bar {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 20px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.canvas-command-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.canvas-project-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(9, 14, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
}

.canvas-subtle-meta {
  color: rgba(238, 244, 247, 0.6);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.canvas-command-bar .canvas-toolbar {
  padding: 0;
  gap: 8px;
}

.canvas-command-bar .canvas-toolbar button {
  min-height: 36px;
  padding: 0 14px;
  background: rgba(9, 14, 20, 0.74);
}

.canvas-add-menu {
  position: absolute;
  right: 24px;
  top: 66px;
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 164px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 24, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

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

.canvas-add-menu-head {
  padding: 2px 2px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.canvas-add-menu-copy {
  display: block;
  color: rgba(238, 244, 247, 0.6);
  font-size: 0.78rem;
  line-height: 1.4;
}

.canvas-empty-state {
  position: absolute;
  left: 390px;
  top: 248px;
  z-index: 2;
  width: 292px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(14, 21, 31, 0.92), rgba(10, 16, 24, 0.84)),
    rgba(10, 16, 24, 0.72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.canvas-empty-state h4 {
  margin-bottom: 10px;
  font-size: 1.14rem;
  line-height: 1.02;
  max-width: 13ch;
}

.canvas-empty-state p:last-of-type {
  margin-bottom: 0;
  color: rgba(238, 244, 247, 0.74);
  line-height: 1.45;
}

.canvas-empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.canvas-empty-action,
.canvas-next-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.canvas-empty-action.primary,
.canvas-next-button {
  border-color: rgba(209, 255, 102, 0.28);
  background: rgba(209, 255, 102, 0.12);
}

.canvas-empty-action:hover,
.canvas-next-button:hover {
  border-color: rgba(209, 255, 102, 0.4);
  background: rgba(209, 255, 102, 0.16);
}

.canvas-add-item {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  font-weight: 500;
}

.canvas-add-item:hover {
  border-color: rgba(209, 255, 102, 0.26);
  background: rgba(209, 255, 102, 0.08);
}

.canvas-floating-copy {
  position: absolute;
  left: 32px;
  top: 132px;
  z-index: 2;
  max-width: 190px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 24, 0.54);
  backdrop-filter: blur(12px);
}

.canvas-floating-copy h4 {
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.1;
  max-width: 12ch;
}

.canvas-halo,
.canvas-axis,
.canvas-band,
.canvas-grid-glow {
  position: absolute;
  z-index: 0;
}

.canvas-stage-strip,
.canvas-minimap,
.canvas-signal-rail {
  position: absolute;
  z-index: 1;
}

.canvas-grid-glow {
  inset: 0;
  background:
    radial-gradient(circle at 22% 36%, rgba(159, 209, 255, 0.1), transparent 18%),
    radial-gradient(circle at 74% 32%, rgba(209, 255, 102, 0.08), transparent 22%);
  pointer-events: none;
}

.canvas-stage-strip {
  left: 18px;
  right: 18px;
  top: 618px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stage-pill {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(12, 19, 28, 0.84);
}

.stage-pill.active {
  border-color: rgba(209, 255, 102, 0.22);
  background: rgba(209, 255, 102, 0.08);
}

.stage-pill.complete {
  border-color: rgba(159, 209, 255, 0.2);
  background: rgba(159, 209, 255, 0.08);
}

.stage-step,
.stage-pill small {
  display: block;
  font-family: "IBM Plex Mono", monospace;
}

.stage-step {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.7rem;
}

.stage-pill strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.stage-pill small {
  color: var(--muted);
  font-size: 0.72rem;
}

.canvas-halo {
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.5;
}

.canvas-halo-a {
  width: 220px;
  height: 220px;
  left: 8%;
  top: 18%;
  background: radial-gradient(circle, rgba(159, 209, 255, 0.24), transparent 70%);
}

.canvas-halo-b {
  width: 280px;
  height: 280px;
  right: 4%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(209, 255, 102, 0.16), transparent 72%);
}

.canvas-board.stage-1 .canvas-stage-strip,
.canvas-board.stage-1 .canvas-stream,
.canvas-board.stage-1 .canvas-signal-rail,
.canvas-board.stage-1 .canvas-minimap,
.canvas-board.stage-1 .canvas-axis,
.canvas-board.stage-1 .canvas-band-b,
.canvas-board.stage-1 .lane-b,
.canvas-board.stage-1 .lane-c {
  opacity: 0;
  pointer-events: none;
}

.canvas-board.stage-1 .canvas-empty-state {
  display: block;
}

.canvas-board:not(.stage-1) .canvas-empty-state {
  display: none;
}

.canvas-board.stage-1 .canvas-floating-copy {
  opacity: 0;
  pointer-events: none;
}

.canvas-board.stage-2 .canvas-stage-strip,
.canvas-board.stage-2 .canvas-stream,
.canvas-board.stage-2 .canvas-minimap {
  opacity: 0;
  pointer-events: none;
}

.canvas-board.stage-2 .canvas-band-b,
.canvas-board.stage-2 .lane-c {
  opacity: 0;
}

.canvas-board.stage-2 .canvas-floating-copy,
.canvas-board.stage-3 .canvas-floating-copy {
  opacity: 0;
  pointer-events: none;
}

.canvas-board.stage-2 .canvas-inspector-floating {
  width: 288px;
}

.canvas-board.stage-2 .inspector-summary,
.canvas-board.stage-2 .inspector-trace,
.canvas-board.stage-2 .llm-control-panel {
  display: none;
}

.canvas-board.stage-3 .canvas-stage-strip,
.canvas-board.stage-3 .canvas-minimap {
  opacity: 0;
  pointer-events: none;
}

.canvas-board.stage-3 .canvas-stream {
  top: 112px;
  grid-template-columns: minmax(0, 220px);
}

.canvas-board.stage-3 .stream-card:last-child {
  display: none;
}

.canvas-board.stage-3 .canvas-signal-rail {
  bottom: 118px;
}

.canvas-board.stage-4 .canvas-stage-strip,
.canvas-board.stage-4 .canvas-minimap,
.canvas-board.stage-4 .canvas-stream {
  opacity: 0;
  pointer-events: none;
}

.canvas-board.stage-4 .canvas-signal-rail {
  bottom: 84px;
}

.canvas-board.stage-4 .canvas-axis {
  bottom: 20px;
}

.canvas-inspector-floating.generate-focus .inspector-summary,
.canvas-inspector-floating.generate-focus .inspector-list,
.canvas-inspector-floating.generate-focus .inspector-trace {
  display: none;
}

.canvas-inspector-floating.generate-focus {
  width: 258px;
}

.canvas-inspector-floating.generate-focus .canvas-next-card {
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
  padding: 10px;
}

.canvas-inspector-floating.generate-focus .llm-config-grid,
.canvas-inspector-floating.generate-focus .llm-metrics-grid,
.canvas-inspector-floating.generate-focus .llm-log,
.canvas-inspector-floating.generate-focus .llm-field span,
.canvas-inspector-floating.generate-focus #llm-prompt-input {
  display: none;
}

.canvas-inspector-floating.generate-focus .llm-head h4 {
  font-size: 1rem;
}

.canvas-inspector-floating.generate-focus .llm-action-row {
  grid-template-columns: 1fr;
}

.canvas-inspector-floating.generate-focus .llm-action-row .llm-button:not(.primary) {
  display: none;
}

.canvas-inspector-floating.generate-focus .llm-action-row .llm-button.primary {
  min-height: 42px;
}

.canvas-inspector-floating.generate-focus .llm-head {
  margin-bottom: 0;
}

.canvas-inspector-floating.generate-focus .llm-head .status-pill {
  min-height: 26px;
  padding: 0 8px;
}

.canvas-inspector-floating.generate-focus .llm-compact-copy {
  max-height: 4.3em;
  overflow: hidden;
}

.canvas-inspector-floating.generate-focus .inspector-action-row {
  display: none;
}

.canvas-inspector-floating.output-focus .inspector-summary,
.canvas-inspector-floating.output-focus .inspector-trace,
.canvas-inspector-floating.output-focus .llm-control-panel {
  display: none;
}

.canvas-inspector-floating.output-focus {
  width: 252px;
}

.canvas-inspector-floating.output-focus .canvas-next-card {
  margin-bottom: 8px;
  padding: 10px;
}

.canvas-inspector-floating.output-focus .inspector-action-row {
  margin-top: 8px;
}

.canvas-inspector-floating.output-focus .output-preview-card {
  display: block;
}

.llm-compact-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 10px;
}

.llm-compact-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 244, 247, 0.82);
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.llm-compact-copy {
  margin: 0 0 12px;
  color: rgba(238, 244, 247, 0.72);
  line-height: 1.45;
}

.canvas-band {
  left: 24px;
  right: 24px;
  height: 118px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.03));
}

.canvas-band-a {
  top: 136px;
}

.canvas-band-b {
  top: 418px;
}

.canvas-runway,
.canvas-stream {
  position: absolute;
  z-index: 0;
}

.canvas-runway {
  inset: 40px 28px 54px;
}

.runway-lane {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

.lane-a {
  top: 18%;
}

.lane-b {
  top: 48%;
}

.lane-c {
  top: 76%;
}

.canvas-stream {
  left: 30px;
  right: 30px;
  top: 170px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  justify-content: end;
  gap: 10px;
}

.stream-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 19, 28, 0.9);
  backdrop-filter: blur(10px);
}

.stream-card strong {
  display: block;
  margin-bottom: 10px;
}

.stream-meter {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.stream-meter span {
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

.canvas-signal-rail {
  left: 30px;
  bottom: 148px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rail-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 14, 20, 0.78);
  color: var(--muted);
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.rail-chip.active {
  border-color: rgba(209, 255, 102, 0.34);
  color: var(--accent);
  background: rgba(209, 255, 102, 0.08);
}

.canvas-axis {
  left: 28px;
  right: 28px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.canvas-minimap {
  right: 22px;
  bottom: 190px;
  width: 118px;
  height: 86px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 19, 28, 0.86);
  backdrop-filter: blur(10px);
}

.mini-node,
.mini-viewport {
  position: absolute;
  border-radius: 6px;
}

.mini-node {
  background: rgba(159, 209, 255, 0.28);
}

.mini-a {
  left: 10px;
  top: 16px;
  width: 34px;
  height: 16px;
}

.mini-b {
  right: 10px;
  top: 16px;
  width: 34px;
  height: 16px;
}

.mini-c {
  left: 10px;
  bottom: 16px;
  width: 34px;
  height: 18px;
}

.mini-d {
  right: 10px;
  bottom: 16px;
  width: 34px;
  height: 18px;
}

.mini-viewport {
  inset: 10px;
  border: 1px solid rgba(209, 255, 102, 0.58);
  background: transparent;
}

.canvas-inspector {
  grid-area: inspector;
}

.canvas-inspector-floating {
  position: absolute;
  right: 24px;
  top: 132px;
  z-index: 3;
  width: 308px;
  max-height: calc(100% - 176px);
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 16, 24, 0.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
}

.canvas-next-card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.canvas-next-card h4 {
  margin-bottom: 8px;
}

.canvas-next-card p:last-of-type {
  margin-bottom: 0;
  color: rgba(238, 244, 247, 0.7);
  line-height: 1.45;
}

.output-preview-card {
  display: none;
  margin-bottom: 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.output-preview-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0b1118;
}

.inspector-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.inspector-action {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 244, 247, 0.86);
  cursor: pointer;
}

.inspector-action.primary {
  border-color: rgba(209, 255, 102, 0.28);
  background: rgba(209, 255, 102, 0.12);
}

.canvas-inspector-floating.is-onboarding .inspector-summary,
.canvas-inspector-floating.is-onboarding .inspector-head,
.canvas-inspector-floating.is-onboarding .inspector-list,
.canvas-inspector-floating.is-onboarding .inspector-trace,
.canvas-inspector-floating.is-onboarding .llm-control-panel {
  display: none;
}

.canvas-shell .section-head h3 {
  max-width: none;
  font-size: clamp(1.5rem, 2.3vw, 2.4rem);
  line-height: 1;
}

.inspector-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.inspector-kpi {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.inspector-kpi-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.inspector-kpi strong {
  display: block;
  font-size: 1rem;
}

.canvas-node {
  position: absolute;
  width: 320px;
  max-width: 320px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.canvas-node.is-hidden {
  display: none;
}

.canvas-node::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 72%);
}

.canvas-node:hover,
.canvas-node:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.canvas-node strong {
  display: block;
  margin-bottom: 6px;
  line-height: 1.15;
}

.canvas-node p {
  line-height: 1.3;
  color: rgba(238, 244, 247, 0.78);
}

.node-preview {
  position: relative;
  height: 88px;
  margin: 12px 0 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.node-preview::before,
.node-preview::after {
  content: "";
  position: absolute;
  border-radius: 14px;
}

.node-preview-brief {
  background:
    linear-gradient(135deg, rgba(248, 191, 122, 0.8), rgba(84, 56, 35, 0.2)),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.25), transparent 20%),
    #131c26;
}

.node-preview-brief::before {
  left: 14px;
  top: 18px;
  width: 72px;
  height: 44px;
  background: rgba(14, 20, 28, 0.7);
  box-shadow: 88px 10px 0 -6px rgba(255, 255, 255, 0.12);
}

.node-preview-world {
  background:
    radial-gradient(circle at 30% 40%, rgba(209, 255, 102, 0.26), transparent 18%),
    linear-gradient(180deg, rgba(46, 71, 56, 0.8), rgba(12, 18, 24, 0.8)),
    #131c26;
}

.node-preview-world::before {
  inset: 16px;
  border: 1px dashed rgba(209, 255, 102, 0.28);
}

.node-preview-image {
  background:
    linear-gradient(135deg, rgba(108, 144, 182, 0.92), rgba(33, 47, 66, 0.2)),
    radial-gradient(circle at 66% 34%, rgba(255, 207, 145, 0.36), transparent 18%),
    #131c26;
}

.node-preview-image::before {
  left: 18px;
  top: 14px;
  width: 72px;
  height: 60px;
  background: rgba(18, 24, 32, 0.66);
}

.node-preview-image::after {
  right: 18px;
  top: 20px;
  width: 56px;
  height: 46px;
  background: rgba(255, 255, 255, 0.12);
}

.node-preview-video {
  background:
    linear-gradient(135deg, rgba(255, 183, 120, 0.95), rgba(99, 54, 37, 0.18)),
    #131c26;
}

.node-preview-video::before {
  left: 18px;
  top: 14px;
  width: 104px;
  height: 60px;
  background: rgba(18, 24, 32, 0.62);
}

.node-preview-video::after {
  right: 18px;
  top: 18px;
  width: 62px;
  height: 50px;
  background: rgba(18, 24, 32, 0.72);
}

.canvas-node.node-video {
  width: 262px;
  max-width: 262px;
}

.canvas-node.node-video p {
  max-width: 18ch;
}

.canvas-node.node-assets {
  width: 248px;
  max-width: 248px;
}

.node-preview-assets {
  background:
    linear-gradient(180deg, rgba(118, 94, 188, 0.56), rgba(22, 27, 38, 0.82)),
    #131c26;
}

.node-preview-assets::before {
  left: 14px;
  top: 18px;
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    68px 0 0 rgba(255, 255, 255, 0.08),
    136px 0 0 rgba(255, 255, 255, 0.08);
}

.output-node-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.node-assets.has-result .node-preview-assets::before {
  opacity: 0;
}

.node-assets.has-result .output-node-video {
  opacity: 1;
}

.node-corner-status {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 12, 18, 0.58);
  color: rgba(238, 244, 247, 0.78);
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.node-brief {
  background:
    radial-gradient(circle at top left, rgba(159, 209, 255, 0.12), transparent 46%),
    rgba(255, 255, 255, 0.04);
}

.node-brief::before {
  background: linear-gradient(90deg, rgba(159, 209, 255, 0.86), transparent 80%);
}

.node-world {
  background:
    radial-gradient(circle at top left, rgba(209, 255, 102, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.04);
}

.node-world::before {
  background: linear-gradient(90deg, rgba(209, 255, 102, 0.9), transparent 78%);
}

.node-video {
  background:
    radial-gradient(circle at top left, rgba(255, 194, 134, 0.16), transparent 42%),
    rgba(255, 255, 255, 0.04);
}

.node-video::before {
  background: linear-gradient(90deg, rgba(255, 194, 134, 0.88), transparent 78%);
}

.node-assets {
  background:
    radial-gradient(circle at top left, rgba(200, 178, 255, 0.16), transparent 44%),
    rgba(255, 255, 255, 0.04);
}

.node-assets::before {
  background: linear-gradient(90deg, rgba(200, 178, 255, 0.86), transparent 78%);
}

.canvas-node.active {
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at top right, rgba(209, 255, 102, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(209, 255, 102, 0.09), rgba(255, 255, 255, 0.07));
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(209, 255, 102, 0.1);
}

.canvas-link.is-hidden {
  display: none;
}

.llm-control-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.llm-head {
  margin-bottom: 10px;
}

.llm-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.llm-field {
  display: grid;
  gap: 7px;
}

.llm-field span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "IBM Plex Mono", monospace;
}

.llm-field select,
.llm-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  padding: 10px 11px;
  resize: vertical;
}

.llm-field textarea {
  min-height: 108px;
  line-height: 1.48;
}

.llm-field-full {
  margin-bottom: 12px;
}

.llm-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.llm-button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.llm-button.primary {
  background: var(--accent);
  color: #111;
  border-color: transparent;
}

.llm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.llm-metric {
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.llm-metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "IBM Plex Mono", monospace;
}

.llm-log {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.llm-log-list li {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.canvas-node.dragging {
  z-index: 5;
  cursor: grabbing;
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.3);
}

.node-brief {
  top: 36px;
  left: 36px;
}

.node-world {
  top: 210px;
  left: 230px;
}

.node-video {
  top: 80px;
  right: 50px;
}

.node-assets {
  bottom: 38px;
  right: 70px;
}

.link-a {
  width: 220px;
  top: 154px;
  left: 212px;
  transform: rotate(28deg);
}

.link-b {
  width: 180px;
  top: 176px;
  left: 430px;
  transform: rotate(-18deg);
}

.link-c {
  width: 170px;
  top: 314px;
  right: 148px;
  transform: rotate(22deg);
}

.inspector-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.inspector-kicker {
  margin-bottom: 4px;
}

.inspector-list {
  margin: 0;
}

.inspector-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inspector-list div:last-child {
  border-bottom: none;
}

.inspector-list dt {
  color: var(--muted);
}

.inspector-note {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.inspector-trace {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trace-pill {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
}

.trace-pill.active {
  border-color: rgba(209, 255, 102, 0.24);
  color: var(--accent);
  background: rgba(209, 255, 102, 0.08);
}

.world-editor-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.world-viewport {
  position: relative;
  min-height: 560px;
  padding: 12px;
  overflow: hidden;
}

.world-vignette {
  position: absolute;
  inset: 12px;
  z-index: 2;
  border-radius: 18px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 14, 20, 0.24), transparent 18%, transparent 70%, rgba(8, 14, 20, 0.42)),
    radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.18));
}

.world-video {
  height: 100%;
  min-height: 536px;
}

.video-frame {
  border-radius: 18px;
  overflow: hidden;
  background: #080808;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewport-overlay {
  position: absolute;
  left: 24px;
  top: 24px;
  right: 24px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.viewport-meta {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 0.84rem;
}

.world-director-card {
  position: absolute;
  right: 24px;
  top: 68px;
  z-index: 4;
  min-width: 232px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 19, 28, 0.82);
  backdrop-filter: blur(14px);
}

.world-director-card strong,
.world-director-card small {
  display: block;
}

.world-director-card strong {
  margin-bottom: 6px;
}

.world-director-card small {
  color: var(--muted);
  line-height: 1.5;
}

.annotation-box {
  position: absolute;
  border: 1px solid rgba(209, 255, 102, 0.72);
  box-shadow:
    0 0 0 1px rgba(209, 255, 102, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(180deg, rgba(209, 255, 102, 0.1), rgba(209, 255, 102, 0.04)),
    rgba(209, 255, 102, 0.06);
  border-radius: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.world-monitor-strip {
  position: absolute;
  left: 24px;
  bottom: 202px;
  z-index: 4;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.world-monitor-strip span {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 19, 28, 0.74);
  color: rgba(238, 244, 247, 0.8);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.box-a {
  width: 180px;
  height: 120px;
  left: 14%;
  top: 26%;
}

.box-b {
  width: 220px;
  height: 150px;
  right: 12%;
  bottom: 24%;
}

.annotation-box:hover,
.annotation-box:focus-visible {
  border-color: var(--accent);
  background: rgba(209, 255, 102, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.annotation-box.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(209, 255, 102, 0.18), rgba(209, 255, 102, 0.06)),
    rgba(209, 255, 102, 0.12);
  box-shadow:
    0 0 0 1px rgba(209, 255, 102, 0.24),
    0 20px 32px rgba(0, 0, 0, 0.18);
}

.annotation-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5, 12, 18, 0.7);
  border: 1px solid rgba(209, 255, 102, 0.24);
  color: var(--text);
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
}

.box-a::after,
.box-b::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(209, 255, 102, 0.18);
  opacity: 0.85;
}

.world-scanline,
.world-safe-area {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.world-scanline {
  inset: 12px;
  border-radius: 18px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.028) 0 1px,
      transparent 1px 7px
    );
  opacity: 0.28;
}

.world-safe-area {
  left: 52px;
  right: 52px;
  top: 52px;
  bottom: 148px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.world-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.world-panel {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
}

.world-metrics-panel {
  background:
    radial-gradient(circle at top right, rgba(209, 255, 102, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.04);
}

.world-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.world-health-grid span {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 14, 20, 0.34);
}

.world-health-grid b,
.world-health-grid small {
  display: block;
}

.world-health-grid b {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.world-health-grid small {
  color: var(--muted);
  font-size: 0.76rem;
}

.mode-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-chip {
  padding: 0 12px;
}

.viewpoint-list li {
  padding: 0;
  border-bottom: none;
}

.viewpoint-item {
  width: 100%;
  text-align: left;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.viewpoint-item:hover,
.viewpoint-item:focus-visible {
  border-color: var(--line-strong);
  color: var(--text);
  outline: none;
}

.viewpoint-item.active {
  border-color: var(--line-strong);
  background: rgba(209, 255, 102, 0.08);
  color: var(--text);
}

.world-patch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.world-patch-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-patch-item strong {
  color: var(--accent);
}

.world-patch-item:hover span,
.world-patch-item:focus-visible span {
  color: var(--text);
}

.world-patch-item:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 4px;
}

.world-patch-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.world-panel-description {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.world-bottom-stack {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(12, 19, 28, 0.9), rgba(10, 17, 25, 0.76)),
    rgba(8, 14, 20, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 -16px 42px rgba(0, 0, 0, 0.22);
}

.shot-strip {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.shot-strip::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(209, 255, 102, 0.32), transparent);
}

.shot-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.shot-strip-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shot-chip {
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.shot-chip:hover,
.shot-chip:focus-visible {
  border-color: var(--line-strong);
  outline: none;
  color: var(--text);
  transform: translateY(-1px);
}

.shot-chip.active {
  border-color: var(--line-strong);
  background: rgba(209, 255, 102, 0.1);
  color: var(--text);
}

.shot-chip-index,
.shot-chip-copy {
  display: block;
}

.shot-chip-index {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
}

.world-timeline {
  position: relative;
  padding: 10px 0 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.world-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(159, 209, 255, 0.28), transparent);
}

.world-timeline-head,
.world-timeline-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
}

.world-timeline-head {
  margin-bottom: 8px;
}

.world-timeline-track {
  position: relative;
  height: 22px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.timeline-segment {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 999px;
}

.seg-a {
  left: 4%;
  width: 26%;
  background: linear-gradient(90deg, rgba(159, 209, 255, 0.7), rgba(159, 209, 255, 0.22));
}

.seg-b {
  left: 34%;
  width: 38%;
  background: linear-gradient(90deg, rgba(209, 255, 102, 0.88), rgba(209, 255, 102, 0.26));
}

.seg-c {
  left: 74%;
  width: 14%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.12));
}

.timeline-scrubber {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 68%;
  width: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.world-timeline-events {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-pill {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.event-pill.active {
  border-color: rgba(209, 255, 102, 0.24);
  color: var(--accent);
  background: rgba(209, 255, 102, 0.08);
}

.world-region-head {
  margin-bottom: 10px;
}

.world-region-list {
  margin-top: 12px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
  }

  .workspace-grid,
  .canvas-layout,
  .world-editor-layout,
  .hero-grid,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 14px, 1480px);
    margin: 7px auto;
  }

  .sidebar,
  .hero,
  .section {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-topbar {
    flex-direction: column;
  }

  .section-head-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-topbar h2 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .section-head h3 {
    max-width: none;
  }

  .canvas-node {
    position: relative;
    inset: auto;
    margin: 12px;
    left: auto !important;
    top: auto !important;
  }

  .canvas-board {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .canvas-link {
    display: none;
  }

  .world-video {
    min-height: 380px;
  }

  .shot-strip {
    position: static;
    margin-top: 12px;
  }

  .world-timeline {
    position: static;
    margin-top: 12px;
  }

  .world-bottom-stack {
    position: static;
    margin-top: 12px;
  }

  .world-monitor-strip {
    position: static;
    margin: 12px 0 0;
  }

  .shot-strip-list {
    grid-template-columns: 1fr;
  }

  .canvas-stream {
    position: static;
    grid-template-columns: 1fr;
    width: auto;
    margin: 18px 12px 0;
  }

  .canvas-signal-rail {
    position: static;
    margin: 0 12px 12px;
  }

  .canvas-stage-strip {
    position: static;
    grid-template-columns: 1fr;
    margin: 18px 12px 0;
  }

  .inspector-summary,
  .world-health-grid {
    grid-template-columns: 1fr;
  }

  .canvas-minimap {
    display: none;
  }
}
