/* rastrillo/ui — design tokens and the component classes the shipped
   partials use (see ui_test.go's TestAllPartialsAreDefined for the
   current, authoritative list — deliberately not counted here, so this
   comment cannot go stale as the set grows).

   rastrillo new writes this file once into your app's static/ directory.
   From then on it is yours: edit it, replace it, delete rules you do not
   want. Nothing regenerates it, and rastrillo.Serve never serves it —
   your app's own static handler does.

   Every class, attribute and custom property is prefixed rst- — except
   the single .icon rule, which styles the class rastrillo.Icon emits —
   so dropping this file into an app with existing CSS has exactly one
   known collision surface. There are no imports, no remote assets and no webfont:
   this stylesheet fetches nothing, from anywhere, ever. That is a test,
   not a wish (ui_test.go, TestTokensCSSIsSelfContained) — which is also
   why this comment cannot spell those constructs out literally.

   ONE SPELLING. Every component is an rst- attribute: `[rst-btn]`,
   `[rst-btn~="primary"]`, `[rst-callout-body]`. 1.x also named each
   one's class twin (`.rst-btn--primary`, `.rst-callout__body`); 2.0
   does not, so markup written that way is not styled. Where the prose
   below names a component as .rst-name, read [rst-name].

   The grammar, so a rule you add follows it: the KIND is a bare
   attribute; a VARIANT is a token in that attribute's value, matched
   with ~= so `rst-btn="primary compact"` composes the way a class list
   does; a PART is its own flat attribute (`rst-callout-body`), never a
   value — the value slot means variant on every attribute or the
   grammar is unreadable; and rst-tone carries the four tones.

   Utilities keep the class spelling: rst-sr-only, rst-mono,
   rst-m-hide, rst-grow, rst-nm, rst-danger, rst-cell-mut. They are not
   kinds — they are cross-cutting styling, which is what class is for.
   check/spelling_test.go's TestOnlyTheUtilitiesKeepTheClassSpelling
   holds that.

      Colour, the type family and shape are not here: they live in
   themes/day.css (or whichever theme was scaffolded), which rastrillo new
   writes beside this file as static/theme.css. This file is structure —
   layout, spacing, the type scale, and the component classes, every one
   of them painted with var(--rst-*). Swap the theme file and the app
   changes palette, corner and depth; nothing here is touched.

   Radius and shadow used to live in the scale block below. They moved to
   the themes in v2, because a theme that can only change colour cannot
   change how an app feels: day is soft (8px/6px, wide low-alpha
   shadows), plain is nearly square (4px/3px, one hairline layer) and
   signal is milled (4px/2px, short dense shadows). tokens.css still
   paints with var(--rst-radius*) and var(--rst-shadow-*) everywhere; it
   just no longer decides what they are.

   Padding values are load-bearing for SC 2.5.8 Target Size (AA, new in
   WCAG 2.2): pagination chips measure about 30px, row action pills
   about 27px, and the button sizes about 26px (sm), 34px (default) and
   42px (lg) on their smaller axis, all clear of the 24px minimum. Do
   not shrink them without re-measuring; the button block shows the
   arithmetic.

   Type sizes are rem, not px, so the whole scale tracks a reader who has
   raised their browser's default font size. Spacing is rem for the same
   reason. Anything you add here should follow suit.
   ──────────────────────────────────────────────────────────────────── */

/* ── Scale: type and spacing. Theme-independent. Radius is not here —
      it is part of the theme's shape axis; see themes/. ────────────── */
:root {
  --rst-fs-lg: 1.0625rem;    /* 17px — the one step above base */
  --rst-fs-base: 0.875rem;   /* 14px at the browser default */
  --rst-fs-sm: 0.78125rem;   /* 12.5px */
  --rst-fs-xs: 0.71875rem;   /* 11.5px */

  --rst-sp-1: 0.25rem;
  --rst-sp-2: 0.5rem;
  --rst-sp-3: 0.75rem;
  --rst-sp-4: 1rem;
  --rst-sp-5: 1.5rem;
  --rst-sp-6: 2.5rem;

  /* The tap floor on small or touch screens: 44px at the default root,
     and it tracks a reader who raised their default size. Declared here
     so an app's own CSS can use it; only the touch query below reads
     it, so desktop density never sees it. */
  --rst-tap: 2.75rem;

  /* The target floor in force, which every control's floor at the end
     of this file reads: 32px on a desktop with a mouse, raised to
     --rst-tap by the touch query. One token rather than a second copy
     of the floor block, so a control cannot be floored on one kind of
     screen and forgotten on the other. */
  --rst-target: 2rem;

  /* The header strip at the top of a phone screen: the back strip on a
     content page, the index's header row, and the bar of a shell that
     has one. 56px at the default root, a mobile app's top bar, with
     the 44px target centred in it: the strip at the bare tap height
     read as cramped beside every native header. Border included, so
     the strip and the scroll padding that keeps a #fragment's heading
     out from under it are the same number, and a strip resized here
     cannot leave a heading half hidden. */
  --rst-shell-strip: 3.5rem;

  /* The list grid's kebab column. A variable rather than the literal
     32px the samples used to write, so the column can grow to a 44px
     kebab on touch screens (the touch block redefines it). An app that
     keeps a literal 32px still works: the kebab is justify-self: end,
     so it overflows 12px toward the inline start, into the grid's
     0.85rem gap, without reaching the cell beside it. */
  --rst-col-menu: 32px;

  /* The scrollbar's gutter, reserved whether or not there is a
     scrollbar in it, so a short page and a long one are the same width
     and clicking between them does not slide the layout sideways.

     A token rather than a class for three reasons: the opt-out is one
     line in your own stylesheet (--rst-scrollbar-gutter: auto), it
     layers like every other token, and custom properties are untouched
     by the markup migration, so this survives it without an edit.

     What it costs, chosen knowingly: a page too short to scroll now
     reserves the strip as well, so there is a thin empty band at the
     trailing edge where there was none. That is the price of never
     shifting. both-edges would double the band to keep centred content
     exactly centred, and was not taken: this system's pages are already
     a max-width column inside a wider ground, so the asymmetry does not
     land where it would be seen.

     Do not over-claim what it fixes. macOS overlay scrollbars take no
     layout space at all, so on a default Mac there was never anything
     to shift. This is real on Windows and Linux, on a Mac set to
     "always show scrollbars", and inside the design gallery's own
     preview iframes. Chrome 94+, Firefox 97+, Safari 18.2+; an older
     engine ignores the declaration and lands on the behaviour it has
     today. */
  --rst-scrollbar-gutter: stable;

  /* The light. light.js sets these from the hour (its FOLLOW flag,
     off, would ease them toward the pointer); without it they hold
     straight-above, which is the static design.
     Shadows fall away from the light by up to 1.5px across and 1.2px
     down; the top highlight leans toward it by up to 1px. */
  --rst-light-x: 0;
  --rst-light-y: -1;
  --rst-shadow-x: calc(var(--rst-light-x) * -1.5px);
  --rst-shadow-y: calc(1px + (var(--rst-light-y) + 1) * 0.6px);
  --rst-hl-x: calc(var(--rst-light-x) * 1px);
}

/* ── Small or touch screens: the type scale moves up one step ───────
   One query decides "a phone, a tablet, or a window too narrow to read
   at desktop density", and every touch-only rule in this file sits in
   it. pointer: coarse is the PRIMARY pointer, so a touchscreen laptop
   driven by its trackpad keeps desktop density; any-pointer would
   switch a mouse user's whole interface because a touchscreen exists.
   max-width: 40rem catches a narrow desktop window and the design
   gallery's 390px Mobile tab, a fine pointer showing what a phone
   shows (a rem in a media query is the browser's initial size, not the
   root's). The shells' 800px is a different axis: between 640 and
   800px under a mouse is a split window, which gets the narrow LAYOUT
   and keeps mouse DENSITY.

   The four tokens move and nothing else: the root size, the rem
   spacing and every px geometry stay, and controls grow because their
   text grows and because the floor block at the end of this file gives
   them a minimum box. Display sizes (page titles, stat numbers, avatar
   initials) stay literal on purpose, so a 22px title sits over 16px
   body text. ─────────────────────────────────────────────────────── */
@media (pointer: coarse), (max-width: 40rem) {
  :root {
    --rst-fs-lg: 1.1875rem;    /* 19px */
    --rst-fs-base: 1rem;       /* 16px */
    --rst-fs-sm: 0.875rem;     /* 14px */
    --rst-fs-xs: 0.8125rem;    /* 13px */
  }
}

/* ── Base. Three rules, so a freshly scaffolded app looks finished
      before it has any CSS of its own. Delete them if your app owns
      its own base styles. ──────────────────────────────────────────── */
/* The gutter is declared on the root element, which is where the
   viewport's scrollbar lives. It also fixes a second instance of the
   same bug that nobody had attributed to the scrollbar: the modal's
   scroll lock below (body:has(.rst-backdrop) { overflow: hidden })
   takes the scrollbar away the instant a modal opens, and without a
   reserved gutter the whole page slides sideways while the reader
   watches. One declaration, both cases. */
html {
  scrollbar-gutter: var(--rst-scrollbar-gutter);
}

body {
  margin: 0;
  background: var(--rst-bg);
  color: var(--rst-text);
  font-family: var(--rst-font);
  font-size: var(--rst-fs-base);
  line-height: 1.5;
}

/* The content column every screen sits in. Your page markup emits this;
   no partial does. 64rem, widened from 52rem after the v2 page went
   live: 52rem is a reading measure, and this column holds list grids
   and side-by-side form fields, which a reading measure squeezes. */
[rst-page] {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 64rem;
  padding: var(--rst-sp-5) var(--rst-sp-4) var(--rst-sp-6);
}

/* rastrillo.Icon emits class="icon" with no width or height, so the icon
   sizes from here and tracks the text beside it: an icon in a heading
   is the heading's size, one in a line of prose the line's. */
.icon {
  block-size: 1em;
  flex: none;
  inline-size: 1em;
}
/* Inside a control an icon is 16px, whatever text sits beside it.
   Sized from the font, icons in controls came out anywhere from 9 to
   20px (a caret in a small summary, a menu icon in a big button), so
   two icons in one toolbar disagreed. The controls are the ones the
   target floor at the end of this file holds; a control added there
   belongs here too. :where() keeps this at .icon's own weight, so a
   component that sizes its icon (the 12px caret, .rst-caret) still
   wins. Not the list grid's title: it is the row's name, text that an
   icon should follow, and the row is its target. */
:where([rst-btn], [rst-help], [rst-row-action], [rst-choice-cards] label, [rst-back-nav] a) .icon {
  block-size: 1rem;
  inline-size: 1rem;
}

/* Focus is visible everywhere inside the app column (.rst-page) and
   inside any component rendered outside one. :where() contributes no
   specificity, so any rule below can override it. The side nav is
   here because a page may put one outside an rst-page, as the
   landing page's sample does, and its links would show the browser's
   thin ring there. */
:where([rst-page], [rst-page-header], [rst-list], [rst-lbar], [rst-empty]) :focus-visible {
  outline: 2px solid var(--rst-accent);
  outline-offset: 2px;
}


/* A press is a number so a release can fade it: a gradient cannot
   transition, a registered number inside one can. */
@property --rst-press { syntax: "<number>"; inherits: false; initial-value: 0; }

/* The hover tint's own number, and the press's. A row, a tile and a
   rail item fade their tint in on hover; when that fade was a
   background-color transition, a scheme change while one was hovered
   retargeted it, and the one item under the pointer took a quarter of
   a second to reach the new scheme while its text changed at once
   (Astra A3). What eases now is a percentage: the tint, the lift's
   shadows and the press are re-resolved from it every frame, so the
   colours come from the current scheme and the flip lands on the next
   frame with no script's help. Two numbers, so a release still eases
   from the press tint back to the hover tint. Every rule that reads
   them sets both: without @property (Firefox before 128) an unset
   var() invalidates the whole declaration, and a hover that set only
   --rst-hover lost its background until pressed. */
