/* Starruk Library. Reads only --s-* tokens (fonts, colours and sizes come from the profile via ThemeCss).
   Every component exposes its own tokens (--s-<component>-<property>) with a library default, so a
   platform adjusts a component through its profile's ComponentTokens and never through its own stylesheet.

   Shape language: Fluent 2, with the values of Fluent UI React v9 (@fluentui/tokens):
   - type ramp caption 12/16, body 14/20, subtitle 16/22, title 24/32 and 28/36; weights 400 and 600
   - spacing 2 4 6 8 10 12 16 20 24 32; strokes 1px, 2px, 3px
   - corners only through the --s-radius-* tokens (control, card, small, dialog, bar, round): the profile's shape
     sets them, Fluent values when rounded and 0 when square; a component token is the way out per component
   - elevation shadow 2/4/8/16/28; motion 100ms and 200ms on the easy-ease and decelerate curves
   The Starruk twist is colour only: navy app bar and brand ramp, koraal indicator, accent and focus. */

.s-app {
    --s-ease: cubic-bezier(.33, 0, .67, 1);
    --s-ease-out: cubic-bezier(.1, .9, .2, 1);
    --s-dur-fast: 100ms;
    --s-dur: 200ms;
    --s-shadow-2: 0 0 2px var(--s-shadow-ambient), 0 1px 2px var(--s-shadow-key);
    --s-shadow-4: 0 0 2px var(--s-shadow-ambient), 0 2px 4px var(--s-shadow-key);
    --s-shadow-8: 0 0 2px var(--s-shadow-ambient), 0 4px 8px var(--s-shadow-key);
    --s-shadow-16: 0 0 2px var(--s-shadow-ambient), 0 8px 16px var(--s-shadow-key);
    --s-shadow-28: 0 0 8px var(--s-shadow-ambient), 0 14px 28px var(--s-shadow-key);
    /* Avatar colours: Fluent palette, background 2 with foreground 2 (cornflower, teal, grape, pumpkin, forest, steel, lavender, marigold). */
    --s-avatar-1-bg: #c8d1fa; --s-avatar-1-fg: #2c3c85;
    --s-avatar-2-bg: #9bd9db; --s-avatar-2-fg: #02494c;
    --s-avatar-3-bg: #d9a7e0; --s-avatar-3-fg: #4c0d55;
    --s-avatar-4-bg: #efc4ad; --s-avatar-4-fg: #712d09;
    --s-avatar-5-bg: #bdd99b; --s-avatar-5-fg: #294903;
    --s-avatar-6-bg: #94c8d4; --s-avatar-6-fg: #00333f;
    --s-avatar-7-bg: #d2ccf8; --s-avatar-7-fg: #3f3682;
    --s-avatar-8-bg: #f9e2ae; --s-avatar-8-fg: #835b00;
    min-height: 100vh;
    background: var(--s-bg);
    color: var(--s-ink);
    font-family: var(--s-font-body);
    font-size: var(--s-fs-body);
    line-height: var(--s-lh-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}
.s-app[data-theme="dark"] {
    --s-avatar-1-bg: #2c3c85; --s-avatar-1-fg: #c8d1fa;
    --s-avatar-2-bg: #02494c; --s-avatar-2-fg: #9bd9db;
    --s-avatar-3-bg: #4c0d55; --s-avatar-3-fg: #d9a7e0;
    --s-avatar-4-bg: #712d09; --s-avatar-4-fg: #efc4ad;
    --s-avatar-5-bg: #294903; --s-avatar-5-fg: #bdd99b;
    --s-avatar-6-bg: #00333f; --s-avatar-6-fg: #94c8d4;
    --s-avatar-7-bg: #3f3682; --s-avatar-7-fg: #d2ccf8;
    --s-avatar-8-bg: #835b00; --s-avatar-8-fg: #f9e2ae;
}
.s-app *, .s-app *::before, .s-app *::after { box-sizing: border-box; }
.s-app a { color: var(--s-brand); text-decoration: none; }
.s-app a:hover { text-decoration: underline; }
/* The placeholder of a list that loads does not scroll: there is nothing to reach in it yet. */
.s-lp-grid[aria-busy="true"] { overflow: hidden; }
/* A link in running text is underlined: colour alone does not tell it from the text around it (WCAG 1.4.1). */
.s-app :is(p, .s-prose, .s-markdown) a:not(.s-btn), .s-app a.s-markdown-link { text-decoration: underline; text-underline-offset: 2px; }
.s-app b, .s-app strong { font-weight: 600; }
/* Fluent focus: a 2px stroke just outside the control. */
.s-app :focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
/* A frame with Tab inside it: marked by starruk-frames.js, because :focus-visible does not reach into another document. */
.s-app iframe.s-frame-focus { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-icon { flex: none; display: block; }

/* Text helpers: the type ramp and ink steps for content a page writes itself. */
.s-caption { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-subtitle { font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-figure { font-family: var(--s-font-display); font-size: var(--s-fs-figure); line-height: var(--s-lh-figure); font-weight: 600; font-variant-numeric: tabular-nums; }
.s-strong { font-weight: 600; }
.s-subtle { color: var(--s-ink-2); }
.s-muted { color: var(--s-ink-3); }
.s-num { font-variant-numeric: tabular-nums; }
.s-mono { font-family: var(--s-font-mono); }
.s-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.s-grow { flex: 1; min-width: 0; }
/* Text for screen readers only, e.g. the header of an actions column. */
.s-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.s-code { margin: 0; padding: var(--s-pad-sm) var(--s-pad); border-radius: var(--s-radius-control); background: var(--s-fill); color: var(--s-ink-2);
          font-family: var(--s-font-mono); font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-x: auto; }

/* Tones: a status, brand or accent sets --s-tone and --s-tone-tint for whatever carries the class. */
.s-tone-neutral { --s-tone: var(--s-ink-2); --s-tone-tint: var(--s-selected); }
.s-tone-brand { --s-tone: var(--s-brand); --s-tone-tint: var(--s-brand-tint); }
.s-tone-accent { --s-tone: var(--s-accent-text); --s-tone-tint: var(--s-accent-soft); }
.s-tone-done { --s-tone: var(--s-done); --s-tone-tint: var(--s-done-tint); }
.s-tone-late { --s-tone: var(--s-late); --s-tone-tint: var(--s-late-tint); }
.s-tone-human { --s-tone: var(--s-human); --s-tone-tint: var(--s-human-tint); }
.s-tone-auto { --s-tone: var(--s-auto); --s-tone-tint: var(--s-auto-tint); }
.s-tone-external { --s-tone: var(--s-external); --s-tone-tint: var(--s-external-tint); }

/* Stack and grid */
.s-stack { display: flex; flex-direction: column; min-width: 0; }
.s-stack-row { flex-direction: row; align-items: center; }
.s-wrap { flex-wrap: wrap; }
.s-gap-none { gap: 0; } .s-gap-xsmall { gap: 4px; } .s-gap-small { gap: 8px; } .s-gap-medium { gap: 12px; } .s-gap-large { gap: var(--s-gap); } .s-gap-xlarge { gap: 24px; }
.s-align-start { align-items: flex-start; } .s-align-center { align-items: center; } .s-align-end { align-items: flex-end; } .s-align-baseline { align-items: baseline; }
.s-stack-row.s-align-stretch { align-items: stretch; }
.s-justify-center { justify-content: center; } .s-justify-end { justify-content: flex-end; } .s-justify-between { justify-content: space-between; }
.s-grid { display: grid; gap: var(--s-gap); align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--s-grid-min, 280px)), 1fr)); min-width: 0; }
.s-grid-fixed { grid-template-columns: minmax(0, 1fr); }
.s-grid-tight { gap: var(--s-pad-sm); }
.s-grid-stretch { align-items: stretch; }
@media (min-width: 1080px) { .s-grid-fixed { grid-template-columns: var(--s-grid-cols); } }

/* Shell: app bar */
.s-shell { display: flex; flex-direction: column; min-height: 100vh; }
.s-skip { position: absolute; left: 8px; top: -64px; z-index: 50; padding: 8px 12px; border-radius: var(--s-radius-control); background: var(--s-surface); color: var(--s-ink) !important; box-shadow: var(--s-shadow-8); }
.s-skip:focus { top: 8px; }
.s-appbar { position: sticky; top: 0; z-index: 20; flex: none; box-sizing: content-box; height: var(--s-appbar-h); padding-top: env(safe-area-inset-top, 0px); display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, 468px) minmax(max-content, 1fr);
            align-items: center; column-gap: 16px; background: var(--s-appbar); color: var(--s-on-appbar); }
.s-appbar :focus-visible { outline-color: var(--s-on-appbar); outline-offset: -2px; }
.s-appbar-start { display: flex; align-items: center; align-self: stretch; min-width: 0; }
.s-appbar-end { display: flex; align-items: center; justify-content: flex-end; align-self: stretch; min-width: 0; padding-right: 4px; }
.s-appbar-search { min-width: 0; }
.s-appbar-btn { flex: none; width: var(--s-appbar-h); height: var(--s-appbar-h); display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--s-on-appbar) !important;
                text-decoration: none !important; cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
.s-appbar-btn:hover { background: color-mix(in srgb, var(--s-on-appbar) 12%, transparent); }
.s-appbar-btn:active { background: color-mix(in srgb, var(--s-on-appbar) 20%, transparent); }
.s-appbar-brand { display: flex; align-items: center; gap: 12px; align-self: stretch; padding: 0 12px 0 4px; color: var(--s-on-appbar) !important; text-decoration: none !important; white-space: nowrap; }
.s-appbar-brand:first-child { padding-left: var(--s-page-pad-x); }
.s-appbar-logo { height: var(--s-appbar-logo-h, 18px); display: block; }
.s-appbar-name { font-family: var(--s-font-display); font-weight: 600; font-size: 16px; line-height: 22px; }
.s-appbar-product { font-family: var(--s-font-display); font-size: 16px; line-height: 22px; font-weight: 600; padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--s-on-appbar) 32%, transparent); }
.s-topnav { display: flex; align-self: stretch; margin-left: 12px; min-width: 0; }
.s-topnav-item { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--s-on-appbar-muted) !important; text-decoration: none !important; white-space: nowrap;
                 transition: background var(--s-dur-fast) var(--s-ease), color var(--s-dur-fast) var(--s-ease); }
.s-topnav-item:hover { color: var(--s-on-appbar) !important; background: color-mix(in srgb, var(--s-on-appbar) 10%, transparent); }
.s-topnav-item.is-active { color: var(--s-on-appbar) !important; font-weight: 600; }
.s-topnav-item.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: var(--s-radius-bar) var(--s-radius-bar) 0 0; background: var(--s-accent); }

/* Shell: side navigation (Fluent nav: 40px hamburger row, 4px corners, indicator bar on the selected item) */
.s-body { flex: 1; display: flex; min-height: 0; }
.s-sidenav { position: sticky; top: var(--s-appbar-h); align-self: flex-start; flex: none; width: var(--s-nav-w); height: calc(100vh - var(--s-appbar-h)); overflow-x: hidden; overflow-y: auto;
             padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 2px; background: var(--s-nav); border-right: 1px solid var(--s-line); transition: width var(--s-dur) var(--s-ease-out); }
.s-sidenav.is-collapsed { width: 56px; }
.s-sidenav-toggle { flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-2); cursor: pointer;
                    transition: background var(--s-dur-fast) var(--s-ease); }
.s-sidenav-toggle:hover { background: var(--s-fill); color: var(--s-ink); }
.s-sidenav-toggle:active { background: var(--s-pressed); }
.s-sidenav-group { flex: none; height: 32px; display: flex; align-items: flex-end; padding: 0 10px 6px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; color: var(--s-ink-3); white-space: nowrap; }
.s-sidenav.is-collapsed .s-sidenav-group { height: 17px; margin: 0 6px; padding: 0; border-bottom: 1px solid var(--s-line); }
.s-sidenav.is-collapsed .s-sidenav-group span { display: none; }
.s-sidenav-item { position: relative; flex: none; display: flex; align-items: center; gap: var(--s-nav-gap); height: var(--s-nav-item-h); padding: 0 10px; border-radius: var(--s-radius-control);
                  color: var(--s-ink-2) !important; text-decoration: none !important; white-space: nowrap; transition: background var(--s-dur-fast) var(--s-ease); }
.s-sidenav-item:hover { background: var(--s-fill); color: var(--s-ink) !important; }
.s-sidenav-item:active { background: var(--s-pressed); }
.s-sidenav-item.is-active { background: var(--s-selected); color: var(--s-ink) !important; font-weight: 600; }
.s-sidenav-item.is-current-app { font-weight: 600; color: var(--s-ink) !important; }
.s-sidenav-check { display: inline-flex; margin-left: auto; color: var(--s-ink-2); }
.s-sidenav-item.is-active::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: var(--s-radius-bar); background: var(--s-indicator); }
.s-sidenav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.s-sidenav.is-collapsed .s-sidenav-label { display: none; }
.s-sidenav.is-collapsed .s-counter { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
.s-sidenav-foot { margin-top: auto; padding: 8px 10px 0; border-top: 1px solid var(--s-line); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); white-space: nowrap; overflow: hidden; }
.s-sidenav.is-collapsed .s-sidenav-foot { display: none; }
.s-main { flex: 1; min-width: 0; padding: var(--s-page-pad-y) max(var(--s-page-pad-x), env(safe-area-inset-right, 0px)) calc(var(--s-page-pad-y) * 2 + env(safe-area-inset-bottom, 0px))
                                           max(var(--s-page-pad-x), env(safe-area-inset-left, 0px)); }
.s-main-inner { max-width: var(--s-content-max); display: flex; flex-direction: column; gap: var(--s-gap); }
.s-app[data-content="centered"] .s-main-inner { margin-inline: auto; }
/* The menu button, the head of the drawer, the apps in the navigation, "Meer" in the app bar and the backdrops are
   for the phone only. On a wide screen what a platform added to the bar stands in the bar itself. */
.s-appbar-nav, .s-appbar-more, .s-appbar-btn-label, .s-appbar-tools-backdrop, .s-sidenav-head, .s-sidenav-apps, .s-sidenav.is-phone-only { display: none; }
.s-appbar-tools { display: contents; }
/* The backdrop is there for as long as the drawer is open, on any screen: the bar and the work area are inert then,
   and a click on it closes the drawer. A window that grew wide with the drawer open (a tablet turned on its side)
   has no drawer to show; the navigation stands above the backdrop there, so nothing is ever out of reach for good. */
.s-sidenav-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .4); touch-action: none; animation: s-fade-in var(--s-dur-fast) linear; }
/* A backdrop closes what is open: it shows a hand, and starruk-aria.js gives it the listener Safari needs for a tap. */
:is(.s-sidenav-backdrop, .s-appbar-tools-backdrop, .s-launcher-backdrop, .s-acctmenu-backdrop, .s-envmenu-backdrop, .s-picker-backdrop, .s-sheet-backdrop, .s-cmdk-backdrop, .s-ctx-backdrop, .s-drawer-backdrop, .s-treeselect-backdrop) { cursor: pointer; }
.s-sidenav.is-open { z-index: 31; }
/* A phone (docs/library/responsive.md). The navigation is a drawer over the whole height of the screen, on top of
   the app bar, with a head of its own (the logo and a close button) and the other apps at its foot. It scrolls by
   itself and the page behind it stands still. Every destination is there with its name.
   The app bar keeps four things: the menu, the logo, the search and the account. The search is an icon until it is
   tapped; what a platform added to the bar is a list under "Meer". */
@media (max-width: 860px) {
    .s-appbar { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 0; padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
    .s-topnav, .s-appbar-launcher { display: none; }
    .s-appbar-nav, .s-appbar-more { display: inline-grid; }
    .s-appbar-brand, .s-appbar-brand:first-child { min-width: 0; padding-left: 4px; }
    .s-appbar-logo { max-width: 100%; }
    .s-appbar-end { padding-right: 0; }

    /* Search. The box is as large as its icon and its field lies see-through over it, so a tap lands in the field
       itself: the browser gives it the cursor and the keyboard at once, without a round trip to the server. With
       the cursor or with text in it, it takes the place of the logo, between the menu and what stands at the end;
       empty and left alone it is the icon again. Nothing ever lies under it. */
    .s-appbar-search .s-search-appbar { width: var(--s-appbar-h); height: var(--s-appbar-h); padding: 0; justify-content: center; border-color: transparent; background: transparent; }
    .s-appbar-search .s-search-appbar::after { content: none; }
    .s-appbar-search .s-search-appbar > .s-icon { color: var(--s-on-appbar); }
    .s-appbar-search .s-search-appbar .s-input-el { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
    .s-appbar:has(.s-search-appbar:focus-within, .s-search-appbar .s-input-el:not(:placeholder-shown)) { grid-template-columns: auto minmax(0, 1fr) auto; }
    .s-appbar:has(.s-search-appbar:focus-within, .s-search-appbar .s-input-el:not(:placeholder-shown)) .s-appbar-brand { display: none; }
    .s-appbar:has(.s-search-appbar:focus-within, .s-search-appbar .s-input-el:not(:placeholder-shown)) .s-search-appbar {
        width: auto; height: calc(var(--s-appbar-h) - 4px); margin: 0 4px; padding: 0 10px; justify-content: flex-start; background: var(--s-surface); }
    .s-appbar:has(.s-search-appbar:focus-within, .s-search-appbar .s-input-el:not(:placeholder-shown)) .s-search-appbar > .s-icon { color: var(--s-ink-2); }
    .s-appbar:has(.s-search-appbar:focus-within, .s-search-appbar .s-input-el:not(:placeholder-shown)) .s-search-appbar .s-input-el { position: static; opacity: 1; cursor: text; }
    .s-appbar-search .s-search-appbar .s-input-el::-webkit-search-cancel-button { appearance: auto; }

    /* "Meer": what a platform added to the bar, one under the other, each with its name. Closed, none of it is
       there. A drawer that one of them opened (the notifications of the bell) is not one of them: it lies over the
       page and stays, also when the list closes behind the choice. */
    .s-appbar-tools:not(.is-open) > :not(.s-drawer-layer) { display: none; }
    .s-appbar-tools.is-open { position: absolute; z-index: 3; top: calc(100% + 4px); right: max(8px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 2px;
                              min-width: 224px; max-width: calc(100vw - 16px); max-height: calc(100dvh - var(--s-appbar-h) - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 4px;
                              border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-16); }
    .s-appbar-tools .s-appbar-btn { width: auto; min-height: 48px; height: auto; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: var(--s-radius-control);
                                    color: var(--s-ink) !important; font: inherit; text-align: left; }
    .s-appbar-tools .s-appbar-btn:hover { background: var(--s-fill); }
    .s-appbar-tools .s-appbar-btn:active { background: var(--s-pressed); }
    .s-appbar-tools .s-appbar-btn > .s-icon { color: var(--s-ink-2); }
    .s-appbar-tools .s-appbar-btn-label { display: block; }
    .s-appbar-tools .s-select-appbar { width: 100%; color: var(--s-ink); }
    .s-appbar-tools .s-select-appbar > .s-icon { color: var(--s-ink-3); }
    .s-appbar-tools :focus-visible { outline-color: var(--s-focus); }
    /* Under the bar, so its buttons stay within reach; a tap anywhere on the page closes the list. */
    .s-appbar-tools-backdrop { display: block; position: fixed; inset: 0; z-index: 19; }

    /* The drawer. Its height comes from top and bottom: the wide shell's align-self would make it as high as its
       items and push it over the top of a screen that is lower than that. */
    .s-sidenav, .s-sidenav.is-collapsed, .s-sidenav.is-phone-only { position: fixed; top: 0; left: 0; bottom: 0; z-index: 31; align-self: auto; display: flex;
                                                                    width: calc(min(320px, 100vw - 56px) + env(safe-area-inset-left, 0px)); height: auto;
                                                                    padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px)); overscroll-behavior: contain;
                                                                    border-right: 0; box-shadow: var(--s-shadow-28); visibility: hidden; transform: translateX(-100%);
                                                                    transition: transform var(--s-dur) var(--s-ease-out), visibility 0s linear var(--s-dur); }
    .s-sidenav.is-open { visibility: visible; transform: none; transition: transform var(--s-dur) var(--s-ease-out); }
    .s-app .s-sidenav:focus-visible { outline: none; }
    .s-sidenav-toggle { display: none; }
    .s-sidenav-head { position: sticky; top: 0; z-index: 1; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
                      height: calc(var(--s-appbar-h) + env(safe-area-inset-top, 0px)); margin: 0 -8px 6px calc(-8px - env(safe-area-inset-left, 0px));
                      padding: env(safe-area-inset-top, 0px) 0 0 calc(16px + env(safe-area-inset-left, 0px)); background: var(--s-appbar); color: var(--s-on-appbar); }
    .s-sidenav-head :focus-visible { outline-color: var(--s-on-appbar); outline-offset: -2px; }
    .s-sidenav-brand { display: flex; align-items: center; gap: 12px; min-width: 0; white-space: nowrap; overflow: hidden; }
    /* Folded to icons is a choice for a wide screen; the drawer always shows the names. */
    .s-sidenav.is-collapsed .s-sidenav-label { display: block; }
    .s-sidenav.is-collapsed .s-sidenav-group { height: 32px; margin: 0; padding: 0 10px 6px; border-bottom: 0; }
    .s-sidenav.is-collapsed .s-sidenav-group span { display: inline; }
    .s-sidenav.is-collapsed .s-counter { position: static; min-width: 20px; height: 20px; padding: 0 6px; font-size: var(--s-fs-caption); }
    .s-sidenav.is-collapsed .s-sidenav-foot { display: block; }
    .s-sidenav-apps { flex: none; display: flex; flex-direction: column; gap: 2px; }
    .s-sidenav-foot { flex: none; margin-top: auto; white-space: normal; }
    /* The page behind an open drawer stands still. */
    html:has(.s-sidenav.is-open) { overflow: hidden; }
}
/* A narrow phone: the logo says which platform this is (the drawer has room for the product's name), and the page
   takes less of the width and of the height for its margins. */
@media (max-width: 560px) {
    .s-appbar-product { display: none; }
    .s-sidenav-brand .s-appbar-product { display: block; }
    .s-app .s-shell { --s-page-pad-x: 16px; --s-page-pad-y: 12px; }
}

/* App launcher: the panel behind the grid button, as in Microsoft 365 */
.s-launcher-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .4); animation: s-fade-in var(--s-dur-fast) linear; }
.s-launcher { position: fixed; top: 0; left: 0; bottom: 0; z-index: 41; width: 320px; max-width: 100vw; display: flex; flex-direction: column; background: var(--s-surface); color: var(--s-ink);
              box-shadow: var(--s-shadow-28); animation: s-slide-in var(--s-dur) var(--s-ease-out); }
.s-launcher-head { flex: none; height: var(--s-appbar-h); display: flex; align-items: center; gap: 4px; }
.s-launcher-close { width: var(--s-appbar-h); height: var(--s-appbar-h); display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--s-ink); cursor: pointer; }
.s-launcher-close:hover { background: var(--s-fill); }
.s-launcher-title { font-family: var(--s-font-display); font-size: 16px; line-height: 22px; font-weight: 600; }
.s-launcher-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.s-launcher-app { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--s-radius-control); color: var(--s-ink) !important; text-decoration: none !important; }
.s-launcher-app:hover { background: var(--s-fill); }
.s-launcher-app.is-current { background: var(--s-selected); }
.s-launcher-tile { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--s-radius-control); background: var(--s-primary); color: var(--s-on-primary); }
.s-launcher-app.is-current .s-launcher-tile { background: var(--s-accent); color: var(--s-on-accent); }
.s-launcher-text { display: flex; flex-direction: column; min-width: 0; }
.s-launcher-name { font-weight: 600; }
.s-launcher-desc { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
@keyframes s-slide-in { from { transform: translateX(-24px); opacity: 0; } }
@keyframes s-fade-in { from { opacity: 0; } }

/* Breadcrumb and page header */
.s-crumbs ol { list-style: none; margin: 0 0 0 -6px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.s-crumbs li { display: inline-flex; align-items: center; }
.s-crumb { display: inline-flex; align-items: center; height: 24px; padding: 0 6px; border-radius: var(--s-radius-control); color: var(--s-ink-2) !important; text-decoration: none !important; }
a.s-crumb:hover { background: var(--s-fill); color: var(--s-ink) !important; }
a.s-crumb:active { background: var(--s-pressed); }
.s-crumb.is-current { color: var(--s-ink) !important; font-weight: 600; }
.s-crumb-sep { color: var(--s-ink-3); }
.s-pagehead { display: flex; flex-direction: column; gap: 2px; }
.s-pagehead-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.s-pagehead-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.s-pagehead-titleline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.s-pagehead-title { margin: 0; font-family: var(--s-font-display); font-size: var(--s-pagehead-title-size, var(--s-fs-title)); line-height: var(--s-lh-title); font-weight: var(--s-pagehead-title-weight, 600); }
/* FocusOnNavigate moves focus to the title for screen readers; it is not a control, so no ring. */
.s-pagehead-title:focus { outline: none; }
.s-pagehead-meta { color: var(--s-ink-3); }
.s-pagehead-summary { margin: 0; color: var(--s-ink-2); max-width: 96ch; }
.s-pagehead-summary b { color: var(--s-ink); }
.s-pagehead-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Button (Fluent: 32px, 96px minimum, 12px padding, 6px icon gap, semibold) */
.s-btn { appearance: none; margin: 0; font-family: inherit; font-size: var(--s-fs-control); line-height: var(--s-lh-body); font-weight: 600; height: var(--s-control-h); min-width: var(--s-button-min-w, 96px);
         padding: 0 var(--s-button-pad-x, 12px); display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--s-line-strong);
         border-radius: var(--s-button-radius, var(--s-radius-control)); background-color: var(--s-surface); color: var(--s-ink) !important; text-decoration: none !important; white-space: nowrap; cursor: pointer; user-select: none;
         transition: background-color var(--s-dur-fast) var(--s-ease), border-color var(--s-dur-fast) var(--s-ease), color var(--s-dur-fast) var(--s-ease); }
.s-btn:hover { background-image: linear-gradient(var(--s-fill), var(--s-fill)); border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); }
.s-btn:active { background-image: linear-gradient(var(--s-pressed), var(--s-pressed)); }
.s-btn-sm { height: var(--s-control-h-sm); min-width: var(--s-button-min-w-sm, 64px); padding: 0 8px; gap: 4px; font-size: var(--s-fs-control-sm, 12px); font-weight: var(--s-fw-control-sm, 400); }
.s-btn-lg { height: var(--s-control-h-lg); padding: 0 16px; font-size: 16px; line-height: 22px; }
.s-btn-icononly { min-width: 0; width: var(--s-control-h); padding: 0; }
.s-btn-icononly.s-btn-sm { min-width: 0; width: var(--s-control-h-sm); }
.s-btn-icononly.s-btn-lg { width: var(--s-control-h-lg); }
/* On a phone a button never pushes the page wide: a label longer than the room it has goes onto a second line.
   After the sizes, so their fixed height and padding do not win again. */
@media (max-width: 560px) {
    .s-btn { max-width: 100%; white-space: normal; height: auto; min-height: var(--s-control-h); padding-block: 4px; text-align: inherit; }
    .s-btn-sm { height: auto; min-height: var(--s-control-h-sm); padding-block: 2px; }
    .s-btn-lg { height: auto; min-height: var(--s-control-h-lg); padding-block: 4px; }
}
.s-btn-primary { background-color: var(--s-primary); border-color: transparent; color: var(--s-on-primary) !important; }
.s-btn-primary:hover { background-color: var(--s-primary-hover); background-image: none; border-color: transparent; }
.s-btn-primary:active { background-color: var(--s-primary-pressed); background-image: none; }
.s-btn-accent { background-color: var(--s-accent); border-color: transparent; color: var(--s-on-accent) !important; }
.s-btn-accent:hover { background-color: var(--s-accent-hover); background-image: none; border-color: transparent; }
.s-btn-accent:active { background-color: color-mix(in srgb, var(--s-accent-hover) 90%, #000); background-image: none; }
/* Subtle: no border or fill until hover; the icon then takes the brand colour, as in a Fluent toolbar. */
.s-btn-subtle { background-color: transparent; border-color: transparent; color: var(--s-ink-2) !important; }
.s-btn-subtle:hover { background-color: var(--s-fill); background-image: none; border-color: transparent; color: var(--s-ink) !important; }
.s-btn-subtle:hover .s-icon { color: var(--s-brand); }
.s-btn-subtle:active { background-color: var(--s-pressed); background-image: none; }
.s-btn-danger { color: var(--s-late) !important; }
.s-btn-danger:hover { background-image: linear-gradient(var(--s-late-tint), var(--s-late-tint)); border-color: var(--s-late); }
.s-btn:disabled, .s-btn:disabled:hover { background-color: var(--s-fill); background-image: none; border-color: var(--s-line); color: var(--s-ink-disabled) !important; cursor: not-allowed; }
.s-btn:disabled .s-icon { color: inherit; }
.s-btn-subtle:disabled, .s-btn-subtle:disabled:hover { background-color: transparent; border-color: transparent; }

/* Input (Fluent: thin stroke, darker bottom stroke, a 2px underline that grows from the centre on focus) */
.s-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.s-field-label { color: var(--s-ink); }
.s-field-req { color: var(--s-late); }
.s-input { position: relative; display: flex; align-items: center; gap: 6px; height: var(--s-control-h); min-width: 0; padding: 0 10px; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible);
           border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); color: var(--s-ink); }
.s-input:hover { border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); border-bottom-color: var(--s-ink-2); }
.s-input::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: max(2px, var(--s-input-radius, var(--s-radius-control))); border-bottom: 2px solid var(--s-focus);
                  border-radius: 0 0 var(--s-input-radius, var(--s-radius-control)) var(--s-input-radius, var(--s-radius-control)); clip-path: inset(calc(100% - 2px) 0 0 0); transform: scaleX(0);
                  transition: transform 1ms; pointer-events: none; }
.s-input:focus-within::after { transform: scaleX(1); transition: transform var(--s-dur) var(--s-ease-out); }
.s-input > .s-icon { color: var(--s-ink-3); }
.s-input-el { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; font-family: inherit; font-size: var(--s-fs-control); line-height: var(--s-lh-body); }
.s-app .s-input-el:focus-visible { outline: none; }
.s-input-el::placeholder { color: var(--s-ink-3); opacity: 1; }
.s-input-el::-webkit-search-cancel-button { appearance: none; }
.s-input-el.is-mono { font-family: var(--s-font-mono); }
.s-input.is-readonly { background: transparent; border-color: var(--s-line); }
.s-field.is-error .s-input { border-color: var(--s-late); }
.s-field-help { display: flex; align-items: flex-start; gap: 4px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
.s-field.is-error .s-field-help { color: var(--s-late); }
/* Search in the app bar: the Microsoft 365 header box, light on the brand colour and solid on focus. */
.s-search-appbar { border-color: transparent; background: color-mix(in srgb, var(--s-surface) 82%, transparent); transition: background var(--s-dur-fast) var(--s-ease); }
.s-search-appbar:hover { border-color: transparent; background: color-mix(in srgb, var(--s-surface) 92%, transparent); }
.s-search-appbar:focus-within { background: var(--s-surface); }
.s-search-appbar > .s-icon, .s-search-appbar .s-input-el::placeholder { color: var(--s-ink-2); }

/* Select (Fluent dropdown) */
.s-select { position: relative; display: inline-flex; align-items: center; height: var(--s-control-h); min-width: 0; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible);
            border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); color: var(--s-ink); }
.s-select:hover { border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); border-bottom-color: var(--s-ink-2); }
.s-select:focus-within { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-select-el { appearance: none; width: 100%; height: 100%; padding: 0 32px 0 10px; border: 0; border-radius: inherit; background: transparent; color: inherit; font-family: inherit; font-size: var(--s-fs-control); cursor: pointer; }
.s-app .s-select-el:focus-visible { outline: none; }
.s-select-el option { background: var(--s-surface); color: var(--s-ink); }
.s-select > .s-icon { position: absolute; left: 8px; pointer-events: none; color: var(--s-ink-3); }
.s-select > .s-select-chevron { left: auto; right: 6px; }
.s-select.has-icon .s-select-el { padding-left: 34px; }
.s-select-appbar { border-color: transparent; background: transparent; color: var(--s-on-appbar); }
.s-select-appbar:hover { border-color: transparent; background: color-mix(in srgb, var(--s-on-appbar) 12%, transparent); }
.s-select-appbar:focus-within { outline-color: var(--s-on-appbar); outline-offset: -2px; }
.s-select-appbar > .s-icon { color: var(--s-on-appbar-muted); }

/* Badge and status chip (Fluent badge, tint appearance: 20px, caption strong, a soft edge in its own colour) */
.s-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--s-tone) 24%, transparent); border-radius: var(--s-chip-radius, var(--s-radius-control));
          background: var(--s-tone-tint); color: var(--s-tone); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; white-space: nowrap; }
/* The number of a step in a status flow, before its word: quieter, in tabular figures so a column lines up. */
.s-chip-code { font-variant-numeric: tabular-nums; font-weight: 400; opacity: .8; }
.s-chip-filled { border-color: transparent; background: var(--s-tone); color: var(--s-surface); }
.s-chip-filled.s-tone-brand { background: var(--s-primary); color: var(--s-on-primary); }
.s-chip-filled.s-tone-accent { background: var(--s-accent); color: var(--s-on-accent); }
.s-chip-outline { background: transparent; border-color: currentColor; }
/* A status in a selected row: its tint lies on the surface, as everywhere else, not on the selection tint, so the word keeps its contrast. */
.is-selected .s-chip:not(.s-chip-filled):not(.s-chip-outline) { background: linear-gradient(var(--s-tone-tint), var(--s-tone-tint)) var(--s-surface); }
.s-counter { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--s-radius-round); background: var(--s-selected); color: var(--s-ink-2);
             font-family: var(--s-font-body); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; font-variant-numeric: tabular-nums; }
.s-counter-accent { background: var(--s-accent); color: var(--s-on-accent); }
.s-counter-brand { background: var(--s-primary); color: var(--s-on-primary); }
.s-counter-done { background: var(--s-done-tint); color: var(--s-done); } .s-counter-late { background: var(--s-late-tint); color: var(--s-late); }
.s-counter-human { background: var(--s-human-tint); color: var(--s-human); } .s-counter-auto { background: var(--s-auto-tint); color: var(--s-auto); }
.s-counter-external { background: var(--s-external-tint); color: var(--s-external); }

