/* Waldheim 1.5.2 components. Plain CSS classes over tokens.css; no build step.
   Naming: block .wh-x, part .wh-x__part, variant .wh-x--variant. Type sizes are rem so text follows the reader's browser setting.
   Glyphs (check, minus, plus, chevron-down, circle-check, triangle-alert, circle-x, info, circle-minus; x in bundle.js) are from Lucide, ISC License, Copyright (c) Lucide Contributors 2022;
   portions Copyright (c) 2013-2022 Cole Bemis (Feather), MIT License. */

/* ---------- Base ---------- */
/* Follow the device with no script; data-theme on <html> pins a theme (a manual switch must be able to remove it again). */
:root { color-scheme: light dark; }
/* Motion and accent for native controls. Motion isn't a tokens.json family, so its values live here:
   fast for hover, press and open; panel for dialogs, panels and toasts. */
:root { --wh-duration-fast: 150ms; --wh-duration-panel: 200ms; --wh-ease: ease-out; accent-color: var(--accent); }
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* Metric-matched local fallbacks, named in --font-sans / --font-mono right after the Atkinson faces, so text keeps its
   size and line positions while the web fonts load (or if they never do). Measured against Arial / Liberation Sans and
   Courier New / Liberation Mono, which are metric-compatible; local() fetches nothing. */
@font-face { font-family: "Waldheim Sans Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans");
  size-adjust: 99.22%; ascent-override: 99.17%; descent-override: 31.85%; line-gap-override: 0%; }
@font-face { font-family: "Waldheim Mono Fallback"; src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("LiberationMono");
  size-adjust: 105.32%; ascent-override: 93.43%; descent-override: 30%; line-gap-override: 0%; }

[class^="wh-"], [class*=" wh-"], [class^="wh-"]::before, [class*=" wh-"]::before, [class^="wh-"]::after, [class*=" wh-"]::after { box-sizing: border-box; }

/* Opt-in page base: put class="wh-page" on <body>. */
.wh-page { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
/* Running-text links only: component links (link-buttons, menu items, nav, cards) keep their own colors. */
.wh-page a:not([class^="wh-"], [class*=" wh-"]) { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.wh-page a:not([class^="wh-"], [class*=" wh-"]):hover { color: var(--accent-hover); }

/* Visually hidden, still read by screen readers. --focusable comes back into view while it (or something inside it)
   has focus, for skip links. clip-path replaces the deprecated clip. */
.wh-sr-only, .wh-sr-only-focusable:where(:not(:focus-within, :active)), .wh-skip-link:where(:not(:focus-within, :active)) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.wh-skip-link:focus-within, .wh-skip-link:active {
  position: fixed; top: var(--space-2); left: var(--space-2); z-index: var(--layer-skip-link, 100);
  display: inline-flex; align-items: center; min-height: var(--target-min); padding: 0 var(--space-4);
  font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}

/* hidden must win over component display values. */
.wh-btn[hidden], .wh-badge[hidden], .wh-alert[hidden], .wh-card[hidden] { display: none; }

/* One focus style for everything interactive. */
.wh-btn:focus-visible, .wh-input:focus-visible, .wh-select > select:focus-visible, .wh-checkbox:focus-visible,
.wh-switch:focus-visible, .wh-card--interactive:focus-visible, .wh-table tr[tabindex]:focus-visible,
.wh-disclosure > summary:focus-visible, .wh-table-wrap:focus-visible, .wh-skip-link:focus-visible,
.wh-topbar__name:focus-visible, .wh-topbar__link:focus-visible, .wh-segment:has(:focus-visible) {
  outline: 2px solid var(--focus); outline-offset: 2px;
}

/* ---------- Utilities ---------- */
/* Digits line up and a value never breaks across lines. In tables, wh-num also right-aligns and sets mono (Table). */
.wh-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-nowrap { white-space: nowrap; }

/* ---------- Page shell ---------- */
/* Gutters: space-4 on phones, space-12 from 640px. The main column stops at page-width. */
:root { --wh-gutter: var(--space-4); }
@media (min-width: 40rem) { :root { --wh-gutter: var(--space-12); } }
.wh-page__main, .wh-page__footer { display: block; width: 100%; max-width: var(--page-width); margin-inline: auto; padding-inline: var(--wh-gutter); }
.wh-page__main { padding-block: var(--space-8) var(--space-12); }
.wh-page__main:focus { outline: none; } /* the skip-link target (tabindex="-1"); it isn't a control */
.wh-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-8); }
.wh-page-head > h1, .wh-page-head__title { margin: 0; margin-inline-end: auto; font-family: var(--font-sans); font-size: 1.75rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.wh-page-head__actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.wh-page__footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  padding-block: var(--space-6); border-top: 1px solid var(--border);
  font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted);
}
.wh-page__footer > * { margin: 0; }

/* ---------- Top bar ---------- */
/* Full width; its contents line up with the main column's gutters. */
.wh-topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-6); min-height: var(--target-min);
  padding-inline: max(var(--wh-gutter), calc((100% - var(--page-width)) / 2 + var(--wh-gutter)));
  font-family: var(--font-sans); background: var(--surface); border-bottom: 1px solid var(--border);
}
.wh-topbar__name { display: inline-flex; align-items: center; min-height: var(--target-min); font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); }
.wh-topbar__nav { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.wh-topbar__link {
  display: inline-flex; align-items: center; min-height: var(--target-min); padding: 0 var(--space-3);
  font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; color: var(--text-muted); text-decoration: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: color var(--wh-duration-fast) var(--wh-ease), background-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-topbar__link:hover { color: var(--text); background: var(--surface-muted); }
.wh-topbar__link[aria-current="page"] { color: var(--text); background: var(--accent-subtle); box-shadow: inset 0 -3px 0 var(--accent); }
.wh-topbar__actions { display: flex; align-items: center; gap: var(--space-2); margin-inline-start: auto; }
@media (max-width: 40rem) {
  .wh-topbar__nav { flex-basis: 100%; order: 3; margin-inline: calc(var(--space-3) * -1); }
}

/* ---------- Button ---------- */
.wh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-md); padding: 0 var(--space-4); margin: 0;
  font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none; white-space: nowrap; -webkit-user-select: none; user-select: none;
  transition: background-color var(--wh-duration-fast) var(--wh-ease), border-color var(--wh-duration-fast) var(--wh-ease), color var(--wh-duration-fast) var(--wh-ease);
}
.wh-btn:hover:not(:disabled, [aria-disabled="true"]) { background: var(--surface-muted); }
.wh-btn svg { width: 20px; height: 20px; flex: none; }

