/* kern — white-first, quiet type, one clear reading.
   Palette and proportions follow the brand sheet in assets/brand/identity.webp.

   This sheet is the whole design system: eight pages share it and no page may
   add a stylesheet of its own, so a component that is missing here becomes an
   inline workaround somewhere. Every tint below is mixed from the five brand
   colours rather than picked afresh, which is why the tone tokens are
   color-mix() over a plain fallback instead of new hex values. */

:root {
  color-scheme: light;

  --ink: #171c24;
  --ink-soft: #39414d;
  --muted: #5f6874;
  --muted-2: #6b7280;
  --line: #e7eaef;
  --line-soft: #f0f2f6;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f7;
  --sage: #b9c3af;
  --mist: #dde3ec;
  --danger: #a8403a;
  --danger-bg: #fcf5f4;
  --danger-line: #f0dedc;

  /* Tints. Declared twice on purpose: the flat value is what a browser without
     color-mix() keeps, the mix is what everything else computes. */
  --sage-bg: #f5f7f3;
  --sage-bg: color-mix(in srgb, var(--sage) 18%, var(--surface));
  --sage-line: #dfe4d9;
  --sage-line: color-mix(in srgb, var(--sage) 52%, var(--surface));
  --sage-ink: #5f6b55;
  --sage-ink: color-mix(in srgb, var(--sage) 58%, var(--ink));
  --warn-ink: #6b5b3f;
  --warn-ink: color-mix(in srgb, var(--danger) 34%, var(--sage-ink));

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-2xs: 10.5px;
  --text-xs: 11px;
  --text-sm: 12.5px;
  --text-note: 13px;
  --text-body: 14px;
  --text-md: 16px;
  --text-lg: 19px;
  --text-xl: 23px;
  --text-2xl: 27px;
  --text-3xl: clamp(30px, 4.6vw, 44px);
  --text-hero: clamp(44px, 7.4vw, 88px);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;
  --space-10: 72px;

  --radius-sm: 8px;
  --radius-control: 10px;
  --radius-lg: 12px;
  --radius-card: 16px;
  --radius-pill: 999px;

  --control-h: 52px;
  --control-h-sm: 38px;
  --content-max: 1120px;
  --prose-max: 68ch;

  --z-base: 0;
  --z-sticky: 10;
  --z-header: 20;
  --z-overlay: 30;

  --shadow-card: 0 1px 2px rgba(23, 28, 36, 0.04), 0 24px 48px -32px rgba(23, 28, 36, 0.28);
  --shadow-soft: 0 1px 2px rgba(23, 28, 36, 0.04);
  --focus-ring: 0 0 0 3px rgba(23, 28, 36, 0.08);
  --ease: 140ms ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

a {
  color: var(--ink);
  text-decoration-color: var(--mist);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--sage);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---------- utilities ---------- */

.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;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: var(--z-overlay);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: var(--text-body);
  transform: translateY(-160%);
  transition: transform var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.mono {
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

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

.nowrap {
  white-space: nowrap;
}

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.break {
  overflow-wrap: anywhere;
}

/* Vertical rhythm for a column of blocks. Pages stack cards with this instead
   of putting a margin on every component. */
.stack > * + * {
  margin-top: var(--space-6);
}

.stack--tight > * + * {
  margin-top: var(--space-3);
}

.stack--loose > * + * {
  margin-top: var(--space-8);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.toolbar--end {
  justify-content: flex-end;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.divider {
  height: 1px;
  margin: var(--space-6) 0;
  border: 0;
  background: var(--line-soft);
}

.prose {
  max-width: var(--prose-max);
}

.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: var(--space-4);
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--space-7);
}

.prose h3 {
  font-size: var(--text-md);
  font-weight: 650;
  margin-top: var(--space-6);
}

/* ---------- page frame ---------- */

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-6) var(--space-9);
}

.page-main {
  display: block;
}

/* ---------- site header ---------- */

/* Brand and network switcher share the top row; the eight nav items always get
   a full-width row of their own. Sharing one row squeezed the nav into whatever
   the switcher left over -- 210px of a 560px strip once a custom endpoint was
   showing, which hid five of the eight pages behind a scroll. */
.site-header,
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-soft);
}

.site-header > .site-nav,
.masthead > .site-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

/* The one message a reader without JavaScript is meant to see. It is authored
   in each page's HTML, so it has to look deliberate even before this sheet's
   header rules apply to anything. */
