/* ── components ──────────────────────────────────────────────────────────────────────────────
   Everything with a name: buttons, fields, the select, the date field, menus, cards, the table,
   the rail, the filters panel, the automation flow.

   The order is the order these were written in, and it is load-bearing — the cascade here is a
   partition of one original sheet, never a reordering. If you split this file further, split it
   between top-level rules and prove it with:

       cat design/tokens.css design/base.css design/components.css | diff - <the old sheet>

   Section banners are written as a dashed rule inside a comment, and the comment above each one is
   the explanation components.html prints for that section — documentation, not decoration.

   Load last.
   ───────────────────────────────────────────────────────────────────────────────────────────── */
  .btn-primary { height: 32px; padding: 4px 16px 4px 12px; border-radius: 9999px; background: var(--btn); color: #fff; font-size: 15px; font-weight: 440; display: inline-flex; align-items: center; gap: 6px; }
  .btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
  /* The one state it has besides those two. A button that commits is held back until whatever gates it
     has been done — refusing after the press teaches the same rule a step later and wastes the press.
     .4 is what unavailable is worth everywhere else here, in the pager and the segmented switch. */
  .btn-primary:disabled { opacity: .4; cursor: default; }
  /* The same button filled with the danger colour, for the one press in a dialog that takes something
     away. It is a fill rather than a red word, because the thing it commits is what the dialog is for. */
  .btn-primary.danger { background: var(--danger-btn); color: var(--danger-btn-ink); }
  .btn-primary.danger:hover:not(:disabled) { background: var(--danger-btn-hover); }
  /* The narrow side of these paddings exists so an icon can sit closer to the edge than a word would.
     A button with no icon inherits that allowance and ends up with its label off centre, so it gets an
     even pair instead — which is what makes Apply read as centred next to New Employee. */
  .btn-primary:not(:has(svg)), .pill:not(:has(svg)) { padding-left: 16px; padding-right: 16px; }
  .theme-toggle .i-sun, :root[data-mode="dark"] .theme-toggle .i-moon { display: none; }
  :root[data-mode="dark"] .theme-toggle .i-sun { display: block; }
  .toolbar-actions { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

  /* ---------- frame: 220px sidebar + content column ---------- */
  .frame { display: grid; grid-template-columns: 220px minmax(0, 1fr); flex: 1; min-height: 0; }

  /* ---------- compact nav rail: icon above label ---------- */
  .frame { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); background: var(--frame); }
  /* A product whose sections are a row of tabs has no rail to leave room for. Stated on the frame rather
     than inferred with :has(.rail), because the gallery renders a rail as an exhibit and any rule that
     counts rails on the page is wrong there. */
  .frame.norail { grid-template-columns: minmax(0, 1fr); }
  .rail { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 0 10px 16px; }
  /* One highlight for the whole rail, travelling between items rather than blinking off one and on at the
     next. It sits behind the links (they are positioned, and come later in the source) and is sized to
     whichever it is under, because the two-line labels make some items taller than others. */
  /* ---------- settings sections ----------
     The list is a second column in the outer area rather than content inside the panel: the icon rail
     names the area you are in, this names the page you are on, and the panel is then free to be that page
     — its header is the section, not the word "Settings". Same relationship as the rail and the panel, one
     level deeper. */
  /* The column opens out of the rail rather than being there already: the frame's second track animates
     from nothing to its full width, so the panel is pushed across as it appears.
     The contents are held at a fixed width inside a clipped column — otherwise the labels would reflow and
     re-wrap on every frame of the open, which reads as a stutter rather than a reveal.
     The width it opens to is a variable rather than a number, because an animation filling both ways
     keeps hold of the property after it ends — so a keyframe that named 216px pinned the column at 216px
     for good, and the media queries below, which are the whole reason the width is not always 216px,
     silently did nothing. */
  @keyframes subrail-open {
    from { grid-template-columns: 112px 0px minmax(0, 1fr); }
    to   { grid-template-columns: 112px var(--subrail-w) minmax(0, 1fr); }
  }
  /* Scoped to a frame that actually holds a sub-rail. Unscoped, this three-column override also
     caught the pages that have no sub-rail, giving them a phantom middle column and collapsing
     the content column to nothing. The selector now says what the rule means. */
  /* A direct child, not any descendant. components.html shows the subrail as a component, inside the
     content column of a real frame — with :has(.subrail) that demo gave the page a third column it had
     no business having and squeezed main to nothing. The real one is always a child of .frame. */
  .frame:has(> .subrail) { --subrail-w: 216px; grid-template-columns: 112px var(--subrail-w) minmax(0, 1fr); animation: subrail-open .44s cubic-bezier(.2, .8, .25, 1) both; }
  .subrail {
    position: relative; min-height: 0; display: flex; flex-direction: column;
    padding: 18px 10px 16px; border-left: 1px solid var(--rule); overflow: hidden auto;
    scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  .subrail-in { flex: none; width: 196px; }
  /* each row follows the edge out, a beat behind the one above it */
  @keyframes sub-in {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: none; }
  }
  .subrail-title, .sub-group, .sub-item {
    animation: sub-in .34s cubic-bezier(.2, .8, .25, 1) both;
    animation-delay: calc(120ms + var(--i, 0) * 22ms);
  }
  /* ---------- switching theme ----------
     Left alone, a theme switch fires every transition in the sheet at once — forty-odd declarations with
     their own durations and curves — so panels, hairlines, text and badges each arrive at a different
     moment and the page smears between the two modes. Two classes replace that with one decision.

     .theming overrides them all with a single uniform fade, so everything crosses together and is done in
     140ms. It names the colour properties only: a width or a transform caught mid-change is not part of
     the theme and should not be dragged into it.

     .no-fade is the same override set to none, for anyone who has asked for less motion — a crossfade is
     animation from an interaction, and the hard cut is also the one state that never shows a colour pair
     nobody designed. */
  :root.theming, :root.theming *, :root.theming *::before, :root.theming *::after {
    transition: background-color .14s linear, color .14s linear, border-color .14s linear,
                box-shadow .14s linear, fill .14s linear, stroke .14s linear !important;
  }
  :root.no-fade, :root.no-fade *, :root.no-fade *::before, :root.no-fade *::after { transition: none !important; }
  @media (prefers-reduced-motion: reduce) {
    .frame:has(> .subrail), .subrail-title, .sub-group, .sub-item { animation: none; }
  }
  .subrail-title {
    margin: 0 0 14px; padding: 0 10px; font-size: 17px; line-height: 24px;
    font-weight: 560; letter-spacing: -.2px; color: var(--ink);
  }
  .sub-nav { display: grid; gap: 1px; align-content: start; }
  .sub-group {
    margin: 0 0 4px; padding: 0 10px; font-size: 11px; line-height: 16px; font-weight: 560;
    letter-spacing: .5px; text-transform: uppercase; color: var(--muted-2);
  }
  .sub-item + .sub-group { margin-top: 18px; }
  .sub-item {
    min-height: 32px; padding: 6px 10px; border-radius: 8px; text-align: left;
    font-size: 14px; line-height: 20px; font-weight: 480; color: var(--ink-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: background-color .14s ease, color .14s ease;
  }
  /* The highlight is one element that travels, the same as the rail's — the hover does not belong to any
     row, so nothing blinks off as the next blinks on. Over the current row it takes that row's own colour,
     or a neutral grey would pass behind the translucent fill and turn it muddy. */
  .sub-glide {
    position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 8px; background: var(--wash);
    opacity: 0; pointer-events: none;
    transition: transform .24s ease-out, width .24s ease-out, height .24s ease-out, opacity .16s ease, background-color .24s ease;
  }
  .sub-glide.on-current { background: var(--accent-wash); }
  .sub-item { position: relative; z-index: 1; }
  .sub-item:hover { color: var(--ink); }
  .sub-item.on, .sub-item.on:hover { background: var(--accent-wash); color: var(--accent-deep); font-weight: 520; }
  @media (prefers-reduced-motion: reduce) { .sub-glide { transition: opacity .16s ease; } }
  .sub-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .settings { flex: 1; min-height: 0; padding: 14px 24px 24px; overflow-y: auto; }
  /* with a flow open the page does not scroll as a whole — the flow scrolls on its own beside a pane that
     has to reach the panel's edges, so the page gives up its right and bottom padding and the two children
     carry their own instead */
  .settings:has(#rulesView:not([hidden])) { overflow: hidden; padding: 14px 0 0 24px; }
  .settings:has(#rulesView:not([hidden])) .rule-hd { margin-right: 0; }

  /* ---------- automation rules ---------- */
  /* A rule is a thing you open, not a field you fill, so the section splits: the list of rules is a column of
     its own down the panel's left edge — full bleed, starting above the heading — and everything to its right,
     heading included, belongs to whichever rule you picked. Putting the list outside the heading is what makes
     it read as a second level of navigation rather than as content inside the page. */
  .panel-split { flex: 1; min-height: 0; display: flex; align-items: stretch; }
  .panel-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .rules-side {
    /* 15px, not 10: it puts the top of the list on the same line as the rule header's hairline across the
       divider, so the two columns start their content together */
    flex: 0 0 256px; min-height: 0; display: flex; flex-direction: column; gap: 15px;
    /* Names are cut off at 256px, and a wide window has the room to show them. It grows with the window
       from 1280px and stops at 296, where the longest names fit beside a badge; any wider and the column
       reads as a panel of its own rather than a list beside the flow. Narrow windows keep the 220px the
       query further down gives them. */
    flex-basis: clamp(256px, 20vw, 296px);
    padding: 24px 14px 16px; border-right: 1px solid var(--rule);
    overflow: hidden auto; scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  .rules-side[hidden] { display: none; }
  .rules-top { display: flex; align-items: center; gap: 8px; }
  /* the toolbar's search collapses to a stub until it is used; here it is the only way into a long list, so
     it holds its width and simply fills the row */
  .rules-top .search-field.wide,
  .rules-top .search-field.wide:not(:focus-within):has(input:placeholder-shown) { flex: 1; width: auto; min-width: 0; }
  .rules-top .btn-primary { flex: none; padding: 4px 14px 4px 10px; }

  /* the rows run the full width of the column rather than sitting as pills inside it: a selected rule then
     reads as a slab of the column the pane belongs to, which is how the nav one level out behaves as well */
  .rules-scroll { position: relative; margin: 0 -14px; }
  .rules-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  /* one highlight that travels between rows, as in the rail and the settings column; square, because the
     rows themselves are full bleed and a rounded pool inside them would read as a different component */
  .rules-glide {
    position: absolute; left: 0; top: 0; width: 0; height: 0; background: var(--wash);
    opacity: 0; pointer-events: none;
    transition: transform .24s ease-out, width .24s ease-out, height .24s ease-out, opacity .16s ease, background-color .24s ease;
  }
  .rules-glide.on-current { background: var(--accent-wash); }
  /* A new automation does not appear in a list that was already the right size for it. The list opens a
     place first — the rows below are pushed down by that alone, since the column is a flex stack — and the
     row drops into the gap a beat later, so it reads as arriving rather than as having always been there. */
  @keyframes rule-make { from { height: 0; } to { height: var(--rh); } }
  @keyframes rule-land { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
  .rules-list li.fresh { overflow: hidden; animation: rule-make .26s cubic-bezier(.2, .8, .25, 1); }
  .rules-list li.fresh .rule { animation: rule-land .3s cubic-bezier(.2, .8, .25, 1) .07s backwards; }
  /* and the name it landed with, which is the thing you are about to type over */
  @keyframes name-land { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .rule-name.fresh input { animation: name-land .28s cubic-bezier(.2, .8, .25, 1) .08s backwards; }
  @media (prefers-reduced-motion: reduce) {
    .rules-list li.fresh, .rules-list li.fresh .rule, .rule-name.fresh input { animation: none; }
  }

  /* ---------- reordering ---------- */
  /* The rows only move while a drag is running — a transition left on them would animate the list every
     time the search filter hides a row. The one being carried is lifted off the column and keeps its own
     fill, so it reads as held rather than as another row in the stack. */
  .rules-list.sorting li { transition: transform .18s cubic-bezier(.2, .8, .25, 1); }
  .rules-list.sorting li.drag { transition: none; z-index: 4; touch-action: none; }
  .rules-list.sorting li.drag .rule {
    background: var(--page); box-shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 8px 20px rgba(16, 24, 32, .13);
    cursor: grabbing;
  }
  .rules-list.sorting li.drag .rule.on { background: var(--accent-wash); }
  .sorting-now, .sorting-now * { cursor: grabbing !important; user-select: none; }
  @media (prefers-reduced-motion: reduce) { .rules-list.sorting li { transition: none; } }
  .rule { position: relative; z-index: 1; }   /* above the travelling glide — so the kebab has to clear it in turn */
  .rule {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; text-align: left;
    font-size: 15px; font-weight: 440; line-height: 20px; color: var(--ink);
    transition: background-color .14s ease, color .14s ease;
  }
  .rule:hover { color: var(--ink); }
  /* --accent-deep, not --accent: the name sits on the accent wash, where the lighter accent is 3.5:1 */
  .rule.on { background: var(--accent-wash); color: var(--accent-deep); font-weight: 520; }

  /* ---------- rule preview ----------
     What a rule does, without opening it. It rides on .pop, so it glides between rows rather than blinking
     off and on, and the three steps are named with the same badges the flow uses — the card is a miniature
     of the page it would take you to, not a separate way of describing the same thing. */
  .pop.rpv { width: 284px; }   /* .pop sets 320 further down the sheet, so this has to outrank it */
  /* A long automation outruns the card, so the card scrolls rather than growing past the window — and
     because it can be scrolled it has to be reachable, which is what the grace period on leaving the list
     is for. */
  .rpv .pop-in {
    padding: 12px 13px 12px; max-height: min(62vh, 440px); overflow-y: auto;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  .rpv-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
  .rpv-nm {
    flex: 1; min-width: 0; font-size: 15px; font-weight: 520; line-height: 20px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* the same cards and the same thread, one size down — the card is the flow seen small, so nothing has to
     be learnt twice. It is not a control here, so the steps do not answer to the pointer. */
  /* .flow.mini, not .mini: now that the full-size card is .flow .step, the compact one has to be
     a class more specific or it would merely tie and lose on source order. */
  .flow.mini { max-width: none; margin: 0; }
  .flow.mini .step { padding: 7px 9px 8px; border-radius: 10px; gap: 1px; }
  .flow.mini .step:hover { border-color: var(--stroke); }
  .mini .step-hd { gap: 7px; }
  .mini .step-kind { height: 18px; padding: 0 7px 0 6px; gap: 4px; font-size: 11px; line-height: 18px; }
  .mini .step-kind svg { --sz: 11; width: 11px; height: 11px; }
  .mini .step-hint { font-size: 11px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mini .step-nm { display: block; font-size: 13px; line-height: 18px; }
  .mini .flow-link, .mini .flow-link.bare { height: 18px; }   /* .bare sets 30 later in the sheet */
  .mini .flow-link.bare::before { background: linear-gradient(to bottom, var(--stroke), var(--accent-line), var(--stroke)); }
  .rpv-v.none { color: var(--muted-2); font-weight: 440; }
  /* when the rule runs is the first thing asked of it after what it is called, so it sits with the name
     rather than in the footer among the incidentals. The start carries the weight; the end trails it. */
  .rpv-when { margin: 0 0 11px; font-size: 12.5px; line-height: 17px; color: var(--muted-2); }
  .rpv-when b { display: inline-flex; align-items: center; gap: 5px; font-weight: 560; color: var(--ink-soft); white-space: nowrap; }
  .rpv-when b::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--stroke-strong); }
  /* a rule that is simply running is the live state and reads as one; a rule waiting on a start date is
     stated the same way but not in the accent, which would say it is already going */
  .rpv-when.live b { color: var(--accent-deep); }
  .rpv-when.live b::before { background: var(--accent); }
  .rpv-ft { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; line-height: 17px; color: var(--muted-2); }
  .rule-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* There is one handle, not one per row, and it rides with the highlight: same container, same 240ms
     ease-out, so the row's affordance and the row's highlight are a single thing following the pointer
     rather than one sliding while five others blink. It is a real button, so unlike the glide it keeps its
     pointer events — which is also why it is laid over a gutter the rows reserve at all times, so nothing
     in a row moves as the pointer crosses it. */
  .rules-list li { position: relative; }
  .rule { padding-right: 36px; }
  .rule-more {
    position: absolute; left: 0; top: 0; z-index: 2;
    width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
    color: var(--muted-2); opacity: 0; pointer-events: none;
    transition: transform .24s ease-out, opacity .16s ease, background-color .14s ease, color .14s ease;
  }
  .rule-more svg { --sz: 15; width: 15px; height: 15px; }
  .rule-more:hover { background: var(--wash); color: var(--ink); }
  @media (prefers-reduced-motion: reduce) { .rule-more { transition: none; } }
  .rule-off {
    flex: none; padding: 1px 7px; border-radius: 9999px;
    background: var(--chip); color: var(--muted);
    font-size: 12px; font-weight: 480; line-height: 16px; letter-spacing: .01em;
  }
  .rules-empty { padding: 10px; font-size: 15px; line-height: 20px; color: var(--muted-2); }
  .rules-empty[hidden] { display: none; }

  /* The rule's own header: who it is and what it does on the left, whether it is running and how to change
     it on the right. It is the pane's masthead rather than a card, so its rule runs the full width of the
     pane — the band belongs to the page, not to a box inside it. */
  .rule-hd {
    /* 4px + .settings' 14px above and 18px below leaves the name and its metadata centred in the band,
       and puts this rule on the same line as the top of the list across the divider */
    margin: 4px -24px 0; padding: 0 24px 18px;
    border-bottom: 1px solid var(--rule);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px;
  }
  .rule-id-t { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
  .rule-pane h2 { margin: 0; font-size: 20px; font-weight: 520; line-height: 28px; color: var(--ink); }
  /* The name is not described by a field somewhere else — it is one. The heading is an input that looks
     like a heading until you go near it, when the field it already was shows itself; "Rename" says what
     will happen, and gets out of the way once you are typing and no longer need telling. */
  .rule-h { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
  /* The field is as wide as its text: a mirror of the value shares the grid cell and sets the column, and
     the input is stretched to it. size="1" is what makes that work — an input's default intrinsic width is
     twenty characters, and an auto track sizes to the widest item, so without it the box never shrank below
     that whatever the mirror said. */
  .rule-name { display: inline-grid; align-items: center; min-width: 0; max-width: 100%; }
  .rule-name::after {
    content: attr(data-v); grid-area: 1 / 1; visibility: hidden; white-space: pre;
    padding: 2px 10px; border: 1px solid transparent;
  }
  .rule-name input {
    grid-area: 1 / 1; width: 100%; min-width: 0; padding: 2px 10px; margin: 0;
    font: inherit; color: var(--ink); background: transparent;
    border: 1px solid transparent; border-radius: 9px; box-shadow: 0 0 0 0 var(--accent-wash);
    transition: background-color .14s ease, border-color .14s ease, box-shadow .18s ease;
  }
  .rule-name input:hover { background: var(--page); border-color: var(--accent-line); }
  .rule-name input:focus {
    outline: none; background: var(--page); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
  }
  /* centred under the field rather than hung off its left edge — the field changes width with the name, so
     anything anchored to one end drifts as you type. The shown state has to be restated at a specificity the
     component's own :hover rule cannot undo, or it would drop the X half of the transform. */
  .rule-h > .tip { left: 50%; top: calc(100% + 6px); transform: translate(-50%, -3px); }
  .rule-h.tip-host:hover > .tip { transform: translate(-50%, 0); }
  .rule-h:focus-within > .tip { opacity: 0; visibility: hidden; transition-delay: 0s, 0s, 0s; }
  @media (prefers-reduced-motion: reduce) { .rule-name input { transition: none; } }
  .rule-meta {
    margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 13px; line-height: 20px; color: var(--muted-2);
  }
  .rule-meta time { color: var(--muted); }
  .rule-by { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 520; }
  .rule-av {
    width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
    background: var(--wash); color: var(--muted); font-size: 10px; font-weight: 560; line-height: 1;
  }
  /* the separator is drawn, not typed, so it never lands at the start of a wrapped line */
  .rule-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--stroke-strong); }
  /* who made it and when is reference, not a control, so it sits out on the right rather than under the
     name — the left of the header is then only the two things you can change from it */
  .rule-meta { flex: none; margin-left: auto; }
  @media (max-width: 980px) { .rule-hd { align-items: flex-start; } }
  .rule-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
  .rule-pane[hidden] { display: none; }

  /* ---------- the rule's flow ---------- */
  /* Trigger, filter, action read top to bottom, so the run of the thing is the layout: one column, each step
     a card, the order drawn as a line between them. The cards carry no fill worth the name — the hairline is
     what makes them cards — so the eye follows the thread rather than a stack of grey blocks. */
  /* .step is scoped to .flow deliberately. On its own it is too generic a name for a shared
     stylesheet — the employees pager calls its prev/next buttons .pg.step, and before this was
     scoped those buttons quietly picked up the flow card's layout. */
  .flow { counter-reset: step; max-width: 480px; margin-inline: auto; }
  .flow .step {
    position: relative; display: flex; flex-direction: column; gap: 2px;
    padding: 13px 14px 14px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--stroke); background-clip: padding-box;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
  }
  .flow .step:hover { border-color: var(--accent-line); }
  /* Shutting the pane hands focus back to the step that opened it, and a plain :focus-within would leave
     that step wearing the selected look with nothing open. Only a keyboard focus rings it. */
  .flow .step:has(:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
  .step-hd { display: flex; align-items: center; gap: 10px; }
  /* the step's kind is a label on the card, not a control, so it is a tag rather than a button */
  .step-kind {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px;
    border-radius: 9999px; font-size: 13px; font-weight: 520; line-height: 20px; white-space: nowrap;
  }
  .step-kind svg { --sz: 13; width: 13px; height: 13px; }
  /* The kind is on the tag itself, so a step's badge looks the same wherever it appears — on the card in
     the flow, at the head of that step's settings, and in the hover preview.
     The three are a greyscale ladder rather than three hues: the run gets more consequential as it goes, and
     weight says that without spending colour on it. Every value is a token, so the ladder inverts in dark —
     --page is the surface either way, and --ink-soft is the text colour, so the action's fill and its text
     swap roles rather than needing a second set of values. */
  .step-kind.trigger { background: var(--page); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--stroke); }
  /* the rule-wide settings are not a step, so their tag sits with the quiet end of the ladder */
  .step-kind.filter, .step-kind.auto { background: var(--wash); color: var(--ink-soft); }
  .step-kind.action { background: var(--step-solid); color: var(--page); }
  .step-hint { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; color: var(--muted-2); }
  .step-menu {
    flex: none; width: 26px; height: 26px; margin: -2px -4px -2px 0; border-radius: 8px;
    display: grid; place-items: center; color: var(--muted-2); position: relative; z-index: 2;
    transition: background-color .14s ease, color .14s ease;
  }
  .step-menu:hover { background: var(--wash); color: var(--ink); }
  .step-menu svg { --sz: 15; width: 15px; height: 15px; }
  /* the card opens the step, so the hit area is the card — the overlay puts it there without nesting
     a button inside a button, which the kebab would otherwise be */
  .step-open { display: block; width: 100%; text-align: left; padding: 2px 0 0; }
  .step-open::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
  .step-open:focus-visible { outline: 0; }
  .step-nm { font-size: 16px; line-height: 24px; font-weight: 520; color: var(--muted-2); }
  .step-nm.set { color: var(--ink); }
  .step-nm::before { counter-increment: step; content: counter(step) ". "; color: var(--muted-2); font-weight: 480; }

  /* Everything below it is a step; this is the terms they all run under, so it is not drawn as one. No
     number, no kebab, no fill — an outline you could put a step into, and a chevron because it opens
     something rather than holding it. The line down to step 1 has no +, because nothing goes above the
     trigger. */

  /* Every step is a full-width card with a hairline; this is a capsule, filled, narrower than the column and
     centred over it — a cap on the flow rather than an item in it. Nothing else in the run is shaped or
     coloured like it, which is the point: it is the terms the steps run under, not one of them. */
  .flow-set {
    display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin-inline: auto;
    padding: 6px 12px 6px 6px; border: 0; border-radius: 9999px; background: var(--wash);
    font-size: 14px; line-height: 20px; color: var(--ink-soft);
    transition: background-color .16s ease, color .16s ease;
  }
  .flow-set:hover { background: var(--accent-wash); color: var(--accent-deep); }
  /* --btn, not --accent: this is the one accent surface that carries a white label, and the lighter
     accent leaves it at 2.86:1. The sub-label rides the same fill, so it is lifted to match. */
  .flow-set.on { background: var(--btn); color: #fff; }
  .fs-ico {
    flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    background: var(--page); color: var(--muted); transition: background-color .16s ease, color .16s ease;
  }
  .fs-ico svg { --sz: 14; width: 14px; height: 14px; }
  .flow-set:hover .fs-ico { color: var(--accent); }
  .flow-set.on .fs-ico { background: rgba(255, 255, 255, .22); color: #fff; }
  .fs-t { flex: none; font-weight: 520; }
  .fs-dot { flex: none; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .4; }
  .fs-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); }
  .flow-set:hover .fs-sub { color: inherit; }
  .flow-set.on .fs-sub { color: rgba(255, 255, 255, .92); }
  .fs-go { --sz: 13; width: 13px; height: 13px; flex: none; opacity: .55; }
  /* nothing goes above the trigger, so the line down to it carries no + */
  .flow-link.bare { height: 30px; }
  .flow-link.bare::before { background: linear-gradient(to bottom, transparent, var(--accent-line)); }

  /* the thread between steps: a hairline that is brightest where the + sits, so the join reads as the live
     part of the line rather than a gap in it */
  .flow-link { height: 54px; display: grid; place-items: center; position: relative; }
  .flow-link::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px;
    background: linear-gradient(to bottom, var(--stroke) 0%, var(--accent-line) 34%, var(--accent) 50%, var(--accent-line) 66%, var(--stroke) 100%);
  }
  /* the last + ends the run, so its line stops at it — anything below is a thread going nowhere. It keeps
     the top half of the usual gradient, so it still brightens into the join. */
  .flow-link:last-child::before { bottom: 50%; background: linear-gradient(to bottom, var(--stroke), var(--accent)); }
  .flow-add {
    position: relative; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; color: var(--accent);
    background: var(--panel-bg); border: 1px solid var(--accent-line); background-clip: padding-box;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
  }
  .flow-add svg { width: 9px; height: 9px; }
  .flow-add:hover { background: var(--btn); border-color: var(--btn); color: #fff; transform: scale(1.12); }
  .flow-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* The bubble is a child of the link, not of the +: the + grows on hover, and anything inside it would be
     scaled along with it. So the + is named as the trigger explicitly rather than through .tip-host, which
     would otherwise answer to the whole full-width row the + sits in. */
  /* ---------- add-step menu ----------
     The same floating surface as the dropdowns, because it is one: a short list you pick from. What it adds
     is a first entry set apart — the step that usually comes next — so the common case is a single click
     and the full list is still right there under the rule. Each kind brings the icon and the tint it wears
     in the flow, so you are choosing the thing you will see rather than a word for it. */
  .addmenu {
    position: fixed; top: 0; left: 0; z-index: 30; width: 232px; padding: 4px;
    background: var(--pop-bg); border: 1px solid var(--stroke-strong); border-radius: 11px; box-shadow: var(--lift);
    transform-origin: left top; opacity: 0; visibility: hidden; transform: translateX(-4px) scale(.98);
    transition: opacity .12s ease, transform .14s ease, visibility 0s linear .14s;
  }
  .addmenu[hidden] { display: none; }
  .addmenu.on {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .14s ease, transform .2s cubic-bezier(.2, .8, .25, 1), visibility 0s;
  }
  /* no room on the right, so it opens the other way and grows from the edge it is anchored to */
  .addmenu.left { transform-origin: right top; transform: translateX(4px) scale(.98); }
  /* a kebab's menu hangs off the bottom of it, right edges flush, and grows from that corner */
  .addmenu.under { transform-origin: right top; transform: translateY(-4px) scale(.98); }
  .addmenu.under.up { transform-origin: right bottom; transform: translateY(4px) scale(.98); }
  .addmenu.left.on, .addmenu.under.on, .addmenu.under.up.on { transform: none; }
  .am-group {
    margin: 0; padding: 6px 8px 3px; font-size: 10px; line-height: 14px; font-weight: 560;
    letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2);
  }
  .am-opt {
    width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 6px 8px; border-radius: 7px;
    text-align: left; transition: background-color .12s ease;
  }
  .am-opt:hover, .am-opt:focus-visible { background: var(--wash); outline: none; }
  /* the icon alone, not a tile: at this size a tinted badge behind every row is more furniture than signal.
     One colour for all of them — the glyph already says which kind it is, and colouring it as well would
     make the accent mean "action" here and "selected" everywhere else on the page. */
  .am-ico { flex: none; display: grid; place-items: center; margin-top: 2px; color: var(--muted); }
  .am-ico svg { --sz: 15; width: 15px; height: 15px; }
  .am-t { flex: 1; min-width: 0; display: grid; font-size: 14px; font-weight: 520; line-height: 19px; color: var(--ink); }
  .am-sub { font-size: 12.5px; font-weight: 440; line-height: 17px; color: var(--muted-2); }
  /* full bleed, so it divides the list rather than sitting inside it */
  .am-rule { height: 1px; margin: 4px -4px; background: var(--rule); }
  /* A menu of plain actions rather than things to choose between, so the rows are one line and it is
     only as wide as they are. 164px fits Rename, Disable and Delete; a row menu that names what it acts
     on — "Remove from agency", "Go to program settings" — needs more than that and wrapped without it.
     Two stated widths rather than one content-sized: max-content here measured the row box rather than
     the text and came out wider than the floor it was given, which grew every short menu in the app. */
  .addmenu.sm { width: 164px; }
  .addmenu.sm.roomy { width: 232px; }

  /* A row that opens another menu rather than doing something. The chevron is the whole of the signal:
     it keeps its distance on the right the way the one in a select does, so a row you can follow reads
     differently from one you cannot without having to be said twice. */
  /* A row that offers a thing rather than naming it — the status badges, shown as the table will
     show them. The badge brings its own height, so the row stops padding for a text baseline and
     centres it instead. */
  .am-opt.am-badges { align-items: center; padding: 4px 8px; }

  .am-go { flex: none; margin-left: auto; color: var(--muted-2); }
  .am-go svg, svg.am-go { --sz: 14; width: 14px; height: 14px; }
  /* the parent stays lit while its submenu is open, so the trail back is visible from inside it */
  .am-opt[aria-expanded="true"] { background: var(--wash); }
  /* Offered but not available — the row is still read out, and still says what it would do. Pointer
     events stay off so it cannot be hovered into looking live. */
  .am-opt[disabled] { color: var(--muted-2); opacity: .55; pointer-events: none; }
  .am-opt[disabled] .am-t { color: inherit; }
  .sm .am-opt { align-items: center; }
  .sm .am-ico { margin-top: 0; }
  /* Nothing here has a second line to be the heading of, so the rows are plain body text — the same as
     a dropdown's options, which is what sits next to them. The weight above is for the rows that do. */
  .sm .am-t { font-weight: 440; }
  .am-opt.danger .am-ico, .am-opt.danger .am-t { color: var(--danger); }
  .am-opt.danger:hover, .am-opt.danger:focus-visible { background: var(--danger-wash); }
  /* A danger row that is not available reads as unavailable first: the red is what says this one takes
     something away, and there is nothing to take it from yet. It has to be restated here because the
     rule above it is the more specific of the two. */
  .am-opt.danger[disabled] .am-ico, .am-opt.danger[disabled] .am-t { color: var(--muted-2); }
  @media (prefers-reduced-motion: reduce) {
    .am-opt { transition: none; }
    .addmenu { transition: opacity .12s ease, visibility 0s; transform: none; }
  }

  /* beside the + rather than under it: the connector is a narrow gap between two cards, and a bubble below
     covers the card the + would add a step above. The child selector is load-bearing — .tip sets its own
     left, top and transform later in the sheet, and at equal specificity those would win. */
  .flow-link > .flow-tip { left: calc(50% + 22px); top: 50%; transform: translate(-3px, -50%); }
  .flow-link:has(.flow-add:hover) > .flow-tip,
  .flow-link:has(.flow-add:focus-visible) > .flow-tip {
    opacity: 1; visibility: visible; transform: translate(0, -50%); transition-delay: 0s;
  }
  /* once the menu is open the + has already said what it does, and the pointer is still on it — so the
     bubble would sit alongside the answer to its own question */
  .flow-link:has(.flow-add[aria-expanded="true"]) > .flow-tip {
    opacity: 0; visibility: hidden; transition-delay: 0s, 0s, 0s;
  }
  @media (prefers-reduced-motion: reduce) { .flow .step, .step-menu, .flow-add, .flow-set, .fs-ico { transition: none; } }

  /* ---------- the step's settings ---------- */
  /* The pane opens as a column of the panel rather than over it: nothing is covered, the flow stays where it
     was and simply has less room, so you keep sight of the step you are editing while you edit it. Its width
     is what animates — the contents are held at a fixed width inside, or every label would reflow on every
     frame of the open, which reads as a stutter rather than a slide. */
  /* the pane belongs to the flow, not to the page: it opens below the rule's header and runs from there to
     the panel's bottom-right corner, so the rule stays named above whatever step you are editing */
  .rule-body { flex: 1; min-height: 0; display: flex; align-items: stretch; }
  /* 24px of its own on the right, matching the page's own 24px on the left, so the flow stays centred
     between them whether the pane is open or shut */
  /* the gap under the header belongs to the flow, not to the header: the pane has to meet the header's
     hairline, so the space that separates the first card from it cannot sit above them both */
  .flow-wrap {
    flex: 1; min-width: 0; overflow-y: auto; padding: 22px 24px 24px 0;
    scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  .step-pane {
    flex: none; width: 0; min-height: 0; overflow: hidden;
    transition: width .42s cubic-bezier(.2, .8, .25, 1);
  }
  .step-pane.open { width: 361px; }
  .step-pane:not(.open) .sp-in { visibility: hidden; }   /* and so out of the tab order while shut */
  .sp-in {
    width: 360px; height: 100%; display: flex; flex-direction: column;
    border-left: 1px solid var(--rule); background: var(--surface); background-clip: padding-box;
  }
  /* the slot holds one view at a time; swapping between them keeps the pane open and just changes what is
     in it, so moving from the rule's own settings to a step's is not a close and an open */
  .sp-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .sp-view[hidden] { display: none; }

  /* the header names what the pane is for, so it is ruled off from the fields that do it */
  .sp-hd {
    flex: none; display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--rule);   /* even, so the badge sits in the middle of the band */
  }
  .sp-step { flex: 1; min-width: 0; font-size: 13px; line-height: 20px; color: var(--muted-2); }
  .sp-hd .step-kind { flex: none; }
  .sp-x {
    flex: none; width: 26px; height: 26px; margin: -2px -4px -2px 0; border-radius: 8px;
    display: grid; place-items: center; color: var(--muted-2);
    transition: background-color .14s ease, color .14s ease;
  }
  .sp-x:hover { background: var(--wash); color: var(--ink); }
  /* the symbol is drawn on a 24 grid, so it needs --sz to get its stroke normalised — a 12-unit wrapper
     viewBox would halve the mark and leave it heavier than the kebab beside it */
  .sp-x svg { --sz: 14; width: 14px; height: 14px; }
  .sp-body {
    flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 24px;
    display: flex; flex-direction: column; gap: 18px;
    scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  /* the fields follow the edge in, a beat behind the pane, the same as the settings column's rows */
  .step-pane.open .sp-view:not([hidden]) .sp-field, .step-pane.open .sp-view:not([hidden]) .sp-sec {
    animation: sub-in .34s cubic-bezier(.2, .8, .25, 1) both;
    animation-delay: calc(140ms + var(--i, 0) * 34ms);
  }
  .sp-field { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  /* the stagger animates transform, which makes each row its own stacking context — so an open list is
     trapped behind the row below it until the row that holds it is lifted above its siblings.
     flex: none because the body is a column that scrolls: without it the rows share out the overflow and
     everything short gets squeezed — the "Add Or rule group" button losing height as groups are added. */
  .sp-body > * { position: relative; flex: none; }
  /* Lifting the section is not enough on its own: the stagger's fill is `both`, so every field keeps its
     transform — and its stacking context — for good. Two fields side by side in a row are therefore
     siblings that stack by source order, and the one on the left has its list painted over by the one on
     the right. So the field that holds the open control is lifted within its row as well. */
  .sp-body > *:has(.sel[data-open="true"]), .sp-body > *:has(.f-date[data-open="true"]),
  .sp-sec:has(.sel[data-open="true"]), .sp-sec:has(.f-date[data-open="true"]),
  .sp-field:has(.sel[data-open="true"]), .sp-field:has(.f-date[data-open="true"]) {
    position: relative; z-index: 7;
  }
  /* Four roles live in this pane — a section heading, its note, a field's label and the field's own value —
     and they were all within a point of each other, told apart by weight alone. So the heading read as no
     bigger than the label beneath it and smaller than the value it governs. Each one now has a step of its
     own: 14/600 heading, 14 value, 12.5 note, 12 label. */
  .sp-field label, .sp-lbl { font-size: 12px; line-height: 16px; font-weight: 520; letter-spacing: .1px; color: var(--muted-2); }
  /* :not(.f-date-in) — the date field is already a bordered box, and its input is just the text line
     inside it. Without this the pane drew a second field, with a second focus ring, within the first. */
  .sp-field input[type="text"]:not(.f-date-in), .sp-field input[type="date"] {
    width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--field); border-radius: 8px;
    background: var(--page); color: var(--ink); font: inherit; font-size: 14px;
    box-shadow: 0 0 0 0 var(--accent-wash);
    transition: border-color .14s ease, box-shadow .18s ease, background-color .14s ease;
  }
  /* The ring is for the fields the rule above draws, and names them again rather than saying "input":
     a bare input picks up a halo with no edge of its own to sit on. The multi-select's search box is
     one — it sits in a popover inside a .sp-field, and its frame belongs to the row around it. */
  .sp-field input[type="text"]:not(.f-date-in):focus, .sp-field input[type="date"]:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
  }
  .sp-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .sp-sec h4 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: -.1px; color: var(--ink); }
  .sp-note, .sp-hint { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--muted-2); }
  /* The grid's 7px gap is between boxes, and both lines carry leading of their own, so the heading and
     its note were 12px apart on the page — further than the note is from the fields it introduces, which
     read the grouping backwards. Pulled up so the note belongs to the heading above it. */
  .sp-note { margin-top: -5px; margin-bottom: 3px; }
  .sp-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  /* The pane runs a compact scale — its selects are 32px at 14px — so the date field follows that rather
     than the modal's roomier 36px. Everything else about it is the modal's field, unchanged. */
  .f-date { min-width: 0; }
  /* two of these share a 360px pane, so the chrome is pared back far enough that a full date — "31 Dec
     2026" — still fits the field without clipping */
  .f-date.sm .f-date-btn { height: 32px; padding: 0 2px 0 7px; gap: 6px; font-size: 14px; background: var(--page); }
  .f-date.sm .f-date-in { font-size: 14px; }
  .f-date.sm .f-date-toggle { width: 22px; height: 22px; border-radius: 6px; }
  /* two of these sit side by side in a 360px pane, so the calendar is narrower than the modal's and hangs
     off whichever edge keeps it on screen */
  .sp-view .f-cal { min-width: 0; width: 304px; right: auto; padding: 8px; }
  .sp-view .f-cal.right { left: auto; right: 0; transform-origin: top right; }
  .sp-view .f-day { height: 32px; line-height: 32px; font-size: 14px; }
  .sp-view .f-cal-dow span { height: 24px; line-height: 24px; }
  /* the step being edited holds the selected look while its pane is open, so the two read as one thing */
  .flow .step.on { border-color: var(--accent); background: var(--page); }
  /* A disabled step still holds its settings and still has to be read, so it greys out rather than hiding:
     the run skips it, and the card says so without leaving a gap in the numbering. */
  .flow .step.off { background: var(--wash); border-style: dashed; }
  .flow .step.off .step-kind, .flow .step.off .step-nm, .flow .step.off .step-nm::before, .flow .step.off .step-sub { color: var(--muted-2); }
  .flow .step.off .step-kind.action { background: var(--muted-2); color: var(--page); }
  /* a badge rather than a word appended to the hint, so it reads at a glance and matches the one the
     automations list puts on a rule that is off */
  .step-off {
    display: none; flex: none; padding: 1px 7px; border-radius: 9999px;
    background: var(--danger-wash); color: var(--danger);
    font-size: 12px; font-weight: 480; line-height: 16px; letter-spacing: .01em;
  }
  .flow .step.off .step-off { display: block; }
  /* ---------- filter conditions ---------- */
  /* A rule group is a set of conditions that must all hold, and the groups are alternatives to each other.
     That is two levels, so it gets two kinds of container rather than one flat list: each group is a card,
     and between the cards sits an "Or" on a hairline — the same device the flow uses between steps, which
     is exactly the same relationship one level down. */
  .fg-list { display: flex; flex-direction: column; }
  .fg {
    padding: 12px; border-radius: 12px;
    background: var(--page); border: 1px solid var(--stroke); background-clip: padding-box;
  }
  .fr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .fr + .fr { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
  .fr-hd { display: flex; align-items: center; gap: 8px; min-height: 20px; }
  .fr-lbl { flex: 1; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 520; color: var(--ink-soft); }
  .fr-x {
    flex: none; width: 22px; height: 22px; margin: -2px -4px -2px 0; border-radius: 6px;
    display: grid; place-items: center; color: var(--muted-2);
    transition: background-color .14s ease, color .14s ease;
  }
  .fr-x:hover { background: var(--danger-wash); color: var(--danger); }
  .fr-x svg { --sz: 13; width: 13px; height: 13px; }
  /* The day count borrows .offset from the action pane, where a number with its unit sitting inside
     the field was already the way to ask for a span of days. Range needs nothing of its own: it is one
     field holding two ends, the same field every other condition here uses. */

  /* The alternation between groups, drawn rather than written into a heading. The word sits on the line
     rather than in a pill on the line — one less outline — and the line fades out at both ends, the same
     way the flow's connector does, so it reads as a join between two things rather than a border under one. */
  .fg-or { position: relative; display: grid; place-items: center; height: 36px; }
  .fg-or::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
    background: linear-gradient(to right, transparent, var(--stroke) 22%, var(--stroke) 78%, transparent);
  }
  .fg-or span {
    position: relative; padding: 0 10px; background: var(--surface);
    font-size: 11px; font-weight: 560; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
  }

  /* the quiet way to add one more of something: a bordered row that does not compete with the fields */
  .ghost {
    height: 32px; padding: 0 12px 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--field); border-radius: 8px; background: var(--page);
    font-size: 14px; font-weight: 480; line-height: 20px; color: var(--muted);
    transition: border-color .14s ease, color .14s ease, background-color .14s ease;
  }
  .ghost:hover { border-color: var(--accent-line); color: var(--accent-deep); background: var(--accent-wash); }
  .ghost svg { --sz: 12; width: 12px; height: 12px; }
  .ghost.wide { width: 100%; }
  .fg > .ghost { margin-top: 12px; }

  /* ---------- action ---------- */
  .sp-row { display: flex; align-items: center; gap: 8px; }
  .sp-row .sel { flex: 1; min-width: 0; }
  /* the offset rides alongside the start date rather than under it: it modifies that date, it is not a
     field of its own */
  .offset { flex: none; position: relative; width: 90px; }
  .offset input {
    width: 100%; height: 32px; padding: 0 40px 0 8px; border: 1px solid var(--field); border-radius: 8px;
    background: var(--page); color: var(--ink); font: inherit; font-size: 14px;
    appearance: textfield; -moz-appearance: textfield; font-variant-numeric: tabular-nums;
  }
  .offset input::-webkit-outer-spin-button, .offset input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .offset input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
  .offset .unit { position: absolute; right: 8px; top: 50%; margin-top: -9px; font-size: 13px; line-height: 18px; color: var(--muted-2); pointer-events: none; }
  /* An offset is the exception, not the rule: most start dates are the event itself, so the field asks
     for the date and offers the days rather than showing an empty box for them. Added, they get a line of
     their own that reads as a sentence — 3 days, after — with the way back out at the end of it. */
  .sp-row .ghost { flex: none; }
  .off-row[hidden] { display: none; }
  .off-row .offset { width: 86px; }
  .off-row .sel { flex: 1; min-width: 0; }
  .off-row .fr-x { margin-right: -2px; }
  @keyframes off-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .off-row.fresh { animation: off-in .2s cubic-bezier(.2, .8, .25, 1); }
  @media (prefers-reduced-motion: reduce) { .off-row.fresh { animation: none; } }
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* the switch keeps its own hover pill, pulled into the pane's gutter so the label still lines up with
     the fields under it */
  .sp-switch { margin: 0 -12px 2px; }
  /* The hover pill is the hit target drawn, so it ends where the control does. Stretched to the pane it
     was half empty — a filled bar rather than a hover state, and a claim on space nothing lives in. The
     negative margin stays, so the label still lines up with the fields below. */
  .sp-switch .toggle { width: auto; justify-content: flex-start; }
  .sp-opts { display: grid; gap: 2px; margin: 0 -8px; }
  .sp-opts[hidden], .sp-callout[hidden], #acTargetField[hidden], #acDates[hidden] { display: none; }
  .sp-opts .f-opt { font-size: 14px; line-height: 19px; width: fit-content; max-width: 100%; }
  /* a consequence of the choice above it, not an instruction — so it is a note on the pane, not a field */
  .sp-callout {
    margin: 0; padding: 10px 12px; border-radius: 10px;
    background: var(--accent-wash); color: var(--accent-deep);
    font-size: 13px; line-height: 19px;
  }
  /* the action card says what it will do and, underneath, what it will do it to */
  .step-sub { display: block; margin-top: 1px; font-size: 14px; line-height: 20px; color: var(--muted-2); }
  .step-sub[hidden] { display: none; }

  @media (prefers-reduced-motion: reduce) {
    .fr-x, .ghost { transition: none; }
    .step-pane { transition: none; }
    .step-pane.open .sp-view .sp-field, .step-pane.open .sp-view .sp-sec { animation: none; }
  }

  @media (max-width: 1240px) { .rules-side { flex-basis: 220px; } }
  .rules-empty { margin: 0 14px; }
  @media (prefers-reduced-motion: reduce) { .rule, .rules-glide { transition: none; } }
  .settings:focus-visible { outline: none; }
  .sub-note { margin: 0; font-size: 15px; line-height: 22px; color: var(--muted); }

  /* the second column is the first thing to go when the window cannot carry three */
  @media (max-width: 1100px) { .frame:has(> .subrail) { --subrail-w: 188px; } }

  .rail-glide { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 10px; background: var(--wash); opacity: 0; pointer-events: none; transition: transform .24s ease-out, width .24s ease-out, height .24s ease-out, opacity .16s ease, background-color .24s ease; }
  /* Over the current page the highlight takes that item's own colour instead of its usual neutral. The
     selected item's fill is translucent, so a grey passing behind it shows through and turns the teal
     muddy; two coats of the same accent instead just read as the selected item, hovered. The colour eases
     on the same clock as the travel, so it has arrived by the time the highlight has. */
  .rail-glide.on-current { background: var(--accent-wash); }
  /* The mark is the way back out to Customer Success, which is where a CS user came in from — so it is
     a link, and says so under the pointer rather than only on arrival. The rail's own travelling
     highlight stops short of it: it belongs to the sections, and the mark is not one of them. */
  /* min-height, padding and justify-content are restated because .rail a dresses every link in the rail
     as a section: the mark became one of those the moment it became a link, and took their 60px box with
     it. The last of the three is the one that shows — a grid's justify-content places its tracks, so
     flex-start packed this one's single column against the rail's left edge and place-items could only
     centre the mark inside that 36px column. It sat a full rail's width left of the icons below it. */
  .rail .logo {
    height: 56px; min-height: 0; width: 100%; padding: 0; border-radius: 10px;
    display: grid; place-items: center; justify-content: center;
  }
  .rail .logo .mark { width: 36px; height: auto; aspect-ratio: 105 / 50; color: var(--accent); transition: opacity .14s ease; }
  .rail .logo:hover .mark, .util-logo:hover .mark { opacity: .72; }
  .rail .logo:focus-visible, .util-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
  @media (prefers-reduced-motion: reduce) { .rail .logo .mark { transition: none; } }
  .rail nav { display: flex; flex-direction: column; gap: 4px; width: 100%; margin-top: 4px; }
  .rail a { position: relative; min-height: 60px; padding: 10px 10px 8px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; text-align: center; text-wrap: balance; font-size: 13px; line-height: 16px; letter-spacing: .1px; font-weight: 480; color: var(--ink-soft); }
  .rail a svg { width: 18px; height: 18px; color: var(--muted-2); }
  /* The box never changes size, so hovering cannot nudge the label or the items below it. It is held at
     the full 34-wide artwork (25.5px at the rail's 18px height, a clean 0.75 scale, so the stroke still
     lands at 1.5px like every other icon). At rest the pair is slid right by 5 units to sit centred in
     that box; on hover it slides back to 0 as the second pair fades in, and the group is centred again —
     both states balanced, with the movement doing the storytelling. */
  .rail a svg.team { width: 25.5px; height: 18px; }
  .team-shift { transform: translateX(5px); transition: transform .24s ease; }
  .team-more { opacity: 0; transition: opacity .2s ease; }
  .rail a:hover .team-shift, .rail a:focus-visible .team-shift { transform: translateX(0); }
  .rail a:hover .team-more, .rail a:focus-visible .team-more { opacity: 1; }

  /* The route stretches rather than gains parts, so this one morphs: both states are the same sequence of
     commands (M h a h a H), which is what makes d interpolable — the line genuinely lengthens instead of
     one copy fading into another. The dots ride along on cx. Values are duplicated as attributes so the
     icon still draws its resting state if a browser will not animate d. Same constant box and centring
     slide as the Employees icon. */
  .rail a svg.route { width: 25.5px; height: 18px; }
  .route-shift { transform: translateX(5px); transition: transform .26s ease; }
  .route-line { d: path("M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"); transition: d .26s ease; }
  .route-a { cx: 6px; transition: cx .26s ease; }
  .route-b { cx: 18px; transition: cx .26s ease; }
  .rail a:hover .route-shift, .rail a:focus-visible .route-shift { transform: translateX(0); }
  .rail a:hover .route-line, .rail a:focus-visible .route-line { d: path("M7.5 19h14a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H25.5"); }
  .rail a:hover .route-a, .rail a:focus-visible .route-a { cx: 4px; }
  .rail a:hover .route-b, .rail a:focus-visible .route-b { cx: 29px; }

  /* TrainOnce. The two drawings were authored independently, so their outlines shared no commands and d
     could not interpolate between them. Both silhouettes are resampled here onto the same 44 cubic segments
     by arc length — same count, same order — which is what makes the body a genuine morph rather than a
     swap: the shoe rotates down and flattens, and is a shoe at every frame in between. The seam was chosen
     by trying every rotation of the flat loop in both directions and keeping the one whose points travel
     least, which is what stops the tween from twisting.
     Resampling smooths corners, so only the body goes through it. Everything that reads as detail — the
     sole, the strap, the heel tab, the lace — stays exactly as drawn and is a path of its own, collapsed to
     a point rather than faded, so nothing in this icon ever dissolves. They clear out before the body moves
     and the lace arrives after it lands, which keeps the morph legible and the detail crisp. */
  .rail a svg.train { width: 23.25px; height: 18px; }
  .train-body { d: path("M13 22C13.4 21.83 13.65 21.31 13.97 20.97C14.3 20.63 14.62 20.29 14.95 19.94C15.27 19.6 15.59 19.26 15.92 18.92C16.24 18.57 16.57 18.23 16.89 17.89C17.22 17.55 17.54 17.2 17.86 16.86C18.19 16.52 18.51 16.18 18.84 15.83C19.16 15.49 19.49 15.15 19.81 14.81C20.13 14.46 20.46 14.12 20.78 13.78C21.11 13.44 21.43 13.09 21.76 12.75C22.08 12.41 22.4 12.07 22.73 11.72C23.05 11.38 23.38 11.04 23.7 10.7C24.03 10.35 24.39 10.03 24.67 9.67C24.96 9.3 25.33 8.92 25.44 8.5C25.54 8.07 25.48 7.52 25.3 7.12C25.11 6.72 24.67 6.43 24.32 6.12C23.97 5.81 23.57 5.55 23.19 5.27C22.81 4.99 22.44 4.7 22.06 4.42C21.68 4.14 21.3 3.85 20.93 3.57C20.55 3.29 20.18 2.98 19.8 2.72C19.41 2.46 18.97 2 18.6 2C18.22 2.01 17.71 2.39 17.53 2.75C17.35 3.11 17.52 3.69 17.5 4.16C17.48 4.63 17.57 5.15 17.42 5.57C17.27 5.99 16.95 6.41 16.59 6.68C16.23 6.94 15.71 7.01 15.26 7.15C14.81 7.3 14.35 7.42 13.9 7.55C13.45 7.68 12.94 7.74 12.54 7.95C12.15 8.15 11.7 8.42 11.52 8.79C11.34 9.17 11.48 9.73 11.45 10.21C11.41 10.68 11.38 11.15 11.32 11.61C11.26 12.08 11.19 12.55 11.1 13.01C11 13.47 10.9 13.94 10.76 14.39C10.62 14.83 10.46 15.29 10.25 15.71C10.05 16.13 9.82 16.56 9.51 16.91C9.21 17.25 8.83 17.6 8.42 17.79C8.01 17.98 7.46 17.88 7.04 18.05C6.62 18.22 6.14 18.47 5.89 18.82C5.63 19.17 5.47 19.72 5.51 20.15C5.54 20.58 5.78 21.1 6.08 21.41C6.39 21.72 6.89 21.9 7.34 21.99C7.78 22.09 8.28 22 8.75 22C9.23 22 9.7 22 10.17 22C10.64 22 11.11 22 11.58 22C12.06 22 12.6 22.17 13 22"); transition: d .4s cubic-bezier(.4, 0, .2, 1); }
  .train-line { d: path("M18.5 10.42L23.3 5.35"); transition: d .4s cubic-bezier(.4, 0, .2, 1); }
  /* The line inside the shoe is the same line in both drawings — the strap when it is upright, the lace when
     it is flat — so it rides the morph with the body instead of leaving and coming back. Both are one point
     to another, which is all d needs to interpolate; the lace's H is written as an L and runs left to right
     so its direction matches the strap rotating down, rather than flipping end over end on the way.
     What has no counterpart on the other side draws itself away instead: a zero-length path still paints a
     dot under a round cap, and with the body gone from under them those dots would be left stranded.
     pathLength normalises each to 100 so one number covers both, and the offset is negative so the sole
     retracts from its far end, right to left. */
  .train-sole, .train-heel { stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset .13s ease .4s; }

  .rail a:hover svg.train .train-body, .rail a:focus-visible svg.train .train-body {
    d: path("M14.23 18C14.69 18 15.15 18 15.61 18C16.07 18 16.53 18 16.99 18C17.45 18 17.91 18 18.37 18C18.83 18 19.29 18 19.75 18C20.21 18 20.67 18 21.13 18C21.59 18 22.05 18 22.51 18C22.97 18 23.43 18 23.89 18C24.35 18 24.83 18.08 25.27 18C25.71 17.92 26.24 17.82 26.53 17.54C26.82 17.25 26.93 16.72 26.99 16.29C27.05 15.85 26.93 15.37 26.87 14.91C26.82 14.46 26.73 14 26.66 13.55C26.59 13.09 26.51 12.64 26.44 12.19C26.37 11.73 26.3 11.28 26.23 10.82C26.15 10.37 26.08 9.91 26.01 9.46C25.94 9.01 25.97 8.48 25.79 8.1C25.62 7.71 25.31 7.23 24.95 7.15C24.6 7.07 24.1 7.41 23.69 7.61C23.28 7.8 22.91 8.11 22.51 8.32C22.1 8.54 21.7 8.8 21.26 8.9C20.83 8.99 20.33 8.97 19.89 8.88C19.46 8.79 19.05 8.53 18.63 8.34C18.21 8.15 17.8 7.95 17.38 7.75C16.96 7.56 16.56 7.26 16.13 7.17C15.7 7.07 15.17 7.01 14.81 7.19C14.46 7.38 14.25 7.9 14 8.28C13.74 8.66 13.53 9.08 13.28 9.46C13.03 9.85 12.77 10.23 12.49 10.6C12.22 10.96 11.93 11.32 11.61 11.65C11.29 11.99 10.96 12.31 10.6 12.59C10.23 12.87 9.84 13.13 9.43 13.33C9.02 13.52 8.58 13.68 8.13 13.78C7.69 13.89 7.22 13.9 6.77 13.96C6.31 14.02 5.81 13.96 5.41 14.13C5 14.29 4.56 14.6 4.33 14.95C4.1 15.31 3.96 15.85 4.02 16.26C4.08 16.68 4.38 17.15 4.7 17.43C5.02 17.72 5.51 17.88 5.95 17.98C6.39 18.07 6.87 18 7.33 18C7.79 18 8.25 18 8.71 18C9.17 18 9.63 18 10.09 18C10.55 18 11.01 18 11.47 18C11.93 18 12.39 18 12.85 18C13.31 18 13.77 18 14.23 18"); transition: d .4s cubic-bezier(.4, 0, .2, 1) .13s;
  }
  .rail a:hover svg.train .train-line, .rail a:focus-visible svg.train .train-line {
    d: path("M19.02 13.55L26.66 13.55"); transition: d .4s cubic-bezier(.4, 0, .2, 1) .13s;
  }
  .rail a:hover svg.train .train-sole, .rail a:hover svg.train .train-heel,
  .rail a:focus-visible svg.train .train-sole, .rail a:focus-visible svg.train .train-heel {
    stroke-dashoffset: -100; transition: stroke-dashoffset .13s ease;
  }

  /* info at rest, circle-question-mark on hover. The two glyphs are the same circle with the dot and the
     body at opposite ends, so the whole thing is one swap: the stem rises and curls into the hook while the
     dot drops past it to the baseline. info's stem is normally "M12 16v-4", which cannot interpolate with
     the hook's "M a c" — so it is written here as the same three commands, with a zero-length arc (SVG drops
     an arc whose endpoints coincide) and a cubic whose controls are collinear. It draws pixel-identical to
     lucide's info and is one continuous morph away from the question mark. Radii stay 3 3 in both states, so
     nothing inflates on the way across. */
  .rail a svg.ask { width: 18px; height: 18px; }
  .ask-stem { transition: d .3s cubic-bezier(.34, .1, .2, 1); }
  /* The dot waits for the stem to curl up and left before it drops, so the two do not spend the first half
     of the move sitting on top of each other at x=12 — held together they read as one blob rather than as
     an icon. Letting the hook form first keeps the glyph legible the whole way across. */
  .ask-dot { transition: d .22s cubic-bezier(.34, .1, .2, 1) .1s; }
  .rail a:hover .ask-stem, .rail a:focus-visible .ask-stem { d: path("M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"); }
  .rail a:hover .ask-dot, .rail a:focus-visible .ask-dot { d: path("M12 17h.01"); }

  /* The one icon that is a machine, so it just turns — no morph. The gear has six lobes, so it repeats
     every 60deg; two teeth is far enough to read as a spin and still lands on an identical pose, which is
     also why unhovering can simply run it backwards. Origin is set explicitly: it is the CSS default for an
     outermost <svg>, but every other icon rule here sets one, and the sprite's gear is centred on 12,12. */
  .rail a svg.gear { transform-origin: center; transition: transform .45s cubic-bezier(.34, .1, .2, 1); }
  .rail a:hover svg.gear, .rail a:focus-visible svg.gear { transform: rotate(120deg); }

  /* Same widening box and centring slide as the Employees icon, and the same morph as the route: rest and
     hover are identical command sequences (M v a h for the axis, M V for every bar), so the axis genuinely
     extends and the bars genuinely change height rather than one drawing cross-fading into another. The two
     new bars start as zero-height stubs on the baseline and grow, which is why they morph as well as fade —
     a bar chart gaining a column should look like it grew, not like it appeared. Left-to-right stagger. */
  .rail a svg.chart { width: 25.5px; height: 18px; }
  .chart-shift { transform: translateX(5px); transition: transform .26s ease; }
  .chart-axis { d: path("M3 3v16a2 2 0 0 0 2 2h16"); transition: d .26s ease; }
  .bar { transition: d .26s ease, opacity .2s ease; }
  .b1 { d: path("M8 17V14"); }
  .b2 { d: path("M13 17V5"); transition-delay: .03s; }
  .b3 { d: path("M18 17V9"); transition-delay: .06s; }
  .b4 { d: path("M23 17V17"); opacity: 0; transition-delay: .09s; }
  .b5 { d: path("M28 17V17"); opacity: 0; transition-delay: .12s; }
  .rail a:hover .chart-shift, .rail a:focus-visible .chart-shift { transform: translateX(0); }
  .rail a:hover .chart-axis, .rail a:focus-visible .chart-axis { d: path("M3 4v16a2 2 0 0 0 2 2h25.182"); }
  .rail a:hover .b1, .rail a:focus-visible .b1 { d: path("M8 18V7"); }
  .rail a:hover .b2, .rail a:focus-visible .b2 { d: path("M13 18V12"); }
  .rail a:hover .b3, .rail a:focus-visible .b3 { d: path("M18 18V8"); }
  .rail a:hover .b4, .rail a:focus-visible .b4 { d: path("M23 18V2"); opacity: 1; }
  .rail a:hover .b5, .rail a:focus-visible .b5 { d: path("M28 18V8"); opacity: 1; }

  .rail a svg.dash { width: 18px; height: 18px; }
  /* Each tile turns a quarter clockwise about its own centre and slides one slot round the
     pinwheel; the stagger is what keeps it from reading as a rigid spin of the whole icon. */
  .tile { transform-box: fill-box; transform-origin: center; transition: transform .34s cubic-bezier(.34,.1,.2,1); }
  .tile.tr { transition-delay: .05s; }
  .tile.br { transition-delay: .1s; }
  .tile.bl { transition-delay: .15s; }
  .rail a:hover .tile.tl, .rail a:focus-visible .tile.tl { transform: translate(1px, 10px) rotate(90deg); }
  .rail a:hover .tile.tr, .rail a:focus-visible .tile.tr { transform: translate(-12px, 1px) rotate(90deg); }
  .rail a:hover .tile.br, .rail a:focus-visible .tile.br { transform: translate(-1px, -10px) rotate(90deg); }
  .rail a:hover .tile.bl, .rail a:focus-visible .tile.bl { transform: translate(12px, -1px) rotate(90deg); }

  /* Doffing the cap: the board and its tassel keep their shape exactly and lift straight up, so that half is
     a plain translate rather than a morph — the hovered drawing's corners differ from the resting ones by
     3.000 on y and nothing else. Only the head band changes shape, growing taller on both sides as the cap
     comes off it, and it morphs because rest and hover are the same M V a v sequence. */
  .rail a svg.cap { width: 18px; height: 18px; }
  .cap-lift { transition: transform .26s ease; }
  .cap-head { transition: d .26s ease; }
  .rail a:hover .cap-lift, .rail a:focus-visible .cap-lift { transform: translateY(-3px); }
  .rail a:hover .cap-head, .rail a:focus-visible .cap-head { d: path("M6 10V16a6 3 0 0 0 12 0v-6"); }

  /* The page starts blank and the lines write on, top to bottom. Each is hidden by a dash offset of its own
     length, so it draws over its whole duration rather than finishing early; the offsets clear it by more
     than a cap radius, or the round linecap leaves a nub showing on a line that is meant to be absent.
     Durations are proportional to length, so the pen moves at one speed down the page. Triggered from the
     whole .rail-item, not the link, so the lines stay written while the pointer is out in the flyout —
     the same reason the glide stays parked there. */
  .rail a svg.doc { width: 18px; height: 18px; }
  .doc-line { transition: stroke-dashoffset .15s ease; }
  .doc-line.l1 { stroke-dasharray: 2 14; stroke-dashoffset: 4; transition-duration: .06s; }
  .doc-line.l2 { stroke-dasharray: 8 20; stroke-dashoffset: 10; transition-delay: .05s; }
  .doc-line.l3 { stroke-dasharray: 8 20; stroke-dashoffset: 10; transition-delay: .12s; }
  .rail-item:hover .doc-line, .rail-item:focus-within .doc-line { stroke-dashoffset: 0; }
  .rail a:focus-visible { background: var(--wash); }
  .rail a.on { background: var(--accent-wash); color: var(--accent-deep); font-weight: 520; }
  .rail a.on svg { color: var(--accent); }
  .rail .foot { margin-top: auto; width: 100%; padding-top: 12px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }

  /* A rail entry that owns children. It carries no marker of its own: the rail's items are icon over a
     centred label, and anything pinned to the right edge needs padding to sit in, which pulls the icon and
     label off centre and breaks the one alignment every other item keeps. What ties the two together is
     the parent staying lit while the pointer is out in the menu, plus the panel's adjacency and lift.
     No tails on floating surfaces anywhere, by the way — see .pop for why: it glides between rows, flips
     sides and clamps to the viewport, so a tail there would have to chase its anchor and would sometimes
     point at nothing. A rule the two surfaces can both keep is worth more than a pointer on the easy one. */
  .rail-item { position: relative; width: 100%; }
  /* the glide stays parked on the parent while the pointer is out in the menu, so the two read as one
     surface; this covers the keyboard, which the glide does not follow */
  .rail-item:focus-within > a { background: var(--wash); }

  /* The flyout is the same floating surface as the row hover card — same fill, stroke, radius and lift —
     so the app has one idea of what a panel above the page looks like. The wrapper's left padding is the
     bridge: without it the pointer crosses dead ground on its way over and the menu closes underneath it. */
  /* The wrapper only places the panel and holds it open; its transform is the vertical centring and nothing
     else, so the reveal is carried by the panel inside it. Visibility is what makes the closed menu properly
     gone rather than just transparent, and its delay has to outlast the slowest exit transition (.16s) or
     the panel is yanked out of view part-way through fading. */
  .rail-menu { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); z-index: 30; padding-left: 12px; visibility: hidden; transition: visibility 0s linear .16s; }
  .rail-item:hover .rail-menu, .rail-item:focus-within .rail-menu { visibility: visible; transition: visibility 0s; }
  /* It unfolds out of the rail item it belongs to: growing from the left edge, which is the side touching
     its parent, so the movement points back at what opened it instead of arriving from nowhere. Opening is
     eased out over a longer beat than closing — appearing is the part worth watching. */
  .rail-menu-panel { position: relative; min-width: 168px; padding: 6px; background: var(--pop-bg); border: 1px solid var(--stroke-strong); border-radius: 12px; box-shadow: var(--lift); transform-origin: left center; opacity: 0; transform: translateX(-8px) scale(.97); transition: opacity .12s ease, transform .16s ease; }
  .rail-item:hover .rail-menu-panel, .rail-item:focus-within .rail-menu-panel { opacity: 1; transform: none; transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .25, 1); }
  /* reset the column layout the rail gives its links; in here each option is an icon beside its name, on
     one line, so the two centre on each other rather than hanging from a common top edge */
  .rail-menu a { min-height: 0; padding: 8px 10px; border-radius: 8px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; letter-spacing: 0; font-size: 15px; line-height: 20px; font-weight: 520; color: var(--ink); }
  .rail-menu a svg { --sz: 16; width: 16px; height: 16px; color: var(--muted-2); }
  /* Hover is the travelling highlight, exactly as in the rail — no static background here, or the item would
     wear two coats of the same wash while the glide sat on it. The glide is neutral because the accent is how
     the rail says "this is the page you are on"; spending it on a hover made every option look selected in
     passing. Keyboard focus is already covered by .rail a:focus-visible, which reaches in here too. */
  .menu-glide { border-radius: 8px; }

  /* ---------- needs setup ----------
     An automation that is missing something will not run, and nothing else on the page says so. This is
     how it is said, and it is kept quiet on purpose: a fresh step is unfinished by definition, so a loud
     treatment would shout at every new automation before anyone had a chance to fill it in. A badge in
     the warning colour on the card and beside the rule's name in the list, and nothing on the fields
     themselves: the card already says which step is short, and opening it shows what is empty. */
  /* the same pill as the Disabled badge beside it, so a card or a row says both things the same way */
  .step-warn, .rule-warn {
    flex: none; padding: 1px 7px; border-radius: 9999px;
    background: color-mix(in srgb, var(--warning) 13%, transparent); color: var(--warning);
    font-size: 12px; font-weight: 480; line-height: 16px; letter-spacing: .01em; white-space: nowrap;
  }
  .step-warn { display: none; }
  .flow .step.warn .step-warn { display: block; }
  .flow .step.warn.off .step-warn { display: none; }   /* a skipped step is not one the run is waiting on */
  .rule-warn[hidden] { display: none; }
  .rpv-when.warn b { color: var(--warning); }
  .rpv-when.warn b::before { background: var(--warning); }

  /* ---------- content column ---------- */
  .content { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .panel { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel-bg); background-clip: padding-box; border-top-left-radius: 16px; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); overflow: hidden; }
  .util { height: 56px; padding: 0 24px 0 0; display: flex; align-items: center; justify-content: space-between; }
  /* top row: agency, active count | app switcher, notifications, user */
  .util .left, .util .right { display: flex; align-items: center; }
  /* Fluted glass in an empty stretch of chrome, lit only where the pointer is. The flutes are even and
     translucent — real reeded glass is a uniform extrusion — and the variety comes from what sits behind
     them: pools of light and shade, no two the same size or place, which the flutes slice into ribbons of
     differing brightness. A radial mask is what makes it a spotlight rather than a texture.

     It runs along the bar's width and is pinned to the bar's bottom edge, which is the top edge of the
     content panel, so the light reads as coming up out of the panel. The element's own overflow cuts the
     pool at that edge, so only the half facing up into the bar is ever drawn. */
  .util .glass { flex: 1; align-self: stretch; min-width: 0; position: relative; overflow: hidden; }
  .util .glass::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
    transition: opacity 1.2s ease;   /* the fade OUT; the reveal has its own, quicker one below */
    background-image:
      repeating-linear-gradient(90deg, var(--rib-hi) 0px, transparent 2px, var(--rib-lo) 4px, transparent 6px, var(--rib-hi) 7px),
      radial-gradient(38% 150% at 12% 6%, var(--rib-glow), transparent 60%),
      radial-gradient(30% 130% at 33% 92%, var(--rib-shade), transparent 62%),
      radial-gradient(46% 175% at 57% 20%, var(--rib-glow), transparent 58%),
      radial-gradient(34% 140% at 80% 74%, var(--rib-shade), transparent 60%),
      radial-gradient(26% 120% at 96% 14%, var(--rib-glow), transparent 64%),
      linear-gradient(104deg, var(--rib-base), transparent 46%, var(--rib-base));
    /* Two mask layers intersected: the moving pool, and a fixed taper at the far ends, without which the
       pool would meet the element's own clip edge at full strength and stop dead against the controls
       either side. The taper is a proportion of the strip rather than a fixed distance, and runs through
       several stops rather than straight to black — a short linear ramp against a pool this wide still
       reads as an edge, because it fades over a fraction of the pool's own width. The pool's 56px of
       vertical radius matches the bar's height, so it reaches nothing exactly at the top. */
    -webkit-mask-image: radial-gradient(200px 56px at var(--mx, 50%) var(--my, 100%), #000 0%, rgba(0,0,0,.9) 20%, rgba(0,0,0,.6) 44%, rgba(0,0,0,.28) 68%, rgba(0,0,0,.08) 86%, transparent 100%), linear-gradient(90deg, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.75) 16%, #000 24%, #000 76%, rgba(0,0,0,.75) 84%, rgba(0,0,0,.3) 92%, transparent 100%);
    mask-image: radial-gradient(200px 56px at var(--mx, 50%) var(--my, 100%), #000 0%, rgba(0,0,0,.9) 20%, rgba(0,0,0,.6) 44%, rgba(0,0,0,.28) 68%, rgba(0,0,0,.08) 86%, transparent 100%), linear-gradient(90deg, transparent 0, rgba(0,0,0,.3) 8%, rgba(0,0,0,.75) 16%, #000 24%, #000 76%, rgba(0,0,0,.75) 84%, rgba(0,0,0,.3) 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
  /* One dial over the whole stack, so the flutes, the pools and the silver wash brighten and soften
     together and keep their relationship to each other. --glow answers to how fast the pointer moves. */
  .util .glass:hover::before { opacity: var(--glow, .46); transition: opacity .6s ease; }
  .util .left { gap: 12px; }
  .util .right { gap: 4px; }
  .util .nm { font-weight: 520; }
  .util .chev { color: var(--muted-2); }
  .agency, .user { height: 40px; display: inline-flex; align-items: center; gap: 10px; padding: 0 10px 0 6px; border-radius: 10px; font-size: 15px; color: var(--ink); }
  .agency:hover, .user:hover { background: var(--wash); }
  .ag-av { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-wash); color: var(--accent-deep); display: grid; place-items: center; font-size: 13px; font-weight: 560; border: 1px solid var(--accent-line); }
  /* The initial is the agency you are in, so there is no tile until you are in one: the control reads as
     its own words until it has something to stand for. It used to hold the product's mark in the
     meantime, which made the switcher the place the product signed its name. */
  .ag-av svg { --sz: 15; width: 15px; height: 15px; }
  .count { height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--accent-line); border-radius: 8px; background: transparent; font-size: 15px; color: var(--ink-soft); }
  .count i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  .count b { font-weight: 560; color: var(--ink); font-variant-numeric: tabular-nums; }
  .util .sq svg { width: 16px; height: 16px; }
  .notify { position: relative; }
  .pip { position: absolute; top: 5px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--frame); }
  .sep { width: 1px; height: 20px; background: var(--stroke); margin: 0 10px 0 8px; }
  .util .me { width: 28px; height: 28px; font-size: 11px; }
  .util img.me { display: block; object-fit: cover; background: var(--avatar-blue); }
  /* no avatar available: nothing is shown in its place, and the name takes up the space */
  .user:not(:has(.me)) { padding-left: 10px; }
  .role { height: 20px; padding: 0 6px; border-radius: 6px; background: var(--accent-wash); color: var(--accent-deep); font-size: 12px; line-height: 20px; font-weight: 560; letter-spacing: .2px; }
  .me { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-blue); color: var(--ink-soft); display: grid; place-items: center; font-size: 12px; font-weight: 560; }

  .head, .toolbar { flex-shrink: 0; }
  .head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  .head { padding: 26px 24px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
  .head[hidden] { display: none; }   /* an author display: would otherwise beat the UA rule for [hidden] */
  h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 420; letter-spacing: 0; }
  .pill { height: 32px; padding: 4px 16px 4px 12px; border-radius: 9999px; background: var(--wash); display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-soft); }

  /* ---------- view tabs ----------
     One row of the page's own views, sitting under the title and above the toolbar — which of the
     same things you are looking at, where the toolbar narrows whichever set you chose.

     The underline is drawn by each tab rather than by one element that slides between them. A slider
     has to be measured, and measuring it is wrong exactly when the measurement is hardest to get: on
     first paint before the webfont lands, and after a resize that rewraps the row. One rule per tab
     costs nothing and is right whenever the browser says it is.

     Scoped to the children of .tabs on purpose. A bare .tab would be the kind of name that means
     something else in the next app to use this sheet, which is how .step became .flow .step. */
  /* Links as well as buttons, because the same row does two jobs in this app. Buttons that switch which
     of the same things you are looking at, inside one page — and, where a product has no rail, links to
     the sections of the product itself. The second kind says where you are with aria-current rather than
     aria-selected: one is a page you are on, the other is a view you have chosen, and a screen reader
     should not be told a link is a selected tab. They look the same because in both cases the row is the
     set of places you can be and the underline is the one you are at. */
  .tabs { display: flex; gap: 2px; padding: 12px 24px 0; box-shadow: inset 0 -1px var(--rule); }
  .tabs > button, .tabs > a {
    position: relative; height: 38px; padding: 0 10px; font-size: 15px; font-weight: 440;
    color: var(--muted); transition: color .14s ease;
    display: inline-flex; align-items: center; white-space: nowrap;
  }
  .tabs > button:hover, .tabs > a:hover { color: var(--ink-soft); }
  /* inset, so the ring sits inside the row rather than crossing the rule the tabs sit on */
  .tabs > button:focus-visible, .tabs > a:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 7px; }
  .tabs > button[aria-selected="true"], .tabs > a[aria-current="page"] { color: var(--ink); font-weight: 520; }
  .tabs > button::after, .tabs > a::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
    border-radius: 2px 2px 0 0; background: var(--accent); opacity: 0;
    transition: opacity .16s ease;
  }
  .tabs > button[aria-selected="true"]::after, .tabs > a[aria-current="page"]::after { opacity: 1; }
  /* A product with no rail keeps its sections in the top bar, beside the control that says which agency
     you are in. The row takes the bar's full height so each tab's underline lands on the bar's own
     bottom edge, which is the panel's top edge — centred at 38px it would float in the middle of the
     bar, marking a line that is not there. No rule of its own either: the panel's top edge is already
     one, and two would read as a box around nothing. */
  /* The left group is centred in the bar and sized to the agency button, so a tab row stretching inside
     it reaches 40px and stops there, leaving its underline floating. The group has to stretch first —
     and only where it actually carries tabs, so every other top bar keeps the height it has. */
  .util .left:has(.tabs) { align-self: stretch; min-width: 0; }
  /* With no rail the bar sits over the panel rather than beside it, so the first thing in it lines up
     with the panel's own gutter — the title and the table's first column start at 24px, and so does the
     agency tile. The button gives back its own 6px of padding so that it is the tile that lands on the
     line rather than the pressable area around it. */
  .norail .util { padding-left: 25px; }   /* 24px of gutter, plus the 1px left border the panel carries */
  /* The rounded corner is where the panel turns away from the rail. With no rail it has nothing to turn
     away from — it meets the window's own edge, and a curve there reads as a card floating in a frame
     that is not there. */
  .norail .panel { border-top-left-radius: 0; }
  /* The mark standing on its own at the head of the bar, which is where a product with no rail has to
     put it. It takes the line the title and the table start on, and the switcher follows a clear gap
     later: the two are a mark and a control, not one lockup. */
  .util-logo { flex: none; display: flex; align-items: center; color: var(--accent); }
  .util-logo .mark { width: 28px; height: auto; aspect-ratio: 105 / 50; }
  /* The switcher used to hold the mark and was pulled back by its own padding to put it on that line.
     The mark leads now, so the pull would only close the gap between the two. */
  /* Seven sections, an agency control and the account menu do not all fit a laptop's width, and what
     they did instead was overrun each other — Integration Jobs printed under the theme toggle. The row
     scrolls rather than collides, and without a bar of its own: a scrollbar inside 56px of chrome is
     more noise than the thing it is scrolling. */
  .util .tabs {
    align-self: stretch; padding: 0; box-shadow: none; min-width: 0;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .util .tabs::-webkit-scrollbar { display: none; }
  /* Taking the scrollbar away takes the only sign that there is more, so the row fades at the edge it
     runs off instead. Set by script on overflow rather than always, because at a width where the tabs
     exactly fit, a standing fade would dim the last of them for no reason. The attribute is
     data-overflow and not data-more, because [data-more] is how a row's kebab marks itself and the
     menu's click handler walks up from whatever was pressed to find one. */
  .util .tabs[data-overflow="true"] {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  }
  .util .tabs > a { height: 100%; }
  @media (prefers-reduced-motion: reduce) {
    .tabs > button, .tabs > a, .tabs > button::after, .tabs > a::after { transition: none; }
  }

  /* The filter row cannot shrink below what its own chips need, so once the two groups can no longer
     share a line the actions drop to their own — which hands the filters the full width and is the only
     move left that hides nothing. The 520px basis is the point where collapsing the pins has already
     been spent and the row would otherwise start spilling over Export. */
  .toolbar { padding: 18px 24px 0; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px 16px; }
  .toolbar-main { flex: 1 1 520px; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 12px 8px; }
  /* below this width even the fixed controls plus "n more" cannot share one line, so let the row wrap instead of overlapping the actions */
  @media (max-width: 1220px) { .toolbar-main { flex-wrap: wrap; } }
  .chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 13px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 8px; font-size: 15px; color: var(--ink); }
  .chip svg { color: var(--ink-soft); }
  .chip .chev { width: 12px; height: 12px; color: var(--muted-2); }
  .sq { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); }
  .sq:hover { background: var(--wash); }
  .sq svg { width: 16px; height: 16px; }

  /* secondary buttons in the title row: neutral pills, so the teal stays on the primary action */
  .pill.neutral { background: var(--wash); color: var(--ink-soft); }
  .pill.neutral:hover { background: var(--stroke); }
  .pill.neutral svg { color: var(--ink-soft); }
  .pill.neutral .chev { color: var(--muted-2); }
  /* the quiet form of a destructive button: red enough to be read as one, not filled, because the pages
     it sits on are pages you came to read rather than to act on */
  .pill.danger { background: var(--danger-wash); color: var(--danger); }
  .pill.danger svg { color: currentColor; }
  .pill.danger:hover { background: var(--danger); color: var(--danger-btn-ink); }
  .pill.trail { padding: 4px 12px 4px 16px; gap: 6px; }

  /* filter chips: an icon-only variant for advanced search */
  .chip.icon { width: 32px; padding: 0; justify-content: center; }
  .chip.icon > svg { --sz: 16; width: 16px; height: 16px; }

  /* Splits the row: searching on the left, narrowing on the right. Sized here rather than left to the
     span's own dimensions, which are nothing — an empty inline element has no box to draw. */
  /* the extra air is on the rule itself rather than on a neighbour, so it stays centred between them
     however the row is rearranged */
  .vsep { flex-shrink: 0; width: 1px; height: 20px; margin: 0 4px; background: var(--stroke); }

  /* Saved views: a plain menu hung off its chip. It sits beside Filters, so the two ways of narrowing the
     list — recall one, or build one — are next to each other, with the tags that result trailing after. */
  .views { position: relative; }
  .views-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 208px;
    padding: 4px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--pop-bg);
    box-shadow: var(--lift); display: grid; gap: 1px;
  }
  /* `display: grid` above is an author rule, and author rules beat the UA stylesheet's [hidden] at the
     same specificity — so without this the hidden attribute toggles and the menu never goes away. */
  .views-menu[hidden] { display: none; }
  /* The row is the hover target, not the label, because a row can now hold tools beside its name and the
     highlight has to cover the whole of it. */
  .views-menu .view { display: flex; align-items: center; gap: 2px; border-radius: 7px; transition: background-color .12s ease; }
  .views-menu .view:hover { background: var(--wash); }
  .views-menu button[role="menuitem"] {
    flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 7px; text-align: left;
    font-size: 14px; line-height: 32px; color: var(--ink-soft); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; transition: color .12s ease;
  }
  .views-menu .view:hover button[role="menuitem"] { color: var(--ink); }
  /* Only a view you saved carries these. The seeded ones are not yours to rename or throw away. */
  .view-tools { display: flex; gap: 2px; flex-shrink: 0; padding-right: 4px; }
  .view-act { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--muted-2); transition: background-color .12s ease, color .12s ease; }
  .view-act:hover { background: var(--stroke); color: var(--ink); }
  .view-act svg { --sz: 14; width: 14px; height: 14px; }
  .view-act[data-act="del"] { color: var(--danger); }
  .view-act[data-act="del"]:hover { background: var(--danger-wash); color: var(--danger); }
  .view-act:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  /* mid-rename the field takes the whole row, so the tools get out of its way */
  .views-menu .view:has(input:not([hidden])) .view-tools { display: none; }
  /* A freshly saved view lands in a field rather than as finished text: "New view" is a placeholder more
     than a name, so the rename is already open with it selected, ready to be typed over. The field
     matches the button's metrics exactly so swapping between them moves nothing. */
  .views-menu input {
    display: block; box-sizing: border-box; flex: 1; min-width: 0; height: 32px; padding: 0 9px;
    border: 1px solid var(--accent); border-radius: 7px; background: var(--page);
    font: inherit; font-size: 14px; color: var(--ink); outline: none;
    box-shadow: 0 0 0 3px var(--accent-wash);
  }
  /* both of these are author rules, so they beat the UA stylesheet's [hidden] and have to say it again */
  .views-menu input[hidden], .views-menu button[hidden] { display: none; }
  /* the longest label is the first thing to go when the row runs out of room */
  .toolbar-main.tight #viewsBtn .pl { display: none; }

  /* applied (temporary) filters sit inline after the Filters chip: same height and corners, but in a soft teal tint */
  .applied { display: contents; }
  .applied[hidden] { display: none; }
  .tag { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 5px 0 12px; background: var(--accent-wash); border: 1px solid transparent; border-radius: 8px; font-size: 15px; line-height: 20px; color: var(--accent-deep); white-space: nowrap; }
  .tag[hidden] { display: none; }
  .toolbar-main > *:not(.search-field), .toolbar-main .applied > * { flex-shrink: 0; }
  .more-tag { height: 32px; padding: 0 12px; border-radius: 9999px; background: transparent; color: var(--accent-deep); font-size: 14px; line-height: 20px; font-weight: 520; white-space: nowrap; }
  .more-tag[hidden] { display: none; }
  .more-tag:hover { background: var(--wash); }
  .tag button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--accent); }
  .tag button:hover { background: var(--wash-hover); color: var(--accent-deep); }
  .tag button:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .link-btn.reset { margin-left: 0; }
  .reset[hidden] { display: none; }

  /* on/off setting: a switch (it applies immediately) as a ghost pill, like the old Export button: no outline, a soft wash on hover */
  .toggle { height: 32px; display: inline-flex; align-items: center; gap: 10px; padding: 0 16px 0 12px; background: transparent; border: 0; border-radius: 9999px; font-size: 14px; line-height: 20px; color: var(--muted); white-space: nowrap; }
  .toggle b { font-weight: 520; color: var(--ink); }
  .sp-switch .toggle[aria-checked="false"] .lbl { color: var(--muted-2); }
  .sp-switch .toggle[aria-checked="false"] b { color: var(--muted); }
  .toggle:hover { background: var(--wash); }
  .toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .track { position: relative; width: 30px; height: 18px; flex-shrink: 0; border-radius: 9999px; background: var(--field); transition: background .16s ease; }
  .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .16s ease; }
  .toggle[aria-checked="true"] .track { background: var(--accent); }
  .toggle[aria-checked="true"] .knob { transform: translateX(12px); }
  @media (prefers-reduced-motion: reduce) { .train-body, .train-line, .train-sole, .train-heel, .track, .knob, .person .ext, .pop, .pop-in, td.disc .dis > *, .tbl, .util .glass::before, .search-field, .rail-menu, .rail-menu-panel, .rail-glide,
    .team-shift, .team-more, .route-shift, .route-line, .route-a, .route-b, .doc-line,
    .cap-lift, .cap-head, .tile, .chart-shift, .chart-axis, .bar,
    .rail a svg.gear, .ask-stem, .ask-dot,
    .f-scrim, .fpanel, .f-opt .bx, .f-opt .bx svg, .f-twist svg, .f-thumb, .f-mode button, .f-pane-hd .link-btn,
    .search-field, .f-search, .f-field input[type="month"], .f-field input[type="date"], .f-num { transition: none; } }

  /* search field: same height, radius and stroke as the filter chips */
  /* One plain width, open and staying open. It used to hug its placeholder until you reached for it and
     widen on focus, which saved 76px of a toolbar and spent them on a field that moved under the pointer
     on the way to it — and on every list here, searching is the first thing done, so the field that does
     it should be the size it will be used at. Fixed rather than shrinkable, so a crowded toolbar wraps
     around it rather than squeezing it to nothing. */
  .search-field { height: 32px; flex: 0 0 auto; width: 180px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; background: var(--surface); border: 1px solid var(--field); border-radius: 8px; color: var(--ink); cursor: text; }
  .search-field:hover { border-color: var(--accent-line); }

  .search-field > svg { color: var(--ink); }
  .search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0; font: inherit; font-size: 15px; line-height: 24px; color: var(--ink); }
  .search-field input::placeholder { color: var(--muted-2); opacity: 1; }
  .search-field input::-webkit-search-cancel-button { display: none; }
  .search-field .clear { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--muted-2); flex-shrink: 0; }
  .search-field .clear:hover { background: var(--wash); color: var(--ink); }
  .search-field .clear[hidden] { display: none; }
  .search-field .clear svg { width: 10px; height: 10px; }

  /* status pill and cell text */
  .st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border: 1px solid var(--stroke); border-radius: 9999px; font-size: 13px; line-height: 20px; color: var(--ink-soft); }
  .st i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  tbody td.sub { font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }

  /* frozen columns: checkbox + name stay put, a stroke on the name's right edge marks the split */
  thead th.ck, thead th.fz, thead th.fz-end { position: sticky; z-index: 3; }
  tbody td.ck, tbody td.fz, tbody td.fz-end { position: sticky; z-index: 1; background: var(--page); }
  .ck { left: 0; }
  .fz { left: 42px; border-right: 1px solid var(--stroke); }
  /* The row's actions, held against the right edge so they are reachable without scrolling to the
     end of a wide table. Its stroke is on the left, the side the columns arrive from, for the same
     reason .fz carries one on its right. */
  .fz-end { right: 0; border-left: 1px solid var(--stroke); }
  /* its own padding rather than borrowing .ck’s: .unpinned un-sticks .ck, so an actions cell wearing
     that class to centre its button lost its own pinning along with the left columns. */
  thead th.fz-end, tbody td.fz-end { padding: 0; text-align: center; }
  tbody td.fz-end .sq { margin-inline: auto; }
  /* A table narrow enough to read in one piece says so and scrolls as one. Note that .fz pins to a
     42px offset, which is the checkbox column and assumes .fz is the cell straight after it — a table
     with anything in between has to either set its own offset or not freeze at all. */
  .tbl.unpinned thead th.ck, .tbl.unpinned tbody td.ck,
  .tbl.unpinned thead th.fz, .tbl.unpinned tbody td.fz { position: static; }
  .tbl.unpinned .fz { border-right: 0; }
  /* .fz-end is deliberately absent here: a table can be too narrow to need its name column pinned and
     still want its actions where the thumb expects them. */
  /* The run the search matched, marked where it sits. A row that matched on its phone number cannot
     say so through its name, and a count at the top of the page says how many matched but never
     which part of them did. The wash is the same one every other faint accent surface uses, and the
     text keeps its own colour, so nothing about the row's contrast changes. */
  .tbl mark { background: var(--accent-wash); color: inherit; border-radius: 3px; padding: 0 1px; margin: 0 -1px; }
  /* A chip is already a small bordered box, so a tint laid inside one reads as a slightly different
     chip rather than as a highlight, and at the wash's strength it barely reads at all. Marks in a
     chip get their own, heavier value — still a tint under the chip's own text colour, not a
     reversal of it. */
  .dis mark { background: var(--mark-strong); }
  /* The line that says the rows below it matched less well. It is a row rather than a thing drawn
     over the table, so it travels with the rows, pages with them and sorts where they put it. The
     label is stuck to the left edge: a table scrolled sideways would otherwise carry a band with
     nothing written on it. */
  tbody tr.split td { padding: 0; border-top: 1px solid var(--rule); background: var(--wash); overflow: visible; }
  tbody tr.split:hover td { background: var(--wash); }
  /* Two things the label needs before sticky does anything at all. The cell has to let its content
     overflow, or the cell is itself the scroll container the label sticks to and it never moves; and
     the label has to be narrower than the cell, because sticky is clamped to the containing block and
     a full-width box has no room left to slide. */
  tbody tr.split span {
    position: sticky; left: 0; display: inline-block; width: max-content; padding: 6px 16px;
    font-size: 11px; line-height: 14px; font-weight: 560; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted-2);
  }
  tbody tr.empty:hover td { background: transparent; }
  /* nothing in it any more: it only holds the scroll area open behind the overlay */
  tbody tr.empty td { height: 380px; padding: 0; border-top: 0; }
  /* The empty state is laid over the scroll area rather than inside it. Placed in the cell it would have to
     be pushed back by however far the table had been scrolled, and that correction is written by a scroll
     handler — always a frame behind the scroll itself, which reads as jitter. Sitting on .tbl, which does
     not scroll, there is nothing to correct. */
  .empty-state {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    /* Held near the top rather than centred, so it does not drift further down as the table area grows.
       The offset is roughly a row's worth: level with the header the text read as a column heading of
       its own, and centred in a tall table it ends up stranded in the middle of nothing. */
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 52px;
  }
  .empty-state[hidden] { display: none; }
  .empty-state .link-btn { pointer-events: auto; }
  .empty-say, .empty-note { position: relative; z-index: 1; margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
  .empty-say { color: var(--ink-soft); font-size: 17px; line-height: 24px; font-weight: 520; }
  .empty-note { margin-top: 10px; }
  tbody tr.empty b { color: var(--ink); font-weight: 520; }
  /* text button (Reset, Clear search, + n more): teal label, ghost wash on hover */
  .link-btn { display: inline-flex; align-items: center; box-sizing: border-box; height: 32px; padding: 0 12px; margin-left: 8px; border-radius: 9999px; font-size: 14px; line-height: 20px; font-weight: 520; color: var(--accent-deep); white-space: nowrap; }
  .link-btn:hover { background: var(--wash); }

  /* table: full-bleed, fixed column widths measured from the live page */
  table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
  thead th { height: 40px; padding: 8px 16px; text-align: left; font-size: 13px; line-height: 20px; font-weight: 480; letter-spacing: .1px; color: var(--muted-2); white-space: nowrap; background: var(--page); }
  thead th.r { text-align: right; }
  thead th.ck, tbody td.ck { padding: 0 0 0 12px; }
  thead th .arr { display: inline-block; margin-left: 4px; vertical-align: -1px; transition: transform .18s ease; }
  /* The column advertised sorting with an arrow and did nothing: the cell was not focusable, carried no
     aria-sort, and had no handler. It is a button now, and the arrow turns over to show the direction
     rather than being swapped for a second icon. */
  /* the negative margin lets the fill sit round the label without moving the label: the cell's own padding
     already spaces the columns, so the button borrows a little of it back rather than adding its own */
  thead th .sort { display: inline-flex; align-items: center; gap: 2px; height: 26px; margin: 0 -7px; padding: 0 7px;
                   border-radius: 7px; font: inherit; color: inherit; letter-spacing: inherit;
                   transition: background-color .14s ease, color .14s ease; }
  thead th .sort:hover { background: var(--wash); color: var(--ink-soft); }
  thead th .sort:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
  /* the arrow belongs to whichever column is sorted, so the others hold its width without drawing it */
  thead th .arr { opacity: 0; transition: transform .18s ease, opacity .14s ease; }
  thead th[aria-sort] .arr { opacity: 1; }
  thead th:not([aria-sort]) .sort:hover .arr { opacity: .45; }
  thead th[aria-sort="descending"] .arr { transform: rotate(180deg); }
  tbody tr { height: 51px; }
  tbody td { height: 51px; padding: 1px 16px 0; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  tbody tr:hover td { background: var(--surface); }
  /* The rows that answered the search exactly, marked at the edge rather than across the row. A fill
     large enough to see competes with the one selection draws, and this sits in the checkbox gutter,
     which nothing else paints in. It rides the frozen cell, so it stays at the table's edge when the
     body is scrolled sideways, and that cell gives the 3px back in padding so every checkbox on the
     page still stands in one column. */
  tbody tr.exact td.ck { border-left: 3px solid var(--accent); padding-left: 9px; }
  /* ---------- nesting table ---------- */
  /* A list whose rows own each other. The step is cell padding rather than a margin on what is inside,
     so the frozen column still paints edge to edge behind it and a nested row's selected wash does not
     come away from the table's left edge. Opt-in on the table, because every other list here is flat
     and a --depth nobody sets would otherwise be a rule every one of them carries for nothing. */
  .tbl.tree tbody td.fz { padding-left: calc(16px + var(--depth, 0) * 22px); display: flex; align-items: center; gap: 2px; }
  /* Making the cell a flex row made the link a flex item, and a flex item will not shrink below its
     content unless it is told it may. Without this the name never gets squeezed, so its own ellipsis
     never fires and a long name is cut off mid-word by the cell's overflow instead. */
  .tbl.tree tbody td.fz .person { min-width: 0; }
  /* The twist sits above the link's hit overlay, which covers the whole frozen cell — without the lift
     it would be the one part of the row you cannot press, because the overlay is painted over it. */
  .tbl.tree .twist {
    position: relative; z-index: 1; flex: none; width: 20px; height: 20px; margin-left: -4px;
    border-radius: 6px; display: grid; place-items: center; color: var(--muted-2);
  }
  .tbl.tree .twist:hover { background: var(--wash); color: var(--ink); }
  .tbl.tree .twist:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .tbl.tree .twist svg { --sz: 12; width: 12px; height: 12px; transform: rotate(-90deg); transition: transform .16s ease; }
  .tbl.tree .twist[aria-expanded="true"] svg { transform: none; }
  /* a row with nothing under it still spends the width, so names at one depth start on one line */
  .tbl.tree .twist-gap { flex: none; width: 16px; }
  @media (prefers-reduced-motion: reduce) { .tbl.tree .twist svg { transition: none; } }
  /* the last row is closed off with a stroke; when the list scrolls to the end it overlaps the pager's top stroke, so it never doubles up */
  tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
  tbody tr.empty:last-child td { border-bottom: 0; }
  tbody tr:first-child td { border-top: 0; }
  td.r { text-align: right; }
  .person span, .av { line-height: 24px; }
  .mid { font-size: 14px; line-height: 20px; color: var(--ink-soft); }
  .st.hold i { background: var(--warning); }
  .st.terminated { color: var(--error); border-color: var(--error-border); }
  .st.terminated i { background: var(--error); }
  .prog { display: flex; align-items: center; gap: 10px; }
  .prog .bar { flex: 0 0 96px; height: 6px; border-radius: 9999px; background: var(--wash); overflow: hidden; }
  .prog .bar i { display: block; height: 100%; border-radius: 9999px; background: var(--accent); }
  .prog b { min-width: 34px; font-size: 14px; line-height: 20px; font-weight: 440; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .hrs { font-size: 14px; line-height: 20px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .yn { font-size: 14px; line-height: 20px; color: var(--ink-soft); }
  .dis { display: flex; align-items: center; gap: 6px; }
  .dis em { height: 22px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center; background: var(--wash); font-style: normal; font-size: 12px; line-height: 18px; letter-spacing: .2px; font-weight: 520; color: var(--muted); }
  .dis span { height: 22px; padding: 0 8px; border: 1px solid var(--stroke); border-radius: 6px; display: inline-flex; align-items: center; font-size: 12px; line-height: 18px; letter-spacing: .2px; color: var(--ink-soft); }

  /* Hovering the column unfolds every row's hidden disciplines at once, the column having widened to fit
     them (see --disc-w above). Spacing is margin-right rather than column-gap, because a flex gap still
     applies either side of a zero-width item, which would drift the resting +n by 6px per hidden chip.
     Order matters in both directions: going in, the column widens before the chips grow into it; coming
     out, the chips fold away before the column narrows. Animating both at once leaves a frame where the
     content is wider than the column is. nowrap makes that unrepresentable rather than merely unlikely. */
  td.disc .dis { flex-wrap: nowrap; column-gap: 0; }
  td.disc .dis > * { flex-shrink: 0; margin-right: 6px; transition: max-width .14s ease, opacity .12s ease, padding .14s ease, margin .14s ease, border-width .14s ease; }
  .tbl.can-expand:has(.disc:hover) td.disc .dis > * { transition-delay: .12s; }
  /* The +n is switched, not faded: its label cannot survive being narrowed, since collapsing the width
     clips "+2" down through "+" in full view. So it cuts straight out on the way in, and cuts straight
     back only once its width has returned. Only the width animates, which is what lets the chips slide
     smoothly into the space it gives up. */
  td.disc .dis em {
    transition-property: max-width, padding, margin, opacity;
    transition-timing-function: ease;
    transition-duration: .14s, .14s, .14s, 0s;   /* opacity never interpolates: it is switched */
    transition-delay: 0s, 0s, 0s, .14s;          /* ...and switches back on only once the width has returned */
  }
  .tbl.can-expand:has(.disc:hover) td.disc .dis em {
    transition-duration: .14s, .14s, .14s, 0s;
    transition-delay: .12s, .12s, .12s, 0s;      /* going in it cuts out at once, before anything narrows */
  }
  td.disc .dis > *:last-child { margin-right: 0; }
  td.disc .dis .xtra, .tbl.can-expand:has(.disc:hover) td.disc .dis em { max-width: 0; margin-right: 0; padding-left: 0; padding-right: 0; border-left-width: 0; border-right-width: 0; opacity: 0; overflow: hidden; }
  .tbl.can-expand:has(.disc:hover) td.disc .dis .xtra { max-width: var(--w, 4rem); margin-right: 6px; padding-left: 8px; padding-right: 8px; border-left-width: 1px; border-right-width: 1px; opacity: 1; }

  /* A real checkbox, drawn with appearance:none rather than faked with a div — so it is focusable, has a
     checked state the browser owns, announces itself, and can be driven by its label. The padded label is
     the hit area: an 18px square is a poor target in a 44px row. */
  .ck label { display: grid; place-items: center; width: 100%; padding: 4px; cursor: pointer; }
  .box {
    appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0;
    width: 18px; height: 18px; border: 1px solid var(--stroke-strong); border-radius: 4px; background: var(--surface);
    display: grid; place-items: center; cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .box::after {
    content: ""; width: 10px; height: 10px; background: #fff; opacity: 0;
    transition: opacity .12s ease;
    -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat;
  }
  :root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
           --dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); }
  .box:checked, .box:indeterminate { background: var(--accent); border-color: var(--accent); }
  .box:checked::after, .box:indeterminate::after { opacity: 1; }
  /* the header box says "some of these", not "all of them", whenever the page is part-selected */
  .box:indeterminate::after { -webkit-mask-image: var(--dash); mask-image: var(--dash); }
  .box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* A selected row is washed by a single gradient across the whole row, not one per cell: the gradient
     lives on the tr and the cells go transparent so it reads as one band. The two frozen cells cannot
     go transparent — they would let the scrolled columns show through — so they carry a flat wash at
     the value the gradient holds over their 284px, where it has barely left its 3% edge. */
  tbody tr:has(.box:checked) td { background: transparent; }
  /* The two hairlines are gradients too, so they cannot be borders — a border takes one colour. They are
     1px background layers on the row instead, and the cell borders that would sit in the same place are
     turned transparent so nothing doubles up. A row's bottom rule is really the next row's border-top,
     so the row below a selection draws the line rather than the selection drawing it downward: that keeps
     it in the same 1px it has always occupied. Only the last row, which has no row below, draws its own. */
  tbody tr:has(.box:checked), tbody tr:has(.box:checked) + tr { --rt: var(--row-rule); }
  /* the first row has never had a rule above it, and selecting it should not invent one */
  tbody tr:has(.box:checked):first-child { --rt: none; }
  tbody tr:has(.box:checked):last-child { --rb: var(--row-rule); }
  /* repeat-x rather than no-repeat: the tile is exactly the visible window, so the seams always fall
     offscreen, and a scroll frame that lands before script has updated --sl shows neighbouring gradient
     instead of a bare gap. The wash tiles invisibly either way, since both its ends are the same 3%. */
  tbody tr:has(.box:checked) {
    background-image: var(--rt, none), var(--rb, none), var(--row-sel);
    background-repeat: repeat-x;
    background-size: var(--cw) 1px, var(--cw) 1px, var(--cw) 100%;
    background-position: var(--sl) top, var(--sl) bottom, var(--sl) 0;
  }
  tbody tr:has(.box:checked) + tr:not(:has(.box:checked)) {
    background-image: var(--rt);
    background-repeat: repeat-x; background-size: var(--cw) 1px; background-position: var(--sl) top;
  }
  tbody tr:has(.box:checked) td, tbody tr:has(.box:checked) + tr td { border-top-color: transparent; }
  /* that transparent border is where the hairline shows through, so a cell background must stop short of
     it — otherwise hovering the row below a selection paints over the line. The frozen cells are excluded:
     their background is the opaque backing their translucent border is read against. */
  tbody tr:has(.box:checked) td:not(.ck):not(.fz):not(.fz-end),
  tbody tr:has(.box:checked) + tr td:not(.ck):not(.fz):not(.fz-end) { background-clip: padding-box; }
  /* the frozen cells are opaque, so the row gradient behind them never shows; they carry their own slice
     of it instead. The stroke stays a flat border, at the value it holds over their 284px of the window. */
  tbody tr:has(.box:checked) td.ck, tbody tr:has(.box:checked) td.fz, tbody tr:has(.box:checked) td.fz-end {
    background-color: var(--page);
    background-image: var(--row-sel);
    background-repeat: no-repeat; background-size: var(--cw) 100%;
  }
  /* both are pinned to the left of the window, so their slice of it is known: x 0 and x 42 */
  tbody tr:has(.box:checked) td.ck { background-position-x: 0; }
  tbody tr:has(.box:checked) td.fz { background-position-x: -42px; }
  /* pinned to the other end, so its slice is the last --fz-end-w of the window rather than the first */
  tbody tr:has(.box:checked) td.fz-end { background-position-x: calc(var(--fz-end-w, 56px) - var(--cw)); }
  tbody tr:has(.box:checked) td.ck, tbody tr:has(.box:checked) td.fz, tbody tr:has(.box:checked) td.fz-end,
  tbody tr:has(.box:checked) + tr td.ck, tbody tr:has(.box:checked) + tr td.fz, tbody tr:has(.box:checked) + tr td.fz-end { border-top-color: var(--row-rule-edge); }
  tbody tr:has(.box:checked):last-child td.ck, tbody tr:has(.box:checked):last-child td.fz,
  tbody tr:has(.box:checked):last-child td.fz-end { border-bottom-color: var(--row-rule-edge); }

  .person { display: flex; align-items: center; gap: 12px; }
  /* the name is the row's handle: same emphasis as the agency name in the top bar */
  .person .nm { font-weight: 520; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* the link's hit area is the whole cell, not just the text: td.fz is sticky, so it is already the
     containing block this stretches to. Hovering any part of the cell is therefore hovering the link. */
  /* The hit target is the whole cell, not just the text, so a tired click lands. It is absolute with
     inset: 0, which means it needs the cell to be a positioned ancestor — on a frozen column that comes
     free, because sticky is positioned. Unfrozen it does not, and the overlay then resolves to .tbl-main
     and covers the entire table: every row stacks one over the rest and the last one swallows every
     hover in the body. So the cell says it is positioned here rather than relying on being frozen.
     Frozen cells are excluded by the selector rather than by specificity: :has(.person) contributes a
     class, which ties this with the sticky rule at (0,1,2), and source order then handed it to whichever
     came second — this one, which unfroze the employees table. A :not() pair cannot tie because it
     cannot match those cells at all. */
  tbody td:has(.person):not(.ck):not(.fz) { position: relative; }
  /* And it is the cell's overlay, so it is only drawn inside one. Unscoped, a .person standing anywhere
     else — a settings value, a gallery exhibit — had nothing positioned above it to resolve against, so
     the overlay took the initial containing block and covered the whole viewport: every hit test on the
     page answered with that one chip, and a scroll gesture over the page found an element that does not
     scroll with the pane it sits in, so the pane did not move. */
  tbody td .person::after { content: ""; position: absolute; inset: 0; }
  /* Drawn as a background rather than text-decoration, because a browser does not decorate the ellipsis
     it generates: a truncated name would otherwise underline only as far as its last real glyph. 19px is
     where text-underline-offset: 2px lands for Figtree at 15px in this 24px line box. */
  .person:hover .nm, .person:focus-visible .nm { background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1px; background-position: 0 19px; background-repeat: no-repeat; }
  /* the external-link mark keeps its space at rest, so revealing it on hover never shifts the name */
  .person .ext { flex-shrink: 0; margin-left: -6px; color: var(--muted-2); opacity: 0; transition: opacity .12s ease; }
  .person:hover .ext, .person:focus-visible .ext { opacity: 1; }
  .av { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 10px; font-weight: 560; color: var(--avatar-text); }
  .av.blue { background: var(--avatar-blue); } .av.teal { background: var(--avatar-teal); } .av.violet { background: var(--avatar-violet); }
  /* An organization is not a person, so it gets no disc at all: the disc is the thing that says
     "someone", and the three hues inside it are for telling people apart — lending one to a company
     would say the company is another of them. A mark standing on its own reads as a kind instead.
     The gap closes with it, because 12px is measured from a 28px disc and a bare mark needs less room
     to sit apart from the name it leads. */
  .person.org { gap: 9px; }
  .person.org .org-ico { --sz: 18; width: 18px; height: 18px; flex-shrink: 0; color: var(--muted-2); }

  /* hover card for a row, opening beside the name cell. Flat like everything else here: a stroke and the
     page colour, no drop shadow, since nothing in this design casts one. It is fixed-position so the
     table's own overflow never clips it, and pointer-transparent so it cannot steal the hover it depends on. */
  /* Two layers on purpose: .pop only ever carries position, .pop-in only ever carries the entrance.
     That lets the card glide between rows while the fade stays independent of where it is going. */
  .pop { position: fixed; top: 0; left: 0; z-index: 20; width: 320px; pointer-events: none; transform: translate3d(0, 0, 0); transition: transform .18s ease-out; }
  .pop.on { pointer-events: auto; }
  .pop-in { padding: 14px 16px 16px; background: var(--pop-bg); border: 1px solid var(--stroke-strong); border-radius: 12px; box-shadow: var(--lift); opacity: 0; transform: translateY(3px); transition: opacity .13s ease, transform .13s ease; }
  .pop.on .pop-in { opacity: 1; transform: none; }

  /* ---- progress card ----
     The overall figure leads, then what it is made of. A learning path is shown as one entry with its own
     roll-up and its programs beneath it on a rule, so the grouping is read off the indent rather than
     spelled out; loose programs follow. */
  .pg-pop { width: 368px; }
  /* a tail on the edge facing the cell, level with the cell's middle, so it is plain which bar the card is
     about. Drawn after .pop-in, it paints over the card's border where they meet, which is what joins them.
     It rides on .pop, so it fades with the card by hand and glides with it between rows. */
  .pg-pop::after {
    content: ""; position: absolute; right: -6px; top: var(--tail-y, 50%); width: 12px; height: 12px; margin-top: -6px;
    box-sizing: border-box; background: var(--pop-bg);
    border: 1px solid var(--stroke-strong); border-left-color: transparent; border-bottom-color: transparent;
    border-radius: 0 3px 0 0; transform: rotate(45deg);
    opacity: 0; transition: opacity .13s ease, top .18s ease-out;
  }
  .pg-pop.flip::after { right: auto; left: -6px; transform: rotate(-135deg); }
  .pg-pop.on::after { opacity: 1; }
  .pg-pop.snap::after { transition: none; }
  /* A long plan would otherwise run off the screen; place() already clamps the card to the viewport, but
     only after the card has decided how tall it wants to be. Capping it here means offsetHeight is the
     capped height, so the placement maths still holds. overscroll-behavior stops a scroll that reaches the
     end of the list from carrying on into the table beneath — which would scroll the card out of existence. */
  .pg-pop .pop-in {
    padding: 20px 22px; max-height: min(66vh, 540px); overflow-y: auto;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  .pg-pop .bar { display: block; height: 4px; border-radius: 9999px; background: var(--wash); overflow: hidden; }
  .pg-pop .bar i { display: block; height: 100%; border-radius: 9999px; background: var(--accent); }

  .pg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
  .pg-list > li + li { padding-top: 22px; border-top: 1px solid var(--rule); }
  /* the mode and the status share a line above the title, which leaves the title the full width to run in */
  .pg-line { display: flex; align-items: center; gap: 8px; }
  /* the name leads and the status sits at its right edge, so the eye reads what, then how it stands */
  .pg-head { display: flex; align-items: flex-start; gap: 12px; }
  .pg-head .pg-name { flex: 1; min-width: 0; }
  .pg-head .pg-st { margin-top: -1px; }
  /* a program's name is the thing you are looking for, so it wraps rather than being cut off */
  .pg-name { display: block; font-size: 14px; line-height: 20px; font-weight: 520; color: var(--ink); overflow-wrap: anywhere; }
  /* mode and due date are context, not headings: one quiet line in sentence case */
  .pg-meta { margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  .pg-meta span + span::before { content: "·"; margin: 0 6px; }
  .pg-meta .late { color: var(--error); }
  .pg-meter { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
  .pg-meter .bar { flex: 1; }
  .pg-meter b { flex-shrink: 0; width: 32px; text-align: right; font-size: 12px; line-height: 16px; font-weight: 520; color: var(--muted); font-variant-numeric: tabular-nums; }

  /* one chip, five readings — the colour carries the state and the text names it */
  .pg-st { flex-shrink: 0; height: 20px; padding: 0 8px; border-radius: 9999px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 20px; font-weight: 560; white-space: nowrap; }
  .pg-st svg { --sz: 11; width: 11px; height: 11px; }
  .pg-st.ok { background: var(--accent-wash); color: var(--accent-deep); }
  .pg-st.run { background: var(--wash); color: var(--ink-soft); }
  .pg-st.new { background: var(--wash); color: var(--muted); }
  .pg-st.exp { background: var(--error-wash, rgba(176, 23, 95, .1)); color: var(--error); }
  .pg-st.lock { background: var(--wash); color: var(--muted); }

  /* A drill-down, drawn the way a tree is: the path sits at the top with a marker, and its programs hang
     off a guide line beneath it, each on its own elbow. The last child's line stops at its elbow, which is
     what makes the branch look finished rather than cut off. The marker is static — nothing collapses —
     so it is muted and takes no hover, or it would read as a control. */
  /* The path's own figure sits on its line rather than under it, which puts the children directly beneath
     the icon — that is what makes the drop from the icon to the first branch a known distance. */
  .pg-node { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
  .pg-node .pg-name { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 560; }
  .pg-node .pg-pct { flex-shrink: 0; font-size: 13px; line-height: 16px; font-weight: 560; color: var(--ink); font-variant-numeric: tabular-nums; }
  .pg-route { --sz: 16; width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); }

  /* A learning path is an ordered thing, so its programs are numbered rather than bracketed. The steps
     carry the nesting themselves — a numbered badge belongs to whatever numbered it — which replaces the
     trunk, the connectors and the brackets with one hairline threaded through the badges.
     The column is aligned on the route icon's centre: badges are 16px at a 28px indent, so their centre
     lands at x = 8 against the icon's 7.5. */
  .pg-path .pg-kids {
    position: relative; counter-reset: step; list-style: none;
    margin: 18px 0 0; padding: 0 0 0 30px; display: grid; gap: 22px;
  }
  /* the drop from the icon into the first step: the list's own 18px gap plus the 10px from the node's
     top to the icon's centre, less the half the icon covers */
  .pg-path .pg-kids::before {
    content: ""; position: absolute; left: 7.5px; top: -20px; width: 1px; height: 21px; background: var(--stroke);
  }
  .pg-path .pg-kids > li { position: relative; counter-increment: step; }
  .pg-path .pg-kids > li::before {
    content: counter(step); position: absolute; left: -31px; top: 1px; width: 18px; height: 18px; box-sizing: border-box;
    border-radius: 50%; border: 1px solid var(--stroke); background: var(--pop-bg, var(--surface)); color: var(--muted);
    font-size: 10px; line-height: 16px; font-weight: 560; text-align: center; font-variant-numeric: tabular-nums;
  }
  /* threaded from one step to the next, and stopping at the last */
  .pg-path .pg-kids > li:not(:last-child)::after {
    content: ""; position: absolute; left: -22.5px; top: 19px; bottom: -23px; width: 1px; background: var(--stroke);
  }
  .pg-path .pg-kids .pg-name { font-weight: 480; color: var(--ink-soft); }
  .pg-tag { flex-shrink: 0; font-size: 11px; line-height: 16px; font-weight: 560; letter-spacing: .6px; text-transform: uppercase; color: var(--muted-2); }
  /* identity line: who, then the one status everything else is read in light of */
  .pop-hd { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
  .pop-hd .av { width: 32px; height: 32px; font-size: 11px; }
  .pop-hd .who { flex: 1; min-width: 0; }
  /* the card has room to spend, so a long name wraps here instead of truncating as it does in the row */
  .pop-hd b { display: block; font-size: 15px; line-height: 20px; font-weight: 520; color: var(--ink); overflow-wrap: anywhere; }
  .pop-hd .id { display: block; font-size: 13px; line-height: 18px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  .pop-hd .st { flex-shrink: 0; }
  /* Each field is a label sitting directly above its value — the same header-over-data pairing the table
     uses, so a value is read in one stop instead of tracking across a gap to a right-aligned column. */
  .pop dl { margin: 0; padding-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .pop dl > div { min-width: 0; }
  .pop dt { font-size: 13px; line-height: 18px; font-weight: 480; letter-spacing: .1px; color: var(--muted-2); }
  .pop dd { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* chips get the full width and their own band, so they never squeeze into half a column */
  .pop .disc-row { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 14px; }
  .pop .disc-row dd { white-space: normal; overflow: visible; margin-top: 6px; }
  .pop .disc-row .dis { flex-wrap: wrap; gap: 4px 6px; }
  /* the card's one action, set off from the data it acts on */
  .pop-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
  .pop-foot .pill { width: 100%; justify-content: center; }


  /* ---------- filters panel -----------------------------------------------------------------------
     Sixteen filter groups will not fit in a single scrolling column without turning every visit into a
     hunt, so the panel splits: the groups live in a rail on the left and only the chosen one is drawn
     on the right. The rail doubles as the summary — each group carries a count of what is set on it —
     which is the thing a long scrolling list cannot do, because you have to reach a group to see
     whether it is doing anything. Same floating surface as the row hover card and the rail flyout.
     Edits are a draft until Apply, so an exploratory click costs nothing.
     ------------------------------------------------------------------------------------------------ */
  .f-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(26, 35, 42, .18); opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility 0s linear .16s; }
  .f-scrim.on { opacity: 1; visibility: visible; transition: opacity .16s ease, visibility 0s; }
  :root[data-mode="dark"] .f-scrim { background: rgba(0, 0, 0, .45); }

  .fpanel {
    display: flex; flex-direction: column; overflow: hidden; background: var(--pop-bg);
    position: fixed; z-index: 41; left: 0; top: 0;
    width: 772px; max-width: calc(100vw - 24px);
    height: 740px; max-height: calc(100vh - 80px);
    border: 1px solid var(--stroke-strong); border-radius: 14px; box-shadow: var(--lift);
    transform-origin: center; opacity: 0; visibility: hidden; transform: scale(.97);
    transition: opacity .12s ease, transform .16s ease, visibility 0s linear .16s;
  }
  .fpanel.on { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .25, 1), visibility 0s; }

  /* The same dialog treatment as the filters panel, but centred by the box model rather than by script:
     it has one fixed size, so there is nothing to measure. */
  .ne-panel {
    position: fixed; z-index: 41; left: 50%; top: 50%; width: 468px; max-width: calc(100vw - 24px);
    display: flex; flex-direction: column; overflow: hidden; background: var(--pop-bg);
    border: 1px solid var(--stroke-strong); border-radius: 14px; box-shadow: var(--lift);
    opacity: 0; visibility: hidden; transform: translate(-50%, -50%) scale(.97); transform-origin: center;
    transition: opacity .12s ease, transform .16s ease, visibility 0s linear .16s;
  }
  .ne-panel.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity .16s ease, transform .22s cubic-bezier(.2, .8, .25, 1), visibility 0s; }
  /* ---- the two routes ----
     Full-width rows the way a settings list reads: the whole row is the target, and the hairline between
     them is the only structure. The accent sits in the icon and the chevron, which is what says these are
     things you press — a hover wash cannot, since you only meet it once the pointer is already there. */
  .ne-body { display: grid; }
  .ne-card {
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    padding: 16px 20px; text-align: left; background: none; border: 0; border-radius: 0;
    transition: background-color .14s ease;
  }
  .ne-card + .ne-card { border-top: 1px solid var(--rule); }
  .ne-card:hover { background: var(--wash); }
  .ne-card:active { background: var(--wash-hover); }
  .ne-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .ne-ico { flex-shrink: 0; color: var(--accent); }
  .ne-ico svg { --sz: 20; width: 20px; height: 20px; }
  .ne-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
  .ne-txt b { font-size: 15px; line-height: 20px; font-weight: 560; color: var(--ink); }
  .ne-txt span { font-size: 13px; line-height: 18px; color: var(--muted); }
  .ne-go { --sz: 16; width: 16px; height: 16px; flex-shrink: 0; color: var(--muted-2); transition: transform .18s ease; }
  .ne-card:hover .ne-go { transform: translateX(3px); }
  @media (prefers-reduced-motion: reduce) { .ne-card:hover .ne-go { transform: none; } }

  /* ---------- ask ----------
     The dialog that asks before something is taken away: the same centred panel, narrower, holding a
     sentence instead of a body. The sentence names what goes and where from, because an "Are you sure?"
     asks you to remember what you pressed rather than telling you. */
  .ne-panel.ask { width: 420px; }
  .ask-body { margin: 0; padding: 16px 18px 18px; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
  .ask-body b { font-weight: 560; color: var(--ink); }
  /* Cancel is the way out, not an offer: it reads in the text colour so the only coloured thing in the
     foot is the button that does something. */
  .ask .f-foot .link-btn { color: var(--ink-soft); }


  .f-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 13px 18px; border-bottom: 1px solid var(--rule); }
  .f-head b { font-size: 16px; line-height: 22px; font-weight: 560; }
  .f-head .n { font-size: 13px; line-height: 18px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  /* 32px with an 8px radius is the page's icon-button square — the top bar's, the advanced-search chip's
     and the pager's steps are all that size, so the panel's close matches rather than being 2px shy */
  .f-x { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted-2); }
  .f-x:hover { background: var(--wash); color: var(--ink); }

  .f-body { flex: 1; min-height: 0; display: flex; }
  .f-nav { width: 244px; flex-shrink: 0; border-right: 1px solid var(--rule); background: var(--surface); padding: 8px; overflow-y: auto; overscroll-behavior: contain; }
  .f-nav button { width: 100%; min-height: 38px; padding: 0 8px 0 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; text-align: left; font-size: 14px; line-height: 19px; color: var(--ink-soft); }
  /* One fixed-width slot holds either the icon or the count, so a group switching between them never
     shifts its label — and the slot is sized for the widest badge (two digits; the largest group has 17
     options), which is what keeps a "2" and a "17" sitting on the same centre line. */
  .f-nav .slot { width: 22px; flex-shrink: 0; display: grid; place-items: center; }
  .f-nav .slot > svg { --sz: 16; width: 16px; height: 16px; color: var(--muted-2); }
  .f-nav button:hover { background: var(--wash); }
  .f-nav button.on { background: var(--accent-wash); color: var(--accent-deep); font-weight: 520; }
  .f-nav button.on .slot > svg { color: var(--accent); }
  .f-nav .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* the count is the whole point of the rail: what each group is doing, without opening it */
  .f-nav .cnt { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--btn); color: #fff; font-size: 11px; line-height: 18px; font-weight: 560; text-align: center; font-variant-numeric: tabular-nums; }
  .f-nav .go { --sz: 14; width: 14px; height: 14px; color: var(--accent); opacity: 0; flex-shrink: 0; }
  .f-nav button.on .go { opacity: 1; }

  .f-pane { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
  /* nowrap, and Clear is always in the layout — only its visibility changes. Rendering it in and out
     re-flowed the header, and anything that reflows the header moves the whole list under it. */
  .f-pane-hd { padding: 14px 18px 8px; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
  /* One tooltip treatment, wherever a control needs one. The bubble lives inside its trigger and the
     trigger carries .tip-host, which is only there to give it a positioning context. visibility rides
     along with opacity so the bubble is genuinely gone between hovers — opacity alone leaves something
     hittable and readable-out in the layer. It drops from above by default; .up hangs it overhead
     instead, for a trigger with the page's edge below it rather than above. */
  .tip-host { position: relative; }
  .tip {
    position: absolute; top: calc(100% + 8px); left: -8px; z-index: 40;
    width: max-content; max-width: 236px; padding: 7px 10px; border-radius: 8px;
    background: var(--ink); color: var(--page); font-size: 12.5px; line-height: 17px;
    font-weight: 440; letter-spacing: .1px; text-align: left; white-space: normal;
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-3px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }
  .tip.up { top: auto; bottom: calc(100% + 8px); transform: translateY(3px); }
  /* .mid centres the bubble on its host instead of hanging it from the host's left edge. A square
     icon button is narrower than anything it can say, so left-aligned the bubble reads as belonging
     to whatever sits to the right of the button rather than to the button. Wider hosts keep the
     default, where the bubble's first word lines up with the thing it is describing.
     After .up, which it has to be able to combine with: the two tie on specificity. */
  /* A tooltip that is a list rather than a sentence. The space goes between the items and not into the
     line height, because a name long enough to wrap is still one item: spacing the lines would put the
     same gap inside it as between it and the next, and you could no longer tell where one ended. */
  .tip.lines > span { display: block; }
  .tip.lines > span + span { margin-top: 7px; }
  /* A tooltip inside something that scrolls is clipped by it, and counts toward what that thing can be
     scrolled to. On the groups grid both bit: the bubble was cut off at the foot of the list, and one
     in the last column had pushed a horizontal scrollbar under a grid that had no business having one.
     .float takes it out to the viewport, where an overflow it is not inside cannot clip it and a scroll
     width it is not part of cannot grow. It is the one tooltip form that has to be placed by script,
     for the same reason the hover card and the row menu are: nothing in CSS knows how much room is
     left below the thing you are pointing at. */
  .tip.float { position: fixed; top: 0; left: 0; }
  .tip.float.up { bottom: auto; }
  .tip.mid { left: 50%; transform: translate(-50%, -3px); }
  .tip.mid.up { transform: translate(-50%, 3px); }
  .tip-host:hover > .tip, .tip-host:focus-visible > .tip {
    opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s;
  }
  .tip-host:hover > .tip.mid, .tip-host:focus-visible > .tip.mid { transform: translate(-50%, 0); }
  @media (prefers-reduced-motion: reduce) { .tip { transition-duration: 0s; transform: none; } }

  .f-help { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: -4px; border-radius: 6px; color: var(--muted-2); transition: color .14s ease, background-color .14s ease; }
  .f-help:hover, .f-help:focus-visible { color: var(--ink-soft); background: var(--wash); }
  .f-help svg { --sz: 15; width: 15px; height: 15px; }
  .f-pane-hd h3 { margin: 0; flex-shrink: 0; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Clear holds its slot whether or not it is shown, so revealing it cannot move anything; what changes
     is that it now eases in from under the segmented control on its right rather than snapping on. */
  .f-pane-hd .link-btn { transition: opacity .16s ease, transform .18s cubic-bezier(.2, .8, .25, 1); }
  .f-pane-hd .link-btn.is-off { visibility: hidden; pointer-events: none; opacity: 0; transform: translateX(8px); }
  /* The margin sits on the mode rather than on Clear, so a group that has no mode still ends flush at the
     same right edge instead of being pushed in by a margin with nothing beside it. */
  .f-pane-hd .link-btn { margin-left: 0; }
  .f-pane-hd .f-mode { margin-left: 4px; }
  .f-pane-hd .f-mode { flex-shrink: 0; }

  .f-pane-hd .sp { flex: 1; }
  /* 5px of headroom: overflow-y makes this a scroll container, which clips, and the search box sits flush
     against its top edge — so a focus ring drawn outside the box was being cut off along the top. The
     header gives the space back so the gap looks the same. */
  .f-scroll { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 5px 12px 14px 12px; }

  /* A yes/no question is not a checklist. As two checkboxes, "neither ticked" and "both ticked" were the
     same query, so half the states were dead. Radios fix that, but naming them Any / Yes / No only moved
     the work: you had to hold the group's title in your head and map "Yes" onto it. So the options are
     written as finished phrases instead — you read one line and know what you get — and "no opinion" is
     the cleared state, which is the same Clear every other group already has. */
  .f-opt .bx.rd { border-radius: 50%; }
  .f-opt .bx.rd i { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .12s ease; }
  .f-opt input:checked + .bx.rd i { opacity: 1; }

  /* And / Or sits in the header, which is above the scroll area and never moves — putting it in the list
     meant the checkboxes shifted the moment it rendered. It states the current mode rather than offering
     two of them: a pair side by side asks you to compare and choose, where one phrase only asks you to
     notice. Both halves are the same width, which is what lets one thumb slide between them on a single
     translate rather than resizing — the movement is the affordance, so the control can stay borderless
     and the hover can stay quiet. */
  .f-mode { position: relative; display: inline-flex; padding: 2px; background: var(--wash); border-radius: 9px; }
  .f-mode button { position: relative; z-index: 1; flex: 1; min-width: 74px; height: 24px; padding: 0 10px; border-radius: 7px; font-size: 13px; line-height: 24px; font-weight: 480; color: var(--muted); transition: color .18s ease; }
  .f-mode button:hover { color: var(--ink-soft); }
  .f-mode button:disabled { opacity: .4; cursor: default; }
  .f-mode button:disabled:hover { color: var(--muted); }
  .f-mode button.on { color: var(--ink); font-weight: 560; }
  .f-mode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .f-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 7px; background: var(--page); box-shadow: 0 1px 2px rgba(90, 100, 105, .14); transition: transform .22s cubic-bezier(.2, .8, .25, 1); }
  .f-mode[data-on="And"] .f-thumb { transform: translateX(100%); }

  .f-search { height: 32px; margin: 0 6px 8px; padding: 0 10px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 8px; }

  .f-search > svg { --sz: 14; width: 14px; height: 14px; color: var(--muted-2); flex-shrink: 0; }
  .f-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); }

  .f-opt { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 20px; color: var(--ink); }
  .f-opt:hover { background: var(--wash); }
  .f-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .f-opt .bx { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; border: 1px solid var(--field); border-radius: 5px; background: var(--page); display: grid; place-items: center; color: #fff; transition: background-color .12s ease, border-color .12s ease; }
  .f-opt .bx svg { --sz: 12; width: 12px; height: 12px; opacity: 0; transition: opacity .12s ease; stroke-width: 3; }
  .f-opt input:checked + .bx { background: var(--accent); border-color: var(--accent); }
  .f-opt input:checked + .bx svg { opacity: 1; }
  .f-opt input:focus-visible + .bx { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* test data in here runs to a hundred characters with no spaces, so it wraps rather than escaping the panel */
  .f-opt .t { min-width: 0; overflow-wrap: anywhere; }
  .f-opt .t em { font-style: normal; background: var(--accent-wash); border-radius: 3px; }
  /* set apart from the values under it by a rule and a quieter label, because it answers a different
     question: not "which one" but "the ones with none at all" */
  .f-none { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
  /* dimmed rather than hidden: the options are still worth seeing, they just cannot apply right now */
  .f-list.off { opacity: .45; }
  .f-list.off .f-opt { cursor: default; }
  .f-list.off .f-opt:hover { background: transparent; }
  .f-none .t { color: var(--muted); }
  .f-sub { padding-left: 28px; }
  .f-twist { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; border-radius: 8px; font-size: 13px; line-height: 18px; font-weight: 520; letter-spacing: .1px; color: var(--muted-2); }
  .f-twist:hover { background: var(--wash); }
  .f-twist svg { --sz: 12; width: 12px; height: 12px; transition: transform .16s ease; }
  .f-twist[aria-expanded="true"] svg { transform: rotate(90deg); }
  .f-empty { padding: 18px 8px; font-size: 14px; color: var(--muted-2); }

  /* date and range groups */
  /* Sized to the conditions and nothing more: the six chips measure 341px, plus the popover's 10px
     padding either side and its border. The popover stretches to this same width, so the two keep
     sharing their edges. */
  .f-field { padding: 0 8px; display: grid; gap: 8px; max-width: 380px; }
  .f-field label { font-size: 13px; line-height: 18px; font-weight: 480; letter-spacing: .1px; color: var(--muted-2); }
  .f-field input[type="month"], .f-field input[type="date"], .f-num {
    height: 36px; padding: 0 10px; border: 1px solid var(--field); border-radius: 8px;
    background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
  }

  .f-two { display: flex; align-items: center; gap: 8px; }
  .f-two span { color: var(--muted-2); }

  /* ---------- select ---------------------------------------------------------------------------------
     One dropdown for the whole app. Built from the same parts as the rail flyout and the row hover card —
     the panel fill, the stronger stroke, a 12px radius and the shared lift — so it reads as this app's
     floating surface rather than as a control borrowed from another kit, and its trigger is the same 36px
     bordered field as every other input, focus ring included.

     A native <select> could not be any of that: its list is drawn by the operating system, so it cannot
     carry the surface, the tick, the group labels or the open state. What it can do is stay a real
     listbox — this one keeps the roles, the keyboard and a change event, so it drops into a form in place
     of the native one.

       <div class="sel" data-sel data-value="">
         <button class="sel-btn" type="button">…</button>
         <div class="sel-pop" role="listbox">
           <div role="group" aria-label="Group"><p class="sel-group">Group</p>
             <button class="sel-opt" role="option" data-value="x">X</button>
           </div>
         </div>
       </div>
     ---------------------------------------------------------------------------------------------------- */
  .sel { position: relative; display: block; min-width: 0; max-width: 100%; }
  .sel-btn {
    width: 100%; height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--field); border-radius: 8px; background: var(--page);
    font: inherit; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer;
    box-shadow: 0 0 0 0 var(--accent-wash);
    transition: border-color .14s ease, box-shadow .18s ease, background-color .14s ease;
  }
  .sel-btn:hover { border-color: var(--accent-line); }
  .sel-btn:focus-visible, .sel[data-open="true"] .sel-btn {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
  }
  .sel-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sel-val.empty { color: var(--muted-2); }
  .sel-btn .chev { flex: none; color: var(--muted-2); transition: transform .2s cubic-bezier(.2, .8, .25, 1); }
  .sel[data-open="true"] .sel-btn .chev { transform: rotate(180deg); }
  .sel[data-disabled] .sel-btn { background: var(--wash); color: var(--muted-2); cursor: default; border-color: var(--stroke); }
  .sel[data-disabled] .sel-btn .chev { opacity: .5; }

  /* As wide as its options need, and never narrower than the field it belongs to. Pinned to both
     edges it was exactly the trigger width, which the tick and the padding then ate into — so
     “All training types” wrapped under a trigger that showed it on one line. Capped, because one
     filter group deliberately carries an absurd option and that one still has to wrap. */
  .sel-pop {
    position: absolute; left: 0; right: auto; top: calc(100% + 6px); z-index: 6;
    min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 32px));
    transform-origin: top center;
    max-height: 264px; overflow-y: auto; overscroll-behavior: contain; padding: 5px;
    background: var(--pop-bg); border: 1px solid var(--stroke-strong); border-radius: 12px; box-shadow: var(--lift);
    scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
    transform-origin: top center; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98);
    transition: opacity .12s ease, transform .14s ease, visibility 0s linear .14s;
  }
  /* near the bottom of a page the list opens upward instead, so it is never cut off by the edge */
  /* hung from its right edge instead, when the left would put it past the window */
  .sel[data-align="right"] .sel-pop { left: auto; right: 0; }
  .sel[data-drop="up"] .sel-pop { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; transform: translateY(4px) scale(.98); }
  .sel[data-open="true"] .sel-pop {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .14s ease, transform .2s cubic-bezier(.2, .8, .25, 1), visibility 0s;
  }
  .sel-pop:focus-visible { outline: none; }
  /* A long option wraps rather than truncating. Some of these labels come from the customer's own data —
     programs, learning paths, policies — and in a chooser it is often the tail that tells two options apart,
     which is exactly what an ellipsis hides. One line still measures 32px, so a list of short options keeps
     the rhythm it had. The trigger keeps its ellipsis: that is a fixed-height field, and the whole value is
     one click away. */
  .sel-opt {
    width: 100%; min-height: 32px; padding: 6px 8px; display: flex; align-items: flex-start; gap: 8px;
    border-radius: 7px; font-size: 15px; line-height: 20px; color: var(--ink); text-align: left;
    transition: background-color .12s ease, color .12s ease;
  }
  .sel-opt span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  /* the pointer and the arrow keys land on the same class, so a row never lights up twice or in two ways */
  .sel-opt.here { background: var(--wash); }
  .sel-opt[aria-selected="true"] { color: var(--accent-deep); font-weight: 520; }
  .sel-opt[aria-selected="true"].here { background: var(--accent-wash); }
  .sel-tick { flex: none; width: 13px; height: 13px; --sz: 13; margin-top: 3px; color: var(--accent); opacity: 0; }
  .sel-opt[aria-selected="true"] .sel-tick { opacity: 1; }
  .sel-group {
    margin: 0; padding: 9px 8px 5px; font-size: 11px; line-height: 14px; font-weight: 560;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2);
  }
  .sel-pop > [role="group"]:first-child .sel-group, .sel-pop > .sel-group:first-child { padding-top: 4px; }
  /* a rule above each section after the first: the label alone leaves the last option of one section and the
     heading of the next reading as one block. It runs the full width of the surface, so it divides the list
     rather than sitting inside it — hence the negative margins past the popover's own padding. */
  .sel-pop > [role="group"]:not(:first-child) {
    margin: 5px -5px 0; padding: 4px 5px 0; border-top: 1px solid var(--rule);
  }
  .sel-pop > [role="group"]:not(:first-child) .sel-group { padding-top: 7px; }
  /* Several values at once, found by typing. The trigger and the surface are the same; what changes is that
     the list is filtered by a box above it, picking does not close anything, and the row keeps its tick as a
     standing state rather than a final answer. The search sits outside the listbox — a listbox holds options,
     not controls — which is also what keeps the list scrolling under a box that stays put. */
  .sel-pop:has(.sel-search) { display: flex; flex-direction: column; overflow: hidden; }
  .sel-list { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent; }
  .sel-search {
    flex: none; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px;
    margin: -5px -5px 5px; border-bottom: 1px solid var(--rule);
  }
  .sel.sm .sel-search { height: 32px; margin: -4px -4px 4px; }
  .sel-search svg { --sz: 13; width: 13px; height: 13px; flex: none; color: var(--muted-2); }
  .sel-search input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; padding: 0;
    font: inherit; font-size: 14px; color: var(--ink);
  }
  .sel-search input::placeholder { color: var(--muted-2); opacity: 1; }
  .sel-search input::-webkit-search-cancel-button { display: none; }
  /* once several things are ticked, untickng them one at a time is the only way back — so there is a way
     back. It sits by the search rather than in the trigger: a button inside the trigger would be a button
     inside a button, and this is where you already are when you want to undo. */
  .sel-clear {
    flex: none; padding: 2px 6px; margin-right: -2px; border-radius: 6px;
    font-size: 13px; line-height: 18px; font-weight: 480; color: var(--muted-2);
    transition: background-color .14s ease, color .14s ease;
  }
  .sel-clear:hover { background: var(--wash); color: var(--ink); }
  /* when the label had to give up names, hovering the field gives them back — the page's one tooltip
     treatment, aligned to the field rather than offset like the icon-button tips */
  .sel-tip { left: 0; max-width: 280px; }
  .sel-none { margin: 0; padding: 8px; font-size: 14px; line-height: 18px; color: var(--muted-2); }
  /* A box, not a tick: a tick reads as "this is the answer", and here it is one of several. It is the same
     box as the checkboxes in the filters modal, so a list you can take more than one thing from looks like
     one everywhere. With the box doing the work the chosen rows keep the ordinary text colour — accent type
     as well would be saying it twice. */
  .sel-box {
    flex: none; width: 16px; height: 16px; margin-top: 1px; display: grid; place-items: center;
    border: 1px solid var(--stroke-strong); border-radius: 4px; background: var(--page); color: #fff;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .sel-box svg { --sz: 11; width: 11px; height: 11px; opacity: 0; transition: opacity .12s ease; }
  .sel-opt[aria-selected="true"] .sel-box { background: var(--accent); border-color: var(--accent); }
  .sel-opt[aria-selected="true"] .sel-box svg { opacity: 1; }
  .sel[data-multi] .sel-opt[aria-selected="true"] { color: var(--ink); font-weight: inherit; }
  .sel[data-multi] .sel-opt[aria-selected="true"].here { background: var(--wash); }
  @media (prefers-reduced-motion: reduce) { .sel-box, .sel-box svg { transition: none; } }

  /* A compact size for places that are mostly fields — a settings pane is a column of them, and at the
     default scale the pane reads as a stack of buttons rather than a form. Same anatomy, one step down:
     32px trigger, 14px text, tighter rows and a smaller radius on the surface. */
  .sel.sm .sel-btn { height: 32px; padding: 0 8px; font-size: 14px; }
  .sel.sm .sel-pop { max-height: 240px; padding: 4px; border-radius: 10px; }
  .sel.sm .sel-opt { min-height: 28px; padding: 5px 8px; border-radius: 6px; font-size: 14px; line-height: 18px; }
  .sel.sm .sel-tick { width: 12px; height: 12px; --sz: 12; margin-top: 3px; }
  .sel.sm .sel-group { padding: 7px 8px 4px; font-size: 10px; }
  .sel.sm .sel-pop > [role="group"]:first-child .sel-group { padding-top: 3px; }
  .sel.sm .sel-pop > [role="group"]:not(:first-child) { margin: 4px -4px 0; padding: 4px 4px 0; }
  .sel.sm .sel-pop > [role="group"]:not(:first-child) .sel-group { padding-top: 6px; }

  @media (prefers-reduced-motion: reduce) {
    .sel-btn, .sel-btn .chev, .sel-opt { transition: none; }
    .sel-pop { transition: opacity .12s ease, visibility 0s; transform: none; }
  }




  /* ---------- date picker ---------------------------------------------------------------------------
     One calendar serving five conditions. The same floating surface as the condition list above it, and
     the same trigger as every other field in the panel, so a date does not arrive looking like a control
     from another kit. The grid has no column gap: a range has to read as one continuous band, which it
     cannot do if every cell is separated by a gutter — the rounding is put back on the two ends instead.
     ---------------------------------------------------------------------------------------------------- */
  .f-date { position: relative; }
  .f-date-btn { width: 100%; height: 36px; padding: 0 4px 0 10px; cursor: text; display: flex; align-items: center; gap: 8px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); font: inherit; font-size: 15px; color: var(--ink); text-align: left; box-shadow: 0 0 0 0 var(--accent-wash); transition: border-color .14s ease, box-shadow .18s ease, background-color .14s ease; }
  /* the same 14px, muted, --sz-scaled icon the two search fields carry: at 15px it was the only
     oversized field icon on the page, which is what made it read as decoration rather than as part
     of the field */
  .f-date-btn > svg:first-child { --sz: 14; width: 14px; height: 14px; color: var(--muted-2); flex-shrink: 0; }
  .f-date-btn .chev { color: var(--muted-2); flex-shrink: 0; transition: transform .2s cubic-bezier(.2, .8, .25, 1); }
  .f-date[data-open="true"] .f-date-btn .chev { transform: rotate(180deg); }
  /* fills the field rather than hugging its text, and takes no ring of its own: the field already shows
     focus, so a content-sized input drew a second bordered box inside the first */
  .f-date-in { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; padding: 0; font: inherit; font-size: 15px; color: var(--ink); }
  .f-date-in:focus, .f-date-in:focus-visible { outline: none; box-shadow: none; }
  .f-date-in::placeholder { color: var(--muted-2); opacity: 1; }
  .f-date-in.bad { color: var(--error); }
  .f-date-toggle { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted-2); flex-shrink: 0; transition: background-color .14s ease, color .14s ease; }
  .f-date-toggle:hover { background: var(--wash); color: var(--ink); }
  .f-date-btn:hover { border-color: var(--accent-line); }
  .f-date-btn:focus-within, .f-date[data-open="true"] .f-date-btn { outline: none; border-color: var(--accent); background: var(--page); box-shadow: 0 0 0 3px var(--accent-wash); }

  .f-cal { position: absolute; left: 0; right: 0; min-width: 364px; top: calc(100% + 6px); z-index: 6; padding: 10px; background: var(--pop-bg); border: 1px solid var(--stroke-strong); border-radius: 12px; box-shadow: var(--lift); transform-origin: top left; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); transition: opacity .12s ease, transform .14s ease, visibility 0s linear .14s; }
  .f-date[data-open="true"] .f-cal { opacity: 1; visibility: visible; transform: none; transition: opacity .14s ease, transform .2s cubic-bezier(.2, .8, .25, 1), visibility 0s; }

  /* five small chips rather than a nested dropdown: a menu inside a popover is a second thing to open
     and dismiss, and at five options it buys nothing over showing them all */
  .f-modes { display: flex; flex-wrap: nowrap; gap: 4px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
  .f-modes button { flex: 1 0 auto; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13px; line-height: 28px; font-weight: 520; color: var(--muted); transition: background-color .14s ease, color .14s ease; }
  .f-modes button:hover { background: var(--wash); color: var(--ink-soft); }
  .f-modes button.on { background: var(--accent-wash); color: var(--accent-deep); }
  .f-cal-hd { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; }
  .f-cal-hd .ttl { flex: 1; height: 32px; padding: 0 8px; border-radius: 8px; transition: background-color .14s ease; font-size: 15px; line-height: 32px; font-weight: 520; color: var(--ink); text-align: center; }
  .f-cal-hd .ttl:hover { background: var(--wash); }
  .f-cal-nav { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted-2); flex-shrink: 0; transition: background-color .14s ease, color .14s ease; }
  .f-cal-nav:hover { background: var(--wash); color: var(--ink); }
  .f-cal-nav svg { --sz: 14; width: 14px; height: 14px; }
  .f-cal-nav.prev svg { transform: rotate(90deg); }
  .f-cal-nav.next svg { transform: rotate(-90deg); }

  /* The grid arrives from the side it came from, so a month step reads as movement along a line rather
     than as the contents being swapped. Zooming between days and months scales instead, because that is
     a change of altitude, not of position. */
  @keyframes f-in-r { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
  @keyframes f-in-l { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
  @keyframes f-in-z { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
  @keyframes f-fade { from { opacity: 0; } to { opacity: 1; } }
  .f-cal-grid.in-r, .f-cal-months.in-r { animation: f-in-r .22s cubic-bezier(.2, .8, .25, 1); }
  .f-cal-grid.in-l, .f-cal-months.in-l { animation: f-in-l .22s cubic-bezier(.2, .8, .25, 1); }
  .f-cal-grid.in-z, .f-cal-months.in-z { animation: f-in-z .2s cubic-bezier(.2, .8, .25, 1); }
  .f-cal-hd .ttl.in-r, .f-cal-hd .ttl.in-l, .f-cal-hd .ttl.in-z { animation: f-fade .24s ease; }
  .f-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); }
  .f-cal-dow span { height: 26px; display: grid; place-items: center; font-size: 12px; line-height: 26px; font-weight: 480; letter-spacing: .1px; color: var(--muted-2); }
  .f-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
  .f-day { height: 36px; display: grid; place-items: center; position: relative; border-radius: 8px; font-size: 15px; line-height: 36px; color: var(--ink); font-variant-numeric: tabular-nums; transition: background-color .13s ease, color .13s ease; }
  .f-day.out { color: var(--muted-2); opacity: .5; }
  .f-day:hover { background: var(--wash); }
  /* today is a mark under the number, so it can coexist with being selected or mid-range */
  .f-day.today::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
  .f-day.in { background: var(--accent-wash); border-radius: 0; }
  .f-day.in:hover { background: var(--wash-hover); }
  /* --accent is for a dot, a bar, a track — things nothing is read off. Anything carrying white
     text uses --btn, the same hue tuned to hold it: on --accent this was 3.95:1. */
  .f-day.end { background: var(--btn); color: #fff; font-weight: 520; border-radius: 8px; }
  .f-day.end:hover { background: var(--btn); }
  .f-day.end.today::after { background: #fff; }
  .f-day.end.lo { border-radius: 8px 0 0 8px; }
  .f-day.end.hi2 { border-radius: 0 8px 8px 0; }
  .f-day:disabled { color: var(--muted-2); opacity: .3; }

  .f-cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .f-mon { height: 42px; border-radius: 8px; font-size: 14px; display: grid; place-items: center; color: var(--ink); transition: background-color .13s ease, color .13s ease; }
  .f-mon:hover { background: var(--wash); }
  .f-cal-months { padding-top: 2px; }
  .f-mon.end { background: var(--btn); color: #fff; font-weight: 520; }

  .f-cal-ft { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
  .f-cal-ft .sp { flex: 1; }
  .f-cal-ft button { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 520; color: var(--accent-deep); transition: background-color .14s ease; }
  .f-cal-ft button:hover { background: var(--wash); }
  .f-cal-note { margin: 2px 2px 0; padding: 0 2px 2px; font-size: 13px; line-height: 18px; color: var(--muted); }
  .f-cal-hint { padding: 0 2px 6px; font-size: 12px; line-height: 16px; color: var(--muted-2); text-align: center; }

  /* the thumb width and track height live here rather than on .f-track, because the tick labels are a
     sibling of the track and have to be laid out on the same geometry */
  .f-range { --th: 20px; --tk: 26px; padding: 4px 8px 0; max-width: 340px; }
  /* the track reads first and the two fields below it are the readout, rather than two small boxes
     floating above the thing they describe */
  .f-range .vals { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
  .f-ticks { position: relative; height: 16px; margin-top: 7px; }
  /* the scale dims outside the chosen span and firms up inside it, so the labels say where the range
     sits without a second reading of the numbers. --muted is the more prominent of the two in both
     themes, which is what "darker" has to mean on a dark page. */
  .f-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px;
                  line-height: 16px; color: var(--muted-2); opacity: .62; font-variant-numeric: tabular-nums;
                  transition: color .16s ease, opacity .16s ease; }
  .f-ticks span.in { color: var(--muted); opacity: 1; }
  .f-num { width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
  /* the spinners would sit exactly where the label goes, and they are redundant next to a slider */
  .f-num { appearance: textfield; -moz-appearance: textfield; }
  .f-num::-webkit-outer-spin-button, .f-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  /* the label rides inside the field rather than above it: the pair is already under a slider that
     says what they are, so a stacked caption would be a third line saying the same thing */
  .f-minmax { position: relative; flex: 1; min-width: 0; display: flex; }
  .f-minmax .f-num { width: 100%; min-width: 0; text-align: left; padding-right: 52px; }
  .f-minmax .lb { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
                  font-size: 13px; line-height: 18px; color: var(--muted-2); pointer-events: none; }
  /* two sliders stacked on one track: the inputs ignore the pointer so the track never steals a drag,
     and only the thumbs take it back, which is what lets the two handles cross without fighting.
     --th is the thumb width; the fill has to know it, because a range input insets its thumb by half a
     thumb at each end, so a fill measured off the raw track would drift away from the handle it belongs to. */
  /* the track itself takes the pointer, so a press anywhere along it places a handle; touch-action
     keeps a drag from turning into a page scroll */
  .f-track { position: relative; height: var(--tk); cursor: pointer; touch-action: none; }
  .f-track .rail-bg { position: absolute; left: 0; right: 0; top: 0; height: var(--tk); border-radius: 7px; background: var(--wash); }
  /* a hairline of shade along the inside of the top and bottom edges, so the track sits in the page
     rather than on it. The fill covers it over the chosen span, which is what keeps that span reading flat. */
  .f-track .rail-bg { box-shadow: inset 0 1px 0 rgba(90, 100, 105, .11), inset 0 -1px 0 rgba(90, 100, 105, .07); }
  /* The divisions are cut in the page colour rather than drawn in a stroke, so they read as gaps in the
     track the way a segmented rule does, and they sit under the fill so the chosen span stays solid.
     Inset by half a thumb: that is the span a thumb can actually reach, so every division lands under a
     real value, and the ends line up with the handles at 0 and 100 instead of sitting past them. The
     repeat draws 10 through 100; the single layer before it supplies the one at 0. */
  .f-track .ticks { position: absolute; top: 0; height: var(--tk); pointer-events: none;
    left: calc(var(--th) / 2); right: calc(var(--th) / 2);
    background-image: linear-gradient(var(--page), var(--page)),
      repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), var(--page) calc(10% - 1px), var(--page) 10%);
    background-size: 1px 100%, auto; background-position: left top, 0 0;
    background-repeat: no-repeat, repeat; }
  /* The bar spans the whole of the handles' travel and is clipped back to the chosen span, rather than
     being a box sized to that span. That is what keeps the gradient meaning something: teal is always
     0 and green is always 100, instead of the whole ramp compressing into whatever is selected and the
     colour under a given value shifting every time a handle moves. inset() rounds its own corners, so
     the clipped ends keep the handles' radius. */
  .f-track .fill { position: absolute; top: 0; height: var(--tk); background: var(--fill-grad);
                   left: calc(var(--th) / 2); right: calc(var(--th) / 2); }
  .f-track input[type="range"] { position: absolute; left: 0; top: -2px; width: 100%; height: calc(var(--tk) + 4px); margin: 0; background: none; appearance: none; pointer-events: none; }
  .f-track input[type="range"]::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: var(--th); height: calc(var(--tk) + 4px); border-radius: 5px; background: var(--page); border: 2px solid var(--accent); box-shadow: 0 0 0 1px rgba(90, 100, 105, .12), 0 1px 3px rgba(90, 100, 105, .22); cursor: grab; }
  .f-track input[type="range"]::-moz-range-thumb { pointer-events: auto; box-sizing: border-box; width: var(--th); height: calc(var(--tk) + 4px); border-radius: 5px; background: var(--page); border: 2px solid var(--accent); box-shadow: 0 0 0 1px rgba(90, 100, 105, .12), 0 1px 3px rgba(90, 100, 105, .22); cursor: grab; }
  .f-track input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
  .f-track input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* What the current selection would return, at the foot of the pane. It sits where the artwork used to
     and does the job the artwork could not: the pane shows one group at a time, so the only way to know
     what the whole filter adds up to was to apply it and look. mt:auto rather than a fixed position, so
     it sits under a short list and is pushed to the floor by a long one without ever overlapping it. */
  .f-live {
    margin-top: auto; flex-shrink: 0; padding: 14px 18px 16px;
    border-top: 1px solid var(--rule);
  }
  .f-live-n { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
  /* the number is the thing being read, so it carries the weight and the ink; the rest is scaffolding */
  .f-live-n b { font-size: 19px; font-weight: 560; color: var(--ink); letter-spacing: -.2px; }
  .f-live-bar { margin: 9px 0 7px; height: 4px; border-radius: 9999px; background: var(--wash); overflow: hidden; }
  .f-live-bar i { display: block; height: 100%; border-radius: 9999px; background: var(--accent);
                  transition: width .32s cubic-bezier(.2, .8, .25, 1); }
  .f-live-sub { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--muted-2); }
  .f-live-sub b { font-weight: 560; color: var(--muted); }
  /* nothing matches: the line above is the answer rather than a count. The track stays — hiding it took
     it out of the layout, so the block jumped shorter at the exact moment the fill should be gliding to
     empty, and an empty track says "none of them" perfectly well. */
  .f-live[data-none="true"] .f-live-n { color: var(--ink-soft); font-size: 15px; font-weight: 520; }
  @media (prefers-reduced-motion: reduce) { .f-live-bar i { transition: none; } }

  .f-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--rule); background: var(--surface); }
  .f-foot .sp { flex: 1; }


  /* One focus treatment for every bordered field on the page. These were three different things — the
     toolbar search went solid accent, the panel search only tinted its border, and the date and number
     fields drew a hard outline — so the same gesture looked like three. The ring grows from nothing on
     focus, which is the part that reads as a response rather than a state flipping.
     Controls that are not bordered fields keep the global outline, because a tick box or a rail item has
     no border for a ring to sit against. */
  .search-field, .f-search, .f-field input[type="month"], .f-field input[type="date"], .f-num {
    box-shadow: 0 0 0 0 var(--accent-wash);
    transition: border-color .14s ease, box-shadow .18s ease, background-color .14s ease;
  }
  .search-field { transition: border-color .14s ease, box-shadow .18s ease, background-color .14s ease; }
  /* :focus, not :focus-visible — a field you have clicked into should show where you are typing, and the
     two search boxes already behave that way through :focus-within. Under :focus-visible the selects and
     number boxes stayed bare while the search boxes lit up, which is the inconsistency being fixed. */
  .search-field:focus-within, .f-search:focus-within,
  .f-field input[type="month"]:focus, .f-field input[type="date"]:focus, .f-num:focus {
    outline: none; border-color: var(--accent); background: var(--page); box-shadow: 0 0 0 3px var(--accent-wash);
  }

  /* ---------- teal accents, kept light ---------- */
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .me { background: var(--accent-wash); color: var(--accent-deep); }
  .pill { background: var(--accent-wash); color: var(--accent-deep); }
  .pill svg { color: var(--accent); }
  .pill:hover { background: var(--wash-hover); }
  .chip:hover { border-color: var(--accent-line); }
  .chip svg, .chip .chev { color: var(--ink); }
  thead th .arr { color: var(--muted); }
  .ck label:hover .box { border-color: var(--accent); }

  /* header follows the rows' horizontal scroll natively (scroll-driven animation) so it never lags or bounces.
     The frozen header cells counter-translate so they stay pinned. Browsers without support fall back to JS sync. */
  @supports (animation-timeline: scroll()) {
    .tbl { timeline-scope: --hscroll; }
    .tbl-body { scroll-timeline: --hscroll x; }
    @keyframes hscroll-follow { to { transform: translateX(calc(var(--max, 0) * -1px)); } }
    @keyframes hscroll-pin { to { transform: translateX(calc(var(--max, 0) * 1px)); } }
    @keyframes hscroll-pin-end { from { transform: translateX(calc(var(--max, 0) * -1px)); } to { transform: none; } }
    .tbl.sdt .tbl-head table { animation: hscroll-follow linear both; animation-timeline: --hscroll; }
    .tbl.sdt thead th.ck, .tbl.sdt thead th.fz { position: relative; left: 0; animation: hscroll-pin linear both; animation-timeline: --hscroll; }
    /* nothing is pinned here, so the header travels whole with the rows */
    .tbl.sdt.unpinned thead th.ck, .tbl.sdt.unpinned thead th.fz { position: static; animation: none; }
    .tbl.sdt thead th.fz-end { position: relative; right: 0; animation: hscroll-pin-end linear both; animation-timeline: --hscroll; }
  }
  .scroll { flex: 1; min-height: 0; display: flex; padding: 16px 24px 24px; }

  /* Hovering anywhere in the disciplines column widens the column itself, for every row at once, so the
     full set fits on one line. Registering the length makes the custom property animatable, which is what
     lets the width interpolate; the table's min-width tracks it so the other columns keep their sizes. */
  @property --disc-w { syntax: "<length>"; inherits: true; initial-value: 240px; }
  /* --cw / --sl are the width of the table's visible window and how far it is scrolled, written by
     script. Row gradients map onto that window rather than onto the 1714px row, so the bright point
     sits in the middle of what is on screen instead of drifting off the right edge. */
  .tbl { --cw: 100%; --sl: 0px; --disc-w-rest: 240px; --disc-w: var(--disc-w-rest); transition: --disc-w .18s ease .12s; }
  .tbl.can-expand:has(.disc:hover) { --disc-w: var(--disc-w-full, 290px); transition-delay: 0s; }
  col.c-disc { width: var(--disc-w); }

  .tbl { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--page); border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; }
  .tbl-head { flex-shrink: 0; overflow: hidden; scrollbar-gutter: stable; border-bottom: 1px solid var(--stroke); }
  /* The overlay needs a box that is exactly the scroll area. Hung off .tbl it would run the full height of
     the table, pager included, and centring in that sits it too low. */
  .tbl-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .tbl-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: none; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent; }
  /* The table's own column sum, which is a fact about the page rather than about .tbl. Employees
     keeps it as the default because its disciplines column breathes and the number has to track that;
     a page whose columns add up to something else sets --tbl-min on its own .tbl and is done. */
  /* employees column sum, now including the 56px actions column */
  .tbl { --tbl-min: calc(1530px + var(--disc-w)); }
  .tbl-head table, .tbl-body table { min-width: var(--tbl-min); }

  /* ---------- cards ----------
     The same rows read as objects rather than as a list: one card each, laid out on a grid that
     takes as many columns as it has room for. The table stays the way to compare a column down the
     page; this is the way to take one thing in whole.

     Everything is scoped under .cards. A bare .card is exactly the name that means something else in
     the next app to read this sheet, which is how .step became .flow .step. */
  /* flex: 1 because .scroll is a flex row — without it the grid takes its width from its content and
     auto-fill has nothing to fill, so every card lands in a single column. */
  .cards {
    flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
    align-content: start;
  }
  .cards[hidden] { display: none; }
  .cards .card {
    position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
    padding: 14px 16px 14px; border: 1px solid var(--stroke); border-radius: 12px;
    background: var(--page); transition: border-color .14s ease, background-color .14s ease;
  }
  .cards .card:hover { background: var(--surface); border-color: var(--stroke-strong); }
  /* The whole card is the hit target, not just the words: the name is the link and an overlay on it
     fills the card, which is the same trick .person uses to turn a table cell into one. The controls
     are lifted above that overlay so they stay their own targets. */
  .cards .card-name a { color: inherit; }
  .cards .card-name a::after { content: ""; position: absolute; inset: 0; }
  /* The counts in the foot are lifted for the same reason, because a tooltip that the overlay
     swallows the hover for is a tooltip that never opens. */
  .cards .card-tools, .cards .card-foot .tip-host, .cards .card-meta .tip-host { position: relative; z-index: 1; }
  /* A card paints over the one before it, so a tooltip hanging below its own card was being covered by
     the next one down — visible, faintly, through a card it had no business being behind. The card
     whose tooltip is open comes forward for as long as it is open. */
  .cards .card:has(.tip-host:hover), .cards .card:has(.tip-host:focus-visible) { z-index: 2; }
  /* text-decoration rather than the painted line .person uses: a card's name can wrap, and a
     background gradient would underline the block rather than each line of it. */
  /* Not while the pointer is on the controls or on a count with a tooltip. Everything lifted above
     the link's overlay does its own thing there, so promising that a click follows the card would be
     a promise the card does not keep — :has lets the card ask where inside itself the pointer is. */
  /* The hover belongs to whatever you can actually press. Lifting a tooltip host above the name's
     overlay takes it out of the link, so by default pointing at one says so: the card does not light,
     because clicking there would do nothing. A grid marked .whole is one where the card itself is the
     target rather than the name inside it — there a fact is part of what you would click, so it lights
     the card like anything else on it and carries the same cursor. The kebab never lights either: it
     is its own target on every card. */
  .cards .card:hover:not(:has(.card-tools:hover)) .card-name a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  .cards:not(.whole) .card:hover:has(.tip-host:hover) .card-name a { text-decoration: none; }
  .cards.whole .card .tip-host { cursor: pointer; }
  .cards .card-name .ext { display: inline-block; vertical-align: -2px; margin-left: 5px; color: var(--muted-2); opacity: 0; transition: opacity .12s ease; }
  /* focus is read off the link rather than the card: focus-within would light the arrow when the
     checkbox or the kebab took the focus, which is the same false promise as the hover above */
  .cards .card:hover:not(:has(.card-tools:hover)) .card-name .ext,
  .cards .card-name a:focus-visible .ext { opacity: 1; }
  .cards:not(.whole) .card:hover:has(.tip-host:hover) .card-name .ext { opacity: 0; }
  @media (prefers-reduced-motion: reduce) { .cards .card-name .ext { transition: none; } }
  /* Selected says what the table says, in the table's own two marks: the faint --row-sel wash over
     the face, and the --row-rule hairline, which is brightest in the middle and fades towards both
     ends. That rule is a gradient and a border takes one colour, so the stroke is painted as a
     masked ring instead, pulled out to -1px so it lands on the border rather than inside it, with
     the border beneath it turned transparent. One pixel either way, so picking a card does not
     nudge the grid. After the hover rule because it has to beat it. */
  .cards .card:has(.box:checked) { border-color: transparent; background-image: var(--row-sel); }
  .cards .card:has(.box:checked)::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
    background: var(--card-rule); pointer-events: none;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
  }
  /* The top line carries what kind of thing this is and what can be done to it, one at each end. The
     controls had a row to themselves above the kind, which spent a whole line saying nothing and left
     the card top-heavy; sharing the line gives it back to the name. */
  .cards .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  /* pulled tight into the corner, so the controls sit on the card's edge rather than inside a margin */
  /* The block margins are what keep the controls from setting the height of this line: a 32px button
     beside an 18px label left ten pixels of slack under the label, and that slack read as a gap
     between the kind and the name it belongs to. They stay in flow, because taken out of it a long
     name would run underneath them. */
  .cards .card-tools { display: flex; align-items: center; gap: 2px; margin: -7px -6px -7px 0; flex: none; }
  /* The thing's own colour, carried as a tile so a card can be told apart before it is read. The
     colour travels with the record rather than living here — it is a property of that path, not of
     the system — so the card is handed one value and the wash is mixed from it. Passing the wash in
     beside it would be two values with no way to keep them agreeing. */
  .cards .card-mark {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 12px; color: var(--tint, var(--accent));
    background: color-mix(in srgb, currentColor 16%, transparent);
  }
  .cards .card-mark svg { --sz: 20; width: 20px; height: 20px; }
  .cards .card-kind { margin: 0; font-size: 11px; line-height: 14px; font-weight: 560; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
  /* the kind labels this name, so it sits nearer to it than the card's own rhythm would put it */
  .cards .card-name { margin: -4px 0 0; font-size: 16px; line-height: 22px; font-weight: 560; color: var(--ink); overflow-wrap: anywhere; }
  .cards .card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
  /* pushed to the bottom so every card's footer sits on the same line however tall the name ran */
  /* What the thing is, above what is attached to it. Five facts do not fit one line of a 320px card,
     and left to wrap they broke wherever the words happened to end — which put the ID on a line of
     its own, reading as a caption for nothing. Split where the meaning splits instead, and each line
     is short enough that it never has to break at all. */
  .cards .card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  /* the wrap stays as the backstop for a count wide enough to need it, not as the layout */
  .cards .card-foot { margin-top: auto; padding-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  /* The label carries the number's weight and the quieter colour: weight makes "ID" read as a
     label rather than as a word that trailed off, and colour is what keeps it behind the number. */
  .cards .card-id { margin-left: auto; font-size: 13px; font-weight: 560; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  .cards .card-id b { font-weight: 560; color: var(--muted); }

  /* A learning path as a chip. The path's colour is its own, so it arrives as a dot rather than as the
     chip's fill: a pale wash of an arbitrary colour cannot be relied on to hold text at 4.5:1, and the
     dot says which path it is without asking the label to be read against it. */
  .lp-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 7px; border-radius: 9999px; background: var(--wash); color: var(--ink-soft); font-size: 12.5px; line-height: 20px; }
  .lp-chip .lp-dot { width: 8px; height: 8px; }

  /* ---------- learning paths ---------- */
  /* A learning path's colour is the path's own, picked by whoever made it, so it arrives as data on the
     element rather than as a class here. The dot is what the system owns: its size and its place. */
  .lp-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
  /* A dot is smaller than the avatar .person is spaced for, so it sits closer to the name it marks. */
  .person .lp-dot { margin-right: -4px; }
  /* a count with the thing it counts beside it, so the column needs no unit in its heading */
  .lp-count { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .lp-count svg { --sz: 15; width: 15px; height: 15px; color: var(--muted-2); }
  .lp-auto { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
  .lp-auto svg { --sz: 15; width: 15px; height: 15px; color: var(--muted-2); }
  /* a duration nobody has set reads as absent rather than as zero */
  .lp-none { color: var(--muted-2); }

  /* A table the width of its own columns, centred in the space it has, for a list too narrow to fill
     the page — stretched across it the columns drift apart and the eye has to travel between them for
     no reason. --tbl-min has to be the column sum for this to work: the inner tables are width: 100%
     of the frame, so the frame has nothing else to take its width from. Every column needs a stated
     width too, or the one without absorbs the slack and the table fills after all. */
  /* The width is stated rather than left to shrink-to-fit: the inner tables are width: 100% of this
     frame, so asking the frame to size to its content asks it to size to something sized from it,
     and the browser settles that by handing it the whole column. --tbl-min is the answer either way. */
  /* pagination */
  .pager { position: relative; z-index: 2; margin-top: -1px; flex-shrink: 0; height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); background: var(--surface); }
  /* the pager is space-between, so the two counts share one side rather than becoming a third column */
  .pg-left { display: flex; align-items: center; min-width: 0; }
  /* Selection needs somewhere to land or ticking a box does nothing visible beyond the box itself.
     It sits beside the row count because it qualifies it: how many of these you have picked. */
  .sel-count { font-size: 14px; line-height: 20px; font-weight: 520; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
  .sel-count:not(:empty)::before { content: "·"; margin: 0 8px; color: var(--muted-2); font-weight: 440; }
  .pg-sum { font-size: 14px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .pg-sum b { font-weight: 520; color: var(--ink); }
  /* How the result divides, inside the summary rather than beside it: the summary is the live region
     that announces when the list changes, and a second one next to it would say the same thing twice.
     It carries its own separator, so a result that does not divide leaves no stray dot behind. */
  .pg-sum .match-count::before { content: "·"; margin: 0 8px; color: var(--muted-2); font-weight: 440; }
  .pg-nav { display: flex; align-items: center; gap: 4px; }
  .pg { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; display: grid; place-items: center; font-size: 14px; line-height: 20px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .pg:hover:not(:disabled):not(.on) { background: var(--wash); }
  .pg.on { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent-line); font-weight: 520; }
  .pg.step { background: var(--page); border-color: var(--stroke); color: var(--ink-soft); }
  .pg.step:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent-deep); background: var(--page); }
  .pg.step svg { width: 10px; height: 10px; }
  .pg.prev svg { transform: rotate(90deg); }
  .pg.next svg { transform: rotate(-90deg); }
  .pg.prev { margin-right: 8px; } .pg.next { margin-left: 8px; }
  .pg:disabled { opacity: .4; cursor: default; }
  /* Where the numbers were cut. Not a button: there is nothing it could do that the number beside it
     does not already do, and a row of twenty would push the summary off its own end. */
  .pg-gap { min-width: 20px; height: 32px; display: grid; place-items: center; color: var(--muted-2); font-size: 14px; line-height: 20px; }

  /* Below this the rail goes and the frame is its content alone. A page with a sub-rail keeps that
     column — it is the page's own navigation, not the product's — but the frame has to be told again:
     .frame:has(> .subrail) is the more specific of the two and would otherwise hold a 112px column open
     for a rail that is no longer in it. The opening animation goes with the rail it opened out of. */
  @media (max-width: 900px) {
    .frame { grid-template-columns: 1fr; }
    .frame:has(> .subrail) { grid-template-columns: var(--subrail-w) minmax(0, 1fr); animation: none; }
    .rail { display: none; }
  }


  /* soft gradient rising from the bottom right of the content area, behind the table and everything else */
  :root { --glow: #e0eeeb; }
  :root[data-mode="dark"] { --glow: transparent; }
  .panel { position: relative; }
  .panel > * { position: relative; z-index: 1; }
  /* The toolbar's menus hang below it, over the table. Its siblings all sit at z-index 1, so without this
     the table wins on document order and its sticky header paints over anything the toolbar opens. */
  .panel > .toolbar { z-index: 2; }
  .panel::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse 32% 28% at 100% 100%, var(--glow) 0%, transparent 100%); }


  /* ---------- one-time setup ---------- */
  /* A page that is one decision, so it is laid out as one column at reading width rather than as a
     panel of fields. Nothing here is a setting that gets revisited: it is read once, agreed to once,
     and then the page has no further use. The column scrolls, not the panel, because the agreement
     inside it is long and the title should stay where the rail left it. */
  .setup { flex: 1; min-width: 0; overflow: auto; }
  .setup-card { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; align-content: start; }
  .setup-hd { display: flex; align-items: center; gap: 14px; }
  /* the same tile a card's kind mark uses, one step larger because it has a whole page to head */
  .setup-mark {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px;
    border-radius: 13px; color: var(--accent); background: var(--accent-wash);
  }
  .setup-mark svg { --sz: 24; width: 26px; height: 20px; }
  .setup-ttl h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 560; letter-spacing: -.2px; color: var(--ink); }
  /* a row rather than a line of prose, because what follows the words is a badge and a badge taller than
     the text around it would otherwise set the line height for the whole subtitle */
  .setup-sub { margin: 3px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--muted-2); }
  /* How long it takes, lifted out of the sentence it was in. It is the quiet badge the app already uses
     for a fact about a thing rather than a state of it — --chip on --muted, the same pair .rule-off takes
     — and it carries the clock every duration in this app is shown with, so the number reads as a length
     of time rather than a count of something. */
  .setup-time {
    flex: none; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px 0 6px;
    border-radius: 9999px; background: var(--chip); color: var(--muted);
    font-size: 12px; font-weight: 480; line-height: 16px; letter-spacing: .01em;
  }
  .setup-time svg { --sz: 12; width: 12px; height: 12px; }
  .setup-lede { margin: 0; font-size: 15px; line-height: 23px; color: var(--ink-soft); }
  .setup-sec { display: grid; gap: 8px; }
  /* the type a group header takes everywhere in the app, the same one the search groups are named in */
  .setup-lbl {
    margin: 0; font-size: 11px; line-height: 14px; font-weight: 560; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted-2);
  }
  /* The agreement keeps its own surface and its own scroll. Letting it run the length of the page would
     make the checkbox beneath it something you arrive at rather than something you can see you have to
     reach, and the box is what says there is more of this than fits. It is focusable because a scrolling
     region that only answers the wheel cannot be read from the keyboard. */
  .terms-doc {
    max-height: 332px; overflow: auto; padding: 18px 20px;
    border: 1px solid var(--rule); border-radius: 12px; background: var(--page);
    display: grid; gap: 12px; align-content: start;
  }
  .terms-doc:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
  .terms-ttl { margin: 0; font-size: 16px; line-height: 22px; font-weight: 560; letter-spacing: -.1px; color: var(--ink); }
  .terms-sub { margin: -8px 0 0; font-size: 13px; line-height: 18px; font-weight: 520; color: var(--muted); }
  .terms-doc h5 { margin: 4px 0 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
  .terms-doc p { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-soft); }
  /* The checkbox sits in the gap between the agreement and the commit, and its own row padding would
     otherwise read as a third gap on each side of it. It also stops short of the column's width:
     .f-opt is a full-width row where it came from, in a list of options where the whole row is the
     target, but there is only one of these and its hover wash would otherwise run the width of the
     page to light up a single line. justify-self rather than a width, so a narrow page still wraps it. */
  .setup-card > .f-opt { margin: -7px -8px; justify-self: start; }
  .setup-ft { display: flex; align-items: center; }

  /* ---------- agency switcher ----------
     Which agency you are in, and the only way into another one. A select would be the obvious component
     and the wrong one: a Customer Success user has nine hundred agencies to choose from, which is not a
     list you read but one you search. So the control opens a search with the handful you actually work
     in held above it — the ones you came back to are one press away rather than one search away — and
     the rest of them below, in the order a list of names wants to be in.

     It hangs off the button rather than covering the screen, because choosing an agency is a move
     between places rather than a decision to be weighed: it should cost a press and a glance.

     Each row leads with the agency's tile — the same one the bar carries for the agency you are in, so
     the row and the control that took it read as one thing. It is not the table's person disc, which an
     organization is deliberately refused: that disc is round and hued, and the hues are for telling
     people apart. This is the agency's own square, holding its logo where there is one and its initial
     until then. */
  .ag-menu {
    position: fixed; z-index: 41; left: 0; top: 0; width: 340px; max-width: calc(100vw - 16px);
    display: flex; flex-direction: column; padding: 5px;
    background: var(--pop-bg); border: 1px solid var(--stroke-strong); border-radius: 12px; box-shadow: var(--lift);
    transform-origin: top left; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98);
    transition: opacity .12s ease, transform .14s ease, visibility 0s linear .14s;
  }
  .ag-menu.on {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .12s ease, transform .18s cubic-bezier(.2, .8, .25, 1), visibility 0s;
  }
  .ag-menu[hidden] { display: none; }   /* an author display: would otherwise beat the UA rule for [hidden] */
  /* The list scrolls and the search does not: a search box that leaves the top of its own results is a
     search box you have to go back for. */
  .ag-list {
    min-height: 0; max-height: 312px; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  .ag-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; text-align: left; }
  .ag-opt:hover, .ag-opt.here { background: var(--wash); }
  .ag-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  /* The same tile the bar carries for the agency you are in, so the row you pick and the control you
     picked it with are plainly the same thing. It holds a logo where there is one — object-fit keeps a
     wide one from stretching — and the agency's initial until then. */
  .ag-opt .ag-av { overflow: hidden; }
  .ag-opt .ag-av img { width: 100%; height: 100%; object-fit: cover; }
  .ag-nm { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The number is what tells two agencies of the same name apart, and half of them are some company's
     second site, so it is next to the name rather than hidden behind a hover. */
  .ag-id { flex: none; font-size: 13px; line-height: 18px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  /* centred on the row rather than on its first line, which is what the select's own rows are */
  .ag-opt .sel-tick { margin-top: 0; }
  .ag-opt[aria-selected="true"] .sel-tick { opacity: 1; }
  .ag-opt[aria-selected="true"] .ag-nm { font-weight: 520; }
  @media (prefers-reduced-motion: reduce) { .ag-menu { transition: opacity .12s ease, visibility 0s linear .12s; } }

  /* ---------- agency info ----------
     What an agency is, read rather than edited: nine groups of settings, stacked down the page in the
     order you would go looking for them. The column is held to a reading width rather than run to the
     panel's edge — a label and its value six hundred pixels apart are two columns, not one row. What
     changes from the original is inside the groups: a yes or a no is a mark before the word, so a card
     of eight settings can be skimmed for what is on without being read, and the asterisks are gone,
     because what a form insists on is a fact about the form and this is the page that only shows. */
  .info { display: grid; gap: 16px; align-content: start; max-width: 760px; }
  /* who this is, above the groups: the name, what names it elsewhere, and whether it is still running */
  .info-hero {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 18px 20px; background: var(--page); border: 1px solid var(--stroke); border-radius: 14px;
  }
  .info-mark {
    flex: none; display: grid; place-items: center; width: 52px; height: 52px;
    border-radius: 15px; color: var(--accent); background: var(--accent-wash);
  }
  .info-mark svg { --sz: 26; width: 26px; height: 26px; }
  .info-id { min-width: 0; flex: 1; display: grid; gap: 3px; }
  .info-id h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 560; letter-spacing: -.2px; color: var(--ink); }
  .info-sub { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
  .info-sub b { font-weight: 520; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .info-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--stroke-strong); }

  .info-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
  .info-card {
    display: grid; gap: 12px; align-content: start;
    padding: 16px 18px 18px; background: var(--page); border: 1px solid var(--stroke); border-radius: 14px;
  }
  .info-card.wide { grid-column: 1 / -1; }
  .info-card h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: -.1px; color: var(--ink); }
  .info-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  /* The label column is fixed so the values of a card line up, and gives way below the width where two
     columns of text would each be too narrow to read — the label goes above its value instead. */
  .info-card dl { margin: 0; display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 10px 14px; align-items: baseline; }
  .info-card dt { font-size: 12px; line-height: 18px; font-weight: 520; letter-spacing: .1px; color: var(--muted-2); }
  .info-card dd { margin: 0; min-width: 0; font-size: 14px; line-height: 20px; color: var(--ink); overflow-wrap: anywhere; }
  @media (max-width: 560px) {
    .info-card dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .info-card dd + dt { margin-top: 8px; }
  }
  /* A value nobody has filled in. It reads as a gap rather than as a word, which is what it is. */
  .info-none { color: var(--muted-2); }
  /* yes and no, as a mark and a word: the mark is what makes a card skimmable, and the word is what
     keeps it readable to anything that cannot see the mark */
  .info-flag { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
  .info-flag svg { --sz: 15; width: 15px; height: 15px; color: var(--muted-2); }
  .info-flag.on { color: var(--ink); }
  .info-flag.on svg { color: var(--accent); }
  /* the hours an agency has bought, which is the one number on the page rather than a setting */
  .info-meter { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
  .info-meter .info-hd { gap: 8px; }
  .info-ttl { font-size: 12px; line-height: 18px; font-weight: 520; letter-spacing: .1px; color: var(--muted-2); }
  .info-meter b { font-size: 26px; line-height: 32px; font-weight: 500; letter-spacing: -.4px; color: var(--ink); font-variant-numeric: tabular-nums; }
  .info-bar { height: 6px; border-radius: 9999px; background: var(--wash); overflow: hidden; }
  .info-bar i { display: block; height: 100%; border-radius: 9999px; background: var(--fill-grad); }
  .info-ends { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 18px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  .info-ends b { font-size: 12.5px; line-height: 18px; font-weight: 520; color: var(--ink-soft); }
  /* the end of the page, where the one irreversible thing lives: it says what it costs before it offers
     to do it, and the button is quiet because a filled red button on a page you came to read is a dare */
  .info-say { margin: 0; max-width: 62ch; font-size: 13.5px; line-height: 20px; color: var(--muted); }

  /* ---------- compact filter dialog ---------- */
  /* The filter panel the employee list opens is a two-pane room with a group list down one side, because
     it has seventeen groups to put somewhere. Five fields do not need a room. This is the same dialog at
     the size five fields take — one column of the step pane's own label-over-control rows, and the same
     head and foot, so closing and applying stay where the hand already looks for them. */
  /* max-height goes with the scroll. The big panel is capped at the window because it is a room you
     scroll inside; capping this one would hand .fpanel's own overflow: hidden a pane with nowhere to
     go, and at a short window it cut Show results off below the fold. It is as tall as its fields and
     no taller, and the placement keeps its foot on screen. */
  .fpanel.sm { width: 420px; height: auto; max-height: none; }
  /* It does not scroll. Five fields are the whole of the dialog, so a scrolling pane would only ever
     hide the last of them behind an edge — and a dialog that can hide a field is one you have to scroll
     to be sure of. It takes the height its fields take, and the height is the limit on how many there
     can be, which is the right way round. */
  .f-fields { padding: 16px 18px 18px; display: grid; gap: 14px; }
  /* A select's list hangs out of the dialog when the dialog is only a field or two tall, and the panel
     clips what leaves it. The clip is there for the big panel's scrolling halves, so it is lifted only
     while a list is actually open, and only on the compact one. */
  .fpanel.sm:has([data-sel][data-open]) { overflow: visible; }

  /* ---------- chips ----------
     What a multi-select holds, standing under the field as the things themselves. The field can only
     count them; a count sends you back into a thousand-row list to find out what you picked, and each
     chip carries the x that takes it back out. */
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chips:empty { display: none; }
  .chips .tag { max-width: 100%; }
  .chips .tag .org-ico { --sz: 14; width: 14px; height: 14px; flex: none; color: var(--accent); }
  /* In a dialog the chips are the one part with no limit to how far it grows — a group can hold a
     hundred organizations — so they scroll inside a height instead of pushing the foot off the bottom
     of the window. The height gives way to the window first, so what is above and below them is always
     on screen: that is what the compact dialog's no-scrolling rule is really protecting, and it is the
     chips that are a list rather than a field. The popover is left to hang out of the panel as it does
     now, which a scrolling .f-fields would have clipped. */
  .fpanel .chips {
    max-height: min(196px, max(72px, calc(100vh - 240px))); overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
  }
  /* and the last row under the cap is faded while there is more below it, the same edge the section
     tabs use when they run off their end: a list that stops at a clean line looks finished, and an
     overlay scrollbar only shows itself once you are already scrolling. */
  .fpanel .chips[data-overflow="true"] {
    mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }

  /* ---------- groups ---------- */
  /* A group is curation where the organizations list is structure: that list nests a company over its
     regions over their agencies, which is who owns whom, and this is whichever organizations somebody
     put together. So the list of groups is cards — a group is a thing you take in whole — and opening
     one is a page of its own, holding the same table the organizations list uses. A pane beside the
     cards was the first answer and the wrong one: what you want from a group is to work through what
     is in it, and a 380px column is not where you do that. */
  /* the names in it, because a group is known by what is in it; one line, and the count says the rest */
  .gp-names { min-width: 0; font-size: 13px; line-height: 18px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* the grid and its empty state share a box, because .empty-state is laid over its container and
     needs one that says it is positioned */
  .grid-wrap { position: relative; flex: 1; min-width: 0; display: flex; }

  /* One of these is shown at a time and whichever it is has to fill the panel, so the table inside it
     reaches the bottom of the window and scrolls there rather than stopping under its last row with
     the panel left empty beneath it. [hidden] is restated because an author display beats the user
     agent's rule for it — the same reason .head and the views menu restate theirs. */
  .gp-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .gp-view[hidden] { display: none; }

  /* The head of a drilled-into group. The way back comes before the title rather than after it: it is
     the first thing you want when you arrive somewhere you did not mean to be, and a row you read
     left to right should start with where you are standing. The actions sit on the baseline of the
     counts rather than centred on a head three lines tall, which would float them beside the title. */
  .gp-head { align-items: flex-end; }
  /* one column, capped at the head's width: an auto track would size to the title's mirror and carry
     a long name straight off the side of the panel. */
  .gp-id { min-width: 0; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gp-back {
    justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin: 0 0 2px -8px;
    padding: 2px 8px; border-radius: 8px; font-size: 13px; line-height: 18px; color: var(--muted);
    transition: color .12s ease, background-color .12s ease;
  }
  .gp-back:hover { color: var(--ink-soft); background: var(--wash); }
  .gp-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .gp-back svg { --sz: 14; width: 14px; height: 14px; transform: rotate(90deg); }
  /* the title is the group, so it is a field that looks like a heading until you reach for it — the
     same gesture names it and renames it, which is how an automation is made. It is also as wide as
     the name in it, by the same mirror the rule name uses: a hidden copy of the value shares the grid
     cell and sets the column, and size="1" is what lets the box shrink to it, an input's intrinsic
     width being twenty characters whatever the mirror says. */
  .gp-name {
    justify-self: start; display: inline-grid; grid-template-columns: minmax(0, max-content);
    align-items: center; min-width: 0; max-width: 100%;
    font-size: 28px; line-height: 36px; font-weight: 420; letter-spacing: 0;
    /* the field's own padding is pulled back so the title's first letter sits over the counts below
       it, and by transform rather than a negative margin: a margin comes off the box's width too, and
       the box is the mirror's width exactly, so the name lost its last letter to it. */
    transform: translateX(-10px);
  }
  .gp-name::after {
    content: attr(data-v); grid-area: 1 / 1; visibility: hidden; white-space: pre;
    padding: 2px 10px; border: 1px solid transparent;
  }
  .gp-title {
    grid-area: 1 / 1; width: 100%; min-width: 0; padding: 2px 10px; margin: 0; font: inherit;
    color: var(--ink);
    background: transparent; border: 1px solid transparent; border-radius: 10px;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
  }
  .gp-title::placeholder { color: var(--muted-2); }
  .gp-title:hover { background: var(--page); border-color: var(--accent-line); }
  .gp-title:focus { outline: none; background: var(--page); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
  .gp-sub { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  @media (prefers-reduced-motion: reduce) { .gp-back, .gp-title { transition: none; } }
  /* The lists carry a toolbar of filter chips under the head. A group has one search field and one
     button, which fit on the head row itself, so there is no toolbar here at all and the table
     follows the counts directly. */
  .gp-head ~ .scroll { padding-top: 16px; }
