/* ==========================================================================
   HiLab — a classless semantic CSS framework
   Aesthetic: "A — Hybrid" — flat corporate base + instrument cues.
   Style raw semantic HTML directly. The only classes are the frozen
   escape hatches: .notice .button .pass .fail .warn .led .primary .danger
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Fonts: system stacks only */
  --sans-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, "Helvetica Neue", sans-serif;
  --mono-font: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo,
    Consolas, "Ubuntu Mono", monospace;

  --radius: 3px;
  --radius-lg: 4px;
  --border-width: 1px;

  /* Light theme — cool-biased neutral grays */
  --bg: #eef1f4;          /* page ground */
  --panel: #ffffff;       /* raised surfaces: article, fieldset, dialog */
  --accent-bg: #e4e9ee;   /* header strips, table headers, neutral buttons */
  --field-bg: #ffffff;    /* recessed inputs / meters */
  --text: #1c2530;
  --text-light: #54606d;  /* labels, captions, secondary */
  --border: #a9b4bf;      /* defined field borders */
  --border-soft: #c9d0d8; /* hairlines between rows */
  --disabled: #e6eaee;

  /* Accent = instrument blue = "safe to click" */
  --accent: #1f6feb;
  --accent-hover: #175bc7;
  --accent-text: #ffffff;

  /* Reserved status colors — never used for generic controls */
  --pass: #2b8a3e;
  --warn: #b5820a;
  --fail: #d92c2c;
  --pass-bg: #dff3e3;
  --warn-bg: #fbeecd;
  --fail-bg: #fadddd;

  --code: #1f6feb;
  --mark-bg: #ffe08a;
  --inset-shadow: inset 0 1px 2px rgba(20, 30, 45, 0.10);
  --focus-ring: 0 0 0 2px rgba(31, 111, 235, 0.35);
}

/* Dark theme via media query */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14171b;
    --panel: #1c2026;
    --accent-bg: #232a33;
    --field-bg: #0f1319;
    --text: #e7ebf0;
    --text-light: #9aa4b2;
    --border: #3a434f;
    --border-soft: #2a323c;
    --disabled: #24292f;

    --accent: #4f8dff;
    --accent-hover: #74a4ff;
    --accent-text: #0b1220;

    --pass: #3fb950;
    --warn: #d9a441;
    --fail: #f85149;
    --pass-bg: #10261a;
    --warn-bg: #2c2410;
    --fail-bg: #2d1414;

    --code: #6ea0ff;
    --mark-bg: #6a5410;
    --inset-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
    --focus-ring: 0 0 0 2px rgba(79, 141, 255, 0.40);
  }
}

/* Explicit override — must beat the media query (showcase switcher) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171b;
  --panel: #1c2026;
  --accent-bg: #232a33;
  --field-bg: #0f1319;
  --text: #e7ebf0;
  --text-light: #9aa4b2;
  --border: #3a434f;
  --border-soft: #2a323c;
  --disabled: #24292f;

  --accent: #4f8dff;
  --accent-hover: #74a4ff;
  --accent-text: #0b1220;

  --pass: #3fb950;
  --warn: #d9a441;
  --fail: #f85149;
  --pass-bg: #10261a;
  --warn-bg: #2c2410;
  --fail-bg: #2d1414;

  --code: #6ea0ff;
  --mark-bg: #6a5410;
  --inset-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
  --focus-ring: 0 0 0 2px rgba(79, 141, 255, 0.40);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f4;
  --panel: #ffffff;
  --accent-bg: #e4e9ee;
  --field-bg: #ffffff;
  --text: #1c2530;
  --text-light: #54606d;
  --border: #a9b4bf;
  --border-soft: #c9d0d8;
  --disabled: #e6eaee;

  --accent: #1f6feb;
  --accent-hover: #175bc7;
  --accent-text: #ffffff;

  --pass: #2b8a3e;
  --warn: #b5820a;
  --fail: #d92c2c;
  --pass-bg: #dff3e3;
  --warn-bg: #fbeecd;
  --fail-bg: #fadddd;

  --code: #1f6feb;
  --mark-bg: #ffe08a;
  --inset-shadow: inset 0 1px 2px rgba(20, 30, 45, 0.10);
  --focus-ring: 0 0 0 2px rgba(31, 111, 235, 0.35);
}

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

textarea, select, input, progress, meter {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

html {
  font-family: var(--sans-font);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ---- Page frame ---------------------------------------------------------- */
body {
  color: var(--text);
  background-color: var(--bg);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr min(78rem, 94%) 1fr;
}
body > * { grid-column: 2; }

/* Full-bleed page header banner */
body > header {
  grid-column: 1 / -1;
  background-color: var(--panel);
  border-bottom: var(--border-width) solid var(--border);
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
}
body > header > * { max-width: 78rem; margin-inline: auto; }

