/* Shared palette from src/supertools.c3 (lines 20-29) */
:root {
  --bg-top: #16181f;
  --bg-bottom: #0c0d11;
  --card: #1c1f27;
  --card-hover: #242833;
  --edge: #2c313d;
  --accent: #5ab4ff;
  --accent-glow: rgba(90, 180, 255, 0.35);
  --accent-soft: rgba(90, 180, 255, 0.12);
  --ink: #eceef3;
  --muted: #8b92a3;
  --faint: #5a6070;

  --surface: #12141b;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;

  --radius-win: 12px;
  --radius-thumb: 8px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-bottom);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 36%, var(--bg-bottom) 100%);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

.page-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 460px at 50% -60px, rgba(90, 180, 255, 0.11), transparent 65%),
    radial-gradient(600px 400px at 85% 24%, rgba(90, 180, 255, 0.045), transparent 70%);
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

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

code,
pre,
kbd {
  font-family: var(--font-mono);
}

p code,
label code {
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.1em 0.42em;
  border-radius: 5px;
  color: var(--ink);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: #171a22;
  border: 1px solid var(--edge);
  border-bottom-width: 2px;
  border-radius: 5px;
  line-height: 1;
  transition: border-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

kbd.is-pressed {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(1px);
}

.sep {
  color: var(--faint);
}

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

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(16, 18, 24, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-glyph {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  gap: 3px;
}

.brand-glyph span {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--edge);
}

.brand-glyph span.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.brand-glyph-sm {
  grid-template-columns: repeat(2, 5px);
  gap: 2px;
}

.brand-glyph-sm span {
  width: 5px;
  height: 5px;
}

.brand-name {
  font-size: 16px;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13.5px;
  color: var(--muted);
}

.nav-links a {
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

/* HERO */
.hero {
  padding: 96px 0 76px;
}

.hero-copy {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(2.45rem, 5.2vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero-lead {
  margin: 0 auto 36px;
  max-width: 740px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #091019;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(90, 180, 255, 0.24);
}

.btn-primary:hover {
  background: #74c2ff;
  box-shadow: 0 0 28px rgba(90, 180, 255, 0.36);
}

.btn-primary kbd {
  background: rgba(9, 16, 25, 0.14);
  border-color: rgba(9, 16, 25, 0.25);
  color: #091019;
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--edge);
}

.btn-ghost:hover {
  background: var(--card-hover);
  border-color: #3e4556;
}

.btn-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
}

/* WORKS IN STRIP */
.works-in {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.works-in-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.works-in-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 660px;
}

.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(28, 31, 39, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.client-pill img {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
  opacity: 0.9;
  transition: opacity 0.14s ease;
}

.client-pill:hover {
  background: var(--card-hover);
  border-color: rgba(90, 180, 255, 0.45);
  color: var(--ink);
  transform: translateY(-1px);
}

.client-pill:hover img {
  opacity: 1;
}

/* STAGE SHELL */
.stage-shell {
  border-radius: 16px;
  border: 1px solid var(--edge);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(22, 24, 31, 0.78);
  flex-wrap: wrap;
}

.tool-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-bottom);
  border: 1px solid var(--edge);
}

.tool-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.tool-tab:hover {
  color: var(--ink);
}

.tool-tab.is-active {
  background: var(--card-hover);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tool-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.tool-tab.is-active .tool-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.stage-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.preset-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.preset-tab:hover {
  color: var(--ink);
  background: var(--card);
  border-color: var(--edge);
}

.preset-tab.is-active {
  color: var(--ink);
  background: var(--card);
  border-color: rgba(90, 180, 255, 0.4);
}

.flag-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}

.preset-tab.is-active .flag-pill {
  color: var(--accent);
}

.recenter-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--edge);
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--font-sans);
  cursor: pointer;
}

.recenter-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* TUI SURFACE + FLOATING SUPERTOOLS WINDOW */
.desktop-canvas {
  position: relative;
  min-height: 540px;
  padding: 58px 24px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08090d;
  overflow: hidden;
  outline: none;
}

.desktop-canvas:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(90, 180, 255, 0.45);
}

.term-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: #08090d;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: 0.36;
  transition: opacity 0.25s ease;
}

.term-backdrop.is-awake {
  opacity: 1;
}

.term-backdrop.is-awake .term-title {
  color: #8b94a8;
}

.term-backdrop.is-awake .term-badge {
  color: rgba(90, 180, 255, 0.85);
}

.term-backdrop.is-awake .term-line-user {
  color: #e6ebf5;
}

.term-backdrop.is-awake .term-line-user .t-sym,
.term-backdrop.is-awake .term-line-tool .t-sym,
.term-backdrop.is-awake .term-prompt-arrow {
  color: var(--accent);
}

