/* ────────────────────────────────────────────────────────────
   PULSE — layout & component styles
   ────────────────────────────────────────────────────────── */

#root { min-height: 100vh; display: flex; flex-direction: column; }

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: oklch(from var(--surface) l c h / 0.78);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 22px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.022em;
  color: var(--ink);
  background: transparent;
  transition: background 0.15s var(--ease);
}
.brand:hover { background: oklch(1 0 0 / 0.04); }
.brand-glyph {
  width: 24px; height: 16px;
  color: var(--pulse);
  filter: drop-shadow(0 0 8px oklch(from var(--pulse) l c h / 0.6));
}
.brand-word {
  font-feature-settings: "ss01" 1;
  text-transform: lowercase;
}
.nav-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; align-self: center; }
.nav-vsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.nav-tabs { display: flex; gap: 2px; }
.nav-tab {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-tab:hover { color: var(--ink); background: var(--panel); }
.nav-tab.is-active { color: var(--ink); background: var(--panel-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* render meter */
.nav-meter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 6px;
  background: oklch(1 0 0 / 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  transition: all 0.15s var(--ease);
}
.nav-meter:hover { background: oklch(1 0 0 / 0.07); color: var(--ink); }
.nav-meter-ring {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--pulse);
}
.nav-meter-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.nav-meter-num .of { color: var(--ink-3); font-weight: 400; margin-left: 1px; }
.nav-meter-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.nav-meter.is-warn .nav-meter-ring,
.nav-meter.is-warn .nav-meter-num { color: oklch(0.86 0.15 72); }
.nav-meter.is-danger .nav-meter-ring,
.nav-meter.is-danger .nav-meter-num { color: oklch(0.74 0.20 28); }

/* plan pill */
.nav-plan {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  background: oklch(from var(--pulse) l c h / 0.12);
  border: 1px solid oklch(from var(--pulse) l c h / 0.36);
  border-radius: 999px;
  color: var(--pulse-hi);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-plan .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--pulse);
  box-shadow: 0 0 6px oklch(from var(--pulse) l c h / 0.7);
}

.nav-user {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--panel-hi);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink);
}

/* ── LANDING ─────────────────────────────────────────────── */
.landing { flex: 1; }