[data-chrome] > noscript {
  grid-column: 1 / -1;
  display: block;
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--mist);
  border-left: 3px solid var(--warn-ink);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  font-size: var(--text-body);
  color: var(--ink-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.wordmark {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
}

.brand-rule {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand .eyebrow {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Eight items have to fit a 390px screen. They scroll sideways inside the nav
   rather than wrapping into a squashed block; the strip is its own scroll
   container so the page itself never scrolls horizontally. */
.site-nav {
  min-width: 0;
}

.site-nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.site-nav-list::-webkit-scrollbar {
  height: 4px;
}

.site-nav-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--radius-pill);
}

.site-nav-item {
  scroll-snap-align: start;
}

.site-nav-link {
  display: block;
  padding: var(--space-2) 1px;
  border-bottom: 2px solid transparent;
  font-size: var(--text-body);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease), border-color var(--ease);
}

.site-nav-link:hover {
  color: var(--ink-soft);
  border-bottom-color: var(--line);
}

.site-nav-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--sage);
}

.site-nav-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- network switcher ---------- */

.netswitch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.netswitch-select {
  height: var(--control-h-sm);
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: var(--text-note);
  color: var(--ink-soft);
  cursor: pointer;
}

.netswitch-select:hover {
  border-color: var(--mist);
}

.netswitch-host[hidden] {
  display: none;
}

.netswitch-host {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 22ch;
  padding: 0 var(--space-3);
  height: var(--control-h-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: var(--text-sm);
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.netswitch-custom {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex-wrap: wrap;
  width: 100%;
  justify-content: flex-end;
}

.netswitch-custom[hidden] {
  display: none;
}

.netswitch-custom .input {
  flex: 1 1 240px;
  max-width: 340px;
}

.netswitch-error {
  flex: 1 1 100%;
  text-align: right;
  font-size: var(--text-sm);
  color: var(--danger);
}

.netswitch-error:empty {
  display: none;
}

/* ---------- site footer ---------- */

.site-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-soft);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-6);
}

.footer-col {
  min-width: 0;
}

.footer-title {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: var(--space-3);
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-list li + li {
  margin-top: var(--space-2);
}

.footer-link {
  font-size: var(--text-body);
  color: var(--muted);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--sage);
}

.footer-note {
  font-size: var(--text-note);
  color: var(--muted-2);
  max-width: 34ch;
}

.colophon {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
  font-size: var(--text-xs);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.site-footer .colophon {
  border-top: 0;
  padding-top: 0;
}

/* ---------- page header ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-8) 0 var(--space-7);
}

.page-head-text {
  min-width: 0;
}

.page-eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  margin-top: var(--space-3);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.page-head .lede {
  margin-top: var(--space-4);
}

.page-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.lede {
  max-width: 44ch;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--muted);
}

/* ---------- hero (Inspect) ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) 0 44px;
}

.hero h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.97;
}

.hero .lede {
  margin-top: var(--space-5);
  max-width: 34ch;
  font-size: clamp(17px, 1.6vw, 21px);
}

/* The banner is one composed image; this window shows only its glass artwork
   (source region x 1080–2000, y 0–600 of a 2000×667 file). */
.hero-art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 920 / 600;
}

.hero-art img {
  position: absolute;
  top: 0;
  left: -117.39%;
  width: 217.39%;
  max-width: none;
  height: auto;
}

/* ---------- card ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 30px;
}

.card--quiet {
  background: var(--surface-2);
  border-color: var(--line-soft);
  box-shadow: none;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card--flush .card-head {
  padding: var(--space-6) var(--space-6) 0;
  margin-bottom: var(--space-4);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.card-head h2,
.card-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.card-head h3,
.card-title--sm {
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card-sub {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 62ch;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.section {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-soft);
}

.section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section-title {
  font-size: var(--text-note);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-4);
}

/* ---------- form ---------- */

.form {
  display: flex;
  gap: var(--space-3);
}

.input,
.textarea,
.select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.input,
.select {
  height: var(--control-h);
  padding: 0 var(--space-4);
}

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

.input--text,
.textarea--text {
  font-family: var(--font);
  letter-spacing: normal;
}

.input--sm,
.select--sm {
  height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-body);
  border-radius: var(--radius-sm);
}

.textarea {
  padding: var(--space-3) var(--space-4);
  min-height: 108px;
  resize: vertical;
  line-height: 1.55;
}