.term-backdrop.is-awake .term-line-tool {
  color: #aeb8cc;
}

.term-backdrop.is-awake .term-line-tool .t-fn {
  color: #e6ebf5;
}

.term-backdrop.is-awake .term-line-sub {
  color: #7c869c;
}

.term-backdrop.is-awake .term-line-sub.is-ok {
  color: #4ade80;
}

.term-backdrop.is-awake .term-line-sub.is-wait {
  color: var(--accent);
}

.term-backdrop.is-awake .term-line-agent {
  color: #cbd3e3;
}

.term-backdrop.is-awake .term-line-agent .t-sym {
  color: #8b94a8;
}

.term-backdrop.is-awake .term-input-placeholder {
  color: #7c869c;
}

.term-backdrop.is-awake .term-cursor {
  background: var(--accent);
}

.term-line-in {
  animation: termLineIn 0.2s ease both;
}

@keyframes termLineIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.term-chrome {
  height: 32px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  flex-shrink: 0;
}

.term-title {
  color: #464d5e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-badge {
  font-size: 10.5px;
  color: rgba(130, 155, 185, 0.55);
  white-space: nowrap;
}

.term-body {
  flex: 1;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #555d70;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.term-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-line-user {
  color: #8f98ab;
  font-weight: 500;
}

.term-line-user .t-sym {
  color: rgba(90, 180, 255, 0.55);
}

.term-line-tool {
  color: #6c7589;
}

.term-line-tool .t-sym {
  color: rgba(90, 180, 255, 0.5);
}

.term-line-tool .t-fn {
  color: #96a0b5;
  font-weight: 500;
}

.term-line-sub {
  padding-left: 18px;
  color: #484f61;
}

.term-line-sub.is-ok {
  color: rgba(74, 222, 128, 0.52);
}

.term-line-sub.is-warn {
  color: rgba(251, 191, 36, 0.52);
}

.term-line-sub.is-wait {
  color: rgba(90, 180, 255, 0.55);
}

.term-line-agent {
  color: #778094;
  padding-top: 2px;
}

.term-line-agent .t-sym {
  color: #4f5668;
}

.term-input-row {
  height: 40px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  background: rgba(12, 14, 19, 0.52);
  font-family: var(--font-mono);
  font-size: 12px;
  flex-shrink: 0;
}

.term-prompt-arrow {
  color: rgba(90, 180, 255, 0.5);
  font-weight: 600;
}

.term-input-placeholder {
  color: #434a5b;
}

.term-cursor {
  width: 7px;
  height: 14px;
  background: rgba(90, 180, 255, 0.38);
  border-radius: 1px;
  animation: blink 1.15s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

/* PIXEL-FAITHFUL NATIVE SUPERTOOLS WINDOW */
.pk-window {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  padding: 18px 26px 26px;
  border-radius: var(--radius-win);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    0 32px 92px rgba(0, 0, 0, 0.88),
    0 6px 20px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pk-window[hidden] {
  display: none;
}

.pk-window.is-launching {
  opacity: 0;
  transform: translateY(10px) scale(0.975);
  pointer-events: none;
}

.pk-window.is-dragging {
  transition: none;
  box-shadow:
    0 34px 82px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(90, 180, 255, 0.22);
}

.pk-window.is-hidden-exited {
  opacity: 0.14;
  pointer-events: none;
  filter: blur(2px);
}

.pk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 18px;
}

[data-drag-handle] {
  cursor: grab;
}

[data-drag-handle]:active {
  cursor: grabbing;
}

.pk-header {
  min-width: 0;
  flex: 1;
}

.pk-prompt {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.pk-prompt:empty {
  display: none;
}

.pk-sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.pk-none-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--radius-thumb);
  background: var(--card);
  border: 1px solid var(--edge);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.pk-none-btn:hover {
  background: var(--card-hover);
  border-color: #3d4455;
}

.pk-none-btn[hidden] {
  display: none;
}

.pk-primary-btn {
  flex-shrink: 0;
  padding: 7px 15px;
  border-radius: var(--radius-thumb);
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0c0d11;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}

.pk-primary-btn:hover {
  background: #7cc4ff;
}

/* PICKER GRID */
.pk-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pk-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-win);
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  color: var(--ink);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.14s ease, transform 0.1s ease;
}

.pk-tile:hover {
  background: var(--card-hover);
}

.pk-tile.is-selected {
  border: 2px solid var(--accent);
  padding: 13px 15px;
  box-shadow: 0 0 18px 1px rgba(90, 180, 255, 0.35);
}

.pk-tile:active {
  transform: scale(0.988);
}

