/* WEBSITE COPY of ui/ui.css (6 Nov 2026) — so website/ stands alone and can be copied to the web server as it is.
   Made from the shared file on that day; if the shared file changes and the website needs it, copy it again. */
/* ═══════════════════════════════════════════════════════════════════════════════════════
   THE SHARED COMPONENT LAYER — ui/ui.css
   ---------------------------------------------------------------------------------------
   Until now the system was WRITTEN in one place and BUILT in every place. brand/system.js
   generated tokens.css, and not one file in the estate linked it: every page kept its own
   inline copy of the values and stayed on the old ones until a person retyped them.

   This file is the first real consumer. It imports the generated token file, so a value
   changed in brand/system.js now reaches a screen instead of only a download.

   WHAT LIVES HERE: atoms and molecules that more than one surface uses — the button, the
   form controls, and the field group that wraps a control with its label, help text and
   error. Page layout does not live here. Instrument chrome does not live here (the
   simulator and the mapper are dark-only, dense and tuned; they consume tokens.css for
   values and keep their own component layer).

   THE HOOKS. A component never names a colour. It reads one of these, and each one falls
   back along a chain: the website's own accent ladder first (so a sector page stays orange
   or blue), then the UDS role, so the same markup is correct on an internal page with no
   ladder at all. Set --uds-accent on a container to re-point everything inside it.

   STATUS: proposed. Approved by Esben and the design team before it is used more widely.
   See ui/README.md for the register.
════════════════════════════════════════════════════════════════════════════════════════ */

/* UPTEKO DESIGN SYSTEM — LIBRARY 0.5.6 · built against brand REV 29 · 25 Sep 2026
   Every class, hook and entry point in this library carries the uds- prefix. A name
   without it belongs to a page, not to the library. */
@import url("tokens.css");

:root {
  /* ONLY the accent reads the website's ladder first, because that is the one thing that
     genuinely differs per page: a defence page is orange, a security page is blue, and an
     internal page has no ladder at all and falls through to the UDS accent role.

     EVERYTHING ELSE READS THE THEME ROLE DIRECTLY, and that ordering matters. Reading the
     website's palette literals first (--color-surface, --text-primary) looked equivalent —
     they hold the same values — but those literals are the DARK palette by definition and
     do not move when [data-theme="light"] is set. The first light-mode render of this layer
     put #16161A ink on a #1C1C1F field: 1.1:1, unreadable. The roles flip; the literals do
     not. (21 Sep 2026) */
  --uds-accent:        var(--accent, var(--acc));
  --uds-accent-hover:  var(--accent-hover, var(--acc-hover));
  --uds-ink:           var(--ink);
  --uds-muted:         var(--mut);
  --uds-faint:         var(--sub);
  --uds-line:          var(--line);
  --uds-surface:       var(--card);
  --uds-surface-2:     var(--card2);
  /* the motion scale is the system's: nothing here exceeds 180ms */
  --uds-t-snap:        var(--t-snap, .12s);
  --uds-t-move:        var(--t-move, .18s);
}

/* ── BUTTON ─────────────────────────────────────────────────────────────────────────────
   Squared-off, uppercase, letter-spaced — the estate has no pills outside the bar. The
   label is 13px: above the 12px floor, which controls do not get to duck under. */
.uds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  /* 13 Oct 2026 (Rose: "align all buttons"): the tracking leaves a space after the last letter, so the label moves right by
     half of it (.07em). --uds-btn-nudge moves it down for a face whose capitals sit high (Blender: .1em, set by the website). */
  padding: calc(11px + var(--uds-btn-nudge, 0px)) calc(26px - .07em) calc(11px - var(--uds-btn-nudge, 0px)) calc(26px + .07em); font-family: inherit;
  font-size: var(--fs-small, 13px); font-weight: var(--fw-semibold, 600);
  letter-spacing: .14em; text-transform: uppercase;
  border-radius: var(--radius-4); border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--uds-ink); text-decoration: none;
  transition: background var(--uds-t-move) ease, border-color var(--uds-t-move) ease,
              transform var(--uds-t-move) ease;
}
/* primary = neutral: the brand is monochrome and teal never marks an action (rev 32, 12 Oct 2026).
   It is the ink at 55% — so it flips with the theme — and full ink on hover. */