main { padding-block: 1.6rem 2.5rem; }

body > footer {
  grid-column: 1 / -1;
  margin-top: 2rem;
  padding: 1.3rem clamp(1rem, 4vw, 3rem);
  color: var(--text-light);
  font-size: 0.86em;
  border-top: var(--border-width) solid var(--border);
  background: var(--panel);
}
body > footer > * { max-width: 78rem; margin-inline: auto; }

/* ---- Headings ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
h2 {
  font-size: 1.4rem;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: var(--border-width) solid var(--border);
}
h3 { font-size: 1.15rem; margin: 1.8rem 0 0.7rem; }
h4 { font-size: 1rem; margin: 1.4rem 0 0.5rem; }
h5 {
  font-size: 0.86rem; margin: 1.2rem 0 0.4rem;
  font-family: var(--mono-font); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-light); font-weight: 600;
}
h6 {
  font-size: 0.78rem; margin: 1rem 0 0.4rem;
  font-family: var(--mono-font); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-light); font-weight: 600;
}

p { margin: 0.8rem 0; overflow-wrap: break-word; }

/* ---- Links --------------------------------------------------------------- */
a, a:visited { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); text-decoration: none; }

/* ---- Lists --------------------------------------------------------------- */
ul, ol { margin: 0.8rem 0; padding-inline-start: 1.5rem; }
li { margin: 0.25rem 0; }
li::marker { color: var(--accent); }

dl { margin: 0.8rem 0; }
dt { font-family: var(--mono-font); font-weight: 600; color: var(--text); margin-top: 0.6rem; }
dd { margin: 0.1rem 0 0.4rem 1.2rem; color: var(--text-light); }

/* ---- Quotes -------------------------------------------------------------- */
blockquote {
  margin: 1.2rem 0;
  padding: 0.5rem 0.9rem;
  border-inline-start: 0.25rem solid var(--accent);
  background: var(--accent-bg);
  color: var(--text-light);
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }
cite { font-size: 0.86em; color: var(--text-light); font-style: normal; }
cite::before { content: "— "; }

/* ---- Horizontal rule ----------------------------------------------------- */
hr {
  border: none;
  height: var(--border-width);
  background: var(--border);
  margin: 1.6rem 0;
}

/* ---- Inline semantics ---------------------------------------------------- */
mark {
  padding: 0.05em 0.35em;
  border-radius: var(--radius);
  background-color: var(--mark-bg);
  color: #1c2530;
}
small { font-size: 0.85em; color: var(--text-light); }
sup, sub { vertical-align: baseline; position: relative; font-size: 0.75em; }
sup { top: -0.45em; }
sub { top: 0.3em; }
abbr[title] { cursor: help; text-decoration: underline dotted; }

/* ---- Code / keyboard ----------------------------------------------------- */
code, pre, kbd, samp {
  font-family: var(--mono-font);
  font-size: 0.9em;
}
code, samp {
  color: var(--code);
  background: var(--accent-bg);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
}
kbd {
  font-size: 0.82em;
  color: var(--text);
  background: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-bottom-width: 3px;
  border-radius: var(--radius);
  padding: 0.1em 0.4em;
}
pre {
  font-size: 0.86em;
  background: var(--field-bg);
  color: var(--text);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;
  box-shadow: var(--inset-shadow);
  line-height: 1.5;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* ---- Tables — compact data grids ---------------------------------------- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.92em;
  background: var(--panel);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
caption {
  caption-side: top;
  text-align: start;
  font-family: var(--mono-font);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  padding: 0 0 0.4rem;
}
th, td {
  text-align: start;
  padding: 0.34rem 0.6rem;
  border-bottom: var(--border-width) solid var(--border-soft);
}
thead th {
  background: var(--accent-bg);
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  border-bottom: var(--border-width) solid var(--border);
}
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--accent-bg) 45%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
tbody tr:last-child td { border-bottom: none; }
/* Numeric cells align on the decimal */
td { font-variant-numeric: tabular-nums; }

/* Figure wrapper lets wide tables scroll on their own */
figure { margin: 1rem 0; overflow-x: auto; }
figure > table { margin: 0; }
figcaption {
  font-size: 0.82em;
  color: var(--text-light);
  margin-top: 0.5rem;
  font-family: var(--mono-font);
}
img { max-width: 100%; height: auto; border-radius: var(--radius); }
figure > img { display: block; }

/* ---- Structural containers ---------------------------------------------- */
section { margin: 1.6rem 0; }