.wh-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wh-btn--primary:hover:not(:disabled, [aria-disabled="true"]) { background: var(--accent-hover); border-color: var(--accent-hover); }

.wh-btn--quiet { background: transparent; border-color: transparent; }

.wh-btn--danger { color: var(--danger); }
.wh-btn--danger:hover:not(:disabled, [aria-disabled="true"]) { background: var(--danger-subtle); }

.wh-btn--danger-solid { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.wh-btn--danger-solid:hover:not(:disabled, [aria-disabled="true"]) { background: var(--danger-hover); border-color: var(--danger-hover); }

.wh-btn--sm { min-height: var(--control-sm); padding: 0 var(--space-3); font-size: 0.875rem; gap: var(--space-1); }
.wh-btn--sm svg { width: 16px; height: 16px; }
.wh-btn--lg { min-height: var(--control-lg); padding: 0 var(--space-6); font-size: 1rem; line-height: 1.5rem; }
.wh-btn--icon { padding: 0; width: var(--control-md); }
.wh-btn--icon.wh-btn--sm { width: var(--control-sm); }
.wh-btn--icon.wh-btn--lg { width: var(--control-lg); }
.wh-btn--block { display: flex; width: 100%; }

.wh-btn:disabled, .wh-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.wh-btn[aria-busy="true"] { cursor: progress; }

.wh-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* The visible outcome of the row's last action ("Checked just now"). Plain text, no aria-live: announce with Waldheim.announce. */
.wh-btn-row__status { font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); }

/* ---------- Theme toggle (wh-theme.js) ---------- */
/* Both labels are in the markup; CSS shows the one for the theme you'd switch to, so it is right before and without script. */
.wh-theme-toggle__to-light { display: none; }
:root[data-theme="dark"] .wh-theme-toggle__to-dark { display: none; }
:root[data-theme="dark"] .wh-theme-toggle__to-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wh-theme-toggle__to-dark { display: none; }
  :root:not([data-theme="light"]) .wh-theme-toggle__to-light { display: inline; }
}

/* ---------- Text field ---------- */
.wh-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.wh-label { font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; color: var(--text); }
.wh-label__optional { font-weight: 400; color: var(--text-muted); }

.wh-input, .wh-select > select {
  display: block; width: 100%; min-height: var(--control-md); margin: 0;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; font-weight: 400;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-input::placeholder { color: var(--text-muted); opacity: 1; }
.wh-input:hover:not(:disabled, [readonly]), .wh-select > select:hover:not(:disabled) { border-color: var(--text-muted); }
.wh-input[readonly] { background: var(--surface-muted); }
.wh-input:disabled, .wh-select > select:disabled { opacity: 0.45; background: var(--surface-muted); cursor: not-allowed; }
.wh-input[aria-invalid="true"], .wh-select > select[aria-invalid="true"] { border-color: var(--danger); }
/* Browser-checked rules (required, type, pattern) show after interaction even without script. */
.wh-input:is(:user-invalid), .wh-select > select:is(:user-invalid), .wh-checkbox:is(:user-invalid) { border-color: var(--danger); }
textarea.wh-input { min-height: calc(var(--space-16) + var(--space-8)); resize: vertical; }
.wh-input--mono { font-family: var(--font-mono); font-size: 0.9375rem; }

.wh-help { margin: 0; font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); }
.wh-error { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--danger); }
.wh-error::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Select ---------- */
.wh-select { position: relative; display: block; }
.wh-select > select { -webkit-appearance: none; appearance: none; padding-right: calc(var(--space-8) + var(--space-2)); cursor: pointer; }
.wh-select::after {
  content: ""; position: absolute; right: var(--space-3); top: 50%; width: 20px; height: 20px; margin-top: -10px;
  background: var(--text-muted); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Choice row (shared by checkbox and switch) ---------- */
.wh-choice { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; color: var(--text); cursor: pointer; }
.wh-choice__text { display: flex; flex-direction: column; min-width: 0; }
.wh-choice__hint { font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); }
.wh-choice--end { flex-direction: row-reverse; justify-content: space-between; }
.wh-choice:has(:disabled) { cursor: not-allowed; }
.wh-choice:has(:disabled) .wh-choice__text { opacity: 0.45; }
/* A confirm-gate box for a consequential step ("I reviewed the exact commands"). */
.wh-choice--danger .wh-choice__text { color: var(--danger); font-weight: 600; }
.wh-choice--danger .wh-choice__hint { font-weight: 400; }
.wh-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.wh-fieldset > legend { padding: 0; margin-bottom: var(--space-1); font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; color: var(--text); }

