:root {
  color-scheme: light;
  --bg: #f5efe3;
  --bg-start: #efe6d6;
  --bg-end: #f8f4ec;
  --bg-radial-warm: rgba(184, 92, 56, 0.18);
  --bg-radial-cool: rgba(37, 92, 75, 0.2);
  --orb-warm: rgba(184, 92, 56, 0.16);
  --orb-cool: rgba(37, 92, 75, 0.14);
  --surface: rgba(255, 252, 246, 0.82);
  --surface-topbar: rgba(255, 253, 248, 0.72);
  --surface-strong: #fffdf8;
  --surface-soft: rgba(255, 255, 255, 0.5);
  --surface-soft-strong: rgba(255, 255, 255, 0.82);
  --surface-note: rgba(255, 255, 255, 0.54);
  --hero-start: rgba(255, 251, 245, 0.94);
  --hero-end: rgba(234, 243, 238, 0.9);
  --ink: #1f2b24;
  --muted: #5f6e63;
  --accent: #255c4b;
  --accent-strong: #39725f;
  --accent-soft: #dbe9e2;
  --accent-track: rgba(37, 92, 75, 0.08);
  --accent-hover: rgba(37, 92, 75, 0.14);
  --accent-panel: rgba(37, 92, 75, 0.05);
  --accent-panel-border: rgba(37, 92, 75, 0.1);
  --highlight: #b85c38;
  --highlight-soft: rgba(184, 92, 56, 0.06);
  --highlight-track: rgba(184, 92, 56, 0.14);
  --line: rgba(31, 43, 36, 0.12);
  --line-soft: rgba(31, 43, 36, 0.08);
  --line-bright: rgba(255, 255, 255, 0.72);
  --line-topbar: rgba(255, 255, 255, 0.55);
  --sheen-line: rgba(255, 255, 255, 0.08);
  --field: rgba(255, 255, 255, 0.72);
  --code-bg: rgba(31, 43, 36, 0.06);
  --code-ink: #28443d;
  --neutral-soft: rgba(31, 43, 36, 0.05);
  --status-healthy-bg: rgba(60, 122, 87, 0.12);
  --status-healthy-ink: #1f5b3b;
  --status-healthy-line: rgba(60, 122, 87, 0.16);
  --status-degraded-bg: rgba(184, 92, 56, 0.12);
  --status-degraded-ink: #8a4026;
  --status-degraded-line: rgba(184, 92, 56, 0.18);
  --status-neutral-bg: rgba(31, 43, 36, 0.08);
  --status-neutral-ink: var(--ink);
  --status-neutral-line: rgba(31, 43, 36, 0.12);
  --selection-bg: rgba(184, 92, 56, 0.2);
  --shadow: 0 24px 60px rgba(47, 39, 22, 0.12);
  --radius: 22px;
  --eyebrow-size: 0.72rem;
  --title-size: 1.55rem;
  --font-display: "Atkinson Hyperlegible", "Segoe UI", "Trebuchet MS", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", "Trebuchet MS", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111915;
  --bg-start: #16211d;
  --bg-end: #0f1513;
  --bg-radial-warm: rgba(184, 92, 56, 0.22);
  --bg-radial-cool: rgba(37, 92, 75, 0.28);
  --orb-warm: rgba(184, 92, 56, 0.2);
  --orb-cool: rgba(37, 92, 75, 0.22);
  --surface: rgba(18, 27, 24, 0.82);
  --surface-topbar: rgba(20, 29, 26, 0.82);
  --surface-strong: #21342f;
  --surface-soft: rgba(29, 44, 39, 0.62);
  --surface-soft-strong: rgba(39, 58, 52, 0.88);
  --surface-note: rgba(27, 39, 35, 0.76);
  --hero-start: rgba(27, 38, 34, 0.96);
  --hero-end: rgba(15, 23, 20, 0.92);
  --ink: #e7efe9;
  --muted: #a3b6ac;
  --accent: #8ed0b4;
  --accent-strong: #5ca187;
  --accent-soft: rgba(99, 151, 129, 0.2);
  --accent-track: rgba(99, 151, 129, 0.18);
  --accent-hover: rgba(99, 151, 129, 0.28);
  --accent-panel: rgba(54, 100, 81, 0.18);
  --accent-panel-border: rgba(110, 167, 145, 0.2);
  --highlight: #f0a27f;
  --highlight-soft: rgba(240, 162, 127, 0.14);
  --highlight-track: rgba(240, 162, 127, 0.22);
  --line: rgba(223, 238, 229, 0.14);
  --line-soft: rgba(223, 238, 229, 0.1);
  --line-bright: rgba(143, 181, 167, 0.18);
  --line-topbar: rgba(143, 181, 167, 0.15);
  --sheen-line: rgba(255, 255, 255, 0.04);
  --field: rgba(17, 27, 24, 0.9);
  --code-bg: rgba(223, 238, 229, 0.08);
  --code-ink: #d5f4e6;
  --neutral-soft: rgba(223, 238, 229, 0.08);
  --status-healthy-bg: rgba(61, 153, 103, 0.18);
  --status-healthy-ink: #b5f1cf;
  --status-healthy-line: rgba(61, 153, 103, 0.26);
  --status-degraded-bg: rgba(184, 92, 56, 0.22);
  --status-degraded-ink: #ffd0bd;
  --status-degraded-line: rgba(184, 92, 56, 0.28);
  --status-neutral-bg: rgba(223, 238, 229, 0.08);
  --status-neutral-ink: var(--ink);
  --status-neutral-line: rgba(223, 238, 229, 0.12);
  --selection-bg: rgba(240, 162, 127, 0.28);
  --shadow: 0 28px 70px rgba(2, 7, 5, 0.45);
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--selection-bg);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background:
    radial-gradient(circle at top left, var(--bg-radial-warm), transparent 28%),
    radial-gradient(circle at bottom right, var(--bg-radial-cool), transparent 24%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg) 55%, var(--bg-end) 100%);
  min-height: 100vh;
  transition: background 180ms ease, color 180ms ease;
}

