/* ==========================================================================
   ForgePilot — interactive field manual
   Warm paper, ink, cobalt, amber. This sheet is standalone: no webfonts,
   no build step, no external assets beyond the repository mark.
   ========================================================================== */

:root {
  --paper: #efeae0;
  --paper-soft: #f7f3eb;
  --paper-deep: #e3dccd;
  --ink: #111419;
  --ink-soft: #2b2e33;
  --ink-raised: #1a1f26;
  --blue: #2447ff;
  --blue-deep: #1832c9;
  --blue-light: #8fa6ff;
  --blue-soft: #dbe2ff;
  --amber: #eaa22b;
  --amber-deep: #8a5a10;
  --amber-soft: #f2e2c1;
  --mint: #2f9e6c;
  --mint-light: #7ad3a6;
  --mint-soft: #e0f2e8;
  --red: #c84a36;
  --muted: #5c5d59;
  --dim: #8b877b;
  --line: rgba(17, 20, 25, 0.16);
  --line-strong: rgba(17, 20, 25, 0.34);
  --line-dark: rgba(239, 234, 224, 0.14);
  --line-dark-strong: rgba(239, 234, 224, 0.3);
  --term-bg: #080b0f;
  --term-panel: #0b1015;
  --term-raised: #0f151c;
  --term-text: #c7d0db;
  --term-dim: #6d7b8d;
  --term-bright: #f0ece4;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Cascadia Code", "Consolas",
    "Liberation Mono", monospace;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", Georgia, serif;

  --page-max: 1400px;
  --gutter: clamp(22px, 4.4vw, 72px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 240;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button,
input,
textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p,
h1,
h2,
h3,
h4 { margin: 0; }
ol,
ul { margin: 0; padding: 0; list-style: none; }
pre,
code,
kbd { font-family: var(--font-mono); }
code { font-size: 0.92em; }
::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.console-section :focus-visible,
.site-footer :focus-visible,
.arch-frame :focus-visible,
.install-panel :focus-visible {
  outline-color: var(--amber);
}

section[id] { scroll-margin-top: 82px; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 9px 13px;
  border: 1px solid var(--paper);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: none; }

.pulse-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mint);
  animation: pulse 2.4s infinite;
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(239, 234, 224, 0.9);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 2px 0 var(--blue);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: var(--page-max);
  height: 66px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
}
.brand-mark { width: 25px; height: 25px; flex-shrink: 0; }
.brand-word {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  transition: color 0.18s ease;
}
.brand:hover .brand-word { color: var(--blue); }
.brand-sub {
  margin-left: 3px;
  padding-left: 11px;
  border-left: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 27px;
}
.site-nav a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.18s ease;
}
.site-nav a span {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  color: var(--dim);
  letter-spacing: 0.05em;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--blue);
  transition: width 0.2s ease;
}
.site-nav a:hover { color: var(--blue); }
.site-nav a:hover::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sim-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.sim-pill .pulse-dot { background: var(--amber); animation-name: pulse-amber; }

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.source-link:hover { color: var(--blue); border-bottom-color: var(--blue); }
.source-link span { font-size: 11px; }

/* ------------------------------------------------------ shared section -- */

.section-inner {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1.08fr) minmax(250px, 0.58fr);
  gap: clamp(24px, 3.2vw, 52px);
  align-items: end;
  margin-bottom: 40px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.section-no {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.section-no strong {
  font-family: var(--font-mono);
  font-size: clamp(44px, 5vw, 66px);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.07em;
  color: var(--ink);
}
.section-no span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.section-kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--blue);
}

.section-title-block h2 {
  font-size: clamp(34px, 3.9vw, 58px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: var(--ink);
}
.section-title-block h2 em {
  font-style: normal;
  color: var(--blue);
}

.section-lede {
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
}

.section-head-dark { border-bottom-color: var(--line-dark); }
.section-head-dark .section-no strong {
  color: transparent;
  -webkit-text-stroke: 1px rgba(239, 234, 224, 0.5);
}
.section-head-dark .section-no span { color: rgba(239, 234, 224, 0.38); }
.section-head-dark .section-kicker { color: rgba(239, 234, 224, 0.48); }
.section-head-dark .section-kicker::before { background: var(--amber); }
.section-head-dark .section-title-block h2 { color: var(--paper); }
.section-head-dark .section-title-block h2 em { color: var(--blue-light); }
.section-head-dark .section-lede {
  color: rgba(239, 234, 224, 0.52);
  border-top-color: var(--line-dark);
}

/* -------------------------------------------------------------- buttons -- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}
.button span {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.button:hover span { transform: translate(2px, 1px); }

.button-primary {
  background: var(--blue);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 5px 5px 0 var(--ink);
}
.button-primary:hover {
  background: var(--blue-deep);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.button-link {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.button-link:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.button-paper {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--blue-deep);
  box-shadow: 5px 5px 0 rgba(11, 15, 22, 0.45);
}
.button-paper:hover {
  background: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(11, 15, 22, 0.45);
}

.button-outline-light {
  background: transparent;
  border-color: rgba(239, 234, 224, 0.45);
  color: var(--paper);
}
.button-outline-light:hover {
  background: rgba(239, 234, 224, 0.12);
  border-color: var(--paper);
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 6vw, 84px) var(--gutter) 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "0161";
  position: absolute;
  left: -0.06em;
  bottom: -0.2em;
  z-index: 0;
  font-family: var(--font-mono);
  font-size: clamp(220px, 33vw, 480px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.09em;
  color: rgba(17, 20, 25, 0.022);
  -webkit-text-stroke: 1px rgba(17, 20, 25, 0.075);
  pointer-events: none;
  user-select: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: clamp(40px, 5.6vw, 92px);
  align-items: center;
  max-width: var(--page-max);
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.19em;
  color: var(--ink-soft);
}
.eyebrow-line { width: 30px; height: 2px; background: var(--blue); }
.eyebrow-version {
  padding-left: 15px;
  border-left: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.hero h1 {
  margin-left: -0.055em;
  font-size: clamp(48px, 6vw, 96px);
  font-weight: 800;
  line-height: 0.99;
  letter-spacing: -0.06em;
  color: var(--ink);
}
.hero h1 .mark {
  color: var(--blue);
  background-image: linear-gradient(
    transparent 73%,
    rgba(234, 162, 43, 0.5) 73%,
    rgba(234, 162, 43, 0.5) 94%,
    transparent 94%
  );
}

.hero-intro {
  max-width: 560px;
  margin-top: 34px;
  padding-left: 22px;
  border-left: 2px solid var(--blue);
}
.hero-lede {
  margin-bottom: 26px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--dim);
}
.hero-notes span { display: flex; align-items: center; gap: 8px; }
.hero-notes span::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--amber);
  transform: rotate(45deg);
}

/* control ticket */

.hero-board {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 540px;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid var(--ink);
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(239, 234, 224, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 234, 224, 0.045) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--paper);
  box-shadow: 14px 14px 0 var(--blue), 0 40px 90px -44px rgba(17, 20, 25, 0.75);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 224, 0.46);
}
.board-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  white-space: nowrap;
}
.board-status .pulse-dot { background: var(--amber); animation-name: pulse-amber; }

.ticket {
  position: relative;
  margin-top: 18px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(239, 234, 224, 0.2);
  background:
    linear-gradient(rgba(239, 234, 224, 0.025) 1px, transparent 1px),
    rgba(4, 7, 11, 0.65);
  background-size: 100% 26px, auto;
}
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 82px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid rgba(239, 234, 224, 0.2);
}
.ticket::before { left: -6px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -6px; clip-path: inset(0 50% 0 0); }

.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.ticket-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  color: var(--amber);
}
.ticket-head strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(31px, 3.1vw, 43px);
  font-weight: 800;
  line-height: 0.93;
  letter-spacing: -0.04em;
  color: var(--paper);
}
.ticket-mark {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  opacity: 0.95;
  filter: drop-shadow(0 0 24px rgba(36, 71, 255, 0.5));
}

.ticket-routes {
  margin: 19px 0 0;
  border-top: 1px solid rgba(239, 234, 224, 0.16);
}
.ticket-routes li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(239, 234, 224, 0.12);
}
.ticket-routes > li > span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--amber);
}
.ticket-routes b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.ticket-routes em {
  display: block;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: rgba(239, 234, 224, 0.4);
}
.ticket-routes i {
  padding: 3px 5px;
  border: 1px solid rgba(239, 234, 224, 0.24);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.08em;
  color: rgba(239, 234, 224, 0.55);
  white-space: nowrap;
}

.ticket-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px dashed rgba(239, 234, 224, 0.22);
}
.ticket-barcode {
  width: 118px;
  height: 34px;
  opacity: 0.82;
  background: repeating-linear-gradient(
    90deg,
    var(--paper) 0 1px,
    transparent 1px 3px,
    var(--paper) 3px 5px,
    transparent 5px 8px,
    var(--paper) 8px 9px,
    transparent 9px 14px
  );
}
.ticket-stamp {
  flex-shrink: 0;
  padding: 5px 9px;
  border: 2px solid var(--amber);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-align: center;
  transform: rotate(-6deg);
}
.ticket-stamp small {
  display: block;
  margin-top: 2px;
  font-size: 6px;
  font-weight: 400;
  letter-spacing: 0.12em;
  opacity: 0.8;
}
.ticket-serial {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(239, 234, 224, 0.1);
  font-family: var(--font-mono);
  font-size: 6.8px;
  letter-spacing: 0.08em;
  color: rgba(239, 234, 224, 0.35);
}