@property --rst-hover { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --rst-pressed { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* A card's light is registered so it does not inherit: unregistered, a
   write of --rst-card-x on a card of 500 rows restyled all 1,500
   descendants, 16ms a frame while the pointer moved, and nothing below
   a card reads these. */
@property --rst-card-x { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }
@property --rst-card-y { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }
@property --rst-card-lit { syntax: "<number>"; inherits: false; initial-value: 0; }

/* ── Buttons: page-header's primary action, empty-state's CTA. ────── */
/* Every variant composes its own rest, hover, press, focus, disabled
   and busy from named tokens, in this order, at one specificity, so
   the cascade never decides a state. The press rules come last. Every
   token is read through a fallback that is today's value, so a theme
   written before the axis renders as it did. A filled button's hover
   reads its own hover fill: a filter on the fill scaled the label too,
   and an earlier hover rule once won the label back to the accent on
   the red fill at 1.05:1, at the moment a reader committed to a
   delete. The face is four background layers: the sheen, the press
   spot, the press wash, the face shade. The press is instant and the
   release fades over 0.7s through --rst-press; the strengths are
   per-scheme number tokens composed as rgb(0 0 0 / calc(press *
   strength)), because a color-mix() whose percentage carried
   calc(var()) blanked every button in Safari. The sheen is on while
   hovered and not pressed, and only where a pointer can hover.

   border-box because rst-btn goes on <a> as often as on <button>, and
   only <button> is border-box by the browser's own stylesheet: a block
   link-button's width: 100% came out its padding and border wider than
   its column, and poked past the sign-in card on a phone. */
[rst-btn] {
  --rst-mx: 50%;
  --rst-my: -40%;
  --rst-px: 50%;
  --rst-py: 50%;
  --rst-btn-sheen: none;
  --rst-btn-face: none;
  --rst-btn-wash: var(--rst-press-wash-plain, 0);
  --rst-btn-spot: var(--rst-press-spot-plain, 0);
  align-items: center;
  background-color: var(--rst-control-face, var(--rst-surface));
  /* --rst-press is read with a 0 fallback: an engine without @property
     has no initial value for it, and an unset var() inside a gradient
     invalidates the whole background-image, face shade included. */
  background-image: var(--rst-btn-sheen), radial-gradient(70px circle at var(--rst-px) var(--rst-py), rgb(0 0 0 / calc(var(--rst-press, 0) * var(--rst-btn-spot))), transparent 75%), linear-gradient(rgb(0 0 0 / calc(var(--rst-press, 0) * var(--rst-btn-wash))) 0 0), var(--rst-btn-face);
  border: 1px solid var(--rst-control-border, var(--rst-line-strong));
  border-radius: var(--rst-radius-sm);
  box-shadow: inset var(--rst-hl-x) 1px 0 var(--rst-depth-hl, transparent), var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-contact, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
  box-sizing: border-box;
  color: var(--rst-text);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: var(--rst-fs-sm);
  font-weight: 600;
  gap: var(--rst-sp-2);
  line-height: 1.4;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  /* The shadow is not in the transition list: a root light write moves
     every button's shadow, and a box-shadow transition on 500 buttons
     was 500 main-thread animations a write, four fifths of the frame.
     A press needs no shadow transition: the press list is inset and the
     rest list is not, so the two never interpolated. */
  transition: --rst-press 0.7s cubic-bezier(0.2, 0.6, 0.3, 1), translate 0.3s ease-out;
  -webkit-tap-highlight-color: transparent;
}
[rst-btn~="primary"] {
  --rst-btn-face: linear-gradient(rgb(255 255 255 / var(--rst-depth-face, 0)), rgb(0 0 0 / var(--rst-depth-face, 0)));
  --rst-btn-wash: var(--rst-press-wash, 0);
  --rst-btn-spot: var(--rst-press-spot, 0);
  background-color: var(--rst-accent-fill, var(--rst-accent));
  border-color: var(--rst-accent-fill-edge, var(--rst-accent));
  box-shadow: inset var(--rst-hl-x) 1px 0 color-mix(in srgb, var(--rst-depth-hl, transparent) 28%, transparent), var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-contact, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
  color: var(--rst-on-accent-fill, var(--rst-on-accent));
}
[rst-btn~="danger"] {
  --rst-btn-face: linear-gradient(rgb(255 255 255 / var(--rst-depth-face, 0)), rgb(0 0 0 / var(--rst-depth-face, 0)));
  --rst-btn-wash: var(--rst-press-wash, 0);
  --rst-btn-spot: var(--rst-press-spot, 0);
  background-color: var(--rst-danger-fill, var(--rst-tone-negative-fg));
  border-color: var(--rst-danger-fill-edge, var(--rst-tone-negative-fg));
  box-shadow: inset var(--rst-hl-x) 1px 0 color-mix(in srgb, var(--rst-depth-hl, transparent) 28%, transparent), var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-contact, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
  color: var(--rst-on-danger-fill, var(--rst-on-accent));
}
/* ghost — a quiet Cancel beside a primary/danger action: no fill, a
   muted label, and it darkens toward the ordinary text colour on hover
   rather than picking up the accent (the accent means "this navigates
   somewhere new"; a ghost Cancel does not). */
[rst-btn~="ghost"] {
  --rst-btn-wash: 0;
  --rst-btn-spot: 0;
  background-color: transparent;
  border-color: var(--rst-ghost-edge, var(--rst-line-strong));
  /* The ghost's press shadow rides --rst-press, which fades over 0.7s
     on release: at 0 it is a zero-sized inset and paints nothing. Its
     release used to ease on the box-shadow transition, which is gone. */
  box-shadow: inset 0 calc(var(--rst-press, 0) * 1px) calc(var(--rst-press, 0) * 3px) var(--rst-depth-contact, transparent);
  color: var(--rst-text-muted);
}
@media (hover: hover) {
  [rst-btn]:hover {
    background-color: var(--rst-control-face-hover, var(--rst-surface));
    border-color: var(--rst-control-border-hover, var(--rst-accent));
    color: var(--rst-control-text-hover, var(--rst-accent));
  }
  [rst-btn]:hover:not(:active) {
    --rst-btn-sheen: radial-gradient(90px circle at var(--rst-mx) var(--rst-my), var(--rst-sheen-plain, transparent), transparent 70%);
  }
  [rst-btn~="primary"]:hover {
    background-color: var(--rst-accent-fill-hover, var(--rst-accent-strong));
    border-color: var(--rst-accent-fill-edge-hover, var(--rst-accent-strong));
    color: var(--rst-on-accent-fill, var(--rst-on-accent));
  }
  /* The filter is a token because it is the only exact way to keep an
     old theme's hover: the filter darkens the rasterised button, label,
     corners and edges included, and no colour mix repaints those
     corners pixel for pixel. day sets it to none and reads its own
     hover fill. Background, border and label are restated here on
     purpose: the plain hover above sits at the same specificity, and a
     danger hover that declared only the filter once let the label
     cascade back to the accent on the red fill. */
  [rst-btn~="danger"]:hover {
    background-color: var(--rst-danger-fill-hover, var(--rst-tone-negative-fg));
    border-color: var(--rst-danger-fill-edge-hover, var(--rst-tone-negative-fg));
    color: var(--rst-on-danger-fill-hover, var(--rst-on-accent));
    filter: var(--rst-danger-hover-filter, brightness(0.9));
  }
  [rst-btn~="primary"]:hover:not(:active),
  [rst-btn~="danger"]:hover:not(:active) {
    --rst-btn-sheen: radial-gradient(120px circle at var(--rst-mx) var(--rst-my), var(--rst-sheen-fill, transparent), transparent 70%);
  }
  [rst-btn~="ghost"]:hover {
    background-color: var(--rst-ghost-face-hover, transparent);
    border-color: var(--rst-ghost-edge-hover, var(--rst-line-strong));
    color: var(--rst-text);
  }
  /* A ghost has no sheen: a sheen means "press this" and a ghost is
     the quiet one. At :hover:not(:active) like the plain sheen rule,
     because a plain :hover rule at (0,2,0) lost to it and a hovered
     ghost painted the accent. */
  [rst-btn~="ghost"]:hover:not(:active) {
    --rst-btn-sheen: none;
  }
}
/* The press rules set no border and no label colour: a pressed button
   keeps the hover's where there is a hover and the rest's where there
   is none (a touch), which is what every theme does today. Disabled and
   busy are excluded by selector, not by order: a browser never makes a
   disabled button :active, so this changes no pixel today, and a busy
   button pressed mid-submit must not sink. */
[rst-btn]:active:not(:disabled):not([aria-busy="true"]) {
  --rst-press: 1;
  --rst-btn-sheen: none;
  box-shadow: inset 0 2px 4px var(--rst-depth-contact, transparent), inset 0 1px 1px var(--rst-depth-contact, transparent), inset 0 1px 2px var(--rst-depth-contact, transparent);
  transition: none;
  translate: 0 var(--rst-press-drop, 0px);
}
[rst-btn~="ghost"]:active:not(:disabled):not([aria-busy="true"]) {
  background-color: var(--rst-control-face-press, transparent);
  box-shadow: inset 0 1px 3px var(--rst-depth-contact, transparent);
}

/* ── Button sizes ─────────────────────────────────────────────────────
   Three steps, and they are a size scale rather than a set of variants:
   size composes with primary/ghost/danger, so `rst-btn="primary lg"` is
   the ordinary spelling of a form's submit.

   The default step is the one the page-header action and the row pill
   want — small, dense, a control beside other controls. It was the ONLY
   step for a long time, and that is how a form's submit ended up
   wearing it: a 34px, 12.5px-labelled button stretched across a 44rem
   column, which reads as a skinny bar rather than the thing the whole
   screen is asking you to press. A CTA is not a toolbar button; give it
   `lg`.

   The steps are even, so the three read as a scale: 26/34/42 on a
   desktop, 32/44/52 on a small or touch screen. Each is padding both
   sides, plus the label's line box, plus the 1px border top and bottom
   (the border is why the default step is 34px and not 32px). The
   header comment carries the desktop row; keep the two in step:
     desktop  sm       0.25rem  × 2 + 11.5px × 1.4 + 2  =  8   + 16.1 + 2  ≈ 26px
              default  0.45rem  × 2 + 12.5px × 1.4 + 2  = 14.4 + 17.5 + 2  ≈ 34px
              lg       0.65rem  × 2 + 14px   × 1.4 + 2  = 20.8 + 19.6 + 2  ≈ 42px
     touch    sm       0.375rem × 2 + 13px   × 1.4 + 2  = 12   + 18.2 + 2  ≈ 32px
              default  the target floor                                    = 44px
              lg       0.875rem × 2 + 16px   × 1.4 + 2  = 28   + 22.4 + 2  ≈ 52px
   The default step is the only one the floor sizes. Lifted to the
   floor, sm was the same 44px as the default on a phone (32 beside 34
   on a desktop), and the scale read as two sizes.

   sm is drawn under the floor and still meets it: its ::after is an
   invisible hit area, centred on the button and --rst-target on each
   axis (or the button, where the button is bigger), so a tap or click
   in it lands on the button. It is the tightest thing in the file that
   is still a button: for a dense row of them, not for making an
   ordinary button smaller, and there is deliberately nothing below it.
   What the hit area costs is in the comment on it below. */
[rst-btn~="sm"] {
  --rst-btn-sm-pad: 0.25rem;
  font-size: var(--rst-fs-xs);
  padding: var(--rst-btn-sm-pad) 0.5rem;
}
[rst-btn~="lg"] {
  font-size: var(--rst-fs-base);
  padding: 0.65rem 1rem;
}
@media (pointer: coarse), (max-width: 40rem) {
  [rst-btn~="sm"] { --rst-btn-sm-pad: 0.375rem; }
  [rst-btn~="lg"] { padding-block: 0.875rem; }
}

/* sm's hit area. The floor block at the end of this file lifts every
   button to --rst-target, and its .rst-btn rule is last, so the rule
   that lets sm be drawn under it repeats the button's own name to
   outweigh it: (0,2,0) here, where the floor is (0,1,0). That is the
   only reason for the doubled selector. These live here and not in the
   floor block because the block may set sizes only (ui's
   TestTheFloorBlockCarriesOnlySizes): a margin and a pseudo-element are
   layout, and they are how sm keeps the floor rather than being an
   exception to it.

   sm is drawn shorter than the floor and takes the difference as
   margin, so its box in the layout is the floor's height and nothing
   else can sit in the band a tap needs: --rst-btn-sm-reach is half the
   difference, the floor less sm's own padding, line and border (3px on
   a desktop, 6px on a phone; the touch query moves the padding and the
   floor, and this follows). A positioned ::before spans that margin
   band (::before because ::after is a tooltip's: an sm button with
   rst-tip lost the hit area to the tip's pointer-events: none, and the
   tip took the hit area's insets), so a tap in it lands on the button; it never reaches past the
   margin, so it cannot cover a neighbour's edge, even with no gap
   between them (two block sm buttons' margins collapse to one band,
   which both reach into and neither crosses). Across, sm keeps the
   floor's minimum width, so an icon-only sm is the floor wide and needs
   no reach that way. The ::before paints nothing, and the focus ring is
   the button's outline on its drawn border box.

   What it costs, so it is chosen knowingly:
   - A row or line holding an sm button is the floor tall, as it would
     be with a default button in it, though the button is drawn smaller.
   - An ancestor with overflow: hidden or clip cuts the hit area off at
     its edge, as it cuts off anything it holds; the drawn 26px (32px on
     a phone) is still over WCAG 2.5.8's 24px.
   - An app's own position on the button still contains the ::before,
     whatever it is but static: :where() weighs nothing, as the busy
     spinner's containing block does. */
[rst-btn~="sm"] { --rst-btn-sm-reach: max(0px, (var(--rst-target) - 2 * var(--rst-btn-sm-pad) - 1.4 * var(--rst-fs-xs) - 2px) / 2); }
[rst-btn][rst-btn~="sm"] { margin-block: var(--rst-btn-sm-reach); min-block-size: auto; }
:where([rst-btn~="sm"]) { position: relative; }
[rst-btn~="sm"]::before { content: ""; inset-block: calc(-1px - var(--rst-btn-sm-reach)); inset-inline: -1px; position: absolute; }

/* block — a button that fills its container, for the one-action form
   (sign in, sign up, a confirm page) where the submit IS the screen.
   It centres its own label: .rst-btn sets no justify-content, so a
   stretched button's text sits at the row's flex-start and reads as a
   mistake rather than a choice.

   Pair it with lg. A block button at the default size is precisely the
   skinny bar described above — the width comes from the container and
   the height does not follow, so the ratio goes wrong in proportion to
   how wide the column is. Nothing here enforces that pairing, because a
   narrow container is a legitimate place for a block button at the
   default size; the wide ones are where it fails. */
[rst-btn~="block"] {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* The UA's [hidden] { display: none } loses to the display this file
   gives every button, so a button marked hidden would show anyway. The
   sign-in screen's passkey door ships hidden and is revealed only where
   a ceremony can work; without this it would show everywhere. */
[rst-btn][hidden] { display: none; }

/* busy — the loading state rastrillo.js gives every submit button on
   its way out, and the one state of a button that is not a variant:
   any .rst-btn can wear it. The spinner is a real child element
   (.rst-spin, further down) rather than a pseudo-element, because the
   shim adds and removes it; .rst-btn's own `gap` spaces it from the
   label, so there is no margin here to keep in step with the padding.
   :disabled arrives a tick later, once the submission is under way —
   the two are styled together so the button does not change twice.
   Nothing here animates, so prefers-reduced-motion has nothing to say
   to it: .rst-spin already stops rotating under that query. */
[rst-btn][aria-busy="true"], [rst-btn]:disabled {
  cursor: default;
}
/* Dimmed, but not much. A disabled control is "incidental" under WCAG
   1.4.3 and exempt from the contrast minimum, and this one is disabled
   for a second — so the dimming is a hint that the button is not
   listening, not a licence to make the label hard to read while
   someone is waiting on it. */
[rst-btn]:disabled {
  opacity: 0.8;
}
/* The ring must not be squeezed by a long label, and must not stretch
   with the button's align-items: center default.

   Placed by shape rather than by a name of its own: the busy spinner is
   the shim's rst-spin child of an rst-btn, and there is nothing else it
   could be. rst-btn__spin was the second name for one thing, and the
   grammar of §6-v3 is explicit that a part is styled structurally where
   structure says it. The shim now writes one attribute. */
[rst-btn] > [rst-spin] {
  align-self: center;
  flex: none;
}
/* With no busy label there are no words to show while it works, so the
   spinner takes the label's place instead of joining it: joining widens
   the button mid-click and shoves whatever sits beside it. The shim
   marks a button that HAS a busy label with data-idle-label, which is
   what the :not() keys on — those words were asked for, so they stay.

   :has(> spinner) because aria-busy is ordinary ARIA an app may set on
   its own fetch button with no shim and no spinner; keyed on aria-busy
   alone, that button would lose its label and show nothing at all.

   The label is unpainted, never removed: aria-busy plus the untouched
   text is what a screen reader announces. -webkit-text-fill-color
   rather than color, because the ring is drawn in currentColor — a
   transparent color would take the spinner with it. Element children
   (an icon) are not reached by the text fill and take opacity 0, which
   unlike visibility keeps them in the accessibility tree.

   The media query stands the swap down for two readers a lone ring
   fails. Under reduced motion the ring is still and dimmed, and on its
   own reads as a stray "C". Under forced colours the engine repaints
   the text fill, so the label paints anyway and a centred ring would
   land on top of it. Both keep the older spinner-beside-label look. */
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  [rst-btn][aria-busy="true"]:not([data-idle-label]):has(> [rst-spin]) {
    -webkit-text-fill-color: transparent;
  }
  [rst-btn][aria-busy="true"]:not([data-idle-label]):has(> [rst-spin]) > :not([rst-spin]) {
    opacity: 0;
  }
  [rst-btn][aria-busy="true"]:not([data-idle-label]) > [rst-spin] {
    inset: 0;
    margin: auto;
    position: absolute;
  }
  /* The spinner's containing block. Zero specificity, so an app's own
     position: fixed or sticky on a floating Save still wins — either
     of those contains the spinner just as well, and losing it would
     drop the button back into the page flow mid-click. */
  :where([rst-btn][aria-busy="true"]:not([data-idle-label])) {
    position: relative;
  }
}
/* Under reduced motion the spinner takes the label's place too (1.8).
   Beside the label it pushed the label along inside the button as it
   appeared, and Paul's rule is that nothing moves after first paint.
   The swap stood down here because a still, open ring on its own reads
   as a stray "C", so here the ring is closed and dotted, at full ink.
   Forced colours keep the ring beside the label: the engine repaints
   the hidden label. */
@media (prefers-reduced-motion: reduce) and (forced-colors: none) {
  [rst-btn][aria-busy="true"]:not([data-idle-label]):has(> [rst-spin]) { -webkit-text-fill-color: transparent; }
  [rst-btn][aria-busy="true"]:not([data-idle-label]):has(> [rst-spin]) > :not([rst-spin]) { opacity: 0; }
  [rst-btn][aria-busy="true"]:not([data-idle-label]) > [rst-spin] { border: 2px dotted; inset: 0; margin: auto; opacity: 1; position: absolute; }
  :where([rst-btn][aria-busy="true"]:not([data-idle-label])) { position: relative; }
}

/* ── page-header ──────────────────────────────────────────────────── */
[rst-page-header] {
  align-items: baseline;
  border-bottom: 1px solid var(--rst-header-rule);
  display: flex;
  flex-wrap: wrap;
  gap: var(--rst-sp-3);
  justify-content: space-between;
  margin: 0 0 var(--rst-sp-5);
  padding-bottom: var(--rst-sp-3);
  position: relative;
}
/* The rake line is retired (design doc §6-v2.2). It drew a 2.5rem
   accent stroke over this rule, flush to the inline start — the
   library's one flourish, and, built from the same parts in the same
   order, indistinguishable from a determinate progress bar at 12%. The
   rule itself carries the theme now: --rst-header-rule is derived from
   the theme's accent and line, so plain draws grey, day draws a barely
   tinted hairline and signal a visibly tinted one, and an app that
   wants its own sets one custom property instead of fighting an
   ::after it cannot remove.

   The declaration stays, rather than the rule being deleted, because a
   stylesheet that merely stops mentioning the stroke says nothing to
   the next reader; this says the stroke is gone on purpose. It also
   neutralises a vendored theme or app sheet that still carries the old
   flourish at a lower specificity.

   THE RULE IS DECORATIVE AND CARRIES NO CONTRAST FLOOR. The heading's
   size, weight and spacing carry the structure; the rule does not. It
   is deliberately absent from ui/contrast_test.go's pair table, and a
   later pass must not argue it up to 1.4.11's 3:1 — that floor was
   never its. See ui/contrast_test.go's colorMixSkip comment.

   position: relative stays: it is the containing block anything an app
   absolutely positions inside its own header expects to find, and
   removing it would move those elements rather than tidy the file. */
[rst-page-header]::after {
  content: none;
}
[rst-page-header-titles] {
  flex: 1 1 auto;
  min-inline-size: 0;
}
/* The title's size, weight and tracking are the theme's (C15), read
   through today's values so a theme written before the tokens keeps
   the title it has. */
[rst-page-header] h1 {
  color: var(--rst-text);
  font-size: var(--rst-title-size, 1.375rem);
  font-weight: var(--rst-title-weight, 600);
  letter-spacing: var(--rst-title-track, -0.015em);
  line-height: 1.25;
  margin: 0;
}
[rst-page-header-sub] {
  color: var(--rst-text-muted);
  font-size: var(--rst-fs-sm);
  margin: var(--rst-sp-1) 0 0;
  max-inline-size: 44rem;
}

/* ── page-foot: the column's footer row ───────────────────────────── */
/* The column's last child, for the language and colour-scheme menus.
   Above the title a menu pushed the page down and read as the page's
   first action; here it is out of the way and on every page. Quiet:
   a hairline, muted text one step down, and summaries with no face
   (the face rules below exclude it, as they do a shell's tail).
   Packed at the inline end, so one menu sits at the end and two sit
   side by side, Language first, with whatever else an app puts in the
   row before them; it wraps on a phone rather than scroll sideways.

   position: relative, and static on its dropdowns, is the fallback
   where nothing can anchor a panel. A panel then hangs from its
   <details>, and Language is not at the row's end: its panel, at least
   176px wide, ran past the opposite edge of a narrow page. With the
   row as the containing block every panel opens under the row, flush
   with its inline end, with or without anchor.js. Where anchor
   positioning applies the panel is fixed to its own summary and none
   of this matters. The document grows to hold an open panel, so no
   drop-up rule: the rail foot needs one because its rail is the
   window's height, and a page's foot is not. */
[rst-page-foot] {
  align-items: center;
  border-block-start: 1px solid var(--rst-line);
  color: var(--rst-text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--rst-fs-sm);
  gap: var(--rst-sp-2) var(--rst-sp-4);
  justify-content: flex-end;
  margin-block-start: var(--rst-sp-6);
  padding-block-start: var(--rst-sp-3);
  position: relative;
}
/* Standing alone, as in a component example, the margin above it
   would be a blank band over nothing. */
[rst-page-foot]:first-child { margin-block-start: 0; }
/* An app with one language and no scheme menu may render the row with
   only template whitespace in it, which would draw a hairline under
   the page for nothing. :empty counts that whitespace as content. */
[rst-page-foot]:not(:has(> *)) { display: none; }

/* ── The list card, its toolbar, and its search field ─────────────── */
/* No padding here, on purpose: a list card holds rows, and each row pads
   itself. A form, prose or a strip of links does NOT go in here — it
   goes in .rst-box, the padded section card. Text touching the border
   is the sign that content landed in the wrong card.
   The face, rim and shadows are the card stack described above .rst-box. */
[rst-list] {
  --rst-card-x: 50%;
  --rst-card-y: 0%;
  --rst-card-lit: 0;
  background:
    radial-gradient(calc(var(--rst-card-lit) * 520px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-wash, transparent), transparent 75%) padding-box,
    linear-gradient(var(--rst-surface) 0 0) padding-box,
    radial-gradient(calc(var(--rst-card-lit) * 260px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-rim, var(--rst-line)), var(--rst-line) 80%) border-box;
  border: 1px solid transparent;
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-ambient, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
}

/* Why there is no `overflow: hidden` here, since the obvious way to
   clip rows to a rounded card is exactly that, and it IS what this rule
   used to be.
   A card that clips is a clipping context for everything absolutely
   positioned inside it — so a bulk bar's Actions menu, or a row kebab's
   panel, was sliced off at the card's edge the moment it opened. That
   is any card holding a menu, not one instance of it, so the fix is
   here rather than at the bulk bar.
   `overflow: clip` is the same trap: it clips too. `overflow-clip-margin`
   would push the clip box outward, but it pushes it outward on every
   side and past the border radius — which is the corner clipping this
   whole rule exists to do. So the card stops clipping and the rows round
   THEMSELVES: the first full-bleed child takes the card's start corners,
   the last takes its end corners, one step in for the 1px border. A
   card's own rows (.rst-row, .rst-lrow, .rst-lbar, .rst-bulkbar) declare
   no radius, which is what makes them full-bleed in the first place.

   Both selectors are wrapped in :where() to weigh NOTHING — (0,0,0),
   not the (0,2,0) a bare `.rst-list > :first-child` would carry. That is
   the whole mechanism by which a child that owns its own shape keeps it:
   a bare <form rst-search> or a .rst-empty as the direct first
   or last child of a card declares its radius at (0,1,0) and therefore
   wins, and so does any app class doing the same. Source order does NOT
   decide this and cannot be relied on to — an earlier draft of this
   comment said it did, and both those children painted lopsided corners
   (7px over 6px in day) because (0,2,0) beat (0,1,0) whatever the order.
   :where() rather than a :not(.rst-search, .rst-empty) exception list
   because the list would need extending for every self-shaped child an
   app or a later partial invents, and the thing being expressed is not
   "except these two" but "unless the child says otherwise".
   TestSelfShapedChildrenKeepTheirCornersInsideACard gates the
   relationship, by measuring the same child inside a card and outside
   one and requiring the two to agree.

   KNOWN EDGE, not handled: :last-child is a DOM position, and the old
   `overflow: hidden` clipped whatever was PAINTED last. So a trailing
   <input type="hidden"> — which apps write constantly, and which has
   display: none from the UA — takes the rounding and leaves the real
   last row square. No template in the framework does this, so nothing
   regressed; it is unhandled rather than overlooked because the CSS that
   would handle it has to enumerate what "invisible" means in a selector
   (:nth-last-child(1 of :not([type=hidden]):not([hidden]))), and the
   commonest case of all — display: none from the app's own stylesheet —
   is not expressible in a selector at all. A rule that covered two of
   the three would read as covering all three. If you are looking at a
   square corner on a rounded card, look for a hidden last child. */
:where([rst-list]) > :where(:first-child),
:where([rst-card]) > :where(:first-child) {
  border-start-end-radius: calc(var(--rst-radius) - 1px);
  border-start-start-radius: calc(var(--rst-radius) - 1px);
}
:where([rst-list]) > :where(:last-child),
:where([rst-card]) > :where(:last-child) {
  border-end-end-radius: calc(var(--rst-radius) - 1px);
  border-end-start-radius: calc(var(--rst-radius) - 1px);
}

/* list-bar: the toolbar strip. The search field is capped at 20rem so
   the space to its right stays reserved — that is where the filter and
   sort controls attach when the dropdown slice lands. */
[rst-lbar] {
  align-items: center;
  background: var(--rst-surface-2);
  border-bottom: 1px solid var(--rst-line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--rst-sp-3);
  padding: var(--rst-sp-2) var(--rst-sp-3);
}
/* list-bar-search wraps its form in <search>, the landmark element, so
   the strip's flex child is the <search>, not the form. Both are sized
   here: an app that hand-writes a bare <form rst-search> into
   its own .rst-lbar keeps the layout it had before the element landed. */
[rst-lbar] > search {
  flex: 0 1 20rem;
}

/* list-bar-search renders this form, which is the field box itself. Used
   on its own inside a .rst-list card it just needs margin; inside a
   .rst-lbar the strip supplies the padding. The <search> around it is a
   plain block box — it draws nothing, so the form remains the field. */
[rst-search] {
  align-items: center;
  background: var(--rst-surface);
  border: 1px solid var(--rst-line-strong);
  border-radius: var(--rst-radius-sm);
  box-shadow: inset 0 1px 1px var(--rst-depth-ambient, transparent);
  display: flex;
  gap: var(--rst-sp-2);
  margin: 0;
  padding: 0.3rem 0.55rem;
}
[rst-list] > search {
  margin: var(--rst-sp-3);
}
/* The link that replaces it. 24px on BOTH axes is WCAG 2.2 SC 2.5.8
   Target Size (AA), which this library gates in CI — an ✕ tucked inside
   a field is exactly the shape that fails it, and a 17px chip on this
   branch already did. Do not shrink it without re-measuring. */
[rst-search-clear] {
  align-items: center;
  border-radius: var(--rst-radius-sm);
  color: var(--rst-text-faint);
  display: inline-flex;
  flex: none;
  justify-content: center;
  min-block-size: 24px;
  min-inline-size: 24px;
  text-decoration: none;
}

/* ── list-row-action ──────────────────────────────────────────────── */
[rst-row] {
  align-items: center;
  border-top: 1px solid var(--rst-line);
  display: flex;
  gap: var(--rst-sp-3);
  padding: var(--rst-sp-3);
  position: relative;
}
[rst-row]:first-child {
  border-top: 0;
}
/* The toolbar strip already draws the line under itself. */
[rst-lbar] + [rst-row] {
  border-top: 0;
}
/* Only a row that is a link looks like one: the fill follows the
   primary link, so a hand-written row with nothing to open stays flat.
   The hover and the press are below, after the rule that lifts a row's
   controls: one lift for every row idiom. */
[rst-row-lead] {
  align-items: center;
  background: var(--rst-tone-neutral-bg);
  block-size: 1.9rem;
  border-radius: 50%;
  color: var(--rst-tone-neutral-fg);
  display: flex;
  flex: none;
  font-size: var(--rst-fs-xs);
  font-weight: 600;
  inline-size: 1.9rem;
  justify-content: center;
}
[rst-row-lead][data-lead="positive"] {
  background: var(--rst-tone-positive-bg);
  color: var(--rst-tone-positive-fg);
}
[rst-row-lead][data-lead="warning"] {
  background: var(--rst-tone-warning-bg);
  color: var(--rst-tone-warning-fg);
}
[rst-row-lead][data-lead="negative"] {
  background: var(--rst-tone-negative-bg);
  color: var(--rst-tone-negative-fg);
}
[rst-row-lead][data-lead="accent"] {
  background: var(--rst-accent-soft);
  color: var(--rst-accent);
}
[rst-row-main] {
  flex: 1;
  min-inline-size: 0;
}
/* A row with a destination has ONE primary link, and its ::after covers
   the row, so the row is the target on every screen: the
   cursor, the status-bar URL, middle-click and "open in new tab" all
   work across the whole width. Everything else in the row that can be
   operated is lifted above the overlay by the :where() rule under the
   list grid. The row is not a link, it contains one, so nested anchors
   stay impossible. */
[rst-row-main] > a {
  color: var(--rst-text);
  font-weight: 600;
  text-decoration: none;
}
[rst-row-main] > a::after {
  content: "";
  inset: 0;
  position: absolute;
}
/* Focus draws the ring on the overlay, inset 2px so a card's corner
   cannot cut it, so a keyboard user sees the whole row outlined. The
   link also underlines: a check that reads the focused element and its
   ancestors (the gallery's keyboard walk) never sees a pseudo-element,
   and forced-colors mode keeps text decoration. */
[rst-row-main] > a:focus-visible, [rst-lrow] > a.rst-nm:focus-visible, [rst-lrow] > a[rst-person]:focus-visible, [rst-lrow] > [role="rowheader"] > a.rst-nm:focus-visible, [rst-lrow] > [role="rowheader"] > a[rst-person]:focus-visible { outline: none; text-decoration: underline; }
[rst-row-main] > a:focus-visible::after, [rst-lrow] > a.rst-nm:focus-visible::after, [rst-lrow] > a[rst-person]:focus-visible::after, [rst-lrow] > [role="rowheader"] > a.rst-nm:focus-visible::after, [rst-lrow] > [role="rowheader"] > a[rst-person]:focus-visible::after { border-radius: var(--rst-radius-sm); outline: 2px solid var(--rst-accent); outline-offset: -2px; }
[rst-row-main] > a:hover {
  text-decoration: underline;
}
[rst-row-sub] {
  color: var(--rst-text-muted);
  display: block;
  font-size: var(--rst-fs-sm);
  margin-block-start: 0.1rem;
}
[rst-row-action] {
  background: var(--rst-surface);
  border: 1px solid var(--rst-line-strong);
  border-radius: var(--rst-radius-pill);
  color: var(--rst-text-muted);
  flex: none;
  font-size: var(--rst-fs-sm);
  padding: 0.2rem 0.7rem;
  position: relative;
  text-decoration: none;
  z-index: 1;
}
[rst-row-action]:hover {
  border-color: var(--rst-accent);
  color: var(--rst-accent);
}

/* A status pill inside a row is part of the row's target, not a
   control: a dead spot inside a row you can tap is a mis-tap on a
   phone. It is not lifted, so a tap on it opens the row. */
[rst-row] [rst-status] {
  flex: none;
}

/* ── status-pill. The dot is decoration; the label is the state. ──── */
[rst-status] {
  align-items: center;
  background: var(--rst-tone-neutral-bg);
  border-radius: var(--rst-radius-pill);
  color: var(--rst-tone-neutral-fg);
  display: inline-flex;
  font-size: var(--rst-fs-xs);
  font-weight: 600;
  gap: 0.35rem;
  line-height: 1.6;
  padding: 0.15rem 0.55rem;
}
[rst-status]::before {
  background: currentColor;
  block-size: 0.375rem;
  border-radius: 50%;
  content: "";
  flex: none;
  inline-size: 0.375rem;
}
[rst-status][rst-tone~="positive"] {
  background: var(--rst-tone-positive-bg);
  color: var(--rst-tone-positive-fg);
}
[rst-status][rst-tone~="warning"] {
  background: var(--rst-tone-warning-bg);
  color: var(--rst-tone-warning-fg);
}
[rst-status][rst-tone~="negative"] {
  background: var(--rst-tone-negative-bg);
  color: var(--rst-tone-negative-fg);
}

/* ── empty-state ──────────────────────────────────────────────────── */
/* No box: the heading and text sit on the page. A dashed outline reads
   as a drop target, and an empty state accepts nothing. The radius
   stays because 1.x keeps every 1.0 declaration; it paints nothing now.
   The padding gains the 1px the border took, so nothing moves. */
[rst-empty] {
  background: transparent;
  border: none;
  border-radius: var(--rst-radius);
  padding: calc(var(--rst-sp-6) + 1px) calc(var(--rst-sp-4) + 1px);
  text-align: center;
}
/* Class-based, so it styles the partial's <h2> without inheriting any
   <h2> default: an empty state's heading is a real heading in the
   document outline, not a paragraph dressed up as one. */
[rst-empty-title] {
  color: var(--rst-text);
  font-size: var(--rst-fs-lg);
  font-weight: 600;
  margin: 0 0 var(--rst-sp-2);
}
[rst-empty-body] {
  color: var(--rst-text-muted);
  margin: 0 auto;
  max-inline-size: 34rem;
}
[rst-empty-cta] {
  margin: var(--rst-sp-4) 0 0;
}

/* ── pagination. The current page is a filled chip AND aria-current AND
      bolder — three signals, so it never rests on colour alone. ────── */
[rst-pagination] {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
  gap: var(--rst-sp-1);
  margin: var(--rst-sp-4) 0;
}
/* The hover is the tint rows and nav items hover to, through today's
   accent-soft; there is no press rule, because a pressed chip has no
   fill of its own today in any theme (A15) and it navigates at once. */
[rst-pagination] > a:hover {
  background: var(--rst-tint-hover, var(--rst-accent-soft));
  border-color: var(--rst-accent);
  color: var(--rst-text);
}

/* badge — uppercase bordered chip; tones reuse the pill tone pairs. */
[rst-badge] {
  border: 1px solid var(--rst-line);
  border-radius: var(--rst-radius-sm);
  color: var(--rst-text-muted);
  display: inline-block;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.4rem;
  text-transform: uppercase;
  white-space: nowrap;
}
[rst-badge~="positive"] { background: var(--rst-tone-positive-bg); border-color: var(--rst-tone-positive-fg); color: var(--rst-tone-positive-fg); }
[rst-badge~="warning"] { background: var(--rst-tone-warning-bg); border-color: var(--rst-tone-warning-fg); color: var(--rst-tone-warning-fg); }
[rst-badge~="negative"] { background: var(--rst-tone-negative-bg); border-color: var(--rst-tone-negative-fg); color: var(--rst-tone-negative-fg); }
[rst-badge~="neutral"] { background: var(--rst-tone-neutral-bg); border-color: var(--rst-tone-neutral-fg); color: var(--rst-tone-neutral-fg); }

/* meter — 4px capacity bar; the number rides beside it as text.

   The bar is a native <meter> (spec §6-v2.4), and styling one is the
   one place in this file where the same declaration has to be written
   three times: once on the element, once for the WebKit/Blink
   pseudo-elements, once for the Firefox one. They cannot share a rule.
   A selector list containing a pseudo-element an engine does not know
   is invalid AS A WHOLE in that engine, so ::-webkit-meter-bar and
   ::-moz-meter-bar in one comma-separated rule would style nothing
   anywhere. That is why the repetition below is not tidied up.

   The two engines also disagree about which pseudo-element is which.
   In WebKit/Blink ::-webkit-meter-bar is the TRACK and
   ::-webkit-meter-optimum-value is the FILL; in Firefox the element
   itself is the track and ::-moz-meter-bar is the FILL. Read the three
   blocks with that in mind or they look contradictory.

   HONESTLY FLAGGED: the -moz- rule is unverified. This project's
   browser drive is Chromium, so the WebKit/Blink path below is measured
   and the Firefox path is written from the spec and reasoned about. It
   was shipped that way knowingly (Paul's call). If a Firefox drive ever
   lands, this is the first rule to point it at.

   The old markup was a <span> with an <i> in it sized by
   --rst-meter-fill. That custom property is gone; an app that set it is
   setting nothing now, which is why it is called out in the changelog
   rather than only here. */
[rst-meter] { align-items: center; color: var(--rst-text-muted); display: inline-flex; font-size: var(--rst-fs-xs); gap: var(--rst-sp-2); }
[rst-meter-bar] { appearance: none; background: var(--rst-accent-soft); block-size: 4px; border: 0; border-radius: 2px; flex: 1; min-inline-size: 34px; }
[rst-meter-num] { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* stats — the instrument strip a dashboard or a report opens with: a
   lead reading at headline size, companion readings beside it, divided
   by hairlines inside one card.

   One band, one cell, one lead variant. The headline stat and the
   counts next to it are the same component at two sizes (spec
   §6-v2.4), so there is no second kind to keep in step with this one.

   flex-wrap and a flex-basis rather than a grid with a column count.
   Any number of cells has to work — three on one dashboard, five on
   the next — and a grid would need the caller to say how many. The
   basis is what decides when the strip becomes two rows, and the lead
   cell's is larger so it keeps the line to itself when the others
   wrap under it.

   The hairline is border-inline-start on every cell but the first,
   which is what makes the strip read as ONE instrument rather than as
   a row of cards. Logical, so it lands on the right in Arabic. A
   wrapped cell keeps its line, and that is the one visual compromise
   here: at two rows the first cell of the second row draws a leading
   hairline against the card's edge. It is a hairline, and the
   alternative — :nth-child arithmetic against a column count nobody
   declared — is the grid this deliberately is not. */
/* The face, rim and shadows are the card stack described above .rst-box. */
[rst-stats] {
  --rst-card-x: 50%;
  --rst-card-y: 0%;
  --rst-card-lit: 0;
  background:
    radial-gradient(calc(var(--rst-card-lit) * 520px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-wash, transparent), transparent 75%) padding-box,
    linear-gradient(var(--rst-surface) 0 0) padding-box,
    radial-gradient(calc(var(--rst-card-lit) * 260px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-rim, var(--rst-line)), var(--rst-line) 80%) border-box;
  border: 1px solid transparent;
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-ambient, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
  display: flex;
  flex-wrap: wrap;
}
[rst-stat] {
  border-inline-start: 1px solid var(--rst-line);
  display: flex;
  flex: 1 1 9rem;
  flex-direction: column;
  gap: 0.15rem;
  min-inline-size: 0;
  padding: var(--rst-sp-4);
}
/* The eyebrow. Uppercase and tracked unless the theme says otherwise
   (C15: day sets sentence case with no tracking), the same grammar
   every label in this system uses above a value, so a band of cells
   reads as one row of labels rather than as four headings. */
[rst-stat-label] {
  color: var(--rst-text-muted);
  font-size: var(--rst-fs-xs);
  font-weight: 650;
  letter-spacing: var(--rst-label-track, 0.06em);
  text-transform: var(--rst-label-case, uppercase);
}
/* tabular-nums so a column of readings lines up on its digits, and so
   a number that changes on a poll does not jitter its neighbours. */
[rst-stat-num] {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.1;
}
/* The delta is TEXT in a colour, not a colour. Its sign is written by
   the caller and is the signal a reader who cannot tell the two hues
   apart is reading; the colour is the second one (WCAG 2.2 AA 1.4.1).
   Both hues are held at 4.5:1 against this card by the contrast gate
   in the same commit that added them — they are text, so the floor
   applies whether or not the colour carries meaning of its own. */
[rst-stat-delta] {
  font-size: var(--rst-fs-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
[rst-stat-note] {
  color: var(--rst-text-faint);
  font-size: var(--rst-fs-xs);
}

/* person — avatar + name + email; avatar is decoration, text is identity. */
[rst-person] { align-items: center; color: inherit; display: inline-flex; gap: 0.7rem; min-width: 0; text-decoration: none; }
[rst-person-av] { align-items: center; background: var(--rst-accent); border-radius: 50%; color: var(--rst-on-accent); display: flex; flex: none; font-size: 0.6875rem; font-weight: 600; height: 28px; justify-content: center; width: 28px; }
/* The empty avatar is a soft filled circle, not a dashed ring. The
   border stays 1px, transparent, so the circle is the size it was. */
[rst-person-av~="empty"] { background: var(--rst-line); border: 1px solid transparent; color: transparent; }
[rst-person-meta] { min-width: 0; }
[rst-person-name] { display: block; font-weight: 550; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[rst-person-email] { color: var(--rst-text-muted); display: block; font-size: var(--rst-fs-xs); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[rst-person]:hover [rst-person-name] { color: var(--rst-accent); }
[rst-person~="lg"] [rst-person-av] { font-size: 1.0625rem; height: 46px; width: 46px; }
/* actor — who did something, as the words the actor function writes,
   in an element an app can style. Isolated the way <bdi> is: both
   names are what someone typed, and a right-to-left name beside "for"
   would otherwise pull the sentence's punctuation across to its side. */
[rst-actor] { unicode-bidi: isolate; }
/* api-tokens — the token page's body: the reveal, the create form, the
   list and the revoke buttons stacked at the page's rhythm. The list
   sets its own columns, which a list grid otherwise takes from the app's
   stylesheet: the identity cell, four fact cells, the state word, and
   the kebab column. Below the phone width the facts leave the columns
   and stack under the identity, each spanning the row with its label
   shown: a person checks a token's access and activity before revoking
   it, so the facts are not hidden there the way a list's middle cells
   usually are. The identity, the state and the kebab are pinned to the
   first grid row, or the stacked facts would push them down. The secret
   wraps anywhere, because a 60-character token that will not break
   overflows a phone and the end of it, the part that is secret, is what
   gets cut. */
[rst-tokens] { display: grid; gap: var(--rst-sp-5); }
[rst-tokens-fact] { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[rst-tokens-state] { min-width: 0; }
[rst-tokens-revoke] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); }

/* callout — the one alert vocabulary; icon sized to the first text line. */
[rst-callout] { align-items: flex-start; background: var(--rst-surface-2); border: 1px solid var(--rst-line-strong); border-radius: var(--rst-radius); display: flex; gap: 0.6rem; margin: var(--rst-sp-4) 0; padding: 0.85rem 1rem; }
[rst-callout-ic] { align-items: center; color: var(--rst-accent); display: inline-flex; flex: none; height: 1.5rem; justify-content: center; width: 1.25rem; }
[rst-callout-ic] svg, [rst-callout-ic] .icon { display: block; height: 1.25rem; width: 1.25rem; }
[rst-callout-body] { line-height: 1.5; min-width: 0; }
[rst-callout-body] > strong { display: block; font-weight: 600; }
[rst-callout-body] > p { color: var(--rst-text-muted); margin: 0.15rem 0 0; }
[rst-callout-body] > p:only-child { color: inherit; margin: 0; }
[rst-callout-body] > ul { color: var(--rst-text-muted); margin: 0.15rem 0 0; padding-inline-start: 1.1rem; }
[rst-callout][rst-tone~="positive"] { background: var(--rst-tone-positive-bg); border-color: var(--rst-tone-positive-fg); }
[rst-callout][rst-tone~="positive"] > [rst-callout-ic] { color: var(--rst-tone-positive-fg); }
[rst-callout][rst-tone~="warning"] { background: var(--rst-tone-warning-bg); border-color: var(--rst-tone-warning-fg); }
[rst-callout][rst-tone~="warning"] > [rst-callout-ic] { color: var(--rst-tone-warning-fg); }
[rst-callout][rst-tone~="negative"] { background: var(--rst-tone-negative-bg); border-color: var(--rst-tone-negative-fg); }
[rst-callout][rst-tone~="negative"] > [rst-callout-ic] { color: var(--rst-tone-negative-fg); }

/* detail-list — a record's labelled facts as a definition list; the
   partial emits .rst-detail, .rst-mono marking machine-ish values.
   A label is smaller than its value, so the two meet on the value's
   first baseline: stretched to the row, each set at its own top and
   the label rode above the line it names; centred, it drifted off the
   first line of a value that wraps. */
[rst-detail] { align-items: first baseline; display: grid; gap: var(--rst-sp-2) var(--rst-sp-5); grid-template-columns: max-content 1fr; margin: var(--rst-sp-4) 0; }
[rst-detail] dt { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); font-weight: 600; }
[rst-detail] dd { margin: 0; }
.rst-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--rst-fs-sm); }

/* snippet — a line of code to copy, in a box, with a Copy button that
   copy.js shows where the browser has a clipboard.
   The box hugs its line (fit-content) up to the width it is given, and
   the code wraps anywhere inside it, at any width, with no media
   query: a URL has no space to break at, and one that will not break
   runs off a phone's screen and takes the end a reader has to copy
   with it. border-box, so the 100% is the whole box, its padding and
   border included. The button is spaced by its own margin, not the
   grid's gap: a gap would stay behind when the button is hidden (no
   script, or no clipboard) and pad the box's end twice. user-select:
   all makes one click select the whole line, which is how it is copied
   by hand; Safari 17.5 reads only the prefixed property.
   The status takes a row of its own under the code when it speaks.
   While empty it is clipped to nothing rather than display: none, so
   the live region is in the accessibility tree before its first
   message: one that joins the tree as it speaks may never be heard. */
[rst-snippet] { align-items: center; background: var(--rst-surface); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; inline-size: fit-content; max-inline-size: 100%; padding: var(--rst-sp-2) var(--rst-sp-3); position: relative; row-gap: var(--rst-sp-1); }
[rst-snippet-status] { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); grid-column: 1 / -1; }

/* ── Narrow screens ───────────────────────────────────────────────── */
@media (max-width: 34rem) {
  [rst-lbar] > search {
    flex: 1 1 100%;
  }
  [rst-row] {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  /* A row with a status gives its title the row. Side by side, the
     pill and the action squeezed the title into a narrow column
     ("Release notes, August" in three lines beside "Published"). The
     status goes on a line of its own under the title and meta; the
     title's column is the last explicit one, so it is the same column
     with or without a lead, and the action and kebab fill the first
     line's implicit columns after it.
     The pill is bold and tinted, and beside the title its size was
     measured against the title. Under the meta line it is measured
     against the meta, and at the full --rst-fs-xs it competes with it
     for the eye. One pixel under the scale's smallest step keeps it a
     tag on the record; calc() against the token, not a literal, so it
     still moves when the scale does on a phone. */
  [rst-row]:has(> [rst-status]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--rst-sp-1);
  }
  [rst-row]:has(> [rst-row-lead]):has(> [rst-status]) {
    grid-template-columns: auto minmax(0, 1fr);
  }
  [rst-row]:has(> [rst-status]) > * {
    grid-row: 1;
  }
  [rst-row]:has(> [rst-status]) > [rst-row-main] {
    grid-column: -2;
  }
  [rst-row]:has(> [rst-status]) > [rst-status] {
    font-size: calc(var(--rst-fs-xs) - 1px);
    grid-column: -2;
    grid-row: 2;
    justify-self: start;
    padding-block: 0.05rem;
  }
  /* A status the page marks inline stays on the first line, in its
     source place: an implicit column straight after the name's, so the
     line reads lead, name, status, action (mirrored right to left), and
     the name's column takes what is left and wraps inside it. It keeps
     the size above. Marking it is the page saying the status is short;
     nothing here measures it. Not a wrapping flex line: the name
     (flex: 1, min-inline-size: 0) shrinks to nothing first, so what
     breaks the line is the lead, status, action and gaps together
     outgrowing the row, and flex then drops the action, or the status,
     to a second line item by item. Which one dropped would vary with
     each row's status and action labels, row to row in one list; the
     grid keeps every part on the first line. Opt-in, because a 1.0
     page's status must stay where 1.0 put it. */
  [rst-row]:has(> [rst-status]) > [rst-status~="inline"] {
    grid-column: auto;
    grid-row: 1;
  }
  /* min(), not a second token: a theme that already chose a title at or
     under the narrow size keeps it, and one above it steps down. */
  [rst-page-header] h1 {
    font-size: min(var(--rst-title-size, 1.375rem), 1.25rem);
  }
  /* A band the page marks pairs is two columns. The wrapping flex row
     above stacks a phone's band one stat to a line at 320px, four short
     figures four screens of scroll apart, and pairs them at 390px with
     the leading hairline on the wrong cell. The grid pairs them at
     every phone width; the first of each pair sits on the band's edge,
     so it drops the leading hairline, and the second pair is ruled off
     from the first. Opt-in, because a 1.0 page's band must not reflow:
     a lead or a long figure wants the whole line, which the page knows
     and the CSS does not. */
  [rst-stats~="pairs"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* ── The structural idioms: box, list grid, row-menu, dropdown, ftok ── */

/* box — the section card. Its heading (rst-box-head) is a SIBLING
   before the box, never inside it: a screen is a stack of
   section-header + card. A box-head action is a compact real button,
   never a pill. */
/* Cards rest on the page: a hairline, and two layers of ambient light
   that lean with the light. The border is transparent and the hairline
   is the outer stop of a border-box gradient, so the light can catch
   the rim nearest the pointer; its lit radius scales with
   --rst-card-lit instead of its alpha, because a colour whose alpha is
   a calc(var()) is what Safari refused. At 0 the radius is 0px and the
   card shows its hairline. */
[rst-box] {
  --rst-card-x: 50%;
  --rst-card-y: 0%;
  --rst-card-lit: 0;
  background:
    radial-gradient(calc(var(--rst-card-lit) * 520px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-wash, transparent), transparent 75%) padding-box,
    linear-gradient(var(--rst-surface) 0 0) padding-box,
    radial-gradient(calc(var(--rst-card-lit) * 260px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-rim, var(--rst-line)), var(--rst-line) 80%) border-box;
  border: 1px solid transparent;
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-ambient, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
  margin: var(--rst-sp-4) 0;
  padding: 1.1rem 1.25rem;
}
[rst-box] > :first-child { margin-top: 0; }
[rst-box] > :last-child { margin-bottom: 0; }
[rst-box-head] { align-items: baseline; display: flex; gap: var(--rst-sp-4); justify-content: space-between; margin: 1.5rem 0 0.5rem; }
[rst-box-head]:first-child { margin-top: 0; }
[rst-box-head] + [rst-box] { margin-top: 0; }
[rst-box-head] h2 { font-size: var(--rst-heading-size, var(--rst-fs-base)); margin: 0; }
[rst-box-foot] { border-top: 1px solid var(--rst-line); color: var(--rst-text-muted); margin-top: var(--rst-sp-4); padding-top: 0.75rem; }
[rst-box] > [rst-detail] { margin: 0; }

/* The list grid — the real data-table vocabulary. The card sets the
   columns once (--rst-cols, from a class in the app's stylesheet —
   the default CSP blocks inline styles — trailing
   var(--rst-col-menu) for the kebab); rows only choose cells. Hover
   fill only on rows that contain the identity link — a display-only
   row must never look clickable.
   Like .rst-list, .rst-card has no padding: rows only. Anything that
   is not a row belongs in .rst-box.
   The face, rim and shadows are the card stack described above .rst-box. */
[rst-card] {
  --rst-card-x: 50%;
  --rst-card-y: 0%;
  --rst-card-lit: 0;
  background:
    radial-gradient(calc(var(--rst-card-lit) * 520px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-wash, transparent), transparent 75%) padding-box,
    linear-gradient(var(--rst-surface) 0 0) padding-box,
    radial-gradient(calc(var(--rst-card-lit) * 260px) circle at var(--rst-card-x) var(--rst-card-y), var(--rst-light-rim, var(--rst-line)), var(--rst-line) 80%) border-box;
  border: 1px solid transparent;
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow-x) var(--rst-shadow-y) 1px var(--rst-depth-ambient, transparent), calc(var(--rst-shadow-x) * 2) calc(var(--rst-shadow-y) * 1.5) 3px var(--rst-depth-ambient, transparent);
}
/* Room above and below a card in the page's flow, as a box has, so a
   note under a table does not touch it. Only a card that is a child of
   the page column, the shell's main or the body gets it: a grid or a
   component that lays cards out keeps its own spacing. Under a section
   heading the heading's 0.5rem is the gap, first or last in its parent
   a card adds nothing, and the count line keeps its 0.7rem. The resets
   ask for the same parents, so a card elsewhere keeps the margins it
   had. All weightless, so a margin an app gives a card wins. */
:where(body, [rst-page]) > :where([rst-card]) { margin-block: var(--rst-sp-4); }
:where(body, [rst-page]) > :where([rst-box-head]) + :where([rst-card]), :where(body, [rst-page]) > :where([rst-card]:first-child) { margin-block-start: 0; }
:where(body, [rst-page]) > :where([rst-card]:last-child) { margin-block-end: 0; }
:where(body, [rst-page]) > :where([rst-card]):has(+ :where([rst-count-line])) { margin-block-end: 0; }
[rst-lrow] { align-items: center; border-bottom: 1px solid var(--rst-line); display: grid; gap: 0.85rem; grid-template-columns: var(--rst-cols, 1fr); padding: 0.68rem 1rem; position: relative; }
[rst-lrow]:last-child { border-bottom: 0; }
[rst-lrow~="head"] { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); font-weight: 550; letter-spacing: 0.05em; padding: 0.55rem 1rem; text-transform: uppercase; }
/* The list grid's primary link is its identity cell: the rst-nm link,
   or a person link when a person is who the row is. Its ::after covers
   the row, as list-row-action's does. One identity cell per row: with
   both, the later overlay wins and the earlier link is unreachable. */
[rst-lrow] > a.rst-nm::after, [rst-lrow] > a[rst-person]::after { content: ""; inset: 0; position: absolute; }
/* A list grid can be a table: role="table" on the card, named by its
   heading, role="row" on each row, columnheader in the head row, and a
   rowheader cell holding the identity link. Every rule that names the
   row's own link names it in that cell too. The link stays unpositioned,
   or its ::after would cover the cell and not the row. */
[rst-lrow] > [role="rowheader"] > a.rst-nm::after, [rst-lrow] > [role="rowheader"] > a[rst-person]::after { content: ""; inset: 0; position: absolute; }
[rst-lrow] > [role="rowheader"] > a.rst-nm, [rst-lrow] > [role="rowheader"] > a[rst-person] { position: static; z-index: auto; }
[rst-lrow] > [role="rowheader"] { min-width: 0; }
[rst-lrow] > [role="rowheader"] > a.rst-nm { display: block; }
.rst-nm { border-radius: var(--rst-radius-sm); color: inherit; font-weight: 550; min-width: 0; text-align: start; text-decoration: none; }
a.rst-nm:hover { color: var(--rst-accent); }
.rst-nm small { color: var(--rst-text-muted); display: block; font-size: var(--rst-fs-xs); font-weight: 400; }
.rst-cell-mut { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[rst-no-match] { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); padding: 1.6rem 1rem; text-align: center; }
[rst-count-line] { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); margin: 0.7rem 0 0; }
/* Controls above the overlay. A positioned overlay paints above every
   element that is not positioned, whatever the DOM order, so without
   this a checkbox before the name link would be covered and a tap on it
   would open the item.

   It lifts the CONTROLS, never their containers: lifting a row menu's
   <details> would make it a stacking context and trap its open panel
   under the next row's lifted controls. The :not() is attached to the
   :is() with no space, so it filters the controls themselves; with a
   space it is a descendant combinator and lifts things inside them.
   The primary link is excluded, or its ::after would measure against
   the link instead of the row. A media-grid tile is a row of this
   kind too: its name link covers the tile, and its checkbox and kebab
   are the controls lifted over it.

   The whole selector is inside :where(), so it weighs nothing: its job
   is to give an otherwise static control a position and a z-index, and
   never to replace a position a component chose. The switch's input,
   the date field's pick button and select.js's hidden native select are
   all absolutely placed, and at zero weight their own rules win
   position while z-index still applies; at any weight they would be
   pulled back into flow, out of the boxes they were drawn for.

   Each lifted control is a stacking context at z-index 1, so a popup
   it draws itself (a tooltip's [rst-tip]::after) paints under the next
   row's lifted controls. Do not put such a control in a row without
   raising it. */
:where(:is([rst-row], [rst-lrow]) :is(a[href], button, summary, label, input, select, textarea):not([rst-row-main] > a, [rst-lrow] > a.rst-nm, [rst-lrow] > a[rst-person], [rst-media-name] > a)) { position: relative; z-index: 1; }
/* A quiet lift, no sheen: lists are for reading, and a sheen means
   "press this". The lift is a tint, a highlight along the top edge and
   a shade along the bottom, all inside the row: never a position, a
   z-index or an outer shadow, because the :where() rule above keeps a
   row menu's panel above the rows below it, and a stacking context
   here would trap the panel. Pressed, or with its overlay link active,
   the whole row takes the press tint, so a tap on the link and a tap
   on the row look the same.

   Three row idioms, one lift: the list grid's row, the list-row-action
   row and the media tile, each through the filter that already says
   which rows are links. Two press rules per family: hovered with the
   link active, inside the hover query, reads the press tint (a mouse
   pressing a hovered row); the link active alone, outside it, reads
   the tap tint (a finger, which hovers nothing; transparent in every
   theme today). The list-row-action row keeps its own pair of tokens
   because it hovers to --rst-surface-2 today, not to the accent tint;
   the tile keeps its own pair because it had no hover at all, so a
   flat theme reads its surface in every state and a tap never shows
   the page through it.

   The 0.25s fade is declared on the hover rules, not at rest: a
   transition at rest also ran on a scheme change, and an app's own
   switch, which never calls rastrillo.js's land(), showed the new
   text on the old ground for a quarter of a second (Astra A3).
   Hover-in fades; hover-out, a press and a scheme change land at
   once. */
[rst-lrow]:not([rst-lrow~="head"]):has(> a.rst-nm:active, > a[rst-person]:active), [rst-lrow]:not([rst-lrow~="head"]):has(> [role="rowheader"] > a.rst-nm:active, > [role="rowheader"] > a[rst-person]:active), [rst-row]:has(> [rst-row-main] > a:active) { background-color: var(--rst-tint-tap, transparent); box-shadow: inset 0 1px 2px var(--rst-depth-ambient, transparent); transition: none; }
@media (hover: hover) {
  [rst-lrow]:not([rst-lrow~="head"]):has(> a.rst-nm, > a[rst-person]):hover, [rst-lrow]:not([rst-lrow~="head"]):has(> [role="rowheader"] > a.rst-nm, > [role="rowheader"] > a[rst-person]):hover { --rst-hover: 100%; --rst-pressed: 0%; background-color: color-mix(in srgb, var(--rst-tint-press, var(--rst-accent-soft)) var(--rst-pressed), color-mix(in srgb, var(--rst-tint-hover, var(--rst-accent-soft)) var(--rst-hover), transparent)); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--rst-depth-hl, transparent) var(--rst-hover), transparent), inset 0 -1px 0 color-mix(in srgb, var(--rst-depth-contact, transparent) var(--rst-hover), transparent); transition: --rst-hover 0.25s ease, --rst-pressed 0.25s ease; }
  [rst-row]:has(> [rst-row-main] > a):hover { --rst-hover: 100%; --rst-pressed: 0%; background-color: color-mix(in srgb, var(--rst-row-tint-press, var(--rst-surface-2)) var(--rst-pressed), color-mix(in srgb, var(--rst-row-tint-hover, var(--rst-surface-2)) var(--rst-hover), transparent)); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--rst-depth-hl, transparent) var(--rst-hover), transparent), inset 0 -1px 0 color-mix(in srgb, var(--rst-depth-contact, transparent) var(--rst-hover), transparent); transition: --rst-hover 0.25s ease, --rst-pressed 0.25s ease; }
  [rst-lrow]:not([rst-lrow~="head"]):hover:has(> a.rst-nm:active, > a[rst-person]:active), [rst-lrow]:not([rst-lrow~="head"]):hover:has(> [role="rowheader"] > a.rst-nm:active, > [role="rowheader"] > a[rst-person]:active) { --rst-pressed: 100%; background-color: var(--rst-tint-press, var(--rst-accent-soft)); box-shadow: inset 0 1px 2px var(--rst-depth-ambient, transparent); transition: none; }
  [rst-row]:hover:has(> [rst-row-main] > a:active) { --rst-pressed: 100%; background-color: var(--rst-row-tint-press, var(--rst-surface-2)); box-shadow: inset 0 1px 2px var(--rst-depth-ambient, transparent); transition: none; }
}
@media (max-width: 800px) {
  .rst-m-hide { display: none; }
  [rst-lrow], [rst-lrow~="head"] { grid-template-columns: minmax(0, 1fr) auto var(--rst-col-menu); }
  /* A row with nothing between its first cell and its kebab leaves the
     auto column empty, but both column gaps stay: 13.6px the name could
     not use, enough to push a word onto a second line at 390. The name
     spans the empty column instead. A row with a shown middle cell, or
     a head row (whose last cell is not a kebab), does not match. */
  [rst-lrow]:not(:has(> :not(:first-child, .rst-m-hide, [rst-row-menu]))) > :first-child { grid-column: 1 / -2; }
}
.rst-danger { color: var(--rst-tone-negative-fg); }