/* Avatar and persona (Fluent: 32px default, initials semibold; square for things that are not people) */
.s-avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--s-radius-round); font-size: 14px; line-height: 1; font-weight: 600; user-select: none; }
.s-avatar.is-square { border-radius: var(--s-radius-control); }
.s-avatar-20 { width: 20px; height: 20px; font-size: 10px; } .s-avatar-24 { width: 24px; height: 24px; font-size: 10px; } .s-avatar-28 { width: 28px; height: 28px; font-size: 12px; }
.s-avatar-40 { width: 40px; height: 40px; } .s-avatar-48 { width: 48px; height: 48px; font-size: 16px; }
.s-avatar-neutral { background: var(--s-pressed); color: var(--s-ink-2); }
.s-avatar-brand { background: var(--s-primary); color: var(--s-on-primary); }
.s-avatar-accent { background: var(--s-accent); color: var(--s-on-accent); }
.s-avatar-c1 { background: var(--s-avatar-1-bg); color: var(--s-avatar-1-fg); } .s-avatar-c2 { background: var(--s-avatar-2-bg); color: var(--s-avatar-2-fg); }
.s-avatar-c3 { background: var(--s-avatar-3-bg); color: var(--s-avatar-3-fg); } .s-avatar-c4 { background: var(--s-avatar-4-bg); color: var(--s-avatar-4-fg); }
.s-avatar-c5 { background: var(--s-avatar-5-bg); color: var(--s-avatar-5-fg); } .s-avatar-c6 { background: var(--s-avatar-6-bg); color: var(--s-avatar-6-fg); }
.s-avatar-c7 { background: var(--s-avatar-7-bg); color: var(--s-avatar-7-fg); } .s-avatar-c8 { background: var(--s-avatar-8-bg); color: var(--s-avatar-8-fg); }
.s-persona { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.s-persona-text { display: flex; flex-direction: column; min-width: 0; }
.s-persona-name { color: var(--s-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-persona-sub { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Card: the Fluent surface (shadow 4 on the canvas). Blocks, item cards, KPI tiles and an elevated command bar share it. */
.s-card { min-width: 0; border-radius: var(--s-card-radius, var(--s-radius-card)); background-color: var(--s-surface); box-shadow: var(--s-card-shadow, var(--s-shadow-4)); }
.s-block-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px var(--s-pad-sm) 8px var(--s-pad); }
.s-block-head > .s-icon { color: var(--s-ink-3); }
.s-block-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-block-title { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-block-sub { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
.s-block-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.s-block-body { display: flex; flex-direction: column; gap: 12px; padding: 0 var(--s-pad) var(--s-pad); }
.s-block-body:first-child { padding-top: var(--s-pad); }
.s-block-flush { display: flex; flex-direction: column; }
.s-block-foot { padding: 10px var(--s-pad); border-top: 1px solid var(--s-line); color: var(--s-ink-3); }
.s-block > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.s-itemcard { position: relative; display: flex; flex-direction: column; gap: 12px; padding: var(--s-pad-sm); transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-itemcard.is-interactive:hover { background-image: linear-gradient(var(--s-fill), var(--s-fill)); box-shadow: var(--s-shadow-8); }
.s-itemcard.is-interactive:active { background-image: linear-gradient(var(--s-pressed), var(--s-pressed)); }
.s-itemcard:has(a.s-itemcard-title:focus-visible) { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-itemcard-head { display: flex; align-items: center; gap: 12px; }
.s-itemcard-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-itemcard-title { font-weight: 600; color: var(--s-ink) !important; text-decoration: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.s-itemcard-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.s-app a.s-itemcard-title:focus-visible { outline: none; }
/* The line under a card may take two lines before it is cut; the whole text is in its title. */
.s-itemcard-sub { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.s-itemcard-actions { position: relative; z-index: 1; flex: none; display: flex; gap: 4px; }
.s-itemcard-body { display: flex; flex-direction: column; gap: 8px; }
.s-itemcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }

/* KPI tile and stats */
.s-kpi { display: flex; flex-direction: column; gap: 2px; padding: var(--s-pad-sm) var(--s-pad); color: var(--s-ink) !important; text-decoration: none !important; transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-kpi:hover { box-shadow: var(--s-shadow-8); }
.s-kpi:active { box-shadow: var(--s-shadow-2); }
.s-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s-kpi-label { color: var(--s-ink-2); }
.s-kpi-icon { color: var(--s-tone); }
.s-kpi-icon.s-tone-neutral { color: var(--s-ink-3); }
.s-kpi-value { font-family: var(--s-font-display); font-size: var(--s-kpi-value-size, var(--s-fs-figure)); line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.s-kpi-note { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; color: var(--s-tone); }
.s-kpi-note.s-tone-neutral { color: var(--s-ink-3); font-weight: 400; }
.s-stats { display: flex; flex-wrap: wrap; row-gap: 12px; }
.s-stat { flex: 1; min-width: 104px; display: flex; flex-direction: column; padding: 0 var(--s-pad); border-left: 1px solid var(--s-line); }
.s-stat:first-child { padding-left: 0; border-left: 0; }
.s-stat-value { font-family: var(--s-font-display); font-size: 20px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.s-stat-label { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }

/* List item */
.s-li { display: flex; align-items: center; gap: 12px; min-height: calc(var(--s-row-h) + 12px); padding: 6px var(--s-pad); border-top: 1px solid var(--s-line); transition: background var(--s-dur-fast) var(--s-ease); }
.s-li:hover { background: var(--s-fill); }
.s-li-media { flex: none; display: flex; }
.s-li-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--s-radius-round); background: var(--s-tone-tint); color: var(--s-tone); }
.s-li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-li-title { color: var(--s-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-li-note { display: flex; gap: 4px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); white-space: nowrap; overflow: hidden; }
.s-li-note > span { overflow: hidden; text-overflow: ellipsis; }
.s-li-key { flex: none; font-weight: 600; color: var(--s-ink-2); }
.s-li-key::after { content: " ·"; font-weight: 400; color: var(--s-ink-3); }
.s-li-actions { flex: none; display: flex; gap: 4px; }

/* Progress (Fluent progress bar). Done and busy differ at least 3:1 in the light theme; the label carries the numbers. */
.s-progress { display: flex; gap: 1px; height: var(--s-progress-h, 4px); min-width: 48px; border-radius: var(--s-radius-bar); overflow: hidden; background: var(--s-selected); }
.s-progress > span { display: block; min-width: 0; }
.s-progress-done { background: var(--s-progress-done, var(--s-primary)); }
.s-progress-busy { background: var(--s-progress-busy, var(--s-ink-3)); }
.s-progress-open { background: transparent; }

/* Tabs (Fluent tab list: 44px, 3px rounded indicator inset to the text, semibold when selected) */
.s-tabs { display: flex; min-width: 0; overflow-x: auto; border-bottom: 1px solid var(--s-line); }
.s-tab { position: relative; flex: none; appearance: none; height: var(--s-tab-h); padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--s-ink-2);
         font-family: inherit; font-size: var(--s-fs-body); line-height: var(--s-lh-body); white-space: nowrap; cursor: pointer; }
.s-tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: var(--s-radius-bar); background: transparent; transition: background var(--s-dur-fast) var(--s-ease); }
.s-tab:hover { color: var(--s-ink); }
.s-tab:hover::after { background: var(--s-line-strong); }
.s-tab.is-active { color: var(--s-ink); }
.s-tab.is-active .s-tab-label { font-weight: 600; }
.s-tab.is-active::after { background: var(--s-tabs-indicator, var(--s-indicator)); }
.s-app .s-tab:focus-visible { outline-offset: -2px; border-radius: var(--s-radius-control); }
/* The hidden bold copy keeps the tab from changing width when it becomes selected. */
.s-tab-label { display: inline-flex; flex-direction: column; }
.s-tab-label::after { content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; font-weight: 600; user-select: none; pointer-events: none; }

/* Segmented: joined toggle buttons */
.s-seg { --s-seg-inner: max(0px, calc(var(--s-radius-control) - 1px)); flex: none; display: inline-flex; border: 1px solid var(--s-line-strong); border-radius: var(--s-radius-control); background: var(--s-surface); }
.s-seg-item { appearance: none; height: calc(var(--s-control-h) - 2px); min-width: calc(var(--s-control-h) - 2px); padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
              border: 0; border-left: 1px solid var(--s-line-strong); background: transparent; color: var(--s-ink-2); font-family: inherit; font-size: var(--s-fs-body); cursor: pointer;
              transition: background var(--s-dur-fast) var(--s-ease); }
.s-seg-item:first-child { border-left: 0; border-radius: var(--s-seg-inner) 0 0 var(--s-seg-inner); }
.s-seg-item:last-child { border-radius: 0 var(--s-seg-inner) var(--s-seg-inner) 0; }
.s-seg-item:hover { background: var(--s-fill); color: var(--s-ink); }
.s-seg-item:active { background: var(--s-pressed); }
.s-seg-item.is-active { background: var(--s-selected); color: var(--s-ink); font-weight: 600; }
.s-seg-item.is-active .s-icon { color: var(--s-brand); }
.s-seg-count { font-weight: 400; color: var(--s-ink-3); font-variant-numeric: tabular-nums; }

/* Command bar (Fluent toolbar: 4px 8px padding, subtle buttons) and dividers */
.s-cmdbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: calc(var(--s-control-h) + 8px); padding: 4px 8px; }
.s-cmdbar-main, .s-cmdbar-far { display: flex; align-items: center; gap: 4px; min-width: 0; }
.s-cmdbar-main { flex-wrap: wrap; }
.s-cmdbar .s-btn { min-width: 0; }
.s-cmdbar .s-search { width: 240px; }
.s-block-flush > .s-cmdbar { border-bottom: 1px solid var(--s-line); }
.s-divider { display: block; height: 1px; background: var(--s-line); }
.s-divider-v { flex: none; align-self: center; width: 1px; height: 20px; margin: 0 4px; background: var(--s-line); }

/* Table (Fluent data grid: 8px cell padding, one stroke under each row, brand tint on the selected row) */
/* Relative, so a hidden heading of a column (.s-sr) stays inside the scrolling table instead of widening the page. */
.s-table-wrap { position: relative; overflow-x: auto; }
.s-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.s-table th { height: var(--s-row-h); padding: 0 8px; text-align: left; font-weight: 600; color: var(--s-ink-2); border-bottom: 1px solid var(--s-line); white-space: nowrap; }
.s-table td { height: var(--s-row-h); padding: 0 8px; border-bottom: 1px solid var(--s-line); white-space: nowrap; }
.s-table th:first-child, .s-table td:first-child { padding-left: var(--s-pad); }
.s-table th:last-child, .s-table td:last-child { padding-right: var(--s-pad); }
.s-table tbody tr:last-child td { border-bottom: 0; }
.s-table tbody tr:hover td { background: var(--s-fill); }
.s-table tr.is-selected td, .s-table tr.is-selected:hover td { background: var(--s-brand-tint); }
.s-table tr.s-table-empty:hover td { background: transparent; }
.s-table tr.s-table-empty td { height: auto; padding: var(--s-pad); color: var(--s-ink-3); white-space: normal; }
.s-table .is-num { text-align: right; }
.s-table .is-shrink { width: 1%; }
.s-table .s-progress { flex: none; width: 120px; }
.s-th-btn { appearance: none; display: inline-flex; align-items: center; gap: 4px; height: var(--s-control-h); margin: 0 -6px; padding: 0 6px; border: 0; border-radius: var(--s-radius-control); background: transparent;
            color: inherit; font: inherit; cursor: pointer; }
.s-th-btn:hover { background: var(--s-fill); color: var(--s-ink); }
.s-table th[aria-sort] { color: var(--s-ink); }

/* Message bar (Fluent: 36px minimum, 1px stroke, status tint) */
.s-msg { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--s-tone) 30%, transparent); border-radius: var(--s-radius-control); background: var(--s-tone-tint); }
.s-msg.s-tone-neutral { border-color: var(--s-line-strong); background: var(--s-surface); }
.s-msg > .s-icon { color: var(--s-tone); }
.s-msg.s-tone-neutral > .s-icon { color: var(--s-ink-3); }
.s-msg-body { flex: 1; min-width: 0; }
.s-msg-title { margin-right: 4px; }
.s-msg-actions { flex: none; display: flex; gap: 4px; }

/* Empty state */
.s-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px var(--s-pad); text-align: center; }
.s-empty > .s-icon { margin-bottom: 4px; color: var(--s-ink-3); }
.s-empty-title { font-weight: 600; }
.s-empty-text { max-width: 48ch; color: var(--s-ink-3); }
.s-empty .s-btn { margin-top: 12px; }

/* Swatch */
.s-swatch { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.s-swatch-chip { flex: none; width: 32px; height: 32px; border-radius: var(--s-radius-control); border: 1px solid var(--s-line); }
.s-swatch-text { display: flex; flex-direction: column; min-width: 0; }
.s-swatch-value { font-family: var(--s-font-mono); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Compare: two renderings in one place, the upper one cut at a handle. The handle stands at --s-compare-at, which the
   component sets from the two range inputs: one over the whole surface for the pointer, one in steps for the keyboard. */
.s-compare { position: relative; display: grid; min-width: 0; }
/* Each rendering is a layer of its own: whatever it stacks inside (a sticky head, a menu) stays under the handle. */
.s-compare-layer { grid-area: 1 / 1; min-width: 0; isolation: isolate; }
.s-compare-after { clip-path: inset(0 0 0 var(--s-compare-at)); }
.s-compare-line { position: absolute; top: 0; bottom: 0; left: var(--s-compare-at); width: 2px; margin-left: -1px; background: var(--s-surface); box-shadow: 0 0 0 1px var(--s-line-accessible); pointer-events: none; }
.s-compare-grip { position: absolute; top: min(50%, 220px); left: clamp(18px, var(--s-compare-at), calc(100% - 18px)); width: 36px; height: 36px; margin: -18px 0 0 -18px; display: inline-flex; align-items: center; justify-content: center;
                  border: 1px solid var(--s-line-accessible); border-radius: var(--s-radius-round); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-8); pointer-events: none; }
.s-compare-grip .s-icon + .s-icon { margin-left: -6px; }
.s-compare-keys { position: absolute; top: min(50%, 220px); left: clamp(18px, var(--s-compare-at), calc(100% - 18px)); width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.s-app .s-compare-keys:focus-visible { outline: none; }
.s-compare-keys:focus-visible + .s-compare-grip { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-compare-drag { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; background: transparent; }
.s-compare-drag::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 2px; }
.s-compare-drag::-moz-range-thumb { width: 2px; height: 2px; border: 0; }
.s-compare-tag { position: absolute; top: 8px; max-width: 45%; padding: 2px 8px; border-radius: var(--s-radius-control); background: var(--s-ink); color: var(--s-surface);
                 font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; overflow-wrap: anywhere; pointer-events: none; }
.s-compare-tag.is-before { left: 8px; }
.s-compare-tag.is-after { right: 8px; }

/* ===== Inputs of the first wave: text area, number, radio, switch, combobox and its kin, time, rich text, form ===== */

/* What fields share: a foot with help left and a counter right, a sign or unit inside the box, and the look of off. */
.s-field-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.s-field-count { flex: none; margin-left: auto; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; }
.s-field-count.is-full { color: var(--s-late); font-weight: 600; }
.s-input-affix { flex: none; color: var(--s-ink-3); font-size: var(--s-fs-control); white-space: nowrap; }
.s-input:has(> .s-input-el:disabled) { border-color: var(--s-line); background: var(--s-fill); color: var(--s-ink-disabled); cursor: not-allowed; }
.s-input:has(> .s-input-el:disabled)::after { display: none; }
.s-input > .s-input-el:disabled { cursor: not-allowed; }

/* Text area: with is-growing a hidden copy of the text in the same grid cell gives the box its height */
.s-textarea-box { height: auto; padding: 0; align-items: stretch; }
.s-textarea-el { height: auto; min-height: calc(var(--s-ta-rows, 3) * 1lh + 12px); max-height: calc(var(--s-ta-max, 12) * 1lh + 12px); padding: 6px 10px; resize: vertical; overflow: auto; }
.s-textarea-box.is-growing { display: grid; }
.s-textarea-box.is-growing::before { content: attr(data-value) " "; grid-area: 1 / 1; visibility: hidden; min-width: 0; padding: 6px 10px; white-space: pre-wrap; overflow-wrap: anywhere;
                                    font-size: var(--s-fs-control); line-height: var(--s-lh-body); min-height: calc(var(--s-ta-rows, 3) * 1lh + 12px); max-height: calc(var(--s-ta-max, 12) * 1lh + 12px); overflow: hidden; }
.s-textarea-box.is-growing > .s-textarea-el { grid-area: 1 / 1; height: 100%; min-height: 0; max-height: none; resize: none; }

/* Number field: the two step buttons at the end of the box */
.s-number-steps { flex: none; align-self: stretch; display: flex; flex-direction: column; margin-right: -10px; border-left: 1px solid var(--s-line); }
.s-number-step { appearance: none; flex: 1; width: 24px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-number-step:hover { background: var(--s-fill); color: var(--s-ink); }
.s-number-step:active { background: var(--s-pressed); }

/* Radio group: native radio buttons with the Fluent dot */
.s-radiogroup { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.s-radiogroup > legend { padding: 0; }
.s-radiogroup-items { display: flex; flex-direction: column; gap: 0; }
.s-radiogroup.is-row .s-radiogroup-items { flex-direction: row; flex-wrap: wrap; column-gap: 20px; }
.s-radio { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--s-control-h); cursor: pointer; }
.s-radio-input { position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin: -8px 0 0; opacity: 0; cursor: inherit; }
.s-radio-dot { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--s-line-accessible); border-radius: var(--s-radius-round); background: var(--s-surface); transition: border-color var(--s-dur-fast) var(--s-ease); }
.s-radio-dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--s-radius-round); background: var(--s-primary); transform: scale(0); transition: transform var(--s-dur-fast) var(--s-ease); }
.s-radio:hover .s-radio-dot { border-color: var(--s-ink); }
/* The edge of what is on is the primary colour pulled a little towards the text colour: on a dark surface the primary
   colour alone does not stand out enough for an edge that carries meaning. */
.s-radio-input:checked + .s-radio-dot { border-color: color-mix(in srgb, var(--s-primary) 62%, var(--s-ink)); }
.s-radio-input:checked + .s-radio-dot::after { transform: scale(1); }
.s-radio-input:focus-visible + .s-radio-dot { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-radio-label { display: inline-flex; align-items: center; gap: 6px; }
.s-radiogroup:disabled .s-radio { cursor: not-allowed; color: var(--s-ink-disabled); }
.s-radiogroup:disabled .s-radio-dot { border-color: var(--s-ink-disabled); }
.s-radiogroup:disabled .s-radio-dot::after { background: var(--s-ink-disabled); }
.s-radiogroup.is-error .s-radio-dot { border-color: var(--s-late); }

/* Switch: a native checkbox with the role of a switch */
.s-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--s-control-h); cursor: pointer; }
.s-switch.is-before { display: flex; flex-direction: row-reverse; justify-content: space-between; }
.s-switch-input { position: absolute; left: 0; top: 50%; width: 40px; height: 20px; margin: -10px 0 0; opacity: 0; cursor: inherit; }
.s-switch.is-before .s-switch-input { left: auto; right: 0; }
.s-switch-track { flex: none; box-sizing: border-box; width: 40px; height: 20px; display: flex; padding: 2px; border: 1px solid var(--s-line-accessible); border-radius: var(--s-switch-radius, var(--s-radius-round)); background: var(--s-surface);
                  transition: background-color var(--s-dur-fast) var(--s-ease), border-color var(--s-dur-fast) var(--s-ease); }
.s-switch-thumb { width: 14px; height: 14px; border-radius: var(--s-switch-thumb-radius, var(--s-radius-round)); background: var(--s-ink-2); transition: transform var(--s-dur-fast) var(--s-ease); }
.s-switch:hover .s-switch-track { border-color: var(--s-ink); }
.s-switch-input:checked + .s-switch-track { border-color: color-mix(in srgb, var(--s-primary) 62%, var(--s-ink)); background: var(--s-primary); }
.s-switch-input:checked + .s-switch-track > .s-switch-thumb { transform: translateX(20px); background: var(--s-on-primary); }
.s-switch:hover .s-switch-input:checked + .s-switch-track { border-color: color-mix(in srgb, var(--s-primary-hover) 62%, var(--s-ink)); background: var(--s-primary-hover); }
.s-switch-input:focus-visible + .s-switch-track { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-switch.is-disabled { cursor: not-allowed; color: var(--s-ink-disabled); }
.s-switch.is-disabled .s-switch-track { border-color: var(--s-ink-disabled); background: var(--s-fill); }
.s-switch.is-disabled .s-switch-thumb { background: var(--s-ink-disabled); }
.s-switch-state { min-width: 3ch; color: var(--s-ink-2); }
/* The shape: the theme sets --s-switch-radius and --s-switch-thumb-radius for every switch (StarrukProfile.SwitchShape);
   a switch with a Shape of its own sets them here and wins. Square takes the corners of the inputs. */
.s-switch.is-round { --s-switch-radius: var(--s-radius-round); --s-switch-thumb-radius: var(--s-radius-round); }
.s-switch.is-square { --s-switch-radius: var(--s-radius-control); --s-switch-thumb-radius: var(--s-radius-small); }

/* Combobox, multi select, tag input and lookup: an input with a list under it. The list stands right under the box:
   it is taken out of the flow where it is, so help under the field does not move. */
.s-combo { position: relative; display: block; }
.s-combo > .s-field-label { display: block; margin-bottom: 4px; }
.s-combo > .s-field-help { margin-top: 4px; }
.s-combo-box { padding-right: 2px; }
.s-combo-btn { appearance: none; flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-combo-btn:hover:not(:disabled) { background: var(--s-fill); color: var(--s-ink); }
.s-combo-btn:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-combo-btn:disabled { color: var(--s-ink-disabled); cursor: not-allowed; }
.s-combo-btn.is-done { color: var(--s-done); }
.s-combo-list { position: absolute; z-index: 30; left: 0; right: 0; max-height: 288px; margin: -2px 0 0; padding: 4px; overflow: auto; list-style: none; border: 1px solid var(--s-line); border-radius: var(--s-radius-control);
                background: var(--s-surface); box-shadow: var(--s-shadow-16); }
.s-combo-option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: var(--s-radius-control); cursor: pointer; }
.s-combo-option > .s-icon { flex: none; color: var(--s-ink-3); }
.s-combo-option:hover { background: var(--s-fill); }
.s-combo-option.is-active { background: var(--s-selected); outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-combo-option[aria-selected="true"] { font-weight: 600; }
.s-combo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.s-combo-count { flex: none; color: var(--s-ink-3); font-size: var(--s-fs-caption); font-variant-numeric: tabular-nums; }
.s-combo-option > .s-combo-check { color: var(--s-primary); }
.s-combo-note { padding: 8px; color: var(--s-ink-3); }
.s-multi-box { height: auto; min-height: var(--s-control-h); flex-wrap: wrap; gap: 4px; padding: 3px 2px 3px 6px; }
.s-multi-box > .s-input-el { flex: 1 1 96px; min-width: 64px; height: 24px; }
.s-multi-box > .s-combo-btn { height: 24px; }
.s-multi-check { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--s-line-accessible); border-radius: var(--s-checkbox-radius, var(--s-radius-small)); color: transparent; }
.s-multi-check.is-on { border-color: color-mix(in srgb, var(--s-primary) 62%, var(--s-ink)); background: var(--s-primary); color: var(--s-on-primary); }
.s-multi-check > .s-icon { color: inherit; }

/* Lookup: the list is a small table. Every row shares the columns of the list (subgrid), so the cells line up. */
.s-lookup { container: s-lookup / inline-size; }
.s-lookup-list { right: auto; min-width: 100%; width: max-content; max-width: min(720px, 92vw); padding: 0; display: grid; grid-template-columns: repeat(var(--s-lookup-cols, 1), auto); column-gap: 20px; }
.s-lookup-rows { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; padding: 4px; }
.s-lookup-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; column-gap: 20px; padding-left: 8px; padding-right: 8px; }
.s-lookup-head { position: sticky; top: 0; z-index: 1; padding: 6px 12px 5px; border-bottom: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-lookup-cell { min-width: 0; overflow-wrap: anywhere; }
.s-lookup-cell.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.s-lookup-cell.is-mono { font-family: var(--s-font-mono); }
.s-lookup-rows > .s-combo-note, .s-lookup-new { grid-column: 1 / -1; }
.s-lookup-new { margin-top: 2px; border-top: 1px solid var(--s-line); border-radius: 0 0 var(--s-radius-control) var(--s-radius-control); color: var(--s-brand); font-weight: 600; }
.s-lookup-new > .s-icon { color: inherit; }
@container s-lookup (max-width: 460px) {
    /* A narrow field: the list is as wide as the field and what does not fit wraps inside its cell. */
    .s-lookup-list { width: 100%; max-width: 100%; column-gap: 10px; }
    .s-lookup-row { column-gap: 10px; }
}

/* Date range, time and date with time */
.s-daterange-parts, .s-datetime-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.s-daterange-parts > .s-datefield, .s-datetime-parts > .s-datefield { flex: 1 1 128px; min-width: 120px; max-width: 176px; }
.s-daterange-to { color: var(--s-ink-3); }
.s-datetime-parts > .s-time { flex: 0 1 116px; min-width: 96px; }
.s-time > .s-input { max-width: 132px; }
.s-datetime-parts > .s-time > .s-input { max-width: none; }

/* Rich text editor */
.s-rte-box { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible); border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); }
.s-rte-box:hover { border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); border-bottom-color: var(--s-ink-2); }
.s-rte-box:has(.s-rte-area:focus-visible, .s-rte-plain:focus-visible) { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-rte.is-error .s-rte-box { border-color: var(--s-late); }
.s-rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--s-line); }
.s-rte-tool[aria-pressed="true"] { background-color: var(--s-selected); color: var(--s-ink) !important; }
.s-rte-mark { font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.s-rte-sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--s-line); }
.s-rte-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; border-bottom: 1px solid var(--s-line); background: var(--s-bg); }
.s-rte-link[hidden], .s-rte-link [hidden] { display: none; }
.s-rte-link > .s-icon { color: var(--s-ink-3); }
.s-rte-url { flex: 1 1 160px; min-width: 0; height: var(--s-control-h-sm); padding: 0 8px; border: 1px solid var(--s-line-strong); border-radius: var(--s-radius-control); background: var(--s-surface); color: var(--s-ink); font: inherit; }
.s-rte-url:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-rte-url[aria-invalid="true"] { border-color: var(--s-late); }
.s-rte-area { min-height: calc(var(--s-rte-rows, 5) * 1lh + 16px); max-height: 60vh; overflow: auto; padding: 8px 12px; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.s-rte[data-empty="true"] .s-rte-area::before { content: attr(data-placeholder); float: left; height: 0; color: var(--s-ink-3); pointer-events: none; }
.s-rte-area > * { max-width: none; margin: 0 0 8px; }
.s-rte-area > :last-child { margin-bottom: 0; }
.s-rte-area h2 { margin-top: 12px; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-rte-area h3 { margin-top: 10px; font-size: var(--s-fs-body); font-weight: 600; }
.s-rte-area > :first-child { margin-top: 0; }
.s-rte-area ul, .s-rte-area ol { padding-left: 22px; }
.s-rte-area a { color: var(--s-brand); text-decoration: underline; text-underline-offset: 2px; }
.s-rte-area[aria-readonly="true"] { color: var(--s-ink-2); }
.s-rte-plain { width: 100%; min-height: 120px; padding: 8px 12px; border: 0; border-radius: inherit; background: transparent; color: var(--s-ink); font: 13px/20px var(--s-font-mono); resize: vertical; outline: none; }

/* Form: what is wrong at the top, the fields, and the buttons at the bottom */
.s-form { min-width: 0; display: flex; flex-direction: column; gap: 16px; container: s-form / inline-size; }
.s-form-errors { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--s-late) 30%, transparent); border-radius: var(--s-radius-control); background: var(--s-late-tint); }
.s-form-errors > .s-icon { flex: none; color: var(--s-late); }
.s-form-errors:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-form-errors-body { min-width: 0; }
.s-form-errors-title { margin: 0; font-weight: 600; }
.s-form-errors-list { margin: 4px 0 0; padding-left: 18px; }
.s-form-errors-list a { color: var(--s-ink); text-decoration: underline; text-underline-offset: 2px; }
.s-form-errors-list a:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; border-radius: var(--s-radius-small); }
.s-form-body { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.s-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--s-line); }
.s-form-state { margin-right: auto; padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--s-accent-text) 30%, transparent); border-radius: var(--s-radius-control); background: var(--s-accent-soft); color: var(--s-accent-text);
                font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-form-section { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.s-form-section-title { margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-form-section-text { margin: 2px 0 0; color: var(--s-ink-2); }
.s-form-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 24px; align-items: start; }
@container s-form (min-width: 560px) {
    .s-form-fields.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Display of the first wave: tooltip, hover card, popover, skeleton, spinner, timeline, feed, description list ===== */

/* Tooltip and hover card: shown by their wrapper on hover and on focus, no script. The pseudo element around the
   bubble bridges the gap to the element, so the pointer can move onto it. */
.s-tip, .s-hovercard { position: relative; display: inline-flex; max-width: 100%; }
.s-tip-bubble, .s-hovercard-card { position: absolute; z-index: 40; opacity: 0; visibility: hidden; pointer-events: none; text-align: left; font-weight: 400; white-space: normal;
                                   transition: opacity var(--s-dur-fast) var(--s-ease), visibility 0s linear var(--s-dur-fast); }
.s-tip-bubble { width: max-content; max-width: min(280px, 80vw); padding: 4px 8px; border-radius: var(--s-radius-control); background: var(--s-ink); color: var(--s-surface); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption);
                box-shadow: var(--s-shadow-8); }
.s-hovercard-card { width: min(var(--s-hovercard-w, 280px), 92vw); padding: 12px; border: 1px solid var(--s-line); border-radius: var(--s-card-radius, var(--s-radius-card)); background: var(--s-surface); color: var(--s-ink);
                    box-shadow: var(--s-shadow-16); }
.s-tip-bubble::before, .s-hovercard-card::before { content: ""; position: absolute; inset: -8px; z-index: -1; }
.s-tip:hover > .s-tip-bubble, .s-hovercard:hover > .s-hovercard-card { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 350ms, 350ms; }
.s-tip:focus-within > .s-tip-bubble, .s-hovercard:focus-within > .s-hovercard-card { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s, 0s; }
.s-tip.is-dismissed > .s-tip-bubble, .s-hovercard.is-dismissed > .s-hovercard-card { opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, 0s; }
.is-top > .s-tip-bubble, .is-top > .s-hovercard-card { bottom: calc(100% + 6px); left: 50%; translate: -50% 0; }
.is-bottom > .s-tip-bubble, .is-bottom > .s-hovercard-card { top: calc(100% + 6px); left: 50%; translate: -50% 0; }
.is-left > .s-tip-bubble, .is-left > .s-hovercard-card { right: calc(100% + 6px); top: 50%; translate: 0 -50%; }
.is-right > .s-tip-bubble, .is-right > .s-hovercard-card { left: calc(100% + 6px); top: 50%; translate: 0 -50%; }
.s-hovercard-trigger { display: inline-flex; align-items: center; min-width: 0; }
.s-hovercard-trigger[tabindex] { border-radius: var(--s-radius-small); text-decoration: underline dotted var(--s-line-accessible); text-underline-offset: 3px; cursor: default; }
.s-hovercard-trigger:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
/* Where the browser can anchor one element to another, the bubble is placed by its element on top of everything:
   it is not cut off by a scrolling pane and moves to the other side when there is no room. */
@supports (position-area: top) {
    .s-tip-bubble, .s-hovercard-card { position: fixed; margin: 6px; position-try-fallbacks: flip-block, flip-inline; }
    /* The place by hand of the rules above is taken back here: the browser places the bubble in the area by its element. */
    .is-top > .s-tip-bubble, .is-top > .s-hovercard-card { position-area: top; inset: auto; translate: none; }
    .is-bottom > .s-tip-bubble, .is-bottom > .s-hovercard-card { position-area: bottom; inset: auto; translate: none; }
    .is-left > .s-tip-bubble, .is-left > .s-hovercard-card { position-area: left; inset: auto; translate: none; }
    .is-right > .s-tip-bubble, .is-right > .s-hovercard-card { position-area: right; inset: auto; translate: none; }
}

/* Popover: the browser's own, so it lies on top and closes on Escape and on a click outside */
.s-popover { width: min(var(--s-popover-w, 320px), calc(100vw - 32px)); max-height: min(70vh, 560px); padding: 0; overflow: auto; border: 1px solid var(--s-line); border-radius: var(--s-card-radius, var(--s-radius-card));
             background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-28); }
.s-popover::backdrop { background: transparent; }
.s-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--s-line); }
.s-popover-title { margin: 0; font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; }
.s-popover-body { padding: 12px 16px 16px; }
@supports (position-area: bottom) {
    .s-popover { inset: auto; margin: 4px 0; position-area: bottom span-right; position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; }
}

/* Skeleton shapes and spinner */
.s-skel { width: var(--s-skel-w, 100%); max-width: 100%; display: flex; flex-direction: column; gap: 10px; }
.s-skel > .s-skel-bar { display: block; width: 100%; max-width: none; height: 10px; }
.s-skel > .s-skel-bar.is-short { width: 62%; }
.s-skel.is-block > .s-skel-bar { height: var(--s-skel-h, 96px); border-radius: var(--s-radius-control); }
.s-skel.is-circle { width: var(--s-skel-h, 32px); }
.s-skel.is-circle > .s-skel-bar { height: var(--s-skel-h, 32px); border-radius: var(--s-radius-round); }
.s-spinner { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; color: var(--s-ink-2); }
.s-spinner-ring { flex: none; box-sizing: border-box; width: var(--s-spinner-size, 20px); height: var(--s-spinner-size, 20px); border: max(2px, calc(var(--s-spinner-size, 20px) / 10)) solid var(--s-line-strong);
                  border-top-color: var(--s-primary); border-radius: var(--s-radius-round); animation: s-spin 900ms linear infinite; }
.s-spinner.is-on-primary { color: inherit; }
.s-spinner.is-on-primary > .s-spinner-ring { border-color: color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; }
@keyframes s-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .s-spinner-ring { animation-duration: 2.4s; }
}

/* Timeline: a dot per moment on a line that runs to the next */
.s-timeline { margin: 0; padding: 0; list-style: none; }
.s-timeline-item { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; padding-bottom: 16px; }
.s-timeline-item:last-child { padding-bottom: 0; }
.s-timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--s-line); }
.s-timeline-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--s-radius-round); color: var(--s-tone, var(--s-ink-3)); }
.s-timeline-mark:empty::after { content: ""; box-sizing: border-box; width: 10px; height: 10px; border-radius: var(--s-radius-round); background: var(--s-tone, var(--s-ink-3)); }
.s-timeline-item.is-open > .s-timeline-mark:empty::after { border: 2px solid var(--s-line-accessible); background: var(--s-surface); }
.s-timeline-item.is-current > .s-timeline-mark { background: var(--s-tone-tint, var(--s-selected)); }
.s-timeline-body { min-width: 0; }
.s-timeline-title { margin: 0; min-height: 24px; display: flex; align-items: center; font-weight: 600; overflow-wrap: anywhere; }
.s-timeline-item.is-open .s-timeline-title { color: var(--s-ink-2); font-weight: 400; }
.s-timeline-time { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-timeline-text { margin: 2px 0 0; color: var(--s-ink-2); overflow-wrap: anywhere; }

/* Activity feed */
.s-feed { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.s-feed-day { margin: 6px 0 0; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-feed-day:first-child { margin-top: 0; }
.s-feed-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; }
.s-feed-body { min-width: 0; }
.s-feed-line { margin: 0; min-height: 28px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; padding-top: 4px; }
.s-feed-what { min-width: 0; overflow-wrap: anywhere; }
a.s-feed-what { color: var(--s-brand); text-decoration: underline; text-underline-offset: 2px; }
.s-feed-time { margin-left: auto; color: var(--s-ink-3); font-size: var(--s-fs-caption); white-space: nowrap; font-variant-numeric: tabular-nums; }
.s-feed-detail { margin: 2px 0 0; padding: 4px 10px; border-left: 2px solid var(--s-line-strong); color: var(--s-ink-2); overflow-wrap: anywhere; }
.s-feed-empty, .s-comments-empty, .s-approvals-empty, .s-agent-empty { margin: 0; color: var(--s-ink-3); }

/* Description list: as many columns as asked for and as fit */
.s-dl { margin: 0; display: grid; gap: 6px 32px; grid-template-columns: repeat(auto-fit, minmax(max(220px, calc((100% - (var(--s-dl-cols, 2) - 1) * 32px) / var(--s-dl-cols, 2))), 1fr)); }
.s-dl-pair { min-width: 0; display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
.s-dl.is-stacked .s-dl-pair { grid-template-columns: minmax(0, 1fr); }
.s-dl-term { color: var(--s-ink-2); overflow-wrap: anywhere; }
.s-dl.is-stacked .s-dl-term { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-dl-value { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.s-dl-value.is-mono { font-family: var(--s-font-mono); }
.s-dl-value.is-empty { color: var(--s-ink-3); }
.s-dl-value a { color: var(--s-brand); text-decoration: underline; text-underline-offset: 2px; }
.s-copy-box { padding-right: 2px; }
.s-copy-box > .s-input-el { text-overflow: ellipsis; }

/* ===== Working together: comments, approvals, what an agent did ===== */
.s-comments { min-width: 0; display: flex; flex-direction: column; gap: 12px; container: s-comments / inline-size; }
.s-comments-list, .s-comment-replies { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.s-comment-thread { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--s-line); border-radius: var(--s-card-radius, var(--s-radius-card)); background: var(--s-surface); }
.s-comment-thread.is-resolved { background: var(--s-bg); }
.s-comment-replies { gap: 8px; margin-left: 13px; padding-left: 23px; border-left: 2px solid var(--s-line); }
.s-comment { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; }
.s-comment-body { min-width: 0; }
.s-comment-head { margin: 0; min-height: 28px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
.s-comment-time { color: var(--s-ink-3); font-size: var(--s-fs-caption); }
.s-comment-delete { appearance: none; margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-3); cursor: pointer; }
.s-comment-delete:hover { background: var(--s-fill); color: var(--s-late); }
.s-comment-delete:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-comment-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.s-mention { padding: 0 4px; border-radius: var(--s-radius-small); background: var(--s-brand-tint); color: var(--s-ink); font-weight: 600; }
.s-mention-pick { appearance: none; height: 24px; border: 1px solid var(--s-brand-line); font: inherit; font-weight: 600; cursor: pointer; }
.s-mention-pick:hover { background: var(--s-selected); }
.s-mention-pick:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-comment-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 38px; }
.s-comment-composer { display: flex; flex-direction: column; gap: 6px; }
.s-comment-thread > .s-comment-composer { margin-left: 38px; }
.s-comment-input { box-sizing: border-box; width: 100%; min-height: 56px; max-height: 240px; padding: 6px 10px; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible);
                   border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); color: var(--s-ink); font: inherit; resize: vertical; field-sizing: content; }
.s-comment-input::placeholder { color: var(--s-ink-3); opacity: 1; }
.s-comment-input:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-comment-people { display: flex; flex-wrap: wrap; gap: 4px; }
.s-comment-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.s-comment-hint { margin-right: auto; color: var(--s-ink-3); font-size: var(--s-fs-caption); }
.s-comments-toggle { align-self: flex-start; margin: 0; }
@container s-comments (max-width: 380px) {
    .s-comment-replies { margin-left: 0; padding-left: 10px; }
    .s-comment-actions, .s-comment-thread > .s-comment-composer { margin-left: 0; }
}

.s-approvals { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.s-approval { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border: 1px solid var(--s-line); border-left: 3px solid var(--s-human); border-radius: var(--s-card-radius, var(--s-radius-card)); background: var(--s-surface); }
.s-approval.is-done { border-left-color: var(--s-done); }
.s-approval.is-late { border-left-color: var(--s-late); }
.s-approval.is-neutral { border-left-color: var(--s-line-accessible); }
.s-approval-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
.s-approval-what { flex: 1 1 180px; min-width: 0; }
.s-approval-title { margin: 0; font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; overflow-wrap: anywhere; }
.s-approval-meta { margin: 0; display: flex; flex-wrap: wrap; column-gap: 8px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-approval-text { margin: 0; overflow-wrap: anywhere; }
.s-approval-input > summary { width: fit-content; color: var(--s-ink-2); font-size: var(--s-fs-caption); cursor: pointer; border-radius: var(--s-radius-small); }
.s-approval-input > summary:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-approval-input > pre { max-height: 200px; margin: 6px 0 0; padding: 8px 10px; overflow: auto; border-radius: var(--s-radius-control); background: var(--s-bg); color: var(--s-ink); font: 12px/18px var(--s-font-mono);
                          white-space: pre-wrap; overflow-wrap: anywhere; }
.s-approval-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.s-approval-note { color: var(--s-ink-3); font-size: var(--s-fs-caption); }
.s-approval-reason { display: flex; flex-direction: column; gap: 8px; }
.s-approval-result { margin: 0; display: flex; align-items: flex-start; gap: 8px; }
.s-approval-result > .s-icon { flex: none; margin-top: 2px; }
.s-approval.is-done .s-approval-result > .s-icon { color: var(--s-done); }
.s-approval.is-late .s-approval-result > .s-icon { color: var(--s-late); }
.s-approval-line { display: block; color: var(--s-ink-2); overflow-wrap: anywhere; }

.s-agent { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; border: 1px solid var(--s-line); border-radius: var(--s-card-radius, var(--s-radius-card)); background: var(--s-surface); container: s-agent / inline-size; }
.s-agent-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.s-agent-who { flex: 1 1 160px; min-width: 0; }
.s-agent-name { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; }
.s-agent-for { color: var(--s-ink-3); font-size: var(--s-fs-caption); font-weight: 400; }
.s-agent-title { margin: 0; color: var(--s-ink-2); overflow-wrap: anywhere; }
.s-agent-state { display: inline-flex; align-items: center; }
.s-agent-steps { margin: 0; padding: 0; list-style: none; }
.s-agent-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; column-gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--s-line); }
.s-agent-mark { width: 24px; height: 24px; display: grid; place-items: center; color: var(--s-done); }
.s-agent-step.is-failed > .s-agent-mark { color: var(--s-late); }
.s-agent-step.is-waiting > .s-agent-mark { color: var(--s-human); }
.s-agent-step.is-running > .s-agent-mark { color: var(--s-auto); }
.s-agent-step.is-running > .s-agent-mark > .s-icon { animation: s-spin 1.6s linear infinite; }
.s-agent-step.is-stopped > .s-agent-mark, .s-agent-step.is-undone > .s-agent-mark { color: var(--s-ink-3); }
.s-agent-step-body { min-width: 0; }
.s-agent-step-text { margin: 0; min-height: 24px; display: flex; align-items: center; overflow-wrap: anywhere; }
.s-agent-step.is-undone .s-agent-step-text { color: var(--s-ink-3); text-decoration: line-through; }
.s-agent-step-detail { margin: 0; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow-wrap: anywhere; }
.s-agent-step-time, .s-agent-undone { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: 24px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@container s-agent (max-width: 420px) {
    .s-agent-step { grid-template-columns: 24px minmax(0, 1fr); row-gap: 2px; }
    .s-agent-step > .s-agent-step-time, .s-agent-step > .s-agent-undone, .s-agent-step > .s-btn { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
    .s-agent-step.is-running > .s-agent-mark > .s-icon { animation: none; }
}

/* Text editor: a text box with a mirror of its lines behind it. The mirror has the same font, padding and wrapping, so it
   knows where every line stands: the gutter reads the line numbers from it and the matches of a search are drawn in it,
   behind the text. Its own text is never seen. The script (starruk-texteditor.js) keeps the two in step. */
.s-te { --s-te-fs: 13px; --s-te-lh: 20px; --s-te-pad: 8px; --s-te-gutter: 44px; flex: 1; min-width: 0; min-height: 240px; display: flex; flex-direction: column;
        border: 1px solid var(--s-line-strong); border-radius: var(--s-radius-control); background: var(--s-surface); color: var(--s-ink); container: s-te / inline-size; }
.s-te-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-height: calc(var(--s-control-h-sm) + 8px); padding: 4px 8px; border-bottom: 1px solid var(--s-line); }
.s-te-bar .s-btn-sm { min-width: 0; }
.s-te-bar .s-btn-icononly.s-btn-sm { width: var(--s-control-h-sm); }
.s-te-split { flex: none; align-self: stretch; width: 1px; margin: 4px; background: var(--s-line); }
.s-te-bar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-left: auto; }
.s-te-find { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--s-line); background: var(--s-bg); }
.s-te-find[hidden], .s-te-find-row[hidden] { display: none; }
.s-te-find-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.s-te-find-input { flex: 0 1 320px; min-width: 120px; height: var(--s-control-h-sm); background: var(--s-surface); }
.s-te-find-input .s-icon { color: var(--s-ink-3); }
.s-te-find .s-input-el { font-family: var(--s-font-mono); font-size: var(--s-te-fs); }
.s-te-find .s-input-el[aria-invalid="true"] { color: var(--s-late); }
.s-te-find .s-btn-sm { min-width: 0; }
.s-te-find .s-btn-icononly.s-btn-sm, .s-te-toggle { width: var(--s-control-h-sm); padding: 0; }
.s-te-toggle { font-family: var(--s-font-mono); font-weight: 600; }
.s-te-toggle.is-word { text-decoration: underline; text-underline-offset: 3px; }
.s-te-find-count { min-width: 9ch; padding: 0 6px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; }
.s-te > .s-msg, .s-te-check > .s-msg { flex: none; border-width: 0 0 1px; border-radius: 0; }
.s-te-check { flex: none; }
.s-te-check-detail { overflow-wrap: anywhere; }
.s-te-body { flex: 1; min-height: 160px; display: flex; overflow: hidden; }
.s-te-edit { flex: 1 1 50%; min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--s-te-gutter) minmax(0, 1fr); }
.s-te-gutter { position: relative; overflow: hidden; border-right: 1px solid var(--s-line); background: var(--s-bg); color: var(--s-ink-3); font: 400 12px/var(--s-te-lh) var(--s-font-mono); font-variant-numeric: tabular-nums; user-select: none; cursor: default; }
.s-te-num { position: absolute; top: 0; right: 8px; height: var(--s-te-lh); white-space: nowrap; }
.s-te-num.is-current { color: var(--s-ink); font-weight: 600; }
.s-te-pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
/* What the text box and its mirror must have in common, to the pixel. */
.s-te-text { margin: 0; padding: var(--s-te-pad); border: 0; box-sizing: border-box; font: 400 var(--s-te-fs)/var(--s-te-lh) var(--s-font-mono); letter-spacing: 0; font-variant-ligatures: none; font-kerning: none;
             tab-size: 4; text-align: left; text-indent: 0; text-transform: none; white-space: pre; overflow-wrap: normal; word-break: normal; }