.board-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 20px;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.board-stats div {
  padding: 14px 12px;
  border-left: 1px solid var(--line-dark);
}
.board-stats div:first-child { padding-left: 0; border-left: 0; }
.board-stats strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--paper);
}
.board-stats div:nth-child(2) strong { color: var(--amber); }
.board-stats div:nth-child(3) strong { color: var(--blue-light); }
.board-stats div:nth-child(4) strong { color: var(--mint-light); }
.board-stats span {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: rgba(239, 234, 224, 0.38);
  white-space: nowrap;
}

.board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: rgba(239, 234, 224, 0.35);
}
.board-foot code {
  overflow: hidden;
  color: var(--blue-light);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-foot span { white-space: nowrap; }

.hero-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin: clamp(48px, 6vw, 82px) calc(var(--gutter) * -1) 0;
  padding: 15px var(--gutter);
  background: var(--ink);
  color: rgba(239, 234, 224, 0.5);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}
.hero-band a {
  color: var(--paper);
  transition: color 0.18s ease;
}
.hero-band a span { color: var(--amber); margin-left: 5px; }
.hero-band a:hover { color: var(--amber); }

/* -------------------------------------------------------------- console -- */

.console-section {
  position: relative;
  overflow: hidden;
  padding: 82px 0 48px;
  border-top: 1px solid #1c222a;
  border-bottom: 1px solid #1c222a;
  background-color: var(--term-bg);
  background-image: radial-gradient(rgba(239, 234, 224, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--paper);
}
.console-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 78% -8%, rgba(36, 71, 255, 0.19), transparent 56%);
  pointer-events: none;
}

.console-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(239, 234, 224, 0.38);
}
.console-meta span:first-child { color: rgba(239, 234, 224, 0.6); }

.console-shell {
  position: relative;
  scroll-margin-top: 84px;
  border: 1px solid rgba(239, 234, 224, 0.17);
  background: var(--term-panel);
  box-shadow: 14px 14px 0 rgba(36, 71, 255, 0.42);
}

.console-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px;
  border-top: 3px solid var(--blue);
  border-bottom: 1px solid rgba(239, 234, 224, 0.11);
  background: #0c1117;
}
.console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.console-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border: 1px solid rgba(122, 211, 166, 0.35);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--mint-light);
}
.console-live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-mint 2s infinite;
}
.console-title img { width: 17px; height: 17px; flex-shrink: 0; }
.console-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--paper);
  white-space: nowrap;
}
.console-path {
  padding-left: 10px;
  border-left: 1px solid rgba(239, 234, 224, 0.14);
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: rgba(239, 234, 224, 0.32);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.console-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex-shrink: 0;
}
.console-sim {
  margin-right: 3px;
  padding: 4px 7px;
  border: 1px solid rgba(234, 162, 43, 0.36);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--amber);
  white-space: nowrap;
}
.window-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(239, 234, 224, 0.18);
  background: transparent;
  color: rgba(239, 234, 224, 0.55);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.window-btn svg { width: 11px; height: 11px; }
.window-btn:hover {
  border-color: var(--blue-light);
  color: var(--paper);
  background: rgba(36, 71, 255, 0.1);
}
.window-btn-quiet {
  border-color: transparent;
  color: rgba(239, 234, 224, 0.34);
}
.window-btn-quiet:hover {
  border-color: rgba(239, 234, 224, 0.18);
  background: transparent;
}

.console-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 268px;
  height: 700px;
  min-height: 0;
}

/* mission rail */

.mission-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 15px 12px 12px;
  border-right: 1px solid rgba(239, 234, 224, 0.1);
  background: #090d12;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 11px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.1);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 224, 0.35);
}
.rail-scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 10px 0 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #263241 transparent;
}
.mission {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) 6px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 8px 9px 9px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  background: transparent;
  color: rgba(239, 234, 224, 0.52);
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.mission:hover {
  background: rgba(239, 234, 224, 0.05);
  color: var(--paper);
}
.mission.is-active {
  background: rgba(36, 71, 255, 0.17);
  border-color: rgba(36, 71, 255, 0.35);
  border-left-color: var(--blue);
  color: var(--paper);
}
.mission-index {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: rgba(239, 234, 224, 0.28);
}
.mission.is-active .mission-index { color: var(--blue-light); }
.mission-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.mission-copy strong {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mission-copy em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 7.5px;
  letter-spacing: 0.05em;
  color: rgba(239, 234, 224, 0.32);
}
.mission.is-active .mission-copy em { color: rgba(143, 166, 255, 0.8); }
.mission-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  background: #2c3947;
  transform: rotate(45deg);
}
.mission.is-active .mission-dot { background: var(--blue-light); }
.mission.is-complete .mission-dot { background: var(--mint); }

.rail-foot {
  margin-top: auto;
  padding: 12px 7px 2px;
  border-top: 1px solid rgba(239, 234, 224, 0.1);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.7;
  color: rgba(239, 234, 224, 0.28);
}

/* terminal chrome */

.terminal-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  background: var(--term-bg);
}
.terminal-chrome {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.mode-line {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.1);
  background: #0b1016;
}
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(36, 71, 255, 0.55);
  background: rgba(36, 71, 255, 0.14);
  color: #b7c6ff;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.mode-chip:hover {
  border-color: var(--blue-light);
  background: rgba(36, 71, 255, 0.26);
  color: #fff;
}
.mode-cycle { color: var(--amber); font-size: 10px; }
.mode-caption {
  overflow: hidden;
  font-size: 9.5px;
  color: rgba(239, 234, 224, 0.36);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.terminal-env {
  display: flex;
  gap: 12px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: rgba(239, 234, 224, 0.28);
  white-space: nowrap;
}

.terminal-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 12px;
  background: radial-gradient(circle at 78% 0%, rgba(36, 71, 255, 0.055), transparent 48%);
  color: var(--term-text);
  font-size: 12px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: #263241 transparent;
}
.terminal-screen::-webkit-scrollbar { width: 9px; }
.terminal-screen::-webkit-scrollbar-thumb {
  background: #263241;
  border: 3px solid var(--term-bg);
}
.terminal-screen:focus-visible { outline: 1px solid rgba(143, 166, 255, 0.6); outline-offset: -2px; }
.terminal-screen > * { animation: term-in 0.24s ease both; }
.terminal-screen .tool-item.is-open .tool-detail { animation: term-in 0.18s ease both; }

.terminal-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 23px;
  padding: 0 18px;
  background: var(--term-bg);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  color: rgba(239, 234, 224, 0.42);
}
.spinner {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border: 1px solid #35445a;
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.slash-palette {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 110px;
  z-index: 25;
  overflow: hidden;
  border: 1px solid #33455c;
  background: #0b1219;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.55);
}
.palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 9px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.1);
  background: rgba(239, 234, 224, 0.035);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(239, 234, 224, 0.35);
}
#paletteList { max-height: 188px; overflow-y: auto; }
.palette-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-top: 1px solid rgba(239, 234, 224, 0.06);
  background: transparent;
  color: rgba(239, 234, 224, 0.55);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-align: left;
}
.palette-item:first-child { border-top: 0; }
.palette-item:hover,
.palette-item.is-active {
  background: rgba(36, 71, 255, 0.16);
  border-left-color: var(--blue-light);
  color: var(--paper);
}
.palette-cmd { color: var(--blue-light); white-space: nowrap; }
.palette-desc {
  overflow: hidden;
  color: rgba(239, 234, 224, 0.36);
  font-family: var(--font-sans);
  font-size: 8.5px;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  margin: 0 14px 10px;
  padding: 0 12px;
  border: 1px solid rgba(239, 234, 224, 0.17);
  background: #0d1319;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.terminal-input-row:focus-within {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.prompt-glyph {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-light);
}
#commandInput {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--term-bright);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
#commandInput::placeholder { color: rgba(239, 234, 224, 0.26); }
.enter-key {
  padding: 2px 5px;
  border: 1px solid rgba(239, 234, 224, 0.16);
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: rgba(239, 234, 224, 0.28);
  white-space: nowrap;
}

