/* p24-ui v1 — the shared Powder24 stylesheet for P24 apps, served by the Apps Hub at
   https://apps.powder24.co.uk/p24-ui/v1/p24.css. The look is powder24.co.uk's: black and white,
   the brand gradient as the only colour, Geist and Geist Mono, pill buttons, 16px cards. What the
   website has no need of — tables, forms, status colours, a wide page — is added here.

   Rules this file keeps, each enforced by apps-hub-tests/P24UiTests.cs:
   - Every selector carries a .p24- class (or is the :root token block). No plain tag is ever styled,
     so linking this file beside an app's existing CSS cannot change anything the app has not opted in to.
   - Every custom property and keyframe name starts with p24-.
   - v1 only ever takes non-breaking changes. Renaming or removing a class, or changing what one
     means, ships as /p24-ui/v2/ beside this file, and each app moves over in its own PR. A v1 token
     change that restyles every app is allowed only when every app CSS rule that depends on it is
     fixed in the same change (APPS-884).
   - Every text/background pair in the token blocks passes WCAG AA; the test lists the pairs.

   Proposal and decision record: https://powder24.atlassian.net/wiki/spaces/WTI/pages/505577475
   Reference page: https://apps.powder24.co.uk/p24-ui/ */

/* ── Fonts ──────────────────────────────────────────────────────────────────────────────────
   Geist and Geist Mono (SIL Open Font Licence 1.1, fonts/LICENSE.txt), served from this folder as
   variable fonts so every weight is one file. Area Normal Bold, the display face of powder24.co.uk,
   is the same file the website serves; Powder24 licenses it for its own sites, and fonts/LICENSE.txt
   does not cover it, so it is not for use outside Powder24 apps. font-display: swap shows the
   system font until a font arrives, so a slow font never blanks the page. */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Area Normal";
  src: url("fonts/AreaNormal-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens: light ──────────────────────────────────────────────────────────────────────────── */
:root {
  --p24-font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --p24-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Display headings: Area Normal Bold, as on powder24.co.uk, falling back to Geist. */
  --p24-font-display: "Area Normal", var(--p24-font-sans);

  /* The brand gradient, sampled from powder24.co.uk. Decoration and the brand button only. */
  --p24-cyan: #01bce1;
  --p24-violet: #ba7bca;
  --p24-pink: #ed7c99;
  --p24-amber: #fea904;
  --p24-gradient: linear-gradient(90deg, var(--p24-cyan), var(--p24-violet) 35%, var(--p24-pink) 60%, var(--p24-amber));

  /* Light only, on a white page (APPS-2647): cards keep their 1px line, so they still stand apart. */
  --p24-bg: #ffffff;
  --p24-surface: #ffffff;
  --p24-surface-sunk: #eeeff1;
  --p24-ink: #0a0a0a;
  --p24-ink-muted: #5b5f67;
  --p24-line: #e3e4e8;
  --p24-line-strong: #cdd0d6;
  /* Form-control borders are a non-text boundary, so they need 3:1 against the surface. */
  --p24-line-input: #8a8f98;
  --p24-focus: #0a0a0a;
  /* Table tints (APPS-885): a group header row, and the row under the pointer, each set apart from
     the column header, which sits on the surface. Hover is the lighter of the two. */
  --p24-table-group-bg: #eeeff1;
  --p24-table-hover-bg: #f7f8f9;
  /* The header's colours: a white bar with a 1px line above the gradient hairline. The chrome tokens mean the header's colours and nothing
     else; an app wanting black uses the inverse tokens below. The wordmark file is white, so the
     filter renders it black on the light bar (APPS-884). */
  --p24-chrome: #ffffff;
  --p24-chrome-ink: #0a0a0a;
  --p24-chrome-muted: #5b5f67;
  --p24-chrome-line: #e3e4e8;
  --p24-wordmark-filter: brightness(0);
  /* Toasts and floating tips: a white card. */
  --p24-toast-bg: #ffffff;
  /* A black for the inverse card and any app's black panel. */
  --p24-inverse: #000000;
  --p24-inverse-ink: #ffffff;

  /* Gradient heading text. The site's own stops are too pale to read on a light page (cyan is
     2.3:1 on white), so the heading uses the same hues darkened to pass as large text. */
  --p24-text-gradient: linear-gradient(90deg, #0a7f9c, #9150a6 35%, #c2456a 60%, #a86700);

  /* Primary action: black pill, white label. */
  --p24-primary-bg: #0a0a0a;
  --p24-primary-ink: #ffffff;
  --p24-primary-hover: #2a2b2e;

  /* Status: text colour plus a pale background, for meaning only — never decoration. */
  --p24-success: #1c6b43;
  --p24-success-bg: #e5f2eb;
  --p24-warning: #8a5300;
  --p24-warning-bg: #fbf0dc;
  --p24-danger: #a8231c;
  --p24-danger-bg: #fbe8e6;
  --p24-info: #1f5a78;
  --p24-info-bg: #e4eff5;
  --p24-neutral: #4a4f57;
  --p24-neutral-bg: #eceef1;
  --p24-danger-solid: #a8231c;
  --p24-danger-solid-ink: #ffffff;

  /* 1280px: above it the page stops growing, so a few columns never stretch thin. A data-heavy
     page uses .p24-wrap--full, or sets this token on its own :root (APPS-886). */
  --p24-page-max: 1280px;
  --p24-gutter: clamp(16px, 2.5vw, 32px);
  --p24-measure: 70ch;
  --p24-header-height: 56px;

  --p24-radius-card: 16px;
  --p24-radius-input: 8px;
  --p24-radius-small: 4px;
  --p24-radius-pill: 999px;

  --p24-space-1: 0.25rem;
  --p24-space-2: 0.5rem;
  --p24-space-3: 0.75rem;
  --p24-space-4: 1rem;
  --p24-space-5: 1.5rem;
  --p24-space-6: 2rem;
  --p24-space-7: 3rem;

  /* The page rhythm: between sections, from a heading to its content, and between stacked blocks
     and notices. Literals rather than the scale above, so a reader of the token sees the number.
     (APPS-886). Gaps inside a
     component — card padding, button clusters, form fields, table cells — are not rhythm. */
  --p24-space-section: 3rem;
  --p24-space-heading: 1rem;
  --p24-space-block: 1rem;

  /* The smallest text: 13px. Nothing in p24-ui is set smaller (APPS-886). */
  --p24-text-xs: 0.8125rem;
  --p24-text-sm: 0.875rem;
  --p24-text-md: 1rem;
  --p24-text-lg: 1.125rem;
  --p24-text-xl: 1.5rem;
  --p24-text-2xl: 2rem;
  --p24-text-3xl: 3rem;

  --p24-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --p24-shadow-raised: 0 8px 28px rgba(0, 0, 0, 0.14);

  color-scheme: light;
}

/* ── Light only ──────────────────────────────────────────────────────────────────────────────
   p24-ui is light only (APPS-2647): there is no dark theme, and the computer's dark-mode setting
   never switches the tokens, so an app's own CSS never needs a prefers-color-scheme rule. */

/* ── Base ─────────────────────────────────────────────────────────────────────────────────────
   Opt in with <body class="p24-body">. Everything below is scoped to its own class. */
.p24-body {
  margin: 0;
  min-height: 100vh;
  background: var(--p24-bg);
  color: var(--p24-ink);
  font-family: var(--p24-font-sans);
  font-size: var(--p24-text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.p24-body *,
.p24-body *::before,
.p24-body *::after { box-sizing: border-box; }

/* The layout default (APPS-2647): page content sits in a .p24-wrap of the same kind as the
   header's, so its left edge lines up with the wordmark; a full-width page uses .p24-wrap--full on
   both. Cap reading width on the content inside (max-width: var(--p24-measure)), never by
   narrowing or centring the wrap. The gutter grows to clear a notched screen's edges. */
.p24-wrap {
  width: 100%;
  max-width: var(--p24-page-max);
  margin-inline: auto;
  padding-inline: max(var(--p24-gutter), env(safe-area-inset-left)) max(var(--p24-gutter), env(safe-area-inset-right));
}
/* Pages that are mostly tables and data use the whole screen. */
.p24-wrap--full { max-width: none; }

.p24-main { padding-block: var(--p24-space-6) var(--p24-space-7); }

/* ── Header ───────────────────────────────────────────────────────────────────────────────────
   A compact white bar on every app: wordmark
   and app name left, text links right, a 1px line inside its bottom edge, finished with the brand
   gradient as a hairline. An app wanting a coloured bar of its own sets the chrome tokens on its
   .p24-header, as the live (production) bars do. */
.p24-header {
  background: var(--p24-chrome);
  color: var(--p24-chrome-ink);
  border-bottom: 3px solid transparent;
  border-image: var(--p24-gradient) 1;
  box-shadow: inset 0 -1px 0 var(--p24-chrome-line);
}
.p24-header__inner {
  display: flex;
  align-items: center;
  gap: var(--p24-space-3) var(--p24-space-5);
  min-height: var(--p24-header-height);
  flex-wrap: wrap;
}
.p24-header__brand {
  display: flex;
  align-items: center;
  gap: var(--p24-space-3);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.p24-wordmark { display: block; height: 22px; width: auto; flex: none; }
/* The wordmark file is white, so the filter renders it black on the white bar. Only inside a header,
   so a wordmark elsewhere stays as it is. A wordmark that fails to load shows its alt text, which
   the filter darkens the same way. */
.p24-header .p24-wordmark { filter: var(--p24-wordmark-filter); }
/* Windows high contrast: the mark follows the system's own background. */
@media (forced-colors: active) {
  .p24-header .p24-wordmark { filter: brightness(0); }
}
@media (forced-colors: active) and (prefers-color-scheme: dark) {
  .p24-header .p24-wordmark { filter: none; }
}
.p24-header__app {
  font-family: var(--p24-font-sans);
  font-size: var(--p24-text-md);
  font-weight: 500;
  color: var(--p24-chrome-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p24-header__nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--p24-space-2) var(--p24-space-5);
  list-style: none;
  padding: 0;
  margin-block: 0;
}
.p24-header__nav a,
.p24-header__link {
  color: var(--p24-chrome-ink);
  text-decoration: none;
  font-size: var(--p24-text-md);
  font-weight: 500;
  border-radius: var(--p24-radius-small);
}
.p24-header__nav a:hover,
.p24-header__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.p24-header__nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.p24-header__nav a:focus-visible,
.p24-header__link:focus-visible,
.p24-header__brand:focus-visible { outline: 2px solid var(--p24-chrome-ink); outline-offset: 3px; }

/* ── Header slots ─────────────────────────────────────────────────────────────────────────────
   The same bar in every app. Markup, in order, each slot but the brand optional:
     <header class="p24-header"><div class="p24-wrap p24-header__inner">
       <span class="p24-header__brand">
         <a class="p24-header__home" href="https://apps.powder24.co.uk/" aria-label="Powder24 Apps"><img class="p24-wordmark" …alt="Powder24"></a>
         <span class="p24-header__app">App name</span>
         <span class="p24-live-marker" title="…">LIVE</span>   (optional, the live copy only: Live marker below)
       </span>
       <ul class="p24-header__nav">…in-page sections…</ul>
       <div class="p24-header__tools">
         <nav class="p24-header__links" aria-label="App links">
           <a class="p24-header__link" href="…" target="_blank" rel="noopener">Documentation</a>
           <a class="p24-header__link" href="…" target="_blank" rel="noopener">Dashboard</a>
         </nav>
         <span class="p24-header__identity" title="Name"><span class="p24-visually-hidden">Signed in as </span>Name</span>
       </div>
     </div></header>
   An absent slot is an absent element, never an empty one. An identity a script fills after load
   may ship with the hidden attribute, so no rule here declares display on .p24-header__identity. */
.p24-header__home {
  display: flex;
  align-items: center;
  flex: none;
  color: inherit;
  border-radius: var(--p24-radius-small);
}
.p24-header__home:focus-visible { outline: 2px solid var(--p24-chrome-ink); outline-offset: 3px; }
/* The end-of-bar group: the app's links, then the identity. It sits at the right edge; after an
   in-page nav it drops its own auto margin, so the nav's carries both and the two sit together. */
.p24-header__tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--p24-space-2) var(--p24-space-3);
}
.p24-header__nav + .p24-header__tools { margin-left: 0; }
.p24-header__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--p24-space-2) var(--p24-space-5);
}
/* The signed-in name only: cut with an ellipsis at a fixed width, the full name on its title. */
.p24-header__identity {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--p24-chrome-muted);
  font-size: var(--p24-text-md);
}
/* The hairline between the links and the name, drawn only when both are present. */
.p24-header__links + .p24-header__identity {
  border-left: 1px solid var(--p24-chrome-muted);
  padding-left: var(--p24-space-3);
  margin-left: var(--p24-space-2);
}