[rst-caret] { align-items: center; color: var(--rst-text-faint); display: inline-flex; font-size: 0.8em; transition: transform 0.15s; }
/* 12px, smaller than an icon's 16: the chevron marks a disclosure and
   should not read as a second control beside its label. */
[rst-caret] svg, [rst-caret] .icon { display: block; height: 0.75rem; width: 0.75rem; }
details[open] > summary > [rst-caret] { transform: rotate(180deg); }

/* Reduced motion: the caret's rotate transition is the only new
   animation this batch adds. Everything else here (hover fills, colour
   changes) is not a "large motion" trigger under 2.3.3, so it does not
   need a rule here too. */
@media (prefers-reduced-motion: reduce) {
  [rst-caret] { transition: none; }
  /* A press neither fades nor drops: the fade is the transition, and
     the drop is a token, so the override needs no state selector.
     html:root outranks the theme's :root, which is the only reason for
     the doubled selector. */
  [rst-btn] { transition: none; }
  html:root { --rst-press-drop: 0px; }
  /* A row's lift lands at once rather than easing in (A8). The fade
     sits on the hover rules (Astra A3), so these are the hover rules. */
  [rst-lrow]:not([rst-lrow~="head"]):has(> a.rst-nm, > a[rst-person]):hover, [rst-lrow]:not([rst-lrow~="head"]):has(> [role="rowheader"] > a.rst-nm, > [role="rowheader"] > a[rst-person]):hover, [rst-row]:has(> [rst-row-main] > a):hover { transition: none; }
}