.pk-tile-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-thumb);
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pk-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pk-tile-thumb.is-svg-mark {
  background: #0e1016;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pk-tile-thumb.is-svg-mark img {
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.pk-tile-caption {
  padding-top: 12px;
}

.pk-tile-caption.no-image {
  padding-top: 0;
}

.pk-tile-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}

.pk-tile-desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.pk-tile-idx {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  background: rgba(12, 13, 17, 0.72);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity 0.14s ease;
  pointer-events: none;
}

.pk-tile:hover .pk-tile-idx,
.pk-tile.is-selected .pk-tile-idx {
  opacity: 1;
}

.pk-tile.is-selected .pk-tile-idx {
  color: var(--accent);
  border-color: rgba(90, 180, 255, 0.35);
}

/* POINTER (DRAW) & VIEW PANELS */
.pk-window-pointer {
  padding-bottom: 18px;
}

.ptr-canvas-grid {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-items: start;
}

.ptr-canvas-grid.layout-1 {
  grid-template-columns: minmax(0, 390px);
  justify-content: center;
}

.ptr-canvas-grid.layout-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ptr-canvas-grid.layout-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ptr-canvas-grid.layout-4 {
  grid-template-columns: repeat(2, minmax(0, 285px));
  justify-content: center;
}

.ptr-panel {
  width: 100%;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--edge);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ptr-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
}

.ptr-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.ptr-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.ptr-caption {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ptr-caption-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.ptr-caption-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.ptr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.ptr-footer[hidden] {
  display: none;
}

.ptr-footer-compact {
  margin-top: 12px;
  padding-top: 12px;
}

.ptr-swatches {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ptr-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

.ptr-swatch:hover {
  transform: scale(1.1);
}

.ptr-swatch.is-active {
  box-shadow: 0 0 0 3px var(--accent);
}

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

/* EXITED OVERLAY */
.pk-exited {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pk-exited[hidden] {
  display: none;
}

.pk-exited-card {
  width: 100%;
  max-width: 520px;
  padding: 22px 24px;
  border-radius: 14px;
  background: rgba(22, 24, 31, 0.96);
  border: 1px solid var(--edge);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.76), 0 0 0 1px rgba(90, 180, 255, 0.14);
  backdrop-filter: blur(10px);
}

.pk-exited-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.exit-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.exit-badge.is-ok {
  background: rgba(74, 222, 128, 0.14);
  color: var(--ok);
  border: 1px solid rgba(74, 222, 128, 0.28);
}

.exit-badge.is-cancel {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.exited-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.exited-thumbs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.exited-thumbs[hidden] {
  display: none;
}

.exited-thumb {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  object-fit: cover;
  background: #000;
}

.exited-stdout {
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--bg-bottom);
  border: 1px solid var(--edge);
  font-size: 12.5px;
  color: var(--accent);
  overflow-x: auto;
  max-height: 150px;
}

.exited-agent {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.pk-exited-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* INSPECTOR */
.inspector {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0e1016;
}

.inspector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inspector-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-bottom);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.inspector-tab {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.inspector-tab:hover {
  color: var(--ink);
}

.inspector-tab.is-active {
  background: var(--card);
  color: var(--ink);
}

.inspector-body {
  padding: 14px 16px;
}

.code-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.code-row + .code-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.code-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.code-line {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.code-line .dim {
  color: var(--faint);
}

.code-line .out-hl {
  color: var(--accent);
  font-weight: 500;
}

.mini-copy {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--edge);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.mini-copy:hover {
  color: var(--ink);
  background: var(--card-hover);
  border-color: #3f4759;
}

.mini-copy.is-copied {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.4);
}

.mcp-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mcp-col .code-label {
  margin-bottom: 6px;
}

.code-block-sm {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-bottom);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  overflow-x: auto;
  max-height: 220px;
}

/* SECTIONS */
.section {
  padding: 84px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-alt {
  background: rgba(22, 24, 31, 0.34);
}

.section-head {
  max-width: 660px;
  margin-bottom: 34px;
}

.section-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.section-desc {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}

/* PLAYGROUND / EXAMPLES */
.pg-mode-bar {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pg-presets-bar {
  margin-bottom: 20px;
}

.pg-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--edge);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.pg-mode-btn code {
  color: var(--ink);
  font-size: 12px;
}

.pg-mode-btn span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
}

.pg-mode-btn:hover {
  background: var(--card);
}

.pg-mode-btn.is-active {
  background: var(--card-hover);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(90, 180, 255, 0.16);
}

.pg-mode-btn.is-active span {
  color: var(--accent);
}

.pg-output {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pg-preview-wrap {
  position: relative;
  overflow: hidden;
  height: 540px;
  padding: 48px 24px 52px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: #08090d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#pg-preview-window {
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

#pg-preview-window .ptr-stage {
  max-height: 215px;
}

#pg-preview-window .layout-4 .ptr-stage {
  max-height: 112px;
}

#pg-pk-grid {
  min-height: 0;
  overflow-y: auto;
}

#pg-ptr-footer {
  flex-shrink: 0;
}

