/* Generated by scripts/generators/build-site-css.mjs from
   registry/design-system.json. Do not hand-edit — constitution §0.2.

   Source version 1.0.0. 20 components.
   Colours, spacing, type, radius, shadow and motion all resolve to tokens
   in tokens.css, which is itself generated from registry/design-tokens.json. */

/* ---------------------------------------------------------------- reset */
/* Baseline. Everything after this assumes border-box and a token-driven body. */
*, *::before, *::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-16);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  margin: 0;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-semibold);
}
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img, svg {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- layout */
/* One container set. Wide content scrolls inside its own box; the body never scrolls sideways. */
.wrap {
  width: 100%;
  max-width: var(--container-default);
  margin-inline: auto;
  padding-inline: var(--gutter-mobile);
}
.wrap--narrow {
  max-width: var(--container-narrow);
}
.section {
  padding-block: var(--space-20);
  border-top: 1px solid var(--line-soft);
}
.eyebrow {
  font-size: var(--text-12);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-4);
}
.h-section {
  font-size: var(--text-36);
  max-width: 24ch;
}
.lede {
  font-size: var(--text-18);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  max-width: 62ch;
  margin-top: var(--space-5);
}
.note {
  font-size: var(--text-13);
  color: var(--text-dim);
  margin-top: var(--space-6);
  max-width: 72ch;
  line-height: var(--leading-relaxed);
}
@media (min-width: 640px) {
  .wrap {
    padding-inline: var(--gutter-tablet);
  }
}
@media (min-width: 1024px) {
  .wrap {
    padding-inline: var(--gutter-desktop);
  }
}
@media (min-width: 900px) {
  .section {
    padding-block: var(--space-24);
  }
}

/* ---------------------------------------------------------------- header */
.top {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: var(--space-16);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  color: var(--text);
  font-size: var(--text-16);
  letter-spacing: var(--tracking-tight);
}
.brand:hover {
  text-decoration: none;
}
.brand__mark {
  width: var(--space-6);
  height: var(--space-6);
  border-radius: var(--radius-sm);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  flex: none;
}
.nav a {
  color: var(--text-muted);
  font-size: var(--text-14);
  font-weight: var(--weight-medium);
}
.nav a:hover {
  color: var(--text);
  text-decoration: none;
}
.theme-toggle {
  width: var(--space-10);
  height: var(--space-10);
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}
.theme-toggle .moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .moon {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .sun {
  display: none;
}
.top__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--space-16);
  min-width: 0;
}
.brand {
  min-width: 0;
  flex: none;
}
.nav {
  display: none;
  gap: var(--space-6);
  margin-left: auto;
  align-items: center;
}
.top__cta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-left: auto;
  flex: none;
}
.top__cta .btn--ghost {
  display: none;
}
.nav-toggle {
  width: var(--space-10);
  height: var(--space-10);
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex: none;
}
.nav-toggle:hover {
  background: var(--surface-2);
}
.nav-panel {
  position: fixed;
  inset: var(--space-16) 0 auto 0;
  z-index: var(--z-overlay);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: none;
  padding: var(--space-4) 0 var(--space-6);
  max-height: calc(100dvh - var(--space-16));
  overflow-y: auto;
}
.nav-panel[data-open="true"] {
  display: block;
}
.nav-panel a {
  display: flex;
  align-items: center;
  min-height: var(--space-12);
  padding: 0 var(--gutter-mobile);
  font-size: var(--text-16);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.nav-panel a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.nav-panel .btn {
  margin: var(--space-4) var(--gutter-mobile) 0;
  width: auto;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .moon {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .sun {
    display: none;
  }
}
@media (min-width: 600px) {
  .top__cta .btn--ghost {
    display: inline-flex;
  }
}
@media (min-width: 960px) {
  .nav {
    display: flex;
  }

  .top__cta {
    margin-left: 0;
  }

  .nav-toggle {
    display: none;
  }
}
@media (min-width: 960px) {
  .nav-panel {
    display: none !important;
  }
}

/* ---------------------------------------------------------------- button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--space-10);
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-14);
  font-weight: var(--weight-semibold);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--accent-ink);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent-line);
}
.btn--lg {
  min-height: var(--space-12);
  padding: 0 var(--space-6);
  font-size: var(--text-16);
}
.btn--sm {
  min-height: var(--space-8);
  padding: 0 var(--space-4);
  font-size: var(--text-13);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.btn-row .btn {
  width: 100%;
}
.btn, .nav a, .foot a {
  min-height: var(--space-6);
}
@media (min-width: 560px) {
  .btn-row .btn {
    width: auto;
  }
}

/* ---------------------------------------------------------------- hero */
.hero {
  padding-block: var(--space-20) var(--space-16);
  position: relative;
  border-top: 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60ch 40ch at 12% -10%, var(--accent-soft), transparent 70%), radial-gradient(50ch 34ch at 92% 0%, var(--info-soft), transparent 70%);
}
.hero__grid {
  display: grid;
  gap: var(--space-12);
  align-items: start;
}
.hero h1 {
  font-size: var(--text-hero);
  max-width: 16ch;
}
.hero__lede {
  margin-top: var(--space-4);
  font-size: var(--text-22);
  font-weight: var(--weight-medium);
  color: var(--accent-ink);
}
.hero__body {
  margin-top: var(--space-5);
  font-size: var(--text-18);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  max-width: 54ch;
}
.hero__note {
  margin-top: var(--space-5);
  font-size: var(--text-13);
  color: var(--text-dim);
}
@media (min-width: 900px) {
  .hero {
    padding-block: var(--space-24) var(--space-20);
  }
}
@media (min-width: 1040px) {
  .hero__grid {
    grid-template-columns: 1.02fr 0.98fr;
    gap: var(--space-16);
  }
}

/* ---------------------------------------------------------------- console */
/* The product visual. Illustrative data, drawn from real registry rows. */
.console {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.console__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.console__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
}
.console__label {
  margin-left: var(--space-2);
  font-size: var(--text-12);
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.console__body {
  display: grid;
  grid-template-columns: 1fr;
}
.console__main {
  padding: var(--space-5);
  min-width: 0;
}
.console__side {
  padding: var(--space-5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.console__side h4 {
  font-size: var(--text-11);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-4);
}
.stage {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-13);
  color: var(--text-muted);
  padding-block: var(--space-1);
}
.stage__tick {
  color: var(--delivered);
  font-weight: var(--weight-bold);
  flex: none;
}
@media (min-width: 720px) {
  .console__body {
    grid-template-columns: minmax(0,1fr) 15rem;
  }
}
@media (min-width: 720px) {
  .console__side {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

/* ---------------------------------------------------------------- code */
.code {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-13);
  line-height: var(--leading-relaxed);
  overflow: hidden;
}
.code pre {
  margin: 0;
  padding: var(--space-5);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.code .c {
  color: var(--code-dim);
}
.code .k {
  color: var(--code-accent);
}
.code .s {
  color: var(--code-string);
}
.console__main .code pre {
  padding: var(--space-4);
  font-size: var(--text-12);
}

/* ---------------------------------------------------------------- grid */
.grid {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-10);
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--surface);
  transition: border-color var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease);
}
.card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}
.card h3 {
  font-size: var(--text-16);
  margin-bottom: var(--space-3);
}
.card p {
  font-size: var(--text-14);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}