/* ── Footer ───────────────────────────────────────────────────────────────────────────────────── */
.p24-footer {
  border-top: 1px solid var(--p24-line-strong);
  padding-block: var(--p24-space-5) var(--p24-space-7);
  color: var(--p24-ink-muted);
  font-size: var(--p24-text-sm);
}
.p24-footer p { margin: 0 0 var(--p24-space-2); max-width: var(--p24-measure); }

/* ── Type ───────────────────────────────────────────────────────────────────────────────────── */
.p24-h1,
.p24-h2,
.p24-h3,
.p24-h4 { margin: 0 0 var(--p24-space-heading); color: var(--p24-ink); }
.p24-h1 {
  font-family: var(--p24-font-display);
  font-size: clamp(2rem, 1.4rem + 2vw, var(--p24-text-3xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.p24-h2 {
  font-family: var(--p24-font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, var(--p24-text-2xl));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.p24-h3 { font-size: var(--p24-text-lg); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.p24-h4 { font-size: var(--p24-text-md); font-weight: 600; line-height: 1.35; }
/* Section headings in the brand gradient, as on the site. */
/* fit-content so the gradient spans the words, not the whole row a block heading occupies. */
.p24-text-gradient {
  width: fit-content;
  max-width: 100%;
  background: var(--p24-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (forced-colors: active) {
  .p24-text-gradient { background: none; color: CanvasText; }
}

.p24-prose { max-width: var(--p24-measure); }
.p24-prose > * + * { margin-top: var(--p24-space-block); }
.p24-lede { font-size: var(--p24-text-lg); font-weight: 400; color: var(--p24-ink-muted); max-width: var(--p24-measure); margin: 0; }
.p24-muted { color: var(--p24-ink-muted); }
.p24-small { font-size: var(--p24-text-sm); }
.p24-mono { font-family: var(--p24-font-mono); }
.p24-num { font-variant-numeric: tabular-nums; }

/* Large figures: Geist Mono ExtraLight, as the site sets its "100". */
.p24-figure {
  display: block;
  font-family: var(--p24-font-mono);
  font-weight: 200;
  font-size: clamp(2.5rem, 1.8rem + 2.5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.p24-figure__label { display: block; margin-top: var(--p24-space-2); font-size: var(--p24-text-sm); font-weight: 500; color: var(--p24-ink-muted); }

.p24-link { color: var(--p24-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.p24-link:hover { text-decoration-thickness: 2px; }

.p24-code {
  font-family: var(--p24-font-mono);
  font-size: max(0.875em, var(--p24-text-xs));
  background: var(--p24-surface-sunk);
  border-radius: var(--p24-radius-small);
  padding: 0.1em 0.35em;
}
.p24-pre {
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-sm);
  background: var(--p24-surface-sunk);
  border-radius: var(--p24-radius-input);
  padding: var(--p24-space-4);
  overflow-x: auto;
  margin: 0;
}

.p24-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Layout helpers ───────────────────────────────────────────────────────────────────────────── */
.p24-stack { display: flex; flex-direction: column; gap: var(--p24-space-block); }
/* A stack is a flex column, so a heading's own bottom margin would add to the gap: the gap alone is
   the heading-to-content distance. */
.p24-stack > .p24-h1,
.p24-stack > .p24-h2,
.p24-stack > .p24-h3,
.p24-stack > .p24-h4 { margin-bottom: 0; }
.p24-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--p24-space-2) var(--p24-space-3); }
.p24-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--p24-space-4); }
/* Half the section rhythm above and below, so two adjacent sections sit 48px apart in any flow. */
.p24-section { padding-block: calc(var(--p24-space-section) / 2); }
.p24-divider { border: 0; border-top: 1px solid var(--p24-line-strong); margin: var(--p24-space-5) 0; }

/* ── Buttons ──────────────────────────────────────────────────────────────────────────────────
   Pills with Geist Mono labels. --primary (black) for everyday actions; --brand (the gradient) for
   the one main action on a page. The brand label is black: white fails contrast on the gradient. */
.p24-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--p24-space-2);
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-sm);
  font-weight: 500;
  line-height: 1.2;
  padding: 0.625rem 1.25rem;
  min-height: 40px;
  border-radius: var(--p24-radius-pill);
  border: 1px solid var(--p24-line-strong);
  background: var(--p24-surface);
  color: var(--p24-ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.p24-btn:hover { border-color: var(--p24-ink); }
.p24-btn:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-btn:disabled,
.p24-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.p24-btn--primary { background: var(--p24-primary-bg); color: var(--p24-primary-ink); border-color: var(--p24-primary-bg); }
.p24-btn--primary:hover { background: var(--p24-primary-hover); border-color: var(--p24-primary-hover); }
.p24-btn--brand { background: var(--p24-gradient); color: #000000; border-color: transparent; font-weight: 600; }
.p24-btn--brand:hover { box-shadow: 0 0 0 2px var(--p24-bg), 0 0 0 3px var(--p24-ink); border-color: transparent; }
.p24-btn--secondary { background: var(--p24-surface); color: var(--p24-ink); border-color: var(--p24-line-strong); }
.p24-btn--danger { background: var(--p24-danger-solid); color: var(--p24-danger-solid-ink); border-color: var(--p24-danger-solid); }
.p24-btn--danger:hover { border-color: var(--p24-ink); }
.p24-btn--ghost { background: transparent; border-color: transparent; }
.p24-btn--ghost:hover { background: var(--p24-surface-sunk); border-color: transparent; }
.p24-btn--sm { font-size: var(--p24-text-xs); padding: 0.375rem 0.875rem; min-height: 32px; }
.p24-btn--lg { font-size: var(--p24-text-md); padding: 0.875rem 2rem; min-height: 52px; }

/* ── Forms ────────────────────────────────────────────────────────────────────────────────────
   8px boxes, labels above fields, one error style. The pill shape is kept for search boxes. */
.p24-field { display: flex; flex-direction: column; gap: var(--p24-space-1); min-width: 0; }
.p24-label { font-size: var(--p24-text-sm); font-weight: 600; color: var(--p24-ink); }
.p24-hint { font-size: var(--p24-text-xs); color: var(--p24-ink-muted); }
.p24-error { font-size: var(--p24-text-xs); font-weight: 500; color: var(--p24-danger); }

.p24-input,
.p24-select,
.p24-textarea {
  font: inherit;
  font-size: var(--p24-text-sm);
  color: var(--p24-ink);
  background: var(--p24-surface);
  border: 1px solid var(--p24-line-input);
  border-radius: var(--p24-radius-input);
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  width: 100%;
  max-width: 100%;
}
.p24-textarea { min-height: 6rem; resize: vertical; line-height: 1.45; }
.p24-select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.p24-input::placeholder,
.p24-textarea::placeholder { color: var(--p24-ink-muted); opacity: 1; }
.p24-input:focus-visible,
.p24-select:focus-visible,
.p24-textarea:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 1px; border-color: var(--p24-ink); }
.p24-input[aria-invalid="true"],
.p24-select[aria-invalid="true"],
.p24-textarea[aria-invalid="true"] { border-color: var(--p24-danger); }
.p24-input:disabled,
.p24-select:disabled,
.p24-textarea:disabled { background: var(--p24-surface-sunk); color: var(--p24-ink-muted); cursor: not-allowed; }
.p24-input--search { border-radius: var(--p24-radius-pill); padding-inline: 1rem; }

.p24-check { display: inline-flex; align-items: center; gap: var(--p24-space-2); font-size: var(--p24-text-sm); cursor: pointer; }
.p24-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--p24-ink); }
.p24-check input:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }

.p24-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--p24-space-4); align-items: end; }

