/* Generated by scripts/build.ts from css/components.css. Do not edit; change the source and run pnpm build. */

/* The server-rendered component layer (hub ui-standard §2): the account's layout.ts stylesheet as
   classes, on the roles in tokens.css. Plain class names, the account's own, so its markup moves over
   unchanged (D-5). Colours only through roles: test/components.test.ts fails on a hex, rgb() or hsl()
   literal here. Both layers are named so a product's own unlayered rules win without !important. */

@layer forspring.base, forspring.components;

@layer forspring.base {
  /* Shades the account had as extra tokens (--blue-deep links, --blue-hover, --tint), derived from
     the roles so they follow every product's accent and both themes. The account's --tint (the
     accent at 8%) is gone: no non-action state is filled with the accent, which can be red-ish. Declared wherever the accent can
     change, because a custom property resolves its var()s where it is declared. */
  :root,
  [data-product],
  [data-theme] {
    --_link: color-mix(in srgb, var(--primary) 70%, var(--foreground));
    --_hover: color-mix(in srgb, var(--primary) 80%, light-dark(var(--background), var(--foreground)));
    --_shadow: color-mix(in srgb, light-dark(var(--foreground), var(--background)) 25%, transparent);
    /* A control's line box is what its height leaves after the padding and the 1px borders, so the
       text sits in the middle of every control of a size, and a row of them shares a baseline. */
    --_control-line: calc(var(--control-height) - 2 * var(--space-3) - 2px);
    --_control-line-small: calc(var(--control-height-small) - 2 * var(--space-1) - 2px);
  }

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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    margin: 0;
    background: var(--background);
    color: var(--body-foreground);
    font: 400 var(--text-content-body)/var(--leading-content-body) var(--font-sans);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  h1,
  h2,
  h3 {
    color: var(--foreground);
    margin: 0;
    text-wrap: balance;
  }

  h1 {
    font: 800 clamp(var(--text-content-h1-min), 4.4vw, var(--text-content-h1))/var(--leading-content-h1) var(--font-display);
    letter-spacing: -0.02em;
    margin-bottom: var(--rhythm-stack);
  }

  h2 {
    font: 800 var(--text-content-h2)/var(--leading-content-h2) var(--font-display);
    letter-spacing: -0.01em;
    margin-bottom: var(--rhythm-field);
  }

  h3 {
    font: 600 var(--text-content-h3)/var(--leading-content-h3) var(--font-sans);
    margin-bottom: var(--rhythm-field);
  }

  p {
    margin: 0 0 var(--rhythm-stack);
  }

  b,
  strong {
    color: var(--foreground);
    font-weight: 600;
  }

  section {
    margin-top: var(--rhythm-section);
  }

  a {
    color: var(--_link);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }

  a:hover {
    color: var(--_hover);
  }

  :focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 3px;
  }

  label {
    color: var(--foreground);
  }

  /* Control geometry (D-14). Inputs, selects and buttons share one box per size: a 1px border, 12px
     of padding and an 18px line (15px type at 1.2) make --control-height, 44px, and min-height holds
     it when a font or a product's padding differs. Text sits at the same height in every one, so a
     row of them shares a baseline. Small controls and the bar's are --control-height-small, 32px. */

  /* A bare button is the primary action, as in the account. */
  button {
    font: 600 var(--text-chrome-body)/var(--_control-line) var(--font-sans);
    cursor: pointer;
    border-radius: var(--radius-button);
    min-height: var(--control-height);
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
    transition: background-color var(--motion-duration-fast) var(--motion-ease-standard), border-color var(--motion-duration-fast) var(--motion-ease-standard);
  }

  button:hover {
    background: var(--_hover);
    border-color: var(--_hover);
    color: var(--primary-foreground);
  }

  input,
  select,
  textarea {
    font: 400 var(--text-content-body)/var(--_control-line) var(--font-sans);
    min-height: var(--control-height);
    padding: var(--space-3);
    border: 1px solid var(--input);
    border-radius: var(--radius-input);
    background: var(--card);
    color: var(--foreground);
    min-width: 0;
    width: 100%;
  }

  textarea {
    line-height: var(--space-5);
    min-height: calc(var(--space-16) * 2);
    resize: vertical;
  }

  /* The select draws its own chevron, so it sits where the padding leaves room for it, in
     --muted-foreground, centred, the same in every browser. Two gradients, each a diagonal stroke in a
     5px tile, make the caret: no url() or data: image, so a page with img-src 'self' needs nothing
     more. The stops are a pixel soft on each side, which antialiases the strokes. appearance: none
     keeps the native control: keyboard, the phone's picker, the option list in the system's theme. */
  select {
    appearance: none;
    padding-inline-end: var(--space-8);
    background-image:
      linear-gradient(45deg, transparent calc(50% - 1.25px), var(--muted-foreground) calc(50% - 0.5px), var(--muted-foreground) calc(50% + 0.5px), transparent calc(50% + 1.25px)),
      linear-gradient(135deg, transparent calc(50% - 1.25px), var(--muted-foreground) calc(50% - 0.5px), var(--muted-foreground) calc(50% + 0.5px), transparent calc(50% + 1.25px));
    background-size: 5px 5px;
    background-position:
      right calc(var(--space-3) + 5px) center,
      right var(--space-3) center;
    background-repeat: no-repeat;
    text-overflow: ellipsis;
    cursor: pointer;
  }

  select:dir(rtl) {
    background-position:
      left var(--space-3) center,
      left calc(var(--space-3) + 5px) center;
  }

  /* A list box shows its options, so it needs no chevron or room for one. */
  select:is([multiple], [size]:not([size="1"])) {
    background-image: none;
    padding-inline-end: var(--space-3);
    cursor: default;
  }

  input:disabled,
  select:disabled,
  textarea:disabled {
    background-color: var(--muted);
    color: var(--muted-foreground);
    border-color: var(--border);
    cursor: not-allowed;
  }

  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 0;
    border-color: var(--ring);
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
    flex: none;
  }

  input[aria-invalid="true"],
  select[aria-invalid="true"],
  textarea[aria-invalid="true"] {
    border-color: var(--danger);
  }

  fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    gap: var(--space-3) var(--space-5);
    flex-wrap: wrap;
  }

  legend {
    padding: 0;
    margin-bottom: var(--space-2);
    font-size: var(--text-chrome-body);
    font-weight: 600;
    color: var(--foreground);
  }

  fieldset label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-content-body);
    min-height: var(--space-6);
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }

  th,
  td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  tr:last-child td {
    border-bottom: 0;
  }

  th {
    font: 600 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
    background: var(--muted);
    white-space: nowrap;
  }

  /* The row a link pointed at: neutral, with the accent as an edge rule (a row, not a notice). */
  tr:target td {
    background: var(--muted);
  }

  tr:target td:first-child {
    box-shadow: inset 3px 0 0 var(--primary);
  }

  main {
    flex: 1;
    padding-block: var(--space-11) var(--space-16);
  }

  /* The same rule as the motion tokens (tokens/motion.json): under reduced motion tokens.css sets
     every --motion-duration-* to 0s, and this turns off anything that moves without them too. */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      transition: none !important;
      animation: none !important;
    }
  }
}