.s-te[data-wrap="on"] .s-te-text, .s-te[data-wrap="on"] .s-te-line { white-space: pre-wrap; overflow-wrap: break-word; }
.s-te-mirror { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* The mirror: the same text line for line behind the text box, for the line numbers and the matches. Only what it has
   to show is painted, the line of the caret and the matches: painting thousands of unseen lines at every key costs time. */
.s-te-lines { position: absolute; top: 0; left: 0; min-width: 100%; width: max-content; color: transparent; visibility: hidden; }
.s-te-line { display: block; min-height: var(--s-te-lh); white-space: pre; }
.s-te-line.is-current { background: var(--s-fill); visibility: visible; }
.s-te-hit { visibility: visible; background: var(--s-human-tint); color: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--s-human) 55%, transparent); }
.s-te-hit.is-current { background: var(--s-accent-soft); box-shadow: inset 0 0 0 1px var(--s-accent-text); }
.s-te-area { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; overflow: auto; background: transparent; color: var(--s-ink); caret-color: var(--s-ink); scrollbar-width: thin; }
.s-te[data-wrap="on"] .s-te-area { overflow-x: hidden; }
.s-app .s-te-area:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-te-area[readonly] { color: var(--s-ink-2); }
.s-te-side { flex: 1 1 50%; min-width: 0; min-height: 0; overflow: auto; padding: 12px 16px; border-left: 1px solid var(--s-line); scrollbar-width: thin; }
.s-app .s-te-side:focus-visible { outline-offset: -2px; }
.s-te-side-loading { display: flex; flex-direction: column; gap: 8px; }
.s-te-side-note { margin: 12px 0 0; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-te-side-text { margin: 0; color: var(--s-ink); font: 400 var(--s-te-fs)/var(--s-te-lh) var(--s-font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.s-te[data-view="preview"] .s-te-edit { display: none; }
.s-te[data-view="preview"] .s-te-side { border-left: 0; }
.s-te-status { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; min-height: 28px; padding: 2px 8px; border-top: 1px solid var(--s-line); color: var(--s-ink-2);
               font-size: var(--s-fs-caption); line-height: 24px; font-variant-numeric: tabular-nums; }
.s-te-status > span:empty { display: none; }
.s-te-status .s-btn-sm { min-width: 0; height: 22px; padding: 0 6px; }
.s-te-leave { margin-left: auto; color: var(--s-ink-3); }
.s-te-leave-now { display: none; color: var(--s-ink); font-weight: 600; }
.s-te[data-leaving] .s-te-leave-rest { display: none; }
.s-te[data-leaving] .s-te-leave-now { display: inline; }
/* Narrow: the preview goes under the text, and the status bar keeps to what matters. */
@container s-te (max-width: 620px) {
    .s-te[data-view="split"] .s-te-body { flex-direction: column; }
    /* The text and what stands next to it share the height there is, the text a little more. */
    .s-te[data-view="split"] .s-te-edit { flex: 3 1 0; min-height: 0; }
    .s-te[data-view="split"] .s-te-side { flex: 2 1 0; min-height: 0; border-left: 0; border-top: 1px solid var(--s-line); }
    .s-te-find-input { flex-basis: 100%; }
    .s-te-leave { margin-left: 0; flex-basis: 100%; }
}

/* Document editor: one text file open for editing. A head with the name and the way out, the text editor, and a foot
   with the comment for the version and the save. */
.s-de { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--s-surface); container: s-de / inline-size; }
.s-de-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px var(--s-pad-sm) 6px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-de-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-de-title { margin: 0; font: 600 var(--s-fs-section)/var(--s-lh-section) var(--s-font-display); overflow-wrap: anywhere; }
.s-de-sub { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow-wrap: anywhere; }
.s-de-state { flex: none; display: inline-flex; }
.s-de-head-tools { flex: none; display: flex; align-items: center; gap: 4px; }
.s-de > .s-msg, .s-de-conflict > .s-msg { flex: none; border-width: 0 0 1px; border-radius: 0; }
.s-de-conflict { flex: none; }
.s-de > .s-te { border-width: 0; border-radius: 0; }
.s-de-none { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; padding: var(--s-pad); }
.s-de-theirs-head { margin: 0 0 8px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-de-foot { flex: none; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; padding: var(--s-pad-sm) var(--s-pad); border-top: 1px solid var(--s-line); }
.s-de-note { flex: 1 1 240px; min-width: 0; }
.s-de-foot > .s-checkbox { min-height: var(--s-control-h); }
.s-de-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@container s-de (max-width: 520px) {
    .s-de-head { padding-left: var(--s-pad-sm); }
    /* A message with two actions: the actions go under the text instead of squeezing it or falling outside. */
    .s-de-conflict > .s-msg { flex-wrap: wrap; }
    .s-de-conflict .s-msg-body { flex: 1 1 200px; }
    .s-de-conflict .s-msg-actions { flex-wrap: wrap; margin-left: auto; }
    .s-de-buttons { margin-left: 0; flex: 1 1 100%; }
    .s-de-buttons > .s-btn { flex: 1; }
}

/* In a documents page the editor stands where the pane of the file stood; with "Volledig scherm" it has the page. The
   folders and the list wait behind it: they cannot be used until the editor is closed. */
.s-dp-edit { flex: none; width: clamp(380px, 46%, 920px); min-width: 0; min-height: 0; display: flex; border-left: 1px solid var(--s-line); }
.s-dp.is-editing .s-dp-body > .s-dp-pane { display: none; }
.s-dp.is-editing .s-dp-nav, .s-dp.is-editing .s-dp-main { opacity: .55; }
.s-dp.is-editing-full .s-dp-body > .s-dp-nav, .s-dp.is-editing-full .s-dp-body > .s-dp-main, .s-dp.is-editing-full .s-dp-card > .s-cmdbar,
.s-dp.is-editing-full .s-dp-card > .s-lp-foot, .s-dp.is-editing-full > .s-lp-notice { display: none; }
.s-dp.is-editing-full .s-dp-edit { flex: 1; width: auto; border-left: 0; }
.s-dp-pane-note { flex: 1 1 100%; margin: 0; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
/* Not wide enough for a list and an editor side by side: the editor has the page, and the page keeps the height of the window. */
@container s-page (max-width: 1040px) {
    .s-dp.is-editing .s-dp-body > .s-dp-nav, .s-dp.is-editing .s-dp-body > .s-dp-main, .s-dp.is-editing .s-dp-card > .s-cmdbar,
    .s-dp.is-editing .s-dp-card > .s-lp-foot, .s-dp.is-editing > .s-lp-notice { display: none; }
    .s-dp.is-editing .s-dp-edit { flex: 1; width: auto; border-left: 0; }
    .s-dp.is-editing .s-de-full { display: none; }
}
/* A phone: the editor is at least as high as the window and grows with what it shows; then the page scrolls. */
@media (max-width: 860px) {
    .s-dp.is-editing { height: auto; min-height: calc(100dvh - var(--s-appbar-h) - var(--s-page-pad-y) * 2); }
    .s-dp.is-editing > .s-pagehead { display: none; }
    .s-dp.is-editing .s-te-body { min-height: 280px; }
    .s-dp.is-editing .s-te[data-view="split"] .s-te-body { min-height: 440px; }
}

/* Pressed and link-like buttons */
.s-btn[aria-pressed="true"], .s-btn.is-pressed { background-color: var(--s-selected); background-image: none; color: var(--s-ink) !important; }
.s-btn[aria-pressed="true"] .s-icon { color: var(--s-brand); }
.s-link { appearance: none; margin: 0 0 0 4px; padding: 0; border: 0; background: none; color: var(--s-brand); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.s-link + .s-link { margin-left: 12px; }

/* Checkbox (Fluent: 16px box, small corners, accessible stroke; filled with the brand when checked) */
.s-checkbox { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 20px; vertical-align: middle; cursor: pointer; }
.s-checkbox-input { position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin: -8px 0 0; opacity: 0; cursor: inherit; }
.s-checkbox-box { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--s-line-accessible); border-radius: var(--s-checkbox-radius, var(--s-radius-small)); background: var(--s-surface); color: transparent;
                  transition: background var(--s-dur-fast) var(--s-ease), border-color var(--s-dur-fast) var(--s-ease); }
.s-checkbox:hover .s-checkbox-box { border-color: var(--s-ink); }
.s-checkbox-input:checked + .s-checkbox-box { border-color: var(--s-primary); background: var(--s-primary); color: var(--s-on-primary); }
.s-checkbox:hover .s-checkbox-input:checked + .s-checkbox-box { border-color: var(--s-primary-hover); background: var(--s-primary-hover); }
.s-checkbox-box.is-mixed { border-color: var(--s-brand); color: var(--s-brand); }
.s-checkbox-input:focus-visible + .s-checkbox-box { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-checkbox.is-disabled { cursor: not-allowed; color: var(--s-ink-disabled); }
.s-checkbox.is-disabled .s-checkbox-box { border-color: var(--s-ink-disabled); }

/* Tag: a removable value, such as one active filter */
.s-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 24px; padding: 0 2px 0 8px; border: 1px solid var(--s-brand-line); border-radius: var(--s-chip-radius, var(--s-radius-control));
         background: var(--s-brand-tint); color: var(--s-ink); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-tag-key { color: var(--s-ink-2); }
.s-tag-key::after { content: ":"; }
.s-tag-value { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.s-tag-remove { appearance: none; flex: none; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; border-radius: inherit; background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-tag-remove:hover { background: var(--s-selected); color: var(--s-ink); }

/* Extension mark: a small puzzle piece on whatever an extension added */
.s-ext-mark { flex: none; display: inline-flex; color: var(--s-brand); }

/* Skeleton: nothing for the first 300 ms, then the shape of the content */
.s-skeleton { display: inline-block; width: 68%; max-width: 160px; height: 10px; border-radius: var(--s-radius-bar); vertical-align: middle; opacity: 0;
              background: linear-gradient(90deg, var(--s-selected) 25%, var(--s-fill) 50%, var(--s-selected) 75%); background-size: 200% 100%;
              animation: s-skeleton-in 200ms linear 300ms forwards, s-skeleton-wave 1.6s linear 300ms infinite; }
.s-skeleton-text { width: 120px; }
.s-skeleton-label { width: 96px; }
td:nth-child(3n) > .s-skeleton { width: 44%; }
td:nth-child(4n) > .s-skeleton { width: 82%; }
@keyframes s-skeleton-in { to { opacity: 1; } }
@keyframes s-skeleton-wave { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Collapsible section (BC FastTab): the header toggles; folded it shows a summary, open its actions */
.s-collapse-head { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.s-collapse-heading { flex: 1; min-width: 0; display: flex; margin: 0; font: inherit; }
.s-collapse-toggle { appearance: none; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 var(--s-pad) 0 var(--s-pad-sm); border: 0; border-radius: var(--s-card-radius, var(--s-radius-card));
                     background: transparent; color: var(--s-ink); font: inherit; text-align: left; justify-content: flex-start; cursor: pointer; }
.s-collapse-chevron { color: var(--s-ink-3); transition: transform var(--s-dur-fast) var(--s-ease); }
.s-collapse-toggle:hover .s-collapse-chevron { color: var(--s-ink); }
.s-collapse.is-open .s-collapse-chevron { transform: rotate(90deg); }
.s-collapse-title { flex: none; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-collapse-summary { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 20px; overflow: hidden; color: var(--s-ink-2); white-space: nowrap; }
.s-collapse-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.s-collapse-value:empty { display: none; }
.s-collapse-actions { flex: none; display: flex; gap: 4px; padding-right: var(--s-pad-sm); }
.s-collapse-body { padding: 0 var(--s-pad) var(--s-pad); }
.s-collapse-body[hidden] { display: none; }

/* Fields of a card (BC: caption left, value right, columns filled top to bottom: two, and three on a wide page) */
.s-fields { display: grid; grid-auto-flow: column; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--s-fields-rows, 1), auto); column-gap: 48px; row-gap: 4px; }
.s-fieldrow { display: grid; grid-template-columns: minmax(104px, min(36%, 220px)) minmax(0, 1fr); column-gap: 12px; align-items: start; min-height: var(--s-control-h); }
.s-fieldrow-label { min-width: 0; min-height: var(--s-control-h); display: flex; align-items: center; gap: 6px; color: var(--s-ink-2); }
.s-fieldrow-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-fieldrow-label[title] .s-fieldrow-caption { text-decoration: underline dotted var(--s-line-accessible); text-underline-offset: 3px; cursor: help; }
.s-fieldrow-value { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-fieldrow-text, .s-fieldrow-check { min-height: var(--s-control-h); display: flex; align-items: center; padding: 0 11px; }
.s-fieldrow-text { overflow-wrap: anywhere; }
.s-fieldrow-text.is-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.s-input-el.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.s-fieldrow.is-error .s-input { border-color: var(--s-late); }
.s-fieldrow.is-error .s-field-help { color: var(--s-late); }
.s-fieldrow > .s-skeleton { align-self: center; }

/* Page templates are as wide as the work area, as in BC. The profile's content width is for free pages
   with running text, such as settings and the manual. */
.s-main-inner:has(> .s-lp), .s-main-inner:has(> .s-cp), .s-main-inner:has(> .s-bp), .s-main-inner:has(> .s-cal), .s-main-inner:has(> .s-rc), .s-main-inner:has(> .s-page) { max-width: none; }
/* A page template in a state without its frame: no access, or a record that is not there. */
.s-page { display: flex; flex-direction: column; gap: var(--s-gap); min-width: 0; }

/* Card page: the header stays in view while the groups scroll under it */
.s-cp { display: flex; flex-direction: column; gap: var(--s-pad-sm); container: s-page / inline-size; }
.s-cp-head { position: sticky; top: var(--s-appbar-h); z-index: 5; display: flex; flex-direction: column; gap: 12px; margin: calc(var(--s-page-pad-y) * -1) calc(var(--s-page-pad-x) * -1) 0;
             padding: var(--s-page-pad-y) var(--s-page-pad-x) 4px; background: var(--s-bg); }
.s-pagehead-titleline > .s-btn, .s-pagehead-titleline > .s-chip { align-self: center; }
.s-pagehead-titleline > .s-btn { margin-left: -6px; }
.s-pagehead-actions { align-items: center; }
.s-cp-step { display: inline-flex; align-items: center; gap: 2px; }
.s-cp-position { padding: 0 4px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-saved { display: inline-flex; align-items: center; gap: 6px; height: var(--s-control-h-sm); padding: 0 8px; border-radius: var(--s-radius-control); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-saved.is-saved .s-icon { color: var(--s-done); }
.s-saved.is-error { color: var(--s-late); }
.s-saved.is-fresh { animation: s-saved 1.8s var(--s-ease); }
@keyframes s-saved { 0%, 55% { background: var(--s-done-tint); color: var(--s-done); } }
@container s-page (min-width: 1800px) {
    .s-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(var(--s-fields-rows-wide, 1), auto); }
}
@container s-page (max-width: 760px) {
    .s-fields { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
}
/* On a phone the head of a card scrolls along: it would take a third of the screen. */
@media (max-width: 700px) { .s-cp-head { position: static; } }

/* List page: an application frame. The bar and the footer stay; the table, the filter pane and the detail pane scroll by themselves. */
.s-lp { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--s-appbar-h) - var(--s-page-pad-y) * 2); min-height: 440px; margin-bottom: calc(var(--s-page-pad-y) * -1); container: s-page / inline-size; }
/* The views of a list: tabs on the canvas under the title, each with its count; the card below is what the chosen one holds.
   The page's own controls stand at their end. Where the tabs do not fit they are a dropdown. */
.s-lp-views { --s-tab-h: 40px; flex: none; display: flex; align-items: flex-end; gap: 8px 16px; min-width: 0; margin-top: -8px; border-bottom: 1px solid var(--s-line); }
.s-lp-views-tabs { flex: 1; min-width: 0; }
.s-lp-views-tabs .s-tabs { border-bottom: 0; }
.s-lp-views-select { display: none; flex: 1; min-width: 0; }
.s-lp-views-select .s-select { display: flex; }
.s-lp-views-tools { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; padding-bottom: 4px; }
.s-lp-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.s-lp-card > .s-cmdbar { flex: none; border-bottom: 1px solid var(--s-line); }
/* Quick create: a line above the rows that takes one line of text; the focus line runs under the whole of it. */
.s-lp-quick { flex: none; display: flex; align-items: center; gap: 8px; min-height: var(--s-row-h); padding: 0 var(--s-pad-sm) 0 var(--s-pad); border-bottom: 1px solid var(--s-line);
              transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-lp-quick:focus-within { box-shadow: inset 0 0 0 2px var(--s-focus); }
.s-lp-quick > .s-icon { color: var(--s-brand); }
.s-lp-quick > .s-input-el { height: var(--s-control-h); }
.s-lp-quick > .s-btn { flex: none; }
.s-lp-sortmenu { display: none; }
.s-lp .s-cmdbar .s-search { width: 208px; }
.s-lp-body { flex: 1; min-height: 0; display: flex; }
.s-lp-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.s-lp-chips { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-lp-grid { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.s-lp-empty { flex: 1; min-height: 0; display: grid; place-items: center; padding: var(--s-pad); overflow: auto; }
.s-lp-foot { flex: none; display: flex; align-items: center; gap: 16px; min-height: 40px; padding: 4px var(--s-pad); border-top: 1px solid var(--s-line); color: var(--s-ink-3); }
.s-lp-selected { display: inline-flex; align-items: center; gap: 4px; color: var(--s-ink); }

/* The table of a list page: header and the first two columns stay while the rest scrolls */
.s-table-fixed { border-collapse: separate; border-spacing: 0; }
.s-table-fixed thead th { position: sticky; top: 0; z-index: 2; background: var(--s-surface); }
.s-table-fixed tbody td { background-color: var(--s-surface); }
.s-table-fixed tbody tr:hover td { background-color: var(--s-surface); background-image: linear-gradient(var(--s-fill), var(--s-fill)); }
.s-table-fixed tr.is-selected td, .s-table-fixed tr.is-selected:hover td { background-color: var(--s-surface); background-image: linear-gradient(var(--s-brand-tint), var(--s-brand-tint)); }
.s-table-fixed tr.s-lp-loading:hover td { background-image: none; }
.s-table-fixed .s-lp-check { position: sticky; left: 0; z-index: 1; width: calc(var(--s-pad) + 24px); min-width: calc(var(--s-pad) + 24px); padding-right: 0; }
.s-table-fixed .s-lp-check + th, .s-table-fixed .s-lp-check + td { position: sticky; left: calc(var(--s-pad) + 24px); z-index: 1; }
.s-table-fixed thead .s-lp-check, .s-table-fixed thead .s-lp-check + th { z-index: 3; }
.s-table-fixed .s-mono { font-size: 13px; }
/* A long text takes the width of a column, not of the screen; the detail pane and the card show it whole. */
.s-table-fixed td { max-width: 44ch; overflow: hidden; text-overflow: ellipsis; }
.s-lp-row { cursor: default; user-select: none; }
.s-lp-row.is-cursor > .s-lp-check::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 0 var(--s-radius-bar) var(--s-radius-bar) 0; background: var(--s-indicator); }
/* The focus frame is drawn on the cells, so the frozen columns carry it too. */
.s-app .s-lp-row:focus-visible { outline: none; }
.s-lp-row:focus-visible > td { box-shadow: inset 0 2px 0 var(--s-focus), inset 0 -2px 0 var(--s-focus); }
.s-lp-row:focus-visible > td:first-child { box-shadow: inset 2px 2px 0 var(--s-focus), inset 0 -2px 0 var(--s-focus); }
.s-lp-row:focus-visible > td:last-child { box-shadow: inset 0 2px 0 var(--s-focus), inset -2px -2px 0 var(--s-focus); }
.s-app a.s-lp-key { font-weight: 600; }
.s-app a.s-lp-key:focus-visible { border-radius: var(--s-radius-small); }
.s-th-btn .s-ext-mark { margin-left: 2px; }

/* Filter pane (BC: at the left, one filter per field) */
.s-filterpane { flex: none; width: 248px; display: flex; flex-direction: column; gap: 12px; padding: var(--s-pad-sm) var(--s-pad) var(--s-pad); overflow-y: auto; border-right: 1px solid var(--s-line); }
.s-filterpane-head { display: flex; align-items: center; justify-content: space-between; min-height: var(--s-control-h-sm); }
.s-filterpane-title { margin: 0; font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; }
.s-filter { display: flex; flex-direction: column; gap: 2px; }
.s-filter-head { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.s-filter-label { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-filter-remove { appearance: none; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-3); cursor: pointer; opacity: 0; }
.s-filter:hover .s-filter-remove, .s-filter-remove:focus-visible { opacity: 1; }
.s-filter-remove:hover { background: var(--s-fill); color: var(--s-ink); }
.s-filter .s-select { display: flex; }
.s-filterpane-foot { display: flex; margin-left: -8px; }

/* Detail pane (BC FactBox): the current row in full */
.s-factbox { flex: none; width: 296px; display: flex; flex-direction: column; overflow-y: auto; border-left: 1px solid var(--s-line); }
.s-factbox-head { display: flex; flex-direction: column; align-items: flex-start; padding: var(--s-pad-sm) var(--s-pad); }
.s-factbox-eyebrow { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-factbox-key { font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; overflow-wrap: anywhere; }
.s-factbox-sub { color: var(--s-ink-2); }
.s-factbox-head > .s-chip { margin-top: 8px; }
.s-facts { margin: 0; padding: 6px var(--s-pad); display: flex; flex-direction: column; border-top: 1px solid var(--s-line); }
.s-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0; }
.s-fact dt { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--s-ink-3); }
.s-fact dd { min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; }
.s-fact dd .s-mono { font-size: 13px; }
.s-factbox-foot { position: sticky; bottom: 0; margin-top: auto; padding: var(--s-pad-sm) var(--s-pad); border-top: 1px solid var(--s-line); background: var(--s-surface); }
.s-factbox-foot .s-btn { width: 100%; }
.s-factbox > .s-empty { margin: auto 0; }

/* A narrow page: the bar's secondary buttons keep their icon only, then the panes make room for the table */
.s-actionbar-menus { display: contents; }
.s-actionbar-more { display: none; }
.s-menu-header { padding: 6px 8px 2px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
/* Two steps, by density: first the secondary verbs lose their label, then the menus fold into "Meer". */
@container s-page (max-width: 1240px) {
    .s-cmdbar .s-btn[data-compact] { width: var(--s-control-h); padding: 0; }
    .s-cmdbar .s-btn[data-compact] .s-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container s-page (max-width: 1090px) {
    .s-actionbar-menus { display: none; }
    .s-actionbar-more { display: contents; }
}
@container s-page (max-width: 1640px) {
    .s-app[data-density="comfortable"] .s-cmdbar .s-btn[data-compact] { width: var(--s-control-h); padding: 0; }
    .s-app[data-density="comfortable"] .s-cmdbar .s-btn[data-compact] .s-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container s-page (max-width: 1440px) {
    .s-app[data-density="comfortable"] .s-actionbar-menus { display: none; }
    .s-app[data-density="comfortable"] .s-actionbar-more { display: contents; }
}
/* The detail pane leaves with its button, so no button is left that does nothing. */
@container s-page (max-width: 960px) { .s-factbox, .s-lp .s-cmdbar [data-tool="details"] { display: none; } }
@media (max-width: 860px) { .s-lp { height: auto; margin-bottom: 0; } .s-lp-grid { max-height: 70vh; } }
/* A narrow list, such as on a phone: nothing scrolls sideways. The views are a dropdown, the bar wraps, the
   filter pane stands above the rows, and every row is a small card: its lead and promoted values as they are,
   the status as its chip, and the other values two by two with their caption. Sorting moves to a menu. */
@container s-page (max-width: 700px) {
    .s-lp-views { flex-wrap: wrap; align-items: center; margin-top: 0; border-bottom: 0; }
    .s-lp-views-tabs { display: none; }
    .s-lp-views-select { display: block; }
    .s-lp-views-tools { flex: 1 1 100%; padding-bottom: 0; }
    .s-lp-card > .s-cmdbar { flex-wrap: wrap; }
    .s-lp-card > .s-cmdbar > .s-cmdbar-far { flex: 1 1 240px; }
    .s-lp .s-cmdbar .s-search { flex: 1; width: auto; min-width: 0; }
    .s-lp-sortmenu { display: contents; }
    .s-lp-body { flex-direction: column; }
    .s-filterpane { flex: none; width: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--s-line); }
    .s-lp-foot { flex-wrap: wrap; gap: 2px 16px; }
    .s-table-fixed, .s-table-fixed tbody { display: block; }
    .s-table-fixed thead { display: none; }
    .s-lp-row { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 10px var(--s-pad) 10px calc(var(--s-pad) + 28px);
                border-bottom: 1px solid var(--s-line); background-color: var(--s-surface); }
    .s-lp-row:last-child { border-bottom: 0; }
    .s-lp-row:hover { background-image: linear-gradient(var(--s-fill), var(--s-fill)); }
    .s-lp-row.is-selected, .s-lp-row.is-selected:hover { background-image: linear-gradient(var(--s-brand-tint), var(--s-brand-tint)); }
    .s-table-fixed .s-lp-row > td { position: static; order: 3; display: block; flex: 0 1 auto; width: auto; min-width: 0; max-width: 100%; height: auto; padding: 0; border: 0; background: none !important;
                                    box-shadow: none !important; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: left; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
    .s-table-fixed .s-lp-row > td:not(.is-lead, .is-promoted, .is-status, .s-lp-check)::before { content: attr(data-label); margin-right: 6px; color: var(--s-ink-3); }
    /* The lead and the promoted values first, each on a line of its own; then the status; then the other values as they fit. */
    .s-table-fixed .s-lp-row > .is-lead, .s-table-fixed .s-lp-row > .is-promoted { order: 1; flex: 1 1 100%; color: var(--s-ink); font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
    .s-table-fixed .s-lp-row > .is-lead { order: 0; font-weight: 600; }
    .s-table-fixed .s-lp-row > .is-status { order: 2; flex: 1 1 100%; padding: 2px 0; }
    .s-table-fixed .s-lp-row > .is-empty { display: none; }
    .s-table-fixed .s-lp-row > .s-lp-check { position: absolute; left: var(--s-pad); top: 10px; }
    .s-lp-row.is-cursor > .s-lp-check::before { content: none; }
    .s-lp-row.is-cursor::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 var(--s-radius-bar) var(--s-radius-bar) 0; background: var(--s-indicator); }
    .s-app .s-table-fixed .s-lp-row:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
}
/* On a phone the rows are part of the page: one scroll, not a list that scrolls inside a page that scrolls. */
@media (max-width: 700px) { .s-lp-grid { max-height: none; overflow: visible; } }

/* Brick: one record as a small card (BC: a Brick). A board puts it on a card, a queue of a role center in a row.
   With a link the title carries it and the whole brick follows; the brick's own buttons stay separately clickable. */
.s-brick { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-brick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.s-brick-key { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--s-font-mono); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--s-brand); }
.s-brick-badge { flex: none; display: inline-flex; }
.s-brick-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--s-brick-title-lines, 3); overflow: hidden; overflow-wrap: anywhere; color: var(--s-ink) !important; font-weight: 600; text-decoration: none !important; }
a.s-brick-title::after { content: ""; position: absolute; inset: 0; }
.s-app a.s-brick-title:focus-visible { outline: none; }
.s-brick:has(a.s-brick-title:focus-visible) { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-brick-text { margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--s-brick-text-lines, 2); overflow: hidden; color: var(--s-ink-2); }
.s-brick-facts { margin: 2px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; row-gap: 2px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-brick-fact { display: contents; }
.s-brick-fact dt { display: inline-flex; align-items: center; gap: 4px; color: var(--s-ink-3); white-space: nowrap; }
.s-brick-fact dd { margin: 0; min-width: 0; color: var(--s-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-brick-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; }
.s-brick-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.s-brick-actions .s-btn { min-width: 0; }
.s-brick-person { display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin-left: auto; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-brick-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Board page: an application frame like the list page. The bar stays; every column scrolls by itself, and
   grouped the lanes scroll as a whole under the column heads. Columns are wells on the canvas with the status
   colour along the top; the cards are the only white. */
.s-bp { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--s-appbar-h) - var(--s-page-pad-y) * 2); min-height: 440px; margin-bottom: calc(var(--s-page-pad-y) * -1); container: s-page / inline-size; }
.s-bp > .s-cmdbar, .s-bp > .s-msg, .s-bp > .s-block { flex: none; }
.s-bp .s-cmdbar .s-search { width: 208px; }
.s-bp-board { --s-bp-strip: var(--s-board-strip-w, 40px); --s-bp-min: calc(var(--s-bp-open) * var(--s-board-column-min, 192px) + var(--s-bp-folded) * var(--s-bp-strip) + (var(--s-bp-open) + var(--s-bp-folded) - 1) * var(--s-board-gap, 8px));
              flex: 1; min-height: 0; display: grid; grid-template-columns: var(--s-bp-template); grid-template-rows: minmax(0, 1fr); gap: var(--s-board-gap, 8px); overflow-x: auto; overscroll-behavior-x: contain; }
.s-bp-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-radius: var(--s-card-radius, var(--s-radius-card)); background: var(--s-fill); }
.s-bp-head { flex: none; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px 0 var(--s-pad-sm); border-top: 2px solid var(--s-tone); border-radius: var(--s-card-radius, var(--s-radius-card)) var(--s-card-radius, var(--s-radius-card)) 0 0; }
.s-bp-head.s-tone-neutral, .s-bp-strip.s-tone-neutral { border-top-color: var(--s-line-strong); }
.s-bp-head-title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--s-font-body); font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; }
.s-bp-head .s-btn { opacity: 0; transition: opacity var(--s-dur-fast) var(--s-ease); }
.s-bp-head:hover .s-btn, .s-bp-col:hover .s-bp-head .s-btn, .s-bp-head .s-btn:focus-visible { opacity: 1; }
@media (hover: none) { .s-bp-head .s-btn { opacity: 1; } }
.s-bp-cards { display: flex; flex-direction: column; gap: var(--s-board-card-gap, 6px); }
.s-bp-col > .s-bp-cards { flex: 1; min-height: 0; padding: 2px 6px 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.s-bp-cards > .s-btn { flex: none; }
.s-bp-item { flex: none; padding: 8px 10px 10px; box-shadow: var(--s-shadow-2); transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-bp-item.is-link:hover { box-shadow: var(--s-shadow-8); }
.s-bp-item.is-link:active { background-image: linear-gradient(var(--s-pressed), var(--s-pressed)); box-shadow: var(--s-shadow-2); }
.s-bp-item .s-brick-title { font-weight: 400; }
.s-bp-loading { gap: 10px; padding: 12px 10px 16px; }
.s-bp-empty { margin: 0; padding: 14px 8px; border: 1px dashed var(--s-line-strong); border-radius: var(--s-card-radius, var(--s-radius-card)); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: center; }
/* A folded column: a strip with its count and the caption read from top to bottom; a click opens it again. */
.s-bp-strip { appearance: none; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; padding: 10px 0; border: 0; border-top: 2px solid var(--s-tone); border-radius: var(--s-card-radius, var(--s-radius-card));
              background: var(--s-fill); color: var(--s-ink-2); font: inherit; transition: background var(--s-dur-fast) var(--s-ease); }
button.s-bp-strip { cursor: pointer; }
button.s-bp-strip:hover { background: var(--s-selected); color: var(--s-ink); }
button.s-bp-strip:active { background: var(--s-pressed); }
.s-bp-strip-title { writing-mode: vertical-rl; font-weight: 600; white-space: nowrap; }
.s-bp-strip.is-head { flex-direction: row; justify-content: center; min-height: 40px; padding: 0; border-radius: var(--s-card-radius, var(--s-radius-card)) var(--s-card-radius, var(--s-radius-card)) 0 0; }
/* Grouped: the heads stay at the top, each lane folds, and the cells of a column line up through the lanes. */
.s-bp-board.is-lanes { display: block; overflow: auto; overscroll-behavior: contain; }
.s-bp-heads, .s-bp-lane { min-width: var(--s-bp-min); }
.s-bp-heads, .s-bp-lane-cells { display: grid; grid-template-columns: var(--s-bp-template); gap: var(--s-board-gap, 8px); }
.s-bp-heads { position: sticky; top: 0; z-index: 2; background: var(--s-bg); }
.s-bp-heads > .s-bp-head { background: var(--s-fill); }
.s-bp-lane-head { position: sticky; left: 0; width: max-content; max-width: 100%; margin: 8px 0 4px; font: inherit; }
.s-bp-lane-toggle { appearance: none; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin: 0; padding: 0 8px 0 4px; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink);
                    font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
.s-bp-lane-toggle:hover { background: var(--s-fill); }
.s-bp-lane-toggle:active { background: var(--s-pressed); }
.s-bp-lane-toggle > .s-icon { color: var(--s-ink-3); }
.s-bp-lane-title { min-width: 0; max-width: 72ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-bp-cell { min-width: 0; min-height: 40px; padding: 6px; background: var(--s-fill); }
.s-bp-cell.is-folded { padding: 0; }
@media (max-width: 860px) {
    .s-bp { height: auto; margin-bottom: 0; }
    .s-bp-board { grid-template-rows: auto; }
    .s-bp-col > .s-bp-cards, .s-bp-board.is-lanes { max-height: 70vh; }
}
/* A phone: the columns stack and the page scrolls, so nothing scrolls sideways. A folded column is a bar; grouped,
   every cell names its column and the empty ones leave. */
@media (max-width: 700px) {
    .s-bp-board, .s-bp-board.is-lanes { display: flex; flex-direction: column; max-height: none; overflow: visible; }
    .s-bp-col > .s-bp-cards { max-height: none; overflow: visible; }
    .s-bp-strip { flex-direction: row; min-height: 40px; padding: 0 var(--s-pad-sm); }
    .s-bp-strip-title { writing-mode: horizontal-tb; }
    .s-bp-heads { display: none; }
    .s-bp-lane { min-width: 0; }
    .s-bp-lane-head { position: static; width: auto; }
    .s-bp-lane-cells { display: flex; flex-direction: column; }
    .s-bp-cell.is-empty, .s-bp-cell.is-folded { display: none; }
    .s-bp-cell::before { content: attr(data-caption); padding: 2px 6px 4px; font-weight: 600; }
}

/* Role center: the head with the greeting and the shortcuts, the key figures as tiles, then the queues side by
   side. A queue is a block with its records as rows; a wide queue takes the full width with its cards side by side. */
.s-rc { display: flex; flex-direction: column; gap: var(--s-gap); container: s-page / inline-size; }
.s-rc-shortcuts { display: flex; flex-wrap: wrap; gap: 4px; }
.s-rc-shortcuts .s-btn { min-width: 0; }
.s-rc-cues { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s-pad-sm); }
/* The queues with work share the full width of their row; a wide queue has the row to itself. Inside a queue the
   cards stand side by side as soon as there is room for two, so a wide screen is filled instead of scrolled. */
.s-rc-queues { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--s-queue-min, 340px)), 1fr)); gap: var(--s-gap); align-items: start; }
.s-rc-queues.is-wide { grid-template-columns: minmax(0, 1fr); }
.s-rc-queue { container: s-queue / inline-size; }
.s-rc-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); overflow: clip; }
/* A folded queue shows a fixed number of rows: with two or three cards side by side it shows twice or three times as
   many, and its "Alles tonen" leaves when there is nothing more to show. The widths follow the 380px of a card. */
.s-rc-item.is-second, .s-rc-item.is-third { display: none; }
@container s-queue (min-width: 760px) { .s-rc-item.is-second { display: flex; } .s-rc-foot.is-upto-1 { display: none; } }
@container s-queue (min-width: 1140px) { .s-rc-item.is-third { display: flex; } .s-rc-foot.is-upto-2 { display: none; } }
.s-rc-item { margin-left: -1px; padding: 10px var(--s-pad) 12px calc(var(--s-pad) + 1px); border-top: 1px solid var(--s-line); border-left: 1px solid var(--s-line); transition: background var(--s-dur-fast) var(--s-ease); }
/* Queues without work: one line each, together in one row above the work. */
.s-rc-quiet { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-pad-sm); }
.s-rc-queue.is-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 48px; padding: 6px var(--s-pad-sm) 6px var(--s-pad); }
.s-rc-queue.is-quiet .s-block-heading { flex: none; flex-direction: row; align-items: baseline; gap: 8px; }
.s-rc-item.is-link:hover { background: var(--s-fill); }
.s-rc-loading { gap: 10px; }
.s-rc-empty { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--s-ink-3); }
.s-rc-foot { display: flex; align-items: center; gap: 12px; padding: 6px var(--s-pad-sm); border-top: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
/* The foot of an unfolded queue stays in view, so "Minder tonen" is never a long scroll away. */
.s-rc-queue.is-unfolded .s-rc-foot { position: sticky; bottom: 0; z-index: 2; }
/* A tile that leads to a queue on the same page lands under the app bar, not behind it. */
.s-rc-queue { scroll-margin-top: calc(var(--s-appbar-h) + var(--s-pad-sm)); }

/* Parts of a card: the records that belong to it, as the same rows of bricks a queue has. A part with records is a
   section like the field groups; the parts without stand together in one row, one line each. */
.s-collapse.is-flush > .s-collapse-body { padding: 0; }
.s-collapse.is-flush .s-rc-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.s-cp-quiet { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--s-pad-sm); }
.s-cp-part.is-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 48px; padding: 6px var(--s-pad-sm) 6px var(--s-pad); }
.s-cp-part.is-quiet > .s-icon { color: var(--s-ink-3); }
.s-cp-part.is-quiet > .s-block-title { flex: none; }
.s-cp-part.is-quiet > .s-rc-empty { flex: 1 1 220px; }

/* Calendar page: an application frame like the list and the board. The bar stays; the days scroll by themselves and
   the hours stretch to fill the height. One grid holds the hours and the days, so the heads, what fills a day and the
   time lines line up; an entry stands on its day by the shares the page gives it (--s-cal-top, -height, -col, -cols). */
.s-cal { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--s-appbar-h) - var(--s-page-pad-y) * 2); min-height: 440px; margin-bottom: calc(var(--s-page-pad-y) * -1); container: s-page / inline-size; }
.s-cal > .s-cmdbar, .s-cal > .s-msg { flex: none; }
.s-cal > .s-cmdbar { flex-wrap: wrap; row-gap: 4px; }
.s-cal .s-cmdbar-main { flex-wrap: nowrap; }
.s-cal-nav { flex: none; display: flex; align-items: center; gap: 2px; }
.s-cal-nav .s-btn:first-child { margin-right: 4px; }
.s-cal-period { flex: 0 1 auto; min-width: 0; margin: 0 4px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-cal-period::first-letter { text-transform: uppercase; }
.s-cal-weekno { color: var(--s-ink-3); font-family: var(--s-font-body); font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 400; white-space: nowrap; }
.s-cal-person, .s-cal-views, .s-cal-views-select { display: inline-flex; }
.s-cal-views-select { display: none; }
.s-cal-card { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.s-cal-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: inherit; }
.s-cal-week { min-height: 100%; display: grid; grid-template-columns: var(--s-cal-gutter-w, 64px) repeat(var(--s-cal-days), minmax(0, 1fr));
              grid-template-rows: auto auto minmax(calc(var(--s-cal-hours) * var(--s-cal-hour-min, 44px)), 1fr); }
.s-cal-gutter, .s-cal-day { min-width: 0; display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; }
.s-cal-day { border-left: 1px solid var(--s-line); }
.s-cal-corner, .s-cal-dayhead { grid-row: 1; position: sticky; top: 0; z-index: 3; min-height: 40px; border-bottom: 1px solid var(--s-line); background: var(--s-surface); }
.s-cal-alldaylabel, .s-cal-allday { grid-row: 2; border-bottom: 1px solid var(--s-line); }
.s-cal-hours, .s-cal-timed { grid-row: 3; }
.s-cal-alldaylabel { padding: 6px 8px 6px 0; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: right; }
.s-cal-hours { display: grid; grid-template-rows: repeat(var(--s-cal-hours), minmax(0, 1fr)); }
.s-cal-hour { padding: 2px 8px 0 0; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-cal-dayhead { margin: 0; display: flex; font: inherit; }
.s-cal-daybtn { appearance: none; flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 0; padding: 8px 4px; border: 0; border-top: 3px solid transparent; background: transparent;
                color: var(--s-ink-2); font: inherit; white-space: nowrap; }
button.s-cal-daybtn { cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
button.s-cal-daybtn:hover { background: var(--s-fill); color: var(--s-ink); }
button.s-cal-daybtn:active { background: var(--s-pressed); }
.s-app button.s-cal-daybtn:focus-visible { outline-offset: -2px; }
.s-cal-daynum { font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--s-ink); }
/* Today carries the indicator, as the selected destination does; the weekend steps back. */
.s-cal-day.is-today .s-cal-daybtn { border-top-color: var(--s-indicator); color: var(--s-ink); font-weight: 600; }
.s-cal-day.is-today .s-cal-timed, .s-cal-day.is-today .s-cal-allday { background-color: color-mix(in srgb, var(--s-brand-tint) 55%, transparent); }
.s-cal-day.is-weekend .s-cal-timed, .s-cal-day.is-weekend .s-cal-allday { background-color: var(--s-bg); }
.s-cal-day.is-weekend .s-cal-daynum { color: var(--s-ink-2); }
.s-cal-allday, .s-cal-timed, .s-cal-chips { margin: 0; padding: 0; list-style: none; }
.s-cal-allday { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 3px 3px 4px 2px; }
/* The hours as lines: one at the start of every hour, whatever height the hours got. */
.s-cal-timed { position: relative; min-width: 0; background-image: linear-gradient(to bottom, var(--s-line) 1px, transparent 1px); background-size: 100% calc(100% / var(--s-cal-hours)); }
.s-cal-slot { position: absolute; top: var(--s-cal-top); left: calc(var(--s-cal-col) * 100% / var(--s-cal-cols)); width: calc(100% / var(--s-cal-cols)); height: var(--s-cal-height); min-height: 22px; padding: 1px 3px 1px 2px;
              container: s-slot / inline-size; }
.s-cal-none { display: none; }
/* An entry: the colour of its status as a tint with a stroke at the left, the words in ink. */
.s-cal-entry { min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding: 2px 6px 2px 5px; border-left: 3px solid var(--s-tone); border-radius: var(--s-radius-control); background-color: var(--s-surface);
               background-image: linear-gradient(var(--s-tone-tint), var(--s-tone-tint)); color: var(--s-ink) !important; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-decoration: none !important; }
.s-cal-slot > .s-cal-entry { height: 100%; }
.s-cal-entry.is-link { transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-cal-entry.is-link:hover { box-shadow: var(--s-shadow-4); }
.s-cal-entry.is-link:active { box-shadow: none; }
.s-app a.s-cal-entry:focus-visible { outline-offset: -2px; }
.s-cal-entry-title { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.s-cal-entry-time, .s-cal-entry-person { color: var(--s-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A short entry has one line: its title, then its time. */
.s-cal-slot.is-short > .s-cal-entry { flex-direction: row; align-items: baseline; gap: 6px; padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.s-cal-slot.is-short .s-cal-entry-person { display: none; }
.s-cal-slot.is-short .s-cal-entry-title { flex: 0 1 auto; white-space: nowrap; }
.s-cal-slot.is-short .s-cal-entry-time { flex: 0 1000 auto; min-width: 0; }
.s-cal-entry.is-line { flex-direction: row; align-items: baseline; gap: 6px; white-space: nowrap; }
.s-cal-entry.is-line .s-cal-entry-time { flex: none; }
/* Side by side with three others an entry is narrow: it keeps its title, on as many lines as it has; the rest is in its tooltip. */
@container s-slot (max-width: 88px) {
    .s-cal-entry { padding-left: 3px; padding-right: 2px; }
    .s-cal-entry-time, .s-cal-entry-person { display: none; }
    .s-cal-slot.is-short > .s-cal-entry, .s-cal-slot.is-short .s-cal-entry-title { white-space: normal; }
}
.s-cal-entry.is-line .s-cal-entry-title { font-weight: 400; }
.s-cal-entry.is-line.is-allday .s-cal-entry-title { font-weight: 600; }
/* What fills a day has the width of its day: its title may take two lines there. */
.s-cal-allday .s-cal-entry.is-line { white-space: normal; }
.s-cal-allday .s-cal-entry-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* Nothing planned: the days stay, the words lie over them. */
.s-cal-empty { position: absolute; inset: 40px 0 0 0; display: grid; place-items: center; padding: var(--s-pad); pointer-events: none; }
.s-cal-empty-box { pointer-events: auto; border-radius: var(--s-card-radius, var(--s-radius-card)); background: var(--s-surface); box-shadow: 0 0 0 1px var(--s-line); }
.s-cal-empty-box .s-empty { padding: 20px 28px; }
.s-cal-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 6px var(--s-pad); border-top: 1px solid var(--s-line); }
/* Month: whole weeks, each as high as the frame allows; a day shows its first entries and how many more there are. */
.s-cal-month { min-height: 100%; display: grid; grid-template-rows: auto repeat(var(--s-cal-weeks), minmax(var(--s-cal-week-min, 100px), 1fr)); }
.s-cal-monthhead, .s-cal-weekrow { min-width: 0; display: grid; grid-template-columns: var(--s-cal-wk-w, 36px) repeat(7, minmax(0, 1fr)); }
.s-cal-monthhead { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink-2); }
.s-cal-monthday { padding: 8px 8px 6px; border-left: 1px solid var(--s-line); }
.s-cal-monthday.is-weekend { color: var(--s-ink-3); }
.s-cal-weekrow + .s-cal-weekrow { border-top: 1px solid var(--s-line); }
.s-cal-wk { appearance: none; min-width: 0; display: flex; align-items: flex-start; justify-content: center; margin: 0; padding: 7px 0 0; border: 0; background: transparent; color: var(--s-ink-3); font: inherit;
            font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; }
.s-cal-monthhead > .s-cal-wk { padding: 10px 0 0; }
button.s-cal-wk { cursor: pointer; }
button.s-cal-wk:hover { background: var(--s-fill); color: var(--s-ink); }
.s-app button.s-cal-wk:focus-visible { outline-offset: -2px; }
.s-cal-cell { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 2px 3px 4px 2px; border-left: 1px solid var(--s-line); }
.s-cal-cell.is-weekend { background: var(--s-bg); }
.s-cal-cell.is-outside .s-cal-daynum { color: var(--s-ink-3); font-weight: 400; }
.s-cal-cellhead { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 26px; }
.s-cal-cell .s-cal-daybtn { flex: none; min-width: 26px; height: 24px; align-items: center; padding: 0 6px; border-top: 0; border-radius: var(--s-radius-control); }
.s-cal-cell .s-cal-daynum { font-family: var(--s-font-body); font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
.s-cal-cell.is-today .s-cal-daybtn, .s-cal-cell.is-today button.s-cal-daybtn:hover { background: var(--s-primary); }
.s-cal-cell.is-today .s-cal-daynum { color: var(--s-on-primary); }
.s-cal-count { display: none; }
.s-cal-chips { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.s-cal-more { appearance: none; margin: 0; padding: 1px 6px; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-2); font: inherit; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: left; }
button.s-cal-more { cursor: pointer; }
button.s-cal-more:hover { background: var(--s-fill); color: var(--s-ink); }
@media (max-width: 860px) {
    .s-cal { height: auto; margin-bottom: 0; }
    .s-cal-scroll { max-height: 76vh; }
}
/* A narrow calendar, such as on a phone: nothing scrolls sideways. The views are a dropdown; the days of a week stand
   under one another as a list, each with what is planned or the words that nothing is; a month shows a count per day. */
@container s-page (max-width: 700px) {
    .s-cal .s-cmdbar-main { flex-wrap: wrap; }
    .s-cal > .s-cmdbar > .s-cmdbar-far { flex: 1 1 100%; }
    .s-cal-views { display: none; }
    .s-cal-views-select, .s-cal-person { display: flex; flex: 1; min-width: 0; }
    .s-cal-views-select .s-select, .s-cal-person .s-select { flex: 1; }
    .s-cal-scroll { max-height: none; overflow: visible; }
    .s-cal-week { display: block; min-height: 0; }
    .s-cal-gutter { display: none; }
    .s-cal-day { display: flex; flex-wrap: wrap; align-items: flex-start; border-left: 0; }
    .s-cal-day + .s-cal-day { border-top: 1px solid var(--s-line); }
    .s-cal-dayhead { position: static; flex: none; width: 76px; min-height: 0; border-bottom: 0; background: transparent; }
    .s-cal-daybtn { justify-content: flex-start; padding: 10px 8px 10px var(--s-pad-sm); border-top: 0; border-left: 3px solid transparent; }
    .s-cal-day.is-today .s-cal-daybtn { border-left-color: var(--s-indicator); }
    .s-cal-allday, .s-cal-timed { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; padding: 0 var(--s-pad-sm) 8px; border-bottom: 0; background-image: none; }
    .s-cal-allday:empty { display: none; }
    .s-cal-allday .s-cal-entry.is-line { padding: 4px 8px 4px 7px; }
    .s-cal-allday .s-cal-entry-title { display: block; }
    .s-cal-allday + .s-cal-timed:has(> .s-cal-slot) { padding-top: 0; }
    .s-cal-day.is-free .s-cal-timed { flex: 1; align-self: center; padding: 0 var(--s-pad-sm) 0 0; }
    .s-cal-day.is-today .s-cal-timed, .s-cal-day.is-today .s-cal-allday, .s-cal-day.is-weekend .s-cal-timed, .s-cal-day.is-weekend .s-cal-allday { background-color: transparent; }
    .s-cal-slot { position: static; width: auto; height: auto; min-height: 0; padding: 0; }
    .s-cal-slot > .s-cal-entry, .s-cal-slot.is-short > .s-cal-entry { height: auto; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 8px 4px 7px; white-space: normal; }
    .s-cal-slot.is-short .s-cal-entry-person { display: block; }
    .s-cal-slot.is-short .s-cal-entry-title { white-space: normal; }
    .s-cal-none { display: block; color: var(--s-ink-3); }
    .s-cal.is-empty .s-cal-none { visibility: hidden; }
    .s-cal-empty { position: static; order: -1; padding: var(--s-pad-sm); border-bottom: 1px solid var(--s-line); }
    .s-cal-empty-box { box-shadow: none; }
    .s-cal-empty-box .s-empty { padding: 8px; }
    .s-cal-month { min-height: 0; grid-template-rows: auto repeat(var(--s-cal-weeks), minmax(48px, auto)); }
    .s-cal-monthhead, .s-cal-weekrow { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .s-cal-wk, .s-cal-chips { display: none; }
    .s-cal-monthday { padding: 6px 0; border-left: 0; text-align: center; }
    .s-cal-cell { align-items: center; padding: 4px 0; border-left: 0; }
    .s-cal-cellhead { flex-direction: column; gap: 2px; }
    .s-cal-count { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; background: var(--s-brand-tint); color: var(--s-brand); }
}

/* Toast content */
.s-toast { display: flex; align-items: flex-start; gap: 8px; padding: 12px; }
.s-toast > .s-icon { color: var(--s-tone); }
.s-toast.s-tone-neutral > .s-icon { color: var(--s-ink-3); }
.s-toast-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-toast-text { font-weight: 600; overflow-wrap: anywhere; }
.s-toast-details { margin: 0; padding: 0; list-style: none; color: var(--s-ink-2); }
.s-toast-action { appearance: none; flex: none; height: 24px; margin: -2px 0; padding: 0 8px; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-brand); font: inherit; font-weight: 600;
                  white-space: nowrap; cursor: pointer; }
.s-toast-action:hover { background: var(--s-fill); }
.s-toast-close { appearance: none; flex: none; width: 24px; height: 24px; margin: -2px -4px -2px 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent;
                 color: var(--s-ink-3); cursor: pointer; }
.s-toast-close:hover { background: var(--s-fill); color: var(--s-ink); }

/* Dialog content */
.s-app .s-dialog .s-dialog-title { margin: 0; font-family: var(--s-font-display); font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: normal; }
.s-dialog-text { margin: 0; color: var(--s-ink-2); }

/* MudBlazor under the Starruk components. It carries the menu, the toast, the dialog and the date picker; this
   layer puts those parts on the --s-* tokens, so they follow the profile and nothing of Material shows:
   no ripple, no capitals, no floating labels, Fluent elevation, corners and focus. Platforms never see Mud. */
.s-app .mud-ripple::after { content: none; }
.s-app .mud-popover { border: 1px solid var(--s-line); border-radius: var(--s-radius-control); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-16);
                      font-family: var(--s-font-body); font-size: var(--s-fs-body); line-height: var(--s-lh-body); transition-duration: var(--s-dur-fast) !important; }

/* Menu (Fluent: 4px around the list, 32px items with control corners, hint text at the right) */
.s-app .mud-menu.s-menu { display: inline-flex; }
.s-menu-keys { display: contents; }
.s-menu-chevron { margin: 0 -2px 0 -2px; color: var(--s-ink-3); }
.s-app .mud-popover.s-menu-pop { min-width: 168px; max-width: 360px; }
.s-app .mud-list.s-menu-list { display: flex; flex-direction: column; gap: 2px; padding: 4px; }
.s-app .mud-menu-item.s-menu-item { min-height: var(--s-control-h); margin: 0; padding: 0 8px; border-radius: var(--s-radius-control); color: var(--s-ink); cursor: pointer;
                                   transition: background var(--s-dur-fast) var(--s-ease); }
.s-app .mud-menu-item.s-menu-item:hover, .s-app .mud-menu-item.s-menu-item:focus { background: var(--s-fill); }
.s-app .mud-menu-item.s-menu-item:active { background: var(--s-pressed); }
.s-app .mud-menu-item.s-menu-item:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-app .mud-menu-item.s-menu-item[aria-disabled="true"] { background: transparent; color: var(--s-ink-disabled); cursor: not-allowed; }
.s-app .s-menu-item .mud-menu-item-text { flex: 1; min-width: 0; margin: 0; color: inherit; font: inherit; letter-spacing: normal; }
.s-menu-item-row { display: flex; align-items: center; gap: 8px; }
.s-menu-item-row > .s-icon { color: var(--s-ink-2); }
.s-menu-item:hover .s-menu-item-row > .s-icon { color: var(--s-brand); }
.s-menu-item[aria-disabled="true"] .s-menu-item-row > .s-icon { color: inherit; }
.s-menu-label { flex: 1; white-space: nowrap; }
.s-menu-hint { margin-left: 16px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-menu-check { flex: none; width: 16px; height: 16px; color: var(--s-brand); }

/* Toast (Fluent: a card with shadow 16 at the bottom right; the content carries icon, text and actions) */
.s-app .mud-snackbar { width: max-content; min-width: 292px; max-width: min(440px, calc(100vw - 32px)); min-height: 0; padding: 0; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface);
                       color: var(--s-ink); box-shadow: var(--s-shadow-16); font-family: var(--s-font-body); font-size: var(--s-fs-body); line-height: var(--s-lh-body); letter-spacing: normal; backdrop-filter: none; }
.s-app .mud-snackbar .mud-snackbar-content-message { flex: 1; min-width: 0; padding: 0; font: inherit; }

/* Dialog (Fluent: dialog corners, shadow 28 on a dimmed page, 24px inside) */
.s-app .mud-overlay .mud-overlay-scrim.mud-overlay-dark { background: rgba(0, 0, 0, .4); }
.s-app .mud-dialog.s-dialog { max-width: 480px; border: 1px solid var(--s-line); border-radius: var(--s-dialog-radius, var(--s-radius-dialog)); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-28);
                             font-family: var(--s-font-body); font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
/* A dialog with more to show than one question: two columns fit. */
.s-app .mud-dialog.s-dialog.is-wide { max-width: 760px; }
.s-app .s-dialog .mud-dialog-title.s-dialog-head { margin: 0; padding: 24px 24px 0; }
.s-app .s-dialog .mud-dialog-content.s-dialog-content { margin: 0; padding: 8px 24px 0; }
.s-app .s-dialog .mud-dialog-actions.s-dialog-actions { justify-content: flex-end; gap: 8px; margin: 0; padding: 24px; }
.s-app .s-dialog .s-dialog-actions > .s-btn { margin: 0; }

/* Date field: MudBlazor's picker input drawn as a Starruk input (stroke, 32px, focus underline) */
.s-datefield { display: block; }
.s-app .s-datefield .mud-picker, .s-app .s-datefield .mud-input-control { width: 100%; margin: 0; }
.s-app .s-datefield .mud-input.mud-input-outlined { position: relative; height: var(--s-control-h); padding: 0; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible);
                                                   border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); color: var(--s-ink); font: inherit; }
.s-app .s-datefield .mud-input.mud-input-outlined:hover { border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); border-bottom-color: var(--s-ink-2); }
.s-app .s-datefield .mud-input-outlined-border { display: none; }
.s-app .s-datefield .mud-input.mud-input-outlined::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: max(2px, var(--s-input-radius, var(--s-radius-control))); border-bottom: 2px solid var(--s-focus);
                                                          border-radius: 0 0 var(--s-input-radius, var(--s-radius-control)) var(--s-input-radius, var(--s-radius-control)); clip-path: inset(calc(100% - 2px) 0 0 0);
                                                          transform: scaleX(0); transition: transform 1ms; pointer-events: none; }
.s-app .s-datefield .mud-input.mud-input-outlined:focus-within::after { transform: scaleX(1); transition: transform var(--s-dur) var(--s-ease-out); }
.s-app .s-datefield .mud-input-root { height: 100%; padding: 0 0 0 10px; color: inherit; font-family: var(--s-font-body); font-size: var(--s-fs-control); font-weight: 400; line-height: var(--s-lh-body);
                                      letter-spacing: normal; font-variant-numeric: tabular-nums; }
.s-app .s-datefield input.mud-input-root:focus-visible { outline: none; }
.s-app .s-datefield input.mud-input-root::placeholder { color: var(--s-ink-3); opacity: 1; }
.s-app .s-datefield .mud-input-adornment { height: 100%; max-height: none; margin: 0; }
.s-app .s-datefield .mud-input-adornment .mud-icon-button { width: calc(var(--s-control-h) - 2px); height: calc(var(--s-control-h) - 2px); margin: 0; padding: 0; border-radius: var(--s-radius-control); color: var(--s-ink-3); }
.s-app .s-datefield .mud-input-adornment .mud-icon-button:hover { background: var(--s-fill); color: var(--s-brand); }
.s-app .s-datefield .mud-icon-root, .s-app .mud-picker-popover .mud-icon-root { width: 20px; height: 20px; font-size: 20px; }
.s-app .s-datefield.is-error .mud-input.mud-input-outlined, .s-app .s-datefield .mud-input.mud-input-error { border-color: var(--s-late); }
/* The message about a wrong date is the field's own, in Dutch, under the input. */
.s-app .s-datefield .mud-input-helper-text, .s-app .s-datefield .mud-input-control-helper-container { display: none; }

/* Calendar (control corners, the chosen day filled with the brand, today outlined) */
.s-app .mud-picker-popover { border-radius: var(--s-radius-card); }
.s-app .mud-picker-popover .mud-picker-inline-paper, .s-app .mud-picker-popover .mud-picker-paper { border-radius: inherit; background: transparent; box-shadow: none; }
.s-app .mud-picker-popover .mud-typography { font-family: var(--s-font-body); letter-spacing: normal; }
.s-app .mud-picker-popover .mud-button-month .mud-typography { font-weight: 600; text-transform: none; }
.s-app .mud-picker-popover .mud-day-label { color: var(--s-ink-3); }
.s-app .mud-picker-popover .mud-icon-button { border-radius: var(--s-radius-control); color: var(--s-ink-2); }
.s-app .mud-picker-popover .mud-icon-button:hover { background: var(--s-fill); color: var(--s-ink); }
.s-app .mud-picker-popover .mud-day { border-radius: var(--s-radius-control); color: var(--s-ink); font-family: var(--s-font-body); font-variant-numeric: tabular-nums; }
.s-app .mud-picker-popover .mud-day:hover { background: var(--s-fill); }
.s-app .mud-picker-popover .mud-day.mud-current { border: 1px solid var(--s-brand); color: var(--s-brand); font-weight: 600; }
.s-app .mud-picker-popover .mud-day.mud-selected { border-color: transparent; background: var(--s-primary); color: var(--s-on-primary); font-weight: 600; }
.s-app .mud-picker-popover button:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
    .s-app *, .s-app *::before, .s-app *::after { transition: none !important; animation: none !important; }
    .s-skeleton { opacity: 1; }
}