/* ── Cards ────────────────────────────────────────────────────────────────────────────────────── */
.p24-card {
  background: var(--p24-surface);
  border: 1px solid var(--p24-line);
  border-radius: var(--p24-radius-card);
  padding: var(--p24-space-5);
  box-shadow: var(--p24-shadow);
  min-width: 0;
}
.p24-card--interactive { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.p24-card--interactive:hover { border-color: var(--p24-line-strong); box-shadow: var(--p24-shadow-raised); }
.p24-card--sunk { background: var(--p24-surface-sunk); border-color: transparent; box-shadow: none; }
/* A card in the black of the site's own panels. */
.p24-card--inverse { background: var(--p24-inverse); color: var(--p24-inverse-ink); border-color: var(--p24-inverse); }

/* ── Chips and badges ─────────────────────────────────────────────────────────────────────────── */
.p24-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--p24-space-1);
  font-size: var(--p24-text-sm);
  line-height: 1.2;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--p24-line-strong);
  border-radius: var(--p24-radius-pill);
  background: var(--p24-surface);
  color: var(--p24-ink);
  text-decoration: none;
  white-space: nowrap;
}
a.p24-chip:hover,
button.p24-chip:hover { border-color: var(--p24-ink); }
.p24-chip:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-chip[aria-pressed="true"],
.p24-chip[aria-current="true"] { background: var(--p24-primary-bg); color: var(--p24-primary-ink); border-color: var(--p24-primary-bg); }
.p24-chip--muted { color: var(--p24-ink-muted); border-style: dashed; background: transparent; }