.terminal-status {
  border-top: 1px solid rgba(239, 234, 224, 0.1);
  background: #070a0e;
  font-family: var(--font-mono);
  font-size: 8px;
  color: rgba(239, 234, 224, 0.35);
}
.status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 15px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.06);
}
.status-mode { color: var(--amber); letter-spacing: 0.04em; }
.status-env { color: rgba(143, 166, 255, 0.7); }
.status-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  padding: 7px 15px;
  overflow: hidden;
}
.status-brand { color: #c3a8ff; }
.status-model { color: #7fd0ea; }
.status-phase { color: var(--mint-light); }
.ctx-meter { display: flex; align-items: center; gap: 5px; color: rgba(239, 234, 224, 0.45); }
.ctx-label { color: rgba(143, 166, 255, 0.7); }
.ctx-track {
  width: 48px;
  height: 3px;
  overflow: hidden;
  background: #1b2633;
}
.ctx-track i {
  display: block;
  width: 2%;
  height: 100%;
  background: var(--blue);
  transition: width 0.45s ease;
}
.status-tokens,
.status-elapsed { color: rgba(234, 162, 43, 0.65); }
.status-cwd {
  margin-left: auto;
  color: rgba(239, 234, 224, 0.24);
  white-space: nowrap;
}

/* inspector */

.inspector {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 15px 14px 12px;
  border-left: 1px solid rgba(239, 234, 224, 0.1);
  background: #090d12;
}
.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 224, 0.4);
}
.rec {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e46d5e;
}
.rec i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-red 2s infinite;
}
.inspector-scene {
  padding: 13px 0 14px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.1);
}
.mono-label {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 224, 0.3);
}
.inspector-scene strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--paper);
}
.inspector-scene > span:last-child {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  color: rgba(239, 234, 224, 0.38);
}
.inspector-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(239, 234, 224, 0.1);
}
.inspector-meta div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
}
.inspector-meta dt { color: rgba(239, 234, 224, 0.3); }
.inspector-meta dd {
  max-width: 158px;
  margin: 0;
  overflow: hidden;
  color: rgba(239, 234, 224, 0.66);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspector-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0 8px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: rgba(239, 234, 224, 0.35);
}
.trace-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  scrollbar-width: thin;
  scrollbar-color: #263241 transparent;
}
.trace-empty {
  font-size: 9px;
  line-height: 1.65;
  color: rgba(239, 234, 224, 0.24);
}
.trace-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0 4px 7px;
  border-left: 2px solid #33445c;
}
.trace-item.is-ok { border-left-color: var(--mint); }
.trace-item.is-fail { border-left-color: #b4573f; }
.trace-item.is-blocked { border-left-color: #e0604b; }
.trace-item.is-agent { border-left-color: var(--blue-light); }
.trace-item.is-hitl { border-left-color: var(--amber); }
.trace-name {
  max-width: 98px;
  overflow: hidden;
  color: rgba(239, 234, 224, 0.72);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trace-param {
  overflow: hidden;
  color: rgba(239, 234, 224, 0.3);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trace-ms {
  color: rgba(239, 234, 224, 0.28);
  font-size: 7px;
  white-space: nowrap;
}
.inspector-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(239, 234, 224, 0.1);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  color: rgba(239, 234, 224, 0.26);
}
.inspector-foot span {
  padding: 2px 5px;
  border: 1px solid rgba(239, 234, 224, 0.11);
}

.console-caption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  padding: 13px 3px 0;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.75;
  color: rgba(239, 234, 224, 0.3);
}
.console-caption p { margin: 0; }
.caption-keys { color: rgba(239, 234, 224, 0.4); white-space: nowrap; }
.console-caption kbd {
  padding: 1px 4px;
  border: 1px solid rgba(239, 234, 224, 0.16);
  background: #0e151d;
  color: rgba(239, 234, 224, 0.55);
  font-size: 7.5px;
}
.console-caption span { margin: 0 4px; color: rgba(239, 234, 224, 0.18); }

/* ------------------------------------------------------ terminal stream -- */

.boot { padding: 2px 0 8px; }
.boot-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}
.boot-mark { width: 36px; height: 36px; opacity: 0.95; }
.boot-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--term-bright);
}
.boot-title span {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(239, 234, 224, 0.32);
}
.boot-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 15px;
  margin: 8px 0 13px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.7;
  color: rgba(239, 234, 224, 0.36);
}
.boot-grid b { font-weight: 400; color: rgba(239, 234, 224, 0.55); }
.boot-tips {
  padding-top: 10px;
  border-top: 1px solid rgba(239, 234, 224, 0.1);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.9;
  color: rgba(239, 234, 224, 0.42);
}
.boot-tips strong { color: rgba(239, 234, 224, 0.8); font-weight: 600; }
.boot-tips .k {
  padding: 0 4px;
  border: 1px solid rgba(239, 234, 224, 0.16);
  color: var(--blue-light);
}
.boot-sim {
  margin-top: 11px;
  padding: 8px 10px;
  border: 1px dashed rgba(234, 162, 43, 0.32);
  background: rgba(234, 162, 43, 0.045);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.7;
  color: rgba(239, 234, 224, 0.4);
}
.boot-sim b {
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.boot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.boot-chip {
  padding: 5px 8px;
  border: 1px solid rgba(239, 234, 224, 0.15);
  background: transparent;
  color: rgba(239, 234, 224, 0.52);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  text-align: left;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.boot-chip:hover {
  border-color: var(--blue-light);
  background: rgba(36, 71, 255, 0.12);
  color: var(--paper);
}

.scene-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.07em;
  color: rgba(239, 234, 224, 0.3);
}
.scene-divider::before,
.scene-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(239, 234, 224, 0.1);
}
.scene-divider span { white-space: nowrap; }
.scene-divider b { color: rgba(239, 234, 224, 0.66); font-weight: 500; }

.msg-user {
  display: flex;
  gap: 9px;
  margin: 14px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(36, 71, 255, 0.3);
  border-left: 3px solid var(--blue);
  background: rgba(36, 71, 255, 0.1);
  color: #dde5f4;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}
.msg-user .prompt-symbol { flex-shrink: 0; color: var(--blue-light); }
.msg-user .user-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-user .user-tag {
  flex-shrink: 0;
  margin-left: auto;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(239, 234, 224, 0.3);
}
.msg-user.is-key {
  margin: 8px 0;
  padding: 2px 0 2px 10px;
  border: 0;
  border-left: 1px solid rgba(239, 234, 224, 0.2);
  background: transparent;
  color: rgba(239, 234, 224, 0.42);
  font-size: 8.5px;
}
.msg-user.is-key .prompt-symbol { color: rgba(239, 234, 224, 0.26); }
.msg-user .typing-caret {
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--blue-light);
  animation: blink 0.9s steps(1) infinite;
}

.thinking {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 1px solid rgba(239, 234, 224, 0.18);
  color: rgba(239, 234, 224, 0.46);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.8;
}
.thinking-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  color: rgba(234, 162, 43, 0.65);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}
.thinking-label i {
  width: 4px;
  height: 4px;
  background: currentColor;
  transform: rotate(45deg);
}
.thinking p { margin: 0; }

.assistant {
  margin: 10px 0 12px;
  color: #c6d0dd;
  font-size: 12px;
  line-height: 1.8;
}
.assistant .md > :first-child { margin-top: 0; }
.assistant .md > :last-child { margin-bottom: 0; }
.assistant .md p { margin: 0 0 8px; }
.assistant .md strong { color: var(--term-bright); font-weight: 650; }
.assistant .md ul {
  margin: 6px 0 9px;
  padding-left: 18px;
  list-style: disc;
}
.assistant .md li { margin: 2px 0; }
.assistant .md li::marker { color: var(--blue-light); }
.md code {
  padding: 1px 4px;
  border: 1px solid rgba(143, 166, 255, 0.24);
  background: rgba(36, 71, 255, 0.1);
  color: #a9c0ff;
  font-size: 0.9em;
}
.md pre {
  margin: 8px 0;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid rgba(239, 234, 224, 0.12);
  background: #060a0e;
  color: #a9b8c9;
  font-size: 9px;
  line-height: 1.65;
}

/* tools */

.tool-group {
  margin: 10px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(239, 234, 224, 0.15);
  background: #0a0f14;
  font-family: var(--font-mono);
  font-size: 9px;
}
.tool-group.is-failed { border-color: rgba(200, 74, 54, 0.45); }
.tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid rgba(239, 234, 224, 0.08);
  background: rgba(239, 234, 224, 0.035);
  color: rgba(239, 234, 224, 0.6);
  text-align: left;
  transition: background 0.18s ease;
}
.tool-head:hover { background: rgba(239, 234, 224, 0.065); }
.tool-badge {
  padding: 2px 4px;
  border: 1px solid rgba(36, 71, 255, 0.5);
  background: rgba(36, 71, 255, 0.14);
  color: var(--blue-light);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}