.pg-toast-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}

.pg-toast {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--edge);
  max-width: 100%;
  overflow-x: auto;
  transition: opacity 0.2s ease;
}

.pg-toast.is-launching {
  opacity: 0;
  pointer-events: none;
}

.pg-reopen-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(90, 180, 255, 0.35);
  background: rgba(90, 180, 255, 0.12);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.pg-reopen-btn:hover {
  background: rgba(90, 180, 255, 0.2);
  border-color: var(--accent);
  color: var(--ink);
}

.pg-reopen-btn[hidden] {
  display: none;
}

.pg-toast strong {
  color: var(--accent);
}

.pg-code-card {
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: #0e1016;
  overflow: hidden;
}

.pg-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pg-code-pre {
  margin: 0;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  overflow-x: auto;
  max-height: 250px;
}

/* INSTALL + MCP SECTION */
#install .section-head {
  margin: 0 auto 28px;
  text-align: center;
}

.install-box {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.os-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--edge);
  align-self: center;
}

.os-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.os-tab.is-active {
  background: var(--card-hover);
  border-color: rgba(90, 180, 255, 0.35);
  color: var(--ink);
}

.os-tab:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.os-soon {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.install-card {
  width: 100%;
}

.install-card pre {
  font-size: 13px;
  line-height: 1.6;
  padding: 16px 18px;
}

.mcp-connect {
  width: 100%;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 84px;
}

.install-step-heading {
  margin: 0 0 2px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}

.client-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.client-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--edge);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.client-tab img {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.client-tab:hover {
  color: var(--ink);
  background: var(--card);
}

.client-tab.is-active {
  background: var(--card-hover);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 12px rgba(90, 180, 255, 0.16);
}

.code-card {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: #0e1016;
  overflow: hidden;
}

.code-card[hidden] {
  display: none;
}

.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.code-card pre {
  margin: 0;
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  color: var(--ink);
}

.callout {
  padding: 13px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.callout-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.callout p {
  margin: 0;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.55;
}

.trace-card {
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: #0e1016;
  overflow: hidden;
}

.trace-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--surface);
}

.trace-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.trace-step:hover {
  color: var(--ink);
}

.trace-step.is-active {
  color: var(--ink);
  background: rgba(90, 180, 255, 0.05);
  border-bottom-color: var(--accent);
}

.step-num {
  color: var(--faint);
  font-size: 11px;
}

.trace-step.is-active .step-num {
  color: var(--accent);
}

.trace-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(22, 24, 31, 0.45);
}

.trace-subbar[hidden] {
  display: none;
}

.trace-sublabel {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trace-panes {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trace-dir {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.trace-pre {
  margin: 0;
  padding: 13px 14px;
  border-radius: 9px;
  background: var(--bg-bottom);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  overflow-x: auto;
  max-height: 260px;
}

/* INTERNALS */
#internals {
  padding: 56px 0;
}

#internals .section-head {
  margin-bottom: 18px;
}

#internals h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  margin-bottom: 8px;
}

#internals .section-desc {
  font-size: 14px;
  line-height: 1.65;
}

.build-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: linear-gradient(90deg, rgba(28, 31, 39, 0.7), rgba(18, 20, 27, 0.9));
  flex-wrap: wrap;
}

.build-info h3 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 600;
}

.build-info p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(90, 180, 255, 0.4);
  transition: color 0.14s ease, text-decoration-color 0.14s ease;
}

.text-link:hover {
  color: #82c8ff;
  text-decoration-color: #82c8ff;
}

.build-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* FOOTER */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.footer-right a:hover {
  color: var(--ink);
}

/* JSON SYNTAX TINTING */
.dim { color: var(--faint); }
.tok-key { color: #93c5fd; }
.tok-str { color: #a7f3d0; }
.tok-num { color: #fde68a; }
.tok-bool { color: #c4b5fd; }

/* RESPONSIVE */
@media (max-width: 980px) {
  .mcp-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 44px 0 48px;
  }

  .pg-preview-wrap {
    padding: 20px 14px 18px;
  }

  .pk-window {
    padding: 14px 14px 18px;
  }

  .pk-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .ptr-canvas-grid.layout-2,
  .ptr-canvas-grid.layout-3,
  .ptr-canvas-grid.layout-4 {
    grid-template-columns: 1fr;
  }
}