.p24-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-xs);
  font-weight: 500;
  line-height: 1.2;
  padding: 0.15rem 0.5rem;
  border-radius: var(--p24-radius-pill);
  background: var(--p24-neutral-bg);
  color: var(--p24-neutral);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.p24-badge--success { background: var(--p24-success-bg); color: var(--p24-success); }
.p24-badge--warning { background: var(--p24-warning-bg); color: var(--p24-warning); }
.p24-badge--danger { background: var(--p24-danger-bg); color: var(--p24-danger); }
.p24-badge--info { background: var(--p24-info-bg); color: var(--p24-info); }
.p24-badge--neutral { background: var(--p24-neutral-bg); color: var(--p24-neutral); }

/* ── Status ───────────────────────────────────────────────────────────────────────────────────
   A dot never carries meaning alone: pair it with text (visible or visually hidden). */
.p24-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--p24-neutral); flex: none; }
.p24-dot--up { background: var(--p24-success); }
.p24-dot--down { background: var(--p24-danger); }
.p24-dot--warn { background: var(--p24-warning); }
.p24-dot--none { background: var(--p24-line-strong); }

.p24-status { font-size: var(--p24-text-sm); font-weight: 500; }
.p24-status--success { color: var(--p24-success); }
.p24-status--warning { color: var(--p24-warning); }
.p24-status--danger { color: var(--p24-danger); }
.p24-status--info { color: var(--p24-info); }
.p24-status--neutral { color: var(--p24-neutral); }