.tool-summary {
  overflow: hidden;
  font-size: 9px;
  color: rgba(239, 234, 224, 0.7);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-head .group-state {
  margin-left: auto;
  font-size: 7px;
  color: rgba(239, 234, 224, 0.3);
  white-space: nowrap;
}
.tool-head .group-chevron {
  color: rgba(239, 234, 224, 0.3);
  transition: transform 0.18s ease;
}
.tool-group.is-collapsed .group-chevron { transform: rotate(-90deg); }
.tool-group.is-collapsed .tool-list { display: none; }
.tool-item { border-top: 1px solid rgba(239, 234, 224, 0.06); }
.tool-item:first-child { border-top: 0; }
.tool-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background 0.18s ease;
}
.tool-row:hover { background: rgba(239, 234, 224, 0.04); }
.tool-item.is-open > .tool-row {
  background: rgba(36, 71, 255, 0.09);
  border-left-color: var(--blue-light);
}
.tool-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #415266;
}
.tool-item.is-ok .tool-dot { background: var(--mint-light); }
.tool-item.is-fail .tool-dot { background: #e0806b; }
.tool-item.is-blocked .tool-dot { background: #ff7161; }
.tool-name {
  max-width: 42%;
  overflow: hidden;
  color: rgba(239, 234, 224, 0.78);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-param {
  max-width: 36%;
  overflow: hidden;
  color: rgba(239, 234, 224, 0.32);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-ms {
  margin-left: auto;
  color: rgba(239, 234, 224, 0.28);
  font-size: 7.5px;
  white-space: nowrap;
}
.tool-expand {
  flex-shrink: 0;
  color: rgba(239, 234, 224, 0.25);
  font-size: 7px;
  transition: transform 0.18s ease;
}
.tool-item.is-open .tool-expand { transform: rotate(90deg); }
.tool-detail { display: none; padding: 0 10px 9px 21px; }
.tool-item.is-open .tool-detail { display: block; }
.io-label {
  margin: 7px 0 3px;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: rgba(239, 234, 224, 0.28);
}
.tool-detail pre {
  max-height: 190px;
  margin: 0;
  padding: 7px 9px;
  overflow: auto;
  border: 1px solid rgba(239, 234, 224, 0.09);
  background: #060a0e;
  color: #9fb2c5;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tool-detail pre.is-result { color: #a9c3dc; }
.tool-detail pre.is-error {
  border-color: rgba(200, 74, 54, 0.4);
  color: #e5a08f;
}
.tool-detail pre.is-ok {
  border-color: rgba(47, 158, 108, 0.35);
  color: #96cfb1;
}
.diff {
  margin-top: 6px;
  overflow: auto;
  border: 1px solid rgba(239, 234, 224, 0.1);
  background: #060a0e;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
}
.diff-line {
  display: flex;
  min-width: max-content;
  white-space: pre;
}
.diff-line .ln {
  flex-shrink: 0;
  width: 26px;
  padding-right: 7px;
  color: rgba(239, 234, 224, 0.24);
  text-align: right;
  user-select: none;
}
.diff-line.add {
  background: rgba(47, 158, 108, 0.12);
  color: #97d6b5;
}
.diff-line.del {
  background: rgba(200, 74, 54, 0.12);
  color: #e8a496;
}
.diff-line.ctx { color: rgba(239, 234, 224, 0.45); }

.diagnostics {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid rgba(200, 74, 54, 0.4);
  border-left: 3px solid #d0604b;
  background: rgba(200, 74, 54, 0.08);
  font-family: var(--font-mono);
  font-size: 8.5px;
}
.diagnostics.is-ok {
  border-color: rgba(47, 158, 108, 0.35);
  border-left-color: var(--mint);
  background: rgba(47, 158, 108, 0.07);
}
.diag-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #e4a294;
  font-size: 8px;
  letter-spacing: 0.05em;
}
.diagnostics.is-ok .diag-head { color: #8fd0ae; }
.diag-item {
  display: flex;
  gap: 9px;
  margin-top: 5px;
  color: #bd9188;
  line-height: 1.6;
}
.diagnostics.is-ok .diag-item { color: #91b7a2; }
.diag-file { flex-shrink: 0; color: #d9b2a8; }
.diagnostics.is-ok .diag-file { color: #aed0bd; }

/* plan document — a sheet of paper inside the dark console */

.plan-card {
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-top: 3px solid var(--blue);
  background: var(--paper-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  box-shadow: 8px 8px 0 rgba(36, 71, 255, 0.38);
}
.plan-card.is-approved { border-top-color: var(--blue); }
.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.plan-kicker {
  font-size: 7px;
  letter-spacing: 0.15em;
  color: var(--blue-deep);
}
.plan-goal {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--ink);
}
.plan-count {
  flex-shrink: 0;
  font-size: 7px;
  line-height: 1.65;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.plan-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 7.5px;
  color: var(--muted);
}
.plan-stats b { color: var(--ink); font-weight: 500; }
.plan-progress {
  height: 4px;
  background: rgba(17, 20, 25, 0.1);
}
.plan-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 0.35s ease;
}
.plan-tasks { padding: 5px 0; }
.plan-batch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.plan-batch::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.plan-task {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-left: 2px solid transparent;
  font-size: 8.5px;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
.plan-task.is-running {
  background: var(--blue-soft);
  border-left-color: var(--blue);
  color: var(--ink);
}
.plan-task.is-done { color: var(--muted); }
.plan-task.is-done .task-title {
  text-decoration: line-through;
  text-decoration-color: rgba(17, 20, 25, 0.3);
}
.plan-task.is-failed { color: var(--red); }
.task-state {
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.plan-task.is-running .task-state {
  border-color: var(--blue);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.plan-task.is-done .task-state {
  border-color: var(--mint);
  background: var(--mint);
}
.plan-task.is-failed .task-state {
  border-color: var(--red);
  background: var(--red);
}
.task-id { margin-right: 6px; color: var(--blue-deep); font-size: 7px; }
.task-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-type {
  padding: 1px 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 6.5px;
  letter-spacing: 0.04em;
}
.task-deps { color: var(--dim); font-size: 6.5px; white-space: nowrap; }
.plan-review {
  padding: 10px 14px 11px;
  border-top: 1px solid var(--line);
  background: rgba(36, 71, 255, 0.055);
}
.plan-review-hint {
  margin-bottom: 8px;
  font-size: 7.5px;
  line-height: 1.6;
  color: var(--muted);
}
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-btn {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.plan-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.plan-btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.plan-btn.primary:hover {
  border-color: var(--blue-deep);
  background: var(--blue-deep);
  color: #fff;
}
.plan-btn.cancel {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}
.plan-btn.cancel:hover {
  border-color: var(--red);
  background: transparent;
  color: var(--red);
}
.plan-verdict {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: rgba(17, 20, 25, 0.04);
  font-size: 8px;
  color: var(--muted);
}
.plan-verdict.is-ok { background: var(--mint-soft); color: #1f6b4c; }
.plan-verdict.is-cancelled { background: var(--amber-soft); color: var(--amber-deep); }
.plan-details {
  display: none;
  padding: 9px 14px 10px;
  border-top: 1px solid var(--line);
  background: rgba(17, 20, 25, 0.045);
}
.plan-details.is-open { display: block; }
.plan-details pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.65;
  white-space: pre;
}
.plan-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  background: var(--paper-soft);
  box-shadow: 6px 6px 0 rgba(36, 71, 255, 0.35);
}
.plan-feedback input {
  flex: 1;
  min-width: 160px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  outline: none;
}
.plan-feedback input::placeholder { color: var(--dim); }
.plan-feedback input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.plan-feedback-hint {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  white-space: nowrap;
}

/* agents */

.role-card {
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid rgba(239, 234, 224, 0.13);
  border-left: 3px solid #51678a;
  background: var(--term-raised);
  font-family: var(--font-mono);
}
.role-card.role-planner { border-left-color: var(--blue-light); }
.role-card.role-worker { border-left-color: var(--amber); }
.role-card.role-reviewer { border-left-color: var(--mint-light); }
.role-card.is-rejected {
  border-color: rgba(200, 74, 54, 0.4);
  border-left-color: var(--red);
  background: rgba(200, 74, 54, 0.065);
}
.role-card.is-approved {
  border-color: rgba(47, 158, 108, 0.38);
  border-left-color: var(--mint);
  background: rgba(47, 158, 108, 0.055);
}
.role-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.role-badge {
  padding: 1px 5px;
  border: 1px solid rgba(143, 166, 255, 0.35);
  background: rgba(36, 71, 255, 0.12);
  color: var(--blue-light);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}
.role-card.role-worker .role-badge {
  border-color: rgba(234, 162, 43, 0.38);
  background: rgba(234, 162, 43, 0.09);
  color: var(--amber);
}
.role-card.role-reviewer .role-badge {
  border-color: rgba(122, 211, 166, 0.35);
  background: rgba(47, 158, 108, 0.1);
  color: var(--mint-light);
}
.role-title { color: rgba(239, 234, 224, 0.5); font-size: 8px; }
.role-state { margin-left: auto; color: rgba(239, 234, 224, 0.35); font-size: 7px; }
.role-state.is-rejected { color: #e79a8b; }
.role-state.is-approved { color: #8fd4b0; }
.role-body {
  color: rgba(239, 234, 224, 0.76);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.65;
}
.role-body code { color: #a9c0ff; font-family: var(--font-mono); font-size: 0.9em; }

/* approval — an amber permit slip */

.approval-card {
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #f6ead0;
  color: var(--ink);
  font-family: var(--font-mono);
  box-shadow: 8px 8px 0 rgba(234, 162, 43, 0.42);
}
.approval-card::before {
  content: "";
  display: block;
  height: 6px;
  background: repeating-linear-gradient(
    135deg,
    var(--ink) 0 9px,
    var(--amber) 9px 18px
  );
}
.approval-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  background: var(--ink);
  color: var(--amber);
  font-size: 7.5px;
  letter-spacing: 0.1em;
}
.approval-head .warn-icon { font-size: 11px; color: var(--amber); }
.approval-tool {
  max-width: 52%;
  margin-left: auto;
  overflow: hidden;
  color: #f3d79f;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approval-danger {
  padding: 1px 5px;
  border: 1px solid rgba(234, 162, 43, 0.7);
  color: var(--amber);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}
.approval-body { padding: 9px 11px; }
.approval-risk {
  margin-bottom: 7px;
  color: #55401a;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.6;
}
.approval-args {
  margin: 0;
  padding: 8px 9px;
  border-left: 3px solid var(--amber);
  background: #171208;
  color: #f1e2c1;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.approval-reason {
  margin-top: 6px;
  color: #7c6538;
  font-size: 8px;
  line-height: 1.65;
}
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 11px;
  border-top: 1px dashed rgba(17, 20, 25, 0.28);
  background: rgba(234, 162, 43, 0.08);
}
.approval-btn {
  padding: 6px 9px;
  border: 1px solid rgba(17, 20, 25, 0.35);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.approval-btn:hover { border-color: var(--ink); background: rgba(17, 20, 25, 0.07); }
.approval-btn.approve {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--amber);
  font-weight: 700;
}
.approval-btn.approve:hover { background: #000; color: #ffd27a; }
.approval-btn.reject {
  border-color: rgba(200, 74, 54, 0.5);
  color: #8f3526;
}
.approval-btn.reject:hover {
  border-color: var(--red);
  background: rgba(200, 74, 54, 0.08);
  color: var(--red);
}
.approval-verdict {
  padding: 8px 11px;
  border-top: 1px solid rgba(17, 20, 25, 0.2);
  font-size: 8px;
  line-height: 1.6;
  color: #6f5a30;
}
.approval-verdict.approved {
  background: var(--mint-soft);
  color: #1f6b4c;
}
.approval-verdict.rejected {
  background: #f4ded7;
  color: #8f3526;
}
.approval-card.is-decided .approval-actions { display: none; }

/* ------------------------------------------------------- data artefacts -- */

.memory-card,
.snapshot-card,
.data-card,
.search-card,
.context-card {
  margin: 11px 0;
  overflow: hidden;
  border: 1px solid rgba(239, 234, 224, 0.14);
  background: var(--term-raised);
  font-family: var(--font-mono);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.09);
  background: rgba(239, 234, 224, 0.035);
  font-size: 8px;
  letter-spacing: 0.07em;
  color: rgba(239, 234, 224, 0.45);
}
.card-head b {
  min-width: 0;
  overflow: hidden;
  color: rgba(239, 234, 224, 0.82);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-head span {
  flex-shrink: 0;
  font-size: 7px;
  color: rgba(239, 234, 224, 0.3);
}

.memory-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 7px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.06);
}
.memory-row:first-of-type { border-top: 0; }
.memory-id {
  padding-top: 2px;
  color: rgba(143, 166, 255, 0.75);
  font-size: 7.5px;
}
.memory-fact {
  color: rgba(239, 234, 224, 0.74);
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.memory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}
.mem-chip {
  padding: 1px 4px;
  border: 1px solid rgba(239, 234, 224, 0.16);
  color: rgba(239, 234, 224, 0.42);
  font-size: 6.5px;
  white-space: nowrap;
}
.mem-chip.is-verified {
  border-color: rgba(122, 211, 166, 0.35);
  color: var(--mint-light);
}
.mem-chip.is-global {
  border-color: rgba(234, 162, 43, 0.35);
  color: var(--amber);
}
.memory-foot {
  padding: 7px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.08);
  color: rgba(239, 234, 224, 0.3);
  font-size: 7.5px;
  line-height: 1.65;
}

.snap-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.06);
  font-size: 8px;
  line-height: 1.6;
}
.snap-row:first-of-type { border-top: 0; }
.snap-key { flex-shrink: 0; color: rgba(239, 234, 224, 0.36); }
.snap-val { color: rgba(239, 234, 224, 0.68); text-align: right; overflow-wrap: anywhere; }
.snapshot-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.09);
  color: rgba(239, 234, 224, 0.32);
  font-size: 7.5px;
}
.snap-node {
  padding: 2px 5px;
  border: 1px solid rgba(239, 234, 224, 0.2);
  color: rgba(239, 234, 224, 0.58);
}
.snap-node.changed {
  border-color: rgba(234, 162, 43, 0.55);
  background: rgba(234, 162, 43, 0.1);
  color: var(--amber);
}
.snap-line { width: 14px; height: 1px; background: rgba(239, 234, 224, 0.18); }
.snap-arrow { margin-left: auto; color: var(--blue-light); }
.restore-card {
  margin: 11px 0;
  padding: 9px 11px;
  border: 1px solid rgba(47, 158, 108, 0.4);
  border-left: 3px solid var(--mint);
  background: rgba(47, 158, 108, 0.07);
  color: #9ad1b2;
  font-family: var(--font-mono);
}
.restore-title { font-size: 9px; color: #c2e8d2; }
.restore-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 15px;
  margin-top: 4px;
  color: rgba(154, 209, 178, 0.55);
  font-size: 7.5px;
}

.data-card { overflow-x: auto; }
.data-row {
  display: grid;
  grid-template-columns: minmax(112px, 1.35fr) minmax(50px, 0.7fr) minmax(44px, 0.55fr) minmax(54px, 0.7fr);
  align-items: center;
  gap: 9px;
  padding: 5px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.055);
  color: rgba(239, 234, 224, 0.48);
  font-size: 8px;
}
.data-row:first-of-type { border-top: 0; }
.data-row.is-active {
  background: rgba(36, 71, 255, 0.13);
  color: rgba(239, 234, 224, 0.8);
}
.data-row.is-head {
  background: rgba(239, 234, 224, 0.035);
  color: rgba(239, 234, 224, 0.28);
  font-size: 7px;
  letter-spacing: 0.06em;
}
.data-primary {
  overflow: hidden;
  color: rgba(239, 234, 224, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-row.is-head .data-primary { color: rgba(239, 234, 224, 0.28); }
.state-ok { color: var(--mint-light); }
.state-cur { color: var(--blue-light); }
.state-dim { color: rgba(239, 234, 224, 0.32); }
.state-bad { color: #e0806b; }
.state-warn { color: var(--amber); }

.context-card { padding: 11px; }
.ctx-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: rgba(239, 234, 224, 0.38);
  font-size: 8px;
}
.ctx-big strong {
  color: var(--term-bright);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.ctx-chart {
  height: 5px;
  margin: 8px 0;
  overflow: hidden;
  background: rgba(239, 234, 224, 0.1);
}
.ctx-chart i {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width 0.4s ease;
}
.context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}
.context-grid div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  color: rgba(239, 234, 224, 0.35);
}
.context-grid b {
  color: rgba(239, 234, 224, 0.66);
  font-weight: 400;
  text-align: right;
}
.context-card .memory-foot { margin: 9px -11px -11px; }

.search-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 7px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.06);
}
.search-item:first-of-type { border-top: 0; }
.search-item > div { min-width: 0; }
.search-rank {
  padding-top: 2px;
  color: rgba(143, 166, 255, 0.55);
  font-size: 7.5px;
}
.search-file {
  overflow: hidden;
  color: rgba(239, 234, 224, 0.75);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-snippet {
  margin-top: 1px;
  overflow: hidden;
  color: rgba(239, 234, 224, 0.36);
  font-size: 7.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-score { color: var(--mint-light); font-size: 7.5px; }
.search-foot {
  padding: 7px 11px;
  border-top: 1px solid rgba(239, 234, 224, 0.08);
  color: rgba(239, 234, 224, 0.3);
  font-size: 7.5px;
  line-height: 1.65;
}

.result-card {
  margin: 14px 0 5px;
  overflow: hidden;
  border: 1px solid rgba(47, 158, 108, 0.4);
  border-left: 3px solid var(--mint);
  background: rgba(47, 158, 108, 0.055);
  font-family: var(--font-mono);
}
.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(47, 158, 108, 0.22);
  color: #a9dcc1;
  font-size: 9px;
}
.result-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(122, 211, 166, 0.5);
  color: var(--mint-light);
  font-size: 8px;
}
.result-head .muted {
  margin-left: auto;
  color: rgba(154, 209, 178, 0.45);
  font-size: 7px;
}
.result-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
}
.result-row {
  padding: 8px 11px;
  border-left: 1px solid rgba(47, 158, 108, 0.18);
}
.result-row:first-child { border-left: 0; }
.result-row dt {
  color: rgba(154, 209, 178, 0.45);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}
.result-row dd {
  margin: 2px 0 0;
  color: #b9d9c7;
  font-size: 8px;
  line-height: 1.5;
}
.result-row dd.ok { color: #8fd6b0; }
.result-foot {
  padding: 7px 11px;
  border-top: 1px solid rgba(47, 158, 108, 0.18);
  color: rgba(154, 209, 178, 0.42);
  font-size: 7.5px;
  line-height: 1.65;
}

.audit-card {
  margin: 9px 0;
  padding: 8px 10px;
  border: 1px solid rgba(234, 162, 43, 0.24);
  background: rgba(234, 162, 43, 0.05);
  color: rgba(234, 182, 96, 0.78);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note-line {
  margin: 8px 0;
  padding: 6px 9px;
  border-left: 2px solid rgba(143, 166, 255, 0.5);
  background: rgba(36, 71, 255, 0.08);
  color: rgba(239, 234, 224, 0.55);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
}
.note-line.is-warn {
  border-left-color: var(--amber);
  background: rgba(234, 162, 43, 0.07);
  color: rgba(234, 196, 126, 0.75);
}
.note-line.is-ok {
  border-left-color: var(--mint);
  background: rgba(47, 158, 108, 0.07);
  color: rgba(154, 209, 178, 0.8);
}
.note-line b { color: var(--paper); font-weight: 600; }
.blocked-card {
  margin: 9px 0;
  padding: 8px 10px;
  border: 1px solid rgba(200, 74, 54, 0.38);
  border-left: 3px solid #e0604b;
  background: rgba(200, 74, 54, 0.085);
  color: rgba(229, 160, 143, 0.82);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
}
.blocked-card b {
  color: #ff8a78;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.blocked-card .blocked-tool { color: rgba(229, 160, 143, 0.6); font-size: 7.5px; }
.blocked-card .blocked-args {
  margin: 4px 0;
  color: rgba(229, 160, 143, 0.55);
  font-size: 7.5px;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------- capabilities -- */

.capabilities-section {
  padding: 96px 0 86px;
  background: var(--paper);
}

.cap-table { border-top: 2px solid var(--ink); }
.cap-table-head {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 176px;
  align-items: center;
  gap: 24px;
  padding: 10px 16px;
  background: var(--ink);
  color: rgba(239, 234, 224, 0.48);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
}
.cap-table-head span:last-child { text-align: right; }

.cap-grid { display: flex; flex-direction: column; }
.cap-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 176px;
  align-items: center;
  gap: 24px;
  padding: 25px 16px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.cap-card:hover {
  background: var(--ink);
  border-bottom-color: rgba(239, 234, 224, 0.18);
  color: var(--paper);
}
.cap-index {
  align-self: start;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--blue);
  transition: color 0.22s ease;
}
.cap-card:hover .cap-index { color: var(--amber); }
.cap-main { min-width: 0; }
.cap-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 7px;
}
.cap-type {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: var(--dim);
  transition: color 0.22s ease;
}
.cap-card:hover .cap-type { color: rgba(239, 234, 224, 0.5); }
.cap-card h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: inherit;
}
.cap-main p {
  max-width: 780px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-soft);
  transition: color 0.22s ease;
}
.cap-card:hover .cap-main p { color: rgba(239, 234, 224, 0.66); }
.cap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.cap-tags span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: border-color 0.22s ease, color 0.22s ease;
}
.cap-card:hover .cap-tags span {
  border-color: rgba(239, 234, 224, 0.22);
  color: rgba(239, 234, 224, 0.55);
}
.cap-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.cap-action i {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  color: var(--blue);
  transition: color 0.18s ease, transform 0.18s ease;
}
.cap-card:hover .cap-action {
  border-color: rgba(239, 234, 224, 0.35);
  color: var(--paper);
}
.cap-card:hover .cap-action i { color: var(--amber); }
.cap-card .cap-action:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.cap-card .cap-action:hover i {
  color: #fff;
  transform: translate(2px, -2px);
}

.cap-card.is-feature {
  background: var(--ink);
  border-bottom-color: rgba(239, 234, 224, 0.18);
  box-shadow: inset 4px 0 0 var(--blue);
  color: var(--paper);
}
.cap-card.is-feature .cap-index { color: var(--amber); }
.cap-card.is-feature .cap-type { color: var(--amber); }
.cap-card.is-feature .cap-main p { color: rgba(239, 234, 224, 0.66); }
.cap-card.is-feature .cap-tags span {
  border-color: rgba(239, 234, 224, 0.22);
  color: rgba(239, 234, 224, 0.55);
}
.cap-card.is-feature .cap-action {
  border-color: var(--amber);
  background: transparent;
  color: var(--amber);
}
.cap-card.is-feature .cap-action i { color: var(--amber); }
.cap-card.is-feature .cap-action:hover {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--ink);
}
.cap-card.is-feature .cap-action:hover i {
  color: var(--ink);
  transform: translate(2px, -2px);
}