/* ---------- Checkbox ---------- */
.wh-checkbox {
  -webkit-appearance: none; appearance: none; flex: none; display: grid; place-content: center;
  width: 20px; height: 20px; margin: 2px 0 0;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color var(--wh-duration-fast) var(--wh-ease), border-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-checkbox::before {
  content: ""; width: 14px; height: 14px; background: var(--on-accent); transform: scale(0); transition: transform var(--wh-duration-fast) var(--wh-ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wh-checkbox:hover:not(:disabled) { border-color: var(--text-muted); }
.wh-checkbox:checked, .wh-checkbox:indeterminate { background: var(--accent); border-color: var(--accent); }
.wh-checkbox:checked::before, .wh-checkbox:indeterminate::before { transform: scale(1); }
.wh-checkbox:indeterminate::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}
.wh-checkbox[aria-invalid="true"] { border-color: var(--danger); }
.wh-checkbox:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Switch ---------- */
.wh-switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 40px; height: 24px; margin: 0;
  background: var(--surface-muted); border: 1.5px solid var(--border-strong); border-radius: var(--radius-full);
  cursor: pointer; transition: background-color var(--wh-duration-fast) var(--wh-ease), border-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-switch::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: var(--radius-full);
  background: var(--text-muted); transition: transform var(--wh-duration-fast) var(--wh-ease), background-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-switch:checked { background: var(--accent); border-color: var(--accent); }
.wh-switch:checked::before { transform: translateX(16px); background: var(--on-accent); }
.wh-switch:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Stepper (number input between − and + buttons; bundle.js wires [data-step]) ---------- */
.wh-stepper { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-2); max-width: 12rem; }
.wh-stepper .wh-input { text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.wh-stepper .wh-input::-webkit-inner-spin-button, .wh-stepper .wh-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.wh-stepper [data-step]::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wh-stepper [data-step="up"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
}

/* ---------- Segments (one choice from a few, as radios inside labels) ---------- */
.wh-segments { margin: 0; padding: 0; border: 0; min-width: 0; }
.wh-segments > legend { padding: 0; margin-bottom: var(--space-2); font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; color: var(--text); }
.wh-segments__list { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-1); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.wh-segment {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-sm); padding: 0 var(--space-3);
  font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; color: var(--text-muted);
  border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer; transition: color var(--wh-duration-fast) var(--wh-ease), background-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-segment:hover { color: var(--text); background: var(--surface-muted); }
.wh-segment:has(:checked) { color: var(--text); background: var(--accent-subtle); border-color: var(--accent); }
.wh-segment:has(:disabled) { opacity: 0.45; cursor: not-allowed; }
/* The sr-only recipe: the radio stays in the page for keyboard and screen readers. */
.wh-segment > input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; }

/* ---------- Card ---------- */
.wh-card { display: block; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-6); font-family: var(--font-sans); }
.wh-card--compact { padding: var(--space-4); }
.wh-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.wh-card__title { margin: 0; font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--text); }
.wh-card__subtitle { margin: var(--space-1) 0 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); }
.wh-card__body { font-size: 1rem; line-height: 1.5rem; }
.wh-card__body > :first-child { margin-top: 0; }
.wh-card__body > :last-child { margin-bottom: 0; }
.wh-card__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); }
/* Clickable, so its outline is border-strong (3:1+), never the decorative border. */
.wh-card--interactive { border-color: var(--border-strong); text-decoration: none; cursor: pointer; transition: border-color var(--wh-duration-fast) var(--wh-ease); }
.wh-card--interactive:hover { border-color: var(--text-muted); }
.wh-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-6); }

/* ---------- Disclosure (native details/summary) ---------- */
.wh-disclosure { font-family: var(--font-sans); color: var(--text); }
.wh-disclosure > summary {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-1);
  font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; list-style: none; cursor: pointer; border-radius: var(--radius-sm);
}
.wh-disclosure > summary::-webkit-details-marker { display: none; }
.wh-disclosure > summary:hover { background: var(--surface-muted); }
/* The chevron comes before the label and points at the label (right; left in RTL) while closed, down while open. */
.wh-disclosure > summary::before {
  content: ""; flex: none; width: 16px; height: 16px; background: var(--text-muted); transform: rotate(-90deg); transition: transform var(--wh-duration-fast) var(--wh-ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wh-disclosure > summary:dir(rtl)::before { transform: rotate(90deg); }
.wh-disclosure[open] > summary::before { transform: none; }
.wh-disclosure__hint { margin-inline-start: auto; padding-inline-start: var(--space-4); font-size: 0.875rem; line-height: 1.25rem; font-weight: 400; color: var(--text-muted); }
.wh-disclosure__body { padding: var(--space-2) 0 var(--space-2) calc(var(--space-1) + 16px + var(--space-2)); }
.wh-disclosure__body > :first-child { margin-top: 0; }
.wh-disclosure__body > :last-child { margin-bottom: 0; }
/* Progressive enhancement: the content opens and closes smoothly where ::details-content and interpolate-size exist. */
@supports selector(::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    .wh-disclosure { interpolate-size: allow-keywords; }
    .wh-disclosure::details-content {
      block-size: 0; overflow-y: clip;
      transition: block-size var(--wh-duration-panel) var(--wh-ease), content-visibility var(--wh-duration-panel) var(--wh-ease) allow-discrete;
      transition-behavior: allow-discrete;
    }
    .wh-disclosure[open]::details-content { block-size: auto; }
  }
}

/* ---------- Tabs ---------- */
.wh-tabs__list { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-color: var(--border-strong) transparent; }
.wh-tab {
  position: relative; flex: none; min-height: var(--control-md); margin: 0; padding: 0 var(--space-3);
  font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500;
  color: var(--text-muted); background: transparent; border: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer; transition: color var(--wh-duration-fast) var(--wh-ease), background-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-tab:hover { color: var(--text); background: var(--surface-muted); }
.wh-tab[aria-selected="true"] { color: var(--text); }
/* A border, not a background: forced-colors mode keeps borders, so the selected tab never loses its bar. */
.wh-tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0; height: 0; border-bottom: 3px solid var(--accent); border-radius: 3px 3px 0 0; }
.wh-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.wh-tabs__panel { padding-top: var(--space-6); }
.wh-tabs__panel[hidden] { display: none; }
.wh-tabs__panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- Table ---------- */
.wh-table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); scrollbar-color: var(--border-strong) var(--surface); }
/* Opt-in vertical scrolling for long tables, so the sticky header row has something to stick within. */
.wh-table-wrap--scroll { max-block-size: var(--wh-table-max, 32rem); }
.wh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; color: var(--text); }
.wh-table caption { caption-side: top; padding: var(--space-4) var(--space-4) var(--space-2); text-align: left; font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; }
.wh-table th {
  padding: var(--space-2) var(--space-4);
  background: var(--surface-muted); border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--text-muted);
}
/* Only the column-header row sticks; row headers and group rows scroll with their rows. */
.wh-table thead th { position: sticky; top: 0; z-index: var(--layer-sticky, 1); }
.wh-table th.wh-table__group { padding-top: var(--space-3); color: var(--text); font-weight: 600; }
.wh-table__actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); white-space: nowrap; }
.wh-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
/* A row header (<th scope="row">) reads as part of its row: body text on the row's ground, weight 500. */
.wh-table tbody th[scope="row"] {
  padding: var(--space-3) var(--space-4); background: transparent; vertical-align: middle; white-space: normal;
  font-size: 1rem; line-height: 1.5rem; font-weight: 500; color: var(--text);
}
.wh-table--compact tbody th[scope="row"] { padding: var(--space-2) var(--space-3); font-size: 0.9375rem; }
.wh-table tbody tr:last-child > :is(td, th[scope="row"]) { border-bottom: 0; }
.wh-table tbody tr:hover > :is(td, th[scope="row"]) { background: var(--surface-muted); }
.wh-table tbody tr[aria-selected="true"] > :is(td, th[scope="row"]) { background: var(--accent-subtle); }
.wh-table tbody tr[aria-selected="true"] > :first-child { box-shadow: inset 3px 0 0 var(--accent); }
.wh-table .wh-num { text-align: right; }
.wh-table td.wh-num { font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.25rem; }
.wh-table .wh-muted { color: var(--text-muted); }
.wh-table--compact caption { padding: var(--space-3) var(--space-3) var(--space-2); font-size: 1rem; line-height: 1.5rem; }
.wh-table--compact th { padding: var(--space-1) var(--space-3); }
.wh-table--compact td { padding: var(--space-2) var(--space-3); font-size: 0.9375rem; }