/* A note under the head of a list page, above its views and rows. */
.s-lp-notice { flex: none; margin: 0 0 12px; }

/* ===== Documents and mail: the building blocks ===== */

/* Tree: nodes that sit inside one another, such as folders. A row per node, indented by its level; the chosen node
   carries the indicator, as the selected destination of the navigation does. */
.s-tree, .s-tree-group { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.s-tree-node { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-tree-node.is-separated { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--s-line); }
.s-tree-item { position: relative; display: flex; align-items: center; gap: 6px; min-height: var(--s-tree-item-h, 32px); padding: 0 8px 0 calc(4px + var(--s-tree-level, 0) * 16px); border-radius: var(--s-radius-control);
               color: var(--s-ink-2); cursor: pointer; user-select: none; transition: background var(--s-dur-fast) var(--s-ease); }
.s-tree-item:hover { background: var(--s-fill); color: var(--s-ink); }
.s-tree-item:active { background: var(--s-pressed); }
.s-tree-item.is-selected { background: var(--s-selected); color: var(--s-ink); font-weight: 600; }
.s-tree-item.is-selected::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: var(--s-radius-bar); background: var(--s-indicator); }
.s-tree-item.is-over { background: var(--s-brand-tint); box-shadow: inset 0 0 0 1px var(--s-brand); }
.s-app .s-tree-item:focus-visible { outline-offset: -2px; }
.s-tree-toggle { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border-radius: var(--s-radius-small); color: var(--s-ink-3); }
.s-tree-toggle:hover { background: var(--s-pressed); color: var(--s-ink); }
.s-tree-item > .s-icon { color: var(--s-ink-3); }
.s-tree-item.is-selected > .s-icon { color: var(--s-brand); }
.s-tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-tree-item .s-counter { font-weight: 600; }

/* File icon: the colour says what a file is before its name is read. */
.s-fileicon { color: var(--s-ink-3); }
.s-fileicon.is-folder { color: var(--s-human); }
.s-fileicon-pdf { color: var(--s-late); }
.s-fileicon-image { color: var(--s-external); }
.s-fileicon-sheet { color: var(--s-done); }
.s-fileicon-word, .s-fileicon-text, .s-fileicon-markdown, .s-fileicon-mail { color: var(--s-brand); }
.s-fileicon-slides { color: var(--s-accent-text); }
.s-fileicon-audio, .s-fileicon-video, .s-fileicon-code { color: var(--s-auto); }