/* ── Tables ───────────────────────────────────────────────────────────────────────────────────
   Roomy rows by default — cells middle-aligned, 12px by 16px padding — with .p24-table--compact
   for dense data screens. No stripes, numbers right-aligned. Column headers are small muted
   upper-case labels on the surface over a firmer rule; group header rows and the row under the
   pointer each take their own tint, so the three are told apart. The header row sticks to the top
   of the page when the table is not wrapped, or to the top of .p24-table-wrap--scroll when it is.
   Put every table in a .p24-table-wrap: a long cell wraps, and a table wider than its frame
   scrolls sideways inside the wrap rather than widening the page (APPS-885). */
.p24-table-wrap {
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--p24-line);
  border-radius: var(--p24-radius-input);
  background: var(--p24-surface);
}
.p24-table-wrap--scroll { overflow: auto; max-height: 70vh; }
.p24-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--p24-text-sm);
  background: var(--p24-surface);
  color: var(--p24-ink);
}
.p24-table caption { caption-side: top; text-align: left; padding: var(--p24-space-3) var(--p24-space-4); font-weight: 600; }
.p24-table th,
.p24-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--p24-line);
}
.p24-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--p24-surface);
  color: var(--p24-ink-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 2px solid var(--p24-line-strong);
}
.p24-table tbody tr:last-child > * { border-bottom: 0; }
.p24-table tbody tr:not(.p24-group__head):hover > * { background: var(--p24-table-hover-bg); }
.p24-table .p24-num,
.p24-table th.p24-num { text-align: right; font-variant-numeric: tabular-nums; }
.p24-table--compact th,
.p24-table--compact td { padding: 0.3rem 0.6rem; }
.p24-table--wrap-none td { white-space: nowrap; }

/* Sortable columns: a button inside the th; the th carries aria-sort. */
.p24-sort {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  cursor: pointer;
  font-weight: 600;
  border-radius: var(--p24-radius-small);
}
.p24-sort::after { content: "↕"; font-size: max(0.85em, var(--p24-text-xs)); color: var(--p24-ink-muted); }
.p24-sort:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-table th[aria-sort="ascending"] .p24-sort::after { content: "↑"; color: var(--p24-ink); }
.p24-table th[aria-sort="descending"] .p24-sort::after { content: "↓"; color: var(--p24-ink); }

/* ── Grouped tables ───────────────────────────────────────────────────────────────────────────
   One .p24-table whose rows sit under full-width group headers that open and close. Markup:
   one <tbody class="p24-group"> per group; its first row is <tr class="p24-group__head"> with a
   single <th scope="rowgroup" colspan="<columns>">, holding a .p24-group__bar with a
   <button class="p24-group__toggle" aria-expanded="true|false"> (the open/close control, with
   the group's name in .p24-group__name inside it), then an optional small .p24-group__link and a
   .p24-group__count. A closed group carries .p24-group--collapsed on its tbody, which hides every
   row but the header. p24-ui ships no script: the app's own click handler flips aria-expanded and
   the class together, as the reference page shows. */