/* ---------- Stat tile ---------- */
.wh-stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-6) var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-sans); color: var(--text); min-width: 0; }
.wh-stat__label { margin: 0; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--text-muted); }
.wh-stat__value { margin: 0; font-family: var(--font-sans); font-size: 1.75rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.wh-stat__unit { margin-left: var(--space-1); font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; font-weight: 400; letter-spacing: 0; color: var(--text-muted); }
.wh-stat__meta { margin: 0; font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); }
/* Meter: a native <meter class="wh-meter" min max value>, so it needs no inline style (strict CSP) and no ARIA.
   The fill is text-muted unless a --success/--warning/--danger class says otherwise; the browser's own
   low/high/optimum colors are never used. The older span markup (.wh-meter__fill) still renders. */
.wh-meter { --wh-meter-fill: var(--text-muted); display: block; width: 100%; height: 8px; margin: var(--space-2) 0 var(--space-1); background: var(--surface-muted); border: 0; border-radius: var(--radius-full); overflow: hidden; }
meter.wh-meter { -webkit-appearance: none; -moz-appearance: none; appearance: none; }
meter.wh-meter::-webkit-meter-bar { height: 8px; background: var(--surface-muted); border: 0; border-radius: var(--radius-full); }
meter.wh-meter::-webkit-meter-optimum-value { background: var(--wh-meter-fill); border-radius: var(--radius-full); }
meter.wh-meter::-webkit-meter-suboptimum-value { background: var(--wh-meter-fill); border-radius: var(--radius-full); }
meter.wh-meter::-webkit-meter-even-less-good-value { background: var(--wh-meter-fill); border-radius: var(--radius-full); }
meter.wh-meter::-moz-meter-bar { background: var(--wh-meter-fill); border-radius: var(--radius-full); }
.wh-meter__fill { display: block; height: 100%; background: var(--wh-meter-fill); border-radius: inherit; }
.wh-meter--success { --wh-meter-fill: var(--success); }
.wh-meter--warning { --wh-meter-fill: var(--warning); }
.wh-meter--danger { --wh-meter-fill: var(--danger); }
.wh-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }

/* ---------- Badge ---------- */
.wh-badge {
  display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; padding: 2px var(--space-2);
  font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; white-space: nowrap; vertical-align: middle;
  --wh-tone: var(--text); --wh-tone-bg: var(--surface-muted);
  color: var(--wh-tone); background: var(--wh-tone-bg); border-radius: var(--radius-sm);
}
.wh-badge--success::before, .wh-badge--warning::before, .wh-badge--danger::before, .wh-badge--info::before, .wh-badge--inactive::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--wh-icon) center / contain no-repeat; mask: var(--wh-icon) center / contain no-repeat;
}

/* Several badges side by side; the row wraps instead of overflowing. */
.wh-badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* ---------- Code ---------- */
/* Inline value chip (hostnames, paths, commands) and a block for logs and output. The transparent border shows up in
   forced-colors mode, where the background is repainted. */
.wh-code {
  padding: 0.0625rem var(--space-1); font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.25rem;
  color: var(--text); background: var(--surface-muted); border: 1px solid transparent; border-radius: var(--radius-sm); overflow-wrap: anywhere;
}
.wh-pre {
  display: block; margin: 0; padding: var(--space-3); max-width: 100%; overflow: auto;
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.25rem; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
  color: var(--text); background: var(--surface-muted); border: 1px solid transparent; border-radius: var(--radius-sm);
}
.wh-pre .wh-code { padding: 0; background: none; border: 0; }

/* ---------- History (run-length status strip, SVG) ---------- */
.wh-history { margin: 0; font-family: var(--font-sans); color: var(--text); min-width: 0; }
.wh-history__strip { display: block; width: 100%; height: 28px; border-radius: var(--radius-sm); overflow: hidden; }
/* Severity is also bar height, bottom-aligned, so states differ by shape and not only hue:
   healthy and no data 30%, info 50%, warning 75%, danger full. */