/* Upload button: the browser's own file input, out of sight, under a Starruk button that is its label. */
.s-upload { position: relative; display: inline-flex; }
.s-upload-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.s-upload > .s-btn { cursor: pointer; }
.s-upload-input:focus-visible + .s-btn { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-upload.is-disabled > .s-btn { background-color: var(--s-fill); background-image: none; border-color: var(--s-line); color: var(--s-ink-disabled) !important; cursor: not-allowed; pointer-events: none; }

/* Drop zone: while files hang over it a veil says where they land; the file input under the veil takes them. */
.s-drop { position: relative; min-width: 0; }
.s-drop-veil { position: absolute; inset: 0; z-index: 6; display: none; place-items: center; padding: var(--s-pad); border-radius: inherit;
               background: color-mix(in srgb, var(--s-surface) 90%, transparent); box-shadow: inset 0 0 0 2px var(--s-brand); }
.s-drop.is-over > .s-drop-veil { display: grid; animation: s-fade-in var(--s-dur-fast) linear; }
.s-drop-card { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 48ch; text-align: center; pointer-events: none; }
.s-drop-card > .s-icon { margin-bottom: 4px; color: var(--s-brand); }
.s-drop-title { font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-drop-hint { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: copy; }

/* Choice dialog: the answers as a list of the browser's own radio buttons; a level indents, as in a tree. */
.s-choices { display: flex; flex-direction: column; gap: 2px; max-height: min(52vh, 420px); margin: 8px -8px 0; padding: 2px 8px; overflow-y: auto; }
.s-choice { position: relative; display: flex; align-items: center; gap: 8px; min-height: var(--s-control-h); padding: 0 8px 0 calc(8px + var(--s-choice-level, 0) * 20px); border-radius: var(--s-radius-control); cursor: pointer; }
.s-choice::before { content: ""; flex: none; width: 16px; height: 16px; border: 1px solid var(--s-line-accessible); border-radius: var(--s-radius-round); background: var(--s-surface); }
.s-choice.is-selected::before { border: 5px solid var(--s-primary); }
.s-choice:hover { background: var(--s-fill); }
.s-choice.is-selected { background: var(--s-selected); font-weight: 600; }
.s-choice-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.s-choice:has(.s-choice-input:focus-visible) { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-choice > .s-icon { color: var(--s-ink-3); }
.s-choice.is-selected > .s-icon { color: var(--s-brand); }
.s-choice-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.s-choice-note { flex: none; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 400; }

/* Mail body: text in the app's own letters, or the cleaned HTML on white paper in a frame without script rights. */
.s-mailbody { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.s-mailbody > .s-msg { flex: none; flex-wrap: wrap; }
.s-mailbody > .s-msg > .s-msg-body { flex: 1 1 220px; }
.s-mailbody-frame { flex: 1; width: 100%; min-height: 240px; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); background: #fff; }
.s-mailbody-text { flex: 1; min-height: 0; padding: 4px 0 8px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.s-app .s-mailbody-text:focus-visible { outline-offset: -2px; }

/* Prose: running text a person wrote, such as a Markdown file: headings, paragraphs, lists, tables and code in the
   type ramp of the library. Text keeps a readable measure; a wide table scrolls in its own box. */
.s-prose { min-width: 0; color: var(--s-ink); overflow-wrap: anywhere; }
.s-prose > * { max-width: 88ch; margin: 0 0 12px; }
.s-prose > :last-child { margin-bottom: 0; }
.s-prose h3, .s-prose h4, .s-prose h5, .s-prose h6 { margin: 20px 0 8px; font-family: var(--s-font-display); font-weight: 600; }
.s-prose > :first-child { margin-top: 0; }
.s-prose h3 { font-size: 20px; line-height: 28px; }
.s-prose h4 { font-size: var(--s-fs-section); line-height: var(--s-lh-section); }
.s-prose h5, .s-prose h6 { font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
.s-prose ul, .s-prose ol { padding-left: 24px; }
.s-prose li { margin: 2px 0; }
.s-prose li > ul, .s-prose li > ol { margin: 2px 0; }
.s-prose code { padding: 1px 4px; border-radius: var(--s-radius-small); background: var(--s-fill); font-family: var(--s-font-mono); font-size: 13px; }
.s-prose pre { max-width: none; padding: var(--s-pad-sm); border-radius: var(--s-radius-control); background: var(--s-fill); overflow-x: auto; overflow-wrap: normal; }
.s-prose pre code { padding: 0; background: none; white-space: pre; }
.s-prose blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--s-line-strong); color: var(--s-ink-2); }
.s-prose blockquote > p { margin: 0; }
.s-prose hr { height: 1px; border: 0; background: var(--s-line); }
.s-prose table { display: block; width: max-content; max-width: 100%; border-collapse: collapse; overflow-x: auto; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.s-prose th, .s-prose td { min-width: 72px; max-width: 48ch; padding: 6px 10px; border-bottom: 1px solid var(--s-line); text-align: left; vertical-align: top; }
.s-prose th { color: var(--s-ink-2); font-weight: 600; white-space: nowrap; }

/* A step of a path that leads somewhere is a button when the page handles it itself. */
button.s-crumb { appearance: none; margin: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
button.s-crumb:hover { background: var(--s-fill); color: var(--s-ink) !important; }
button.s-crumb:active { background: var(--s-pressed); }

/* ===== Documents page: an application frame like the list page. The bar and the footer stay; the folders, the
   files and the pane of the current file scroll by themselves. ===== */
.s-main-inner:has(> .s-dp), .s-main-inner:has(> .s-mp) { max-width: none; }
.s-dp > .s-lp-notice, .s-mp > .s-lp-notice { margin: 0; }
.s-dp { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--s-appbar-h) - var(--s-page-pad-y) * 2); min-height: 480px; margin-bottom: calc(var(--s-page-pad-y) * -1); container: s-page / inline-size; }
.s-dp-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.s-dp-card > .s-cmdbar { flex: none; border-bottom: 1px solid var(--s-line); }
.s-dp .s-cmdbar .s-search { width: 208px; }
.s-dp-tool-columns { display: contents; }
.s-dp-body { flex: 1; min-height: 0; display: flex; }
.s-dp-nav { flex: none; width: 248px; padding: 8px; overflow-y: auto; border-right: 1px solid var(--s-line); scrollbar-width: thin; }
.s-dp-nav-loading, .s-dp-pane-loading { display: flex; flex-direction: column; gap: 14px; padding: 10px 8px; }
.s-dp-pane-loading { padding: var(--s-pad); }
.s-dp-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.s-dp-pathbar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px var(--s-pad-sm) 4px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-dp-place { display: none; flex: 1; min-width: 0; }
.s-dp-place .s-select { display: flex; }
.s-dp-path { flex: 1; min-width: 0; }
.s-dp-drop { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.s-dp-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.s-dp-open { appearance: none; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--s-ink); font: inherit; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.s-dp-open:hover { color: var(--s-brand); text-decoration: underline; }
.s-dp-lock { flex: none; display: inline-flex; color: var(--s-human); }
.s-dp-sub { display: block; margin: -2px 0 4px 28px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow: hidden; text-overflow: ellipsis; }
.s-dp-row[draggable="true"] { cursor: grab; }

/* Tiles: the same files as cards, an image as itself and anything else as its icon. */
.s-dp-tiles { list-style: none; margin: 0; padding: var(--s-pad-sm) var(--s-pad); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 152px), 1fr)); gap: var(--s-pad-sm); align-content: start; }
.s-dp-tile { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--s-line); border-radius: var(--s-card-radius, var(--s-radius-card)); background-color: var(--s-surface);
             cursor: default; user-select: none; transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-dp-tile:hover { background-image: linear-gradient(var(--s-fill), var(--s-fill)); box-shadow: var(--s-shadow-4); }
.s-dp-tile.is-selected, .s-dp-tile.is-selected:hover { border-color: var(--s-brand-line); background-image: linear-gradient(var(--s-brand-tint), var(--s-brand-tint)); }
.s-dp-tile.is-folder { cursor: pointer; }
.s-app .s-dp-tile:focus-visible { outline-offset: -2px; }
.s-dp-tile-art { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 6px; border-radius: var(--s-radius-control); background: var(--s-bg); overflow: hidden; }
.s-dp-tile-img { width: 100%; height: 100%; object-fit: cover; }
.s-dp-tile-art > .s-dp-lock { position: absolute; right: 6px; bottom: 6px; }
.s-dp-tile-check { position: absolute; left: 14px; top: 14px; z-index: 1; opacity: 0; transition: opacity var(--s-dur-fast) var(--s-ease); }
.s-dp-tile:hover .s-dp-tile-check, .s-dp-tile.is-selected .s-dp-tile-check, .s-dp-tile:focus-within .s-dp-tile-check, .s-dp-tile:focus-visible .s-dp-tile-check { opacity: 1; }
@media (hover: none) { .s-dp-tile-check { opacity: 1; } }
.s-dp-tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-weight: 600; }
.s-dp-tile-meta { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }

/* Uploads: one line per file on its way in, with how far it is. */
.s-dp-uploads { flex: none; max-height: 34%; overflow-y: auto; border-top: 1px solid var(--s-line); }
.s-dp-uploads-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 2px var(--s-pad-sm) 2px var(--s-pad); }
.s-dp-uploads-list { list-style: none; margin: 0; padding: 0 var(--s-pad) 8px; display: flex; flex-direction: column; gap: 4px; }
.s-dp-upload { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.s-dp-upload-name { flex: 0 1 280px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-dp-bar { flex: 1; min-width: 48px; height: 4px; border-radius: var(--s-radius-bar); background: var(--s-selected); overflow: hidden; }
.s-dp-bar > span { display: block; height: 100%; background: var(--s-primary); transition: width var(--s-dur-fast) linear; }
.s-dp-upload-state { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-dp-upload.is-done .s-dp-upload-state { color: var(--s-done); }
.s-dp-upload.is-error .s-dp-upload-state { flex: 1; min-width: 0; color: var(--s-late); }
.s-dp-upload .s-btn { min-width: 0; }

/* The pane of the current file: a preview, its details, its versions and who it is shared with. */
.s-dp-pane { flex: none; width: clamp(320px, 30%, 560px); min-height: 0; display: none; flex-direction: column; border-left: 1px solid var(--s-line); background: var(--s-surface); }
.s-dp.has-details .s-dp-pane { display: flex; }
.s-dp-pane > .s-empty { margin: auto 0; }
.s-dp-pane-head { flex: none; display: flex; align-items: center; gap: 10px; padding: var(--s-pad-sm) var(--s-pad) 4px; }
.s-dp-pane-back { display: none; margin-left: -8px; }
.s-dp-pane-heading { min-width: 0; display: flex; flex-direction: column; }
.s-dp-pane-title { margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; overflow-wrap: anywhere; }
.s-dp-pane-title:focus { outline: none; }
.s-dp-pane-sub { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-dp-pane-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px var(--s-pad) 0; }
.s-dp-pane > .s-tabs { --s-tab-h: 40px; flex: none; padding: 0 4px; }
.s-dp-pane-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; scrollbar-width: thin; }
.s-dp-pane-foot { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: var(--s-pad-sm) var(--s-pad); border-top: 1px solid var(--s-line); }
.s-dp-pane-foot:empty { display: none; }
.s-dp-preview-frame { flex: 1; width: 100%; min-height: 320px; border: 0; background: var(--s-bg); }
.s-dp-preview-image { flex: 1; min-height: 200px; display: grid; place-items: center; padding: var(--s-pad-sm); background: var(--s-bg); }
.s-dp-preview-image > img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: var(--s-shadow-4); }
.s-dp-preview-text { flex: 1; margin: 0; padding: var(--s-pad-sm) var(--s-pad); color: var(--s-ink); font-family: var(--s-font-mono); font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.s-app .s-dp-preview-text:focus-visible { outline-offset: -2px; }
.s-dp-preview-prose { flex: 1; padding: var(--s-pad-sm) var(--s-pad) var(--s-pad); }
.s-app .s-dp-preview-prose:focus-visible { outline-offset: -2px; }
.s-dp-preview-note { flex: none; margin: 0; padding: 8px var(--s-pad); border-top: 1px solid var(--s-line); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-dp-preview-none { flex: 1; display: grid; place-items: center; }
.s-dp-facts { border-top: 0; }
.s-dp-kind { align-items: center; }
.s-dp-kind .s-select { display: flex; min-width: 168px; }
.s-dp-edit { padding: 2px 0; }
.s-dp-versions { list-style: none; margin: 0; padding: 0; }
.s-dp-version { display: flex; align-items: center; gap: 12px; padding: 8px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-dp-version-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-dp-version-title { display: flex; align-items: center; gap: 8px; }
.s-dp-version-meta { color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow-wrap: anywhere; }
.s-dp-version-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.s-dp-version-actions .s-btn { min-width: 0; }
.s-dp-sharing { display: flex; flex-direction: column; gap: 12px; padding: var(--s-pad-sm) var(--s-pad); }
.s-dp-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.s-dp-share-row > .s-input { flex: 1 1 160px; }
.s-dp-share-row > .s-btn { min-width: 0; }
.s-dp-shares { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.s-dp-share { display: flex; align-items: center; gap: 8px; min-height: 48px; border-top: 1px solid var(--s-line); }
.s-dp-share > .s-persona { flex: 1; }
.s-dp-share .s-btn { min-width: 0; }

/* Less room: first the folders and the pane take less, then the folders are a dropdown above the files. */
@container s-page (max-width: 1280px) {
    .s-dp-nav { width: 208px; }
    .s-dp-pane { width: 320px; }
}
@container s-page (max-width: 1000px) {
    .s-dp-nav, .s-dp-path { display: none; }
    .s-dp-place { display: block; }
}
@media (max-width: 860px) { .s-dp { height: auto; min-height: 0; margin-bottom: 0; } .s-dp-body { min-height: 50vh; } }
/* A phone: nothing scrolls sideways. The bar wraps, the rows are cards (as on a list page), and the pane of a file is
   a sheet over the list with a way back. */
@container s-page (max-width: 700px) {
    .s-dp-card > .s-cmdbar { flex-wrap: wrap; }
    .s-dp-card > .s-cmdbar > .s-cmdbar-far { flex: 1 1 240px; flex-wrap: wrap; }
    .s-dp .s-cmdbar .s-search { flex: 1 1 120px; width: auto; min-width: 0; }
    .s-dp .s-cmdbar [data-tool="details"], .s-dp-tool-columns { display: none; }
    .s-dp-pane, .s-dp.has-details .s-dp-pane { display: none; }
    .s-dp.has-sheet .s-dp-pane { position: fixed; inset: var(--s-appbar-h) 0 0 0; z-index: 15; display: flex; width: auto; border-left: 0; }
    .s-dp-pane-back { display: inline-flex; }
    .s-dp-tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); padding: var(--s-pad-sm); }
    .s-dp-upload-name { flex-basis: 120px; }
    .s-dp-sub { margin-left: 28px; }
}
/* A size container is the containing block of position: fixed (the spec, and Firefox): the sheet hung from the list
   instead of from the screen. While the sheet of a file is open on a phone, the documents page is no container; the
   sheet itself comes from the width of the screen. The list behind it then falls back to its wide layout, so the page
   clips it: nothing pushes the page wider while the sheet covers it. */
@media (max-width: 740px) {
    .s-dp.has-sheet { container-type: normal; overflow: clip; max-width: 100%; }
    .s-dp.has-sheet .s-dp-pane { position: fixed; inset: var(--s-appbar-h) 0 0 0; z-index: 15; display: flex; width: auto; border-left: 0; }
    .s-dp.has-sheet .s-dp-pane-back { display: inline-flex; }
}

/* ===== Mail page: an application frame. Folders, messages and the reading pane side by side; each scrolls by itself. ===== */
.s-mp { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--s-appbar-h) - var(--s-page-pad-y) * 2); min-height: 520px; margin-bottom: calc(var(--s-page-pad-y) * -1); container: s-page / inline-size; }
.s-mp-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.s-mp-card > .s-cmdbar { flex: none; border-bottom: 1px solid var(--s-line); }
.s-mp .s-cmdbar .s-search { width: 208px; }
.s-mp-filter { display: inline-flex; }
.s-mp-body { flex: 1; min-height: 0; display: flex; }
.s-mp-folders { flex: none; width: 216px; padding: 8px; overflow-y: auto; border-right: 1px solid var(--s-line); scrollbar-width: thin; }
.s-mp-list { flex: none; width: clamp(300px, 28%, 440px); min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--s-line); }
.s-mp-listhead { flex: none; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px var(--s-pad-sm) 4px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-mp-folderselect { display: none; flex: 1; min-width: 0; }
.s-mp-folderselect .s-select { display: flex; }
.s-mp-foldername { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-mp-count { flex: none; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-mp-rows { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.s-mp-row { position: relative; display: flex; gap: 10px; padding: 8px var(--s-pad-sm) 9px var(--s-pad); border-bottom: 1px solid var(--s-line); cursor: default; user-select: none; }
.s-mp-row:hover { background: var(--s-fill); }
.s-mp-row.is-checked { background: var(--s-selected); }
.s-mp-row.is-open, .s-mp-row.is-open:hover { background: var(--s-brand-tint); }
/* Unread: the indicator along the row, and the sender and the subject in semibold. Never colour alone. */
.s-mp-row.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--s-indicator); }
.s-app .s-mp-row:focus-visible { outline-offset: -2px; }
.s-mp-row-check { flex: none; padding-top: 1px; }
.s-mp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-mp-row-top { display: flex; align-items: baseline; gap: 8px; }
.s-mp-row-who { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--s-ink); }
.s-mp-row-top > .s-counter { align-self: center; }
.s-mp-row-when { flex: none; margin-left: auto; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-mp-row-subject { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--s-ink-2); }
.s-mp-row-subjecttext { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-mp-row-subject > .s-icon { flex: none; color: var(--s-ink-3); }
.s-mp-row-subject > .s-mp-flag { color: var(--s-late); }
.s-mp-row-preview { min-height: var(--s-lh-caption); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-mp-row.is-unread .s-mp-row-who, .s-mp-row.is-unread .s-mp-row-subject { color: var(--s-ink); font-weight: 600; }
.s-mp-row.is-unread .s-mp-row-when { color: var(--s-brand); font-weight: 600; }
.s-mp-row.is-loading .s-mp-row-main { gap: 10px; padding: 4px 0; }
.s-mp-draftmark { flex: none; color: var(--s-late); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-mp-more { flex: none; display: flex; justify-content: center; padding: 6px; border-top: 1px solid var(--s-line); }
.s-mp-list > .s-lp-empty { flex: 1; }

/* The reading pane: the conversation, one message open at a time so its text has the height. */
.s-mp-read { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.s-mp-read-empty { flex: 1; display: grid; place-items: center; }
.s-mp-read-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px var(--s-pad-sm) 6px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-mp-back { display: none; margin-left: -8px; }
.s-mp-subject { flex: 1; min-width: 0; margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; overflow-wrap: anywhere; }
.s-mp-subject:focus { outline: none; }
.s-mp-threadcount { flex: none; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-mp-links { flex: none; list-style: none; margin: 0; padding: 8px var(--s-pad) 0; display: flex; flex-wrap: wrap; gap: 6px; }
.s-app .s-mp-links a.s-tag-value { color: var(--s-brand); }
.s-mp-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
.s-mp-msg { flex: none; display: flex; flex-direction: column; border-bottom: 1px solid var(--s-line); }
.s-mp-msg:last-child { border-bottom: 0; }
.s-mp-msg.is-open { flex: 1 0 auto; min-height: 360px; padding-bottom: var(--s-pad-sm); }
.s-mp-msg-head { display: flex; align-items: center; gap: 4px; padding-right: var(--s-pad-sm); }
.s-mp-msg-toggle { appearance: none; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin: 0; padding: 6px 8px 6px var(--s-pad); border: 0; background: transparent;
                   color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
.s-mp-msg-toggle:hover { background: var(--s-fill); }
.s-app .s-mp-msg-toggle:focus-visible { outline-offset: -2px; }
.s-mp-msg.is-unread .s-persona-name { font-weight: 600; }
.s-mp-msg-when { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-mp-msg-actions { flex: none; display: flex; gap: 2px; }
.s-mp-recipients { flex: none; margin: 0; padding: 0 var(--s-pad) 8px calc(var(--s-pad) + 40px); display: flex; flex-direction: column; gap: 2px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-mp-recipients > div { display: flex; gap: 6px; }
.s-mp-recipients dt { flex: none; color: var(--s-ink-3); }
.s-mp-recipients dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.s-mp-attachments { flex: none; list-style: none; margin: 0; padding: 0 var(--s-pad) 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.s-mp-attachments > li { min-width: 0; max-width: 100%; display: inline-flex; }
.s-mp-attachment { min-width: 0; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; min-height: var(--s-control-h); padding: 0 6px 0 8px; border: 1px solid var(--s-line-strong); border-radius: var(--s-radius-control);
                   background: var(--s-surface); color: var(--s-ink) !important; text-decoration: none !important; }
.s-app a.s-mp-attachment:hover { background: var(--s-fill); border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); }
.s-mp-attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-mp-attachment-size { flex: none; margin-right: 4px; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-mp-msg-draft { flex: none; padding: 0 var(--s-pad) 8px; }
.s-mp-msg > .s-mailbody { padding: 0 var(--s-pad); }
.s-mp-msg > .s-dp-pane-loading { padding-top: 4px; }

/* The compose form, in the place of the reading pane. */
.s-mp-compose { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.s-mp-compose > .s-msg { flex: none; margin: 8px var(--s-pad) 0; }
.s-mp-compose-fields { flex: none; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: var(--s-pad-sm) var(--s-pad); }
.s-mp-compose-label { color: var(--s-ink-2); }
.s-mp-compose-to { min-width: 0; display: flex; align-items: center; gap: 8px; }
.s-mp-compose-to > .s-input { flex: 1; }
.s-mp-compose-to > .s-btn { min-width: 0; }
.s-mp-compose-text { flex: 1; min-height: 180px; margin: 0 var(--s-pad) var(--s-pad-sm); padding: 8px 10px; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible); border-radius: var(--s-input-radius, var(--s-radius-control));
                     background: var(--s-surface); color: var(--s-ink); font-family: inherit; font-size: var(--s-fs-control); line-height: var(--s-lh-body); resize: none; }
.s-app .s-mp-compose-text:focus-visible { outline: none; border-bottom: 2px solid var(--s-focus); padding-bottom: 7px; }
.s-mp-compose > .s-mp-attachments { padding-bottom: var(--s-pad-sm); }
.s-mp-compose .s-mp-attachment { padding-right: 2px; }
.s-mp-compose-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: var(--s-pad-sm) var(--s-pad); border-top: 1px solid var(--s-line); }
.s-mp-compose-foot .s-btn { min-width: 0; }
.s-mp-compose-foot .s-btn-primary { min-width: 96px; }
.s-mp-me { color: var(--s-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Less room: first the folders are a dropdown above the messages, then the reading pane stands under the list. */
@container s-page (max-width: 1240px) {
    .s-mp-folders { width: 184px; }
    .s-mp-list { width: 300px; }
}
@container s-page (max-width: 1000px) {
    .s-mp-folders, .s-mp-foldername { display: none; }
    .s-mp-folderselect { display: block; }
    .s-mp-list { width: clamp(300px, 36%, 400px); }
}
@container s-page (max-width: 900px) {
    .s-mp-body { flex-direction: column; }
    .s-mp-list { flex: 0 0 42%; width: auto; min-height: 180px; border-right: 0; border-bottom: 1px solid var(--s-line); }
}
/* On a phone the mailbox is part of the page: one scroll, not a pane that scrolls inside a page that scrolls. */
@media (max-width: 748px) { .s-mp { height: auto; min-height: 0; margin-bottom: 0; } .s-mp-list { min-height: 40vh; } }
/* A phone: the list or the reading pane, one at a time, with a way back. */
@container s-page (max-width: 700px) {
    .s-mp-card > .s-cmdbar { flex-wrap: wrap; }
    .s-mp-card > .s-cmdbar > .s-cmdbar-far { flex: 1 1 240px; flex-wrap: wrap; }
    .s-mp .s-cmdbar .s-search { flex: 1 1 120px; width: auto; min-width: 0; }
    .s-mp-filter { flex: 1 1 120px; min-width: 0; }
    .s-mp-filter .s-select { flex: 1; }
    .s-mp-list { flex: 1 1 auto; border-bottom: 0; }
    .s-mp-read, .s-mp.is-reading .s-mp-list { display: none; }
    .s-mp.is-reading .s-mp-read { display: flex; }
    .s-mp-back { display: inline-flex; }
    /* While a message is read or written, what belongs to the list (search, filter) makes room. */
    .s-mp.is-reading .s-mp-card > .s-cmdbar > .s-cmdbar-far { display: none; }
    .s-mp-rows, .s-mp-thread, .s-mp-compose { overflow: visible; }
    .s-mp-read-head { position: sticky; top: var(--s-appbar-h); z-index: 2; background: var(--s-surface); }
    .s-mp-msg-head { flex-wrap: wrap; padding-right: 0; }
    .s-mp-msg-toggle { flex: 1 1 100%; padding-right: var(--s-pad-sm); }
    .s-mp-msg-actions { margin-left: auto; padding: 0 var(--s-pad-sm) 4px; }
    .s-mp-recipients { padding-left: var(--s-pad); }
    .s-mp-msg-when { flex: none; }
    .s-mp-msg.is-open .s-mailbody-frame { min-height: 62vh; }
    .s-mp-compose-text { min-height: 40vh; }
    .s-mp-compose-fields { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .s-mp-compose-label { margin-top: 6px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
}

/* ===== Third wave, input: phone, e-mail, IBAN, postcode, colour, signature, slider, rating, code of digits, code editor ===== */

.s-iban .s-input-el { letter-spacing: .02em; }

/* Postcode and house number: two boxes side by side, the postcode as wide as a postcode is */
.s-postcode-row { display: flex; gap: 8px; min-width: 0; }
.s-postcode-code { flex: 0 1 112px; min-width: 88px; }
.s-postcode-code .s-input-el { text-transform: uppercase; font-variant-numeric: tabular-nums; }
.s-postcode-number { flex: 0 1 88px; min-width: 64px; }
.s-postcode-found { color: var(--s-ink); }
.s-postcode-found > .s-icon { color: var(--s-done); }

/* Colour: the swatch at the end of the box is the colour picker of the browser; a palette stands under the field */
.s-color { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s-color-swatch { position: relative; flex: none; width: 20px; height: 20px; border: 1px solid var(--s-line-accessible); border-radius: var(--s-radius-small); background: var(--s-color-value, transparent); cursor: pointer; }
.s-color-swatch.is-empty { background: linear-gradient(to top right, transparent calc(50% - 1px), var(--s-late) 50%, transparent calc(50% + 1px)); }
.s-color-swatch:focus-within { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-color-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: inherit; }
.s-color-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.s-color-chip { appearance: none; width: 24px; height: 24px; margin: 0; padding: 0; border: 1px solid var(--s-line-accessible); border-radius: var(--s-radius-small); background: var(--s-color-value); cursor: pointer; }
.s-color-chip:hover { border-color: var(--s-ink); }
.s-color-chip.is-active { outline: 2px solid var(--s-ink); outline-offset: 1px; }
.s-color-chip:disabled { cursor: not-allowed; opacity: .5; }

/* Signature pad: a field of three by one, with the line to sign on; the ink is the text colour */
.s-sig { max-width: 600px; }
.s-sig-pad { position: relative; aspect-ratio: 3 / 1; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible); border-radius: var(--s-input-radius, var(--s-radius-control));
             background: var(--s-surface); touch-action: none; cursor: crosshair; overflow: hidden; }
.s-sig-pad.is-readonly, .s-sig-pad[data-readonly="true"] { cursor: default; background: transparent; }
.s-field.is-error .s-sig-pad { border-color: var(--s-late); }
.s-sig-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.s-sig-ink path { fill: none; stroke: var(--s-ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.s-sig-line { position: absolute; left: 6%; right: 6%; bottom: 24%; height: 1px; background: var(--s-line-accessible); pointer-events: none; }
.s-sig-hint { position: absolute; left: 0; right: 0; top: 34%; text-align: center; color: var(--s-ink-3); pointer-events: none; }
.s-sig-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s-sig-foot .s-btn { min-width: 0; }

/* Slider: the range input of the browser, with the part up to the handle in the primary colour */
.s-slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.s-slider-value { color: var(--s-ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-slider-el { appearance: none; -webkit-appearance: none; width: 100%; height: 20px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
.s-slider-el::-webkit-slider-runnable-track { height: 4px; border-radius: var(--s-radius-bar); background: linear-gradient(to right, var(--s-primary) var(--s-slider-at, 0%), var(--s-line-accessible) var(--s-slider-at, 0%)); }
.s-slider-el::-moz-range-track { height: 4px; border-radius: var(--s-radius-bar); background: linear-gradient(to right, var(--s-primary) var(--s-slider-at, 0%), var(--s-line-accessible) var(--s-slider-at, 0%)); }
.s-slider-el::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 2px solid var(--s-surface); border-radius: var(--s-radius-round); background: var(--s-primary); box-shadow: 0 0 0 1px var(--s-line-accessible); }
.s-slider-el::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--s-surface); border-radius: var(--s-radius-round); background: var(--s-primary); box-shadow: 0 0 0 1px var(--s-line-accessible); }
.s-slider-el:hover::-webkit-slider-thumb { background: var(--s-primary-hover); }
.s-app .s-slider-el:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; border-radius: var(--s-radius-control); }
.s-slider.is-disabled .s-slider-el { cursor: not-allowed; opacity: .5; }
.s-slider-limits { display: flex; justify-content: space-between; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; }

/* Rating: stars of our own, an outline with the same star filled over it as wide as it counts */
.s-rating { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset.s-rating { display: flex; flex-direction: column; gap: 4px; }
fieldset.s-rating > legend { padding: 0; }
span.s-rating { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.s-rating-row { display: flex; align-items: center; gap: 2px; }
.s-rating-star { position: relative; flex: none; display: inline-grid; width: 28px; height: 28px; place-items: center; cursor: pointer; }
.s-rating.is-readonly .s-rating-star, .s-rating.is-small .s-rating-star { width: 18px; height: 18px; cursor: default; }
.s-rating.is-small:not(.is-readonly) .s-rating-star { width: 22px; height: 22px; cursor: pointer; }
.s-rating-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.s-rating-shape { width: 100%; height: 100%; overflow: visible; }
.s-rating-edge { fill: none; stroke: var(--s-line-accessible); stroke-width: 1.5; stroke-linejoin: round; }
.s-rating-full { fill: var(--s-human); stroke: color-mix(in srgb, var(--s-human) 70%, var(--s-ink)); stroke-width: 1.5; stroke-linejoin: round; clip-path: inset(-2px calc(100% - var(--s-rating-fill, 0%)) -2px -2px); }
.s-rating-star:hover .s-rating-edge { stroke: var(--s-ink); }
.s-rating-star:has(.s-rating-input:focus-visible) { outline: 2px solid var(--s-focus); outline-offset: 1px; border-radius: var(--s-radius-small); }
.s-rating-text { margin-left: 6px; color: var(--s-ink-2); font-variant-numeric: tabular-nums; }
.s-rating-clear { margin-left: 8px; }
fieldset.s-rating:disabled .s-rating-star { cursor: not-allowed; opacity: .5; }

/* A code of digits: one field, drawn as a row of boxes. Each digit stands in the middle of its box: the letters are
   as far apart as a box is wide, in a font where every digit has the same width. */
.s-otp-box { --s-otp-cell: 40px; --s-otp-gap: 8px; position: relative; display: inline-block; width: calc(var(--s-otp-length) * (var(--s-otp-cell) + var(--s-otp-gap)) - var(--s-otp-gap)); max-width: 100%; height: calc(var(--s-otp-cell) + 4px); }
.s-otp-cells { position: absolute; inset: 0; display: flex; gap: var(--s-otp-gap); pointer-events: none; }
.s-otp-cell { flex: 1 1 0; min-width: 0; border: 1px solid var(--s-line-strong); border-bottom-color: var(--s-line-accessible); border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); }
.s-field.is-error .s-otp-cell { border-color: var(--s-late); }
.s-otp-el { position: absolute; inset: 0; width: calc(100% + var(--s-otp-cell)); height: 100%; margin: 0; padding: 0 0 0 calc((var(--s-otp-cell) - 1ch) / 2); border: 0; background: transparent; color: var(--s-ink);
            font: 600 20px/1 var(--s-font-mono); letter-spacing: calc(var(--s-otp-cell) + var(--s-otp-gap) - 1ch); caret-color: var(--s-ink); }
.s-app .s-otp-el:focus-visible { outline: none; }
.s-otp-box:focus-within .s-otp-cell { border-bottom-color: var(--s-focus); box-shadow: inset 0 -1px 0 var(--s-focus); }
.s-otp-box:focus-within { outline: 2px solid var(--s-focus); outline-offset: 2px; border-radius: var(--s-radius-control); }
.s-otp-box { overflow: hidden; }
.s-otp-el:disabled { color: var(--s-ink-disabled); }

/* Code editor: the colours of the pieces of a line. The text box is see-through then and its mirror shows the text;
   a selection lets the letters under it through. Only colour: a colour never changes the width of a letter. */
.s-te[data-colors="on"] .s-te-lines { visibility: visible; color: var(--s-ink); }
.s-te[data-colors="on"] .s-te-area { color: transparent; }
.s-te[data-colors="on"] .s-te-area::selection { background: color-mix(in srgb, var(--s-brand) 28%, transparent); color: transparent; }
.s-te[data-colors="on"] .s-te-hit { color: var(--s-ink); }
.s-tk-kw, .s-tk-dir { color: var(--s-brand); }
.s-tk-str { color: color-mix(in srgb, var(--s-done) 78%, var(--s-ink)); }
.s-tk-num, .s-tk-lit { color: color-mix(in srgb, var(--s-external) 70%, var(--s-ink)); }
.s-tk-com { color: var(--s-ink-3); }
.s-tk-typ { color: color-mix(in srgb, var(--s-auto) 70%, var(--s-ink)); }
.s-tk-att { color: color-mix(in srgb, var(--s-late) 62%, var(--s-ink)); }
.s-tk-head, .s-tk-mark { color: var(--s-ink); text-decoration: underline; text-decoration-color: var(--s-line-accessible); text-underline-offset: 3px; }

/* ===== Third wave, display: image, gallery, lightbox, file preview, avatar group, presence, time, diff, JSON, codes ===== */

/* Image: with a ratio the box is there before the picture is */
.s-image { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-image-el { display: block; max-width: 100%; height: auto; border-radius: var(--s-radius-control); }
.s-image[style*="--s-image-ratio"] .s-image-el, .s-gallery .s-image-el { width: 100%; aspect-ratio: var(--s-image-ratio); object-fit: cover; background: var(--s-fill); }
.s-image.is-contain .s-image-el { object-fit: contain; }
.s-image-open { appearance: none; display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: var(--s-radius-control); background: none; cursor: zoom-in; }
.s-image-none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; aspect-ratio: var(--s-image-ratio, auto); padding: 12px; border: 1px dashed var(--s-line-accessible);
                border-radius: var(--s-radius-control); background: var(--s-bg); color: var(--s-ink-2); text-align: center; }
.s-image-caption { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }

.s-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--s-gallery-tile, 140px)), 1fr)); gap: 8px; }
.s-gallery-tile { appearance: none; display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: var(--s-radius-control); background: none; cursor: zoom-in; overflow: hidden; }
.s-gallery-tile:hover .s-image-el { filter: brightness(.92); }

/* Lightbox: the dialog of the browser, as large as the screen and dark whatever the theme: the picture is what counts */
.s-lightbox { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 12, 14, .94); color: #fff; z-index: 60; }
.s-lightbox:not([open]) { display: none; }
.s-lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.s-lightbox[open] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); align-items: center; }
.s-lightbox-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(4px, env(safe-area-inset-top, 0px)) 4px 4px 16px; }
.s-lightbox-count { font-variant-numeric: tabular-nums; }
.s-lightbox-btn { appearance: none; flex: none; width: 48px; height: 48px; display: inline-grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: #fff; cursor: pointer; }
.s-lightbox-btn:hover { background: rgba(255, 255, 255, .14); }
.s-lightbox-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.s-app .s-lightbox :focus-visible, .s-lightbox :focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.s-lightbox-stage { grid-column: 2; min-width: 0; min-height: 0; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 4px calc(12px + env(safe-area-inset-bottom, 0px)); }
.s-lightbox-image { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; }
.s-lightbox-caption { flex: none; max-width: 80ch; text-align: center; color: rgba(255, 255, 255, .86); }
html:has(.s-lightbox[open]) { overflow: hidden; }

/* File preview: a frame of one height for whatever the file is */
.s-filepreview { display: flex; flex-direction: column; height: var(--s-filepreview-h, 420px); min-height: 0; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); overflow: auto; }
.s-filepreview > .s-dp-preview-frame { min-height: 0; }

/* Avatar group: avatars that overlap, each with an edge in the colour of what lies under them */
.s-avatar-group { display: inline-flex; align-items: center; vertical-align: middle; padding-left: 8px; }
.s-avatar-group.is-small { padding-left: 6px; }
.s-avatar-group { isolation: isolate; }
.s-avatar-group-item { position: relative; display: inline-flex; margin-left: -8px; border-radius: var(--s-radius-round); box-shadow: 0 0 0 2px var(--s-avatar-group-edge, var(--s-surface)); }
.s-avatar-group.is-small .s-presence-mark { width: 8px; height: 8px; }
.s-avatar-group.is-small .s-presence-mark > svg { display: none; }
.s-avatar-group.is-small .s-avatar-group-item { margin-left: -6px; }
.s-avatar-group-more { background: var(--s-pressed); color: var(--s-ink-2); font-variant-numeric: tabular-nums; }

/* Presence: a mark with a shape of its own per status, at the corner of what it belongs to or by itself */
.s-presence { position: relative; display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.s-presence-mark { flex: none; width: 12px; height: 12px; display: inline-grid; place-items: center; border-radius: var(--s-radius-round); background: var(--s-presence-color, var(--s-ink-3)); box-shadow: 0 0 0 2px var(--s-surface); }
.s-presence.has-content > .s-presence-mark { position: absolute; right: -2px; bottom: -2px; }
.s-presence-mark > svg { width: 12px; height: 12px; }
.s-presence-mark path { fill: none; stroke: var(--s-surface); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.s-presence.is-available { --s-presence-color: var(--s-done); }
.s-presence.is-busy, .s-presence.is-donotdisturb { --s-presence-color: var(--s-late); }
.s-presence.is-away { --s-presence-color: var(--s-human); }
.s-presence.is-offline > .s-presence-mark { background: var(--s-surface); box-shadow: inset 0 0 0 2px var(--s-ink-3), 0 0 0 2px var(--s-surface); }
.s-presence-label { color: var(--s-ink-2); }

.s-reltime { white-space: nowrap; }
.s-countdown { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.s-countdown-clock { font-weight: 600; }
.s-countdown.is-urgent { color: var(--s-late); }
.s-countdown.is-over .s-countdown-clock { color: var(--s-ink-3); font-weight: 400; }

/* Diff: a table of lines; a removed line has a minus and the tint of late, an added one a plus and the tint of done */
.s-diff { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); container: s-diff / inline-size; }
.s-diff-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 40px; padding: 6px var(--s-pad-sm); border-bottom: 1px solid var(--s-line); }
.s-diff-names { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.s-diff-names > .s-icon { color: var(--s-ink-3); }
/* A long file name on a phone: it ends in an ellipsis instead of pushing the page wide. */
.s-diff-names { max-width: 100%; }
.s-diff-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-diff-count { display: inline-flex; gap: 12px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; }
.s-diff-plus { color: color-mix(in srgb, var(--s-done) 80%, var(--s-ink)); font-weight: 600; }
.s-diff-minus { color: color-mix(in srgb, var(--s-late) 80%, var(--s-ink)); font-weight: 600; }
.s-diff-scroll { overflow: auto; max-height: var(--s-diff-max-h, 560px); scrollbar-width: thin; }
.s-app .s-diff-scroll:focus-visible { outline-offset: -2px; }
.s-diff-table { width: 100%; border-collapse: collapse; font-family: var(--s-font-mono); font-size: 13px; line-height: 20px; }
.s-diff-table td { padding: 0 8px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.s-diff-no { width: 1%; min-width: 40px; color: var(--s-ink-3); text-align: right; user-select: none; font-variant-numeric: tabular-nums; white-space: nowrap !important; }
.s-diff-sign { width: 1%; padding: 0 2px !important; color: var(--s-ink-2); user-select: none; font-weight: 600; }
span.s-diff-sign { display: inline-block; width: 1.5ch; }
.s-diff-text { width: 100%; }
.s-diff.is-split .s-diff-text { width: 50%; }
.s-diff-table .is-added { background: var(--s-done-tint); }
.s-diff-table .is-removed { background: var(--s-late-tint); }
.s-diff-table .is-none { background: var(--s-bg); }
.s-diff-table ins { background: color-mix(in srgb, var(--s-done) 26%, transparent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.s-diff-table del { background: color-mix(in srgb, var(--s-late) 22%, transparent); text-decoration: line-through; }
.s-diff-fold > td { padding: 2px 8px; background: var(--s-bg); border-block: 1px solid var(--s-line); text-align: center; font-family: var(--s-font-body); }
.s-diff-more { margin: 0; padding: 8px var(--s-pad-sm); border-top: 1px solid var(--s-line); color: var(--s-ink-2); }
/* Not wide enough for two texts side by side: the old line stands above the new one, and a line that is the same stands there once. */
@container s-diff (max-width: 640px) {
    .s-diff.is-split .s-diff-table tr:not(.s-diff-fold) { display: grid; grid-template-columns: max-content minmax(0, 1fr); }
    .s-diff.is-split .s-diff-text { width: auto; }
    .s-diff.is-split .s-diff-table .is-none, .s-diff.is-split .s-diff-table tr.is-same > td:nth-child(n+3) { display: none; }
}

/* JSON: a tree; the kinds differ by how they are written, the colours only help */
.s-json { min-width: 0; padding: 8px; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); font-family: var(--s-font-mono); font-size: 13px; line-height: 22px; overflow: auto; }
.s-json-row { display: flex; align-items: flex-start; gap: 2px; min-width: 0; }
.s-json-toggle { appearance: none; flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: var(--s-radius-small); background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-json-toggle:hover { background: var(--s-fill); color: var(--s-ink); }
.s-json-toggle.is-none { cursor: default; }
.s-json-key { color: color-mix(in srgb, var(--s-late) 62%, var(--s-ink)); white-space: nowrap; }
.s-json-value { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.s-json-value.is-string { color: color-mix(in srgb, var(--s-done) 78%, var(--s-ink)); }
.s-json-value.is-number, .s-json-value.is-true, .s-json-value.is-false { color: color-mix(in srgb, var(--s-external) 70%, var(--s-ink)); }
.s-json-value.is-null, .s-json-value.is-object, .s-json-value.is-array { color: var(--s-ink-3); }
.s-json-children { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--s-line); }
.s-json-more { display: block; margin: 2px 0 2px 24px; font-family: var(--s-font-body); }

/* QR code and barcode: black on white whatever the theme, because a camera reads them */
.s-qr, .s-barcode { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; vertical-align: middle; }
/* What a QR code says wraps under it, as wide as the code: the text adds nothing to the width of the box. */
.s-qr .s-qr-text { width: 0; min-width: 100%; }
.s-qr-code, .s-barcode-code { display: block; max-width: 100%; }
.s-qr-code { height: auto; }
.s-qr-paper { fill: #fff; }
.s-qr-ink { fill: #000; }
.s-qr-text, .s-barcode-text { max-width: 100%; color: var(--s-ink-2); font-family: var(--s-font-mono); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow-wrap: anywhere; text-align: center; }
.s-barcode-text { letter-spacing: .12em; }
.s-qr-none { align-items: flex-start; color: var(--s-ink-2); }

/* ===== Third wave, navigation and working together: split view, accordion, context menu, toolbar, shortcuts, tour,
   anchor navigation, mentions and chat ===== */

/* Split view: the first pane as wide (or high) as --s-split, the divider a line with room around it for a hand */
.s-split { --s-split: 50%; display: grid; grid-template-columns: minmax(0, var(--s-split)) 9px minmax(0, 1fr); min-height: 0; height: 100%; }
.s-split.is-vertical { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, var(--s-split)) 9px minmax(0, 1fr); }
.s-split-pane { min-width: 0; min-height: 0; overflow: auto; }
.s-split-divider { position: relative; display: grid; place-items: center; cursor: col-resize; touch-action: none; outline: none; }
.s-split.is-vertical .s-split-divider { cursor: row-resize; }
.s-split-divider::before { content: ""; position: absolute; inset: 0 4px; background: var(--s-line); transition: background-color .1s; }
.s-split.is-vertical .s-split-divider::before { inset: 4px 0; }
.s-split-divider:hover::before, .s-split.is-dragging .s-split-divider::before { inset: 0 3px; background: var(--s-brand); }
.s-split.is-vertical .s-split-divider:hover::before, .s-split.is-vertical.is-dragging .s-split-divider::before { inset: 3px 0; }
.s-split-divider:focus-visible::before { inset: 0 3px; background: var(--s-focus); }
.s-split-grip { position: relative; width: 4px; height: 24px; border-radius: var(--s-radius-round); background: var(--s-ink-3); }
.s-split.is-vertical .s-split-grip { width: 24px; height: 4px; }
.s-split.is-dragging { user-select: none; }

/* Accordion: the sections as one block, each heading a full-width button */
.s-acc { border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); overflow: hidden; }
.s-acc.is-flush { border: 0; border-radius: 0; background: transparent; }
.s-acc-item + .s-acc-item { border-top: 1px solid var(--s-line); }
.s-acc-heading { margin: 0; font: inherit; }
.s-acc-toggle { appearance: none; display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 8px var(--s-pad); border: 0; background: transparent;
                color: var(--s-ink); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.s-acc-toggle:hover { background: var(--s-fill); }
.s-acc-toggle:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-acc-toggle:disabled { color: var(--s-ink-disabled); cursor: not-allowed; background: transparent; }
.s-acc-chevron { flex: none; color: var(--s-ink-2); transition: transform .15s; }
.s-acc-item.is-open .s-acc-chevron { transform: rotate(90deg); }
.s-acc-title { min-width: 0; }
.s-acc-summary { margin-left: auto; color: var(--s-ink-2); font-weight: 400; }
.s-acc-body { padding: 0 var(--s-pad) var(--s-pad) calc(var(--s-pad) + 24px); }

/* Context menu: a menu at the pointer, over everything; the rest of the page takes the click that closes it */
.s-ctx-target { display: contents; -webkit-touch-callout: none; }
.s-ctx-backdrop { position: fixed; inset: 0; z-index: 1400; }
.s-ctx-menu { position: fixed; z-index: 1401; display: flex; flex-direction: column; gap: 2px; min-width: 180px; max-width: min(320px, calc(100vw - 16px));
              max-height: calc(100vh - 16px); overflow: auto; padding: 4px; border: 1px solid var(--s-line); border-radius: var(--s-radius-control);
              background: var(--s-surface); box-shadow: var(--s-shadow-16); }
.s-ctx-item { appearance: none; display: flex; align-items: center; gap: 8px; min-height: var(--s-control-h, 32px); margin: 0; padding: 0 8px; border: 0;
              border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink); font: inherit; text-align: start; cursor: pointer; }
.s-ctx-item > .s-icon { color: var(--s-ink-2); }
.s-ctx-item:hover, .s-ctx-item:focus { background: var(--s-fill); outline: none; }
.s-ctx-item:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-ctx-item.is-danger, .s-ctx-item.is-danger > .s-icon { color: var(--s-late); }
.s-ctx-item[aria-disabled="true"], .s-ctx-item[aria-disabled="true"] > .s-icon { color: var(--s-ink-disabled); cursor: not-allowed; background: transparent; }
.s-ctx-label { flex: 1; min-width: 0; }
.s-ctx-key { color: var(--s-ink-3); font: inherit; font-size: var(--s-fs-caption); }
.s-ctx-sep { height: 1px; margin: 3px 4px; background: var(--s-line); }

/* Toolbar: one line; what does not fit is drawn out of sight (to be measured) and stands in the "..." menu */
.s-tb { display: flex; align-items: center; gap: 4px; min-width: 0; }
.s-tb-items { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.s-tb.is-measuring .s-tb-items { flex-wrap: wrap; overflow: visible; }
.s-tb-item, .s-tb-sep { flex: none; display: inline-flex; }
.s-tb-item > .s-btn { white-space: nowrap; }
.s-tb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--s-line); }
.s-tb-item.is-folded, .s-tb-sep.is-folded { position: absolute; visibility: hidden; pointer-events: none; }
.s-tb-more { flex: none; }

/* Keyboard shortcuts: the overview */
.s-keys-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(80vh, 720px); padding: 0; border: 1px solid var(--s-line); border-radius: var(--s-radius-dialog);
                 background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-28); }
.s-keys-dialog[open] { display: flex; flex-direction: column; margin: auto; inset: 0; }
.s-keys-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.s-keys-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px 20px; }
.s-keys-title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.s-keys-body { overflow: auto; padding: 0 20px 8px; }
.s-keys-group + .s-keys-group { margin-top: 16px; }
.s-keys-group-title { margin: 0 0 4px; color: var(--s-ink-2); font-size: var(--s-fs-caption); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.s-keys-list { margin: 0; }
.s-keys-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; border-bottom: 1px solid var(--s-line); }
.s-keys-row.is-off { color: var(--s-ink-3); }
.s-keys-row.is-off .s-kbd { opacity: .5; }
.s-keys-label { margin: 0; }
.s-keys-keys { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.s-keys-then { color: var(--s-ink-3); font-size: var(--s-fs-caption); }
.s-keys-foot { padding: 12px 20px; border-top: 1px solid var(--s-line); }

/* Tour: a step beside what it points at, or in the middle; what it points at has a ring */
.s-tour { position: fixed; z-index: 1300; width: min(340px, calc(100vw - 16px)); padding: 12px 16px 16px; border: 1px solid var(--s-line); border-radius: var(--s-radius-card);
          background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-28); }
.s-tour:focus { outline: none; }
.s-tour:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-tour[data-place="center"] { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.s-tour-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.s-tour-count { color: var(--s-ink-2); font-size: var(--s-fs-caption); }
.s-tour-head > .s-btn { margin: -4px -8px 0 0; }
.s-tour-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.s-tour-text { margin: 0 0 12px; color: var(--s-ink-2); }
.s-tour-foot { display: flex; justify-content: flex-end; gap: 8px; }
.s-tour-target { position: relative; z-index: 1; outline: 3px solid var(--s-accent); outline-offset: 3px; border-radius: var(--s-radius-control); transition: outline-offset .2s; }
@media (prefers-reduced-motion: reduce) { .s-tour-target, .s-acc-chevron, .s-split-divider::before { transition: none; } }

/* Anchor navigation: a list beside the page that stays in sight; the section in view is marked */
.s-anchors { position: sticky; top: calc(var(--s-appbar-h, 48px) + 16px); max-height: calc(100vh - var(--s-appbar-h, 48px) - 32px); overflow: auto; }
.s-anchors-title { margin: 0 0 6px; color: var(--s-ink-2); font-size: var(--s-fs-caption); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.s-anchors-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--s-line); }
.s-anchors-link { display: block; margin-left: -1px; padding: 4px 8px 4px 12px; border-left: 2px solid transparent; color: var(--s-ink-2); text-decoration: none; line-height: 20px; }
.s-anchors-item.is-sub .s-anchors-link { padding-left: 24px; font-size: var(--s-fs-caption); }
.s-anchors-link:hover { color: var(--s-ink); background: var(--s-fill); }
.s-anchors-link:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-anchors-link[aria-current="location"] { border-left-color: var(--s-brand); color: var(--s-ink); font-weight: 600; }
/* A section a link goes to stands under the app bar, not behind it. */
.s-app [id] { scroll-margin-top: calc(var(--s-appbar-h, 48px) + 12px); }

/* Mentions: the list under the box is the list of a combobox */
.s-field.s-mention { position: relative; }
.s-mention-list { position: absolute; left: 0; right: 0; z-index: 30; }
.s-mention-option { display: flex; align-items: center; gap: 8px; }
.s-mention-hash { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--s-radius-small); background: var(--s-fill); color: var(--s-ink-2); font-weight: 600; }
span.s-mention.is-record { background: var(--s-fill); }

/* Chat: the log scrolls, the box to write in stays at the foot */
.s-chat { display: flex; flex-direction: column; min-height: 0; height: 100%; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-bg); }
.s-chat-log { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px; overscroll-behavior: contain; }
.s-chat-log:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-chat-empty { margin: auto; color: var(--s-ink-2); text-align: center; }
.s-chat-msg { display: flex; align-items: flex-start; gap: 8px; max-width: min(640px, 88%); }
.s-chat-msg.is-me { align-self: flex-end; flex-direction: row-reverse; }
.s-chat-msg.is-system { align-self: center; max-width: 100%; }
.s-chat-avatar { flex: none; margin-top: 2px; }
.s-chat-bubble { min-width: 0; padding: 6px 12px 8px; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); }
.s-chat-msg.is-me .s-chat-bubble { border-color: var(--s-brand-line);  background: var(--s-brand-tint); }
.s-chat-msg.is-agent .s-chat-bubble { border-style: dashed; }
.s-chat-msg.is-pending .s-chat-bubble { opacity: .75; }
.s-chat-msg.is-failed .s-chat-bubble { border-color: var(--s-late); }
.s-chat-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; font-size: var(--s-fs-caption); }
.s-chat-name { font-weight: 600; }
.s-chat-agent { padding: 0 4px; border-radius: var(--s-radius-small); background: var(--s-fill); color: var(--s-ink-2); }
.s-chat-time { color: var(--s-ink-3); }
.s-chat-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.s-chat-state { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--s-ink-2); font-size: var(--s-fs-caption); }
.s-chat-state.is-failed { color: var(--s-late); }
.s-chat-system { margin: 0; color: var(--s-ink-2); font-size: var(--s-fs-caption); text-align: center; }
.s-chat-typing { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--s-ink-2); font-size: var(--s-fs-caption); }
.s-chat-dots { display: inline-flex; gap: 3px; }
.s-chat-dots > span { width: 5px; height: 5px; border-radius: var(--s-radius-round); background: var(--s-ink-3); animation: s-chat-dot 1.2s infinite ease-in-out; }
.s-chat-dots > span:nth-child(2) { animation-delay: .15s; }
.s-chat-dots > span:nth-child(3) { animation-delay: .3s; }
@keyframes s-chat-dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .s-chat-dots > span { animation: none; } }
.s-chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 12px; border-top: 1px solid var(--s-line); background: var(--s-surface);
                  border-radius: 0 0 var(--s-radius-card) var(--s-radius-card); }