.more-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.more-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--dim);
}
.more-items { display: flex; flex-wrap: wrap; gap: 6px; }
.more-items span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
}
.more-items span::before {
  content: "+";
  margin-right: 6px;
  color: var(--blue);
}

/* ---------------------------------------------------------- architecture -- */

.architecture-section {
  padding: 96px 0 88px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.arch-frame {
  overflow: hidden;
  border: 1px solid var(--ink);
  border-top: 3px solid var(--amber);
  background-color: var(--term-panel);
  background-image:
    linear-gradient(rgba(239, 234, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 234, 224, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--paper);
  box-shadow: 14px 14px 0 var(--ink);
}
.arch-frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: rgba(239, 234, 224, 0.4);
}
.arch-map {
  display: grid;
  grid-template-columns: 1fr 48px 1fr 48px 1.05fr 48px 1fr;
  padding: 22px 18px 20px;
}
.arch-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.arch-label {
  margin-bottom: 2px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(239, 234, 224, 0.18);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 224, 0.38);
}
.arch-node {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid rgba(239, 234, 224, 0.16);
  background: rgba(239, 234, 224, 0.03);
}
.arch-node-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.arch-node-sub {
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.6;
  color: rgba(239, 234, 224, 0.4);
}
.arch-node-input {
  border-color: var(--blue);
  background: var(--blue);
}
.arch-node-input .arch-node-title { color: #fff; }
.arch-node-input .arch-node-sub { color: rgba(255, 255, 255, 0.65); }
.arch-node-accent {
  border-left: 3px solid var(--blue-light);
  background: rgba(36, 71, 255, 0.13);
}
.arch-node-model {
  border-color: var(--amber);
  background: var(--amber-soft);
}
.arch-node-model .arch-node-title { color: #3a2a0b; }
.arch-node-model .arch-node-sub { color: #715423; }
.arch-node-quiet {
  border-style: dashed;
  background: transparent;
}
.arch-node-quiet .arch-node-title { color: rgba(239, 234, 224, 0.7); }

.arch-connector {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.arch-connector::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(239, 234, 224, 0.18);
}
.arch-connector span {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(239, 234, 224, 0.55);
  border-right: 1px solid rgba(239, 234, 224, 0.55);
  background: var(--term-panel);
  transform: rotate(45deg);
}
.arch-frame-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(239, 234, 224, 0.32);
}

.guardrail-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 18px;
  padding: 15px 18px;
  border: 1px solid var(--ink);
  border-left: 6px solid var(--ink);
  background: var(--amber-soft);
}
.guardrail-seq {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.guardrail-seq span {
  padding: 3px 6px;
  border: 1px solid rgba(17, 20, 25, 0.3);
  background: rgba(247, 243, 235, 0.7);
}
.guardrail-seq i { font-style: normal; color: rgba(17, 20, 25, 0.4); }
.guardrail-band p {
  flex: 1;
  min-width: 260px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #5d481e;
}

.guard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.guard-card {
  display: flex;
  flex-direction: column;
  padding: 21px;
  border: 1px solid var(--ink);
  border-top: 3px solid var(--ink);
  background: var(--paper-soft);
}
.guard-index {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: var(--blue-deep);
}
.guard-card h3 {
  margin-bottom: 8px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
}
.guard-card > p:not(.guard-index) {
  margin-bottom: 18px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.mode-demo {
  display: flex;
  gap: 5px;
  margin-top: auto;
}
.mode-tag {
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.mode-tag.is-on {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.guard-code {
  margin: 0;
  margin-top: auto;
  padding: 12px;
  overflow: auto;
  background: var(--ink);
  color: rgba(239, 234, 224, 0.7);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.guard-block { color: #ff9a86; }
.mini-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--muted);
}
.mini-node {
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.mini-node.is-changed {
  border-color: rgba(234, 162, 43, 0.6);
  background: var(--amber-soft);
  color: #6a4b13;
}
.mini-timeline i { width: 12px; height: 1px; background: var(--line-strong); }
.mini-rollback { margin-left: 2px; color: var(--blue); }

/* ------------------------------------------------------------- quickstart -- */

.start-section {
  position: relative;
  overflow: hidden;
  padding: 92px 0 84px;
  background: var(--blue);
  color: var(--paper);
}
.start-section::before {
  content: "RUN";
  position: absolute;
  right: -0.05em;
  bottom: -0.24em;
  font-family: var(--font-sans);
  font-size: clamp(200px, 30vw, 440px);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.1em;
  color: rgba(255, 255, 255, 0.05);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  user-select: none;
}
.start-overline {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 36px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.65);
}
.start-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
}
.start-copy .section-kicker { color: rgba(255, 255, 255, 0.7); }
.start-copy .section-kicker::before { background: var(--amber); }
.start-copy h2 {
  margin-bottom: 18px;
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.05em;
  color: #fff;
}
.start-lede {
  max-width: 520px;
  margin-bottom: 24px;
  font-size: 13.5px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.72);
}
.start-links { display: flex; flex-wrap: wrap; gap: 10px; }
.start-tagline {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
}
.install-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--term-bg);
  box-shadow: 14px 14px 0 rgba(11, 15, 22, 0.5);
}
.install-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(239, 234, 224, 0.14);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 224, 0.45);
}
.copy-btn {
  padding: 5px 9px;
  border: 1px solid rgba(239, 234, 224, 0.3);
  background: transparent;
  color: rgba(239, 234, 224, 0.7);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.copy-btn:hover {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--ink);
}
.install-code {
  margin: 0;
  padding: 20px 18px;
  overflow: auto;
  color: #d7d1c4;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 2;
  white-space: pre;
}
.c-comment { color: #7d8da1; }
.install-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(239, 234, 224, 0.14);
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: rgba(239, 234, 224, 0.45);
}