body.docs-loading {
  overflow: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.45;
  pointer-events: none;
}

.orb-one {
  width: 320px;
  height: 320px;
  background: var(--orb-warm);
  top: 5%;
  left: -6%;
}

.orb-two {
  width: 280px;
  height: 280px;
  background: var(--orb-cool);
  bottom: 4%;
  right: -4%;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.topbar,
.card,
.hero {
  animation: rise 0.45s ease-out both;
}

.topbar {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 22px;
  background: var(--surface-topbar);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-topbar);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.brand-lockup {
  min-width: max-content;
}

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 14px;
}

.eyebrow,
.label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--eyebrow-size);
  color: var(--highlight);
  margin: 0 0 8px;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--title-size);
  font-weight: 700;
}

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

.nav a,
.sidebar-link,
.inline-link {
  color: var(--accent);
  text-decoration: none;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.nav a:hover,
.nav a.active {
  background: var(--surface-strong);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.theme-switch {
  display: grid;
  justify-items: end;
}

.theme-switch-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--sheen-line);
}

.theme-option {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.theme-option:hover {
  background: var(--surface);
  color: var(--ink);
  transform: none;
}

.theme-option.active,
.theme-option[aria-pressed="true"] {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--accent-hover);
}

.content {
  display: grid;
  gap: 20px;
}

.route-loader[hidden] {
  display: none;
}

.route-loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 18, 16, 0.22);
  backdrop-filter: blur(10px);
}

.route-loader-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  width: min(360px, calc(100vw - 40px));
  padding: 18px 20px;
  background: var(--surface-topbar);
  border: 1px solid var(--line-bright);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.route-loader-copy {
  display: grid;
  gap: 4px;
}

.route-loader-copy p {
  margin: 0;
}

.route-loader-title {
  font-weight: 700;
}