.uds-btn--primary { border-color: color-mix(in srgb, var(--uds-ink) 55%, transparent); }
.uds-btn--primary:hover,
body[data-ds] .uds-btn--primary:is([data-demo-state="hover"],[data-demo-state="pressed"]) {
  background: color-mix(in srgb, var(--uds-ink) 6%, transparent);
  border-color: var(--uds-ink);
}
.uds-btn--outline { border-color: var(--uds-ink); }
.uds-btn--outline:hover,
body[data-ds] .uds-btn--outline:is([data-demo-state="hover"],[data-demo-state="pressed"]) {
  background: color-mix(in srgb, var(--uds-ink) 8%, transparent);
}
.uds-btn:active, body[data-ds] .uds-btn[data-demo-state="pressed"] { transform: translateY(1px); }
/* full-width: the login form's submit, which was a second button class saying the same thing */
.uds-btn--block { width: 100%; padding: calc(14px + var(--uds-btn-nudge, 0px)) calc(26px - .07em) calc(14px - var(--uds-btn-nudge, 0px)) calc(26px + .07em); }

.uds-btn:focus-visible, body[data-ds] .uds-btn[data-demo-state="focus"] { outline: 2px solid var(--uds-accent); outline-offset: 3px; }

/* DISABLED and LOADING are states, not separate buttons. Neither is announced by colour
   alone: disabled carries the attribute, busy carries aria-busy and a label change. */
.uds-btn:disabled, .uds-btn[aria-disabled="true"] {
  opacity: .45; cursor: not-allowed; transform: none;
}
.uds-btn:disabled:hover, .uds-btn[aria-disabled="true"]:hover { background: transparent; }
.uds-btn[aria-busy="true"] { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .uds-btn { transition-duration: .01ms; }
  .uds-btn:active { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════
   BATCH 4 — CHOICE CONTROLS, ICONS AND TOOLTIPS
   ---------------------------------------------------------------------------------------
   Native inputs keep their semantics and keyboard behaviour. CSS owns only the visible
   control. Lucide owns interface symbols; do not redraw a symbol already in the set.
════════════════════════════════════════════════════════════════════════════════════════ */

.uds-choice {
  display: inline-flex; align-items: flex-start; gap: 12px;
  color: var(--uds-ink); cursor: pointer; line-height: 1.45;
}
.uds-choice > input {
  appearance: none; display: grid; place-content: center;
  width: 20px; height: 20px; flex: none; margin: 1px 0 0;
  /* NOT --line2. That is a hairline for decoration and measured 1.56:1 dark / 1.72:1
     light behind this box \u2014 an unchecked checkbox you cannot see. (22 Sep 2026) */
  background: var(--uds-surface); border: 1px solid var(--uds-control-edge);
  transition: background var(--uds-t-snap) ease, border-color var(--uds-t-snap) ease,
              box-shadow var(--uds-t-snap) ease;
}
.uds-choice > input[type="checkbox"] { border-radius: var(--radius-2); }
.uds-choice > input[type="radio"] { border-radius: var(--radius-round); }
.uds-choice > input:hover { background: var(--uds-surface-2); }
.uds-choice > input:focus-visible {
  outline: none; border-color: var(--uds-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--uds-accent) 28%, transparent);
}
.uds-choice > input:checked { background: var(--uds-accent); border-color: var(--uds-accent); }
.uds-choice > input[type="checkbox"]::before {
  content: ''; width: 10px; height: 6px;
  border: solid var(--pg); border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform var(--uds-t-snap) ease;
}
.uds-choice > input[type="checkbox"]:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.uds-choice > input[type="checkbox"]:indeterminate::before {
  width: 10px; height: 0; border-width: 0 0 2px; border-color: var(--uds-ink); transform: none;
}
.uds-choice > input[type="radio"]::before {
  content: ''; width: 8px; height: 8px; border-radius: var(--radius-round);
  background: var(--pg); transform: scale(0); transition: transform var(--uds-t-snap) ease;
}
.uds-choice > input[type="radio"]:checked::before { transform: scale(1); }
.uds-choice > input:disabled { opacity: .45; cursor: not-allowed; }
.uds-choice:has(> input:disabled) { color: var(--uds-muted); cursor: not-allowed; }

.uds-switch {
  display: inline-flex; align-items: flex-start; gap: 12px;
  color: var(--uds-ink); cursor: pointer; line-height: 1.45;
}
.uds-switch > input {
  appearance: none; position: relative; width: 44px; height: 24px; flex: none; margin: 0;
  border: 1px solid var(--uds-control-edge); border-radius: var(--radius-pill);
  background: var(--uds-surface); transition: background var(--uds-t-snap) ease,
  border-color var(--uds-t-snap) ease, box-shadow var(--uds-t-snap) ease;
}
.uds-switch > input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: var(--radius-round); background: var(--uds-muted);
  transition: transform var(--uds-t-move) ease, background var(--uds-t-snap) ease;
  /* the knob stays --muted: it is a filled shape, not a 1px edge, and reads at 6.9:1 */
}
.uds-switch > input:checked { background: var(--uds-accent); border-color: var(--uds-accent); }
.uds-switch > input:checked::after { transform: translateX(20px); background: var(--pg); }
.uds-switch > input:focus-visible {
  outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--uds-accent) 28%, transparent);
}
.uds-switch > input:disabled { opacity: .45; cursor: not-allowed; }
.uds-switch:has(> input:disabled) { color: var(--uds-muted); cursor: not-allowed; }