/* ── The form family: field, switch, choice cards, seg-tabs, layout ── */

/* fields — bare on the page, one column; a card in a form is reserved
   for collections, toggle blocks, and choice cards. */
[rst-field] { margin: var(--rst-sp-4) 0; }
[rst-field-label] { color: var(--rst-text-muted); display: block; font-size: var(--rst-fs-sm); margin: 0 0 0.2rem; }
[rst-field-hint] { color: var(--rst-text-faint); font-weight: 400; }
/* box-sizing is set here rather than in a `*` reset, because this file
   promises exactly one collision surface with an app's own CSS: the
   rst- prefix. Without it width:100% is the CONTENT box, so an input
   overflowed its own wrapper by its padding and borders — 21px for a
   plain field, 47px once .rst-dtp__input reserves room for the picker
   button. That overflow was three of this batch's visible bugs at once:
   an input running under the field beside it in a row, an input running
   out of its card, and a picker button anchored to the wrapper landing
   47px short of the input's visible end. */
[rst-input] { background: var(--rst-surface); border: 1px solid var(--rst-line-strong); border-radius: var(--rst-radius-sm); box-shadow: inset 0 1px 1px var(--rst-depth-ambient, transparent); box-sizing: border-box; color: inherit; font: inherit; padding: 0.45rem 0.6rem; width: 100%; }
/* The zoom floor for the input, and why it is HERE. `font: inherit` in
   the rule above resets font-size, so a floor placed before it would be
   reset with it; the primary rule below sizes the field on purpose, so
   the floor must come before that or it wins the tie and pulls a 19px
   field down to 16. max(1rem, 1em) lifts a field whose parent is small
   (a bulk bar, a menu panel) to 16px; 1em in font-size is the PARENT's
   size, which is exactly why it cannot also keep a large field large —
   the bug the old single floor had. A :where() spelling was rejected: at
   zero weight it loses to `font: inherit` above and switches itself off.
   ui/sizing_test.go holds all three floors to their positions. */