.hero { max-width: 1440px; margin: 0 auto; padding: 88px 32px 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 8vw, 108px);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.hero h1 em {
  font-style: italic;
  color: var(--pulse);
}
.hero p {
  margin-top: 26px;
  max-width: 48ch;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
}
.hero-actions { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.hero-stage .stage-tag {
  position: absolute; top: 18px; left: 18px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: oklch(from var(--surface) l c h / 0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  z-index: 3;
}
.hero-stage .stage-foot {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  background: linear-gradient(to top, oklch(0 0 0 / 0.6), transparent);
  color: var(--ink);
  z-index: 3;
}
.hero-stage .stage-foot h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 32px;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.hero-stage .stage-foot p {
  margin-top: 4px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: oklch(0.96 0.008 80 / 0.78);
  letter-spacing: 0.02em;
}

/* metric strip below hero */
.metrics {
  max-width: 1440px; margin: 0 auto;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 36px;
}
.metric .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 56px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.metric .lbl {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 26ch;
  line-height: 1.4;
}

/* section base */
.section {
  max-width: 1440px; margin: 0 auto;
  padding: 80px 32px;
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
  max-width: 22ch;
}
.section-head h2 em { font-style: italic; color: var(--pulse); }
.section-head .lead { max-width: 38ch; color: var(--ink-2); font-size: 16px; line-height: 1.5; }

/* live strip — three characters in different shapes */
.live-strip { display: grid; grid-template-columns: 1.1fr 1fr 0.9fr; gap: 24px; }
.live-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  overflow: hidden;
  min-height: 460px;
  display: flex; flex-direction: column;
}
.live-card .stage {
  margin: -28px -28px 0;
  aspect-ratio: 16/10;
  background: var(--surface-2);
  position: relative; overflow: hidden;
}
.live-card .stage.shape-circle .stage-inner { border-radius: 999px; }
.live-card .stage.shape-pill .stage-inner { border-radius: 999px; }
.live-card .stage.shape-rounded .stage-inner { border-radius: var(--r-lg); }
.live-card .stage-inner {
  position: absolute; inset: 18px;
  overflow: hidden;
  border-radius: var(--r-md);
}
.live-card .stage-inner video, .live-card .stage-inner img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.live-card .meta { margin-top: 22px; flex: 1; display: flex; flex-direction: column; }
.live-card h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.live-card .desc { margin-top: 6px; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.live-card .row { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.live-card .footrow {
  margin-top: auto; padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* how it works */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step {
  padding: 28px 24px 32px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 220px;
}
.step .n {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 44px; line-height: 1;
  color: var(--pulse);
  letter-spacing: -0.02em;
}
.step h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.step p { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.step .label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

/* on any site (embed showcase) */
.embed-showcase {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px;
  align-items: stretch;
}
.embed-canvas {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
  min-height: 540px;
}
.embed-mock-browser {
  position: absolute; inset: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.mock-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.mock-bar .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--panel-hi); }
.mock-bar .url {
  margin-left: 8px;
  padding: 4px 12px;
  background: var(--surface);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
  flex: 1;
  max-width: 280px;
}
.mock-body {
  flex: 1; padding: 28px; position: relative;
  display: flex; gap: 24px;
}
.mock-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.mock-text .line { height: 10px; background: var(--panel); border-radius: 4px; }
.mock-text .line.w-70 { width: 70%; }
.mock-text .line.w-50 { width: 50%; }
.mock-text .line.w-90 { width: 90%; }
.mock-text .line.w-40 { width: 40%; }
.mock-text .h { height: 22px; width: 60%; background: var(--panel-2); border-radius: 6px; margin-bottom: 6px; }
.mock-sidebar { width: 200px; display: flex; flex-direction: column; gap: 14px; }
.mock-sidebar .pill { height: 32px; background: var(--panel); border-radius: var(--r-pill); }

/* embed snippet box */
.snippet-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.snippet-box h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.snippet-mode {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.snippet-mode button {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.snippet-mode button.is-on { background: var(--pulse-soft); color: var(--pulse-hi); border-color: var(--pulse); }
.snippet-code {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 18px;
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  line-height: 1.7;
  border: 1px solid var(--line);
  position: relative;
}
.snippet-code .tag { color: var(--cool); }
.snippet-code .attr { color: var(--pulse-hi); }
.snippet-code .str { color: oklch(0.78 0.10 165); }
.snippet-copy {
  position: absolute; top: 12px; right: 12px;
  padding: 5px 10px; background: var(--panel-2); border-radius: var(--r-pill);
  font-size: 11px; color: var(--ink-2);
  border: 1px solid var(--line);
}

/* footer */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 64px;
}
.foot-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 36px 32px 48px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

/* ── BOARD ───────────────────────────────────────────────── */
.board { flex: 1; padding: 40px 32px 80px; max-width: 1440px; margin: 0 auto; width: 100%; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; flex-wrap: wrap; gap: 18px; }
.board-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.025em;
}
.board-head h1 .reg { font-style: normal; color: var(--ink-3); display: block; font-size: 0.5em; letter-spacing: 0; text-transform: uppercase; font-family: var(--font-mono); font-weight: 500; margin-bottom: 8px; }
.board-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.board-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.18s var(--ease);
  cursor: pointer;
}
.board-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.board-card .thumb {
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  position: relative; overflow: hidden;
}
.board-card .thumb img, .board-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.board-card .thumb .dot-row {
  position: absolute; bottom: 12px; left: 12px;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px;
  background: oklch(0 0 0 / 0.55);
  backdrop-filter: blur(12px);
  border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink); letter-spacing: 0.04em;
}
.board-card .body { padding: 18px 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.board-card .name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.board-card .desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.board-card .meta { margin-top: 12px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }

.board-add {
  background: transparent;
  border: 1px dashed var(--line-strong);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 32px;
  gap: 10px;
  min-height: 380px;
  color: var(--ink-2);
}
.board-add:hover { background: var(--panel); border-color: var(--pulse); color: var(--ink); }
.board-add .plus {
  width: 48px; height: 48px; border-radius: 999px;
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border: 1px solid var(--line);
  color: var(--pulse);
}
.board-add .title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.board-add p { font-size: 12.5px; color: var(--ink-3); max-width: 28ch; }

/* ── STUDIO ──────────────────────────────────────────────── */
.studio { flex: 1; display: grid; grid-template-columns: 280px 1fr 340px; gap: 0; min-height: 0; }
.studio-rail {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.studio-rail.right { border-right: none; border-left: 1px solid var(--line); }

.rail-head {
  padding: 18px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.rail-head h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.rail-head .count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.rail-body { flex: 1; overflow-y: auto; padding: 0 12px 24px; }
.rail-search {
  margin: 0 12px 12px;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  width: calc(100% - 24px);
}
.rail-search:focus { border-color: var(--pulse); }

.cat-group { margin-top: 14px; }
.cat-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px 8px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase;
}
.cat-group-head .lhs { display: flex; align-items: center; gap: 8px; }

.scene-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.12s var(--ease);
  border: 1px solid transparent;
}
.scene-item:hover { background: var(--panel); }
.scene-item.is-active { background: var(--panel-2); border-color: var(--line-strong); }
.scene-item .thumb {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--panel-hi);
  flex-shrink: 0; overflow: hidden;
  position: relative;
}
.scene-item .thumb video, .scene-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.scene-item .scene-name { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-item .scene-meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
.scene-item.is-idle-pool .scene-name::after {
  content: "";
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: var(--pulse); margin-left: 8px; vertical-align: middle;
}

/* center stage */
.stage-center {
  display: flex; flex-direction: column;
  background: var(--surface);
  min-width: 0;
}
.stage-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}
.stage-head .character {
  display: flex; align-items: center; gap: 12px;
}
.stage-head .character .av {
  width: 36px; height: 36px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.stage-head .character .av img { width: 100%; height: 100%; object-fit: cover; }
.stage-head .character .name {
  font-family: var(--font-display); font-style: italic;
  font-size: 22px; letter-spacing: -0.02em;
  line-height: 1;
}
.stage-head .character .sub {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}

.stage-view-toggle {
  display: flex; gap: 2px;
  background: var(--panel);
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}
.stage-view-toggle button {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--ink-2);
  transition: all 0.18s var(--ease);
}
.stage-view-toggle button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.stage-body { flex: 1; overflow: auto; padding: 36px 24px; display: flex; flex-direction: column; align-items: center; gap: 28px; min-height: 0; }
.stage-frame {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), border-radius 0.3s var(--ease-out);
}
.stage-frame video, .stage-frame img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--surface); }
.stage-frame.shape-circle { border-radius: 999px; }
.stage-frame.shape-pill { border-radius: 999px; }
.stage-frame.shape-rounded { border-radius: 28px; }
.stage-frame.shape-square { border-radius: 0; }
.stage-frame .badge {
  position: absolute; top: 16px; left: 16px;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  background: oklch(0 0 0 / 0.55);
  backdrop-filter: blur(12px);
  border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink); letter-spacing: 0.04em;
}