.s-chat-compose > .s-field { flex: 1; min-width: 0; margin: 0; }
.s-chat-compose .s-mention-list { top: auto; bottom: 100%; }
.s-chat-compose > .s-btn { flex: none; }

/* A phone: the panes of a split view under each other, the contents of a page as a row, a tour step as a sheet */
@media (max-width: 700px) {
    .s-split.is-stacking { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; }
    .s-split.is-stacking > .s-split-divider { display: none; }
    .s-split.is-stacking > .s-split-pane { overflow: visible; }
    .s-anchors { position: static; max-height: none; overflow-x: auto; overscroll-behavior-x: contain; }
    .s-anchors-list { display: flex; gap: 4px; border-left: 0; }
    .s-anchors-item.is-sub { display: none; }
    .s-anchors-link { margin: 0; padding: 0 12px; border: 1px solid var(--s-line); border-radius: var(--s-radius-round); line-height: 30px; white-space: nowrap; }
    .s-anchors-link[aria-current="location"] { border-color: var(--s-brand); background: var(--s-brand-tint); }
    .s-tour, .s-tour[data-place] { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; transform: none; }
    .s-chat-msg { max-width: 94%; }
}
@media (pointer: coarse) {
    .s-split { grid-template-columns: minmax(0, var(--s-split)) 21px minmax(0, 1fr); }
    .s-split.is-vertical { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, var(--s-split)) 21px minmax(0, 1fr); }
    .s-split-divider::before { inset: 0 10px; }
    .s-split.is-vertical .s-split-divider::before { inset: 10px 0; }
    .s-ctx-item { min-height: 44px; }
    .s-keys-row { min-height: 44px; }
    /* A switch is a 44 by 44 target: the label is at least that wide and its invisible input covers it. */
    .s-switch { min-width: 44px; }
    .s-switch-input { width: 44px; height: 44px; margin-top: -22px; }
    .s-th-btn { min-width: 44px; }
    /* A folded column stays a 44 px target on touch, and a theme that makes it wider still wins. */
    .s-bp-board { --s-bp-strip: max(44px, var(--s-board-strip-w, 40px)); }
    .s-anchors-link { min-height: 44px; display: flex; align-items: center; }
    .s-chat-compose .s-textarea-box { min-height: 44px; }
    .s-chat-compose .s-textarea-el { min-height: 42px; }
}

/* ===== A phone and a touch screen (docs/library/responsive.md) =====
   Two measures, each for what it is about. What a narrow screen needs goes by its width: the shell (above), the head
   of a page and its action bar (here). What a finger needs goes by the pointer: on a touch screen the profile raises
   the sizes of controls, rows and text (ThemeCss), and what has no token of its own follows here. */

/* In the "Meer" menu of an action bar: the actions that are buttons on a wide screen. */
.s-menu-narrow, .s-actionbar-more.is-narrow-only { display: none; }
@media (max-width: 700px) {
    /* The breadcrumb is one step: the way back to the page above this one. A page right under the home page has none,
       and neither has a page with a back button in front of its title: the menu and that button lead there. The path
       of folders of a documents page is no trail of a page: it stays whole, every folder on it is a way back. */
    .s-crumbs:not(.s-dp-path) li { display: none; }
    .s-crumbs:not(.s-dp-path) li:nth-last-child(3):not(:first-child) { display: inline-flex; }
    .s-crumbs:not(.s-dp-path) li:nth-last-child(2):not(:nth-child(2)) { display: inline-flex; order: -1; transform: scaleX(-1); }
    .s-pagehead:has(.s-pagehead-titleline > :first-child:not(.s-pagehead-title)) .s-crumbs { display: none; }
    /* The actions of a page head stand in one row; what does not fit is a swipe away, and the page itself stays put.
       The row has room around it for the focus ring of its buttons, which it would cut off otherwise. */
    .s-pagehead-actions { flex-wrap: nowrap; max-width: calc(100% + 8px); margin: -4px; padding: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
    .s-pagehead-actions > * { flex: none; }
    /* The action bar: one action and "Meer". Every other action of the bar is in that menu, under its own name. */
    .s-cmdbar .s-btn[data-action]:not([data-narrow]), .s-cmdbar-main > .s-divider-v { display: none; }
    .s-actionbar-menus { display: none; }
    .s-actionbar-more, .s-actionbar-more.is-narrow-only, .s-menu-narrow { display: contents; }
    /* A menu is a sheet at the bottom of the screen: as wide as the screen and under a thumb, never off its side. It
       is as high as it needs, up to most of the screen, and scrolls by itself; the page behind it is dimmed. */
    .s-app .mud-popover.s-menu-pop { position: fixed !important; inset: auto 0 0 0 !important; width: auto; min-width: 0; max-width: none !important; max-height: min(72dvh, 560px) !important;
                                     padding-bottom: env(safe-area-inset-bottom, 0px); border-width: 1px 0 0; border-radius: var(--s-radius-dialog) var(--s-radius-dialog) 0 0; box-shadow: var(--s-shadow-28);
                                     overscroll-behavior: contain; }
    .s-app .mud-popover-provider:has(> .s-menu-pop.mud-popover-open) > .mud-overlay { background: rgba(0, 0, 0, .4); }
    .s-menu-label { white-space: normal; }
    /* A toast: the message has the width, and what can be done about it stands under it. Side by side the action took
       the room and the message broke in the middle of its words. */
    .s-toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
    .s-toast-text { overflow-wrap: break-word; }
    .s-toast-action { grid-column: 2; grid-row: 2; justify-self: start; margin-left: -8px; }
    .s-toast-close { grid-column: 3; grid-row: 1; }
    /* Third wave. Side by side is for a wide screen: a comparison stands under each other, and the arrows of the
       lightbox lie over the edges of the picture so it has the whole width. */
    .s-lightbox[open] { grid-template-columns: minmax(0, 1fr); }
    .s-lightbox-stage { grid-column: 1; grid-row: 2; }
    .s-lightbox-nav { grid-row: 2; grid-column: 1; z-index: 1; align-self: center; background: rgba(0, 0, 0, .4); }
    .s-lightbox-nav.is-previous { justify-self: start; }
    .s-lightbox-nav.is-next { justify-self: end; }
    /* The foot of the pane of a file is one row that scrolls by itself: the height is for the file. */
    .s-dp-pane-foot { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .s-dp-pane-foot > * { flex: none; }
}
/* The key figures of a role center stand two by two on a phone that has the width for it: four are one screen, not two. */
@container s-page (min-width: 340px) and (max-width: 700px) { .s-rc-cues { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container s-page (max-width: 700px) {
    /* A queue without work: its name with the way on at the end of the line, and under it what it has to say. */
    .s-rc-queue.is-quiet .s-block-heading { flex: 1 1 auto; }
    .s-rc-queue.is-quiet > .s-rc-empty { order: 3; flex: 1 1 100%; }
    /* The head of a conversation: the subject has the width, and how many messages it holds stands under it. */
    .s-mp-read-head { flex-wrap: wrap; }
    .s-mp-threadcount { flex: 1 1 100%; padding-left: var(--s-control-h); }
}

/* A touch screen: a target that stays small to the eye gets its 44px from a see-through area around it. */
@media (pointer: coarse) {
    .s-crumb { position: relative; }
    a.s-crumb::after, button.s-crumb::after { content: ""; position: absolute; top: -10px; left: 0; width: 100%; height: 44px; }
    /* Checkbox: a larger box. With a label the whole line is the target; alone, in a row, the area around the box. */
    .s-checkbox { min-height: 44px; }
    .s-checkbox:not(:has(.s-checkbox-label)) { min-height: 20px; }
    .s-checkbox-input { width: 20px; height: 20px; margin-top: -10px; }
    .s-checkbox-box { position: relative; width: 20px; height: 20px; }
    .s-checkbox:not(:has(.s-checkbox-label)) .s-checkbox-box::after { content: ""; position: absolute; top: -13px; left: -13px; width: 44px; height: 44px; }
    .s-radio-input, .s-radio-dot { width: 20px; height: 20px; }
    .s-radio-input { margin-top: -10px; }
    .s-radio-dot::after { width: 10px; height: 10px; }
    .s-seg-item { height: var(--s-control-h); min-width: var(--s-control-h); }
    /* More choices than the screen is wide: the row scrolls by itself. */
    .s-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .s-seg-item { flex: none; }
    /* The two steps of a number field stand side by side: one above the other they are half a finger high. */
    .s-number-steps { flex-direction: row; }
    .s-number-step { width: var(--s-control-h); }
    .s-number-step + .s-number-step { border-left: 1px solid var(--s-line); }
    .s-tag { height: 32px; }
    .s-tag-remove { position: relative; width: 24px; height: 24px; }
    .s-tag-remove::after, .s-tree-toggle::after { content: ""; position: absolute; top: -10px; left: -10px; width: 44px; height: 44px; }
    .s-tree-toggle { position: relative; width: 24px; height: 24px; }
    /* The name of a row is the way into it: a finger high, as wide as the name. */
    .s-app a.s-lp-key, .s-dp-open { display: inline-block; min-width: 44px; margin-block: -11px; padding-block: 11px; }
    /* Tabs that a template made lower for a mouse are a finger high again. */
    .s-lp-views, .s-dp-pane > .s-tabs { --s-tab-h: 44px; }
    .s-table-fixed .s-mono, .s-fact dd .s-mono { font-size: var(--s-fs-caption); }
    /* A key of the keyboard says nothing where there is none. */
    .s-menu-hint { display: none; }
    /* Larger buttons need more of a bar: none of them gives way, the search does, and what is still too much goes to a next row. */
    .s-cmdbar { flex-wrap: wrap; }
    .s-cmdbar .s-btn { flex: none; }
    .s-cal-daybtn { min-height: 44px; }
    .s-cal-cell .s-cal-daybtn { position: relative; min-height: 24px; }
    .s-cal-cell .s-cal-daybtn::after { content: ""; position: absolute; top: -10px; left: calc(50% - 22px); width: 44px; height: 44px; }
    /* The browser draws code a size smaller than the text around it. */
    .s-app :is(code, kbd, samp, pre) { font-size: var(--s-fs-caption); }
    .s-brick-key { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
    .s-rte-mark { font-size: 14px; }
    .s-bp-strip { min-height: 44px; }
    .s-sidenav-toggle { width: 44px; height: 44px; }
    /* A toast: "Ongedaan maken" and the close button are what it is for; both a finger high. */
    .s-toast-action { height: 44px; margin-block: -10px; }
    .s-toast-close { width: 44px; height: 44px; margin: -10px -10px -10px 0; }
    .s-app .s-datefield .mud-input-adornment .mud-icon-button { width: var(--s-control-h); height: var(--s-control-h); }
    /* A text file: letters a phone does not zoom in on when the cursor lands in them, and line numbers to match. */
    .s-te { --s-te-fs: 16px; --s-te-lh: 24px; --s-te-gutter: 52px; }
    .s-te-gutter { font-size: 14px; }
    /* Third wave: a palette chip, the swatch, a star, a toggle of the JSON tree and a box of a code are a finger large. */
    .s-color-chip { width: 44px; height: 44px; }
    .s-color-swatch { width: 28px; height: 28px; }
    .s-color-swatch::after { content: ""; position: absolute; top: -9px; left: -9px; width: 44px; height: 44px; }
    .s-rating-star, .s-rating.is-small:not(.is-readonly) .s-rating-star { width: 44px; height: 44px; padding: 8px; }
    .s-rating.is-readonly .s-rating-star { width: 20px; height: 20px; padding: 0; }
    .s-otp-box { --s-otp-cell: 44px; --s-otp-gap: 6px; }
    .s-json { font-size: 14px; line-height: 24px; }
    .s-json-toggle { position: relative; }
    .s-json-toggle:not(.is-none)::after { content: ""; position: absolute; top: -11px; left: -11px; width: 44px; height: 44px; }
    .s-json-row { min-height: 32px; align-items: center; }
    .s-diff-table { font-size: 14px; line-height: 22px; }
    .s-slider-el { height: 44px; }
    .s-slider-el::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -12px; }
    .s-slider-el::-moz-range-thumb { width: 24px; height: 24px; }
    /* A link on its own, and a button that looks like one, are a finger high around their words. Running text
       (prose, a mail) keeps its lines: there a link is part of a sentence. */
    .s-app a:not([class]), .s-link { position: relative; }
    .s-app a:not([class])::after, .s-link::after { content: ""; position: absolute; top: calc(50% - 22px); left: 0; width: 100%; min-width: 44px; height: 44px; }
    .s-app .s-prose a::after { content: none; }
}
/* A low screen, such as a phone on its side: what stays in view on a high screen scrolls along, or nothing is left to read. */
@media (max-height: 520px) { .s-cp-head { position: static; } }

/* Dialog with several answers at once. */
.s-checklist { display: flex; flex-direction: column; max-height: min(48vh, 400px); margin-top: 8px; overflow-y: auto; }
.s-checklist-all { margin-bottom: 4px; padding: 4px 0; border-bottom: 1px solid var(--s-line); }
.s-checklist-item { padding: 3px 0; }

/* ===== Data grid, filter builder, pagination, command palette, drawer and side panel, stepper and wizard, notification
   centre, and the settings, worksheet and document templates. Same rules as above: only --s-* tokens, corners through
   --s-radius-*, and a component token where a platform may want to adjust one component. ===== */

/* ===== Keyboard key: a key or a shortcut as it is written on the keyboard ===== */
.s-kbd { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 5px; border: 1px solid var(--s-line-strong); border-bottom-width: 2px; border-radius: var(--s-radius-small);
         background: var(--s-surface); color: var(--s-ink-2); font-family: var(--s-font-body); font-size: 11px; line-height: 16px; font-weight: 400; white-space: nowrap; }

/* ===== Drawer: a panel over the page, under the app bar. The layer lets clicks through except on the panel and its backdrop. ===== */
/* The layers. A drawer and a side panel belong to the page: they lie over its content and under the app bar (20),
   so that what the bar opens (the list under "Meer", the notifications, the command palette) and the shell's own
   panels (the menu of a phone, the app launcher) lie over them and never behind them. */
.s-drawer-layer { position: fixed; inset: var(--s-appbar-h) 0 0 0; z-index: 18; display: flex; justify-content: flex-end; pointer-events: none; }
.s-drawer-layer.is-start { justify-content: flex-start; }
/* The command palette lies over everything, also over the shell's own panels. From the app bar it is drawn inside
   the bar: while it is open the bar comes on top. It covers the screen, so nothing of the bar can be used meanwhile. */
.s-appbar:has(.s-cmdk-layer) { z-index: 61; }
.s-drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); pointer-events: auto; animation: s-fade-in var(--s-dur-fast) linear; }
.s-drawer { position: relative; pointer-events: auto; max-width: 100vw; height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink);
            box-shadow: var(--s-shadow-28); animation: s-drawer-in var(--s-dur) var(--s-ease-out); }
.s-drawer-layer.is-start .s-drawer { border-left: 0; border-right: 1px solid var(--s-line); animation-name: s-drawer-in-start; }
.s-app .s-drawer:focus { outline: none; }
.s-drawer.is-sizing, .s-sidepanel.is-sizing { user-select: none; }
@keyframes s-drawer-in { from { transform: translateX(32px); opacity: 0; } }
@keyframes s-drawer-in-start { from { transform: translateX(-32px); opacity: 0; } }
.s-drawer-head { flex: none; display: flex; align-items: flex-start; gap: 8px; min-height: 56px; padding: 12px 8px 12px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-drawer-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.s-drawer-title { margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; overflow-wrap: anywhere; }
.s-drawer-eyebrow { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; color: var(--s-ink-3); }
.s-drawer-sub { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); overflow-wrap: anywhere; }
.s-drawer-tools { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.s-drawer-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--s-pad); }
.s-app .s-drawer-body:focus { outline: none; }
.is-flush > .s-drawer-body { padding: 0; }
.s-drawer-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px var(--s-pad); border-top: 1px solid var(--s-line); }
/* The edge to drag: wide enough to grab, drawn as a line only while it is used or has the keyboard. */
.s-panel-size { position: absolute; top: 0; bottom: 0; left: -5px; z-index: 2; width: 10px; cursor: col-resize; touch-action: none; }
.s-drawer-layer.is-start .s-panel-size, .s-sidepanel.is-start > .s-panel-size { left: auto; right: -5px; }
.s-panel-size::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 3px; background: transparent; transition: background var(--s-dur-fast) var(--s-ease); }
.s-panel-size:hover::after, .is-sizing > .s-panel-size::after { background: var(--s-brand-line); }
.s-app .s-panel-size:focus-visible { outline: none; }
.s-panel-size:focus-visible::after { background: var(--s-focus); }

/* Side panel: the same panel as part of the page, next to the content. */
.s-sidepanel { position: relative; flex: none; align-self: stretch; max-width: 100%; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--s-line); background: var(--s-surface); }
.s-sidepanel.is-start { border-left: 0; border-right: 1px solid var(--s-line); }
@media (max-width: 700px) {
    /* No room for two columns: the side panel lies over the page as a sheet, and a drawer takes the whole width. */
    /* align-self goes back to auto: Chrome reads a stretch or a start on a fixed box as "as high as its content". */
    .s-sidepanel { position: fixed; inset: var(--s-appbar-h) 0 0 0; z-index: 15; align-self: auto; width: auto !important; border: 0; box-shadow: var(--s-shadow-28); }
    .s-drawer { width: 100vw !important; border: 0; }
    .s-panel-size { display: none; }
}

/* ===== Pagination ===== */
.s-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; color: var(--s-ink-2); container: s-pager / inline-size; }
.s-pager-range { font-variant-numeric: tabular-nums; }
.s-pager-size { display: inline-flex; align-items: center; gap: 8px; }
.s-pager-pages { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.s-pager-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.s-pager-page { appearance: none; min-width: var(--s-control-h); height: var(--s-control-h); padding: 0 6px; border: 1px solid transparent; border-radius: var(--s-radius-control); background: transparent;
                color: var(--s-ink-2); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
.s-pager-page:hover { background: var(--s-fill); color: var(--s-ink); }
.s-pager-page:active { background: var(--s-pressed); }
.s-pager-page.is-current, .s-pager-page.is-current:hover { background: var(--s-primary); color: var(--s-on-primary); font-weight: 600; }
.s-pager-gap { min-width: 20px; text-align: center; color: var(--s-ink-3); }
.s-pager-position { display: none; padding: 0 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-pager.is-compact .s-pager-list { display: none; }
.s-pager.is-compact .s-pager-position { display: inline; }
@container s-pager (max-width: 560px) {
    .s-pager-list { display: none; }
    .s-pager-position { display: inline; }
}

/* ===== Stepper: the steps of a process, joined by a line that fills with the brand as far as the process came ===== */
.s-stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; min-width: 0; }
.s-step { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-start; }
.s-step:last-child { flex: 0 1 auto; }
.s-step::after { content: ""; flex: 1; min-width: 12px; height: 2px; margin: 17px 4px 0; background: var(--s-line-strong); }
.s-step:last-child::after { display: none; }
.s-step.is-done::after, .s-step.is-skipped::after { background: var(--s-brand); }
.s-step-box { appearance: none; min-width: 0; display: inline-flex; align-items: flex-start; gap: 8px; margin: 0; padding: 4px; border: 0; border-radius: var(--s-radius-control); background: transparent; color: inherit; font: inherit; text-align: left; }
button.s-step-box { cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
button.s-step-box:hover { background: var(--s-fill); }
button.s-step-box:active { background: var(--s-pressed); }
.s-step-mark { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--s-line-accessible); border-radius: var(--s-radius-round); background: var(--s-surface); color: var(--s-ink-2);
               font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; font-variant-numeric: tabular-nums; }
.s-step.is-current .s-step-mark { border-color: var(--s-primary); background: var(--s-primary); color: var(--s-on-primary); }
.s-step.is-done .s-step-mark { border-color: var(--s-brand); background: var(--s-brand-tint); color: var(--s-brand); }
.s-step.is-error .s-step-mark { border-color: var(--s-late); background: var(--s-late-tint); color: var(--s-late); }
.s-step.is-skipped .s-step-mark { border-style: dashed; color: var(--s-ink-3); }
.s-step-text { min-width: 0; display: flex; flex-direction: column; padding-top: 4px; }
.s-step-title { color: var(--s-ink-2); overflow-wrap: anywhere; }
.s-step.is-current .s-step-title { color: var(--s-ink); font-weight: 600; }
.s-step.is-done .s-step-title, .s-step.is-error .s-step-title { color: var(--s-ink); }
.s-step-note { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
.s-stepper.is-vertical { flex-direction: column; align-items: stretch; }
.s-stepper.is-vertical .s-step { flex: none; flex-direction: column; }
.s-stepper.is-vertical .s-step::after { flex: none; width: 2px; min-width: 0; height: 16px; margin: 0 0 0 17px; }
/* Not wide enough for every name: the steps keep their marks, and only the step you are on keeps its name. The names
   of the others stay there for a screen reader. */
@container (max-width: 640px) {
    .s-stepper:not(.is-vertical) .s-step:not(.is-current) .s-step-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .s-stepper:not(.is-vertical) .s-step:not(.is-current) { flex: 0 1 auto; }
    .s-stepper:not(.is-vertical) .s-step.is-current { flex: 1 1 auto; }
    .s-stepper:not(.is-vertical) .s-step::after { min-width: 8px; }
}

/* ===== Wizard ===== */
.s-wizard { display: flex; flex-direction: column; min-width: 0; container: s-wizard / inline-size; }
.s-wizard-head { flex: none; display: flex; flex-direction: column; gap: 12px; padding: var(--s-pad) var(--s-pad) 12px; border-bottom: 1px solid var(--s-line); }
.s-wizard-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.s-wizard-title { margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-wizard-progress { color: var(--s-ink-3); font-variant-numeric: tabular-nums; }
.s-wizard-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: var(--s-pad); }
.s-wizard-steptitle { margin: 0; font-family: var(--s-font-display); font-size: 16px; line-height: 22px; font-weight: 600; }
.s-app .s-wizard-steptitle:focus { outline: none; }
.s-wizard-stepdesc { margin: 4px 0 0; max-width: 80ch; color: var(--s-ink-2); }
.s-wizard-step { max-width: 640px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.s-wizard-error { display: flex; align-items: flex-start; gap: 8px; margin: 0 var(--s-pad) 12px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--s-late) 30%, transparent);
                  border-radius: var(--s-radius-control); background: var(--s-late-tint); color: var(--s-ink); }
.s-wizard-error > .s-icon { color: var(--s-late); }
.s-wizard-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px var(--s-pad); border-top: 1px solid var(--s-line); }

/* ===== Notification centre: the bell with its counter, and the notifications in a drawer ===== */
.s-notif-bell, .s-appbar-more { position: relative; }
.s-notif-count, .s-appbar-count { position: absolute; top: 6px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--s-radius-round); background: var(--s-accent); color: var(--s-on-accent);
                                  font-size: 10px; line-height: 16px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.s-btn.s-notif-bell .s-notif-count { top: -2px; right: -4px; }
/* A phone (docs/library/responsive.md): the bell stands in the list under "Meer" with its name, and its number at the
   end of its line. The number on the "Meer" button says that something waits there. */
@media (max-width: 860px) {
    .s-appbar-tools .s-notif-count { position: static; flex: none; margin-left: auto; }
}
@media (pointer: coarse) {
    .s-notif-count, .s-appbar-count { top: 4px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 14px; line-height: 20px; }
}
.s-notif-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 0 var(--s-pad-sm); border-bottom: 1px solid var(--s-line);
               background: var(--s-surface); --s-tab-h: 40px; }
.s-notif-bar .s-tabs { border-bottom: 0; }
/* A phone on its side (docs/library/responsive.md, rule 10): the tabs and the grouping would cover what is left of the
   drawer; they scroll along with the notifications. */
@media (max-height: 520px) { .s-notif-bar { position: static; } }
.s-notif-empty { display: grid; place-items: center; padding: 32px var(--s-pad); }
.s-notif-grouphead { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px var(--s-pad) 4px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; color: var(--s-ink-2); }
.s-notif-list { list-style: none; margin: 0; padding: 0; }
.s-notif-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px 10px var(--s-pad); border-bottom: 1px solid var(--s-line); }
/* Unread: the indicator along the row and the title in semibold; a screen reader hears the word. Never colour alone. */
.s-notif-item.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--s-indicator); }
.s-notif-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--s-radius-round); background: var(--s-tone-tint); color: var(--s-tone); }
.s-notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.s-notif-title { color: var(--s-ink) !important; overflow-wrap: anywhere; }
.s-notif-item.is-unread .s-notif-title { font-weight: 600; }
.s-notif-text { margin: 0; color: var(--s-ink-2); overflow-wrap: anywhere; }
.s-notif-meta { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
.s-notif-meta > * + *::before { content: "·"; margin-right: 6px; }
.s-notif-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.s-notif-tools { flex: none; display: flex; }

/* ===== Command palette: the button that opens it, and the box over the page ===== */
.s-cmdk-trigger { appearance: none; width: 100%; height: var(--s-control-h); display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0 6px 0 10px; border: 1px solid var(--s-line-strong);
                  border-bottom-color: var(--s-line-accessible); border-radius: var(--s-input-radius, var(--s-radius-control)); background: var(--s-surface); color: var(--s-ink-2); font: inherit; text-align: left; cursor: pointer;
                  transition: background var(--s-dur-fast) var(--s-ease); }
.s-cmdk-trigger:hover { border-color: color-mix(in srgb, var(--s-line-strong) 82%, var(--s-ink)); }
.s-cmdk-trigger-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-cmdk-trigger.is-appbar { border-color: transparent; background: color-mix(in srgb, var(--s-surface) 82%, transparent); }
.s-cmdk-trigger.is-appbar:hover { border-color: transparent; background: color-mix(in srgb, var(--s-surface) 92%, transparent); }
.s-cmdk-trigger.is-appbar .s-kbd { border-color: var(--s-line-accessible); }
.s-cmdk-layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: min(12vh, 96px) 16px 16px; }
.s-cmdk-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); animation: s-fade-in var(--s-dur-fast) linear; }
.s-cmdk { position: relative; width: min(640px, 100%); max-height: min(600px, calc(100dvh - 32px - min(12vh, 96px))); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--s-radius-dialog);
          background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-28); animation: s-cmdk-in var(--s-dur) var(--s-ease-out); }
@keyframes s-cmdk-in { from { transform: translateY(-8px); opacity: 0; } }
.s-cmdk-search { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--s-line); }
.s-cmdk-search:focus-within { box-shadow: inset 0 -2px 0 var(--s-focus); }
.s-cmdk-search > .s-icon { color: var(--s-ink-3); }
.s-cmdk-input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: transparent; color: inherit; font-family: inherit; font-size: 16px; line-height: 22px; }
.s-app .s-cmdk-input:focus-visible { outline: none; }
.s-cmdk-input::placeholder { color: var(--s-ink-3); opacity: 1; }
.s-cmdk-busy { flex: none; font-size: var(--s-fs-caption); color: var(--s-ink-3); }
.s-cmdk-scopes { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--s-line); }
.s-cmdk-scope { appearance: none; height: 24px; margin: 0; padding: 0 10px; border: 1px solid var(--s-line-strong); border-radius: var(--s-radius-round); background: transparent; color: var(--s-ink-2); font: inherit;
                font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); cursor: pointer; }
.s-cmdk-scope:hover { background: var(--s-fill); color: var(--s-ink); }
.s-cmdk-scope.is-active { border-color: var(--s-brand-line); background: var(--s-brand-tint); color: var(--s-ink); font-weight: 600; }
.s-cmdk-results { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 4px; }
.s-cmdk-heading { padding: 8px 12px 4px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; color: var(--s-ink-3); }
.s-cmdk-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 12px; border-radius: var(--s-radius-control); cursor: pointer; }
.s-cmdk-item:hover { background: var(--s-fill); }
.s-cmdk-item.is-active { background: var(--s-selected); box-shadow: inset 3px 0 0 var(--s-indicator); }
.s-cmdk-icon { flex: none; display: grid; color: var(--s-ink-2); }
.s-cmdk-item.is-active .s-cmdk-icon { color: var(--s-brand); }
.s-cmdk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-cmdk-title { overflow-wrap: anywhere; }
.s-cmdk-sub { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); overflow-wrap: anywhere; }
.s-cmdk-kind { flex: none; font-size: var(--s-fs-caption); color: var(--s-ink-3); }
.s-cmdk-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px 16px; color: var(--s-ink-2); text-align: center; }
.s-cmdk-empty b { color: var(--s-ink); overflow-wrap: anywhere; }
.s-cmdk-foot { flex: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px; border-top: 1px solid var(--s-line); font-size: var(--s-fs-caption); line-height: 20px; color: var(--s-ink-3); }
.s-cmdk-foot > span { display: inline-flex; align-items: center; gap: 4px; }
/* On a phone the palette is the search of the app bar (docs/library/responsive.md): its button is the search icon, in
   the column the shell keeps for it, and the palette takes the width. */
@media (max-width: 860px) {
    .s-cmdk-trigger.is-appbar { width: var(--s-appbar-h); height: var(--s-appbar-h); justify-content: center; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--s-on-appbar); }
    .s-cmdk-trigger.is-appbar:hover { background: color-mix(in srgb, var(--s-on-appbar) 12%, transparent); }
    .s-cmdk-trigger.is-appbar .s-cmdk-trigger-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); text-overflow: clip; }
    .s-cmdk-trigger.is-appbar .s-kbd { display: none; }
}
@media (max-width: 560px) {
    .s-cmdk-layer { padding: 8px; }
    .s-cmdk { max-height: calc(100dvh - 16px); }
    .s-cmdk-foot, .s-cmdk-kind { display: none; }
}

/* ===== Filter builder ===== */
.s-fb { display: flex; flex-direction: column; gap: 12px; min-width: 0; container: s-fb / inline-size; }
.s-fb-views { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--s-line); }
.s-fb-viewpick { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-fb-viewpick .s-select { display: flex; }
.s-fb-viewlabel { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-2); }
.s-fb-viewtools { display: flex; flex-wrap: wrap; gap: 4px; }
.s-fb-viewnote { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
.s-fb-dirty { color: var(--s-human); font-weight: 600; }
.s-fb-group { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.s-fb-group:not(.is-root) { padding: 8px 8px 8px 12px; border: 1px solid var(--s-line); border-left: 3px solid var(--s-brand-line); border-radius: var(--s-radius-control); background: color-mix(in srgb, var(--s-fill) 50%, transparent); }
.s-fb-grouphead { display: flex; align-items: center; gap: 8px; }
.s-fb-grouptext { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--s-ink-2); }
.s-fb-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.s-fb-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; align-items: start; }
.s-fb-join { min-height: var(--s-control-h); display: flex; align-items: center; justify-content: flex-end; font-size: var(--s-fs-caption); color: var(--s-ink-3); }
.s-fb-rule { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.5fr) auto; gap: 6px; align-items: center; }
.s-fb-rule > .s-select { display: flex; min-width: 0; }
.s-fb-rule > .s-btn { grid-column: 4; }
.s-fb-values { min-width: 0; display: flex; align-items: center; gap: 6px; }
.s-fb-values > .s-input, .s-fb-values > .s-select, .s-fb-values > .s-fb-date { flex: 1; min-width: 0; }
.s-fb-values > .s-select { display: flex; }
.s-fb-and { flex: none; font-size: var(--s-fs-caption); color: var(--s-ink-3); }
.s-fb-error, .s-fb-missing { grid-column: 1 / -1; color: var(--s-late); }
.s-fb-missing { grid-column: 2 / 4; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-fb-rule.is-error .s-input { border-color: var(--s-late); }
.s-fb-add { display: flex; flex-wrap: wrap; gap: 4px; }
.s-fb-left { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-2); }
.s-fb-left > .s-icon { color: var(--s-ink-3); }
.s-fb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--s-control-h); padding-top: 8px; border-top: 1px solid var(--s-line); color: var(--s-ink-3); }
/* Narrow, as in a drawer on a phone: field and remove on one line, the operator and the value each on their own. */
@container s-fb (max-width: 520px) {
    .s-fb-item { grid-template-columns: minmax(0, 1fr); }
    .s-fb-join { min-height: 0; justify-content: flex-start; }
    .s-fb-join:empty { display: none; }
    .s-fb-rule { grid-template-columns: minmax(0, 1fr) auto; }
    .s-fb-rule > :nth-child(1) { grid-column: 1; grid-row: 1; }
    .s-fb-rule > .s-btn { grid-column: 2; grid-row: 1; }
    .s-fb-rule > :nth-child(2), .s-fb-values, .s-fb-missing { grid-column: 1 / -1; }
}

/* The filter pane of a list page has two ways on from its quick filters: one more field, or the filter builder. */
.s-filterpane-foot { flex-direction: column; align-items: flex-start; gap: 2px; }

/* ===== Data grid: a frame with a bar, the rows in their own scroll box and a foot. Rows and cells are table rows and
   cells: MudBlazor's stylesheet makes a long run of sibling div elements slow to style, and a table knows its columns. ===== */