@media (pointer: coarse), (max-width: 40rem) {
  [rst-input] { font-size: max(1rem, 1em); }
}
/* iOS Safari draws a date, time or datetime-local input as its own
   native control, and while it does the control keeps a minimum width
   of its own that width: 100% does not shrink: on a phone the field ran
   past its column and the page scrolled sideways (discussion #46).
   Taking the field off the native appearance gives it the width its
   column gives every other field; a tap still opens the native picker.
   Only the appearance: a display here would outrank the UA's [hidden]
   and .rst-m-hide, and desktop Safari pads a block date field's inside.
   Neither min-width: 0 nor max-width: 100% is needed: the floor block
   below already replaces the automatic minimum, and a minimum wins over
   a maximum anyway. Nor a height: an empty field, with no text to hold
   it open, is held at --rst-target by the same floor.
   check/datefield_phone_browser_test.go stands in the native minimum,
   since no browser off an iPhone draws it. */
input[rst-input][type="date"], input[rst-input][type="time"], input[rst-input][type="datetime-local"] { -webkit-appearance: none; appearance: none; }
/* Off the native appearance, iOS centres the value; a field's text
   starts at its start edge, as a text field's does. A rule of its own:
   a browser that does not know the pseudo-element drops the rule. */
input[rst-input]::-webkit-date-and-time-value { text-align: start; }
/* A field sits slightly into the page: a 1px inset ambient shadow, and
   the control border, which stays --rst-line-strong at 3:1. Focus is one
   ring, not two: the field's own edge turns to the focus edge, the 2px
   accent outline sits flush against it, and the 3px halo flush against
   that. The outline used to stand 2px off a grey edge, and the edge, the
   gap and the outline read as a double border. The outline is still the
   indicator, never the halo: the edge changes from --rst-line-strong to
   the accent at under 3:1 in every theme (1.7:1 in Day), and the halo
   from the surface at 1.4:1, so neither counts toward WCAG 2.4.13; the
   outline's 2px, drawn from the surface, are 5.5:1 to 18.9:1. A halo of
   5px is 3px past the outline. Forced colours drop the edge colour and
   the halo and keep the outline, in the reader's own colour.
   check/focus_ring_browser_test.go measures it. */