.uds-choice__copy { display: grid; gap: 2px; }
.uds-choice__help { color: var(--uds-muted); font-size: var(--fs-small, 13px); }

.uds-icon {
  display: inline-block; width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Text buttons accept one leading or trailing icon. Mark it decorative when the label
   already names the action; icon-only controls use .uds-btn--icon and aria-label. */
.uds-btn > .uds-icon { width: 18px; height: 18px; }

.uds-tooltip { position: relative; display: inline-flex; }
.uds-tooltip__bubble {
  position: absolute; z-index: 80; left: 50%; bottom: calc(100% + 10px);
  translate: -50% 4px; width: max-content; max-width: 240px;
  padding: 7px 10px; border: 1px solid var(--uds-line2, var(--line2));
  border-radius: var(--radius-2); background: var(--uds-surface-2); color: var(--uds-ink);
  font: 500 var(--fs-small, 13px)/1.35 sans-serif; font-family: inherit;   /* the surface's family: Blender on the website, Roboto Mono elsewhere */
  /* NO pointer-events:none. WCAG 1.4.13 says hover content must stay reachable \u2014 a
     reader magnifying or selecting the text must be able to put the pointer ON it.
     While closed, visibility:hidden already blocks the pointer, so nothing is caught
     by an invisible bubble. (22 Sep 2026) */
  opacity: 0; visibility: hidden;
  transition: opacity var(--uds-t-snap) ease, translate var(--uds-t-snap) ease;
}
.uds-tooltip:hover .uds-tooltip__bubble,
.uds-tooltip:focus-within .uds-tooltip__bubble { opacity: 1; visibility: visible; translate: -50% 0; }
.uds-tooltip--start .uds-tooltip__bubble { left: 0; translate: 0 4px; }
.uds-tooltip--start:hover .uds-tooltip__bubble,
.uds-tooltip--start:focus-within .uds-tooltip__bubble { translate: 0 0; }
.uds-tooltip--end .uds-tooltip__bubble { left: auto; right: 0; translate: 0 4px; }
.uds-tooltip--end:hover .uds-tooltip__bubble,
.uds-tooltip--end:focus-within .uds-tooltip__bubble { translate: 0 0; }

/* The bubble floats 10px above the control. Without this the pointer crosses 10px of
   dead space on its way up and the tooltip closes in transit \u2014 "hoverable" on paper,
   unusable in practice. This invisible strip bridges the gap. */
.uds-tooltip__bubble::before {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px;
}

/* DISMISSED \u2014 Escape closes it and it stays closed until the pointer or focus leaves.
   WCAG 1.4.13 again: hover content must be dismissible without moving the pointer.
   ui.js owns the class. This rule sits AFTER the :hover/:focus-within rules on purpose:
   same specificity, so source order decides, and the dismissal wins. */
.uds-tooltip.is-dismissed .uds-tooltip__bubble {
  opacity: 0; visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .uds-choice > input, .uds-switch > input, .uds-switch > input::after,
  .uds-tooltip__bubble { transition-duration: .01ms; }
}

/* ── FIELD — label + control + help + error ─────────────────────────────────────────────
   The molecule, not the input. A control on its own cannot say what it is called, what it
   expects, or what went wrong; this group can, and it wires the relationships that a
   screen reader needs (aria-describedby to the help and the error, aria-invalid on the
   control) rather than leaving them to be remembered per page. */
.uds-field { display: flex; flex-direction: column; gap: 8px; }
.uds-field--full { grid-column: 1 / -1; }

.uds-field label {
  font-size: var(--fs-small, 13px); letter-spacing: .08em; text-transform: uppercase;
  color: var(--uds-muted); font-weight: var(--fw-medium, 500);
}
/* the required star is decoration — the real signal is the required attribute, which is
   what assistive technology reads. Hence aria-hidden on the span in the markup. */
.uds-field label .uds-req { color: var(--uds-accent); margin-left: 3px; }

/* FIELD EDGE (0.5.3): --uds-field-edge, not --line. The hairline measured 1.19:1 and the fields
   read as faint; the field role clears 3:1 on every surface a field sits on, in both themes.
   ONE HEIGHT FOR ALL THREE (0.5.2): line-height pinned to 1.25 so input and select both land on
   48px (20 + 2x13 padding + 2x1 border), the size Figma draws. With 'normal' the browser gave
   the input 49px and the select 47px. */
.uds-field input, .uds-field select, .uds-field textarea {
  width: 100%; font-family: inherit; font-size: 1rem; line-height: 1.25; color: var(--uds-ink);
  background: var(--uds-surface); border: 1px solid var(--uds-field-edge); border-radius: var(--radius-4);
  padding: 13px 14px;
  transition: border-color var(--uds-t-move) ease, background var(--uds-t-move) ease,
              box-shadow var(--uds-t-snap) ease;
}
.uds-field textarea { resize: vertical; min-height: 128px; }
/* PLACEHOLDER. It was --sub (decoration) at 3.41:1 dark and 3.43:1 light — below the floor.
   A visible label does not exempt placeholder text from the normal text-contrast requirement
   (Esben, 21 Sep 2026), so the system owns a role of its own, --uds-placeholder, generated
   from brand/system.js with a measured twin in each theme.

   It is checked against EVERY surface a supported text input sits on — --card at rest and
   --card2 on focus — in both themes, unrounded, with margin. Worst case 4.8193:1.

   SCOPE, stated rather than assumed: --ctl / --ctl-hover (the instrument control surface) are
   NOT in that set, because no text-input variant uses them yet. A placeholder forced to clear
   --ctl-hover computes to #A0A0A5, which IS --mut — the role would collapse into the label
   colour and buy nothing. When an instrument input variant is declared, this role is
   re-derived against its surfaces rather than stretched to cover them in advance.

   opacity:1 is explicit. Firefox dims placeholders by default, and no opacity is applied to an
   input or its placeholder anywhere in this file — so the measured ratio IS the rendered
   ratio. Do not add any. */
.uds-field input::placeholder,
.uds-field textarea::placeholder { color: var(--uds-placeholder); opacity: 1; }

.uds-field input:focus, .uds-field select:focus, .uds-field textarea:focus {
  outline: none; border-color: var(--uds-accent); background: var(--uds-surface-2);
}
/* A 1px border changing hue is a thin thing to hang keyboard focus on. Pointer users keep
   the quiet border; keyboard users get a ring as well. */
.uds-field input:focus-visible, .uds-field select:focus-visible, .uds-field textarea:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--uds-accent) 28%, transparent);
}