.select {
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  padding-right: var(--space-7);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  /* The two 5px squares are halves of one chevron, so they have to sit flush
     against each other: 20px and 15px in from the right edge. */
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select--sm {
  padding-right: 26px;
  background-position: calc(100% - 17px) center, calc(100% - 12px) center;
}

.input::placeholder,
.textarea::placeholder {
  font-family: var(--font);
  color: var(--muted-2);
  letter-spacing: normal;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--mist);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--ink-soft);
  box-shadow: var(--focus-ring);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--danger);
}

.input[readonly] {
  background: var(--surface-2);
}

.form-row {
  display: block;
  min-width: 0;
}

.form-row + .form-row {
  margin-top: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-note);
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: var(--space-2);
}

.form-hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted-2);
}

.form-error {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--danger);
}

.form-error:empty,
.form-hint:empty {
  display: none;
}

/* A control with a button welded to its right edge; they stack on a phone. */
.form-row--inline .form-control {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.form-row--inline .form-control > .input,
.form-row--inline .form-control > .select {
  flex: 1 1 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.form-grid .form-row + .form-row {
  margin-top: 0;
}

.fieldset {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.legend {
  padding: 0 var(--space-2);
  margin-left: calc(var(--space-2) * -1);
  font-size: var(--text-note);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-body);
  color: var(--ink-soft);
  cursor: pointer;
}

.check + .check {
  margin-top: var(--space-3);
}

.check-input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.check-text {
  min-width: 0;
}

.check-note {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted-2);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.radio-group--row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-5);
}

/* ---------- repeating seed rows (Derive) ---------- */

.seed-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.seed-row {
  display: grid;
  grid-template-columns: auto 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.seed-row-index {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted-2);
  width: 2ch;
  text-align: right;
}

.seed-row .input,
.seed-row .select {
  height: 44px;
  font-size: var(--text-body);
}

.seed-row-note {
  grid-column: 2 / -1;
  font-size: var(--text-sm);
  color: var(--muted-2);
}

.seed-row-note:empty {
  display: none;
}

.seed-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.seed-count {
  font-size: var(--text-sm);
  color: var(--muted-2);
}

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-h);
  padding: 0 26px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease),
    opacity var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #0d1218;
}

.btn-ghost {
  height: 44px;
  padding: 0 var(--space-5);
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--mist);
}

.btn-quiet {
  height: 36px;
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: 500;
}

.btn-quiet:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
  height: 44px;
  padding: 0 var(--space-5);
  font-weight: 500;
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
}

.btn-sm {
  height: var(--control-h-sm);
  padding: 0 var(--space-4);
  font-size: var(--text-body);
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: var(--control-h-sm);
  height: var(--control-h-sm);
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  border-color: transparent;
  font-size: var(--text-md);
  line-height: 1;
}

.btn-icon:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* A busy button keeps its width so the row does not jump; the label goes
   transparent and the spinner sits on top of it. */
.btn[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
}

.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentcolor;
  border-top-color: transparent;
  color: var(--ink-soft);
  animation: kern-spin 640ms linear infinite;
}

.btn-primary[aria-busy="true"]::after {
  color: #fff;
}

/* ---------- chips, pills, badges ---------- */

.examples {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.examples-label {
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-right: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-note);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background-color var(--ease);
}

.chip:hover {
  border-color: var(--mist);
  color: var(--ink-soft);
}

.chip:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.chip--active,
.chip[aria-pressed="true"] {
  background: var(--sage-bg);
  border-color: var(--sage-line);
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--text-note);
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  flex: 0 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

.badge--ok {
  background: var(--sage-bg);
  border-color: var(--sage-line);
  color: var(--sage-ink);
}

.badge--warn {
  background: var(--surface-2);
  border-color: var(--mist);
  color: var(--warn-ink);
}

.badge--down {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}

.badge--mono {
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

/* ---------- copy button ---------- */

.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--muted-2);
  cursor: pointer;
  transition: color var(--ease), background-color var(--ease), border-color var(--ease);
}

.copy:hover {
  color: var(--ink-soft);
  background: var(--surface-2);
  border-color: var(--line);
}

.copy:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.copy.is-done {
  color: var(--sage-ink);
  border-color: var(--sage-line);
  background: var(--sage-bg);
}