[rst-input]:focus-visible { border-color: var(--rst-focus-edge, var(--rst-accent)); box-shadow: inset 0 1px 1px var(--rst-depth-ambient, transparent), 0 0 0 5px var(--rst-focus-halo, transparent); outline: 2px solid var(--rst-accent); outline-offset: 0; }
/* short is compact, not tiny: 8rem is a border-box width, so it renders
   within a pixel or two of the old 6.5rem content box plus its padding,
   and it is wide enough for the postcodes and codes it is for. The
   max keeps it from overflowing a column narrower than itself. */
[rst-input~="short"] { inline-size: 8rem; max-inline-size: 100%; }
/* primary is the form's headline field — the title or name the record is
   known by — and the size is the whole signal, because the label above it
   stays the same quiet line every other field gets. font-size has to be
   restated rather than inherited: .rst-input sets `font: inherit`, so the
   shorthand would otherwise reset it back to the body's 14px. 550 is the
   weight .rst-nm and .rst-person__name already give a name; 600 reads as a
   heading, which this is not. The padding grows with the type so the box
   keeps its proportions instead of looking like a squeezed plain input.
   17px is also where iOS Safari stops zooming a focused input, which the
   14px base does not clear — a real bonus, not the reason. */
[rst-input~="primary"] { font-size: var(--rst-fs-lg); font-weight: 550; padding: 0.6rem 0.7rem; }
textarea[rst-input] { min-height: 5rem; resize: vertical; }
/* field-text/field-textarea (the interim pair the manifest generator
   emits) mark a required label with * and put the textarea on its own
   class; styled here so both field families render finished. */
[rst-field-required] { color: var(--rst-tone-negative-fg); }
[rst-textarea] { background: var(--rst-surface); border: 1px solid var(--rst-line-strong); border-radius: var(--rst-radius-sm); box-shadow: inset 0 1px 1px var(--rst-depth-ambient, transparent); box-sizing: border-box; color: inherit; font: inherit; line-height: 1.6; min-height: 5rem; padding: 0.45rem 0.6rem; resize: vertical; width: 100%; }
/* The textarea's zoom floor, directly after the rule whose `font:
   inherit` would reset it: a floor above that line is dead, undone by
   the reset. Reasoning as for the input floor above. */
@media (pointer: coarse), (max-width: 40rem) {
  [rst-textarea] { font-size: max(1rem, 1em); }
}
/* Sunk and focused as .rst-input is, for the reason given there. */
[rst-textarea]:focus-visible { border-color: var(--rst-focus-edge, var(--rst-accent)); box-shadow: inset 0 1px 1px var(--rst-depth-ambient, transparent), 0 0 0 5px var(--rst-focus-halo, transparent); outline: 2px solid var(--rst-accent); outline-offset: 0; }
/* The textarea grows with its text: field-sizing: content, from the
   5rem minimum above (which the touch query leaves alone, so a phone
   keeps it too) to half the viewport, past which it scrolls. Half,
   because a long paste in a box with no cap pushed the label above it
   and the button below it off the screen; a fixed number of lines
   would be most of a phone and a sliver of a desktop. resize: vertical
   still works, and a box the reader drags stays the size they chose.
   Its rows attribute no longer sets a height where this applies: the
   box is its text. An engine without field-sizing keeps the fixed,
   resizable 5rem box, and the cap is inside the @supports so that box
   can still be dragged as tall as it could before. Layout, not a size
   floor, so it is here and not in the floor block. */
@supports (field-sizing: content) {
  [rst-textarea] { field-sizing: content; max-block-size: 50dvh; }
}
/* The three message lines under a control. display:block is load-bearing
   rather than cosmetic: the field partial emits them as <p>, and the
   field-text/date/time/select family as <small>, and an inline <small>
   silently drops the top margin — so the same message sat at two
   different distances from its control depending on which partial drew
   it. The hint's class is shared with the inline parenthetical inside a
   label in the field partial, so only the <small> form is blocked out. */
[rst-field-help] { color: var(--rst-text-muted); display: block; font-size: var(--rst-fs-xs); margin: 0.45rem 0 0; }
[rst-field-error] { color: var(--rst-tone-negative-fg); display: block; font-size: var(--rst-fs-xs); margin: 0.45rem 0 0; }
small[rst-field-hint] { display: block; font-size: var(--rst-fs-xs); margin: 0.45rem 0 0; }

/* choice cards — whole-card target, native input visible. */
[rst-choice] { border: 0; margin: var(--rst-sp-4) 0; padding: 0; }
[rst-choice] > legend { font-size: var(--rst-fs-sm); font-weight: 600; margin: 0 0 0.45rem; padding: 0; }
[rst-choice-cards] { display: grid; gap: 0.5rem; }
[rst-choice-cards] label { align-items: flex-start; border: 1px solid var(--rst-line); border-radius: var(--rst-radius); cursor: pointer; display: flex; gap: 0.7rem; margin: 0; padding: 0.75rem 0.95rem; }
[rst-choice-cards] label:hover { border-color: var(--rst-accent); }
[rst-choice-cards] input { accent-color: var(--rst-accent); flex: none; margin-top: 0.18rem; }
[rst-choice-title] { display: block; font-size: var(--rst-fs-sm); font-weight: 550; line-height: 1.35; }
[rst-choice-desc] { color: var(--rst-text-muted); display: block; font-size: var(--rst-fs-xs); line-height: 1.4; }
[rst-choice-cards] label:has(input:checked) { background: var(--rst-accent-soft); border-color: var(--rst-accent); }
[rst-choice-cards] label:has(input:focus-visible) { outline: 2px solid var(--rst-accent); outline-offset: 2px; }

/* form layout — the interview rhythm and the save bar. */
[rst-form-flow] > [rst-field] + [rst-field] { margin-top: var(--rst-sp-5); }
/* field-row aligns by the CONTROL row, not by the bottom of the box.
   align-items:end was the bug: a field carrying an error is taller than
   its sibling, so bottom-aligning it lifted its input clear of the row
   and dropped its error line across the field beside it.

   Judged against grid-with-subgrid, which does align label/control/
   message tracks across siblings exactly: subgrid needs the row to be a
   grid, and a grid cannot express what this row is for. grid-auto-flow:
   column never wraps, so a narrow screen overflows instead of stacking;
   and grid-auto-columns is one value for every column, so rst-grow — a
   wide field beside a short one — cannot be said at all. Flex keeps
   both. What align-items:start gives up is a row whose fields have
   label boxes of different heights; the ::before below buys back the
   common case of that (a field with no label at all), and a label long
   enough to wrap is a field that wants its own row.

   The message then flows under its own column and shifts no sibling,
   which is the second half of the fix — it needs the border-box on
   .rst-input above to hold, or the control overflows the column the
   message is measured against. */
[rst-field-row] { align-items: start; display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0; }
[rst-field-row] [rst-field] { margin: 0; }
[rst-field-row] > [rst-field] { flex: 0 1 auto; min-inline-size: 8rem; }
[rst-field-row] > .rst-grow { flex: 1 1 12rem; }
/* A field in a row with no label reserves the label's line anyway, so
   its control still lines up with a labelled sibling's. It measures
   that line rather than restating it: the same font-size .rst-field__label
   declares, one lh of the line-height both of them inherit, and the
   label's own bottom margin.

   The two block-size declarations are one value with a fallback, not a
   duplicate: an engine that has :has() but not the lh unit drops the
   second line and keeps the calc. That window is real — :has() shipped
   in Chrome 105 and Safari 15.4, lh in Chrome 109 and Safari 16.4 — so
   Chrome 105-108 and Safari 15.4-16.3 render this rule and would
   otherwise reserve a zero-height line. They get the body's 1.5
   line-height as a number; everything newer measures the line itself
   and the copy stops mattering. Firefox never sees the calc: lh landed
   there in 120 and :has() in 121, so any Firefox that matches this
   selector already has the unit. */
[rst-field-row] > [rst-field]:not(:has(> [rst-field-label]))::before { block-size: calc(var(--rst-fs-sm) * 1.5); block-size: 1lh; content: ""; display: block; font-size: var(--rst-fs-sm); margin-block-end: 0.2rem; }
/* A row is sized by its controls, never by its messages: contain keeps a
   long error out of the field's max-content width, so the sentence wraps
   under its own control instead of stretching the column it belongs to
   and squeezing the field beside it. */
[rst-field-row] > [rst-field] > :is([rst-field-help], [rst-field-error], [rst-field-hint]) { contain: inline-size; }
/* field-daterange — the fieldset reset the grouped start/end pair needs,
   with the legend sized like a field label. Its own selector rather than
   a share of .rst-choice: the two groups look alike today, and a card
   tweak there must not silently reshape a date range. */
[rst-field-range] { border: 0; margin: var(--rst-sp-4) 0; padding: 0; }
[rst-field-range] > legend { font-size: var(--rst-fs-sm); font-weight: 600; margin: 0 0 0.45rem; padding: 0; }
[rst-field-range] > [rst-field-row] { margin: 0; }
[rst-form-bar] { align-items: center; background: var(--rst-bg); border-top: 1px solid var(--rst-line); bottom: 0; display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.75rem; padding: 0.8rem 0; position: sticky; z-index: 5; }
[rst-form-bar] [rst-form-bar-note] { color: var(--rst-text-muted); font-size: var(--rst-fs-xs); margin-inline-end: auto; }
[rst-form-actions] { display: flex; gap: 0.5rem; justify-content: flex-end; }
/* form/form-foot — the container the form-foot partial's callers wrap
   fields in, and the closing action row form-foot itself emits. */