.stage-controls {
  display: flex; gap: 28px; flex-wrap: wrap;
  align-items: center; justify-content: center;
}
.ctl-group { display: flex; align-items: center; gap: 8px; }
.ctl-group .ctl-label {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); letter-spacing: 0.08em;
  text-transform: uppercase;
}
.shape-bar, .size-bar { display: flex; gap: 2px; padding: 3px; background: var(--panel); border-radius: var(--r-pill); border: 1px solid var(--line); }
.shape-bar button, .size-bar button {
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 12px; color: var(--ink-2);
}
.shape-bar button.is-on, .size-bar button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.stage-cyclebar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
}
.stage-cyclebar .cb-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.stage-cyclebar .cb-state { color: var(--pulse); font-weight: 500; }
.toggle {
  position: relative; width: 32px; height: 18px;
  background: var(--panel-hi); border-radius: 999px;
  cursor: pointer; transition: background 0.18s;
}
.toggle::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; border-radius: 999px;
  background: var(--ink); transition: transform 0.18s var(--ease);
}
.toggle.is-on { background: var(--pulse); }
.toggle.is-on::after { transform: translateX(14px); }

/* right rail — behavior */
.behavior-section { padding: 18px 18px 4px; }
.behavior-section + .behavior-section { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 18px; }
.behavior-section h4 {
  font-size: 12px; font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}
.behavior-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.behavior-row .lbl { font-size: 13px; color: var(--ink); }
.behavior-row .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.behavior-row .val { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px; }
.stepper button { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--ink-2); font-size: 14px; }
.stepper button:hover { background: var(--panel-2); color: var(--ink); }
.stepper .v { font-family: var(--font-mono); font-size: 12.5px; min-width: 18px; text-align: center; }

.idle-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--pulse-soft);
  border: 1px solid var(--pulse);
  border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--pulse-hi);
}
.pool-chip button { color: inherit; opacity: 0.6; }
.pool-chip button:hover { opacity: 1; }

.transition-rule {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 12px;
  margin-bottom: 6px;
}
.transition-rule .arrow { color: var(--cool); }
.transition-rule .from, .transition-rule .to { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }

/* tabs */
.studio-tabs button { white-space: nowrap; }
.studio-tabs {
  display: flex; gap: 4px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.studio-tabs button {
  padding: 9px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px; color: var(--ink-2);
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.studio-tabs button:hover { color: var(--ink); }
.studio-tabs button.is-on { background: var(--panel); color: var(--ink); }

/* ── GRAPH ───────────────────────────────────────────────── */
.graph-wrap {
  flex: 1; display: grid; grid-template-columns: 1fr 340px;
  min-height: 0;
}
.graph-canvas {
  position: relative;
  background: var(--surface);
  background-image:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: 14px 14px;
  overflow: auto;
}
.graph-svg { display: block; }
.graph-node {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  min-width: 160px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  box-shadow: var(--shadow-sm);
}
.graph-node:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.graph-node.is-active { border-color: var(--pulse); box-shadow: var(--shadow-pulse); }
.graph-node.is-idle { background: oklch(from var(--cat-idle) l c h / 0.10); }
.graph-node .thumb { width: 36px; height: 36px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); flex-shrink: 0; }
.graph-node .thumb video, .graph-node .thumb img { width: 100%; height: 100%; object-fit: cover; }
.graph-node .name { font-size: 12.5px; font-weight: 500; line-height: 1.2; }
.graph-node .meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }

.graph-cluster {
  position: absolute;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  pointer-events: none;
}
.graph-cluster .lbl {
  position: absolute; top: -11px; left: 18px;
  padding: 2px 10px;
  background: var(--surface);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.graph-cluster.sub-machine {
  border-color: var(--cat-twopart);
  background: oklch(from var(--cat-twopart) l c h / 0.04);
}
.graph-cluster.sub-machine .lbl { color: var(--cat-twopart); background: var(--surface); }

.graph-aside {
  border-left: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.trace {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: oklch(from var(--surface) l c h / 0.6);
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  white-space: nowrap;
  display: flex; align-items: center; gap: 12px;
}
.trace .pulse-dot { width: 8px; height: 8px; }
.trace .now { color: var(--pulse); }
.trace .arr { color: var(--ink-4); margin: 0 8px; }

/* ── SHOWROOM ────────────────────────────────────────────── */
.showroom { flex: 1; padding: 36px 32px 64px; max-width: 1440px; margin: 0 auto; width: 100%; }
.showroom-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}
.showroom-stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  position: relative;
  min-height: 640px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.showroom-stage h2 {
  font-family: var(--font-display); font-style: italic;
  font-size: 28px; font-weight: 400; letter-spacing: -0.02em;
}
.showroom-stage .lead { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

.context-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  flex: 1;
}
.context-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.context-card .label {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 12px;
}
.context-card .frame {
  background: var(--panel);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  padding: 18px;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

/* embed snippet on right */
.embed-config {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex; flex-direction: column; gap: 22px;
  min-height: 640px;
}
.embed-config .opt { display: flex; flex-direction: column; gap: 10px; }
.embed-config .opt-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; }
.embed-config .opt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.embed-config .opt-row button {
  padding: 7px 12px; border-radius: var(--r-pill);
  font-size: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.embed-config .opt-row button.is-on { background: var(--pulse-soft); color: var(--pulse-hi); border-color: var(--pulse); }

/* ── SCENE CREATOR DRAWER ──────────────────────────────── */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: oklch(0 0 0 / 0.5);
  display: flex; justify-content: flex-end;
}
.drawer {
  width: min(560px, 100vw); height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  animation: slidein 0.28s var(--ease-out);
}
@keyframes slidein {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-head {
  padding: 22px 28px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  font-family: var(--font-display); font-style: italic;
  font-size: 28px; font-weight: 400; letter-spacing: -0.02em;
}
.drawer-close {
  width: 32px; height: 32px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--ink-2);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
}

.type-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 24px; }
.type-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s;
}
.type-card:hover { background: var(--panel-2); color: var(--ink); }
.type-card.is-on { background: var(--pulse-soft); border-color: var(--pulse); color: var(--pulse-hi); }
.type-card svg { width: 22px; height: 22px; }

.prompt-field {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 14px; line-height: 1.5;
  color: var(--ink);
  outline: none;
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-ui);
}
.prompt-field:focus { border-color: var(--pulse); }

.suggestion {
  display: inline-block; margin: 4px 6px 4px 0;
  padding: 5px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}
.suggestion:hover { background: var(--pulse-soft); color: var(--pulse-hi); border-color: var(--pulse); }

/* utility row */
.row { display: flex; align-items: center; gap: 10px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

@media (max-width: 900px) {
  .hero-grid, .embed-showcase, .live-strip, .steps, .metrics, .showroom-grid { grid-template-columns: 1fr; }
  .studio { grid-template-columns: 240px 1fr 280px; }
}