.p24-group__head > th,
.p24-group__head > td {
  padding: 0.25rem 1rem;
  vertical-align: middle;
  background: var(--p24-table-group-bg);
  border-top: 1px solid var(--p24-line-strong);
  border-bottom: 1px solid var(--p24-line);
  font-weight: 600;
}
/* In a compact table the group header lines up with the compact cells. */
.p24-table--compact .p24-group__head > th,
.p24-table--compact .p24-group__head > td { padding-inline: 0.6rem; }
/* The first group sits under the column headers, which already draw the line above it. */
.p24-table .p24-group:first-of-type > .p24-group__head > * { border-top: 0; }
.p24-table .p24-group--collapsed > tr:not(.p24-group__head) { display: none; }
/* A closed group is its header alone; the next group's header draws the line between them. */
.p24-table .p24-group--collapsed > .p24-group__head > * { border-bottom: 0; }
.p24-group__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--p24-space-1) var(--p24-space-3);
  min-width: 0;
}
.p24-group__toggle {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: var(--p24-space-2);
  min-height: 36px;
  padding: 0 var(--p24-space-2) 0 0;
  cursor: pointer;
  color: var(--p24-ink);
  font-size: var(--p24-text-sm);
  font-weight: 600;
  border-radius: var(--p24-radius-small);
}
/* The open/close mark: a 28px circle with a chevron, pointing down when open, right when closed. */
.p24-group__toggle::before {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--p24-line-input);
  background-color: var(--p24-surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--p24-ink) 50%), linear-gradient(135deg, var(--p24-ink) 50%, transparent 50%);
  background-position: calc(50% - 3px) 55%, calc(50% + 3px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: transform 0.15s ease;
}
.p24-group__toggle[aria-expanded="false"]::before { transform: rotate(-90deg); }
.p24-group__toggle:hover::before { border-color: var(--p24-ink); }
.p24-group__toggle:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-group__name { min-width: 0; }
.p24-group__link {
  font-size: var(--p24-text-xs);
  font-weight: 500;
  color: var(--p24-ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: var(--p24-radius-small);
}
.p24-group__link:hover { color: var(--p24-ink); }
.p24-group__link:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-group__count {
  margin-left: auto;
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-xs);
  font-weight: 500;
  color: var(--p24-ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Filter bar ───────────────────────────────────────────────────────────────────────────────
   A row of checkbox chips, each a label and a count, led by an "All" chip. Each chip is a
   .p24-check label wrapping a real <input type="checkbox">, so the bar is a set of checkboxes to
   the keyboard (Tab, Space) and to a screen reader. Markup: <div class="p24-filter-bar"
   role="group" aria-label="…">, then <label class="p24-check p24-filter p24-filter--all"> for
   All and <label class="p24-check p24-filter"> for each value, each with its count in
   .p24-filter__count. The app's script keeps All checked when every value is, unchecked when
   none is, and indeterminate in between, as the reference page shows. */
.p24-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--p24-space-2); }
.p24-filter {
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--p24-line-strong);
  border-radius: var(--p24-radius-pill);
  background: var(--p24-surface);
  color: var(--p24-ink);
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
}
.p24-filter:hover { border-color: var(--p24-ink); }
.p24-filter:has(input:checked),
.p24-filter:has(input:indeterminate) { border-color: var(--p24-ink); background: var(--p24-surface-sunk); }
.p24-filter:has(input:checked) { font-weight: 600; }
/* Where the browser supports :has(), the focus ring goes round the whole chip instead of the box. */
@supports selector(:has(*)) {
  .p24-filter:has(input:focus-visible) { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
  .p24-filter input:focus-visible { outline: none; }
}
.p24-filter:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.p24-filter--all { font-weight: 600; }
.p24-filter__count {
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-xs);
  font-weight: 500;
  color: var(--p24-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────────────────────────
   role="tablist" on .p24-tabs, role="tab" + aria-selected on each .p24-tab. */
.p24-tabs {
  display: flex;
  gap: var(--p24-space-1);
  border-bottom: 1px solid var(--p24-line-strong);
  overflow-x: auto;
  scrollbar-width: thin;
}
.p24-tab {
  all: unset;
  position: relative;
  padding: 0.6rem 0.9rem;
  font-size: var(--p24-text-sm);
  font-weight: 500;
  color: var(--p24-ink-muted);
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--p24-radius-small) var(--p24-radius-small) 0 0;
}
.p24-tab:hover { color: var(--p24-ink); }
.p24-tab:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: -2px; }
.p24-tab[aria-selected="true"],
.p24-tab[aria-current="page"] { color: var(--p24-ink); font-weight: 600; }
.p24-tab[aria-selected="true"]::after,
.p24-tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--p24-gradient);
  border-radius: 2px;
}

/* ── Notices and toasts ───────────────────────────────────────────────────────────────────────── */
.p24-notice {
  display: flex;
  gap: var(--p24-space-3);
  align-items: flex-start;
  padding: var(--p24-space-3) var(--p24-space-4);
  border-radius: var(--p24-radius-input);
  /* A coloured left edge on the status tint: the edge is the status text colour (APPS-886). */
  border: 0;
  border-left: 4px solid currentColor;
  font-size: var(--p24-text-sm);
  background: var(--p24-neutral-bg);
  color: var(--p24-neutral);
}
.p24-notice > :first-child { margin-top: 0; }
.p24-notice > :last-child { margin-bottom: 0; }
.p24-notice strong { font-weight: 600; }
.p24-notice--success { background: var(--p24-success-bg); color: var(--p24-success); }
.p24-notice--warning { background: var(--p24-warning-bg); color: var(--p24-warning); }
.p24-notice--danger { background: var(--p24-danger-bg); color: var(--p24-danger); }
.p24-notice--info { background: var(--p24-info-bg); color: var(--p24-info); }
/* Forced colours discard the tint, so the notice gets a 1px outline back to keep its box. */
@media (forced-colors: active) {
  .p24-notice { border: 1px solid CanvasText; border-left: 4px solid CanvasText; }
}