/* the select's own arrow, drawn rather than shipped as an image */
/* SELECT ARROW (0.5.5): the Lucide chevron-down from brand/assets/icons, 20px, 14px in from the
   right edge — exactly what Figma draws. It replaced a hand-drawn CSS triangle. A data URI
   cannot read a CSS variable, so each theme carries its own copy in the --mut colour
   (dark #9A9A9F, light #5E5E68); change them together with --mut in brand/system.js. */
:root { --uds-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9A9F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="light"] { --uds-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5E68' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.uds-field select {
  appearance: none; padding-right: 42px;
  background-image: var(--uds-select-arrow);
  background-position: right 14px center;
  background-size: 20px 20px; background-repeat: no-repeat;
}
/* the shared focus rule sets the whole background, which used to wipe the arrow off a
   focused select; put it back */
.uds-field select:focus {
  background-color: var(--uds-surface-2); background-image: var(--uds-select-arrow);
  background-position: right 14px center; background-size: 20px 20px; background-repeat: no-repeat;
}

.uds-field__help { font-size: var(--fs-small, 13px); color: var(--uds-muted); line-height: 1.5; }

/* ── THE ERROR STATE ────────────────────────────────────────────────────────────────────
   Colour is never the only channel: the border changes, a message appears in words, and
   the control carries aria-invalid. The message sits BELOW the control and is pointed at
   by aria-describedby, so it is read when the control takes focus. */