.wh-history__run { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0.3); }
.wh-history__run--info { transform: scaleY(0.5); }
.wh-history__run--warning { transform: scaleY(0.75); }
.wh-history__run--danger { transform: none; }
.wh-history__run { fill: var(--border); }
.wh-history__run--success { fill: var(--success); }
.wh-history__run--warning { fill: var(--warning); }
.wh-history__run--danger { fill: var(--danger); }
.wh-history__run--info { fill: var(--info); }
.wh-history__caption {
  display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-1);
  font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.wh-history__caption > :nth-child(2) { color: var(--text); font-weight: 500; text-align: center; }

/* ---------- Alert ---------- */
.wh-alert {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; color: var(--text);
  background: var(--wh-tone-bg); border-radius: var(--radius-md);
  --wh-tone: var(--info); --wh-tone-bg: var(--info-subtle); --wh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}
.wh-alert::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; background: var(--wh-tone);
  -webkit-mask: var(--wh-icon) center / contain no-repeat; mask: var(--wh-icon) center / contain no-repeat;
}
.wh-alert__body { flex: 1; min-width: 0; }
.wh-alert__title { margin: 0; font-weight: 600; }
.wh-alert__text { margin: 0; }
.wh-alert__title + .wh-alert__text { margin-top: var(--space-1); }
.wh-alert__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.wh-alert__close { flex: none; margin: calc(var(--space-1) * -1) calc(var(--space-2) * -1) calc(var(--space-1) * -1) 0; }

/* ---------- Tones (badge and alert) ---------- */
.wh-badge--success, .wh-alert--success, .wh-toast--success, .wh-tile--success { --wh-tone: var(--success); --wh-tone-bg: var(--success-subtle); --wh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.wh-badge--warning, .wh-alert--warning, .wh-toast--warning, .wh-tile--warning { --wh-tone: var(--warning); --wh-tone-bg: var(--warning-subtle); --wh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.wh-badge--danger, .wh-alert--danger, .wh-toast--danger, .wh-tile--danger { --wh-tone: var(--danger); --wh-tone-bg: var(--danger-subtle); --wh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E"); }
.wh-badge--info, .wh-alert--info, .wh-toast--info, .wh-tile--info { --wh-tone: var(--info); --wh-tone-bg: var(--info-subtle); --wh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E"); }
.wh-badge--inactive, .wh-tile--inactive { --wh-tone: var(--text-muted); --wh-tone-bg: var(--surface-muted); --wh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E"); }

/* ---------- Empty state ---------- */
.wh-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center;
  padding: var(--space-12) var(--space-6); border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  font-family: var(--font-sans); color: var(--text);
}
.wh-empty--plain { border: 0; padding: var(--space-8) var(--space-4); }
.wh-empty__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--space-2); border-radius: var(--radius-full); background: var(--surface-muted); color: var(--text-muted); }
.wh-empty__icon svg { width: 24px; height: 24px; }
.wh-empty__title { margin: 0; font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--text); }
.wh-empty__text { margin: 0; max-width: 44ch; font-size: 1rem; line-height: 1.5rem; color: var(--text-muted); }
.wh-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-4); }

/* ---------- Overlays: shared ---------- */
@keyframes wh-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wh-rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wh-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Dialog (native <dialog>, opened with showModal) ---------- */
.wh-dialog {
  width: min(calc(100vw - 2 * var(--space-4)), 480px);
  max-height: calc(100vh - 2 * var(--space-8)); max-height: calc(100dvh - 2 * var(--space-8));
  padding: 0; overflow: auto;
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.wh-dialog--wide { width: min(calc(100vw - 2 * var(--space-4)), 640px); }
.wh-dialog[open] { animation: wh-fade-in var(--wh-duration-panel) var(--wh-ease); }
@media (prefers-reduced-motion: no-preference) { .wh-dialog[open] { animation-name: wh-dialog-in; } }
/* Keep scroll gestures over the dialog and its backdrop from scrolling the page behind. */
.wh-dialog:modal { overscroll-behavior: contain; }
.wh-dialog::backdrop { background: var(--overlay, rgba(26, 24, 22, 0.5)); overflow: hidden; overscroll-behavior: contain; }
.wh-dialog[open]::backdrop { animation: wh-fade-in var(--wh-duration-panel) var(--wh-ease); }
.wh-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) var(--space-6) 0; }
.wh-dialog__title { margin: 0; font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; color: var(--text); }
.wh-dialog__header .wh-btn--icon { margin: calc(var(--space-1) * -1) calc(var(--space-2) * -1) 0 0; }
.wh-dialog__body { padding: var(--space-2) var(--space-6) 0; }
.wh-dialog__body > :first-child { margin-top: 0; }
.wh-dialog__body > :last-child { margin-bottom: 0; }
.wh-dialog__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-6); }
@media (max-width: 30rem) {
  .wh-dialog__footer { flex-direction: column-reverse; }
  .wh-dialog__footer .wh-btn { width: 100%; }
}