/* A fixed stack in the bottom-right; give it role="status" (or "alert" for errors). Each toast is a
   white card with its status as a coloured left edge; secondary text in it
   takes .p24-muted. */
.p24-toast-region {
  position: fixed;
  right: var(--p24-gutter);
  bottom: var(--p24-gutter);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--p24-space-2);
  max-width: min(420px, calc(100vw - 2 * var(--p24-gutter)));
}
.p24-toast {
  display: flex;
  gap: var(--p24-space-3);
  align-items: flex-start;
  padding: var(--p24-space-3) var(--p24-space-4);
  border-radius: var(--p24-radius-input);
  background: var(--p24-toast-bg);
  color: var(--p24-ink);
  border: 1px solid var(--p24-line-input);
  border-left: 4px solid var(--p24-neutral);
  box-shadow: var(--p24-shadow-raised);
  font-size: var(--p24-text-sm);
  animation: p24-toast-in 0.18s ease-out;
}
.p24-toast--success { border-left-color: var(--p24-success); }
.p24-toast--warning { border-left-color: var(--p24-warning); }
.p24-toast--danger { border-left-color: var(--p24-danger); }
.p24-toast--info { border-left-color: var(--p24-info); }
@keyframes p24-toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ── Live marker ──────────────────────────────────────────────────────────────────────────────
   Marks the live copy of an app whose live and demo copies look alike (APPS-1065): a small red tag
   reading LIVE. The word is in the markup, so it reads LIVE with no stylesheet. It reads no chrome
   token, so it stays legible on the p24 header, on an app's own bar and on any coloured live bar.
   In a p24 header it is the optional third child of .p24-header__brand, after the app name:
     <span class="p24-live-marker" title="…">LIVE</span> */
.p24-live-marker {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  padding: 0.15rem 0.5rem;
  border-radius: var(--p24-radius-small);
  /* Transparent until forced colours, which draw it so the tag keeps its box. */
  border: 1px solid transparent;
  white-space: nowrap;
  background: var(--p24-danger-solid);
  color: var(--p24-danger-solid-ink);
}

/* ── Mode banner ──────────────────────────────────────────────────────────────────────────────
   Marks every page of a copy that is not live (a demo or test copy) (APPS-1065): a full-width strip
   placed straight after the header, before <main>. Its content sits in a .p24-wrap, as the header's
   does, so the text lines up with the header; an uncapped page uses p24-wrap p24-wrap--full.
     <div class="p24-mode-banner" role="status"><div class="p24-wrap"><strong>DEMO.</strong> …</div></div> */
.p24-mode-banner {
  padding-block: var(--p24-space-2);
  background: var(--p24-warning-bg);
  color: var(--p24-warning);
  border-bottom: 1px solid currentColor;
  font-size: var(--p24-text-sm);
}
.p24-mode-banner strong { font-weight: 700; }

/* ── Spinner ──────────────────────────────────────────────────────────────────────────────────
   Give it role="status" and a visually hidden label ("Loading…"). */
.p24-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--p24-line-strong);
  border-top-color: var(--p24-ink);
  animation: p24-spin 0.8s linear infinite;
  vertical-align: middle;
  flex: none;
}
.p24-spinner--sm { width: 0.875rem; height: 0.875rem; }
.p24-spinner--lg { width: 2rem; height: 2rem; border-width: 3px; }
@keyframes p24-spin { to { transform: rotate(360deg); } }

/* ── Dialog ───────────────────────────────────────────────────────────────────────────────────
   Styles the browser's own <dialog>: open it with showModal() for focus trapping and Esc for free. */
.p24-dialog {
  border: 1px solid var(--p24-line);
  border-radius: var(--p24-radius-card);
  padding: 0;
  width: min(560px, calc(100vw - 2 * var(--p24-gutter)));
  max-height: calc(100vh - 2 * var(--p24-gutter));
  background: var(--p24-surface);
  color: var(--p24-ink);
  box-shadow: var(--p24-shadow-raised);
  font-family: var(--p24-font-sans);
}
.p24-dialog--wide { width: min(960px, calc(100vw - 2 * var(--p24-gutter))); }
.p24-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.p24-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--p24-space-3);
  padding: var(--p24-space-4) var(--p24-space-5);
  border-bottom: 1px solid var(--p24-line);
}
.p24-dialog__title { margin: 0; font-size: var(--p24-text-lg); font-weight: 700; }
.p24-dialog__body { padding: var(--p24-space-5); overflow: auto; }
.p24-dialog__foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--p24-space-2);
  padding: var(--p24-space-4) var(--p24-space-5);
  border-top: 1px solid var(--p24-line);
}

/* ── Tags ─────────────────────────────────────────────────────────────────────────────────────
   A pill naming an area of the system, for documentation and catalogue pages (APPS-2618). The text
   carries the meaning; the dot is a brand-colour cue only, so it is never the only sign of an area.
   A colour modifier sets --p24-tag-dot; with none the dot is the neutral status colour. */