.s-dg { --s-dg-row-h: var(--s-row-h); position: relative; flex: 1; min-width: 0; min-height: 240px; display: flex; flex-direction: column; container: s-dg / inline-size; }
.s-dg-probe { position: absolute; width: 0; height: var(--s-dg-row-h); visibility: hidden; pointer-events: none; }
.s-dg.is-sizing { cursor: col-resize; user-select: none; }
.s-dg-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; padding: 4px 8px; border-bottom: 1px solid var(--s-line); }
.s-dg-bar-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.s-dg-bar-far { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-left: auto; }
.s-dg-bar .s-search { width: 208px; }
.s-dg-groups { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 4px; }
.s-dg-groups-label { font-size: var(--s-fs-caption); color: var(--s-ink-2); }
.s-dg-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; }
.s-dg-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.s-dg-table th, .s-dg-table td { height: var(--s-dg-row-h); padding: 0 8px; border-bottom: 1px solid var(--s-line); background-color: var(--s-surface); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-dg-table .is-num { text-align: right; }
.s-dg-table col.s-dg-fill { width: auto; }
.s-dg-table th.s-dg-fill, .s-dg-table td.s-dg-fill { padding: 0; }
/* The head stays, the pinned columns stay, and where both meet the head is on top. */
.s-dg-table thead th { position: sticky; top: 0; z-index: 3; font-weight: 600; color: var(--s-ink-2); border-bottom-color: var(--s-line-strong); }
.s-dg-table .is-pinned { position: sticky; z-index: 2; }
.s-dg-table thead th.is-pinned { z-index: 4; }
.s-dg-table .s-dg-rowhead { left: 0; padding: 0 4px 0 12px; overflow: visible; text-overflow: clip; }
.s-dg-table td.s-dg-rowhead { display: table-cell; }
.s-dg-rowhead > .s-checkbox { vertical-align: middle; }
.s-dg-issue { display: inline-flex; margin-left: 4px; vertical-align: middle; color: var(--s-late); }
.s-dg-table .is-pinned-left { box-shadow: inset -1px 0 0 var(--s-line-strong); }
.s-dg-table .is-pinned-right { box-shadow: inset 1px 0 0 var(--s-line-strong); }
.s-dg-table thead th.is-sorted { color: var(--s-ink); }
.s-dg-head { height: 100%; display: flex; align-items: center; gap: 2px; min-width: 0; }
.s-dg-sort { appearance: none; flex: 1; min-width: 0; height: 100%; display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; text-align: inherit; }
button.s-dg-sort { cursor: pointer; }
button.s-dg-sort:hover { color: var(--s-ink); }
th.is-num .s-dg-sort { justify-content: flex-end; }
@media (pointer: coarse) { .s-dg-sort { min-width: 44px; } }
.s-dg-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.s-dg-sortorder { flex: none; min-width: 14px; height: 14px; display: inline-grid; place-items: center; border-radius: var(--s-radius-round); background: var(--s-selected); font-size: 10px; line-height: 14px; }
.s-dg-menu { flex: none; display: inline-flex; margin-right: 2px; }
.s-dg-menu .s-btn { color: var(--s-ink-3) !important; }
.s-dg-menu .s-btn:hover, .s-dg-menu .s-btn.is-pressed { color: var(--s-ink) !important; }
.s-dg-resize { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; touch-action: none; }
.s-dg-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; width: 1px; background: var(--s-line-strong); }
.s-dg-resize:hover::after, .s-dg.is-sizing .s-dg-resize:hover::after { top: 0; bottom: 0; width: 2px; background: var(--s-focus); }
.s-dg-table th.is-dragging { opacity: .5; }
.s-dg-table th.is-drop-before { box-shadow: inset 3px 0 0 var(--s-focus); }
.s-dg-table th.is-drop-after { box-shadow: inset -3px 0 0 var(--s-focus); }
/* Rows: hover and selection as a layer over the surface, so pinned cells stay opaque. */
.s-dg-row:hover td { background-image: linear-gradient(var(--s-fill), var(--s-fill)); }
.s-dg-row.is-selected td, .s-dg-row.is-selected:hover td { background-image: linear-gradient(var(--s-brand-tint), var(--s-brand-tint)); }
/* A status in a row or in the head of a group: its tint lies on the surface, whatever the row shows (hover, selected,
   a group), so the word keeps the contrast it has on a plain surface. */
.s-dg-table .s-chip { background-color: var(--s-surface); background-image: linear-gradient(var(--s-tone-tint), var(--s-tone-tint)); }
.s-dg-row.is-loading:hover td { background-image: none; }
.s-dg-table td.is-editable { cursor: cell; }
.s-dg-table td.is-invalid { box-shadow: inset 0 -2px 0 var(--s-late); background-image: linear-gradient(var(--s-late-tint), var(--s-late-tint)); }
.s-dg-row.is-invalid > .s-dg-rowhead { box-shadow: inset 3px 0 0 var(--s-late); }
/* The cell the keyboard is on: a quiet frame while the grid does not have the keyboard, the focus stroke while it has. */
.s-dg-table td.is-active, .s-dg-table th.is-active { box-shadow: inset 0 0 0 1px var(--s-line-accessible); }
.s-app .s-dg-table [data-dg-cell]:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-dg-link { color: var(--s-brand); font-weight: 600; }
.s-dg-flag { display: inline-flex; vertical-align: middle; color: var(--s-ink-2); }
/* Editing: the editor fills the cell, with the focus stroke as its border; what is wrong hangs under the cell. */
.s-dg-table td.is-editing { position: relative; z-index: 2; padding: 0; overflow: visible; }
.s-dg-table td.is-editing.is-pinned { position: sticky; z-index: 5; }
.s-dg-editor { display: block; width: 100%; height: calc(var(--s-dg-row-h) - 1px); margin: 0; padding: 0 6px; border: 2px solid var(--s-focus); border-radius: 0; background: var(--s-surface); color: var(--s-ink);
               font-family: inherit; font-size: var(--s-fs-control); line-height: var(--s-lh-body); font-variant-numeric: tabular-nums; }
.s-dg-editor.is-num { text-align: right; }
.s-dg-editor.is-mono { font-family: var(--s-font-mono); }
.s-app .s-dg-editor:focus-visible { outline: none; }
.s-dg-editor[aria-invalid="true"] { border-color: var(--s-late); }
.s-dg-bubble { position: absolute; top: 100%; left: 0; z-index: 6; min-width: 220px; max-width: 320px; display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border: 1px solid var(--s-late);
               border-radius: var(--s-radius-control); background: var(--s-surface); color: var(--s-ink); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: left; white-space: normal; box-shadow: var(--s-shadow-8); }
.s-dg-bubble > .s-icon { color: var(--s-late); }
.is-pinned-right > .s-dg-bubble, td.is-num > .s-dg-bubble { left: auto; right: 0; }
/* Groups: the head of a group spans up to the first column with a total; its totals stand in their columns. */
.s-dg-group td { background-image: linear-gradient(var(--s-fill), var(--s-fill)); font-weight: 600; }
.s-dg-table td.s-dg-grouplabel { overflow: visible; }
.s-dg-groupbox { position: sticky; left: 8px; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding-left: calc(var(--s-dg-level, 0) * 20px); vertical-align: middle; }
.s-dg-toggle { appearance: none; flex: none; width: 24px; height: 24px; display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-dg-toggle:hover { background: var(--s-selected); color: var(--s-ink); }
.s-dg-groupcaption { font-weight: 400; color: var(--s-ink-2); }
.s-dg-groupvalue { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Rows that are not drawn: the space they take, with the lines of rows, so a fast scroll never shows a hole. */
.s-dg-table .s-dg-spacer td { height: auto; padding: 0; border: 0;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--s-dg-row-h) - 1px), var(--s-line) calc(var(--s-dg-row-h) - 1px), var(--s-line) var(--s-dg-row-h)); }
/* Totals under the grid: they stay in view while the rows scroll. */
.s-dg-table tfoot td { position: sticky; bottom: 0; z-index: 3; border-top: 1px solid var(--s-line-strong); border-bottom: 0; font-weight: 600; }
.s-dg-table tfoot td.is-pinned { z-index: 4; }
.s-dg-totals-label { font-weight: 400; color: var(--s-ink-2); }
.s-dg-empty { position: sticky; left: 0; width: 100%; display: grid; place-items: center; padding: 24px var(--s-pad); }
.s-dg-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 36px; padding: 4px var(--s-pad); border-top: 1px solid var(--s-line); color: var(--s-ink-3); }
.s-dg-selected { display: inline-flex; align-items: center; gap: 4px; color: var(--s-ink); }
.s-dg-notice { display: inline-flex; align-items: center; gap: 6px; color: var(--s-late); }
.s-dg-sorttext { font-size: var(--s-fs-caption); }
/* A narrow grid, as on a phone: nothing stays pinned (the head still does), so the columns have the width to scroll in. */
@container s-dg (max-width: 600px) {
    .s-dg-table tbody .is-pinned, .s-dg-table tfoot .is-pinned { position: static; }
    .s-dg-table thead th.is-pinned { left: auto !important; right: auto !important; }
    .s-dg-table .is-pinned-left, .s-dg-table .is-pinned-right { box-shadow: none; }
    .s-dg-bar .s-search { width: 100%; }
    .s-dg-sorttext { display: none; }
}

/* ===== Settings page: the sections at the left, the chosen one at the right ===== */
.s-main-inner:has(> .s-set) { max-width: none; }
.s-set { display: flex; flex-direction: column; gap: var(--s-gap); min-width: 0; container: s-page / inline-size; }
.s-set-body { display: grid; grid-template-columns: minmax(200px, 264px) minmax(0, 1fr); gap: var(--s-gap); align-items: start; }
.s-set-nav { position: sticky; top: calc(var(--s-appbar-h) + var(--s-page-pad-y)); min-width: 0; }
.s-set-navlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.s-set-navitem { appearance: none; position: relative; width: 100%; min-height: var(--s-nav-item-h); display: flex; align-items: center; gap: 10px; margin: 0; padding: 4px 10px; border: 0; border-radius: var(--s-radius-control);
                background: transparent; color: var(--s-ink-2); font: inherit; text-align: left; cursor: pointer; transition: background var(--s-dur-fast) var(--s-ease); }
.s-set-navitem:hover { background: var(--s-fill); color: var(--s-ink); }
.s-set-navitem:active { background: var(--s-pressed); }
.s-set-navitem.is-active { background: var(--s-selected); color: var(--s-ink); font-weight: 600; }
.s-set-navitem.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: var(--s-radius-bar); background: var(--s-indicator); }
.s-set-navlabel { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.s-set-dot { flex: none; width: 8px; height: 8px; border-radius: var(--s-radius-round); background: var(--s-human); }
.s-set-lock { color: var(--s-ink-3); }
.s-set-pick { display: none; }
.s-set-pick .s-select { display: flex; }
.s-set-section { min-width: 0; display: flex; flex-direction: column; }
.s-set-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: var(--s-pad) var(--s-pad) 12px; border-bottom: 1px solid var(--s-line); }
.s-set-heading { min-width: 0; }
.s-set-title { margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-app .s-set-title:focus { outline: none; }
.s-set-desc { margin: 4px 0 0; max-width: 80ch; color: var(--s-ink-2); }
.s-set-msg { padding: 12px var(--s-pad) 0; }
/* The stroke of a changed field stands in the gutter, so the labels line up with the title of the section. */
.s-set-fields { max-width: 760px; display: flex; flex-direction: column; padding: 4px var(--s-pad) var(--s-pad-sm) calc(var(--s-pad) - 15px); }
.s-set-field { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 0 12px 12px; border-left: 3px solid transparent; }
.s-set-field + .s-set-field { border-top: 1px solid var(--s-line); }
/* A field that was changed and not saved yet: a stroke along it and the words under it. */
.s-set-field.is-changed { border-left-color: var(--s-human); }
.s-set-label { font-weight: 600; }
.s-set-field > .s-input, .s-set-field > .s-select, .s-set-field > .s-datefield { width: min(400px, 100%); }
.s-set-field > .s-select { display: flex; }
.s-set-value { min-height: var(--s-control-h); display: flex; align-items: center; }
.s-set-help { margin: 0; max-width: 72ch; color: var(--s-ink-2); }
.s-set-changed { font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; color: var(--s-human); }
.s-set-field.is-error > .s-input { border-color: var(--s-late); }
.s-set-error { color: var(--s-late); }
.s-set-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px var(--s-pad); border-top: 1px solid var(--s-line); border-radius: 0 0 var(--s-card-radius, var(--s-radius-card)) var(--s-card-radius, var(--s-radius-card));
              background: var(--s-surface); }
@container s-page (max-width: 760px) {
    .s-set-body { grid-template-columns: minmax(0, 1fr); }
    .s-set-nav { display: none; }
    .s-set-pick { display: block; }
}

/* ===== Worksheet page: the frame of a list page with the grid as its rows ===== */
.s-lp-card > .s-dg { flex: 1; min-height: 0; }
.s-wp-issues { flex: none; padding: 8px var(--s-pad-sm) 0; }
.s-wp-issues + .s-dg > .s-dg-bar { border-top: 0; }
@media (max-width: 860px) { .s-wp .s-lp-card > .s-dg { min-height: 60vh; } }

/* ===== Document page: the frame of a card page, with the status flow above the fields and the lines under them ===== */
.s-docp-flow { padding: 12px var(--s-pad); container-type: inline-size; }
.s-docp-lines { min-width: 0; display: flex; flex-direction: column; }
.s-docp-lineshead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 48px; padding: 4px var(--s-pad-sm) 4px var(--s-pad); border-bottom: 1px solid var(--s-line); }
.s-docp-locked { display: inline-flex; align-items: center; gap: 6px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); color: var(--s-ink-3); }
.s-docp-linetools { display: flex; flex-wrap: wrap; gap: 2px; }
.s-docp-lines > .s-dg { flex: none; min-height: 0; }
/* A narrow document: the line tools keep their icon; their words stay for a screen reader and as a tooltip. */
@container s-page (max-width: 620px) {
    .s-docp-linetools .s-btn { width: var(--s-control-h); min-width: 0; padding: 0; }
    .s-docp-linetools .s-btn .s-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.s-docp-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; padding: 12px var(--s-pad) var(--s-pad); border-top: 1px solid var(--s-line); }
.s-docp-total { display: grid; grid-template-columns: minmax(96px, auto) minmax(112px, auto); column-gap: 24px; justify-content: end; }
.s-docp-total dt { color: var(--s-ink-2); text-align: right; }
.s-docp-total dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.s-docp-total.is-strong { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--s-line-strong); }
.s-docp-total.is-strong dt, .s-docp-total.is-strong dd { color: var(--s-ink); font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }

/* A touch screen (docs/library/responsive.md): what a finger must hit is 44 px, and a key of the keyboard says
   nothing where there is none. Sizes only; what changes place on a narrow screen stands with each part above. */
@media (pointer: coarse) {
    .s-cmdk-input { height: 44px; }
    .s-cmdk-scope { position: relative; height: 32px; min-width: 44px; padding: 0 12px; }
    .s-cmdk-scope::after { content: ""; position: absolute; top: -6px; left: 0; width: 100%; height: 44px; }
    .s-cmdk .s-kbd, .s-cmdk-trigger .s-kbd, .s-cmdk-foot { display: none; }
    .s-notif-bar { --s-tab-h: 44px; }
    .s-dg-toggle { position: relative; }
    .s-dg-toggle::after { content: ""; position: absolute; top: -10px; left: -10px; width: 44px; height: 44px; }
    button.s-step-box { min-width: 44px; min-height: 44px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .s-drawer, .s-cmdk, .s-drawer-backdrop, .s-cmdk-backdrop { animation: none; }
}

/* ===== Golf 3, data: tree table, kanban, Gantt chart, scheduler, pivot table, virtual list =====
   One block, so the other parts of wave 3 never meet it. Sizes for a finger stand at the end of the block. */

/* Tree table: a table whose first column carries the tree. The head stays in view; a line with children shows its total. */
.s-tt { min-width: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); }
.s-tt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
.s-tt-table th, .s-tt-table td { height: var(--s-row-h); padding: 0 12px; border-bottom: 1px solid var(--s-line); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-tt-table thead th { position: sticky; top: 0; z-index: 1; background: var(--s-surface); color: var(--s-ink-2); font-weight: 600; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-tt-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.s-tt-table .s-tt-check { width: 44px; padding: 0 0 0 12px; }
.s-tt-row { cursor: default; }
.s-tt-row:hover > td { background: var(--s-fill); }
.s-tt-row.is-chosen > td { background: var(--s-selected); }
.s-tt-row:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-tt-row.is-branch > td { font-weight: 600; }
.s-tt-cell { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; padding-left: calc(var(--s-tt-level, 0) * 20px); }
.s-tt-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.s-tt-toggle { flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-small); background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-tt-toggle:hover { background: var(--s-fill); color: var(--s-ink); }
.s-tt-leaf { flex: none; width: 24px; }
.s-tt-state td { color: var(--s-ink-3); font-size: var(--s-fs-caption); }
.s-tt-state.is-failed td { color: var(--s-late); }
.s-tt-table .s-tt-empty { color: var(--s-ink-3); text-align: center; }
.s-tt-foot td { position: sticky; bottom: 0; background: var(--s-surface); border-top: 1px solid var(--s-line-strong); border-bottom: 0; font-weight: 600; }

/* Kanban: columns as wells with the status colour along the top, the cards the only white. A grabbed card lifts; a
   column that takes it lights up, one that does not says why. */
.s-kb { min-width: 0; display: flex; flex-direction: column; }
.s-kb-scroll { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
.s-kb-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-radius: var(--s-radius-card); background: var(--s-fill); transition: background var(--s-dur-fast) var(--s-ease), box-shadow var(--s-dur-fast) var(--s-ease); }
.s-kb-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 var(--s-pad-sm); border-top: 2px solid var(--s-tone); border-radius: var(--s-radius-card) var(--s-radius-card) 0 0; }
.s-kb-col.s-tone-neutral .s-kb-head { border-top-color: var(--s-line-strong); }
.s-kb-dot { flex: none; width: 8px; height: 8px; border-radius: var(--s-radius-round); background: var(--s-tone); }
.s-kb-title { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; }
.s-kb-count { flex: none; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-variant-numeric: tabular-nums; }
.s-kb-col.is-full .s-kb-count { color: var(--s-late); font-weight: 600; }
.s-kb-why { flex: none; margin: 0 8px 4px; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-kb-cards { flex: 1; min-height: 64px; margin: 0; padding: 2px 6px 8px; list-style: none; display: flex; flex-direction: column; gap: 6px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; }
.s-kb-item { display: block; }
.s-kb-empty { padding: 14px 8px; border: 1px dashed var(--s-line-strong); border-radius: var(--s-radius-card); color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); text-align: center; }
.s-kb-card { display: flex; flex-direction: column; gap: 2px; min-height: 44px; box-sizing: border-box; padding: 8px 10px; border-radius: var(--s-radius-card); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-2); cursor: grab;
             touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: box-shadow var(--s-dur-fast) var(--s-ease); }
.s-kb-card:hover { box-shadow: var(--s-shadow-8); }
.s-kb-card:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-kb-card.is-grabbed { box-shadow: var(--s-shadow-16); outline: 2px solid var(--s-brand); outline-offset: 1px; }
.s-kb-card.is-dragging { opacity: .4; }
.s-kb-card-key { font-weight: 600; overflow-wrap: anywhere; }
.s-kb-card-line { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow-wrap: anywhere; }
.s-kb-ghost { position: fixed; z-index: 70; margin: 0; pointer-events: none; box-shadow: var(--s-shadow-28); cursor: grabbing; }
.s-kb.is-dragging, .s-kb.is-dragging * { cursor: grabbing; }
.s-kb-col.is-drop-ok { background: var(--s-brand-tint); }
.s-kb-col.is-drop-no { opacity: .6; }
.s-kb-col.is-target, .s-kb-col.is-over { box-shadow: inset 0 0 0 2px var(--s-brand); }
.s-kb-col.is-drop-no.is-target, .s-kb-col.is-drop-no.is-over { box-shadow: inset 0 0 0 2px var(--s-late); opacity: 1; }