/* One spacing mechanism, not two. The form is a flex column, so its
   children's own stacking margins never collapse — they were added to
   the gap, and they were also added at the two ends, where nothing is
   being separated from anything. Inside a card holding a single field
   that was the whole of the dead space under the control: 16px of
   field margin on top of the card's own padding, at both ends. The gap
   is now the rhythm (the same var(--rst-sp-5) .rst-form-flow uses
   between its fields) and the blocks contribute no margin of their
   own.

   Stated as a rule over every child rather than as a list of the
   classes we happen to ship: a list is a promise this file cannot keep,
   because it cannot name .rst-callout's successor, and it cannot name
   an app's own div at all — and a child the list forgot lands at gap
   plus its own two margins, which is the bug this rule exists to
   prevent. So: the form owns the block rhythm, full stop, and the two
   deliberate exceptions are exempted here where they can be read.
   .rst-form-foot and .rst-form-bar both set a block-start margin that
   is not rhythm — it is the extra air that separates a closing action
   row from the last question above it. */
[rst-form] { display: flex; flex-direction: column; gap: var(--rst-sp-5); max-inline-size: 44rem; }
[rst-form] > *:not([rst-form-foot], [rst-form-bar]) { margin-block: 0; }
/* The closing action row the form-foot partial emits. It was
   rst-form__foot until the markup flip (spec §6-v3): BEM's __ flattens
   to a hyphen, so it and the sticky save bar above wanted the same
   attribute, and a name the partial emits is the one that should own
   the name the partial is called. The save bar, which no partial emits
   and every caller writes by hand, is rst-form-bar now. */
[rst-form-foot] { display: flex; gap: var(--rst-sp-3); margin-block-start: var(--rst-sp-3); }

/* ── stack: a page's vertical rhythm ──────────────────────────────────
   The blocks a screen is written in, a heading, a paragraph, a hint, a
   card, a row of buttons, are spaced by the stack they sit in and by
   nothing else. Hand-rolled margins gave every screen its own rhythm:
   a heading further from its own text than from the section before
   it, a hint resting on the button under it. So a stack is a flex
   column, where no margin collapses, every child's own block margins
   are zeroed, and the space before each child is read off one table
   by what it is and what it follows (DESIGN.md, "The stack"):

     after a heading (h1 to h6), unless it is
       a heading or a section                 --rst-sp-2
     before an actions row, a button          --rst-sp-4
     a label or hint, then its input, or an
       input, then its hint                   --rst-sp-2
     before h1, h2 or a section, or after
       the page header                        --rst-sp-5
     before h3 to h6                          --rst-sp-4
     anything else                            --rst-sp-3

   Higher in the table wins. A heading or a section after a heading
   takes its own opening: the heading over it is what it belongs to,
   and the audit's heading rule holds the one that follows instead.
   Each relation sets its own custom property on the child, and the one
   margin rule reads them in the table's order through var() fallbacks,
   so which rule wins is written in one place rather than left to
   specificity. Every child resets all five first, so a nested stack's
   child never inherits its parent's answer. rst-section marks a child
   that opens a new section; a section that holds blocks of its own is
   a stack too, <section rst-stack rst-section>.

   The column's gap is the table's smallest step, --rst-sp-2, and a
   child's block-start margin is the rest of its answer.

   Some children are passed over: not drawn, or not in the column. A
   [hidden] child, a hidden input (a form's CSRF field, an edit form's
   old values), a <dialog> or a popover, a script, a style or a
   template, Fiesta's modal overlay, a visually hidden .rst-sr-only
   child, and anything an app marks rst-stack-out, its own fixed or
   absolute layer, take no margin and keep their own (a dialog's auto
   margins centre it), and the block after one is spaced
   as if it were not there: the first block after one still opens the
   stack flush, and any other takes its own row of the table. CSS has no
   selector for a computed position, so an app's own overlay is marked,
   and the rhythm audit reports one that is not. A passed-over child
   never anchors a relation (a hidden heading does not make the block
   after it its content). A relation that reads the block before (after
   a heading, after the page header, a field and its label or hint)
   sees past two passed-over children in a row; with three or more
   between, the block keeps its own row but loses the relation. A
   field select.js or datetime.js has drawn (rst-combo, rst-dtp) is a
   field, in a stack spelt [rst-stack], as the scripts spell it; the
   native select select.js leaves beside it, .rst-sr-only, is passed
   over. A .rst-sr-only control shown on keyboard focus is still
   passed over, so it sits at the column's gap while it shows. */
[rst-stack] { display: flex; flex-direction: column; gap: var(--rst-sp-2); }
[rst-stack] > :not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) {
  --rst-stack-actions: initial;
  --rst-stack-heading: initial;
  --rst-stack-control: initial;
  --rst-stack-section: initial;
  --rst-stack-sub: initial;
  margin-block: 0;
}
[rst-stack] > :not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) ~ :not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) {
  margin-block-start: calc(var(--rst-stack-heading, var(--rst-stack-actions, var(--rst-stack-control, var(--rst-stack-section, var(--rst-stack-sub, var(--rst-sp-3)))))) - var(--rst-sp-2));
}
/* A column stretches its children across; a button or a picture keeps
   its own width. */
[rst-stack] > button, [rst-stack] > [rst-btn], [rst-stack] > img { align-self: flex-start; }
[rst-stack] > :not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) ~ :is(h3, h4, h5, h6) { --rst-stack-sub: var(--rst-sp-4); }
[rst-stack] > :not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) ~ :is(h1, h2, [rst-section]),
[rst-stack] > :is([rst-page-header]:not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), [rst-page-header]:not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), [rst-page-header]:not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template)) + :not([hidden]) { --rst-stack-section: var(--rst-sp-5); }
[rst-stack] > :is(:is(label, [rst-field-help]):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), :is(label, [rst-field-help]):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), :is(label, [rst-field-help]):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template)) + :is(input, select, textarea, [rst-combo], [rst-dtp]),
[rst-stack] > :is(:is(input, select, textarea, [rst-combo], [rst-dtp]):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), :is(input, select, textarea, [rst-combo], [rst-dtp]):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), :is(input, select, textarea, [rst-combo], [rst-dtp]):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template)) + [rst-field-help] { --rst-stack-control: var(--rst-sp-2); }
[rst-stack] > :is(:is(h1, h2, h3, h4, h5, h6):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), :is(h1, h2, h3, h4, h5, h6):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template), :is(h1, h2, h3, h4, h5, h6):not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) + :is([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template)) + :not(h1, h2, h3, h4, h5, h6, [rst-section]) { --rst-stack-heading: var(--rst-sp-2); }
[rst-stack] > :not([hidden], [type="hidden"], [rst-stack-out], [rst-modal-overlay], .rst-sr-only, dialog, [popover], script, style, template) ~ :is([rst-actions], [rst-form-foot], [rst-form-actions], button, [rst-btn]) { --rst-stack-actions: var(--rst-sp-4); }
/* The actions row: buttons, links styled as buttons, and the one-button
   forms a POST action needs, side by side and wrapping on a phone. A
   form stays a box (display: contents would make it one no driver can
   see), and a one-button form is as wide as its button. */
[rst-actions] { align-items: center; display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); }

/* ── The routes family: confirm, toggle-block, modal shells, bulk-bar,
      help ────────────────────────────────────────────────────────── */

/* modal route — its own URL: the response renders the page you'll
   return to inside an inert backdrop, then the overlay. Closing is a
   plain link to that page. */
[rst-backdrop] { display: contents; }
/* The scroll lock. It used to shift the whole page sideways as it
   landed, because taking the scrollbar away takes its width away too;
   --rst-scrollbar-gutter at the top of this file reserves that width
   whether or not a scrollbar is in it, so the page now stays put. */
body:has([rst-backdrop]) { overflow: hidden; }

/* help — a bordered ? icon-link to a section's help article: plain <a>,
   new tab, CSS tooltip. The tooltip is NOT the accessible name — the
   link must carry a full aria-label of its own. */
[rst-help] { align-items: center; border: 1px solid var(--rst-line-strong); border-radius: 7px; color: var(--rst-text-muted); display: inline-flex; height: 28px; justify-content: center; position: relative; width: 28px; }
[rst-help]:hover { border-color: var(--rst-text-faint); color: var(--rst-text); }
[rst-help] svg, [rst-help] .icon { height: 1rem; width: 1rem; }
[rst-tip]::after { background: var(--rst-text); border-radius: var(--rst-radius-sm); color: var(--rst-bg); content: attr(data-tip); font-size: var(--rst-fs-xs); font-weight: 500; inset-inline-end: 0; opacity: 0; padding: 3px 8px; pointer-events: none; position: absolute; top: calc(100% + 6px); transition: opacity 0.12s; white-space: nowrap; z-index: 35; }
[rst-tip]:hover::after, [rst-tip]:focus-visible::after { opacity: 1; }

/* ── media-grid: image tiles in an even frame ─────────────────────────
   The columns come from the width: as many 12.5rem tiles as fit, each
   stretched to share its row, and one column once two do not fit.
   min(100%, …) keeps a 12.5rem tile from forcing a sideways scroll at
   320px. Inside a list card the grid pads itself, because a card holds
   rows and pads nothing. */

[rst-back-nav] { margin: 0 0 var(--rst-sp-3); }
[rst-back-nav] a { color: var(--rst-text-muted); text-decoration: none; }
[rst-back-nav] a:hover { color: var(--rst-accent); }
[rst-notice] { background: var(--rst-tone-positive-bg); border-radius: var(--rst-radius-sm); color: var(--rst-tone-positive-fg); font-size: var(--rst-fs-sm); padding: 0.5rem 0.75rem; }
[rst-form-error] { color: var(--rst-tone-negative-fg); font-size: var(--rst-fs-sm); }

@media (prefers-reduced-motion: reduce) {
  [rst-tip]::after { transition: none; }
}

/* rst-spin — the working indicator a status page or busy button wears.
   Pure CSS; reduced-motion users get a steady dimmed ring instead of
   rotation. */
[rst-spin] {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  /* Physical on purpose: the gap in a ring that rotates a full turn
     every 0.8s has no start or end side to mirror. */
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: rst-spin 0.8s linear infinite;
}
@keyframes rst-spin { to { transform: rotate(1turn); } }

/* A running job's determinate bar: a native <progress>, styled the same
   way and for the same reasons as [rst-meter-bar] — see that block for
   why the three engines need three rules that cannot be merged, and for
   the same honest flag about the -moz- one being unverified here.
   <progress>'s pseudo-elements are its own: ::-webkit-progress-bar is
   the track, ::-webkit-progress-value the fill, ::-moz-progress-bar the
   fill. It is a block on its own line under the sentence, because it
   measures the job the sentence is about. */
[rst-job-bar] { appearance: none; background: var(--rst-accent-soft); block-size: 4px; border: 0; border-radius: 2px; display: block; inline-size: 100%; margin-block-start: var(--rst-sp-2); }
[rst-job-bar]::-webkit-progress-bar { background: var(--rst-accent-soft); border-radius: 2px; }
[rst-job-bar]::-webkit-progress-value { background: var(--rst-accent); border-radius: 2px; }
[rst-job-bar]::-moz-progress-bar { background: var(--rst-accent); border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  [rst-spin] { animation: none; opacity: 0.5; }
}

/* ── Shells: the page frames an app's layout template wraps .rst-page
      in — topbar and sidebar. Written in logical properties throughout,
      so a right-to-left locale gets a mirrored shell for free: the rail
      moves to the inline end, the account menu with it, and nothing
      here needs a second rule. ─────────────────────────────────────── */

/* skip link — first in the DOM of every shell, out of sight until it
   takes focus, then a real chip at the block/inline start. A keyboard
   user must be able to jump the nav; this is the whole mechanism. */
[rst-skip] { block-size: 1px; clip-path: inset(50%); inline-size: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
[rst-skip]:focus-visible { background: var(--rst-surface); block-size: auto; border: 1px solid var(--rst-accent); border-radius: var(--rst-radius-sm); clip-path: none; color: var(--rst-text); inline-size: auto; inset-block-start: var(--rst-sp-2); inset-inline-start: var(--rst-sp-2); overflow: visible; padding: 0.4rem 0.7rem; text-decoration: none; z-index: 60; }

/* ── rst-stage: the stage shell (layouts/stage.html) ─────────────────
   One card centred on a full-page backdrop. [rst-stage] is <body> in
   the shell and a plain wrapper in the design-system gallery's frames,
   so nothing here assumes which element carries it. The scene is
   absolutely positioned inside it rather than fixed, so a page taller
   than the window scrolls the picture with it instead of sliding the
   card over a still image. The page column stacks its children and
   centres each one, rather than laying them in a row: the card is
   usually alone, but a line of text above or below it must not end up
   beside it. inline-size: 100% because [rst-page]'s auto margins make
   a grid item shrink to its content, and a card sized in percent would
   shrink with it. */
[rst-stage] { box-sizing: border-box; display: grid; grid-template-rows: 1fr auto; isolation: isolate; min-block-size: 100dvh; position: relative; }
[rst-stage] > [rst-page] { align-items: center; align-self: center; display: flex; flex-direction: column; inline-size: 100%; position: relative; z-index: 1; }
[rst-stage-scene] { inset: 0; overflow: hidden; pointer-events: none; position: absolute; z-index: 0; }
[rst-stage-scene] > * { block-size: 100%; display: block; inline-size: 100%; object-fit: cover; }
[rst-stage-foot] { color: var(--rst-text-muted); padding: var(--rst-sp-4); position: relative; text-align: center; z-index: 1; }
/* The art's two colours: the line colour and a little accent, each
   mixed into the page background, faint enough that the sign-in card's
   border still clears 3:1 against them in every theme and scheme —
   ui/contrast_test.go reads these two color-mix() calls and checks
   exactly that. Lower the percentages rather than loosen the test.
   non-scaling-stroke keeps the lines fine on a wide screen, where the
   viewBox is scaled up to cover it. */
[rst-stage-art-lines] { fill: none; stroke: color-mix(in srgb, var(--rst-line) 70%, var(--rst-bg)); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
[rst-stage-art-glow] { fill: color-mix(in srgb, var(--rst-accent) 8%, var(--rst-bg)); fill-opacity: 0.2; }
/* Forced colours would paint the lines in the system's text colour at
   full strength, and a printout does not need a picture of waves. */
@media (forced-colors: active) {
  [rst-stage-art] { display: none; }
}
@media print {
  [rst-stage-art] { display: none; }
}

/* error page — one centred column, whatever shell it lands in: the
   status as a quiet label above the sentence, one or two ways out, and
   the reference last, where an operator asked to quote it will find it.
   Logical properties throughout, so an RTL locale mirrors it with no
   second rule. Since 1.7 the page is a stack, <div rst-error rst-stack>
   with its ways out an actions row, <p rst-error-cta rst-actions>, and
   the stack spaces its blocks by its table: the title opens a section
   after the status, the sentence is the title's content, and the
   reference is anything else, so the title sits closer to its sentence
   than to the status above it. The margins below are 1.0's, for an
   error page that is not a stack; the stack's rules outweigh them. */
[rst-error] { margin-inline: auto; max-inline-size: 28rem; padding-block: 4rem var(--rst-sp-6); padding-inline: var(--rst-sp-4); text-align: center; }
[rst-error-status] { color: var(--rst-text-faint); font-size: var(--rst-fs-xs); font-weight: 600; letter-spacing: 0.08em; margin: 0; }
[rst-error-title] { color: var(--rst-text); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin-block: var(--rst-sp-2) 0; }
[rst-error-body] { color: var(--rst-text-muted); margin-block: var(--rst-sp-3) 0; }
[rst-error-cta] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); justify-content: center; margin-block: var(--rst-sp-5) 0; }
[rst-error-ref] { color: var(--rst-text-faint); margin-block: 2rem 0; }