.route-loader-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--accent-track);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.hero,
.page-head {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 18px;
}

.hero {
  padding: 30px;
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
  border: 1px solid var(--line-bright);
  border-radius: 28px;
  box-shadow: var(--shadow);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.page-head {
  grid-template-columns: 1fr;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
}

h1 {
  font-size: var(--title-size);
  max-width: none;
  white-space: nowrap;
}

h2 {
  font-size: 1.3rem;
}

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

.hero-note,
.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.hero-note,
.card {
  padding: 22px;
}

.big-number {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  line-height: 1.02;
  font-weight: 700;
}

.hero-note .big-number {
  font-size: var(--title-size);
}

.card-grid,
.split-grid {
  display: grid;
  gap: 18px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.split-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.metric {
  min-height: 168px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--line-soft);
  font-size: 0.82rem;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.stack-row,
.bar-label,
.kv-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-track {
  height: 10px;
  background: var(--accent-track);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--highlight), var(--accent));
}

.kv-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

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

.kv-list dd {
  margin: 0;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.toolbar label {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
  flex: 1;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

button {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.table-shell {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.data-table thead th {
  font-size: 0.84rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.code-snippet {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 42ch;
  font-size: 0.83rem;
  color: var(--code-ink);
}

.doc-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 20px;
}

.sidebar-section + .sidebar-section {
  margin-top: 22px;
}

.sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: var(--accent-track);
}

.docs-empty-state {
  display: grid;
  gap: 24px;
  align-content: start;
  min-height: 420px;
}

.docs-empty-copy {
  display: grid;
  gap: 12px;
  max-width: 60ch;
}

.docs-empty-copy .eyebrow {
  margin-bottom: 0;
}

.docs-empty-copy .lede {
  margin: 0;
}

.json-viewer-toolbar {
  margin-bottom: 18px;
}

.json-viewer-toolbar label {
  min-width: min(360px, 100%);
}

.json-viewer-shell {
  min-height: 520px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: var(--code-bg);
  overflow: auto;
}

.json-viewer-note {
  margin: 0 0 14px;
  color: var(--muted);
}

.json-viewer-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  width: min(460px, 100%);
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.json-viewer-status[hidden] {
  display: none;
}

.json-viewer-status.has-error {
  grid-template-columns: 1fr;
  border-color: var(--status-degraded-line);
  background: var(--status-degraded-bg);
}

.json-viewer-status.has-error .route-loader-spinner {
  display: none;
}

.openapi-json-viewer[hidden] {
  display: none;
}

.openapi-json-viewer {
  display: block;
  width: 100%;
  color: var(--ink);
  --background-color: transparent;
  --color: var(--ink);
  --font-family: var(--font-mono);
  --font-size: 0.95rem;
  --line-height: 1.5rem;
  --indent-size: 1rem;
  --indentguide-color: var(--line-soft);
  --indentguide-color-active: var(--accent-hover);
  --outline-color: var(--line);
  --string-color: var(--accent);
  --number-color: var(--highlight);
  --boolean-color: var(--accent-strong);
  --null-color: var(--muted);
  --property-color: var(--ink);
  --preview-color: var(--muted);
  --highlight-color: var(--highlight);
}

.json-viewer-fallback {
  margin: 0;
  min-height: 420px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.4em;
  margin-bottom: 0.6em;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child {
  margin-top: 0;
}

.markdown-body p,
.markdown-body li {
  line-height: 1.65;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 16px;
  background: var(--code-bg);
}

.mermaid-diagram {
  margin: 1rem 0;
  padding: 18px;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 18px;
  background: var(--code-bg);
  border: 1px solid var(--line-soft);
  color: transparent;
  font-size: 0;
}

.mermaid-diagram::before {
  content: "Rendering diagram...";
  color: var(--muted);
  font-size: 0.95rem;
}

.mermaid-diagram.is-rendered {
  color: var(--ink);
  font-size: 1rem;
}

.mermaid-diagram.is-rendered::before {
  content: none;
}

.mermaid-diagram svg {
  max-width: 100%;
  height: auto;
}

.mermaid-diagram.has-error {
  display: block;
}

.mermaid-error {
  margin: 0 0 12px;
  color: var(--highlight);
  font-weight: 700;
}

.mermaid-fallback {
  margin: 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.inventory-card {
  display: grid;
  gap: 16px;
}

.inventory-head {
  align-items: start;
}

.inventory-meta-line {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.inventory-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.inventory-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.ghost-button {
  background: var(--accent-track);
  color: var(--accent);
  border: 1px solid var(--accent-hover);
  box-shadow: none;
}

.ghost-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.ghost-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.status-pill {
  text-transform: capitalize;
}

.status-callout {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.status-callout h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.inventory-hint {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.inventory-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.inventory-list dd {
  text-align: right;
}

.simulator-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.simulator-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.detail-panel {
  min-height: 540px;
}

.simulator-guide {
  gap: 18px;
}

.simulator-wide-card {
  grid-column: 1 / -1;
}

.guide-metric-grid,
.kind-card-grid {
  display: grid;
  gap: 12px;
}

.guide-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.guide-metric-tile,
.kind-card,
.flow-node,
.guide-note {
  border-radius: 18px;
  border: 1px solid var(--line-soft);
}

.guide-metric-tile,
.kind-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--surface-soft);
}

.guide-metric-tile strong,
.kind-card strong {
  font-size: 1.02rem;
}

.guide-metric-tile span,
.kind-card p {
  margin: 0;
}

.simulator-flow-strip {
  display: grid;
  gap: 10px;
}

.flow-node {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
}

.flow-node p {
  margin: 0;
}

.flow-step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--highlight), var(--accent));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.flow-link {
  justify-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-track);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kind-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.menu-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.kind-submenu {
  background: var(--accent-panel);
}

.kind-program {
  background: var(--highlight-soft);
}

.kind-report {
  background: var(--neutral-soft);
}

.tone-submenu {
  background: var(--accent-panel);
}

.tone-program {
  background: var(--highlight-soft);
}

.tone-report {
  background: var(--neutral-soft);
}

.tone-external {
  background: var(--status-neutral-bg);
}

.tone-unknown {
  background: var(--surface-note);
}

.type-pill {
  min-width: 2.2rem;
  justify-content: center;
  font-weight: 700;
  cursor: help;
}

.legend-inline {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 8px;
}

.legend-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
}

.legend-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.legend-code {
  display: inline-grid;
  place-items: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--highlight), var(--accent));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: help;
}

.legend-copy {
  display: grid;
  gap: 4px;
}

.legend-copy p,
.legend-stat {
  margin: 0;
}

.legend-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-confidence-confirmed {
  background: var(--status-healthy-bg);
  color: var(--status-healthy-ink);
  border-color: var(--status-healthy-line);
}

.legend-confidence-strong {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--line-soft);
}