/* ---------- Menu (popover="auto", opened by a button with popovertarget) ---------- */
.wh-menu {
  display: flex; flex-direction: column; min-width: 200px; max-width: 320px; padding: var(--space-1);
  font-family: var(--font-sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
.wh-menu[popover] { position: fixed; inset: auto; margin: 0; max-height: calc(100vh - 2 * var(--space-4)); overflow: auto; }
.wh-menu[popover]:not(:popover-open) { display: none; }
.wh-menu[popover]:popover-open { animation: wh-fade-in var(--wh-duration-fast) var(--wh-ease); }
html[data-wh-js] .wh-menu[popover]:popover-open:not([data-wh-placed]) { visibility: hidden; }
.wh-menu__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--control-md); margin: 0; padding: 0 var(--space-3);
  font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 400; text-align: left; text-decoration: none;
  color: var(--text); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.wh-menu__item:hover, .wh-menu__item:focus-visible { background: var(--surface-muted); }
.wh-menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.wh-menu__item svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.wh-menu__item--danger, .wh-menu__item--danger svg { color: var(--danger); }
.wh-menu__item[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.wh-menu__hint { margin-left: auto; padding-left: var(--space-4); font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.25rem; color: var(--text-muted); }
.wh-menu__item[aria-checked]::after { content: ""; flex: none; width: 16px; height: 16px; margin-left: auto; }
.wh-menu__item[aria-checked="true"]::after {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wh-menu__item[aria-checked="true"] { font-weight: 500; }
.wh-menu__label { margin: 0; padding: var(--space-2) var(--space-3) var(--space-1); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; color: var(--text-muted); }
.wh-menu__separator { height: 1px; margin: var(--space-1) calc(var(--space-1) * -1); border: 0; background: var(--border); }

/* ---------- Tooltip (popover="manual", shown by bundle.js) ---------- */
.wh-tooltip {
  width: max-content; max-width: 240px; padding: var(--space-1) var(--space-2);
  font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500;
  color: var(--bg); background: var(--text); border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.wh-tooltip[popover] { position: fixed; inset: auto; margin: 0; overflow: visible; }
.wh-tooltip[popover]:not(:popover-open) { display: none; }
.wh-tooltip[popover]:popover-open { animation: wh-fade-in var(--wh-duration-fast) var(--wh-ease); }

/* ---------- Toast (created by Waldheim.toast) ---------- */
.wh-toaster {
  position: fixed; inset: auto var(--space-6) var(--space-6) auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible;
  display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2);
  width: min(400px, calc(100vw - 2 * var(--space-4))); pointer-events: none;
}
.wh-toaster[popover]:not(:popover-open) { display: none; }
.wh-toast {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  pointer-events: auto; animation: wh-fade-in var(--wh-duration-panel) var(--wh-ease);
}
@media (prefers-reduced-motion: no-preference) { .wh-toast { animation-name: wh-rise-in; } }
.wh-toast--success::before, .wh-toast--warning::before, .wh-toast--danger::before, .wh-toast--info::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 6px; background: var(--wh-tone);
  -webkit-mask: var(--wh-icon) center / contain no-repeat; mask: var(--wh-icon) center / contain no-repeat;
}
.wh-toast__text { flex: 1; min-width: 0; margin: 0; padding: var(--space-1) 0; }
.wh-toast .wh-btn { flex: none; }
.wh-toast__action { color: var(--accent); }
@media (max-width: 40rem) {
  .wh-toaster { inset: auto var(--space-4) var(--space-4) var(--space-4); width: auto; }
}

/* ---------- Split (main area + docked inspector) ---------- */
/* One breakpoint, 68.75rem (1100px at a 16px root): below it the aside stacks under the main column. */
.wh-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.wh-split__main, .wh-split__aside { min-width: 0; }
.wh-split__aside { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); font-family: var(--font-sans); color: var(--text); }
.wh-split__aside:focus, .wh-split__aside [data-wh-focus]:focus { outline: none; } /* focus targets (tabindex="-1"), not controls */
.wh-split__back { display: none; }
@media (max-width: 68.74rem) {
  /* Master-detail on narrow screens: once something is selected the aside comes first, with a way back. */
  .wh-split--master-detail[data-wh-selected] > .wh-split__aside { order: -1; }
  .wh-split--master-detail[data-wh-selected] .wh-split__back { display: inline-flex; margin-bottom: var(--space-4); }
  .wh-split--master-detail:not([data-wh-selected]) > .wh-split__aside { display: none; }
  .wh-split .wh-schematic-frame { display: none; } /* the zone map stands in for the diagram */
}
@media (min-width: 68.75rem) {
  .wh-split { grid-template-columns: minmax(0, 1fr) 22rem; }
  .wh-split__aside { position: sticky; top: var(--space-4); max-block-size: calc(100dvh - var(--space-8)); overflow: auto; }
}

/* ---------- Schematic (hand-placed SVG diagram with live status) ---------- */
.wh-schematic-frame { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-6); }
.wh-schematic { display: block; width: 100%; height: auto; font-family: var(--font-sans); --wh-halo: var(--surface-muted); }
.wh-schematic__zone { fill: var(--surface-muted); stroke: var(--border); }
.wh-schematic__zone-label { font-size: 14px; font-weight: 600; fill: var(--text-muted); }
.wh-schematic__wire { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-linejoin: round; }
.wh-schematic__wire-label { font-size: 12px; fill: var(--text-muted); paint-order: stroke; stroke: var(--wh-halo); stroke-width: 4px; stroke-linejoin: round; }
.wh-schematic__wire-label--on-surface { stroke: var(--surface); }
/* Only a link is a control: a context part drawn as <g class="wh-schematic__node"> gets no pointer and no hover. */
a.wh-schematic__node { cursor: pointer; }
.wh-schematic__node:focus { outline: none; }
.wh-schematic__node:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wh-schematic__box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.25; transition: fill var(--wh-duration-fast) var(--wh-ease); }
a.wh-schematic__node:hover .wh-schematic__box { fill: var(--surface-muted); }
.wh-schematic__title { font-size: 14px; font-weight: 600; fill: var(--text); }
.wh-schematic__subtitle { font-family: var(--font-mono); font-size: 12px; fill: var(--text-muted); }
.wh-schematic__node--host .wh-schematic__box { fill: var(--text); stroke: none; }
.wh-schematic__node--host .wh-schematic__title { font-size: 13px; fill: var(--bg); }
/* Status: healthy is the plain default. Each problem state has a cue besides color: stroke weight or pattern, plus a glyph. */
.wh-schematic__node--danger { --wh-tone: var(--danger); }
.wh-schematic__node--warning { --wh-tone: var(--warning); }
.wh-schematic__node--info { --wh-tone: var(--info); }
.wh-schematic__node--inactive { --wh-tone: var(--text-muted); }
.wh-schematic__node--danger .wh-schematic__box { fill: var(--danger-subtle); stroke: var(--danger); stroke-width: 2.5; }
.wh-schematic__node--warning .wh-schematic__box { fill: var(--warning-subtle); stroke: var(--warning); stroke-width: 2; stroke-dasharray: 5 3; }
.wh-schematic__node--info .wh-schematic__box { stroke: var(--info); stroke-width: 2; stroke-dasharray: 1 3; stroke-linecap: round; }
.wh-schematic__node--inactive .wh-schematic__box { fill: var(--surface-muted); }
.wh-schematic__node--inactive .wh-schematic__title { fill: var(--text-muted); }
.wh-schematic__node--host.wh-schematic__node--danger .wh-schematic__box { fill: var(--danger); stroke: none; }
.wh-schematic__node--host.wh-schematic__node--warning .wh-schematic__box { fill: var(--warning); stroke: none; }
.wh-schematic__node--host.wh-schematic__node--info .wh-schematic__box { fill: var(--info); stroke: none; }
.wh-schematic__node--host.wh-schematic__node--inactive .wh-schematic__box { fill: var(--text-muted); stroke: none; }
.wh-schematic__node--host:is(.wh-schematic__node--danger, .wh-schematic__node--warning, .wh-schematic__node--info, .wh-schematic__node--inactive) .wh-schematic__title { fill: var(--on-accent); }
/* Glyph: <use class="wh-schematic__glyph" href="#wh-sym-…">. Its ring fills with surface, its strokes take the tone. */
.wh-schematic__glyph { display: none; color: var(--wh-tone, var(--text-muted)); fill: var(--surface); }
:is(.wh-schematic__node--danger, .wh-schematic__node--warning, .wh-schematic__node--info, .wh-schematic__node--inactive) .wh-schematic__glyph { display: inline; }
/* Selected: an accent outline over the box; a status fill stays, so the state is still readable. */
/* Selected is a shape, not a color swap: a ring around the box. The box keeps its status stroke, so a selected
   failing part still shows its failing border (accent and danger/warning are hard to tell apart for many people). */