/* ---------------------------------------------------------------------
   Touch: the two zooms nobody asked for.

   Mobile Safari zooms the whole page when it focuses a form control
   whose text is under 16px. The touch step at the top of this file
   makes body text 16px, but controls inherit their size and some sit in
   a smaller parent, so every text-entry control still has a floor. It
   is written twice, because one spelling cannot do both jobs:

   - the component floors (.rst-input, .rst-textarea, the search input)
     sit directly after the rule that resets each one's font, at that
     rule's weight, and before any rule that sizes the field on purpose.
     max(1rem, 1em) is the floor; 1em in font-size is the PARENT's size,
     so a floor that came after the primary field's rule would shrink
     it. That was a bug here once: a single floor sat
     here, after [rst-input~="primary"] at equal weight, and turned the
     17px primary field into 16px.
   - the floor below, for an app's own input with no rst- attribute,
     is wholly inside :where(): the UA stylesheet is what sizes such a
     field, any author rule beats it, and any rule the app writes to size
     its own field still wins.

   rem rather than px so a reader who raised the browser default keeps
   the increase. user-scalable=no in the viewport tag would buy the same
   quiet by taking pinch-zoom from everyone, which fails WCAG 1.4.4.

   Double-tap is the second zoom: tap a button or a row twice in quick
   succession and the second tap lands as a zoom gesture rather than a
   click. touch-action: manipulation drops that gesture on interactive
   elements only, so panning and pinch-zoom are untouched, and so is
   double-tapping prose or an image, which is a real way to read a
   narrow column. :where() weighs nothing, so any rule can override it.
   --------------------------------------------------------------------- */

@media (pointer: coarse), (max-width: 40rem) {
  :where(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) {
    font-size: max(1rem, 1em);
  }
}

:where(a[href], button, input, select, textarea, label, summary, [role="button"], [role="tab"], [role="option"]) {
  touch-action: manipulation;
}

/* ── Tap targets on small or touch screens: what the floor needs
      beyond a size ────────────────────────────────────────────────────
   The touch query raises --rst-target, which every rule in the floor
   block below reads, from the desktop's 32px to --rst-tap (44px). What
   stays here is what a phone needs and a desktop does not: the kebab's
   wider column, a menu cap that fits three 44px rows, the calendar
   docked to the bottom of the screen, and the layout that centres a
   control's text in its 44px. ────────────────────────────── */
@media (pointer: coarse), (max-width: 40rem) {
  :root { --rst-col-menu: var(--rst-tap); --rst-target: var(--rst-tap); }

  /* Layout the phone has had since its floor was 44px, kept off the
     desktop, whose floor needs none of it: a desktop item is a block
     that keeps its own spacing and alignment, and these would change
     it where the floor changes nothing (a row action 9.6px wider, a
     date suggestion's label off its baseline, a full-width button's
     label pulled to the middle). On a phone each control grows well
     past its text, and these centre the text in it. */
  [rst-btn] { justify-content: center; }
  [rst-row-action] { padding-inline: 1rem; }
}

/* Forced colours strip backgrounds and shadows but keep borders. The
   depth language reads tokens, so this block sets them flat on
   html:root, which outranks the theme's :root, and every rule in every
   state paints flat; what a token cannot say is said here: a real
   border on everything that was drawn by a shadow, the knob in
   ButtonText, the highlight pair on the current item. light.js checks
   the same query and does no work.

   The summary's edge is a ring in its shadow, drawn by rules at (0,4,1)
   and up, so it is flattened as a token rather than fought at a
   selector. The current items set no forced-color-adjust: the mode
   keeps a system colour on its own (measured), and switching its
   repainting off would have let a focus ring in the theme's accent, a
   hovered chip's white face and any later rule on those items escape
   the reader's palette. The box-shadow: none is insurance for the
   tab's lift, a theme shadow the axis never flattened. The phone
   index's current link is named again in its hover and press: the
   index ladder sits at (0,4,1) and up and paints its surface over the
   highlight while the text stays HighlightText, white on white.
   Chromium drops every gradient layer and every shadow of its own (a
   hovered knob computes "none, none"), which is why the rest of the
   block is borders and system colours only. The checked knob is
   HighlightText on its Highlight track: the pair a palette guarantees
   contrasts. It was ButtonText, which need not (a white ButtonText on
   a cyan Highlight is about 1.25:1), and the drive holds the checked
   switch and the toggle block's head to the pair (Astra A4). */
@media (forced-colors: active) {
  html:root { --rst-depth-hl: transparent; --rst-depth-contact: transparent; --rst-depth-ambient: transparent; --rst-depth-face: 0; --rst-press-drop: 0px; --rst-sheen-fill: transparent; --rst-sheen-plain: transparent; --rst-light-wash: transparent; --rst-light-rim: var(--rst-line); --rst-press-wash: 0; --rst-press-spot: 0; --rst-press-wash-plain: 0; --rst-press-spot-plain: 0; --rst-tint-hover: var(--rst-surface); --rst-tint-press: var(--rst-surface); --rst-tint-tap: transparent; --rst-row-tint-hover: var(--rst-surface); --rst-row-tint-press: var(--rst-surface); --rst-tint-tile-hover: var(--rst-surface); --rst-tint-tile-press: var(--rst-surface); --rst-tint-card-hover: transparent; --rst-tint-group-hover: transparent; --rst-focus-halo: transparent; --rst-summary-edge: transparent; --rst-summary-edge-hover: transparent; }
  [rst-btn], [rst-input], [rst-textarea] { border: 1px solid ButtonBorder; }
  [rst-box], [rst-card], [rst-list] { border: 1px solid CanvasText; }
}
/* Print drops every shadow, gradient, sheen and tint the same way,
   flattening the tokens at html:root. Cards, fields and controls get a
   --rst-line-strong border, the knob a printable fill, and a filled
   button prints as outlined text: a solid block of colour on paper is
   a block, not a button.

   The fills, faces, edges and labels are tokens too, so a hovered or
   pressed button is outlined text by the same rules that fill it on
   screen; the press numbers day restates for dark sit in :root blocks
   above html:root, which does not matter, because the layers they
   feed are the buttons' background-image, reset here at the base rule
   no state rule sets. The summary's border is its printable edge; the
   ring is flattened as a token, as above. The knob's ring is an
   outline, not a border: a border would add 2px to a 15px knob. No
   shadow token is set to none: inside a composed shadow list none is
   not a layer, and the whole list would be invalid, so the menus, tabs
   and knob get box-shadow: none at their own selectors. The knob's two
   shadow tokens are flattened to a transparent layer as well: the
   hover lift sets the knob's box-shadow from a rule that outranks the
   knob's reset here, and printed the lift under a resting pointer. The
   checked
   track keeps a fill, the strong line: with both tracks empty rings a
   lone switch on paper gave no reference for which end means on. */
@media print {
  html:root { --rst-depth-hl: transparent; --rst-depth-contact: transparent; --rst-depth-ambient: transparent; --rst-depth-face: 0; --rst-press-drop: 0px; --rst-sheen-fill: transparent; --rst-sheen-plain: transparent; --rst-light-wash: transparent; --rst-light-rim: var(--rst-line); --rst-press-wash: 0; --rst-press-spot: 0; --rst-press-wash-plain: 0; --rst-press-spot-plain: 0; --rst-tint-hover: var(--rst-surface); --rst-tint-press: var(--rst-surface); --rst-tint-tap: transparent; --rst-row-tint-hover: var(--rst-surface); --rst-row-tint-press: var(--rst-surface); --rst-tint-tile-hover: var(--rst-surface); --rst-tint-tile-press: var(--rst-surface); --rst-tint-card-hover: transparent; --rst-tint-group-hover: transparent; --rst-focus-halo: transparent; --rst-summary-edge: transparent; --rst-summary-edge-hover: transparent;
    --rst-accent-fill: transparent; --rst-accent-fill-hover: transparent; --rst-accent-fill-edge: var(--rst-line-strong); --rst-accent-fill-edge-hover: var(--rst-line-strong); --rst-on-accent-fill: var(--rst-text);
    --rst-danger-fill: transparent; --rst-danger-fill-hover: transparent; --rst-danger-fill-edge: var(--rst-line-strong); --rst-danger-fill-edge-hover: var(--rst-line-strong); --rst-on-danger-fill: var(--rst-text); --rst-on-danger-fill-hover: var(--rst-text); --rst-danger-hover-filter: none;
    --rst-control-face: transparent; --rst-control-face-hover: transparent; --rst-control-face-press: transparent; --rst-control-border: var(--rst-line-strong); --rst-control-border-hover: var(--rst-line-strong); --rst-control-text-hover: var(--rst-text);
    --rst-ghost-edge: var(--rst-line-strong); --rst-ghost-face-hover: transparent; --rst-ghost-edge-hover: var(--rst-line-strong);
    --rst-summary-face: transparent; --rst-summary-face-hover: transparent;
    --rst-knob: var(--rst-text); --rst-knob-shade: var(--rst-text); --rst-track-off: transparent; --rst-nav-current-bg: transparent; --rst-nav-current-fg: var(--rst-text); --rst-focus-edge: var(--rst-line-strong);
    --rst-shadow-knob: 0 0 0 transparent; --rst-shadow-knob-hover: 0 0 0 transparent; }
  [rst-btn], [rst-input], [rst-textarea] { background-image: none; border: 1px solid var(--rst-line-strong); box-shadow: none; }
  [rst-box], [rst-card], [rst-list] { background: transparent; border: 1px solid var(--rst-line-strong); box-shadow: none; }
}

/* The browser's own tap flash is a different grey from the press tint,
   and iOS paints it on the link alone, so a tapped row lit in two
   colours. Everything with its own press state turns it off. (Buttons
   and nav items do it in their own base rules; this is the rest.) Here
   and not after the floor block, which may carry only sizes, and not
   after the utilities, which must stay last. */
[rst-row] a, [rst-lrow] a { -webkit-tap-highlight-color: transparent; }

/* ── Target floors, at every width ──────────────────────────────────
   Every interactive idiom is at least --rst-target on both axes: 32px
   on a desktop with a mouse, --rst-tap (44px) on a small or touch
   screen, where the query above raises the token. One list of idioms
   read through one token, so a control floored on a phone cannot be
   left at 24px on a desktop, and the two floors cannot drift apart.
   The size is measured as the box a tap or click ACTIVATES: the label
   of a label-backed control, the row of a stretched link. Anything
   that is display: inline today becomes inline-flex or flex here,
   because min sizes do nothing on an inline box; a block keeps its
   display and centres its content with align-content. Nothing else
   belongs here: a declaration that changes a desktop control the floor
   leaves alone goes in the touch query above. Every floor but the
   search box's is border-box, so the floor is the whole control: on
   the content box a control's own padding and border landed on top of
   it, and a 33.8px dropdown summary became 44.8 (the topbar 61.8) on a
   desktop where it already cleared 32. Each selector repeats the weight of the rule
   it raises: a floor lighter than the size it raises loses wherever it
   sits (the topbar's Menu summary is (0,2,1)).

   The block is last before the utilities so it wins ties with every
   component above it. ui/sizing_test.go fails when a rule styling an
   a, button, summary or label arrives without a row in the inventory
   this block implements, and ui/sizing_browser_test.go measures every
   control at 390 and 1024 with a coarse pointer and at 600 with a
   mouse against 44px, and at 1280 with a mouse against 32px. ─────── */
:where([rst-back-nav] a, [rst-row-action]) { column-gap: 0.3em; }
[rst-btn] { box-sizing: border-box; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
/* min-inline-size for a field in a flex row (a bulk bar), which
   shrinks it past the floor; a stretched field is far wider anyway.
   No block floor on the textarea: its own min-height of 5rem is over
   any floor, and min-block-size is the same property under another
   name, so a floor here replaced it and a note field shrank to two
   lines. */
[rst-input] { box-sizing: border-box; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
[rst-textarea] { box-sizing: border-box; min-inline-size: var(--rst-target); }
[rst-help] { block-size: var(--rst-target); box-sizing: border-box; inline-size: var(--rst-target); }

/* The row's own controls. The checkbox's label grows by
   padding, so the 16px box stays 16px and the label is the target. */
[rst-row-action] { align-items: center; box-sizing: border-box; display: inline-flex; justify-content: center; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
/* The identity cell is already a block (a grid item), so its floor
   needs no display of its own, and align-content centres a block's
   content. As a grid it made each inline piece of the title a row:
   "Order <bdi>AB3PX</bdi>" stacked into two lines. */
[rst-lrow] > .rst-nm, [rst-lrow] > [role="rowheader"] { align-content: center; box-sizing: border-box; min-block-size: var(--rst-target); }
a[rst-person] { box-sizing: border-box; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }
[rst-choice-cards] label { box-sizing: border-box; min-block-size: var(--rst-target); }
[rst-back-nav] a { align-items: center; box-sizing: border-box; display: inline-flex; min-block-size: var(--rst-target); min-inline-size: var(--rst-target); }

/* ---------------------------------------------------------------------
   Utilities, last on purpose.

   .rst-sr-only competes with component rules of the same specificity —
   both are single class selectors — so the cascade falls to source
   order. Declared earlier it LOSES: .rst-input's width:100% beat its
   inline-size:1px. Keep this block at the end of the file so the utility
   wins wherever it is applied; a test asserts it stays here.

   What that does NOT buy: a replaced element such as <select> has an
   intrinsic minimum size, so inline-size:1px does not shrink it to 1px
   whoever wins — measured at ~21px in Chromium. clip-path is what
   actually hides these, and position:absolute is what keeps them out of
   flow. Code that wants a genuinely minimal box (select.js does) should
   drop the component class rather than rely on this.
   --------------------------------------------------------------------- */

/* Visually hidden, but in the DOM and the tab order — and it un-hides on
   keyboard focus, because a focused control a sighted keyboard user
   cannot see is a trap. */
.rst-sr-only {
  clip-path: inset(50%);
  block-size: 1px;
  inline-size: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}
.rst-sr-only:focus-visible {
  background: var(--rst-accent);
  border: 0;
  border-radius: var(--rst-radius-sm);
  block-size: auto;
  clip-path: none;
  color: var(--rst-on-accent);
  cursor: pointer;
  font: inherit;
  font-size: var(--rst-fs-sm);
  inline-size: auto;
  overflow: visible;
  padding: 0.3rem 0.6rem;
  position: static;
  white-space: normal;
}