.legend-confidence-working {
  background: var(--highlight-track);
  color: var(--highlight);
  border-color: var(--line-soft);
}

.guide-note {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface-note);
}

.breadcrumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-track);
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb-chip.active {
  background: var(--highlight-track);
  color: var(--highlight);
}

.menu-item-list {
  display: grid;
  gap: 10px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 4px;
}

.menu-item-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.menu-item-card:hover,
.menu-item-card.active {
  transform: translateY(-1px);
  background: var(--surface-soft-strong);
  border-color: var(--accent-hover);
}

.menu-item-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: start;
}

.menu-item-meta {
  margin: 0;
  line-height: 1.45;
}

.detail-block {
  display: grid;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.detail-block h3 {
  margin: 0;
}

.simulator-preview {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: var(--accent-panel);
  border: 1px solid var(--accent-panel-border);
}

.preview-hint,
.preview-status {
  margin: 6px 0 0;
}

.preview-sql {
  min-height: 60px;
  max-height: 220px;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-ink);
}

.preview-results {
  max-height: 360px;
  overflow: auto;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  text-align: center;
}

.status-healthy {
  background: var(--status-healthy-bg);
  color: var(--status-healthy-ink);
  border-color: var(--status-healthy-line);
}

.status-degraded {
  background: var(--status-degraded-bg);
  color: var(--status-degraded-ink);
  border-color: var(--status-degraded-line);
}