.wh-schematic__ring { display: none; fill: none; stroke: var(--accent); stroke-width: 2.5; }
.wh-schematic__node[aria-current="true"] .wh-schematic__ring { display: inline; }
.wh-schematic__node[aria-current="true"]:not(.wh-schematic__node--danger, .wh-schematic__node--warning, .wh-schematic__node--info, .wh-schematic__node--inactive, .wh-schematic__node--host) .wh-schematic__box { fill: var(--accent-subtle); }
/* Tracing a path: the trace in accent, everything unrelated steps back. */
.wh-schematic__trace { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.wh-schematic__trace--past { opacity: 0.3; }
.wh-schematic--tracing .wh-schematic__wire, .wh-schematic--tracing .wh-schematic__wire-label { opacity: 0.35; }
.wh-schematic--tracing .wh-schematic__node:not(.wh-schematic__node--related, [aria-current="true"]) { opacity: 0.3; }
@keyframes wh-march { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: no-preference) {
  .wh-schematic__trace--current { stroke-dasharray: 12 6; animation: wh-march calc(var(--wh-duration-fast) * 6) linear infinite; }
}

/* ---------- Zone map (the same parts as status tiles: the phone view and the diagram's text alternative) ---------- */
.wh-zonemap { display: grid; gap: var(--space-6); font-family: var(--font-sans); color: var(--text); }
.wh-zonemap__zone { min-width: 0; }
.wh-zonemap__heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.wh-zonemap__count { font-size: 0.875rem; line-height: 1.25rem; font-weight: 400; color: var(--text-muted); }
.wh-zonemap__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.wh-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 0.125rem; min-height: var(--target-min); height: 100%;
  padding: var(--space-2) var(--space-3); font-family: var(--font-sans); color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  transition: background-color var(--wh-duration-fast) var(--wh-ease);
}
.wh-tile:hover { background: var(--surface-muted); }
.wh-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wh-tile__title { font-size: 0.9375rem; line-height: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.wh-tile__state { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 0.875rem; line-height: 1.25rem; color: var(--wh-tone, var(--text-muted)); }
:is(.wh-tile--success, .wh-tile--warning, .wh-tile--danger, .wh-tile--info, .wh-tile--inactive) .wh-tile__state::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--wh-icon) center / contain no-repeat; mask: var(--wh-icon) center / contain no-repeat;
}
/* Same cues as the schematic: danger a heavier solid border, warning dashed, info dotted. */
.wh-tile--danger { background: var(--wh-tone-bg); border: 2px solid var(--danger); }
.wh-tile--warning { background: var(--wh-tone-bg); border: 2px dashed var(--warning); }
.wh-tile--info { border: 2px dotted var(--info); }
.wh-tile--inactive { background: var(--surface-muted); }
.wh-tile--inactive .wh-tile__title { color: var(--text-muted); }
.wh-tile[aria-current="true"] { box-shadow: inset 4px 0 0 var(--accent); }
.wh-tile[aria-current="true"]:not(.wh-tile--danger, .wh-tile--warning, .wh-tile--inactive) { background: var(--accent-subtle); }

/* ---------- Touch and motion ---------- */
@media (pointer: coarse) {
  .wh-btn, .wh-btn--sm, .wh-input, .wh-select > select, .wh-tab { min-height: var(--target-min); }
  .wh-btn--icon, .wh-btn--icon.wh-btn--sm { width: var(--target-min); }
  .wh-choice, .wh-menu__item, .wh-segment, .wh-disclosure > summary { min-height: var(--target-min); }
}
/* Reduced motion: nothing slides, scales, rotates or travels. Fades and colour changes stay (dialogs and toasts fade in
   by default; their rise/scale is opted into above under no-preference, as is the disclosure's open/close). Here every
   remaining spatial transition goes, and the disclosure animation is cancelled again in case a page opts into it. */