/* Gantt chart and scheduler: one scroll area; the names at the left and the head at the top stay in view. */
.s-gt, .s-sc { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.s-gt-tools, .s-sc-tools { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.s-gt-scroll, .s-sc-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); }
.s-gt-grid { --s-gt-row: 40px; --s-gt-names: 200px; position: relative; width: calc(var(--s-gt-names) + var(--s-gt-axis)); }
.s-gt-head, .s-sc-head { position: sticky; top: 0; z-index: 5; display: flex; background: var(--s-surface); border-bottom: 1px solid var(--s-line-strong); }
.s-gt-corner, .s-sc-corner { position: sticky; left: 0; z-index: 1; flex: none; box-sizing: border-box; display: flex; align-items: flex-end; padding: 0 12px 4px; background: var(--s-surface); border-right: 1px solid var(--s-line);
                             color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-gt-corner { width: var(--s-gt-names); }
.s-gt-scale { position: relative; flex: none; width: var(--s-gt-axis); height: 48px; }
.s-gt-scale-top, .s-gt-scale-bottom { position: absolute; left: 0; right: 0; height: 24px; }
.s-gt-scale-top { top: 0; }
.s-gt-scale-bottom { top: 24px; }
.s-gt-scale > div > span { position: absolute; top: 0; height: 24px; box-sizing: border-box; padding: 0 4px; overflow: clip; border-left: 1px solid var(--s-line); color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: 24px; white-space: nowrap; }
.s-gt-scale-top span { color: var(--s-ink); font-weight: 600; }
/* The name of a month stays in sight while its band runs on past the names column. */
.s-gt-scale-label { position: sticky; left: calc(var(--s-gt-names) + 4px); display: inline-block; }
.s-gt-rows { position: relative; }
.s-gt-row { display: flex; height: var(--s-gt-row); border-bottom: 1px solid var(--s-line); box-sizing: border-box; }
.s-gt-name { position: sticky; left: 0; z-index: 3; flex: none; box-sizing: border-box; width: var(--s-gt-names); padding: 0 12px; background: var(--s-surface); border-right: 1px solid var(--s-line);
             line-height: calc(var(--s-gt-row) - 1px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-gt-lane { position: relative; flex: none; width: var(--s-gt-axis); }
.s-gt-bar { position: absolute; z-index: 2; top: 6px; height: calc(var(--s-gt-row) - 13px); min-width: 6px; display: flex; align-items: center; padding: 0 10px; box-sizing: border-box; border-radius: var(--s-radius-control);
            background: var(--s-primary); color: var(--s-on-primary, #fff); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; overflow: hidden;
            touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.s-gt-bar[data-tl-movable], .s-sc-item[data-tl-movable] { cursor: grab; }
.s-gt-bar:focus-visible, .s-sc-item:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-gt-bar.is-grabbed, .s-sc-item.is-grabbed { box-shadow: var(--s-shadow-16); outline: 2px dashed var(--s-ink); outline-offset: 2px; }
.s-gt-bar.is-dragging, .s-sc-item.is-dragging { z-index: 4; opacity: .85; box-shadow: var(--s-shadow-16); cursor: grabbing; }
.s-gt-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.s-gt-edge, .s-sc-edge { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.s-gt-edge.is-start { left: 0; }
.s-gt-edge.is-end, .s-sc-edge { right: 0; }
.s-tl-ghost { position: absolute; z-index: 1; border: 2px dashed var(--s-brand); border-radius: var(--s-radius-control); background: var(--s-brand-tint); pointer-events: none; box-sizing: border-box; }
.s-gt-today { position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; margin-left: calc(var(--s-gt-names) - 1px); background: var(--s-late); pointer-events: none; }
.s-gt-today span { position: absolute; top: 2px; left: 4px; padding: 0 4px; border-radius: var(--s-radius-small); background: var(--s-late); color: var(--s-surface); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; }
.s-gt-links { position: absolute; top: 0; left: var(--s-gt-names); width: var(--s-gt-axis); height: 100%; z-index: 1; pointer-events: none; }
.s-gt-link { position: absolute; background: var(--s-ink-3); }
.s-gt-link.is-h { height: 2px; margin-top: -1px; }
.s-gt-link.is-v { width: 2px; margin-left: -1px; }
.s-gt-head-arrow { position: absolute; width: 0; height: 0; margin: -5px 0 0 -7px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid var(--s-ink-3); }
.s-gt-head-arrow.is-back { margin-left: 0; border-left: 0; border-right: 7px solid var(--s-ink-3); }
.s-gt-empty { margin: 0; padding: 24px; color: var(--s-ink-3); text-align: center; }

.s-sc-period { margin: 0 0 0 8px; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-sc-grid { --s-sc-names: 208px; --s-sc-lane: 52px; position: relative; width: calc(var(--s-sc-names) + var(--s-sc-axis)); }
.s-sc-corner { width: var(--s-sc-names); }
.s-sc-hours { position: relative; flex: none; width: var(--s-sc-axis); height: 48px; }
.s-sc-day { position: absolute; top: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border-left: 1px solid var(--s-line-strong); }
.s-sc-day.is-today .s-sc-day-name { color: var(--s-brand); }
.s-sc-day-name { padding: 0 6px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; white-space: nowrap; }
.s-sc-hour-row { display: flex; }
.s-sc-hour { flex: none; height: 24px; padding: 0 4px; border-left: 1px solid var(--s-line); color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: 24px; white-space: nowrap; overflow: hidden; box-sizing: border-box; }
.s-sc-hour:first-child { border-left: 0; }
.s-sc-row { display: flex; border-bottom: 1px solid var(--s-line); }
.s-sc-name { position: sticky; left: 0; z-index: 3; flex: none; box-sizing: border-box; width: var(--s-sc-names); display: flex; align-items: center; padding: 4px 12px; background: var(--s-surface); border-right: 1px solid var(--s-line); overflow: hidden; }
.s-sc-lane { position: relative; flex: none; width: var(--s-sc-axis); height: calc(var(--s-sc-lane) * var(--s-sc-lanes, 1));
             background-image: repeating-linear-gradient(to right, transparent 0 calc(var(--s-sc-hour) - 1px), var(--s-line) calc(var(--s-sc-hour) - 1px) var(--s-sc-hour)); }
.s-sc-now { position: absolute; top: 48px; bottom: 0; z-index: 2; width: 2px; margin-left: calc(var(--s-sc-names) - 1px); background: var(--s-late); pointer-events: none; }
.s-sc-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--s-line) 0 1px, transparent 1px 8px), var(--s-fill); }
.s-sc-item { position: absolute; z-index: 2; height: calc(var(--s-sc-lane) - 6px); margin-top: 3px; display: flex; flex-direction: column; justify-content: center; padding: 0 10px; box-sizing: border-box; border-left: 3px solid var(--s-brand);
             border-radius: var(--s-radius-control); background: var(--s-brand-tint); color: var(--s-ink); overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.s-sc-item.is-clash { border-left-color: var(--s-late); background: var(--s-late-tint); }
.s-sc-item.is-outside { border-left-style: dashed; }
.s-sc-item-title { display: flex; align-items: center; gap: 4px; font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-sc-item.is-clash .s-sc-item-title { color: var(--s-late); }
.s-sc-item-time { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Pivot table: the choice of fields as a bar of zones, the table under it with its head and first column in view. */
.s-pv { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.s-pv-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 16px; }
.s-pv-zone { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-pv-zone-label { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-pv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.s-pv-chips .s-select { width: auto; min-width: 160px; }
.s-pv-value { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); background: var(--s-surface); }
.s-pv-value .s-select { min-width: 0; width: 132px; }
.s-pv-value-name { font-weight: 600; white-space: nowrap; }
.s-pv-remove { width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--s-radius-small); background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-pv-remove:hover { background: var(--s-fill); color: var(--s-ink); }
.s-pv-tools { margin-left: auto; align-self: flex-end; }
.s-pv-scroll { min-width: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); }
.s-pv-scroll:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-pv-table { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
.s-pv-table th, .s-pv-table td { height: var(--s-row-h); padding: 0 12px; border-bottom: 1px solid var(--s-line); white-space: nowrap; text-align: left; }
.s-pv-table thead th { position: sticky; top: 0; z-index: 2; background: var(--s-surface); color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; }
.s-pv-table thead tr + tr th { top: var(--s-row-h); }
.s-pv-table tbody th { position: sticky; left: 0; z-index: 1; padding-left: calc(12px + var(--s-pv-level, 0) * 20px); background: var(--s-surface); font-weight: 400; }
.s-pv-table thead .s-pv-corner { left: 0; z-index: 3; }
.s-pv-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.s-pv-table td.is-total { background: var(--s-fill); }
.s-pv-table tr.is-group th { font-weight: 600; }
.s-pv-table tr.is-subtotal th, .s-pv-table tr.is-subtotal td { font-weight: 600; background: var(--s-fill); }
.s-pv-table tr.is-grand th, .s-pv-table tr.is-grand td { position: sticky; bottom: 0; font-weight: 600; background: var(--s-surface); border-top: 1px solid var(--s-line-strong); border-bottom: 0; }
.s-pv-table .s-pv-empty { color: var(--s-ink-3); text-align: center; }
.s-pv-foot { margin: 0; color: var(--s-ink-3); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }

/* Virtual list: only what is in view is drawn; a group heading stays at the top while its lines pass under it. */
.s-vl { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); overflow: hidden; }
.s-vl-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; overflow-anchor: none; }
.s-vl-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--s-focus); }
.s-vl-space { position: relative; }
.s-vl-window { position: absolute; top: 0; left: 0; right: 0; }
.s-vl-group, .s-vl-sticky { box-sizing: border-box; height: 32px; padding: 0 12px; display: flex; align-items: center; background: var(--s-fill); color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 600; border-bottom: 1px solid var(--s-line); }
.s-vl-sticky { position: sticky; top: 0; z-index: 2; margin-bottom: -32px; }
.s-vl-item { box-sizing: border-box; min-height: 44px; padding: 8px 12px; border-bottom: 1px solid var(--s-line); cursor: default; }
.s-vl-item:hover { background: var(--s-fill); }
.s-vl-item.is-active { background: var(--s-selected); box-shadow: inset 2px 0 0 var(--s-brand); }
.s-vl-empty { padding: 24px; color: var(--s-ink-3); text-align: center; }

/* A phone: the columns of a board each nearly the width of the screen, the names of a timeline narrower. */
@media (max-width: 700px) {
    .s-kb-scroll { grid-auto-columns: 85%; scroll-snap-type: x mandatory; }
    .s-kb-col { scroll-snap-align: start; }
    /* While a card is dragged the board scrolls a little at a time at its edge, not a whole column per step. */
    .s-kb.is-grabbing .s-kb-scroll, .s-kb.is-dragging .s-kb-scroll { scroll-snap-type: none; }
    .s-gt-grid { --s-gt-names: 120px; }
    .s-sc-grid { --s-sc-names: 128px; }
    .s-pv-tools { margin-left: 0; }
}
/* A finger (docs/library/responsive.md): rows and bars of 44 px and more, the small buttons with a larger area. */
@media (pointer: coarse) {
    .s-tt-toggle, .s-pv-remove { position: relative; }
    .s-tt-toggle::after, .s-pv-remove::after { content: ""; position: absolute; top: -10px; left: -10px; width: 44px; height: 44px; }
    .s-gt-grid { --s-gt-row: 58px; }
    .s-gt-bar { top: 6px; height: 45px; }
    .s-gt-edge, .s-sc-edge { width: 16px; }
    .s-sc-grid { --s-sc-lane: 56px; }
    .s-sc-item { height: 50px; }
    /* A short task or appointment stays something to hit: a little longer than its time, never narrower than a finger. */
    .s-gt-bar, .s-sc-item { min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .s-kb-col, .s-kb-card { transition: none; }
}

/* ---- Scan field: a code that is typed or scanned, with a viewfinder (StarrukScanField) ---- */
.s-scan-row { display: flex; align-items: stretch; gap: 8px; }
.s-scan-input { flex: 1 1 auto; }
.s-scan-row > .s-btn { flex: none; }
.s-scan-view { position: relative; display: grid; gap: 8px; margin-top: 8px; padding: 8px; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); box-shadow: var(--s-shadow-8, none); }
.s-scan-video { display: block; width: 100%; max-height: 360px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--s-radius-control); background: #111; }
.s-scan-stage { position: relative; min-height: 0; }
.s-scan-frame { position: absolute; inset: 0; margin: auto; width: min(56%, 240px); aspect-ratio: 1; border: 2px solid rgb(255 255 255 / 0.9); border-radius: var(--s-radius-dialog); box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.28); pointer-events: none; transition: border-color 120ms, box-shadow 120ms; overflow: hidden; }
.s-scan-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: rgb(255 255 255 / 0.85); animation: s-scan-sweep 1.8s ease-in-out infinite alternate; }
.s-scan-frame[data-hit] { border-color: var(--s-done, #107c10); box-shadow: 0 0 0 9999px rgb(16 124 16 / 0.28); }
.s-scan-frame[data-hit] .s-scan-line { background: var(--s-done, #107c10); animation: none; }
.s-scan-note { margin: 0; color: var(--s-ink-2); font-size: 14px; line-height: 20px; }
.s-scan-note.is-failure { color: var(--s-late); }
.s-scan-count { margin: 0; color: var(--s-ink); font-weight: 600; font-size: 14px; }
.s-scan-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.s-scan.is-found .s-scan-input { animation: s-scan-found 1s ease-out 1; }
@keyframes s-scan-sweep { from { top: 18%; } to { top: 82%; } }
@keyframes s-scan-found { from { border-color: var(--s-done, #107c10); box-shadow: 0 0 0 3px rgb(16 124 16 / 0.3); } to { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 600px) {
    .s-scan-view { position: fixed; inset: 0; z-index: 1000; margin: 0; padding: 12px; border: 0; border-radius: 0; grid-template-rows: minmax(0, 1fr) auto auto auto; }
    .s-scan-video { height: 100%; max-height: none; aspect-ratio: auto; }
    .s-scan-frame { width: min(64%, 260px); }
    .s-scan-actions > .s-btn { flex: 1 1 auto; }
}
@media (pointer: coarse) {
    .s-scan-row > .s-btn, .s-scan-actions > .s-btn { min-height: 44px; min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .s-scan-line { animation: none; }
    .s-scan.is-found .s-scan-input { animation: none; }
}
/* ===== Diagrams: the status flow designer and the org chart (one engine, StarrukDiagram) ===== */
.s-flow, .s-org { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.s-flow-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.s-flow-title { margin: 0; font-size: var(--s-fs-subtitle, 16px); font-weight: 600; }
.s-flow-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.s-flow-problems { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: start; padding: 8px 12px; border-radius: var(--s-radius-control); background: var(--s-late-tint); color: var(--s-ink); }
.s-flow-problems.is-ok { background: var(--s-done-tint); }
.s-flow-problems > .s-icon { color: var(--s-late); }
.s-flow-problems.is-ok > .s-icon { color: var(--s-done); }
.s-flow-problems ul { grid-column: 2; margin: 0; padding-left: 18px; }
.s-flow-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 12px; align-items: start; }
.s-flow-body > :only-child { grid-column: 1 / -1; }
.s-flow-canvas { min-width: 0; max-height: 70vh; overflow: auto; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); background: var(--s-bg); }
.s-flow-svg { display: block; }
.s-flow-svg text { fill: var(--s-ink); font-size: 13px; }
.s-flow-node { cursor: grab; }
.s-flow-node.is-dragging { cursor: grabbing; opacity: .85; }
.s-flow-box { fill: var(--s-surface); stroke: var(--s-line-strong); stroke-width: 1; }
.s-flow-bar { fill: var(--s-tone, var(--s-ink-3)); }
.s-flow-node.is-selected .s-flow-box, .s-org-node.is-current .s-flow-box { stroke: var(--s-brand); stroke-width: 2; }
.s-flow-node:focus, .s-flow-edge:focus, .s-org-node:focus { outline: none; }
.s-flow-node:focus-visible .s-flow-box, .s-org-node:focus-visible .s-flow-box { stroke: var(--s-focus); stroke-width: 3; }
.s-flow-node:focus-visible, .s-org-node:focus-visible, .s-flow-edge:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-flow-svg .s-flow-code { fill: var(--s-ink-2); font-size: 12px; }
.s-flow-svg .s-flow-name { font-weight: 600; }
.s-flow-line { fill: none; stroke: var(--s-ink-3); stroke-width: 1.6; }
.s-flow-edge.is-back .s-flow-line { stroke-dasharray: 5 4; }
.s-flow-edge.is-open .s-flow-line { stroke: var(--s-late); }
.s-flow-edge.is-selected .s-flow-line, .s-flow-edge:hover .s-flow-line { stroke: var(--s-brand); stroke-width: 2.4; }
.s-flow-hit { fill: none; stroke: transparent; stroke-width: 22; cursor: pointer; }
.s-flow-head-mark { fill: var(--s-ink-3); }
.s-flow-svg .s-flow-verb { font-size: 12px; fill: var(--s-ink-2); paint-order: stroke; stroke: var(--s-bg); stroke-width: 4px; stroke-linejoin: round; }
.s-flow-edge.is-open .s-flow-verb { fill: var(--s-late); }
.s-flow-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.s-flow-panel-title { margin: 0; font-size: inherit; font-weight: 600; }
.s-flow-note { margin: 0; font-size: var(--s-fs-caption); color: var(--s-ink-2); }
.s-flow-conditions { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 8px 10px; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); }
.s-flow-conditions legend { padding: 0 4px; font-weight: 600; }
.s-flow-lists { display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow-x: auto; }
.s-flow-hit-box { fill: transparent; cursor: pointer; }
.s-flow-lists tr.is-selected td { background: var(--s-selected); }
.s-org-line { fill: none; stroke: var(--s-line-strong); stroke-width: 1.4; }
.s-org-node { cursor: pointer; }
.s-org-node.is-match .s-flow-box { fill: var(--s-brand-tint); stroke: var(--s-brand); }
.s-org-fold rect { fill: var(--s-fill); stroke: var(--s-line-strong); }
.s-flow-svg .s-org-fold text { font-size: 12px; font-weight: 600; }
@media (max-width: 860px) { .s-flow-body { grid-template-columns: minmax(0, 1fr); } }
/* On a phone every text of a diagram is 14px at least; the boxes are wide enough for it. */
@media (pointer: coarse) {
    .s-flow-box { stroke-width: 1.5; }
    .s-flow-svg text, .s-flow-svg .s-flow-code, .s-flow-svg .s-flow-verb, .s-flow-svg .s-org-fold text { font-size: 14px; }
}
/* ===== Golf 4b, invoer: geld, procent, registratienummers, adres, kalender en kiezers, overzetlijst, boomkeuze,
   link, toets, Markdown, onderblad en versies. One block, so the other parts of wave 4 never meet it. ===== */

/* Money: the currency at the end of the box, as a small select without its own border. */

/* Address: postcode, number and addition on one row, street and town on the next; each part with its own small label. */
.s-address { min-width: 0; margin: 0; padding: 0; border: 0; }
.s-address > legend { padding: 0; }
.s-address-row { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.s-address-row + .s-address-row { margin-top: 8px; }
.s-address-part { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-address-part-label { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-address-code { flex: 0 1 112px; min-width: 96px; }
.s-address-code .s-input-el { text-transform: uppercase; font-variant-numeric: tabular-nums; }
.s-address-number { flex: 0 1 88px; min-width: 72px; }
.s-address-addition { flex: 0 1 88px; min-width: 72px; }
.s-address-street { flex: 2 1 200px; }
.s-address-city { flex: 1 1 160px; }

/* Calendar: a month in weeks from Monday, the week number in front. */
.s-calendar { display: inline-flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); color: var(--s-ink); }
.s-calendar-head, .s-picker-head { display: flex; align-items: center; gap: 4px; }
.s-calendar-title { flex: 1; margin: 0; padding: 0 4px; font-size: var(--s-fs-body); line-height: var(--s-lh-body); font-weight: 600; text-transform: capitalize; }
.s-picker-head .s-calendar-title { text-align: center; }
.s-calendar-nav, .s-calendar-today-btn { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px; border: 0; border-radius: var(--s-radius-control);
                                         background: transparent; color: var(--s-ink); font: inherit; font-size: var(--s-fs-caption); cursor: pointer; }
.s-calendar-nav:hover, .s-calendar-today-btn:hover { background: var(--s-fill); }
.s-calendar-nav:focus-visible, .s-calendar-today-btn:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-calendar-grid { border-collapse: separate; border-spacing: 2px; }
.s-calendar-grid th { height: 24px; color: var(--s-ink-3); font-size: var(--s-fs-caption); font-weight: 600; text-align: center; }
.s-calendar-grid abbr { text-decoration: none; }
.s-calendar-grid td { padding: 0; text-align: center; }
.s-calendar-wk { min-width: 28px; color: var(--s-ink-3); font-size: var(--s-fs-caption); font-variant-numeric: tabular-nums; }
.s-calendar-wk-btn { width: 28px; height: 32px; padding: 0; border: 0; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink-3); font: inherit; cursor: pointer; }
.s-calendar-wk-btn:hover { background: var(--s-fill); color: var(--s-ink); }
.s-calendar-day { width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--s-radius-round); background: transparent; color: var(--s-ink);
                  font: inherit; font-size: var(--s-fs-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.s-calendar-day:hover { background: var(--s-fill); }
.s-calendar-day:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-calendar-grid td.is-other .s-calendar-day { color: var(--s-ink-3); }
.s-calendar-grid td.is-today .s-calendar-day { border-color: var(--s-brand); font-weight: 600; }
.s-calendar-grid td.is-in-range .s-calendar-day { background: var(--s-brand-tint); border-radius: var(--s-radius-control); }
.s-calendar-grid td.is-selected .s-calendar-day { background: var(--s-brand); color: var(--s-on-primary, #fff); }
.s-calendar-grid td.is-blocked .s-calendar-day { color: var(--s-ink-disabled); text-decoration: line-through; cursor: not-allowed; }
.s-calendar-grid tr.is-chosen-week td .s-calendar-day { background: var(--s-brand-tint); border-radius: var(--s-radius-control); }
.s-calendar-grid tr.is-chosen-week td.is-selected .s-calendar-day { background: var(--s-brand); color: var(--s-on-primary, #fff); }

/* Week, month and year pickers: the choice in words between a back and an on button, a panel under it. */
.s-picker { position: relative; }
.s-picker-box { padding: 0; }
.s-picker-step { flex: none; width: 32px; align-self: stretch; display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--s-ink-2); cursor: pointer; }
.s-picker-step:hover:not(:disabled) { background: var(--s-fill); color: var(--s-ink); }
.s-picker-step:disabled { color: var(--s-ink-disabled); cursor: default; }
.s-picker-value { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; align-self: stretch; padding: 0 8px;
                  border: 0; border-left: 1px solid var(--s-line); border-right: 1px solid var(--s-line); background: transparent; color: var(--s-ink); font: inherit; text-align: left; cursor: pointer; }
.s-picker-value:hover:not(:disabled) { background: var(--s-fill); }
.s-picker-step:focus-visible, .s-picker-value:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-picker-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-picker-text.is-empty { color: var(--s-ink-3); }
.s-picker-backdrop, .s-treeselect-backdrop { position: fixed; inset: 0; z-index: 30; }
.s-picker-panel { position: absolute; z-index: 31; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px;
                  border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); box-shadow: var(--s-shadow-16); }
.s-picker-panel > .s-calendar { padding: 0; border: 0; }
.s-picker-grid { display: grid; grid-template-columns: repeat(3, 72px); gap: 4px; }
.s-picker-grid.is-years { grid-template-columns: repeat(4, 64px); }
.s-picker-cell { height: 40px; padding: 0 4px; border: 1px solid transparent; border-radius: var(--s-radius-control); background: transparent; color: var(--s-ink); font: inherit; cursor: pointer; text-transform: capitalize; }
.s-picker-cell:hover:not(:disabled) { background: var(--s-fill); }
.s-picker-cell:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-picker-cell.is-today { border-color: var(--s-brand); font-weight: 600; }
.s-picker-cell.is-selected { background: var(--s-brand); color: var(--s-on-primary, #fff); }
.s-picker-cell:disabled { color: var(--s-ink-disabled); cursor: not-allowed; }

/* Transfer list: two lists with the buttons between them. */
.s-transfer-body { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.s-transfer-side { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.s-transfer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.s-transfer-title { font-weight: 600; }
.s-transfer-count { color: var(--s-ink-3); font-size: var(--s-fs-caption); font-variant-numeric: tabular-nums; }
.s-transfer-list { margin: 0; padding: 4px; list-style: none; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); background: var(--s-surface); }
.s-transfer-list:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
.s-transfer-item { display: flex; align-items: center; gap: 8px; min-height: var(--s-row-h, 36px); padding: 0 8px; border-radius: var(--s-radius-control); cursor: default; user-select: none; }
.s-transfer-item:hover { background: var(--s-fill); }
.s-transfer-item.is-marked { background: var(--s-selected); }
.s-transfer-list:focus-visible .s-transfer-item.is-active { box-shadow: inset 0 0 0 1px var(--s-focus); }
.s-transfer-check { flex: none; width: 16px; height: 16px; display: inline-grid; place-items: center; border: 1px solid var(--s-line-accessible); border-radius: var(--s-radius-small); }
.s-transfer-item.is-marked .s-transfer-check, .s-treeselect-item.is-chosen .s-transfer-check { border-color: var(--s-brand); background: var(--s-brand); color: var(--s-on-primary, #fff); }
.s-transfer-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-transfer-empty { padding: 16px 8px; color: var(--s-ink-3); text-align: center; }
.s-transfer-moves { display: flex; flex-direction: column; justify-content: center; gap: 8px; }

/* Tree select: a combobox whose list is a tree. */
.s-treeselect { position: relative; }
.s-treeselect-box { flex-wrap: wrap; gap: 4px; min-height: var(--s-control-h); height: auto; padding-top: 2px; padding-bottom: 2px; }
.s-treeselect-box .s-input-el { flex: 1 1 96px; min-width: 64px; }
.s-treeselect-tree { position: absolute; z-index: 31; top: calc(100% - 18px); left: 0; right: 0; max-height: 320px; margin: 0; padding: 4px; list-style: none; overflow-y: auto;
                     overscroll-behavior: contain; border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); box-shadow: var(--s-shadow-16); }
.s-treeselect-item { display: flex; align-items: center; gap: 6px; min-height: var(--s-row-h, 36px); padding: 0 8px 0 calc(8px + var(--s-ts-level, 0) * 20px); border-radius: var(--s-radius-control); cursor: default; }
.s-treeselect-item:hover { background: var(--s-fill); }
.s-treeselect-item.is-active { background: var(--s-fill); box-shadow: inset 0 0 0 1px var(--s-focus); }
.s-treeselect-item.is-chosen { font-weight: 600; }
.s-treeselect-toggle { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; color: var(--s-ink-2); cursor: pointer; }
.s-treeselect-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-treeselect-path { margin-left: auto; color: var(--s-ink-3); font-size: var(--s-fs-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-treeselect-empty { padding: 12px 8px; color: var(--s-ink-3); }

/* Link and keys. */
.s-link { color: var(--s-brand-text, var(--s-brand)); text-decoration: underline; text-underline-offset: 2px; }
.s-link:hover { text-decoration-thickness: 2px; }
.s-link:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; border-radius: var(--s-radius-small); }
.s-link.is-external > .s-icon { margin-left: 2px; vertical-align: -1px; }
.s-link.is-plain { color: inherit; text-decoration: none; }
.s-kbd-combo { display: inline-flex; align-items: center; gap: 2px; font: inherit; }
.s-kbd-plus { color: var(--s-ink-3); font-size: var(--s-fs-caption); }

/* Markdown: text with its marks, in the rhythm of the page. */
.s-markdown { min-width: 0; overflow-wrap: anywhere; }
.s-markdown > :first-child { margin-top: 0; }
.s-markdown > :last-child { margin-bottom: 0; }
.s-markdown p, .s-markdown-list { margin: 0 0 12px; }
.s-markdown-list { padding-left: 24px; }
.s-markdown-heading { margin: 20px 0 8px; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-markdown h3.s-markdown-heading, .s-markdown h4.s-markdown-heading { font-size: var(--s-fs-body); line-height: var(--s-lh-body); }
.s-markdown-code { margin: 0 0 12px; padding: 12px; overflow-x: auto; border-radius: var(--s-radius-control); background: var(--s-fill); font-family: var(--s-font-mono); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); white-space: pre; }
.s-markdown.is-compact p, .s-markdown.is-compact .s-markdown-list, .s-markdown.is-compact .s-markdown-code { margin-bottom: 6px; }

/* Bottom sheet: from the bottom of the screen, a handle on top, no wider than a phone on a wide screen. */
.s-sheet-layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.s-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); animation: s-fade-in var(--s-dur-fast) linear; }
.s-sheet { position: relative; width: min(100%, 560px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; border-radius: var(--s-radius-dialog) var(--s-radius-dialog) 0 0;
           background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-28); padding-bottom: env(safe-area-inset-bottom, 0px);
           transition: transform var(--s-dur) var(--s-ease-out); animation: s-sheet-in var(--s-dur) var(--s-ease-out); }
.s-sheet.is-full { height: calc(100dvh - 48px); }
.s-sheet:focus { outline: none; }
.s-sheet-handle { flex: none; height: 24px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.s-sheet-handle > span { width: 36px; height: 4px; border-radius: var(--s-radius-round); background: var(--s-line-strong); }
.s-sheet-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 8px var(--s-pad); }
.s-sheet-title { flex: 1; margin: 0; font-family: var(--s-font-display); font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--s-pad) var(--s-pad); }
.s-sheet-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px var(--s-pad); border-top: 1px solid var(--s-line); }
@keyframes s-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
html:has(.s-sheet-layer) { overflow: hidden; }

/* Version history: the versions at the left, what changed at the right. */
.s-versions-title { margin: 0 0 8px; font-size: var(--s-fs-section); line-height: var(--s-lh-section); font-weight: 600; }
.s-versions-body { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.s-versions-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.s-versions-pick { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2px 8px; padding: 8px 10px; border: 0; border-left: 3px solid transparent; border-radius: var(--s-radius-control);
                   background: transparent; color: var(--s-ink); font: inherit; text-align: left; cursor: pointer; }
.s-versions-pick:hover { background: var(--s-fill); }
.s-versions-pick:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-versions-item.is-chosen .s-versions-pick { border-left-color: var(--s-brand); background: var(--s-selected); }
.s-versions-number { font-weight: 600; }
.s-versions-meta { flex-basis: 100%; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-versions-note { flex-basis: 100%; color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); }
.s-versions-view { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.s-versions-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* A phone: the lists under each other, the versions above what changed, the parts of an address the full width. */
@media (max-width: 700px) {
    .s-transfer-body { grid-template-columns: minmax(0, 1fr); }
    .s-transfer-moves { flex-direction: row; justify-content: center; }
    .s-transfer-moves .s-icon { transform: rotate(90deg); }
    .s-versions-body { grid-template-columns: minmax(0, 1fr); }
    .s-picker-panel { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; align-items: center; }
}
/* A finger (docs/library/responsive.md): days, cells and steps of 44 px. */
@media (pointer: coarse) {
    /* Seven days of 44 px and the week number fit a phone of 360 px: no space between the days. */
    .s-calendar { padding: 4px; }
    .s-calendar-grid { border-spacing: 0; }
    .s-picker-panel { padding: 4px; }
    .s-calendar-day, .s-calendar-wk-btn { width: 44px; height: 44px; }
    .s-calendar-wk { min-width: 24px; }
    .s-calendar-nav, .s-calendar-today-btn { min-width: 44px; height: 44px; }
    .s-picker-step { width: 44px; }
    .s-picker-cell { height: 48px; }
    .s-picker-grid { grid-template-columns: repeat(3, 88px); }
    .s-picker-grid.is-years { grid-template-columns: repeat(4, 72px); }
    .s-transfer-item, .s-treeselect-item { min-height: 48px; }
    .s-treeselect-toggle { width: 44px; height: 44px; }
    .s-sheet-handle { height: 32px; }
}
/* A small phone (320 px): seven days of 44 px only fit from edge to edge, so the calendar takes the full width of the
   screen and leaves out the week numbers (a day still chooses its week; the field names it). */
@media (pointer: coarse) and (max-width: 379px) {
    .s-calendar { width: 100vw; margin-inline: calc(50% - 50vw); padding: 4px 0; align-items: center; border-inline: 0; border-radius: 0; }
    .s-calendar-head, .s-picker-head { align-self: stretch; padding-inline: 4px; }
    .s-calendar-wk { display: none; }
    .s-picker-panel { left: 0; right: 0; bottom: 0; padding: 4px 0; border-radius: var(--s-radius-card) var(--s-radius-card) 0 0; }
    .s-picker-panel > .s-calendar { width: 100%; margin-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .s-sheet, .s-sheet-backdrop { animation: none; transition: none; }
}

/* ===== Account menu: the avatar at the right of the app bar opens who is signed in, profile, settings, theme,
   language and signing out, as Microsoft 365 has it. Under the avatar on a wide screen, a sheet from the bottom on a
   phone. ===== */
.s-acctmenu { position: relative; display: flex; align-self: stretch; }
.s-acctmenu-backdrop { position: fixed; inset: 0; z-index: 40; }
.s-acctmenu-menu { position: absolute; z-index: 41; top: calc(100% + 4px); right: max(4px, env(safe-area-inset-right, 0px)); width: 296px; max-width: calc(100vw - 16px);
                  max-height: calc(100dvh - var(--s-appbar-h) - 16px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 4px;
                  border: 1px solid var(--s-line); border-radius: var(--s-radius-card); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-16);
                  animation: s-fade-in var(--s-dur-fast) linear; }
.s-acctmenu-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 10px; }
.s-acctmenu-who { min-width: 0; display: flex; flex-direction: column; }
.s-acctmenu-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-acctmenu-line { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-acctmenu-group { display: flex; flex-direction: column; }
.s-acctmenu-label { padding: 8px 12px 4px; color: var(--s-ink-2); font-size: var(--s-fs-caption); font-weight: 600; line-height: var(--s-lh-caption); }
.s-acctmenu-sep { height: 1px; margin: 4px 0; background: var(--s-line); }
.s-acctmenu-form { display: contents; }
.s-acctmenu .s-acctmenu-item { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: var(--s-radius-control);
                  background: transparent; color: var(--s-ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.s-acctmenu-item > span { flex: 1; min-width: 0; }
.s-acctmenu-item > .s-icon { flex: none; color: var(--s-ink-2); }
.s-acctmenu-item > [data-account-check] { color: var(--s-brand); }
.s-acctmenu .s-acctmenu-item:hover { background: var(--s-fill); }
.s-app .s-acctmenu a.s-acctmenu-item, .s-app .s-acctmenu a.s-acctmenu-item:hover { color: var(--s-ink); text-decoration: none; }
.s-acctmenu-item:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-acctmenu-item[aria-checked="true"] { font-weight: 600; }
/* A phone: a sheet from the bottom over a dimmed page, items of 48 px under the thumb. */
@media (max-width: 700px) {
    .s-acctmenu-backdrop { background: rgba(0, 0, 0, .4); animation: s-fade-in var(--s-dur-fast) linear; }
    .s-acctmenu-menu { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: calc(100dvh - 48px);
                      padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: var(--s-radius-dialog) var(--s-radius-dialog) 0 0;
                      box-shadow: var(--s-shadow-28); animation: s-acctmenu-up var(--s-dur) var(--s-ease-out); }
    .s-acctmenu-head::before { content: ""; position: absolute; top: 8px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: var(--s-radius-round); background: var(--s-line-strong); }
    .s-acctmenu-head { padding-top: 20px; }
}
@media (pointer: coarse) {
    .s-acctmenu-item { min-height: 48px; }
}
@keyframes s-acctmenu-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .s-acctmenu-menu, .s-acctmenu-backdrop { animation: none; }
}

/* ===== Environments: which one this is next to the product, a coloured badge and a strip under the app bar for anything
   but production, and a menu to the others, as Business Central has it. On a phone the menu is a sheet. ===== */
:root { --s-env-production: #107c10; --s-env-test: #a4262c; --s-env-sandbox: #5c2e91; --s-env-development: #005b70; }
.s-appbar[data-environment-kind] { box-shadow: inset 0 -4px 0 var(--s-env-color); }
.s-envmenu-row[data-environment-kind="production"] { --s-env-color: var(--s-env-production); }
.s-appbar[data-environment-kind="test"], .s-envmenu[data-environment-kind="test"], .s-envmenu-row[data-environment-kind="test"] { --s-env-color: var(--s-env-test); }
.s-appbar[data-environment-kind="sandbox"], .s-envmenu[data-environment-kind="sandbox"], .s-envmenu-row[data-environment-kind="sandbox"] { --s-env-color: var(--s-env-sandbox); }
.s-appbar[data-environment-kind="development"], .s-envmenu[data-environment-kind="development"], .s-envmenu-row[data-environment-kind="development"] { --s-env-color: var(--s-env-development); }
.s-envmenu { position: relative; display: flex; align-items: center; align-self: stretch; min-width: 0; }
.s-envmenu-button { min-width: 0; height: calc(var(--s-appbar-h) - 12px); display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding: 0 8px;
                    border: 1px solid transparent; border-radius: var(--s-radius-control); background: transparent; color: var(--s-on-appbar) !important; font: inherit; cursor: pointer; }
.s-envmenu-button:hover { background: rgba(255, 255, 255, .12); }
.s-envmenu-button:focus-visible { outline: 2px solid var(--s-on-appbar); outline-offset: -2px; }
.s-envmenu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-envmenu-badge { flex: none; padding: 1px 8px; border-radius: var(--s-radius-round); background: var(--s-env-color); font-size: var(--s-fs-caption);
                   line-height: var(--s-lh-caption); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
                   color: var(--s-env-ink, #fff); }
.s-envmenu-badge-short { display: none; }
.s-envmenu-backdrop { position: fixed; inset: 0; z-index: 40; }
.s-envmenu-menu { position: absolute; z-index: 41; top: calc(100% + 4px); left: 0; width: 320px; max-width: calc(100vw - 16px); max-height: calc(100dvh - var(--s-appbar-h) - 16px);
                  overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--s-line);
                  border-radius: var(--s-radius-card); background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-16); animation: s-fade-in var(--s-dur-fast) linear; }
.s-envmenu-label { padding: 8px 12px 4px; color: var(--s-ink-2); font-size: var(--s-fs-caption); font-weight: 600; line-height: var(--s-lh-caption); }
.s-envmenu-row { display: flex; align-items: stretch; gap: 2px; }
.s-app .s-envmenu-item, .s-app .s-envmenu-item:hover, .s-app .s-envmenu-tab, .s-app .s-envmenu-tab:hover { color: var(--s-ink); text-decoration: none; }
.s-envmenu-item { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 4px 12px; border-radius: var(--s-radius-control); }
.s-envmenu-item[aria-checked="true"] { font-weight: 600; }
.s-envmenu-item > [data-environment-check] { flex: none; color: var(--s-brand); }
.s-envmenu-tab { flex: none; width: 44px; display: grid; place-items: center; border-radius: var(--s-radius-control); }
.s-envmenu-item:hover, .s-envmenu-tab:hover { background: var(--s-fill); }
.s-envmenu-item:focus-visible, .s-envmenu-tab:focus-visible { outline: 2px solid var(--s-focus); outline-offset: -2px; }
.s-envmenu-dot { flex: none; width: 10px; height: 10px; border-radius: var(--s-radius-round); background: var(--s-env-color); }
.s-envmenu-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.s-envmenu-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-envmenu-item-kind { color: var(--s-ink-2); font-size: var(--s-fs-caption); line-height: var(--s-lh-caption); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) {
    .s-envmenu-button { margin-left: 0; padding: 0 4px; gap: 4px; }
    .s-envmenu-name { max-width: 88px; }
    .s-envmenu[data-environment-kind]:not([data-environment-kind="production"]) .s-envmenu-name { display: none; }
    .s-envmenu-badge-long { display: none; }
    .s-envmenu-badge-short { display: inline; }
    .s-envmenu-backdrop { background: rgba(0, 0, 0, .4); animation: s-fade-in var(--s-dur-fast) linear; }
    .s-envmenu-menu { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: calc(100dvh - 48px);
                      padding: 20px 8px calc(8px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: var(--s-radius-dialog) var(--s-radius-dialog) 0 0;
                      box-shadow: var(--s-shadow-28); animation: s-acctmenu-up var(--s-dur) var(--s-ease-out); }
    .s-envmenu-menu::before { content: ""; position: absolute; top: 8px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: var(--s-radius-round); background: var(--s-line-strong); }
}
@media (pointer: coarse) {
    .s-envmenu-item { min-height: 48px; }
    .s-envmenu-tab { width: 48px; }
    .s-envmenu-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .s-envmenu-menu, .s-envmenu-backdrop { animation: none; }
}

/* ===== Invoer, Fluent 2 overal gelijk: de dropdown met een lijst van zichzelf, de focus van een veld (een onderrand van
   2px in de merkkleur bij een klik, een ring van 2px in inkt of wit alleen voor het toetsenbord), fout, uitgeschakeld en
   alleen-lezen, en de native onderdelen in donker. Later in het blad, dus het wint van wat erboven staat. ===== */

/* Kleurenschema: datum-, tijd- en kleurkiezers, schuifbalken en wat nog native is volgen licht of donker. */
.s-app[data-theme="light"] { color-scheme: light; }
.s-app[data-theme="dark"] { color-scheme: dark; }
.s-app, .s-app * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--s-ink-3) 55%, transparent) transparent; }

/* Het veld zelf (input, textarea, combobox, tags, getal, geld, adres, zoeken, tijd): de focus van de muis is de
   onderrand van 2px in de merkkleur en een iets donkerdere rand; nooit een ring rondom. */
.s-input::after, .s-select::after, .s-app .s-datefield .mud-input.mud-input-outlined::after { border-bottom-color: var(--s-brand); }
.s-input:focus-within, .s-select:focus-within { border-color: color-mix(in srgb, var(--s-line-strong) 70%, var(--s-ink)); }
.s-select:focus-within { outline: none; }
/* Het toetsenbord: een dunne ring van 2px in de focuskleur (inkt, in donker wit), met wat ruimte. */
html[data-s-input="keyboard"] .s-input:focus-within,
html[data-s-input="keyboard"] .s-otp-box:focus-within,
html[data-s-input="keyboard"] .s-app .s-datefield .mud-input.mud-input-outlined:focus-within,
.s-select:has(.s-select-button:focus-visible) { outline: 2px solid var(--s-focus); outline-offset: 2px; }
html:not([data-s-input="keyboard"]) .s-otp-box:focus-within { outline: none; }
.s-otp-box:focus-within .s-otp-cell { border-bottom-color: var(--s-brand); box-shadow: inset 0 -1px 0 var(--s-brand); }
.s-search-appbar::after { border-bottom-color: transparent; }

/* Fout: rand en onderrand in de kleur van gevaar, de onderrand altijd zichtbaar. */
.s-field.is-error .s-input, .s-select.is-error { border-color: var(--s-late); }
.s-field.is-error .s-input::after, .s-select.is-error::after { border-bottom-color: var(--s-late); transform: scaleX(1); }
.s-field.is-error .s-field-help > .s-icon { flex: none; color: var(--s-late); }
.s-app .s-datefield.is-error .mud-input.mud-input-outlined { border-color: var(--s-late); }
.s-datefield-error { display: flex; margin-top: 4px; color: var(--s-late); }
.s-datefield-error > .s-icon { flex: none; color: var(--s-late); }
.s-app .s-datefield .mud-input.mud-disabled { border-color: var(--s-line); background: transparent; color: var(--s-ink-disabled); }
.s-app .s-datefield .mud-input.mud-disabled::after { display: none; }
.s-app .s-datefield .mud-input.mud-disabled .mud-input-root, .s-app .s-datefield .mud-input.mud-disabled .mud-icon-root { color: var(--s-ink-disabled); }
.s-app .s-datefield.is-error .mud-input.mud-input-outlined::after { border-bottom-color: var(--s-late); transform: scaleX(1); }

/* Uitgeschakeld en alleen-lezen (Fluent): geen vulling, een stille rand, tekst in de kleur van uitgeschakeld. */
.s-input:not(.s-multi-box):has(.s-input-el:disabled), .s-input.is-disabled, .s-select.is-disabled, .s-select:has(.s-select-el:disabled) {
    border-color: var(--s-line); background: transparent; color: var(--s-ink-disabled); cursor: not-allowed; }
.s-input:not(.s-multi-box):has(.s-input-el:disabled)::after, .s-input.is-disabled::after, .s-select.is-disabled::after { display: none; }
/* De labels in een uitgeschakelde MultiSelect en TagInput: grijs en zonder kruisje, zoals Fluent. */
.s-input.is-disabled .s-tag { border-color: var(--s-line); background: transparent; color: var(--s-ink-disabled); }
.s-input.is-disabled .s-tag-remove { display: none; }
.s-input.is-disabled .s-combo-btn { color: var(--s-ink-disabled); cursor: not-allowed; }
.s-input:has(.s-input-el:disabled) .s-input-el::placeholder, .s-input:has(.s-input-el:disabled) > .s-icon { color: var(--s-ink-disabled); }
.s-input.is-readonly, .s-input:has(.s-input-el:read-only:not(:disabled)) { background: transparent; border-color: var(--s-line); border-bottom-color: var(--s-line-accessible); }

/* De dropdown: een knop als het veld, met een lijst van zichzelf. */
.s-select::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: max(2px, var(--s-input-radius, var(--s-radius-control)));
                   border-bottom: 2px solid var(--s-brand); border-radius: 0 0 var(--s-input-radius, var(--s-radius-control)) var(--s-input-radius, var(--s-radius-control));
                   clip-path: inset(calc(100% - 2px) 0 0 0); transform: scaleX(0); transition: transform 1ms; pointer-events: none; }
.s-select:focus-within::after, .s-select.is-open::after { transform: scaleX(1); transition: transform var(--s-dur) var(--s-ease-out); }
.s-select-button { appearance: none; width: 100%; height: 100%; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; border: 0;
                   border-radius: inherit; background: transparent; color: inherit; font: inherit; font-size: var(--s-fs-control); line-height: var(--s-lh-body); text-align: left; cursor: pointer; }
.s-app .s-select-button:focus-visible { outline: none; }
.s-select-button:disabled { cursor: not-allowed; }
.s-select-button > .s-icon { flex: none; color: var(--s-ink-3); }
.s-select-button > .s-select-chevron { margin-left: auto; color: var(--s-ink-2); transition: transform var(--s-dur-fast) var(--s-ease); }
.s-select.is-open .s-select-chevron { transform: rotate(180deg); }
.s-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-select-value.is-placeholder { color: var(--s-ink-3); }
.s-select.is-disabled .s-select-button > .s-icon, .s-select.is-disabled .s-select-value { color: var(--s-ink-disabled); }
.s-select-appbar .s-select-button > .s-icon, .s-select-appbar .s-select-chevron { color: var(--s-on-appbar-muted); }
.s-select-appbar::after { display: none; }
.s-select-appbar:has(.s-select-button:focus-visible) { outline-color: var(--s-on-appbar); outline-offset: -2px; }
.s-select-backdrop { position: fixed; inset: 0; z-index: 40; }
/* The native select for a form lies under the button: invisible, but where the browser points when it is required. */
.s-select-form { position: absolute; inset: auto 0 0 0; width: 100%; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.s-select-list { position: absolute; z-index: 41; top: calc(100% + 4px); left: -1px; width: max-content; min-width: calc(100% + 2px); max-width: min(480px, calc(100vw - 16px)); max-height: 288px;
                 margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; list-style: none; border: 1px solid var(--s-line); border-radius: var(--s-radius-control);
                 background: var(--s-surface); color: var(--s-ink); box-shadow: var(--s-shadow-16); animation: s-fade-in var(--s-dur-fast) linear; }
.s-select[data-place="above"] .s-select-list { top: auto; bottom: calc(100% + 4px); }
.s-select-group { padding: 8px 8px 4px; color: var(--s-ink-2); font-size: var(--s-fs-caption); font-weight: 600; line-height: var(--s-lh-caption); }
.s-select-option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border-radius: var(--s-radius-control); cursor: pointer; }
.s-select-option.in-group { padding-left: 16px; }
.s-select-option > .s-icon { flex: none; color: var(--s-ink-3); }
.s-select-option:hover { background: var(--s-fill); }
.s-select-option.is-active { background: var(--s-fill); outline: 2px solid var(--s-focus); outline-offset: -2px; }
html[data-s-input="pointer"] .s-select-option.is-active { outline: none; }
.s-select-option[aria-selected="true"] { font-weight: 600; }
.s-select-option[aria-disabled="true"] { color: var(--s-ink-disabled); cursor: not-allowed; }
.s-select-option[aria-disabled="true"]:hover { background: transparent; }
.s-select-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.s-select-option:has(.s-select-check) .s-select-text, .s-select-option .s-select-text { padding-right: 4px; }
.s-select-option { padding-right: 32px; position: relative; }
.s-select-option > .s-select-check { position: absolute; right: 8px; }
.s-select-option > .s-select-check { margin-left: auto; color: var(--s-brand); }
/* In een ander veld (de valuta van een bedrag): geen rand of onderrand van zichzelf. */
.s-select.is-embedded { flex: none; align-self: stretch; height: auto; margin: 0 -9px 0 4px; border: 0; border-left: 1px solid var(--s-line); border-radius: 0; background: transparent; }
.s-select.is-embedded::after { display: none; }
.s-select.is-embedded .s-select-button { padding: 0 6px 0 8px; color: var(--s-ink-2); font-size: var(--s-fs-caption); }
.s-select.is-embedded .s-select-list { left: auto; right: 0; min-width: 96px; }

/* Wat bewust native blijft (de cel-editor van het raster, de pdf-editor): rustig en in het schema van de app. */
.s-dg-editor, .s-pdf-input { color-scheme: inherit; }
.s-dg-editor option, .s-pdf-input option { background: var(--s-surface); color: var(--s-ink); }

/* Op een telefoon is de lijst een onderblad. */
@media (max-width: 700px) {
    .s-select-backdrop { background: rgba(0, 0, 0, .4); animation: s-fade-in var(--s-dur-fast) linear; }
    .s-select-list, .s-select[data-place="above"] .s-select-list { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; min-width: 0; max-width: none; max-height: calc(70dvh);
                     padding: 20px 8px calc(8px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: var(--s-radius-dialog) var(--s-radius-dialog) 0 0;
                     box-shadow: var(--s-shadow-28); animation: s-acctmenu-up var(--s-dur) var(--s-ease-out); }
    .s-select-list::before { content: ""; position: absolute; top: 8px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: var(--s-radius-round); background: var(--s-line-strong); }
    .s-select-option { min-height: 48px; }
}
@media (pointer: coarse) {
    .s-select-option { min-height: 44px; }
    /* The currency over the full height of the field, its edges included: 44px to tap. */
    .s-select.is-embedded { margin-block: -1px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .s-select-list, .s-select-backdrop, .s-select-chevron { animation: none; transition: none; }
}

/* De datumpopover in de stijl van de select: oppervlak, radius, schaduw-16, 4px ruimte, dagen van 32px; vandaag een
   gevulde cirkel in de merkkleur, de gekozen dag de zachte merktint met merkkleurige tekst (Fluent 2 Calendar). */
.s-app .mud-popover.mud-picker-popover { margin-top: 4px; padding: 4px; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); background: var(--s-surface);
                             box-shadow: var(--s-shadow-16); animation: s-fade-in var(--s-dur-fast) linear; }
.s-app .mud-picker-popover .mud-picker-container, .s-app .mud-picker-popover .mud-picker-content { background: transparent; }
.s-app .mud-picker-popover .mud-picker-calendar-container { width: auto; min-width: 0; }
/* The days wrap after seven: the width of the calendar is that of seven days with their margins. */
.s-app .mud-picker-popover .mud-picker-calendar, .s-app .mud-picker-popover .mud-picker-calendar-header-day { box-sizing: content-box; width: calc(7 * 36px); }
.s-app .mud-picker-popover .mud-picker-calendar-header-switch { padding: 0 2px 4px; }
.s-app .mud-picker-popover .mud-picker-calendar-header-switch .mud-icon-button { width: 32px; height: 32px; padding: 0; }
.s-app .mud-picker-popover .mud-button-month .mud-typography { font-size: var(--s-fs-body); }
.s-app .mud-picker-popover .mud-picker-calendar-header-day { padding: 0 2px; }
.s-app .mud-picker-popover .mud-day-label { width: 32px; margin: 0 2px; font-size: var(--s-fs-caption); font-weight: 600; text-transform: capitalize; }
.s-app .mud-picker-popover .mud-picker-calendar { padding: 0 2px 2px; }
.s-app .mud-picker-popover .mud-day { width: 32px; height: 32px; margin: 1px 2px; padding: 0; border: 1px solid transparent; border-radius: var(--s-radius-round); font-size: var(--s-fs-body); }
.s-app .mud-picker-popover .mud-day .mud-typography { font-size: inherit; line-height: 1; }
.s-app .mud-picker-popover .mud-day:hover { background: var(--s-fill); }
.s-app .mud-picker-popover .mud-day.mud-selected { border-color: var(--s-brand-line, var(--s-brand)); background: var(--s-brand-tint); color: var(--s-brand); font-weight: 600; }
.s-app .mud-picker-popover .mud-day.mud-current { border-color: transparent; background: var(--s-brand); color: var(--s-on-primary, #fff); font-weight: 600; }
.s-app .mud-picker-popover .mud-day.mud-current.mud-selected { box-shadow: 0 0 0 2px var(--s-surface), 0 0 0 3px var(--s-brand); }
.s-app .mud-picker-popover .mud-day.mud-current:hover { background: color-mix(in srgb, var(--s-brand) 88%, var(--s-ink)); }
.s-app .mud-picker-popover .mud-day:disabled, .s-app .mud-picker-popover .mud-day.mud-disabled { color: var(--s-ink-disabled); }
.s-app .mud-picker-popover .mud-ripple::after, .s-app .mud-picker-popover .mud-ripple-icon::after { display: none; }
.s-app .mud-picker-popover button:focus-visible { outline: 2px solid var(--s-focus); outline-offset: 1px; }
@media (pointer: coarse) {
    .s-app .mud-picker-popover .mud-day, .s-app .mud-picker-popover .mud-day-label { width: 44px; margin: 0; }
    .s-app .mud-picker-popover .mud-day { height: 44px; }
    .s-app .mud-picker-popover .mud-picker-calendar-header-transition { min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .s-app .mud-picker-popover .mud-picker-calendar, .s-app .mud-picker-popover .mud-picker-calendar-header-day { width: calc(7 * 44px); padding: 0; }
    .s-app .mud-picker-popover .mud-picker-calendar-header-switch .mud-icon-button { width: 44px; height: 44px; }
}
/* On a phone the calendar is a sheet from the bottom, as the select is: Mud places it with inline top and left. */
@media (max-width: 700px), (max-height: 500px) {
    .s-app .mud-popover.mud-picker-popover.mud-popover-open { top: auto !important; bottom: 0 !important; left: 0 !important; right: 0 !important; max-width: none !important; margin: 0;
        max-height: calc(100dvh - 8px); overflow-y: auto; overscroll-behavior: contain;
        padding: 12px 8px calc(8px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: var(--s-radius-dialog) var(--s-radius-dialog) 0 0; box-shadow: var(--s-shadow-28);
        display: flex; justify-content: center; }
}

/* ----- Design mode of a page (golf 6b): a bar on top, the fields outlined, a panel with every field at the end. ----- */
.s-design-bar { position: sticky; top: var(--s-appbar-h); z-index: 13; display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 8px 12px;
    border: 1px solid var(--s-brand-line); border-radius: var(--s-radius-control); background: var(--s-brand-tint); color: var(--s-ink); }
.s-design-bar-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.s-design-bar-text > span { color: var(--s-ink-2); font-size: 12px; }
.s-design-bar-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.s-design-for { min-width: 180px; }
.s-design-ask { margin: -4px 0 12px; }
.s-design-dock { position: fixed; top: var(--s-appbar-h); right: 0; bottom: 0; z-index: 14; display: flex; }
.s-design-dock > .s-sidepanel { height: 100%; }
/* The whole work area stands next to the panel, also what the host puts under the page. */
.s-main:has(.is-designing) { padding-right: calc(320px + var(--s-page-pad-x)); }
.is-designing .s-fieldrow, .is-designing th[data-column] { outline: 1px dashed var(--s-line-strong); outline-offset: 2px; }
.s-design-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; }
.s-design-item { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 4px; border-bottom: 1px solid var(--s-line); }
.s-design-item.is-hidden .s-design-name { color: var(--s-ink-2); }
.s-design-name { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-design-tools { display: inline-flex; gap: 2px; flex: none; }
.s-design-head { margin: 8px 0 4px; font-size: 12px; font-weight: 600; color: var(--s-ink-2); text-transform: none; }
.s-design-empty { margin: 0; color: var(--s-ink-3); font-size: 12px; }
@media (max-width: 700px) {
    /* On a phone the panel stands in the page under the bar, the fields of the page under it: one column, nothing over the other. */
    .s-main:has(.is-designing) { padding-right: max(var(--s-page-pad-x), env(safe-area-inset-right, 0px)); }
    .s-design-bar { flex-wrap: wrap; }
    .s-design-bar-text > span { display: none; }
    .s-design-dock { position: static; margin: 0 0 12px; }
    .s-design-dock > .s-sidepanel { position: static; width: 100% !important; height: auto; box-shadow: none; border: 1px solid var(--s-line); border-radius: var(--s-radius-control); }
}
@media (pointer: coarse) {
    .s-design-item { min-height: 44px; }
}