.uds-field__err { font-size: var(--fs-small, 13px); color: var(--fault-soft); line-height: 1.5; }
.uds-field__err[hidden] { display: none; }
/* DISABLED FIELDS (0.5.2). Until now a disabled field looked exactly like a live one — the
   author colours override the browser's own greying. Same rule as buttons and choices: the
   control drops to 45% and the cursor says no. Figma's Disabled variants match. */
.uds-field input:disabled, .uds-field select:disabled, .uds-field textarea:disabled {
  opacity: .45; cursor: not-allowed;
}
.uds-field--invalid input, .uds-field--invalid select, .uds-field--invalid textarea { border-color: var(--fault); }
.uds-field--invalid input:focus-visible,
.uds-field--invalid select:focus-visible,
.uds-field--invalid textarea:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fault) 28%, transparent);
}

/* ── FEEDBACK ───────────────────────────────────────────────────────────────────────────
   Two regions, two jobs. The SUMMARY is a list of what is wrong, rendered on submit and
   focused so a keyboard user lands on it instead of hunting. The STATUS line is the
   polite live region the page already had — it reports what happened, not what is wrong. */
/* EVERY PAGE IN THIS ESTATE HAS A FIXED BAR. Moving focus to the summary, or following one
   of its links to a control, scrolls that element to the top of the viewport — which is
   underneath the bar. The offset is a hook so a page with a taller header can raise it. */
.uds-form-errors,
.uds-field input, .uds-field select, .uds-field textarea {
  scroll-margin-top: var(--uds-scroll-offset, calc(var(--nav-h, 64px) + 28px));
}

.uds-form-errors {
  border: 1px solid var(--fault); background: var(--fault-bg); border-radius: var(--radius-4);
  padding: 14px 16px; color: var(--fault-soft); font-size: var(--fs-small, 13px);
  line-height: 1.6;
}
.uds-form-errors[hidden] { display: none; }
.uds-form-errors:focus-visible { outline: 2px solid var(--fault); outline-offset: 3px; }
.uds-form-errors h3 { margin: 0 0 6px; font-size: var(--fs-small, 13px); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fault-soft); }
.uds-form-errors ul { margin: 0; padding-left: 18px; }
.uds-form-errors a { color: inherit; text-decoration: underline; }

.uds-form-status { margin: 0; font-size: var(--fs-small, 13px); color: var(--uds-accent);
  min-height: 1.2em; }
.uds-form-status--fault { color: var(--fault-soft); }

/* ═══════════════════════════════════════════════════════════════════════════════════════
   BATCH 1 — TEXT AND LINKS                                            library 0.2.0
   ---------------------------------------------------------------------------------------
   The cheap atoms. Every page needs them and no page had them: each surface styled its own
   links and lists, so a link on the website and a link on an internal page were two
   different decisions. These are one decision.
════════════════════════════════════════════════════════════════════════════════════════ */

/* LINK. Underlined by default — colour alone is not a link (colour is never the only
   channel, and a reader who cannot see the accent sees plain text). The underline sits a
   little low and thickens on hover, so the hover is felt rather than announced. */
.uds-link {
  color: var(--uds-accent); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color var(--uds-t-snap) ease, text-decoration-thickness var(--uds-t-snap) ease;
}
.uds-link:hover { color: var(--uds-accent-hover); text-decoration-thickness: 2px; }
.uds-link:focus-visible { outline: 2px solid var(--uds-accent); outline-offset: 2px; border-radius: var(--radius-1); }
/* a link that leaves the estate says so, once, in the margin of the text */
.uds-link--external::after { content: '\2197'; margin-left: .25em; font-size: .9em; }
/* a link inside a paragraph of running text inherits the ink and keeps only the underline,
   because a paragraph peppered with accent is a paragraph nobody reads */
.uds-link--quiet { color: inherit; text-decoration-color: var(--uds-line2, var(--line2)); }
.uds-link--quiet:hover { color: var(--uds-accent); text-decoration-color: currentColor; }

/* LIST. Markers in the accent, text in the ink. */
.uds-list { margin: 0; padding-left: 1.35em; color: var(--uds-ink); line-height: 1.7; }
.uds-list > li { margin-bottom: .5em; }
.uds-list > li::marker { color: var(--uds-accent); }
.uds-list--ordered { list-style: decimal; }
.uds-list--ordered > li::marker { font-variant-numeric: tabular-nums; font-weight: 600; }
/* no markers at all — for lists that are really stacks */
.uds-list--bare { list-style: none; padding-left: 0; }