@media (prefers-reduced-motion: reduce) {
  .wh-checkbox::before { transition: none; }
  .wh-switch::before { transition-property: background-color; }
  .wh-disclosure > summary::before { transition: none; }
  .wh-disclosure::details-content { transition: none; }
  .wh-schematic__trace--current { animation: none; stroke-dasharray: none; }
}

/* ---------- Forced colors (Windows high contrast) ----------
   The browser repaints backgrounds with system colors and drops box-shadows, so every indicator drawn with a background
   (masked icons, checked fills, the switch thumb, meter fills) or a shadow (the selected-row bar) is redrawn here in
   system colors. Borders and outlines (focus, the selected-tab bar) survive on their own. */
@media (forced-colors: active) {
  .wh-error::before, .wh-select::after, .wh-alert::before, .wh-menu__item[aria-checked="true"]::after,
  .wh-badge--success::before, .wh-badge--warning::before, .wh-badge--danger::before, .wh-badge--info::before, .wh-badge--inactive::before,
  .wh-toast--success::before, .wh-toast--warning::before, .wh-toast--danger::before, .wh-toast--info::before,
  .wh-disclosure > summary::before { background: CanvasText; }
  .wh-stepper [data-step]::before { background: ButtonText; }
  .wh-stepper [data-step][aria-disabled="true"]::before { background: GrayText; }
  .wh-topbar__link[aria-current="page"] { box-shadow: none; border-bottom: 3px solid Highlight; }
  .wh-segment:has(:checked) { border-color: Highlight; }
  /* History: SVG fills aren't repainted, so map runs to system colors; problems stand out from healthy time. */
  .wh-history__strip { border: 1px solid CanvasText; }
  .wh-history__run { fill: Canvas; }
  .wh-history__run--success, .wh-history__run--info { fill: GrayText; }
  .wh-history__run--warning, .wh-history__run--danger { fill: Highlight; }
  /* Schematic: SVG paint isn't repainted, so redraw it in system colors; problems and the selection in Highlight. */
  .wh-schematic__zone { fill: Canvas; stroke: GrayText; }
  .wh-schematic__zone-label, .wh-schematic__title, .wh-schematic__subtitle, .wh-schematic__wire-label { fill: CanvasText; }
  .wh-schematic__wire-label { stroke: Canvas; }
  .wh-schematic__wire { stroke: CanvasText; }
  .wh-schematic__box, a.wh-schematic__node:hover .wh-schematic__box { fill: Canvas; stroke: CanvasText; }
  /* Fills set by state rules outrank the line above; restate them so no token tint survives (SVG paint isn't forced). */
  .wh-schematic__node--inactive .wh-schematic__box,
  .wh-schematic__node[aria-current="true"]:not(.wh-schematic__node--danger, .wh-schematic__node--warning, .wh-schematic__node--info, .wh-schematic__node--inactive, .wh-schematic__node--host) .wh-schematic__box { fill: Canvas; }
  .wh-schematic__node--inactive .wh-schematic__title { fill: GrayText; }
  .wh-schematic__node--host .wh-schematic__box { fill: CanvasText; }
  .wh-schematic__node--host .wh-schematic__title { fill: Canvas; }
  .wh-schematic__node--danger .wh-schematic__box, .wh-schematic__node--warning .wh-schematic__box, .wh-schematic__node--info .wh-schematic__box { fill: Canvas; stroke: Highlight; }
  .wh-schematic__node--host:is(.wh-schematic__node--danger, .wh-schematic__node--warning, .wh-schematic__node--info) .wh-schematic__box { fill: Highlight; }
  .wh-schematic__node--host:is(.wh-schematic__node--danger, .wh-schematic__node--warning, .wh-schematic__node--info) .wh-schematic__title { fill: HighlightText; }
  .wh-schematic__glyph { color: Highlight; fill: Canvas; }
  .wh-schematic__ring { stroke: Highlight; stroke-width: 3; }
  .wh-schematic__trace { stroke: Highlight; }
  .wh-tile--success .wh-tile__state::before, .wh-tile--warning .wh-tile__state::before, .wh-tile--danger .wh-tile__state::before,
  .wh-tile--info .wh-tile__state::before, .wh-tile--inactive .wh-tile__state::before { background: CanvasText; }
  .wh-tile--danger, .wh-tile--warning, .wh-tile--info { border-color: Highlight; }
  .wh-tile[aria-current="true"] { box-shadow: none; outline: 3px solid Highlight; outline-offset: 1px; }
  .wh-checkbox:checked, .wh-checkbox:indeterminate { background: Highlight; border-color: Highlight; }
  .wh-checkbox::before { background: HighlightText; }
  .wh-switch { border-color: ButtonText; }
  .wh-switch::before { background: ButtonText; }
  .wh-switch:checked { background: Highlight; border-color: Highlight; }
  .wh-switch:checked::before { background: HighlightText; }
  .wh-checkbox:disabled, .wh-switch:disabled, .wh-input:disabled, .wh-select > select:disabled { border-color: GrayText; }
  .wh-switch:disabled::before { background: GrayText; }
  .wh-btn:disabled, .wh-btn[aria-disabled="true"], .wh-menu__item[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
  .wh-tab[aria-selected="true"]::after { border-bottom-color: Highlight; }
  .wh-table tbody tr[aria-selected="true"] > :first-child { box-shadow: none; border-left: 3px solid Highlight; }
  .wh-meter { border: 1px solid CanvasText; }
  .wh-meter__fill { background: CanvasText; }
  meter.wh-meter::-webkit-meter-optimum-value { background: CanvasText; }
  meter.wh-meter::-webkit-meter-suboptimum-value { background: CanvasText; }
  meter.wh-meter::-webkit-meter-even-less-good-value { background: CanvasText; }
  meter.wh-meter::-moz-meter-bar { background: CanvasText; }
  .wh-alert, .wh-badge, .wh-tooltip { border: 1px solid CanvasText; }
}