.card__meta {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  color: var(--text-dim);
  margin-bottom: var(--space-3);
  word-break: break-all;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
@media (min-width: 700px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------- state-cards */
.states {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-10);
}
.state {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--surface);
}
.state__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.state__dot {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-pill);
  flex: none;
}
.state__name {
  font-size: var(--text-14);
  font-weight: var(--weight-semibold);
}
.state__desc {
  font-size: var(--text-13);
  color: var(--text-dim);
  margin-top: var(--space-3);
  line-height: var(--leading-relaxed);
}
.state[data-tone="requested"] .state__dot {
  background: var(--requested);
}
.state[data-tone="sent"] .state__dot {
  background: var(--sent);
}
.state[data-tone="delivered"] .state__dot {
  background: var(--delivered);
}
.state[data-tone="engaged"] .state__dot {
  background: var(--engaged);
}
@media (min-width: 720px) {
  .states {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------- timeline */
.timeline {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.timeline__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  background: var(--surface-2);
}
.timeline__title {
  font-size: var(--text-13);
  font-weight: var(--weight-semibold);
}
.timeline__id {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  color: var(--text-dim);
}
.timeline__rows {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
}
.timeline__row {
  display: grid;
  grid-template-columns: 9ch 1fr;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  align-items: baseline;
}
.timeline__row + .timeline__row {
  border-top: 1px solid var(--line-soft);
}
.timeline__time {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  color: var(--text-dim);
}
.timeline__event {
  font-size: var(--text-14);
}
.timeline__meta {
  font-size: var(--text-12);
  color: var(--text-dim);
  margin-top: var(--space-1);
  font-family: var(--font-mono);
}
.timeline__id {
  word-break: break-all;
  min-width: 0;
}

/* ---------------------------------------------------------------- badge */
.pill {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-11);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.pill--evidence {
  background: var(--success-soft);
  color: var(--success);
}
.pill--observed {
  background: var(--warning-soft);
  color: var(--warning);
}
.pill--available {
  background: var(--success-soft);
  color: var(--success);
}
.pill--roadmap {
  background: var(--warning-soft);
  color: var(--warning);
}
.pill--neutral {
  background: var(--surface-3);
  color: var(--text-dim);
}
.pill--accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.section__status {
  margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------- flow */
.flow {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-10);
  align-items: center;
}
.flow__box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--surface);
}
.flow__box--engine {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
}
.flow__label {
  font-size: var(--text-11);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-4);
  font-weight: var(--weight-semibold);
}
.flow__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-13);
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.flow__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  font-size: var(--text-13);
  color: var(--text);
}
@media (min-width: 900px) {
  .flow {
    grid-template-columns: 1fr 1.3fr 1fr;
  }
}