/* ---------- fields ---------- */

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.fields[data-columns="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.fields[data-columns="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fields[data-columns="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fields--secondary {
  margin-top: var(--space-4);
}

.field {
  min-width: 0;
  padding: 15px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.field--quiet {
  background: var(--surface-2);
  border-color: var(--line-soft);
}

.field--flat {
  padding: 0;
  border: 0;
  background: transparent;
}

.field-label {
  font-size: var(--text-note);
  color: var(--muted);
}

.field-value {
  margin-top: var(--space-1);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.field--quiet .field-value {
  font-size: 17px;
}

.field-value.is-empty {
  color: var(--muted-2);
  font-weight: 500;
}

.field-note {
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--muted-2);
  overflow-wrap: anywhere;
}

.field-note:empty {
  display: none;
}

/* ---------- stat tiles ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}

.stat {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.stat--quiet {
  background: var(--surface-2);
  border-color: var(--line-soft);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat-value {
  margin-top: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stat-value.is-empty {
  color: var(--muted-2);
  font-weight: 500;
}

.stat-note {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.stat-note:empty {
  display: none;
}

/* ---------- definition list ---------- */

.detail {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px var(--space-5);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line-soft);
  font-size: var(--text-note);
}

.detail--flush {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.detail--wide {
  grid-template-columns: minmax(12ch, 22ch) minmax(0, 1fr);
  gap: var(--space-3) var(--space-6);
  font-size: var(--text-body);
}

.detail dt {
  color: var(--muted-2);
}

.detail dd {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* ---------- progress ---------- */

.progress {
  min-width: 0;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-note);
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.progress-value {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-weight: 600;
}

.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
  transition: width 240ms ease;
}

.progress-note {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted-2);
}

.progress-note:empty {
  display: none;
}

/* ---------- status dot ---------- */

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted-2);
  border: 1px solid transparent;
}

.status-dot--ok {
  background: var(--sage);
}

/* Warn and down must not rely on hue alone: warn is a hollow ring, down is
   filled. Every dot also carries visually hidden text. */
.status-dot--warn {
  background: var(--surface);
  border-color: var(--warn-ink);
}

.status-dot--down {
  background: var(--danger);
}

.status-dot--unknown {
  background: var(--surface);
  border-color: var(--muted-2);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-note);
  color: var(--ink-soft);
}

/* ---------- table ---------- */

.table-wrap {
  position: relative;
  margin-top: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.table-wrap--tall {
  max-height: 60vh;
}

.table-wrap--flush {
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}

.table caption {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-sm);
  color: var(--muted-2);
}

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

.table thead th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: var(--surface-2);
}

.table .col--num,
.table td.col--num,
.table th.col--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table .col--mono {
  font-family: var(--mono);
  font-size: var(--text-note);
  letter-spacing: -0.02em;
}

.table .col--tight {
  width: 1%;
  white-space: nowrap;
}

.table-empty td {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--muted-2);
}

/* ---------- alerts ---------- */

/* An alert with no tone is an error: that is what the word means, and it keeps
   a page that forgets the modifier from rendering a failure in quiet grey. */
.alert {
  margin-top: var(--space-5);
  padding: 14px var(--space-4);
  border: 1px solid var(--danger-line);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-control);
  background: var(--danger-bg);
}

.alert[hidden] {
  display: none;
}

.alert--error {
  border-color: var(--danger-line);
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

.alert--warning {
  border-color: var(--mist);
  border-left-color: var(--warn-ink);
  background: var(--surface-2);
}

.alert--info {
  border-color: var(--line);
  border-left-color: var(--mist);
  background: var(--surface-2);
}

.alert--success {
  border-color: var(--sage-line);
  border-left-color: var(--sage);
  background: var(--sage-bg);
}

.alert-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--danger);
}

.alert--warning .alert-title,
.alert--info .alert-title {
  color: var(--ink);
}

.alert--success .alert-title {
  color: var(--sage-ink);
}

.alert-details {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.alert-details:empty {
  display: none;
}

.alert-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* ---------- empty state ---------- */

.empty {
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  text-align: center;
}

.empty-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink-soft);
}

.empty-detail {
  margin: var(--space-2) auto 0;
  max-width: 46ch;
  font-size: var(--text-body);
  color: var(--muted);
}

.empty-action {
  margin-top: var(--space-4);
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ---------- busy ---------- */

.busy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-note);
  color: var(--muted);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--mist);
  border-top-color: var(--ink-soft);
  animation: kern-spin 640ms linear infinite;
  flex: 0 0 auto;
}

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

.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--surface-3), var(--line-soft), var(--surface-3));
  background-size: 200% 100%;
  animation: kern-shimmer 1200ms linear infinite;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}