/* INLINE CODE. Mono, on an inset, at a size that does not shrink against body text —
   .92em rather than a fixed small value, so it tracks whatever it sits in. */
.uds-code {
  font-family: 'Roboto Mono', ui-monospace, monospace;
  /* .92em tracks whatever it sits in \u2014 but inside 13px help text that lands at 11.96px,
     under the 12px floor, which covers documentation labels too. Clamped. (22 Sep 2026) */
  font-size: max(12px, .92em);
  background: var(--uds-surface-2); color: var(--strong);
  border: 1px solid var(--uds-line); border-radius: var(--radius-2);
  padding: .1em .38em;
}

/* DIVIDER. One hairline. The variant carries a label in the middle of the rule. */
.uds-hr { border: 0; border-top: 1px solid var(--uds-line); margin: var(--space-5, 32px) 0; }
.uds-hr--labelled {
  display: flex; align-items: center; gap: var(--space-3, 16px);
  border: 0; margin: var(--space-5, 32px) 0;
  font: 600 var(--fs-small, 13px)/1 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .16em; text-transform: uppercase; color: var(--uds-muted);
}
.uds-hr--labelled::before, .uds-hr--labelled::after {
  content: ''; flex: 1; height: 1px; background: var(--uds-line);
}

/* ═══════════════════════════════════════════════════════════════════════════════════════
   BATCH 2 — ACTIONS AND SIGNALS
   ---------------------------------------------------------------------------------------
   A badge and a status pill look alike and mean different things. A BADGE labels a thing
   ("BETA", "ISO 9001"). A STATUS reports a live condition ("ARMED", "LINK LOST"). The
   status carries a lamp because an operator reads the lamp before the word; the badge
   never does, because a badge is not a reading.
════════════════════════════════════════════════════════════════════════════════════════ */

/* BUTTON, two more variants. Both inherit every state from .uds-btn. */
/* GHOST — a button with no edge, for the third action in a row that must not compete */
.uds-btn--ghost { border-color: transparent; color: var(--uds-muted); }
.uds-btn--ghost:hover,
body[data-ds] .uds-btn--ghost:is([data-demo-state="hover"],[data-demo-state="pressed"]) {
  background: color-mix(in srgb, var(--uds-ink) 8%, transparent);
  color: var(--uds-ink);
}
/* ICON — square, no label showing. An icon-only control MUST carry aria-label; without
   one it is a button that says nothing, and the library will not make it look finished. */
.uds-btn--icon { padding: 0; width: 40px; height: 40px; flex: none; }
.uds-btn--icon > .uds-icon { width: 18px; height: 18px; }