/* ----------------------------------------------------------------- footer -- */

.site-footer {
  overflow: hidden;
  padding: 0 var(--gutter) 26px;
  border-top: 4px solid var(--blue);
  background: var(--ink);
  color: var(--paper);
}
.footer-inner { max-width: var(--page-max); margin: 0 auto; }
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: rgba(239, 234, 224, 0.4);
}
.footer-wordmark {
  padding: clamp(26px, 4vw, 54px) 0;
  font-size: clamp(38px, 13.5vw, 204px);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: var(--paper);
  white-space: nowrap;
}
.footer-wordmark span { color: var(--blue-light); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-mark { width: 24px; height: 24px; }
.footer-brand div { display: flex; flex-direction: column; line-height: 1.35; }
.footer-brand strong { font-size: 12px; }
.footer-brand span {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: rgba(239, 234, 224, 0.35);
}
.footer-note {
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: rgba(239, 234, 224, 0.35);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  color: rgba(239, 234, 224, 0.55);
}
.footer-links a { transition: color 0.18s ease; }
.footer-links a:hover { color: var(--amber); }

/* ------------------------------------------------------------------ toast -- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 260;
  max-width: calc(100vw - 32px);
  padding: 10px 15px;
  border: 1px solid var(--blue-light);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  box-shadow: 6px 6px 0 rgba(36, 71, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------- keyframes -- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes term-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 158, 108, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(47, 158, 108, 0); }
}
@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 162, 43, 0.38); }
  50% { box-shadow: 0 0 0 5px rgba(234, 162, 43, 0); }
}
@keyframes pulse-mint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122, 211, 166, 0.38); }
  50% { box-shadow: 0 0 0 4px rgba(122, 211, 166, 0); }
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 109, 94, 0.38); }
  50% { box-shadow: 0 0 0 4px rgba(228, 109, 94, 0); }
}

/* -------------------------------------------------------------- responsive -- */

@media (max-width: 1280px) {
  .header-inner { gap: 24px; }
  .site-nav { gap: 22px; }
  .hero-grid { gap: 48px; }
  .console-body { grid-template-columns: 216px minmax(0, 1fr) 248px; }
  .mission-copy strong { font-size: 11px; }
  .inspector-meta dd { max-width: 138px; }
  .cap-table-head,
  .cap-card { grid-template-columns: 66px minmax(0, 1fr) 164px; gap: 20px; }
  .section-head { grid-template-columns: 86px minmax(0, 1.08fr) minmax(235px, 0.58fr); }
  .arch-map { grid-template-columns: 1fr 38px 1fr 38px 1.05fr 38px 1fr; }
  .arch-frame-head { font-size: 7px; }
  .arch-node-sub { font-size: 7px; }
  .start-panel { gap: 48px; }
}

@media (max-width: 1120px) {
  .console-shell { box-shadow: 10px 10px 0 rgba(36, 71, 255, 0.42); }
  .console-body {
    grid-template-columns: 208px minmax(0, 1fr);
    grid-template-rows: 660px auto;
    grid-template-areas:
      "rail terminal"
      "inspector inspector";
    height: auto;
  }
  .mission-rail { grid-area: rail; }
  .terminal-column { grid-area: terminal; height: 660px; }
  .inspector {
    grid-area: inspector;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 214px minmax(0, 1.4fr);
    grid-template-areas:
      "head head head"
      "scene meta trace";
    gap: 0 18px;
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(239, 234, 224, 0.1);
    border-left: 0;
  }
  .inspector-head {
    grid-area: head;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(239, 234, 224, 0.1);
  }
  .inspector-scene {
    grid-area: scene;
    padding: 11px 0 0;
    border-bottom: 0;
  }
  .inspector-meta {
    grid-area: meta;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 5px 14px;
    padding: 11px 0 0 18px;
    border-bottom: 0;
    border-left: 1px solid rgba(239, 234, 224, 0.1);
  }
  .inspector-meta dd { max-width: 86px; }
  .inspector-subhead { display: none; }
  .trace-list {
    grid-area: trace;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 4px 10px;
    max-height: 94px;
    padding: 11px 0 0 18px;
    border-left: 1px solid rgba(239, 234, 224, 0.1);
  }
  .inspector-foot { display: none; }
  .trace-name { max-width: 120px; }
  .start-panel { gap: 40px; }
  .arch-node-sub { font-size: 7.5px; }
}

@media (max-width: 1020px) {
  .section-head {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 18px 28px;
  }
  .section-no { grid-row: 1 / span 2; }
  .section-title-block { grid-column: 2; }
  .section-lede {
    grid-column: 2;
    max-width: 640px;
    padding-top: 0;
    border-top: 0;
  }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 42px; }
  .hero-copy { max-width: 780px; }
  .hero-board {
    justify-self: start;
    max-width: 580px;
  }
  .cap-table-head,
  .cap-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px 20px;
  }
  .cap-table-head span:last-child { display: none; }
  .cap-card { padding: 22px 14px; }
  .cap-index { font-size: 24px; }
  .cap-action {
    grid-column: 2;
    justify-self: start;
    margin-top: 8px;
  }
  .arch-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    padding: 20px 16px;
  }
  .arch-connector { display: none; }
  .guard-grid { grid-template-columns: 1fr; }
  .guard-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 0 26px;
  }
  .guard-index { grid-column: 1 / -1; margin-bottom: 11px; }
  .guard-card h3 { margin-bottom: 7px; }
  .guard-card > p:not(.guard-index) { grid-column: 1; margin-bottom: 0; }
  .mode-demo,
  .guard-code,
  .mini-timeline {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: center;
    margin-top: 0;
  }
  .start-panel { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .start-copy { max-width: 680px; }
}