.skeleton-row + .skeleton-row {
  border-top: 1px solid var(--line-soft);
}

@keyframes kern-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

[aria-busy="true"] .fields,
.card[aria-busy="true"] .fields {
  opacity: 0.55;
  transition: opacity var(--ease);
}

.status {
  font-size: var(--text-note);
  color: var(--muted);
  text-align: right;
}

.status[data-tone="busy"] {
  color: var(--ink-soft);
}

.status[data-tone="error"] {
  color: var(--danger);
}

.status[data-tone="done"] {
  color: var(--sage-ink);
}

/* ---------- code and hex ---------- */

.code {
  display: block;
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: var(--text-note);
  line-height: 1.6;
  color: var(--ink-soft);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
  tab-size: 2;
}

.code:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.code--wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-inline {
  padding: 1px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.9em;
}

.hex {
  margin-top: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  overflow: hidden;
}

.hex-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-3) 0;
}

.hex-scroll:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.hex-row {
  display: flex;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  font-family: var(--mono);
  font-size: var(--text-note);
  line-height: 1.75;
  white-space: pre;
  width: max-content;
  min-width: 100%;
}

.hex-row:hover {
  background: var(--surface-3);
}

.hex-offset {
  color: var(--muted-2);
  user-select: none;
}

.hex-bytes {
  color: var(--ink-soft);
}

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

.hex-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.hex-count {
  font-size: var(--text-sm);
  color: var(--muted-2);
}

/* ---------- disclosure ---------- */

.disclosure {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.disclosure + .disclosure {
  margin-top: var(--space-3);
}

.disclosure-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  border-radius: inherit;
}

.disclosure-summary::-webkit-details-marker {
  display: none;
}

.disclosure-summary::before {
  content: "＋";
  color: var(--muted-2);
  font-size: var(--text-note);
  line-height: 1;
}

.disclosure[open] > .disclosure-summary::before {
  content: "−";
}

.disclosure-summary:hover {
  background: var(--surface-2);
}

.disclosure-summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.disclosure-body {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--text-body);
  color: var(--ink-soft);
}

/* ---------- address link ---------- */

.addr {
  font-family: var(--mono);
  font-size: 0.95em;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.addr:hover {
  color: var(--ink);
  border-bottom-color: var(--sage);
}

.addr:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.link {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--mist);
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--ink);
  text-decoration-color: var(--sage);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .site-header,
  .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: var(--space-3);
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 calc(var(--space-6) * -1);
    padding: 0 var(--space-6);
  }

  .netswitch {
    justify-self: end;
  }

  .netswitch-custom {
    justify-content: flex-start;
  }

  .netswitch-error {
    text-align: left;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 34px 0 30px;
  }

  .hero-art {
    order: -1;
    aspect-ratio: 920 / 480;
  }

  .fields[data-columns="3"],
  .fields[data-columns="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    padding: var(--space-5) 18px 44px;
  }

  .site-nav {
    margin: 0 -18px;
    padding: 0 18px;
  }

  .site-nav-list {
    gap: var(--space-4);
  }

  .card {
    padding: var(--space-5) 18px;
  }

  .card--flush .card-head {
    padding: var(--space-5) 18px 0;
  }

  .page-head {
    padding: var(--space-7) 0 var(--space-6);
  }

  .form {
    flex-wrap: wrap;
  }

  .form > .input,
  .form > .btn,
  .form-row--inline .form-control {
    flex: 1 1 100%;
  }

  .form-row--inline .form-control {
    flex-wrap: wrap;
  }

  .form-row--inline .form-control > .btn {
    flex: 1 1 100%;
  }

  .fields,
  .fields[data-columns="3"],
  .fields[data-columns="4"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail,
  .detail--wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .detail dd {
    margin-bottom: var(--space-2);
  }

  .card-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .status {
    text-align: left;
  }

  .seed-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .seed-row .select {
    grid-column: 2 / -1;
  }

  .seed-row .input {
    grid-column: 2 / 3;
  }

  .netswitch-host {
    max-width: 14ch;
  }

  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  /* A spinner that cannot spin must still read as "working", so it keeps a
     visible arc rather than becoming a plain circle. */
  .spinner,
  .btn[aria-busy="true"]::after {
    animation: none;
    border-top-color: var(--sage);
  }

  .skeleton {
    animation: none;
    background: var(--surface-3);
  }
}