/* BADGE — a label on a thing. No lamp, no motion, never announces itself. */
.uds-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 var(--fs-small, 13px)/1 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: var(--radius-2);
  background: var(--uds-surface-2); color: var(--strong);
  border: 1px solid var(--uds-line);
}
.uds-badge--go     { background: var(--go-bg);     color: var(--go-soft);     border-color: color-mix(in srgb, var(--go) 40%, transparent); }
.uds-badge--fault  { background: var(--fault-bg);  color: var(--fault-soft);  border-color: color-mix(in srgb, var(--fault) 45%, transparent); }
.uds-badge--amber  { background: var(--amber-bg);  color: var(--amber);       border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.uds-badge--info   { background: var(--info-bg);   color: var(--info-soft);   border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.uds-badge--accent { background: color-mix(in srgb, var(--uds-accent) 14%, transparent);
  color: var(--uds-accent); border-color: color-mix(in srgb, var(--uds-accent) 45%, transparent); }

/* TAG — a badge the reader can remove. The dismiss is a real button with a real name. */
/* min-height keeps the tag around its now-larger dismiss without the text jumping */
.uds-tag {
  display: inline-flex; align-items: center; gap: 2px; min-height: 34px;
  font: 500 var(--fs-small, 13px)/1 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .06em;
  background: var(--uds-surface-2); color: var(--strong);
  border: 1px solid var(--uds-line); border-radius: var(--radius-2);
  padding: 5px 5px 5px 9px;
}
/* 26x26, not 22. Measured at 22 and WCAG 2.2 AA asks for 24 minimum — a dismiss is a
   real target, and "it is only a small x" is not an exemption. (22 Sep 2026) */
.uds-tag__x {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  background: transparent; border: 0; border-radius: var(--radius-1); cursor: pointer;
  color: var(--uds-muted); font-size: 14px; line-height: 1;
  transition: color var(--uds-t-snap) ease, background var(--uds-t-snap) ease;
}
.uds-tag__x:hover { color: var(--fault-mid); background: color-mix(in srgb, var(--fault) 14%, transparent); }
.uds-tag__x:focus-visible { outline: 2px solid var(--uds-accent); outline-offset: 1px; }
/* a tag with no dismiss keeps its right padding */
.uds-tag--static { padding-right: 9px; }

/* STATUS — a live condition. Lamp first, then the word. The word is never optional:
   colour is never the only channel, and "green" is not a reading. */
.uds-status {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 var(--fs-small, 13px)/1 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--strong);
}
/* The lamp is DECORATION — the word beside it carries the meaning. ui.js sets
   aria-hidden on every lamp at boot so an author cannot forget to. */
.uds-status__lamp {
  width: 9px; height: 9px; flex: none; border-radius: var(--radius-round);
  background: var(--uds-muted); box-shadow: 0 0 0 0 transparent;
}
.uds-status--go    .uds-status__lamp { background: var(--go);    box-shadow: 0 0 10px color-mix(in srgb, var(--go) 55%, transparent); }
.uds-status--amber .uds-status__lamp { background: var(--amber); box-shadow: 0 0 10px color-mix(in srgb, var(--amber) 55%, transparent); }
.uds-status--fault .uds-status__lamp { background: var(--fault); box-shadow: 0 0 10px color-mix(in srgb, var(--fault) 55%, transparent); }
.uds-status--idle  .uds-status__lamp { background: transparent; box-shadow: inset 0 0 0 2px var(--uds-muted); }
.uds-status--go    { color: var(--go-soft); }
.uds-status--amber { color: var(--amber); }
.uds-status--fault { color: var(--fault-soft); }
.uds-status--idle  { color: var(--uds-muted); }
/* STALE — the reading arrived, and then stopped arriving. The lamp holds its colour and
   the value dims, because a stale number that looks live is worse than no number. */
.uds-status--stale .uds-status__lamp { animation: uds-stale 1.4s steps(1) infinite; }
.uds-status--stale { color: var(--uds-muted); }
@keyframes uds-stale { 0%,60% { opacity: 1 } 61%,100% { opacity: .25 } }

/* ═══════════════════════════════════════════════════════════════════════════════════════
   BATCH 5 — CONTAINERS, ALERTS AND DATA
   ---------------------------------------------------------------------------------------
   These molecules compose the atoms above without inventing another visual language.
   Cards create one level of grouping. Alerts explain a condition and what to do about it.
   Metrics present one reading with its unit and freshness visible in words.
════════════════════════════════════════════════════════════════════════════════════════ */

/* CARD — one bounded group. Depth comes from surface steps and a hairline, never a large
   shadow. Use the interactive variant on the link itself; do not put a link over a card
   that also contains buttons or other controls. */
.uds-card {
  display: flex; flex-direction: column; gap: var(--space-3, 16px);
  min-width: 0; padding: var(--space-4, 24px);
  color: var(--uds-ink); background: var(--uds-surface);
  border: 1px solid var(--uds-line); border-radius: var(--radius-5);
}
.uds-card__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3, 16px);
}
.uds-card__title {
  margin: 0; color: var(--uds-ink);
  font: 600 18px/1.3 sans-serif; font-family: inherit;   /* the surface's family */
}
.uds-card__meta {
  margin: 3px 0 0; color: var(--uds-muted);
  font: 600 var(--fs-small, 13px)/1.35 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .08em; text-transform: uppercase;
}
.uds-card__body { margin: 0; color: var(--strong); line-height: 1.6; }
.uds-card__footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: auto; padding-top: var(--space-3, 16px); border-top: 1px solid var(--uds-line);
}
.uds-card--compact { gap: 12px; padding: var(--space-3, 16px); }
.uds-card--interactive {
  color: inherit; text-decoration: none; cursor: pointer;
  transition: background var(--uds-t-move) ease, border-color var(--uds-t-move) ease,
              translate var(--uds-t-move) ease;
}
.uds-card--interactive:hover {
  background: var(--uds-surface-2); border-color: var(--line2); translate: 0 -1px;
}
.uds-card--interactive:active { translate: 0 0; }
.uds-card--interactive:focus-visible {
  outline: 2px solid var(--uds-accent); outline-offset: 3px;
}