.status-stopped,
.status-not-configured,
.status-unknown {
  background: var(--status-neutral-bg);
  color: var(--status-neutral-ink);
  border-color: var(--status-neutral-line);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #111915;
    --bg-start: #16211d;
    --bg-end: #0f1513;
    --bg-radial-warm: rgba(184, 92, 56, 0.22);
    --bg-radial-cool: rgba(37, 92, 75, 0.28);
    --orb-warm: rgba(184, 92, 56, 0.2);
    --orb-cool: rgba(37, 92, 75, 0.22);
    --surface: rgba(18, 27, 24, 0.82);
    --surface-topbar: rgba(20, 29, 26, 0.82);
    --surface-strong: #21342f;
    --surface-soft: rgba(29, 44, 39, 0.62);
    --surface-soft-strong: rgba(39, 58, 52, 0.88);
    --surface-note: rgba(27, 39, 35, 0.76);
    --hero-start: rgba(27, 38, 34, 0.96);
    --hero-end: rgba(15, 23, 20, 0.92);
    --ink: #e7efe9;
    --muted: #a3b6ac;
    --accent: #8ed0b4;
    --accent-strong: #5ca187;
    --accent-soft: rgba(99, 151, 129, 0.2);
    --accent-track: rgba(99, 151, 129, 0.18);
    --accent-hover: rgba(99, 151, 129, 0.28);
    --accent-panel: rgba(54, 100, 81, 0.18);
    --accent-panel-border: rgba(110, 167, 145, 0.2);
    --highlight: #f0a27f;
    --highlight-soft: rgba(240, 162, 127, 0.14);
    --highlight-track: rgba(240, 162, 127, 0.22);
    --line: rgba(223, 238, 229, 0.14);
    --line-soft: rgba(223, 238, 229, 0.1);
    --line-bright: rgba(143, 181, 167, 0.18);
    --line-topbar: rgba(143, 181, 167, 0.15);
    --sheen-line: rgba(255, 255, 255, 0.04);
    --field: rgba(17, 27, 24, 0.9);
    --code-bg: rgba(223, 238, 229, 0.08);
    --code-ink: #d5f4e6;
    --neutral-soft: rgba(223, 238, 229, 0.08);
    --status-healthy-bg: rgba(61, 153, 103, 0.18);
    --status-healthy-ink: #b5f1cf;
    --status-healthy-line: rgba(61, 153, 103, 0.26);
    --status-degraded-bg: rgba(184, 92, 56, 0.22);
    --status-degraded-ink: #ffd0bd;
    --status-degraded-line: rgba(184, 92, 56, 0.28);
    --status-neutral-bg: rgba(223, 238, 229, 0.08);
    --status-neutral-ink: var(--ink);
    --status-neutral-line: rgba(223, 238, 229, 0.12);
    --selection-bg: rgba(240, 162, 127, 0.28);
    --shadow: 0 28px 70px rgba(2, 7, 5, 0.45);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 20px, 1280px);
    margin: 12px auto 28px;
  }

  .hero,
  .doc-layout,
  .simulator-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-controls,
  .nav {
    width: 100%;
    justify-content: start;
  }

  .theme-switch {
    width: 100%;
    justify-items: start;
  }

  .sidebar {
    position: static;
  }

  .inventory-pills,
  .inventory-toolbar {
    justify-content: start;
  }

  .inventory-list dd {
    text-align: left;
  }

  .menu-item-list {
    max-height: none;
  }

  .guide-metric-grid,
  .kind-card-grid,
  .menu-type-grid {
    grid-template-columns: 1fr;
  }

  .legend-inline {
    justify-content: start;
  }
}