/* ---------------------------------------------------------------- table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-top: var(--space-10);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-14);
}
th, td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  vertical-align: top;
}
th {
  font-size: var(--text-12);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  border-top: 1px solid var(--line-soft);
  color: var(--text-muted);
}
td:first-child {
  color: var(--text);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.table-wrap {
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------- pricing */
.plans {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-10);
}
.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.plan--featured {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  position: relative;
}
.plan__flag {
  position: absolute;
  top: calc(var(--space-3) * -1);
  left: var(--space-6);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-11);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
}
.plan__name {
  font-size: var(--text-14);
  font-weight: var(--weight-semibold);
}
.plan__price {
  font-size: var(--text-36);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  margin-top: var(--space-3);
}
.plan__price span {
  font-size: var(--text-14);
  font-weight: var(--weight-regular);
  color: var(--text-dim);
}
.plan__vol {
  font-size: var(--text-13);
  color: var(--text-muted);
  margin-top: var(--space-2);
}
.plan ul {
  list-style: none;
  margin: var(--space-5) 0 var(--space-6);
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-13);
  color: var(--text-muted);
}
.plan li {
  padding-left: var(--space-5);
  position: relative;
  line-height: var(--leading-normal);
}
.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}
.plan .btn {
  margin-top: auto;
  width: 100%;
}
@media (min-width: 760px) {
  .plans {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1140px) {
  .plans {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------- callout */
.callout {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-top: var(--space-8);
}
.callout p {
  font-size: var(--text-14);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}
.cta-band {
  text-align: center;
  padding-block: var(--space-24);
  border-top: 1px solid var(--line-soft);
}
.cta-band h2 {
  font-size: var(--text-36);
  max-width: 20ch;
  margin-inline: auto;
}
.cta-band p {
  margin-top: var(--space-4);
  font-size: var(--text-18);
  color: var(--text-muted);
  max-width: 52ch;
  margin-inline: auto;
}
.cta-band .btn-row {
  justify-content: center;
}

/* ---------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--line);
  padding-block: var(--space-12) var(--space-10);
  background: var(--surface-2);
}
.foot__grid {
  display: grid;
  gap: var(--space-8);
}
.foot h4 {
  font-size: var(--text-12);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-4);
  font-weight: var(--weight-semibold);
}
.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.foot a {
  color: var(--text-muted);
  font-size: var(--text-14);
}
.foot a:hover {
  color: var(--text);
}
.foot__legal {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-size: var(--text-13);
  color: var(--text-dim);
}
.foot ul {
  gap: var(--space-1);
}
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-8);
  padding-block: var(--space-1);
}
@media (min-width: 800px) {
  .foot__grid {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

/* ---------------------------------------------------------------- modal */
/* Every CTA opens one of these. Focus is trapped while open and restored on close. */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-4);
  overflow-y: auto;
}
.modal[data-open="true"] {
  display: flex;
}
.modal__scrim {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text) 45%, transparent);
  backdrop-filter: blur(2px);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-block: var(--space-12);
  overflow: hidden;
}
.modal__head {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.modal__head h2 {
  font-size: var(--text-18);
}
.modal__head p {
  font-size: var(--text-14);
  color: var(--text-muted);
  margin-top: var(--space-2);
  line-height: var(--leading-relaxed);
}
.modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: var(--space-8);
  height: var(--space-8);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-16);
}
.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.modal__body {
  padding: var(--space-6);
}
.field {
  margin-bottom: var(--space-5);
}
.field label {
  display: block;
  font-size: var(--text-13);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-2);
}
.field .hint {
  font-size: var(--text-12);
  color: var(--text-dim);
  margin-top: var(--space-2);
}
.field input, .field textarea, .field select {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-14);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  min-height: var(--space-10);
}
.field textarea {
  min-height: var(--space-20);
  resize: vertical;
  line-height: var(--leading-relaxed);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  border-color: var(--accent);
}
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea {
  border-color: var(--danger);
}
.field__error {
  font-size: var(--text-12);
  color: var(--danger);
  margin-top: var(--space-2);
  display: none;
}
.field[data-invalid="true"] .field__error {
  display: block;
}
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.modal__status {
  font-size: var(--text-13);
  margin-top: var(--space-4);
  min-height: var(--space-5);
  color: var(--text-muted);
}
.modal__status[data-state="error"] {
  color: var(--danger);
}
.modal__status[data-state="ok"] {
  color: var(--success);
}
.modal__done {
  display: none;
  padding: var(--space-8) var(--space-6);
  text-align: center;
}
.modal[data-done="true"] .modal__done {
  display: block;
}
.modal[data-done="true"] .modal__body {
  display: none;
}
.modal__done h3 {
  font-size: var(--text-18);
  margin-bottom: var(--space-3);
}
.modal__done p {
  font-size: var(--text-14);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}