/* ALERT — the title names the state, the body explains it. Colour reinforces that copy;
   it never carries the meaning alone. The caller chooses role=status for informative
   updates and role=alert only when immediate interruption is warranted. */
.uds-alert {
  --uds-alert-ink: var(--info-soft); --uds-alert-bg: var(--info-bg);
  --uds-alert-edge: var(--info);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px;
  padding: 16px 18px; color: var(--uds-alert-ink); background: var(--uds-alert-bg);
  /* one even outline in the state colour, all the way round. A thick coloured edge on one
     side of a rounded box is banned (Rose, 25 Sep 2026): outline everything or nothing. */
  border: 1px solid var(--uds-alert-edge); border-radius: var(--radius-4);
}
.uds-alert--success {
  --uds-alert-ink: var(--go-soft); --uds-alert-bg: var(--go-bg); --uds-alert-edge: var(--go);
}
.uds-alert--warning {
  --uds-alert-ink: var(--warn-soft); --uds-alert-bg: var(--warn-bg); --uds-alert-edge: var(--warn);
}
.uds-alert--danger {
  --uds-alert-ink: var(--fault-soft); --uds-alert-bg: var(--fault-bg); --uds-alert-edge: var(--fault);
}
.uds-alert__icon { grid-row: 1 / span 2; margin-top: 1px; color: var(--uds-alert-edge); }
.uds-alert__title {
  margin: 0; color: var(--uds-alert-ink);
  font: 700 var(--fs-small, 13px)/1.4 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .12em; text-transform: uppercase;
}
.uds-alert__body { margin: 0; color: var(--uds-alert-ink); line-height: 1.55; }
.uds-alert__body .uds-link { color: inherit; }

/* METRIC — a reading is three things: label, value and provenance/state. The value is
   prominent, but the state word and update time stop a stale reading from looking live. */
.uds-metric-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: var(--space-3, 16px); width: 100%;
}
.uds-metric {
  display: grid; gap: 8px; min-width: 0; margin: 0;
  padding: 18px; background: var(--uds-surface-2);
  border: 1px solid var(--uds-line); border-radius: var(--radius-4);
}
.uds-metric__label {
  color: var(--uds-muted);
  font: 700 var(--fs-small, 13px)/1.3 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .12em; text-transform: uppercase;
}
.uds-metric__reading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.uds-metric__value {
  margin: 0; color: var(--uds-ink);
  font: 600 clamp(28px, 5vw, 40px)/1 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.uds-metric__unit {
  color: var(--uds-muted);
  font: 600 var(--fs-small, 13px)/1 'Roboto Mono', ui-monospace, monospace;
  letter-spacing: .08em; text-transform: uppercase;
}
.uds-metric__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--uds-muted); font-size: var(--fs-small, 13px); line-height: 1.35;
}
/* the state colours the whole outline, never one side (Rose, 25 Sep 2026) */
.uds-metric--warning { border-color: var(--warn); }
.uds-metric--fault { border-color: var(--fault); }
.uds-metric--stale .uds-metric__value { color: var(--uds-muted); }
.uds-metric--stale { border-style: dashed; }

@media (prefers-reduced-motion: reduce) {
  .uds-card--interactive { transition-duration: .01ms; }
  .uds-card--interactive:hover { translate: 0 0; }
}

/* SPINNER — for waits the reader must sit through. It carries no text, so whatever
   spawned it owns the announcement (role="status" on the region, not on the ring). */
.uds-spinner {
  display: inline-block; width: 18px; height: 18px; flex: none;
  border: 2px solid color-mix(in srgb, var(--uds-ink) 18%, transparent);
  border-top-color: var(--uds-accent);
  border-radius: var(--radius-round);
  animation: uds-spin .7s linear infinite;
}
.uds-spinner--lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes uds-spin { to { transform: rotate(360deg) } }

@media (prefers-reduced-motion: reduce) {
  /* the spinner still has to say "working", so it pulses in place instead of travelling */
  .uds-spinner { animation: uds-pulse 1.2s ease-in-out infinite; border-top-color: var(--uds-accent); }
  .uds-status--stale .uds-status__lamp { animation: none; opacity: .45; }
  @keyframes uds-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
}