.p24-tags { display: flex; flex-wrap: wrap; gap: var(--p24-space-2); }
.p24-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border: 1px solid var(--p24-line);
  border-radius: var(--p24-radius-pill);
  background: var(--p24-neutral-bg);
  color: var(--p24-ink);
  font-size: var(--p24-text-xs);
  font-weight: 500;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}
.p24-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p24-tag-dot, var(--p24-neutral));
  flex: none;
}
a.p24-tag:hover { border-color: var(--p24-line-strong); }
.p24-tag:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-tag--lg { font-size: var(--p24-text-md); padding: 4px 14px 4px 12px; }
.p24-tag__count { color: var(--p24-ink-muted); font-family: var(--p24-font-mono); font-variant-numeric: tabular-nums; }
.p24-tag--cyan { --p24-tag-dot: var(--p24-cyan); }
.p24-tag--violet { --p24-tag-dot: var(--p24-violet); }
.p24-tag--pink { --p24-tag-dot: var(--p24-pink); }
.p24-tag--amber { --p24-tag-dot: var(--p24-amber); }
.p24-tag--muted { --p24-tag-dot: var(--p24-ink-muted); }

/* ── Doc blocks ───────────────────────────────────────────────────────────────────────────────
   The fixed layout of a documentation page: each block a section with a small upper-case muted
   title under a rule, so every page reads in the same order (APPS-2618). The watch variant marks
   each list item with a warning sign. .p24-doc-defs is a term-and-meaning grid, one <div> per row
   holding a <dt> and a <dd>, stacking to one column on a phone. */
.p24-doc-block {
  display: grid;
  gap: var(--p24-space-2);
  padding-top: var(--p24-space-3);
  border-top: 1px solid var(--p24-line);
  min-width: 0;
}
.p24-doc-block__title {
  margin: 0;
  font-size: var(--p24-text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p24-ink-muted);
}
.p24-doc-block--watch li { list-style-type: "⚠ "; }
.p24-doc-block--watch li::marker { color: var(--p24-warning); }
.p24-doc-defs { display: grid; gap: var(--p24-space-2); margin: 0; }
.p24-doc-defs > div { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: var(--p24-space-3); }
.p24-doc-defs dt { font-weight: 600; }
.p24-doc-defs dd { margin: 0; }
@media (max-width: 34rem) {
  .p24-doc-defs > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ── Code blocks ──────────────────────────────────────────────────────────────────────────────
   A code sample as a <figure>: an optional caption with the language on the right, then a <pre>
   that scrolls sideways rather than widening the page (APPS-2618). Inline code is .p24-code. */
.p24-code-block { display: grid; gap: var(--p24-space-1); margin: 0; min-width: 0; }
.p24-code-block__caption {
  display: flex;
  justify-content: space-between;
  gap: var(--p24-space-2);
  font-size: var(--p24-text-sm);
  color: var(--p24-ink-muted);
}
.p24-code-block__lang { font-family: var(--p24-font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.p24-code-block pre {
  margin: 0;
  padding: var(--p24-space-3);
  background: var(--p24-surface-sunk);
  color: var(--p24-ink);
  border: 1px solid var(--p24-line);
  border-radius: var(--p24-radius-small);
  overflow-x: auto;
  font-family: var(--p24-font-mono);
  font-size: var(--p24-text-xs);
  line-height: 1.55;
}

/* ── Source card ──────────────────────────────────────────────────────────────────────────────
   The foot of a page written from another document: what it was written from, a muted meta line,
   and a button to open the original (APPS-2618). Used with .p24-card and .p24-card--sunk. */
.p24-source-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--p24-space-3);
  padding: var(--p24-space-3) var(--p24-space-4);
}
.p24-source-card p { margin: 0; }
.p24-source-card__title { font-weight: 600; }

/* ── Details ──────────────────────────────────────────────────────────────────────────────────
   A collapsible section on a <details>, for notes most readers can skip, such as notes for
   developers (APPS-2618). */
.p24-details {
  border: 1px solid var(--p24-line);
  border-radius: var(--p24-radius-small);
  padding: var(--p24-space-2) var(--p24-space-3);
}
.p24-details > summary { cursor: pointer; font-size: var(--p24-text-sm); font-weight: 600; }
.p24-details > summary:focus-visible { outline: 2px solid var(--p24-focus); outline-offset: 2px; }
.p24-details[open] > summary { margin-bottom: var(--p24-space-2); }

/* ── Motion ───────────────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .p24-spinner { animation-duration: 2.4s; }
  .p24-toast { animation: none; }
  .p24-btn,
  .p24-card--interactive,
  .p24-group__toggle::before { transition: none; }
}

/* ── Breakpoints: 800px and 1280px, as on powder24.co.uk ─────────────────────────────────────── */
@media (max-width: 799px) {
  .p24-header__inner { padding-block: var(--p24-space-2); }
  .p24-header__nav { margin-left: 0; width: 100%; }
  .p24-header__tools { margin-left: 0; width: 100%; }
  .p24-card { padding: var(--p24-space-4); }
  .p24-main { padding-block: var(--p24-space-5) var(--p24-space-6); }
  .p24-dialog__foot .p24-btn { flex: 1 1 auto; }
}
@media (min-width: 1280px) {
  .p24-grid { gap: var(--p24-space-5); }
}
