:root {
  color-scheme: light dark;
  --color-scheme: light;

  /* Light palette (Apple Notes crisp paper) */
  --bg-l: #f6f7f9;
  --surface-l: #ffffff;
  --elevated-l: #f1f3f7;
  --win-l: #fafbfc;
  --line-l: rgba(15, 23, 42, 0.09);
  --line-strong-l: rgba(15, 23, 42, 0.18);
  --text-l: #111318;
  --muted-l: #4b5262;
  --dim-l: #687082;
  --btn-bg-l: #111318;
  --btn-fg-l: #ffffff;
  --indigo-l: #4f46e5;
  --indigo-hi-l: #4338ca;
  --emerald-l: #047857;
  --amber-l: #b45309;
  --ruby-l: #dc2626;
  --topbar-l: rgba(246, 247, 249, 0.84);
  --sheet-l: rgba(255, 255, 255, 0.88);
  --shadow-l: 0 18px 44px rgba(15, 23, 42, 0.07);
  --scroll-thumb-l: #7b8292;
  --scroll-track-l: #eceef2;

  /* Dark palette (Linear obsidian) */
  --bg-d: #08090a;
  --surface-d: #0e1014;
  --elevated-d: #14171f;
  --win-d: #090a0d;
  --line-d: rgba(255, 255, 255, 0.08);
  --line-strong-d: rgba(255, 255, 255, 0.16);
  --text-d: #f7f8f8;
  --muted-d: #9499a4;
  --dim-d: #6c717d;
  --btn-bg-d: #f7f8f8;
  --btn-fg-d: #08090a;
  --indigo-d: #5e6ad2;
  --indigo-hi-d: #8b95f6;
  --emerald-d: #34d399;
  --amber-d: #fbbf24;
  --ruby-d: #f87171;
  --topbar-d: rgba(8, 9, 10, 0.82);
  --sheet-d: rgba(8, 9, 10, 0.86);
  --shadow-d: 0 24px 60px rgba(0, 0, 0, 0.48);
  --scroll-thumb-d: #7d8390;
  --scroll-track-d: #14171f;

  /* Fallback assignments (default light, switched below for older browsers) */
  --bg: var(--bg-l);
  --surface: var(--surface-l);
  --elevated: var(--elevated-l);
  --win: var(--win-l);
  --line: var(--line-l);
  --line-strong: var(--line-strong-l);
  --text: var(--text-l);
  --muted: var(--muted-l);
  --dim: var(--dim-l);
  --btn-bg: var(--btn-bg-l);
  --btn-fg: var(--btn-fg-l);
  --indigo: var(--indigo-l);
  --indigo-hi: var(--indigo-hi-l);
  --emerald: var(--emerald-l);
  --amber: var(--amber-l);
  --ruby: var(--ruby-l);
  --topbar: var(--topbar-l);
  --sheet: var(--sheet-l);
  --shadow: var(--shadow-l);
  --scroll-thumb: var(--scroll-thumb-l);
  --scroll-track: var(--scroll-track-l);

  @media (prefers-color-scheme: dark) {
    --color-scheme: dark;
    --bg: var(--bg-d);
    --surface: var(--surface-d);
    --elevated: var(--elevated-d);
    --win: var(--win-d);
    --line: var(--line-d);
    --line-strong: var(--line-strong-d);
    --text: var(--text-d);
    --muted: var(--muted-d);
    --dim: var(--dim-d);
    --btn-bg: var(--btn-bg-d);
    --btn-fg: var(--btn-fg-d);
    --indigo: var(--indigo-d);
    --indigo-hi: var(--indigo-hi-d);
    --emerald: var(--emerald-d);
    --amber: var(--amber-d);
    --ruby: var(--ruby-d);
    --topbar: var(--topbar-d);
    --sheet: var(--sheet-d);
    --shadow: var(--shadow-d);
    --scroll-thumb: var(--scroll-thumb-d);
    --scroll-track: var(--scroll-track-d);
  }

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
    --color-scheme: dark;
    --bg: var(--bg-d);
    --surface: var(--surface-d);
    --elevated: var(--elevated-d);
    --win: var(--win-d);
    --line: var(--line-d);
    --line-strong: var(--line-strong-d);
    --text: var(--text-d);
    --muted: var(--muted-d);
    --dim: var(--dim-d);
    --btn-bg: var(--btn-bg-d);
    --btn-fg: var(--btn-fg-d);
    --indigo: var(--indigo-d);
    --indigo-hi: var(--indigo-hi-d);
    --emerald: var(--emerald-d);
    --amber: var(--amber-d);
    --ruby: var(--ruby-d);
    --topbar: var(--topbar-d);
    --sheet: var(--sheet-d);
    --shadow: var(--shadow-d);
    --scroll-thumb: var(--scroll-thumb-d);
    --scroll-track: var(--scroll-track-d);
  }

  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
    --color-scheme: light;
    --bg: var(--bg-l);
    --surface: var(--surface-l);
    --elevated: var(--elevated-l);
    --win: var(--win-l);
    --line: var(--line-l);
    --line-strong: var(--line-strong-l);
    --text: var(--text-l);
    --muted: var(--muted-l);
    --dim: var(--dim-l);
    --btn-bg: var(--btn-bg-l);
    --btn-fg: var(--btn-fg-l);
    --indigo: var(--indigo-l);
    --indigo-hi: var(--indigo-hi-l);
    --emerald: var(--emerald-l);
    --amber: var(--amber-l);
    --ruby: var(--ruby-l);
    --topbar: var(--topbar-l);
    --sheet: var(--sheet-l);
    --shadow: var(--shadow-l);
    --scroll-thumb: var(--scroll-thumb-l);
    --scroll-track: var(--scroll-track-l);
  }

  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-l), var(--bg-d));
    --surface: light-dark(var(--surface-l), var(--surface-d));
    --elevated: light-dark(var(--elevated-l), var(--elevated-d));
    --win: light-dark(var(--win-l), var(--win-d));
    --line: light-dark(var(--line-l), var(--line-d));
    --line-strong: light-dark(var(--line-strong-l), var(--line-strong-d));
    --text: light-dark(var(--text-l), var(--text-d));
    --muted: light-dark(var(--muted-l), var(--muted-d));
    --dim: light-dark(var(--dim-l), var(--dim-d));
    --btn-bg: light-dark(var(--btn-bg-l), var(--btn-bg-d));
    --btn-fg: light-dark(var(--btn-fg-l), var(--btn-fg-d));
    --indigo: light-dark(var(--indigo-l), var(--indigo-d));
    --indigo-hi: light-dark(var(--indigo-hi-l), var(--indigo-hi-d));
    --emerald: light-dark(var(--emerald-l), var(--emerald-d));
    --amber: light-dark(var(--amber-l), var(--amber-d));
    --ruby: light-dark(var(--ruby-l), var(--ruby-d));
    --topbar: light-dark(var(--topbar-l), var(--topbar-d));
    --sheet: light-dark(var(--sheet-l), var(--sheet-d));
    --scroll-thumb: light-dark(var(--scroll-thumb-l), var(--scroll-thumb-d));
    --scroll-track: light-dark(var(--scroll-track-l), var(--scroll-track-d));
  }

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.mono {
  font-family: var(--mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.glow {
  position: fixed;
  top: -180px;
  left: 50%;
  translate: -50% 0;
  width: min(860px, 100vw);
  height: 440px;
  background: radial-gradient(circle at 50% 35%, rgba(94, 106, 210, 0.13), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 54px;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1060px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.6);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

/* Language Switcher + Theme Toggle Button */
.lang-switch {
  min-inline-size: 32px;
  min-block-size: 32px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.lang-switch:hover {
  color: var(--text);
}

.theme-toggle {
  min-inline-size: 32px;
  min-block-size: 32px;
  padding: 6px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Default light -> show moon (.if-light), hide sun (.if-dark) */
.if-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .if-dark {
    display: inline-flex;
  }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .if-light {
    display: none;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .if-dark {
  display: inline-flex;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .if-light {
  display: none;
}

@container style(--color-scheme: dark) {
  .if-dark {
    display: inline-flex !important;
  }
  .if-light {
    display: none !important;
  }
}

@container style(--color-scheme: light) {
  .if-light {
    display: inline-flex !important;
  }
  .if-dark {
    display: none !important;
  }
}

/* Page Container */
.page {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 52px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text);
}

.hero-lead {
  max-width: 600px;
  font-size: 16.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

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

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--elevated);
}

/* CLI Pill + Accessible Copy Button */
.cli-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 5px 6px 5px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.cli-pill code {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.copy {
  position: relative;
  display: inline-flex;
  flex: none;
}

.copy-button {
  min-inline-size: 26px;
  min-block-size: 26px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.copy-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.copy-button .icon {
  display: inline-flex;
}

.copy-button .icon-check {
  display: none;
}

.copy-button[data-copied] {
  color: var(--emerald);
  border-color: var(--emerald);
}

.copy-button[data-copied] .icon-copy {
  display: none;
}

.copy-button[data-copied] .icon-check {
  display: inline-flex;
}

.copy-button[data-failed] {
  color: var(--ruby);
}

.copy .tip {
  position: absolute;
  inset-block-end: calc(100% + 6px);
  inset-inline-end: 0;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.copy-button[data-copied] + .tip,
.copy-button[data-failed] + .tip {
  opacity: 1;
}

/* Live 1.2s Kinetic Stage */
.stage-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.step-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.step {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.step .mono {
  font-size: 11px;
  color: var(--dim);
}

.step:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.step.active {
  color: var(--text);
  background: rgba(94, 106, 210, 0.1);
  border-color: var(--indigo);
}

.step.active .mono {
  color: var(--indigo-hi);
}

.step-fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--indigo);
  transform-origin: left center;
  transform: scaleX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .stage-frame:not(.paused) .step.active .step-fill {
    animation: beat-fill 1.2s linear forwards;
  }
}

@keyframes beat-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.play-toggle {
  min-inline-size: 32px;
  min-block-size: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.play-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.play-toggle .ic-play {
  display: none;
}

.stage-frame.paused .play-toggle .ic-pause {
  display: none;
}

.stage-frame.paused .play-toggle .ic-play {
  display: block;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* Windows */
.win {
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.win.active {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.2);
}

.win-bar {
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lights {
  display: flex;
  gap: 5px;
}

.lights i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

.lights i:nth-child(1) { background: #ff5f56; }
.lights i:nth-child(2) { background: #ffbd2e; }
.lights i:nth-child(3) { background: #27c93f; }

.win-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.state-pill.ok {
  color: var(--emerald);
  border-color: var(--emerald);
}

.state-pill.wait {
  color: var(--amber);
  border-color: var(--amber);
}

.state-pill.cut {
  color: var(--ruby);
  border-color: var(--ruby);
}

.win-body {
  position: relative;
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 216px;
}

/* Invite Card */
.invite-card {
  width: 100%;
  padding: 13px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s ease;
}

.invite-card:hover {
  border-color: var(--indigo);
}

.invite-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--dim);
}

.invite-code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--indigo-hi);
}

/* Key-Value Stack */
.kv-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kv {
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.kv strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.ok { color: var(--emerald) !important; }
.warn { color: var(--amber) !important; }
.bad { color: var(--ruby) !important; }
.dim { color: var(--dim) !important; }

/* Approval Overlay Sheet */
.sheet {
  position: absolute;
  inset: 0;
  padding: 15px;
  background: var(--sheet);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sheet.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.sheet-card {
  width: 100%;
  padding: 15px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.amber-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}

.sheet-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.s-btn {
  padding: 8px 0;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.s-decline {
  background: var(--elevated);
  border: 1px solid var(--line);
  color: var(--muted);
}

.s-approve {
  background: var(--indigo);
  color: #ffffff;
}

/* Center Conduit */
.conduit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wire {
  position: absolute;
  inset-inline: -16px;
  top: 50%;
  height: 2px;
  translate: 0 -50%;
  background: var(--line-strong);
  overflow: hidden;
}

.wire-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--indigo), var(--emerald));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wire-glow.active {
  opacity: 1;
}

.pkt {
  position: absolute;
  top: -2px;
  left: 0;
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: var(--indigo);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .pkt.active {
    animation: pkt-fly 0.65s linear infinite;
  }
  .pkt.p2.active {
    animation-delay: 0.22s;
  }
  .pkt.p3.active {
    animation-delay: 0.44s;
  }
}

@keyframes pkt-fly {
  0% { translate: 0 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { translate: 180px 0; opacity: 0; }
}

.relay-box {
  position: relative;
  z-index: 2;
  padding: 12px 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  color: var(--indigo);
  min-width: 132px;
  box-shadow: var(--shadow);
}

.relay-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.relay-meta {
  font-size: 11px;
  color: var(--muted);
}

/* Friend Mac Temporary Chrome Slot */
.app-slot {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.app-slot.live {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.06);
}

.app-slot.wiped {
  border-color: var(--ruby);
  background: rgba(239, 68, 68, 0.06);
}

.slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slot-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.slot-state {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
}

.chrome-live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--elevated);
  border: 1px solid var(--line);
}

.url-pill {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exit-readout {
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
}

.laser {
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--ruby);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .app-slot.wiped .laser {
    opacity: 1;
    animation: laser-drop 0.8s ease-out forwards;
  }
}

@keyframes laser-drop {
  from { translate: 0 0; opacity: 1; }
  to { translate: 0 92px; opacity: 0; }
}

/* 3 Real-World Scenarios */
.scenarios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.scen-card {
  padding: 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scen-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--elevated);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.v-box {
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.v-box.ok-box {
  border-color: var(--emerald);
  color: var(--emerald);
}

.v-box.bad-box {
  border-color: var(--ruby);
  color: var(--ruby);
}

.v-box.cut-box {
  border-color: var(--indigo);
  color: var(--indigo-hi);
}

.v-arrow {
  font-weight: 600;
  color: var(--dim);
}

.scen-card h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.scen-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* Plain-Language Comparison Matrix */
.matrix-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow-x: auto;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.matrix th,
.matrix td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.matrix tbody tr:last-child th,
.matrix tbody tr:last-child td {
  border-bottom: none;
}

.matrix thead th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--elevated);
}

.matrix tbody th {
  color: var(--text);
  font-weight: 500;
}

.matrix tbody td {
  font-size: 13px;
  font-weight: 500;
}

.matrix .col-tr {
  background: rgba(94, 106, 210, 0.08);
  color: var(--text);
  font-weight: 600;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 24px;
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  font-size: 13px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text);
}

/* Forced Colors Mode Fallback */
@media (forced-colors: active) {
  .step.active,
  .win.active,
  .app-slot.live {
    outline: 2px solid Highlight;
  }
}

/* Responsive */
@media (max-width: 880px) {
  .stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .conduit {
    height: 86px;
  }
  .wire {
    inset-inline: auto;
    left: 50%;
    top: -16px;
    bottom: -16px;
    width: 2px;
    height: auto;
    translate: -50% 0;
  }
  @keyframes pkt-fly {
    0% { translate: -2px 0; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { translate: -2px 110px; opacity: 0; }
  }
  .scenarios {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .page {
    padding: 36px 16px 56px;
    gap: 40px;
  }
  .topbar-inner {
    padding: 0 16px;
  }
  .nav {
    gap: 12px;
  }
  .stage-frame {
    padding: 14px;
  }
}