@layer forspring.components {
  /* --- Page frame ---------------------------------------------------------------------------- */

  .wrap {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding-inline: var(--space-5);
  }

  main.narrow {
    max-width: 480px;
    padding-top: max(var(--space-11), 8vh);
  }

  .skip {
    position: absolute;
    left: -9999px;
  }

  .skip:focus {
    left: var(--space-2);
    top: var(--space-2);
    z-index: 10;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-button);
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* --- Shell: the bar with the mark, "Forspring", the product, a switcher and the person -------- */

  /* The bar is a strip of the card surface over the page's ground (D-41), so the chrome reads as a
     pane, as main's cards do. */
  .bar {
    border-bottom: 1px solid var(--border);
    background: var(--card);
  }

  .bar-inner {
    display: flex;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    min-height: var(--space-16);
    flex-wrap: wrap;
    padding-block: var(--space-2);
  }

  /* Everything in the bar is a small control, 32px, centred on the wordmark's line: a select or an
     input there (an organisation picker) matches the switcher and a small button beside it. */
  .bar-inner :is(select, input:not([type="checkbox"], [type="radio"])) {
    width: auto;
    max-width: 16rem;
    min-height: var(--control-height-small);
    padding-block: var(--space-1);
    font-size: var(--text-content-small);
    line-height: var(--_control-line-small);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--foreground);
    text-decoration: none;
    border-radius: var(--radius-button);
    min-height: var(--space-11);
  }

  .brand:hover {
    color: var(--foreground);
  }

  .brand .mark {
    width: var(--space-7);
    height: var(--space-7);
    flex: none;
  }

  /* The doll's colour is --mark: the product's accent, ink on Forspring's own pages (hub D-101).
     The wordmark beside it stays ink in every product. */
  .brand .mark .fill {
    fill: var(--mark);
  }

  .brand .mark .coil {
    stroke: var(--mark);
  }

  .brand .word {
    font: 900 var(--text-content-h2)/var(--leading-solid) var(--font-display);
    letter-spacing: -0.01em;
  }

  .brand .sub {
    font: 400 var(--text-chrome-meta)/var(--leading-solid) var(--font-sans);
    color: var(--muted-foreground);
    display: inline-flex;
    align-items: center;
    min-height: var(--space-5);
    border-inline-start: 1px solid var(--input);
    padding-inline-start: var(--space-3);
    margin-inline-start: var(--space-1);
  }

  .spacer {
    flex: 1;
  }

  .who {
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
    overflow-wrap: anywhere;
  }

  /* The product switcher: a details element, so it opens with no script. */
  .switcher {
    position: relative;
  }

  .switcher > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height-small);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--input);
    border-radius: var(--radius-button);
    /* The small button's face (D-41): sans 600 at the small size, on the small control's line, so
       the words sit in the middle of the 32px box as a small button's do. */
    font: 600 var(--text-content-small)/var(--_control-line-small) var(--font-sans);
    color: var(--foreground);
    cursor: pointer;
  }

  .switcher > summary::-webkit-details-marker {
    display: none;
  }

  .switcher > summary::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }

  .switcher > summary:hover,
  .switcher[open] > summary {
    color: var(--foreground);
    border-color: var(--foreground);
  }

  .switcher > ul {
    position: absolute;
    z-index: 5;
    top: calc(100% + var(--space-1));
    left: 0;
    min-width: 12rem;
    margin: 0;
    padding: var(--space-1);
    list-style: none;
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-overlay);
  }

  .switcher a {
    display: flex;
    align-items: center;
    min-height: var(--space-10);
    padding: 0 var(--space-3);
    border-radius: var(--radius-button);
    color: var(--foreground);
    text-decoration: none;
  }

  .switcher a:hover {
    background: var(--muted);
    color: var(--foreground);
  }

  .switcher a[aria-current] {
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--primary);
  }

  /* --- The bar's menus: org, products, the person (D-17) ------------------------------------ */

  /* Each is a details element like the switcher, so it opens with no script and a keyboard reaches
     it with Tab and opens it with Enter or Space. The panel holds a label, the links and a foot. */
  .bar-inner {
    position: relative;
  }

  .bar-menu > summary {
    max-width: 16rem;
  }

  .bar-menu-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--foreground);
  }

  .bar-panel {
    position: absolute;
    z-index: 5;
    top: calc(100% + var(--space-1));
    left: 0;
    min-width: 18rem;
    max-width: 24rem;
    padding: var(--space-1);
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-overlay);
    font: 400 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
  }

  .bar-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .bar-panel a {
    gap: var(--space-3);
  }

  .bar-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .bar-item-meta {
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
  }

  .bar-panel-label {
    margin: 0;
    padding: var(--space-2) var(--space-3) var(--space-1);
    font: 600 var(--text-chrome-label)/var(--leading-chrome-label) var(--font-sans);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-foreground);
  }

  .bar-panel-foot {
    margin: var(--space-1) 0 0;
    padding-top: var(--space-1);
    border-top: 1px solid var(--border);
  }

  .bar-panel-foot a {
    color: var(--_link);
  }

  /* The user menu sits at the end of the bar, so its panel opens towards the start. */
  .user-menu > .bar-panel {
    left: auto;
    right: 0;
  }

  /* Anchored to the trigger at every width (D-41), with no script: below it, along its start edge,
     or its end edge when that would run off the window; above it when there is no room below; and
     when neither edge fits, across the window under it. The margins keep the panel 4px from its
     trigger and 16px inside the window: a try only fits when the margin box does, and the flips
     swap the margins with the sides. Fixed, so the window is what it must fit, wherever the menu
     sits (the bar, a page's own nav, a card). anchor-scope gives every menu its own anchor. */
  @supports (position-area: block-end) and (anchor-scope: all) {
    .switcher {
      anchor-scope: --forspring-menu;
    }

    .switcher > summary {
      anchor-name: --forspring-menu;
    }

    .switcher > :is(ul, .bar-panel),
    .user-menu > .bar-panel {
      position: fixed;
      position-anchor: --forspring-menu;
      inset: auto;
      position-area: block-end span-inline-end;
      margin-block: var(--space-1) var(--space-4);
      margin-inline: 0 var(--space-4);
      max-width: min(24rem, calc(100vw - 2 * var(--space-4)));
      position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline, --forspring-menu-across, --forspring-menu-across-up;
    }
  }

  /* Without anchor positioning a menu opens under its trigger, along its start edge (above), and
     never wider than the window. */
  @supports not ((position-area: block-end) and (anchor-scope: all)) {
    .switcher > :is(ul, .bar-panel) {
      max-width: min(24rem, calc(100vw - 2 * var(--space-4)));
    }

    /* Without anchor positioning nothing can measure where the trigger sits, so a phone's bar menus
       align by where the bar puts them: the org switcher sits in the right half there, so its panel
       hangs from its end edge, as the user menu's always does (D-41; Firefox today). */
    @media (max-width: 560px) {
      .org-switcher > .bar-panel {
        left: auto;
        right: 0;
      }
    }
  }

  .user-menu > summary {
    justify-content: center;
    min-width: var(--control-height-small);
    padding: 0 var(--space-2);
    border-radius: 999px;
    background: var(--muted);
  }

  .user-menu > summary::after {
    content: none;
  }

  .avatar {
    font: 600 var(--text-chrome-meta)/var(--leading-solid) var(--font-sans);
    letter-spacing: 0.02em;
    color: var(--foreground);
  }

  .user-head {
    display: grid;
    gap: var(--space-1);
    margin: 0 0 var(--space-1);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
  }

  .user-name {
    font-weight: 600;
    color: var(--foreground);
  }

  .user-email,
  .user-role {
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
    overflow-wrap: anywhere;
  }

  .user-lang {
    display: flex;
    gap: var(--space-1);
    margin: var(--space-1) 0 0;
    padding-top: var(--space-1);
    border-top: 1px solid var(--border);
  }

  .switcher .user-lang a {
    flex: 1;
    justify-content: center;
  }

  .user-signout {
    margin: var(--space-1) 0 0;
    padding: var(--space-2) var(--space-1) var(--space-1);
    border-top: 1px solid var(--border);
  }

  /* --- Standard pages around signing in: choose an org, no org, refused (D-17) -------------- */

  .std-page > .list,
  .std-page > .std-people {
    margin-bottom: var(--space-4);
  }

  .std-page > .actions {
    margin-top: var(--space-2);
  }

  .std-label {
    margin: var(--space-6) 0 var(--space-2);
    font: 600 var(--text-chrome-label)/var(--leading-chrome-label) var(--font-sans);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-foreground);
  }

  .std-people {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
  }

  .std-people a {
    overflow-wrap: anywhere;
  }

  .std-page .meta {
    margin-bottom: var(--rhythm-stack);
  }

  .std-page .name .tag {
    margin-inline-start: var(--space-2);
    vertical-align: middle;
  }

  code {
    font-family: var(--font-mono);
    font-size: var(--text-content-small);
    overflow-wrap: anywhere;
  }

  /* --- Menu: a product's own sections, beside the page (D-13) -------------------------------- */

  /* With a menu the frame widens so the content keeps its measure beside it. The sidebar shows on a
     wide screen; on a narrow one the same menu folds under "Menu" (a details element, no script). */
  .has-menu .wrap {
    max-width: 1120px;
  }

  .app {
    flex: 1;
    display: grid;
    grid-template-columns: var(--layout-menu) minmax(0, 1fr);
    gap: var(--space-12);
    align-items: start;
  }

  .app > main {
    min-width: 0;
    max-width: 760px;
  }

  /* The sidebar is a pane beside main (D-41): the card surface, a border and the card radius on the
     page's ground, its top level with main's first line. The fold on a narrow screen is the same
     surface. */
  .menu-side {
    position: sticky;
    top: var(--space-4);
    margin-block: var(--space-11) var(--space-8);
    padding: var(--space-4) var(--space-2);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
  }

  /* The narrow fold sits inside its own nav (D-38), so landmark navigation finds the menu while the
     fold is closed; on a wide screen the whole nav goes, leaving one menu landmark. */
  .menu-fold-nav,
  .menu-fold {
    display: none;
  }

  /* nav.menu, not .menu: a product's own details.menu (SiteSpring's account menu) must not become a grid.
     .menu-fold > .menu is the fold's list, a div since D-38 (the nav is outside the fold). */
  nav.menu,
  .menu-fold > .menu {
    display: grid;
    gap: var(--space-6);
    font: 400 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
  }

  nav.menu ul,
  .menu-fold > .menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-1);
  }

  .menu-label {
    display: block;
    margin: 0 0 var(--space-2);
    padding-inline: var(--space-3);
    font: 600 var(--text-chrome-label)/var(--leading-chrome-label) var(--font-sans);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-foreground);
  }

  .menu-group a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--space-8);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-button);
    color: var(--body-foreground);
    text-decoration: none;
  }

  .menu-group a:hover {
    background: var(--muted);
    color: var(--foreground);
  }

  /* Where the person is (the page, or the item it sits under): the muted surface, ink, and the
     accent only as an edge rule (D-5). */
  .menu-group a[aria-current] {
    background: var(--muted);
    color: var(--foreground);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--primary);
  }

  /* A menu item's icon (D-40): before the words, never shrunk, in the item's own colour. */
  .menu-group a > .icon {
    flex: none;
  }

  .menu-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .menu-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font: 400 var(--text-chrome-meta)/var(--leading-solid) var(--font-sans);
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
  }

  /* The context: which organisation the menu is for, and a switcher when there are others. */
  .menu-context {
    position: relative;
    display: grid;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
  }

  .menu-context .menu-label {
    margin: 0;
    padding: 0;
  }

  /* The name binds tight under its label (1.15, a heading's leading): at the body's 1.3 the switcher's
     words sat 1.2px nearer its top than its bottom (control-text-centre, D-42). */
  .menu-context-name {
    font-weight: 600;
    line-height: var(--leading-content-h2);
    color: var(--foreground);
    overflow-wrap: anywhere;
  }

  details.menu-context {
    padding: 0;
  }

  details.menu-context > summary {
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-card);
    cursor: pointer;
  }

  details.menu-context > summary::-webkit-details-marker {
    display: none;
  }

  details.menu-context > summary > * {
    grid-column: 1;
  }

  details.menu-context > summary::after {
    content: "";
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--muted-foreground);
    border-bottom: 1.5px solid var(--muted-foreground);
    transform: translateY(-2px) rotate(45deg);
  }

  details.menu-context > summary:hover {
    background: var(--muted);
  }

  details.menu-context > ul {
    position: absolute;
    z-index: 5;
    top: calc(100% + var(--space-1));
    left: 0;
    right: 0;
    padding: var(--space-1);
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-overlay);
  }

  details.menu-context a {
    display: flex;
    align-items: center;
    min-height: var(--space-8);
    padding: 0 var(--space-3);
    border-radius: var(--radius-button);
    color: var(--foreground);
    text-decoration: none;
  }

  details.menu-context a:hover {
    background: var(--muted);
  }

  details.menu-context a[aria-current="true"] {
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--primary);
  }

  /* --- Crumbs: the page's parents, quiet, before its h1 ------------------------------------- */

  .crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: 0 0 var(--rhythm-field);
    padding: 0;
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
  }

  .crumbs li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .crumbs li + li::before {
    content: "/";
    color: var(--input);
  }

  .crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--space-6);
    color: var(--muted-foreground);
    text-decoration: none;
  }

  .crumbs a:hover {
    color: var(--foreground);
    text-decoration: underline;
  }

  /* --- Signal: a monitored thing's state as a traffic light (D-13) -------------------------- */

  /* The word carries the meaning; the mark repeats it in colour and in shape, so red and green are
     told apart without colour: up a dot, late a triangle, down a diamond, not judged a hollow ring. */
  .signal {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font: 500 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
    color: var(--foreground);
    white-space: nowrap;
  }

  .signal-mark {
    flex: none;
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--signal-off);
  }

  .signal-mark.ok {
    border-radius: 999px;
    background: var(--signal-ok);
  }

  .signal-mark.warn {
    width: 11px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: var(--signal-warn);
  }

  .signal-mark.down {
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: var(--signal-down);
  }

  .signal-mark.off {
    border-radius: 999px;
    background: transparent;
    border: 2px solid var(--signal-off);
  }

  /* --- Footer --------------------------------------------------------------------------------- */

  footer {
    border-top: 1px solid var(--border);
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
  }

  .foot {
    display: flex;
    gap: var(--space-2) var(--space-5);
    flex-wrap: wrap;
    padding-block: var(--space-5) var(--space-7);
  }

  footer a {
    color: var(--muted-foreground);
  }

  footer a:hover {
    color: var(--foreground);
  }

  /* --- Text ----------------------------------------------------------------------------------- */

  h1 + .list,
  h1 + .table-wrap,
  h1 + .data-table {
    margin-top: var(--space-6);
  }

  .kicker {
    font: 600 var(--text-content-small)/var(--leading-content-small) var(--font-sans);
    color: var(--primary);
    margin: 0 0 var(--rhythm-field);
  }

  .lede {
    font-size: var(--text-content-lede);
    color: var(--muted-foreground);
    margin-bottom: var(--rhythm-flow);
  }

  .muted {
    color: var(--muted-foreground);
  }

  .small {
    font-size: var(--text-content-small);
  }

  .fine {
    font-size: var(--text-content-small);
    color: var(--muted-foreground);
    margin: var(--space-4) 0 0;
  }

  .fine + .fine {
    margin-top: var(--space-2);
  }

  .fine a {
    color: inherit;
  }

  .fine a:hover {
    color: var(--foreground);
  }

  .back {
    display: inline-block;
    font: 400 var(--text-content-small)/var(--leading-content-small) var(--font-sans);
    color: var(--muted-foreground);
    text-decoration: none;
    margin-bottom: var(--space-6);
  }

  .back:hover {
    color: var(--foreground);
  }

  .num {
    font-variant-numeric: tabular-nums;
  }

  th.num,
  td.num {
    text-align: right;
  }

  .stack > * + * {
    margin-top: var(--rhythm-stack);
  }

  /* --- Rhythm: the space between blocks, with no class (D-41) ------------------------------- */

  /* Markup with no class comes out spaced: the blocks in main, a section, a card or a dialog body
     sit the flow apart, and the parts of a bare form the stack apart. Each selector is inside
     :where(), so it weighs nothing and any class rule wins; it sits in this layer, so it wins over
     the base layer's element margins. Margins rather than gap, so the containers keep block layout
     (an inline form, a button beside a link) and add nothing to a container's own gap. Hidden
     inputs, scripts and templates do not count as the block before; a dialog and a popover keep
     the browser's own margins, which centre them. */
  :where(main, section:not([class]), .card, .dialog-body) > :where(:not([hidden], [type="hidden"], script, style, template)) ~ :where(:not(dialog, [popover])) {
    margin-block-start: var(--rhythm-flow);
  }

  :where(form:not([class])) > :where(:not([hidden], [type="hidden"], script, style, template)) ~ :where(:not(dialog, [popover])) {
    margin-block-start: var(--rhythm-stack);
  }

  /* Text keeps its own measure: paragraph to paragraph is the paragraph's margin, and a heading or a
     label binds to what follows by its own (h2 the field step, h1 the stack step). */
  :where(main, section:not([class]), .card, .dialog-body, form:not([class])) > :where(p, ul:not([class]), ol:not([class]), blockquote) + :where(p, ul:not([class]), ol:not([class]), blockquote),
  :where(main, section:not([class]), .card, .dialog-body, form:not([class])) > :where(h1, h2, h3, h4, .crumbs, .kicker, .back, .std-label, legend, label) + :where(*) {
    margin-block-start: 0;
  }

  /* A page's sections stand the section step apart. */
  :where(main, section:not([class])) > :where(* ~ section) {
    margin-block-start: var(--rhythm-section);
  }

  /* A back link binds to what follows by its own margin, a section too. It is inline-block, so its
     margin never collapses: with the section step on top it made 72px (off-scale, D-42). */
  :where(main, section:not([class])) > :where(.back) + :where(section) {
    margin-block-start: 0;
  }

  /* Two controls side by side in a flow (a Save and a Cancel with no row around them) keep the
     actions gap; in a row of its own (.actions, .toolbar) the row's gap does it instead. */
  :where(main, section:not([class]), .card, .dialog-body, form:not([class]), p) > :where(button, .button, input:not([type="hidden"]), select) + :where(button, .button) {
    margin-inline-start: var(--rhythm-actions);
  }

  /* --- Card and list -------------------------------------------------------------------------- */

  .card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: var(--space-7);
  }

  .card h1 {
    font-size: var(--text-content-h1-min);
  }

  ul.list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
  }

  ul.list li {
    display: flex;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-4) var(--space-5);
    flex-wrap: wrap;
  }

  ul.list li + li {
    border-top: 1px solid var(--border);
  }

  .grow {
    flex: 1;
    min-width: 12rem;
  }

  .name {
    font-weight: 600;
    color: var(--foreground);
  }

  .meta {
    font-size: var(--text-content-small);
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
  }

  .go {
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  .go::after {
    content: "\00a0\203A";
  }

  /* --- Buttons -------------------------------------------------------------------------------- */

  .button {
    font: 600 var(--text-chrome-body)/var(--_control-line) var(--font-sans);
    cursor: pointer;
    border-radius: var(--radius-button);
    min-height: var(--control-height);
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-align: center;
    transition: background-color var(--motion-duration-fast) var(--motion-ease-standard), border-color var(--motion-duration-fast) var(--motion-ease-standard);
  }

  .button:hover {
    background: var(--_hover);
    border-color: var(--_hover);
    color: var(--primary-foreground);
  }

  :is(button, .button).ghost {
    background: transparent;
    color: var(--foreground);
    border-color: var(--input);
  }

  :is(button, .button).ghost:hover {
    border-color: var(--foreground);
    color: var(--foreground);
    background: transparent;
  }

  /* Destructive, and never the loudest thing on the page: danger text on the surface. */
  :is(button, .button).danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
  }

  :is(button, .button).danger:hover {
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    color: var(--danger);
    border-color: var(--danger);
  }

  /* A button in a notice's tone (D-44). Success and warning are filled; the label is the
     primary-foreground role, which is white on the light theme and the dark ground on the dark one. */
  :is(button, .button).success {
    background: var(--success);
    border-color: var(--success);
    color: var(--primary-foreground);
  }

  :is(button, .button).success:hover {
    background: color-mix(in srgb, var(--success) 85%, var(--foreground));
    border-color: color-mix(in srgb, var(--success) 85%, var(--foreground));
    color: var(--primary-foreground);
  }

  :is(button, .button).warning {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--primary-foreground);
  }

  :is(button, .button).warning:hover {
    background: color-mix(in srgb, var(--warning) 85%, var(--foreground));
    border-color: color-mix(in srgb, var(--warning) 85%, var(--foreground));
    color: var(--primary-foreground);
  }

  /* Critical is the tone, filled (0.30.1, D-44; Peter via brand-22): danger background and edge, label
     the primary-foreground role (white on the light theme, the dark ground on the dark one). It is not
     .danger: .danger is the red outline and means "this destroys something". */
  :is(button, .button).critical {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--primary-foreground);
  }

  :is(button, .button).critical:hover {
    background: color-mix(in srgb, var(--danger) 85%, var(--foreground));
    border-color: color-mix(in srgb, var(--danger) 85%, var(--foreground));
    color: var(--primary-foreground);
  }

  :is(button, .button).small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height-small);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-content-small);
    line-height: var(--_control-line-small);
  }

  /* A small input or select: the small button's box, beside it in a toolbar. */
  :is(input, select).small {
    min-height: var(--control-height-small);
    padding-block: var(--space-1);
    line-height: var(--_control-line-small);
  }

  :is(button, .button).wide {
    width: 100%;
  }

  :is(button, .button):disabled,
  :is(button, .button)[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
  }

  form.inline {
    display: inline;
    margin: 0;
  }

  td form.inline {
    display: inline-flex;
    vertical-align: middle;
  }

  /* An action row (D-41, actions()): one height, the actions gap, the primary first, then the
     secondary ones, and a destructive action apart at the far end. On a phone it is a column of
     full-width buttons with the same gap (below). A span.actions is the inline pair of links in a
     list row, and stays inline. */
  .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--rhythm-actions);
  }

  span.actions {
    display: inline-flex;
    align-items: center;
  }

  .actions > :is(button, .button, form) {
    margin: 0;
  }

  .actions > form {
    display: flex;
  }

  .actions-end {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rhythm-actions);
    margin-inline-start: auto;
  }

  /* Controls in a row: a search, a filter, its buttons. They share a height, so they share a line;
     a text input takes the room that is left. */
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
  }

  .toolbar > :is(input, select) {
    width: auto;
  }

  .toolbar > input:not([type="checkbox"], [type="radio"]) {
    flex: 1 1 12rem;
  }

  /* --- Forms ---------------------------------------------------------------------------------- */

  .form {
    display: grid;
    gap: var(--rhythm-stack);
    max-width: 30rem;
  }

  .form p {
    margin: 0;
  }

  /* A field's parts on the rhythm (D-41): the label field above its control, a hint or an error
     help under it. Margins rather than one gap, since the two steps differ. */
  .field {
    display: grid;
    gap: 0;
    font-size: var(--text-chrome-body);
    font-weight: 600;
    color: var(--foreground);
  }

  .hint {
    margin: 0;
    font-size: var(--text-content-small);
    font-weight: 400;
    color: var(--muted-foreground);
  }

  .field-error {
    margin: -4px 0 0;
    font-size: var(--text-content-small);
    font-weight: 400;
    color: var(--danger);
  }

  .field > * + * {
    margin-top: var(--rhythm-field);
  }

  .field > * + :is(.hint, .field-error) {
    margin-top: var(--rhythm-help);
  }

  /* "påkrævet" / "valgfri" in the label (D-30): in its accessible name, quieter than the label. */
  .field-mark {
    font-weight: 400;
    color: var(--muted-foreground);
  }

  .check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--space-6);
  }

  /* --- Table ---------------------------------------------------------------------------------- */

  /* Wider than the page scrolls inside the frame, never clipped. Give the wrap tabindex="0", a role
     of region and a label, so a keyboard can reach and scroll it; the shadows at the edges show
     there is more (they are covered while the content sits flush with that edge). */
  .table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow-x: auto;
    background:
      linear-gradient(to right, var(--card) 30%, transparent) left / var(--space-10) 100% no-repeat local,
      linear-gradient(to left, var(--card) 30%, transparent) right / var(--space-10) 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, var(--_shadow), transparent) left / var(--space-3) 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, var(--_shadow), transparent) right / var(--space-3) 100% no-repeat scroll,
      var(--card);
  }

  .table-wrap:focus-visible {
    outline-offset: 2px;
  }

  .table-wrap caption {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    color: var(--foreground);
  }

  /* A header that sorts is a link; the one in force says its order with an arrow beside the word,
     and aria-sort says it to a screen reader, so the order is never shown by colour alone. */
  .sort {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--space-6);
    color: inherit;
    text-decoration-color: var(--input);
  }

  .sort:hover {
    color: var(--foreground);
    text-decoration-color: currentColor;
  }

  th[aria-sort] {
    color: var(--foreground);
  }

  .sort-dir {
    font-family: var(--font-sans);
    font-weight: 600;
  }

  /* --- A table at scale: search, filters, the order and paging (D-25) ------------------------ */

  /* A column, not a grid: a grid item would grow to the table's width and the frame would stop
     scrolling. */
  .data-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  /* The search and the chips share one row and wrap under each other when it is narrow. They take
     the small box (D-14), as controls in the bar do, so the chips and the field share a line. */
  .table-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
  }

  .table-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1 1 16rem;
    margin: 0;
  }

  .table-search > input {
    flex: 1 1 auto;
    width: auto;
  }

  .table-search > label:not(.visually-hidden) {
    font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
    color: var(--foreground);
    white-space: nowrap;
  }

  .table-filters ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* A filter is a link drawn as a pill in the small control's box. The one in force is filled with
     the ink, a change of shape and weight rather than of hue, and carries aria-current. */
  .chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height-small);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--input);
    border-radius: 999px;
    background: var(--card);
    font: 500 var(--text-chrome-body)/var(--_control-line-small) var(--font-sans);
    color: var(--foreground);
    text-decoration: none;
    white-space: nowrap;
  }

  .chip:hover {
    border-color: var(--foreground);
    color: var(--foreground);
  }

  .chip[aria-current="true"] {
    background: var(--foreground);
    border-color: var(--foreground);
    color: var(--background);
  }

  .chip-count {
    font: 400 var(--text-chrome-meta)/var(--leading-solid) var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);
  }

  .chip[aria-current="true"] .chip-count {
    color: inherit;
  }

  /* The footer: the range and the order on the left, Previous and Next on the right. */
  .table-foot,
  .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
  }

  .table-foot > .pagination {
    flex: 1 1 auto;
  }

  .table-order,
  .pagination-range {
    margin: 0;
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
  }

  /* The order after the range stays one phrase when the footer wraps on a phone. */
  .pagination-order {
    white-space: nowrap;
  }

  /* The order is the product's words, written to follow a range ("værst først"); alone it starts a
     sentence. */
  .table-order::first-letter {
    text-transform: uppercase;
  }

  .pagination-steps {
    display: inline-flex;
    gap: var(--space-2);
  }

  td .email {
    color: var(--muted-foreground);
    font-size: var(--text-content-small);
    overflow-wrap: anywhere;
  }

  .phone-only {
    display: none;
  }

  /* --- Switch: a button[role=switch] whose aria-checked the server sets --------------------- */

  .switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    color: var(--muted-foreground);
    border: 0;
    padding: var(--space-1) 0;
    font-weight: 400;
    font-size: var(--text-content-small);
    min-height: var(--space-6);
  }

  .switch:hover {
    background: transparent;
    color: var(--foreground);
  }

  .switch .track {
    width: var(--space-10);
    height: var(--space-6);
    border-radius: 999px;
    background: var(--input);
    position: relative;
    flex: none;
    transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
  }

  .switch .track::after {
    content: "";
    position: absolute;
    top: var(--space-1);
    left: var(--space-1);
    width: var(--space-4);
    height: var(--space-4);
    border-radius: 999px;
    background: light-dark(var(--card), var(--foreground));
    box-shadow: var(--shadow-raised);
    transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  }

  .switch[aria-checked="true"] .track {
    background: var(--primary);
  }

  .switch[aria-checked="true"] .track::after {
    transform: translateX(var(--space-4));
  }

  .switch[aria-checked="true"] .state {
    color: var(--foreground);
  }

  .switch:focus-visible {
    outline-offset: 2px;
    border-radius: 999px;
  }

  /* --- Notice: what just happened, in words; the colour only repeats it --------------------- */

  /* One style for every notice (D-44): a whole tinted fill in the tone, the tone's icon on the left,
     the label in small caps in the tone colour, an action button in the tone. No coloured edge, on
     a notice or a card. Info is neutral (the muted surface and muted ink), never an accent tint: an
     accent can be red-ish (SiteSpring's terracotta, PulseSpring's magenta) and read as an error
     (controller review of hen, 2026-10-10). The tint is 14% of the tone over the card in the light
     theme and 9% in the dark one (14% takes the danger label to 4.29:1 on dark); test/notice.test.ts
     holds the numbers. A transparent border keeps the box visible in forced-colours mode. */
  .notice {
    --_tone: var(--muted-foreground);
    --_fill: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-3);
    border: 1px solid transparent;
    background: var(--_fill);
    color: var(--foreground);
    border-radius: var(--radius-card);
    padding: var(--space-3) var(--space-4);
    margin: 0 0 var(--space-6);
  }

  .notice.success {
    --_tone: var(--success);
    --_fill: light-dark(color-mix(in srgb, var(--success) 14%, var(--card)), color-mix(in srgb, var(--success) 9%, var(--card)));
  }

  .notice.warning {
    --_tone: var(--warning);
    --_fill: light-dark(color-mix(in srgb, var(--warning) 14%, var(--card)), color-mix(in srgb, var(--warning) 9%, var(--card)));
  }

  .notice.error {
    --_tone: var(--danger);
    --_fill: light-dark(color-mix(in srgb, var(--danger) 14%, var(--card)), color-mix(in srgb, var(--danger) 9%, var(--card)));
  }

  /* The icon (or a signal's mark) in the tone, beside the first line. */
  .notice > .icon,
  .notice > .signal-mark {
    color: var(--_tone);
  }

  .notice > .icon {
    font-size: var(--text-content-h3);
  }

  .notice-body {
    flex: 1 1 12rem;
    min-width: 0;
  }

  .notice-body > :last-child {
    margin-bottom: 0;
  }

  /* The label: the kind of message in words, small caps in the tone colour, real text (D-120). */
  .notice-label {
    display: block;
    font: 600 var(--text-chrome-label)/var(--leading-chrome-label) var(--font-sans);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--_tone);
  }

  .notice-title {
    display: block;
    font-weight: 600;
    color: var(--foreground);
  }

  /* A monitored state: the neutral fill, and the signal's own mark as the icon. */
  .notice.signal-ok,
  .notice.signal-warn,
  .notice.signal-down,
  .notice.signal-off {
    --_tone: var(--muted-foreground);
    --_fill: var(--muted);
  }

  /* The notice's action: a small button in the tone. Success, warning and critical are filled (the
     label is the primary-foreground role, white or the dark ground); .danger stays the red outline
     that means destructive; info is the neutral ghost button. */
  .notice > .button {
    flex: none;
  }

  /* A failed submit's summary (D-30): the error notice with a real heading, at the notice title's
     size, and one link per error. It takes focus, so the ring shows where the page landed. */
  .error-summary > .notice-title {
    font: 600 var(--text-content-body)/var(--leading-content-body) var(--font-sans);
    letter-spacing: normal;
    margin: 0 0 var(--space-2);
  }

  .error-summary-list {
    margin: 0;
    padding-inline-start: var(--space-5);
    display: grid;
    gap: var(--space-1);
  }

  /* A platform error's ref (hub D-88): monospace, and one click selects all of it for a copy. */
  .error-ref {
    margin: var(--space-3) 0 0;
    font-size: var(--text-content-small);
  }

  .error-ref code {
    user-select: all;
  }

  /* --- Tag ------------------------------------------------------------------------------------ */

  .tag {
    font: 600 var(--text-chrome-label)/var(--leading-chrome-label) var(--font-sans);
    color: var(--muted-foreground);
    border: 1px solid var(--input);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    min-height: var(--space-5);
    padding: 0 var(--space-2);
    white-space: nowrap;
  }

  /* "Ny", "Beta": neutral text with an accent dot, never an accent outline, for the same reason as
     the plain notice. */
  .tag.primary {
    color: var(--foreground);
  }

  .tag.primary::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: var(--space-1);
    border-radius: 999px;
    background: var(--primary);
  }

  .tag.success {
    color: var(--success);
    border-color: var(--success);
  }

  .tag.warning {
    color: var(--warning);
    border-color: var(--warning);
  }

  .tag.danger {
    color: var(--danger);
    border-color: var(--danger);
  }

  /* --- States: empty, loading, failed (Canonify DESIGN-SURFACE §3) ------------------------- */

  /* A state takes the footprint of the list or table it stands in for, so nothing jumps when the
     data arrives. Empty says there is nothing (or nothing matching a filter); failed says the read
     failed and never claims there is nothing; loading shows the shape of what is coming. */
  .data-state {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
    padding: var(--space-8) var(--space-7);
    min-height: calc(var(--space-16) * 2);
  }

  .data-state-title {
    margin: 0 0 var(--space-1);
    font: 600 var(--text-content-lede)/var(--leading-content-lede) var(--font-sans);
    color: var(--foreground);
  }

  .data-state-text {
    margin: 0;
    color: var(--muted-foreground);
    max-width: 40rem;
  }

  .data-state-actions {
    margin-top: var(--space-4);
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .data-state.failed {
    border-color: var(--danger);
  }

  .data-state.failed .data-state-title {
    color: var(--danger);
  }

  .data-state.loading {
    display: grid;
    gap: var(--space-3);
    align-content: start;
  }

  .skeleton {
    display: block;
    height: var(--space-3);
    border-radius: var(--radius-button);
    background: var(--border);
    animation: forspring-pulse var(--motion-duration-pulse) ease-in-out infinite;
  }

  .skeleton:nth-child(3n + 1) {
    width: 60%;
  }

  .skeleton:nth-child(3n + 2) {
    width: 85%;
  }

  .skeleton:nth-child(3n) {
    width: 40%;
  }

  @keyframes forspring-pulse {
    50% {
      opacity: 0.45;
    }
  }

  /* --- The "or" divider between two ways to sign in ----------------------------------------- */

  .or {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--rhythm-flow) 0;
    font: 400 var(--text-chrome-meta)/var(--leading-solid) var(--font-sans);
    color: var(--muted-foreground);
  }

  .or::before,
  .or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border);
  }

  /* --- Connect an agent: tabs per client, folded keys (D-19, hub D-102) -------------------- */

  /* The tabs are radio buttons and labels; with :has() only the chosen client's panel shows. A
     browser without :has() shows every panel under its heading, and no tab row. */
  .connect-choose {
    display: none;
  }

  .connect-panel > :is(h2, h3) {
    margin-top: var(--space-6);
  }

  .connect-panel > :last-child,
  .connect-ci-body > :last-child,
  .connect-steps > li > :last-child {
    margin-bottom: 0;
  }

  @supports selector(:has(*)) {
    .connect-choose {
      display: flex;
      gap: 0 var(--space-1);
      margin-bottom: var(--space-5);
      border-bottom: 1px solid var(--border);
    }

    .connect-choose label {
      display: inline-flex;
      align-items: center;
      min-height: var(--control-height-small);
      padding: var(--space-1) var(--space-3);
      font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
      color: var(--muted-foreground);
      cursor: pointer;
    }

    .connect-choose label:hover {
      color: var(--foreground);
    }

    /* The chosen tab: ink words and the accent as its edge rule only (D-5). */
    .connect-choose input:checked + label {
      color: var(--foreground);
      box-shadow: inset 0 -2px 0 var(--primary);
    }

    .connect-choose input:focus-visible + label {
      outline: 2px solid var(--ring);
      outline-offset: -2px;
      border-radius: var(--radius-button);
    }

    .connect-panel {
      display: none;
    }

    .connect-panel > :is(h2, h3) {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }

    .connect-tabs:has(input[value="claude-code"]:checked) > .connect-claude-code,
    .connect-tabs:has(input[value="claude-ai"]:checked) > .connect-claude-ai,
    .connect-tabs:has(input[value="other"]:checked) > .connect-other,
    .connect-tabs:has(input[value="cli"]:checked) > .connect-cli {
      display: block;
    }
  }

  .connect-lede {
    color: var(--muted-foreground);
  }

  .connect-who {
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
  }

  /* A command or address: selectable whole with one click, wrapped rather than scrolled, so a
     phone shows all of it and copying gives the one line. */
  .connect-code {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    background: var(--muted);
  }

  .connect-code pre {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-block: var(--space-1);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--foreground);
  }

  /* Each line of a command is the copy button's height less the pre's padding (24px), so the first
     line sits level with the button beside it. Control geometry, not a leading. */
  .connect-code code {
    font-size: var(--text-content-small);
    line-height: calc(var(--control-height-small) - 2 * var(--space-1));
    user-select: all;
  }

  /* The copy button shows only once the script has found a clipboard (CONNECT_SCRIPT). */
  .connect-copy {
    display: none;
    flex: none;
  }

  [data-forspring-copy] :is(button, .button).connect-copy {
    display: inline-flex;
  }

  .connect-copy .copy-done,
  .connect-copy[data-copied] .copy-label {
    display: none;
  }

  .connect-copy[data-copied] .copy-done {
    display: inline;
  }

  .connect-steps {
    margin: 0 0 var(--space-4);
    padding-inline-start: var(--space-6);
  }

  .connect-steps > li + li {
    margin-top: var(--space-2);
  }

  .connect-steps > li > p {
    margin-bottom: var(--space-2);
  }

  details.connect-ci {
    margin-top: var(--space-6);
    border-top: 1px solid var(--border);
  }

  details.connect-ci > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
    color: var(--foreground);
    cursor: pointer;
    list-style: none;
  }

  details.connect-ci > summary::-webkit-details-marker {
    display: none;
  }

  details.connect-ci > summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-1px) rotate(-45deg);
    transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  }

  details.connect-ci[open] > summary::before {
    transform: translateY(-2px) rotate(45deg);
  }

  .connect-ci-body {
    padding-bottom: var(--space-2);
  }

  .connect-key {
    margin: 0 0 var(--space-4);
  }

  .connect-key > label {
    display: block;
    margin-bottom: var(--space-2);
    font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
  }

  .connect-key .toolbar > input {
    flex: 1 1 12rem;
  }

  .connect-env code {
    color: var(--foreground);
  }

  /* A long org name must wrap the link, not widen a phone's page. */
  .connect-ci-body .go {
    white-space: normal;
  }

  /* --- Dialog and the destructive-action confirm: a native <dialog> (D-23) ------------------ */

  /* The card's surface at the panel radius, centred by the browser's own modal rules (auto margins,
     the top layer). No entry animation: a dialog that fades in only delays the choice, so there is
     nothing for prefers-reduced-motion to turn off. */
  .dialog {
    width: 32rem;
    max-width: calc(100% - 2 * var(--space-4));
    padding: var(--space-7);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    background: var(--card);
    color: var(--card-foreground);
    box-shadow: var(--shadow-overlay);
  }

  /* The page behind dims towards ink in light and towards the ground in dark, as --_shadow does, so
     the dialog stands out in both themes. ::backdrop inherits from the dialog in current browsers;
     an older one that does not resolves no roles and shows no dim, and the dialog still works. */
  .dialog::backdrop {
    background: color-mix(in srgb, light-dark(var(--foreground), var(--background)) 45%, transparent);
  }

  .dialog-title {
    margin-bottom: var(--space-4);
  }

  /* On the no-script fallback page the confirm sits in place, the title the page's h1. */
  .dialog-page {
    width: auto;
    max-width: none;
    margin: 0;
    box-shadow: none;
  }

  .dialog-page h1 {
    font-size: var(--text-content-h1-min);
  }

  .dialog-body > :last-child {
    margin-bottom: 0;
  }

  .dialog-losses {
    margin: 0 0 var(--space-4);
    padding-inline-start: var(--space-6);
  }

  /* The footer: the safe action first, the other after it. They are ordinary buttons, so they share
     one box (D-14) and wrap to two rows on a narrow screen rather than shrink. */
  .dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-6);
  }

  /* Until the typed name matches the pattern, the destructive button looks unavailable, in words
     that keep their contrast rather than faded ones. It stays a live button, so pressing it makes the
     browser say what is missing. A browser without :has() shows it in danger throughout. */
  .dialog-form:has(:invalid) .dialog-actions :is(button, .button).danger {
    color: var(--muted-foreground);
    border-color: var(--border);
    background: transparent;
    cursor: not-allowed;
  }

  /* --- Icons, toast and tooltip (D-26) ------------------------------------------------------- */

  /* An icon is 1em of the text it sits in, so its size comes from the type ladders through that
     text, and it sits on the text's baseline the way a capital does. Its colour is currentColor. */
  .icon {
    display: inline-block;
    flex: none;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
  }

  /* A button with an icon lays the icon and the label out in a row with the link button's gap. A
     visually hidden label is out of the flow, so an icon alone stays centred. */
  button:has(> .icon) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
  }

  /* A toast: the card's surface, floating at the bottom of the window, the tone as the icon's colour only,
     no edge rule (D-44), and (with the icon's shape and a hidden word, never the colour alone). No entry
     animation: it is there when the page is, so there is nothing for reduced motion to turn off. */
  .toast,
  .toast-region {
    position: fixed;
    inset-block-end: var(--space-6);
    inset-inline-end: var(--space-6);
    z-index: 10;
    inline-size: 26rem;
    max-inline-size: calc(100% - 2 * var(--space-6));
    margin: 0;
  }

  .toast-region {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .toast-region > .toast {
    position: static;
    inline-size: auto;
    max-inline-size: none;
  }

  /* The text keeps at least 12rem; when an action and Dismiss leave it less (a phone), they wrap to
     a row of their own at the end, rather than squeeze the sentence into a column. */
  .toast {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
    color: var(--card-foreground);
    box-shadow: var(--shadow-overlay);
  }

  /* A fact is neutral, as a plain notice is; the tones that mean status take their status colour. */
  .toast-info {
    --_tone: var(--muted-foreground);
  }

  .toast-success {
    --_tone: var(--success);
  }

  .toast-warning {
    --_tone: var(--warning);
  }

  .toast-danger {
    --_tone: var(--danger);
  }

  /* The icon's box is the small control's height, so the glyph centres on the buttons' row and on
     the text's first line. */
  .toast > .icon {
    block-size: var(--control-height-small);
    font-size: var(--text-content-h3);
    color: var(--_tone);
  }

  .toast-text {
    flex: 1 1 12rem;
    min-width: 0;
    margin: 0;
    padding-block: var(--space-1);
    color: var(--foreground);
    overflow-wrap: anywhere;
  }

  .toast-actions {
    display: flex;
    flex: none;
    gap: var(--rhythm-actions);
    margin-inline-start: auto;
  }

  /* Dismiss is the small ghost button's box with only the x, and no border until it is pointed at. */
  .toast-dismiss.button.ghost {
    border-color: transparent;
    padding-inline: var(--space-2);
  }

  .toast-dismiss.button.ghost:hover {
    border-color: var(--input);
  }

  /* --- Tooltip: a button and a native popover ---------------------------------------------- */

  /* The trigger is the small control's box, square, with nothing around the icon until it is
     pointed at; the icon is the h3 size, so a help mark reads beside a label. */
  .tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height-small);
    min-width: var(--control-height-small);
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted-foreground);
    font-size: var(--text-content-h3);
    line-height: var(--leading-solid);
    vertical-align: middle;
  }

  .tooltip-trigger:hover {
    border-color: transparent;
    background: transparent;
    color: var(--foreground);
  }

  .tooltip-wrap {
    display: inline-flex;
    vertical-align: middle;
  }

  /* The popover's surface. The browser hides it until it opens and then puts it in the top layer;
     without anchor positioning it sits where the browser centres a popover, which is still readable
     and still closes on a press elsewhere or Escape. */
  .tooltip {
    max-inline-size: min(20rem, calc(100vw - 2 * var(--space-4)));
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    background: var(--popover);
    color: var(--popover-foreground);
    box-shadow: var(--shadow-overlay);
    font: 400 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
    text-align: start;
    overflow: visible;
  }

  /* With anchor positioning (Baseline 2026) it opens above its button, the button being the
     popover's implicit anchor, and below it when there is no room above. */
  @supports (position-area: top) {
    .tooltip {
      inset: auto;
      margin: var(--space-2) 0;
      position-area: top;
      position-try-fallbacks: flip-block;
    }
  }

  /* A field's label with a tooltip beside it, outside the label so the label names only the field. */
  .field-head {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  /* --- Agent approval, diff and "why it did that" (D-24) ------------------------------------- */

  /* A request is a card: who asks on the kicker line, what it wants as the heading, then the facts
     as label and value rows in the order of Spring's Slack card, and the decision at the foot. */
  .approval {
    margin: var(--space-6) 0 0;
    padding: var(--space-7);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
    color: var(--card-foreground);
  }

  .approval-kicker {
    font: 600 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
    margin: 0 0 var(--space-2);
  }

  .approval-agent {
    color: var(--foreground);
  }

  .approval-title {
    font: 800 var(--text-content-h3)/var(--leading-content-h3) var(--font-display);
    letter-spacing: -0.01em;
    margin: 0 0 var(--space-2);
  }

  .approval-summary {
    color: var(--muted-foreground);
    margin: 0;
  }

  /* Label beside value on a wide screen, the labels in one column so the values line up; one under
     the other on a phone. */
  .approval-facts {
    display: grid;
    grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
    gap: var(--space-4) var(--space-6);
    align-items: baseline;
    margin: var(--space-6) 0 0;
  }

  .approval-facts > div {
    display: contents;
  }

  .approval-facts dt {
    font: 400 var(--text-chrome-meta)/var(--leading-chrome-meta) var(--font-sans);
    color: var(--muted-foreground);
  }

  .approval-facts dd {
    margin: 0;
    color: var(--foreground);
  }

  .approval-facts dd > p {
    margin: 0;
  }

  .agent-follows {
    color: var(--muted-foreground);
  }

  /* The items it changes: a ruled list, numbers in even figures, "+11 more" quiet at the foot. */
  .approval-changes {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    font-variant-numeric: tabular-nums;
  }

  .approval-changes > li {
    padding: var(--space-2) var(--space-4);
  }

  .approval-changes > li + li {
    border-top: 1px solid var(--border);
  }

  .approval-item-name {
    font-weight: 600;
  }

  .approval-more {
    font-size: var(--text-content-small);
    color: var(--muted-foreground);
  }

  .approval-more a {
    display: inline-flex;
    align-items: center;
    min-height: var(--space-6);
  }

  /* Each effect has a mark before it: a dot for a plain fact; a warning's triangle and a danger's
     diamond in the status colour, beside words in bold that say it, so the colour only repeats them. */
  .approval-effects {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .approval-effects > li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .approval-effects > li::before {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
  }

  .approval-effects > li:not(.warning, .danger)::before {
    border-radius: 999px;
    background: var(--muted-foreground);
    transform: scale(0.5);
  }

  .approval-effects > li.warning::before {
    width: 11px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: var(--warning);
  }

  .approval-effects > li.danger::before {
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: var(--danger);
  }

  /* The decision: ordinary buttons in one row, so they share one box (D-14), and the draft link
     after them. */
  .approval-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
  }

  .approval-actions > form {
    display: flex;
    margin: 0;
  }

  /* The draft link stands apart from the decision at the row's far end (D-41). */
  .approval-actions > .go {
    margin-inline-start: auto;
  }

  /* Decided: the outcome in place of the buttons, under a rule, wrapping on a phone. */
  .approval-outcome {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
  }

  .approval-outcome > p {
    margin: 0;
  }

  .approval-outcome > p + p {
    margin-top: var(--space-2);
    color: var(--muted-foreground);
  }

  .approval-outcome .signal {
    white-space: normal;
  }

  .approval .explain {
    margin-top: var(--space-5);
  }

  /* A diff: a table of field, before and after, or lines with a sign and a tint. The tint is the
     status colour at a wash, the sign and the hidden word carry it. */
  .diff {
    margin: 0 0 var(--space-6);
  }

  .diff-label {
    font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
    color: var(--foreground);
    margin-bottom: var(--space-2);
  }

  .diff > .table-wrap + .diff-lines {
    margin-top: var(--space-3);
  }

  .diff-field {
    font-weight: 600;
    color: var(--foreground);
  }

  .diff-none {
    color: var(--muted-foreground);
  }

  .diff-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
    overflow: hidden;
  }

  .diff-line {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-1) var(--space-4);
    color: var(--foreground);
  }

  .diff-line.added {
    background: color-mix(in srgb, var(--success) 9%, var(--card));
  }

  .diff-line.removed {
    background: color-mix(in srgb, var(--danger) 9%, var(--card));
  }

  .diff-sign {
    flex: none;
    width: var(--space-3);
    font-family: var(--font-mono);
    color: var(--muted-foreground);
  }

  .diff-line.added .diff-sign {
    color: var(--success);
  }

  .diff-line.removed .diff-sign {
    color: var(--danger);
  }

  .diff-text {
    min-width: 0;
    overflow-wrap: anywhere;
    text-decoration: none;
  }

  /* "Why it did that": a fold, closed, its summary a full control's height to tap. */
  details.explain {
    border-top: 1px solid var(--border);
  }

  details.explain > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
    color: var(--foreground);
    cursor: pointer;
    list-style: none;
  }

  details.explain > summary::-webkit-details-marker {
    display: none;
  }

  details.explain > summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-1px) rotate(-45deg);
    transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  }

  details.explain[open] > summary::before {
    transform: translateY(-2px) rotate(45deg);
  }

  .explain-body {
    padding-bottom: var(--space-2);
  }

  .explain-steps {
    margin: 0;
    padding-inline-start: var(--space-6);
  }

  .explain-steps > li + li {
    margin-top: var(--space-2);
  }

  .explain-text {
    display: block;
    color: var(--foreground);
  }

  .explain-meta {
    display: block;
    font-size: var(--text-content-small);
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
  }

  .explain-follows {
    margin: var(--space-3) 0 0;
    font-size: var(--text-content-small);
  }

  /* Below a tablet's width the sidebar folds: one column, and the menu under "Menu" above main. */
  @media (max-width: 800px) {
    .app {
      display: block;
    }

    nav.menu-side {
      display: none;
    }

    .menu-fold-nav {
      display: block;
    }

    .menu-fold {
      display: block;
      margin-top: var(--space-4);
      border: 1px solid var(--border);
      border-radius: var(--radius-card);
      background: var(--card);
    }

    .menu-fold > summary {
      list-style: none;
      display: flex;
      align-items: center;
      gap: var(--space-3);
      min-height: var(--space-11);
      padding: 0 var(--space-4);
      font: 600 var(--text-chrome-body)/var(--leading-chrome-body) var(--font-sans);
      color: var(--foreground);
      cursor: pointer;
    }

    .menu-fold > summary::-webkit-details-marker {
      display: none;
    }

    .menu-fold > summary::after {
      content: "";
      margin-left: auto;
      width: 7px;
      height: 7px;
      border-right: 1.5px solid currentColor;
      border-bottom: 1.5px solid currentColor;
      transform: translateY(-2px) rotate(45deg);
    }

    .menu-fold[open] > summary::after {
      transform: translateY(2px) rotate(225deg);
    }

    .menu-fold-current {
      font-weight: 400;
      color: var(--muted-foreground);
    }

    .menu-fold > .menu {
      padding: var(--space-2) var(--space-2) var(--space-4);
      border-top: 1px solid var(--border);
    }

    .menu-fold .menu-group a {
      min-height: var(--space-11);
    }
  }

  /* The last tries of an anchored menu (D-41): across the window under its trigger, or over it,
     16px inside each edge. */
  @position-try --forspring-menu-across {
    position-area: block-end span-all;
    justify-self: stretch;
    margin: var(--space-1) var(--space-4) var(--space-4);
    min-width: 0;
    max-width: none;
  }

  @position-try --forspring-menu-across-up {
    position-area: block-start span-all;
    justify-self: stretch;
    margin: var(--space-4) var(--space-4) var(--space-1);
    min-width: 0;
    max-width: none;
  }

  /* --- Phone ---------------------------------------------------------------------------------- */

  /* On a phone the primary controls grow to 44px, the person's address leaves the bar, and tables
     drop the columns marked to go. */
  @media (max-width: 560px) {
    .wrap {
      padding-inline: var(--space-4);
    }

    main {
      padding-block: var(--space-7) var(--space-12);
    }

    .who {
      display: none;
    }

    /* A menu stays anchored to its trigger on a phone too (above, D-41); its least width gives way
       so it fits a 380px window. */
    .bar-panel {
      min-width: min(18rem, calc(100vw - 2 * var(--space-4)));
    }

    /* An action row is a column of full-width buttons, the same gap apart, the destructive one
       last (D-41). */
    .actions:not(span),
    .actions-end {
      flex-direction: column;
    }

    .actions-end {
      margin-inline-start: 0;
    }

    .bar-menu > summary {
      max-width: 11rem;
    }

    .user-menu > summary {
      min-width: var(--control-touch);
    }

    .bar-panel a {
      min-height: var(--control-touch);
    }

    .brand .word {
      font-size: var(--text-content-h3);
    }

    .card {
      padding: var(--space-6) var(--space-5);
    }

    .grow {
      min-width: 8rem;
    }

    th,
    td {
      padding: var(--space-2) var(--space-3);
    }

    /* Text links that stand alone get a 24px target where fingers are used. */
    .go,
    footer a {
      display: inline-flex;
      align-items: center;
      min-height: var(--space-6);
    }

    .phone-hide {
      display: none;
    }

    /* The search takes a row of its own on a phone, the chips wrap under it. */
    .table-search {
      flex-basis: 100%;
    }

    /* All four tabs on one row at 380px. */
    .connect-choose {
      gap: 0;
    }

    .connect-choose label {
      min-height: var(--control-touch);
      padding-inline: var(--space-2);
    }

    .connect-ci-body .go {
      max-width: 100%;
    }

    .phone-only {
      display: inline;
    }

    .switch {
      min-height: var(--space-11);
    }

    .switch .state {
      display: none;
    }

    ul.list li {
      padding: var(--space-3) var(--space-4);
    }

    .data-state {
      padding: var(--space-6) var(--space-5);
    }

    /* A phone's dialog keeps the card's narrower padding, and its buttons share the row's width. */
    .dialog {
      padding: var(--space-5);
    }

    .dialog-actions > * {
      flex: 1 1 auto;
    }

    /* A phone's approval: the card's narrower padding, each label over its value, and the buttons
       sharing the row's width, the draft link on a line of its own. */
    .approval {
      padding: var(--space-6) var(--space-5);
    }

    .approval-facts {
      display: flex;
      flex-direction: column;
      gap: var(--space-4);
    }

    .approval-facts > div {
      display: block;
    }

    .approval-facts dt {
      margin-bottom: var(--space-1);
    }

    .approval-actions > :is(form, .button) {
      flex: 1 1 auto;
    }

    .approval-actions > form > button {
      flex: 1 1 auto;
    }

    .approval-actions > .go {
      flex-basis: 100%;
      margin-inline-start: 0;
    }

    /* A phone's toast spans the window between the gutters, and its icon box grows with the
       buttons to the touch floor, so the glyph stays on their row. */
    .toast,
    .toast-region {
      inset-inline: var(--space-4);
      inline-size: auto;
      max-inline-size: none;
    }

    .toast > .icon {
      block-size: var(--control-touch);
    }

    .toast-text {
      padding-block: var(--space-2);
    }

    .tooltip-trigger {
      min-width: var(--control-touch);
    }

    /* Small controls and the bar's grow to the touch floor; the default size is already there. */
    :is(button, .button):not(.switch, .gsi),
    :is(input, select):not([type="checkbox"], [type="radio"]),
    .chip,
    .bar-inner :is(select, input:not([type="checkbox"], [type="radio"])),
    .switcher > summary {
      min-height: var(--control-touch);
    }

    /* At the touch floor a small control takes the default box, keeping its smaller type, so its
       text stays in the middle. */
    :is(button, .button, input, select).small,
    .chip,
    .bar-inner :is(select, input:not([type="checkbox"], [type="radio"])) {
      padding-block: var(--space-3);
      line-height: calc(var(--control-touch) - 2 * var(--space-3) - 2px);
    }
  }
}