@media (max-width: 900px) {
  .header-inner { height: 62px; }
  .site-nav { display: none; }
  .hero { padding-top: 52px; }
  .console-section { padding: 64px 0 40px; }
  .console-shell { scroll-margin-top: 74px; }
  .console-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 620px auto;
    grid-template-areas:
      "rail"
      "terminal"
      "inspector";
  }
  .mission-rail {
    display: block;
    padding: 9px 11px;
    border-right: 0;
    border-bottom: 1px solid rgba(239, 234, 224, 0.1);
    overflow: hidden;
  }
  .rail-head,
  .rail-foot { display: none; }
  .rail-scroll {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 5px;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .rail-scroll::-webkit-scrollbar { display: none; }
  .mission {
    flex: 0 0 auto;
    width: auto;
    min-width: 168px;
    grid-template-columns: 20px minmax(0, 1fr) 5px;
    padding: 8px 9px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .mission.is-active { border-bottom-color: var(--blue); }
  .mission-copy strong { font-size: 10.5px; }
  .mission-copy em { font-size: 7px; }
  .terminal-column { height: 620px; }
  .capabilities-section,
  .architecture-section { padding: 72px 0 64px; }
  .guard-card {
    display: block;
  }
  .guard-index { margin-bottom: 10px; }
  .guard-card > p:not(.guard-index) { margin-bottom: 16px; }
  .mode-demo,
  .guard-code,
  .mini-timeline { margin-top: 16px; }
  .start-section { padding: 72px 0 68px; }
  .footer-inner { padding-bottom: 2px; }
}

@media (max-width: 680px) {
  :root { --gutter: 18px; }

  .header-inner { height: 58px; padding: 0 var(--gutter); gap: 12px; }
  .brand-word { font-size: 16px; }
  .brand-sub { display: none; }
  .sim-pill { display: none; }
  .source-link { font-size: 8.5px; }

  .hero { padding-top: 40px; }
  .hero::before { font-size: 170px; opacity: 0.7; }
  .hero-meta { gap: 10px 13px; margin-bottom: 20px; }
  .eyebrow { font-size: 7.5px; letter-spacing: 0.14em; }
  .eyebrow-line { width: 20px; }
  .eyebrow-version { padding-left: 11px; font-size: 7px; }
  .hero h1 {
    font-size: clamp(42px, 12.5vw, 64px);
    letter-spacing: -0.05em;
  }
  .hero-intro { margin-top: 26px; padding-left: 16px; }
  .hero-lede { margin-bottom: 22px; font-size: 13.5px; line-height: 1.85; }
  .hero-actions { gap: 9px; }
  .button { min-height: 43px; padding: 0 15px; font-size: 12px; }
  .hero-notes { margin-top: 20px; gap: 7px 14px; font-size: 7.5px; }

  .hero-board { padding: 16px; box-shadow: 8px 8px 0 var(--blue); }
  .board-head { font-size: 7px; padding-bottom: 11px; }
  .ticket { margin-top: 14px; padding: 14px 13px 12px; }
  .ticket-head strong { margin-top: 8px; font-size: 30px; }
  .ticket-mark { width: 44px; height: 44px; }
  .ticket-routes { margin-top: 15px; }
  .ticket-routes li { grid-template-columns: 22px minmax(0, 1fr); padding: 9px 0; }
  .ticket-routes i { display: none; }
  .ticket-routes b { font-size: 14px; }
  .ticket-routes em { font-size: 6.5px; }
  .ticket-foot { margin-top: 14px; padding-top: 13px; }
  .ticket-barcode { width: 84px; height: 28px; }
  .ticket-stamp { padding: 4px 7px; font-size: 7.5px; }
  .ticket-serial { font-size: 6px; letter-spacing: 0.05em; }
  .board-stats { margin-top: 16px; }
  .board-stats div { padding: 11px 7px; }
  .board-stats strong { font-size: 20px; }
  .board-stats span { font-size: 6px; }
  .board-foot { flex-wrap: wrap; gap: 4px 12px; font-size: 6.5px; }
  .hero-band {
    margin-top: 46px;
    padding: 12px var(--gutter);
    font-size: 6.5px;
    letter-spacing: 0.08em;
  }
  .hero-band span:nth-child(2) { display: none; }

  .section-inner { padding: 0 var(--gutter); }
  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 20px;
  }
  .section-no {
    grid-row: auto;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .section-no strong { font-size: 40px; }
  .section-no span { font-size: 7.5px; }
  .section-title-block { grid-column: 1; }
  .section-kicker { font-size: 7.5px; margin-bottom: 10px; }
  .section-title-block h2 { font-size: clamp(30px, 8.8vw, 42px); }
  .section-lede { grid-column: 1; font-size: 11.5px; line-height: 1.8; }

  .console-section { padding: 52px 0 30px; }
  .console-meta { margin-bottom: 22px; font-size: 7px; }
  .console-meta span:last-child { display: none; }
  .console-shell { scroll-margin-top: 70px; box-shadow: 8px 8px 0 rgba(36, 71, 255, 0.42); }
  .console-titlebar { height: 44px; padding: 0 10px; gap: 8px; }
  .console-live { font-size: 6px; padding: 2px 4px; }
  .console-title { gap: 7px; }
  .console-title img { width: 15px; height: 15px; }
  .console-name { font-size: 11px; }
  .console-path,
  .console-sim { display: none; }
  .console-actions { gap: 4px; }
  .window-btn { padding: 4px 6px; font-size: 7px; }
  .window-btn svg { width: 10px; height: 10px; }

  .console-body { grid-template-rows: auto 600px auto; }
  .mission-rail { padding: 8px 9px; }
  .mission { min-width: 152px; padding: 7px 8px; }
  .mission-copy strong { font-size: 10px; }
  .terminal-column { height: 600px; }
  .mode-line { padding: 0 10px; gap: 8px; height: 39px; }
  .mode-caption { display: none; }
  .terminal-env { display: none; }
  .terminal-screen { padding: 13px 12px 8px; font-size: 11.5px; }
  .terminal-input-row { height: 44px; margin: 0 10px 8px; padding: 0 10px; }
  #commandInput { font-size: 11px; }
  .enter-key { display: none; }
  .slash-palette { left: 10px; right: 10px; bottom: 108px; }
  .palette-item { grid-template-columns: 90px minmax(0, 1fr); }
  .status-top { padding: 5px 10px; font-size: 7.5px; }
  .status-env { display: none; }
  .status-bottom { gap: 8px; padding: 6px 10px; font-size: 7.5px; }
  .status-cwd { display: none; }
  .ctx-track { width: 34px; }
  .inspector {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "scene"
      "meta"
      "trace";
    padding: 12px 14px 14px;
    gap: 0;
  }
  .inspector-scene { padding: 10px 0 11px; border-bottom: 1px solid rgba(239, 234, 224, 0.1); }
  .inspector-meta {
    grid-template-columns: 1fr 1fr;
    gap: 5px 16px;
    padding: 10px 0;
    border-left: 0;
    border-bottom: 1px solid rgba(239, 234, 224, 0.1);
  }
  .inspector-meta dd { max-width: 108px; }
  .trace-list {
    max-height: 96px;
    padding: 10px 0 0;
    border-left: 0;
  }
  .trace-name { max-width: 130px; }
  .console-caption { flex-direction: column; gap: 4px; padding-top: 10px; font-size: 7px; }
  .caption-keys { white-space: normal; }

  .capabilities-section,
  .architecture-section { padding: 58px 0 52px; }
  .cap-table-head { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 8px 12px; font-size: 6.5px; }
  .cap-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 14px;
    padding: 18px 12px;
  }
  .cap-index { font-size: 20px; }
  .cap-heading { gap: 5px 9px; }
  .cap-card h3 { font-size: 17px; }
  .cap-type { font-size: 6.5px; }
  .cap-main p { font-size: 11.5px; line-height: 1.75; }
  .cap-tags span { font-size: 7px; }
  .cap-action { margin-top: 2px; padding: 8px 11px; }
  .more-strip { margin-top: 24px; }

  .arch-frame { box-shadow: 8px 8px 0 var(--ink); }
  .arch-frame-head { flex-wrap: wrap; gap: 5px 12px; padding: 10px 13px; font-size: 6.5px; }
  .arch-map { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 13px; }
  .arch-node-sub { font-size: 7px; }
  .arch-frame-foot { flex-wrap: wrap; gap: 4px 12px; padding: 9px 13px; font-size: 6px; }
  .guardrail-band { padding: 12px 13px; gap: 10px 16px; border-left-width: 4px; }
  .guardrail-seq { gap: 5px; font-size: 6.5px; }
  .guardrail-band p { min-width: 100%; font-size: 10.5px; }
  .guard-grid { gap: 12px; }
  .guard-card { padding: 17px; }
  .guard-card h3 { font-size: 15.5px; }
  .guard-card > p:not(.guard-index) { font-size: 11.5px; }
  .mode-demo,
  .guard-code,
  .mini-timeline { margin-top: 14px; }

  .start-section { padding: 56px 0 52px; }
  .start-overline { margin-bottom: 28px; font-size: 6.5px; }
  .start-copy h2 { font-size: clamp(30px, 9vw, 44px); }
  .start-lede { font-size: 12.5px; }
  .install-panel { box-shadow: 8px 8px 0 rgba(11, 15, 22, 0.5); }
  .install-head { font-size: 6.5px; padding: 9px 11px; }
  .copy-btn { font-size: 7px; }
  .install-code { padding: 16px 12px; font-size: 9px; line-height: 1.95; }
  .install-note { font-size: 6.5px; padding: 9px 11px; }

  .site-footer { padding-bottom: 20px; }
  .footer-top { flex-wrap: wrap; gap: 4px 14px; font-size: 6.5px; }
  .footer-wordmark { padding: 26px 0; }
  .footer-bottom { gap: 13px 20px; padding-top: 15px; }
  .footer-note { width: 100%; }
  .footer-links { margin-left: 0; width: 100%; gap: 15px; }

  .msg-user { font-size: 10px; }
  .assistant { font-size: 11px; }
  .boot-grid { font-size: 8px; gap: 2px 11px; }
  .boot-title span { display: block; margin: 1px 0 0; }
  .boot-sim { font-size: 7.5px; }
  .plan-head { padding: 10px 11px; }
  .plan-goal { font-size: 11px; }
  .plan-stats { padding: 6px 11px; }
  .plan-task {
    grid-template-columns: 11px minmax(0, 1fr) auto;
    align-items: start;
    padding: 6px 11px;
    font-size: 9.5px;
    line-height: 1.55;
  }
  .task-state { margin-top: 4px; }
  .task-type { margin-top: 2px; }
  .task-title { overflow: visible; text-overflow: clip; white-space: normal; }
  .task-deps { display: none; }
  .plan-review { padding: 9px 11px 10px; }
  .plan-verdict { padding: 7px 11px; }
  .plan-details { padding: 8px 11px; }
  .plan-feedback { padding: 9px; }
  .plan-feedback input { min-width: 120px; }
  .plan-feedback-hint { white-space: normal; }
  .approval-tool { max-width: 42%; }
  .approval-head { flex-wrap: wrap; }
  .result-rows { grid-template-columns: 1fr 1fr; }
  .result-row:nth-child(3) { border-left: 0; border-top: 1px solid rgba(47, 158, 108, 0.18); }
  .context-grid { grid-template-columns: 1fr; }
  .memory-row { grid-template-columns: 50px minmax(0, 1fr); }
  .memory-meta { grid-column: 2; justify-content: flex-start; }
  .data-row {
    grid-template-columns: minmax(88px, 1.2fr) minmax(44px, 0.7fr) minmax(38px, 0.55fr) minmax(46px, 0.7fr);
    gap: 6px;
    font-size: 7.5px;
  }
  .card-head { font-size: 7px; }
  .card-head span { display: none; }
}

@media (max-width: 380px) {
  :root { --gutter: 14px; }
  .eyebrow-version { display: none; }
  .console-live { display: none; }
  .console-titlebar { gap: 6px; }
  .status-tokens { display: none; }
  .hero h1 { font-size: clamp(36px, 11.2vw, 42px); }
  .ticket-head strong { font-size: 27px; }
  .ticket-serial span:last-child { display: none; }
  .board-foot span { display: none; }
  .cap-table-head { font-size: 6px; }
  .arch-frame-head span:last-child { display: none; }
  .start-overline span:last-child { display: none; }
  .footer-top span:last-child { display: none; }
  .footer-wordmark { font-size: 38px; }
  .guardrail-seq { font-size: 6px; }
  .plan-actions { gap: 5px; }
  .plan-btn { padding: 5px 7px; font-size: 7.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body { background: #fff; }
  body::after { display: none; }
  .site-header,
  .console-section,
  .start-section,
  .site-footer,
  .toast,
  .hero-band { display: none; }
  .hero { padding: 24px 0; }
  .hero-board { box-shadow: none; }
  .cap-card,
  .guard-card,
  .arch-frame { break-inside: avoid; }
}