/* article = framed function block with a header strip */
article {
  background: var(--panel);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  margin: 1rem 0;
}
article > header {
  margin: -0.9rem -0.9rem 0.9rem;
  padding: 0.5rem 0.9rem;
  background: var(--accent-bg);
  border-bottom: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 0.9em;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
article > header > * { margin: 0; }
article > footer {
  margin: 0.9rem -0.9rem -0.9rem;
  padding: 0.5rem 0.9rem;
  background: var(--accent-bg);
  border-top: var(--border-width) solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 0.85em;
  color: var(--text-light);
}
article > *:first-child { margin-top: 0; }
article > *:last-child { margin-bottom: 0; }

/* aside = side note */
aside {
  background: var(--accent-bg);
  border: var(--border-width) solid var(--border-soft);
  border-inline-start: 0.2rem solid var(--accent);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.92em;
  margin: 1rem 0;
}
aside > *:first-child { margin-top: 0; }
aside > *:last-child { margin-bottom: 0; }

/* ---- Navigation ---------------------------------------------------------- */
nav ul, nav ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  padding: 0;
  margin: 0;
}
nav li { margin: 0; }
nav a {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 0.86em;
  padding: 0.25rem 0.7rem;
  border: var(--border-width) solid var(--border-soft);
  border-radius: var(--radius);
}
nav a:hover,
nav a[aria-current],
nav a.current {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--field-bg);
}
/* Buttons in the nav (e.g. Log out) match the link pills, not the big global
   button style. */
nav button {
  font-family: var(--mono-font);
  font-size: 0.86em;
  line-height: normal;
  padding: 0.25rem 0.7rem;
  border: var(--border-width) solid var(--border-soft);
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  cursor: pointer;
}
nav button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--field-bg);
}
nav form { margin: 0; display: inline-flex; }
/* Push the trailing item (Log out) to the far right of the nav. */
nav li:last-child { margin-left: auto; }

/* ---- Forms --------------------------------------------------------------- */
label {
  display: block;
  font-family: var(--mono-font);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.2rem;
}

input, select, textarea, button, .button {
  font-size: inherit;
  font-family: inherit;
  line-height: 1.3;
  max-width: 100%;
}

/* Recessed instrument fields */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="reset"]):not([type="button"]),
select,
textarea {
  display: block;
  width: 100%;
  color: var(--text);
  background-color: var(--field-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--inset-shadow);
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.6rem;
  font-family: var(--mono-font);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.5; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--inset-shadow), var(--focus-ring);
}
input::placeholder, textarea::placeholder { color: var(--text-light); opacity: 0.7; }

/* Native dropdown arrow */
select:not([multiple]) {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-light) 50%),
    linear-gradient(135deg, var(--text-light) 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 26px;
}
select[multiple] { padding: 0; }
select[multiple] option { padding: 0.25rem 0.5rem; }

/* Checkbox & radio — blue when checked */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
  margin-inline-end: 0.35em;
  background: var(--field-bg);
  border: var(--border-width) solid var(--border);
  box-shadow: var(--inset-shadow);
  position: relative;
  cursor: pointer;
}
input[type="checkbox"] { border-radius: var(--radius); }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.32em; top: 0.12em;
  width: 0.25em; height: 0.5em;
  border: solid var(--accent-text);
  border-width: 0 0.14em 0.14em 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 0.24em;
  border-radius: 50%;
  background: var(--accent-text);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
/* Inline label following a checkbox/radio */
input[type="checkbox"] + label,
input[type="radio"] + label {
  display: inline-block;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--sans-font);
  font-size: 1em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