.modal__ref {
  font-family: var(--font-mono);
  font-size: var(--text-14);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: inline-block;
  margin-top: var(--space-5);
}
.modal__legal {
  font-size: var(--text-12);
  color: var(--text-dim);
  margin-top: var(--space-5);
  line-height: var(--leading-relaxed);
}
body[data-modal-open] {
  overflow: hidden;
}

/* ---------------------------------------------------------------- preprocess */
/* The preprocessing rail on a real payload. Kept fields, a dropped field and a blocked field, side by side with what the rail did. */
.pp {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-10);
}
.pp__panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.pp__head {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-11);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: var(--weight-semibold);
}
.pp__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-12);
}
.pp__row + .pp__row {
  border-top: 1px solid var(--line-soft);
}
.pp__key {
  color: var(--text-dim);
  min-width: 11ch;
}
.pp__val {
  color: var(--text);
  word-break: break-all;
  flex: 1;
}
.pp__tag {
  font-family: var(--font-ui);
  font-size: var(--text-11);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
.pp__row[data-pp="dropped"] .pp__tag {
  color: var(--warning);
}
.pp__row[data-pp="blocked"] .pp__tag {
  color: var(--danger);
}
.pp__row[data-pp="kept"] .pp__tag {
  color: var(--delivered);
}
.pp__row[data-pp="blocked"] {
  background: var(--danger-soft);
}
.pp__stages {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-11);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.pp__arrow {
  color: var(--accent);
  font-size: var(--text-16);
}
.pp__out {
  margin-top: var(--space-4);
  font-size: var(--text-13);
  color: var(--text-muted);
}
.pp__row[data-pp="dropped"] .pp__val {
  text-decoration: line-through;
  color: var(--text-dim);
}
.pp__row[data-pp="dropped"] {
  background: var(--warning-soft);
}
.pp__row[data-pp="blocked"] .pp__val {
  color: var(--danger);
  font-weight: var(--weight-semibold);
}
.pp__panel {
  min-height: 0;
}
@media (min-width: 860px) {
  .pp {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-6);
  }
}

/* ---------------------------------------------------------------- pack-install */
/* A pack cascading into a workspace. Rows are the pack's real contents. */
.packs {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-8);
}
.packs .card {
  padding: var(--space-4) var(--space-5);
}
.packs .card h3 {
  font-size: var(--text-13);
  margin-bottom: var(--space-1);
}
.packs .card p {
  font-size: var(--text-12);
  font-family: var(--font-mono);
  color: var(--text-dim);
}
.pack-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-10);
}
.pack-head h3 {
  font-size: var(--text-18);
}
@media (min-width: 700px) {
  .packs {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .packs {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------------------------------------------------------------- widget-frame */
.widget-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-10);
}
.widget-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.widget-frame__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.widget-frame__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  display: inline-block;
}
.widget-frame__host {
  margin-left: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-11);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.widget {
  padding: var(--space-5);
}
.widget__head {
  margin-bottom: var(--space-4);
}
.widget__title {
  margin: 0;
  font-size: var(--text-16);
  font-weight: var(--weight-semibold);
}
.widget__sub {
  margin: var(--space-1) 0 0;
  font-size: var(--text-13);
  color: var(--text-muted);
}
.widget__rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.widget__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}
.widget__row:last-child {
  border-bottom: 0;
}
.widget__label {
  flex: 1;
  min-width: 0;
}
.widget__name {
  display: block;
  font-size: var(--text-13);
  font-weight: var(--weight-semibold);
}
.widget__desc {
  display: block;
  font-size: var(--text-12);
  color: var(--text-muted);
  margin-top: var(--space-1);
  line-height: 1.5;
}
.widget__lock {
  font-size: var(--text-11);
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.widget__switch {
  width: 38px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--line);
  position: relative;
  flex-shrink: 0;
  display: inline-block;
}
.widget__switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.widget__switch.on {
  background: var(--accent);
  border-color: var(--accent);
}
.widget__switch.on span {
  left: auto;
  right: 2px;
}
.widget__foot {
  margin: var(--space-4) 0 0;
  font-size: var(--text-11);
  color: var(--text-dim);
  line-height: 1.5;
}
.widget-frame__cap {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-12);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  margin-top: auto;
}
.widget__btn {
  font-size: var(--text-11);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.widget__btn--danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}