/* Range slider */
input[type="range"] {
  width: 100%;
  height: 1.4rem;
  background: transparent;
  cursor: pointer;
  margin-bottom: 0.6rem;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: var(--field-bg);
  border: var(--border-width) solid var(--border);
  border-radius: 3px;
  box-shadow: var(--inset-shadow);
}
input[type="range"]::-moz-range-track {
  height: 5px;
  background: var(--field-bg);
  border: var(--border-width) solid var(--border);
  border-radius: 3px;
  box-shadow: var(--inset-shadow);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Color picker */
input[type="color"] {
  width: 3rem;
  height: 2rem;
  padding: 2px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  background: var(--field-bg);
  box-shadow: var(--inset-shadow);
  cursor: pointer;
  margin-bottom: 0.6rem;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 1px; }

/* File input */
input[type="file"] {
  display: block;
  width: 100%;
  font-size: 0.9em;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}
input[type="file"]::file-selector-button {
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 0.85em;
  padding: 0.35rem 0.7rem;
  margin-inline-end: 0.6rem;
  color: var(--text);
  background: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }

/* fieldset = framed function-block panel */
fieldset {
  background: var(--panel);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.8rem 0.9rem 0.5rem;
  margin: 1rem 0;
}
legend {
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
  padding: 0.15rem 0.5rem;
  background: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
}

/* ---- Buttons ------------------------------------------------------------- */
button,
input[type="submit"],
input[type="reset"],
input[type="button"],
.button,
a.button {
  display: inline-block;
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 0.9em;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  padding: 0.42rem 0.85rem;
  margin-bottom: 0.4rem;
  border-radius: var(--radius);
  border: var(--border-width) solid var(--border);
  background: var(--accent-bg);
  color: var(--text);
  cursor: pointer;
}
button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
input[type="button"]:focus-visible,
.button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Primary = blue filled (the "go" action) */
.primary,
button.primary,
input[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.primary:hover,
button.primary:hover,
input[type="submit"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
}

/* Danger = red filled (destructive) */
.danger,
button.danger {
  background: var(--fail);
  border-color: var(--fail);
  color: #fff;
}
.danger:hover,
button.danger:hover {
  background: color-mix(in srgb, var(--fail) 82%, #000);
  border-color: color-mix(in srgb, var(--fail) 82%, #000);
  color: #fff;
}

/* Disabled */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--disabled);
  border-color: var(--border-soft);
  color: var(--text-light);
  box-shadow: none;
}

/* ---- Details / summary --------------------------------------------------- */
details {
  background: var(--panel);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 0.9rem;
  margin: 1rem 0;
}
summary {
  cursor: pointer;
  font-family: var(--mono-font);
  font-weight: 600;
  font-size: 0.9em;
  padding: 0.55rem 0;
  list-style-position: inside;
}
summary::marker { color: var(--accent); }
details[open] { padding-bottom: 0.7rem; }
details[open] summary { border-bottom: var(--border-width) solid var(--border-soft); margin-bottom: 0.7rem; }

/* ==========================================================================
   INSTRUMENT ELEMENTS — meter, output, progress, dialog
   ========================================================================== */

/* meter = recessed gauge; native low/high/optimum drive pass/warn/fail color */
meter {
  display: inline-block;
  width: 100%;
  height: 1.1rem;
  vertical-align: middle;
  background: var(--field-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--inset-shadow);
  overflow: hidden;
}
meter::-webkit-meter-bar {
  background: var(--field-bg);
  border: none;
  border-radius: 2px;
  box-shadow: var(--inset-shadow);
}
meter::-webkit-meter-optimum-value { background: var(--pass); }
meter::-webkit-meter-suboptimum-value { background: var(--warn); }
meter::-webkit-meter-even-less-good-value { background: var(--fail); }
meter:-moz-meter-optimum::-moz-meter-bar { background: var(--pass); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--fail); }

/* progress = recessed track, accent fill */
progress {
  display: inline-block;
  width: 100%;
  height: 0.75rem;
  vertical-align: middle;
  background: var(--field-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--inset-shadow);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--field-bg); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
progress:indeterminate {
  background: repeating-linear-gradient(
    -45deg, var(--field-bg), var(--field-bg) 6px, var(--accent-bg) 6px, var(--accent-bg) 12px);
}

/* output = live readout, reads like a lit segment display */
output {
  display: inline-block;
  font-family: var(--mono-font);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--field-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--inset-shadow);
  padding: 0.2rem 0.55rem;
  letter-spacing: 0.02em;
}

/* dialog = modal panel with function-block header feel */
dialog {
  color: var(--text);
  background: var(--panel);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  max-width: 32rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
dialog::backdrop { background: rgba(10, 15, 22, 0.55); backdrop-filter: blur(1px); }
dialog > h1:first-child,
dialog > h2:first-child,
dialog > h3:first-child { margin-top: 0; }

/* ==========================================================================
   FROZEN ESCAPE-HATCH CLASSES
   .notice .button .pass .fail .warn .led .primary .danger
   ========================================================================== */

/* .notice — callout / alert box */
.notice {
  background: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-inline-start: 0.25rem solid var(--accent);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin: 1rem 0;
}
.notice > *:first-child { margin-top: 0; }
.notice > *:last-child { margin-bottom: 0; }

/* .pass / .warn / .fail — status coloring on td, span, mark, etc. */
.pass { color: var(--pass); font-weight: 700; }
.warn { color: var(--warn); font-weight: 700; }
.fail { color: var(--fail); font-weight: 700; }
mark.pass { background: var(--pass-bg); color: var(--pass); }
mark.warn { background: var(--warn-bg); color: var(--warn); }
mark.fail { background: var(--fail-bg); color: var(--fail); }

/* .led — small round status dot; pair with a status class */
.led {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  vertical-align: 0.02em;
  margin-inline-end: 0.15em;
  background: var(--text-light);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-light) 25%, transparent);
}
.led.pass { background: var(--pass); box-shadow: 0 0 0 2px var(--pass-bg), 0 0 4px var(--pass); }
.led.warn { background: var(--warn); box-shadow: 0 0 0 2px var(--warn-bg), 0 0 4px var(--warn); }
.led.fail { background: var(--fail); box-shadow: 0 0 0 2px var(--fail-bg), 0 0 4px var(--fail); }

/* .led inside a status td/span should keep its own dot color, not inherit text weight */
.led { font-weight: normal; }
