/*
 * OneStop shared components ("Refined Lode" 1.0, Source\Docs\Design system\Design system.md section 4). Linked by
 * Components\App.razor right after tokens.css (MudBlazor.min.css -> app.css -> tokens.css -> os.css -> the app files).
 * Every class starts with os- (no collision with the 48 legacy files) and uses tokens only (DesignGuardTests.Os_css_uses_the_tokens).
 * Reference copy: Source\Docs\Design system\os.css (the style guide). Differences of this one, for the real app:
 * - links: the legacy `a { color: inherit }` of app.css stays until wave 5 (app tiles, cards and table rows are links);
 *   the olive link colour is for running text (.os-prose) and new code (a.os-link).
 */

/* ---------- Base (wave 0 replaces app.css html/body rules) ---------- */
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--os-shell-h) + 8px); }
body { margin: 0; background: var(--os-canvas); color: var(--os-text); font: var(--os-type-body); letter-spacing: var(--os-track-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
*, *::before, *::after { box-sizing: border-box; }
:lang(fr) .os-prose { hyphens: auto; }
::selection { background: var(--os-accent-soft); color: var(--os-text); }
:focus-visible { outline: 2px solid var(--os-focus); outline-offset: 2px; }
a.os-link, .os-prose a { color: var(--os-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.os-num, .os-table td.num, .os-kpi__value { font-variant-numeric: tabular-nums; }
.os-mono { font: var(--os-type-mono); font-variant-numeric: tabular-nums slashed-zero; }
.os-prose { max-width: var(--os-prose); }
.os-muted { color: var(--os-text-3); }
.os-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
i[data-i] { display: inline-flex; width: var(--os-icon); height: var(--os-icon); flex: none; }
i[data-i] svg { width: 100%; height: 100%; fill: currentColor; }

/* ---------- Typography helpers (MudText maps onto the same tokens) ---------- */
.os-display { font: var(--os-type-display); letter-spacing: var(--os-track-display); margin: 0; }
.os-h1 { font: var(--os-type-h1); letter-spacing: var(--os-track-h1); margin: 0; }
.os-h2 { font: var(--os-type-h2); letter-spacing: var(--os-track-h2); margin: 0; }
.os-h3 { font: var(--os-type-h3); letter-spacing: var(--os-track-h3); margin: 0; }
.os-h4 { font: var(--os-type-h4); margin: 0; }
.os-small { font: var(--os-type-small); }
.os-caption { font: var(--os-type-caption); color: var(--os-text-3); }
.os-label { font: var(--os-type-label); color: var(--os-text-2); }
.os-eyebrow { font: var(--os-type-eyebrow); letter-spacing: var(--os-track-eyebrow); text-transform: uppercase; color: var(--os-text-3); }

/* ---------- Shell (wave 0.7: Layout\MainLayout.razor, Shared\AppHeader.razor, Shared\Os\OsCommandBar.razor, OsUserMenu.razor) ----------
   The vein (2 px), the top bar (56; 52 on a phone) and the app bar (48; 44), sticky together above the page (main.content
   scrolls). .is-scrolled: the page scrolled (a shadow); .is-condensed: a long page scrolling down, the top bar slides up and
   the app bar stays (os.js shell). Inside a frame and on the wall: no shell. */
.os-shell { position: sticky; top: 0; z-index: var(--os-z-appbar); flex: 0 0 auto; background: var(--os-surface); }
html.framed .os-shell, html.wall-mode .os-shell { display: none; }
.os-vein { height: var(--os-vein-h); background: linear-gradient(90deg, var(--os-logo-gold) 0, var(--os-vein) 28%, var(--os-accent-brand) 62%, transparent 100%); }
.os-topbar { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  height: var(--os-topbar-h); padding: 0 var(--os-page-x); background: var(--os-surface); border-bottom: 1px solid var(--os-border-subtle);
  transition: box-shadow var(--os-dur-3) var(--os-ease-standard), margin-top var(--os-dur-3) var(--os-ease-standard); }
.os-shell.is-scrolled { box-shadow: var(--os-shadow-2); }
.os-shell.is-condensed .os-topbar { margin-top: calc(-1 * var(--os-topbar-h)); visibility: hidden; transition: margin-top var(--os-dur-3) var(--os-ease-standard), visibility 0s var(--os-dur-3); }
/* What the top bar opens over the page stays visible even if it slid up (os.js un-condenses first; this is the safety net) */
.os-shell.is-condensed :is(.os-cmdk, .os-cmdk-back, .os-usermenu__back, .os-usermenu__panel) { visibility: visible; }
.os-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--os-logo-ink); text-decoration: none; border-radius: var(--os-radius-md); }
.os-brand svg { flex: none; width: 28px; height: 28px; transition: transform var(--os-dur-2) var(--os-ease-out); }
.os-brand:hover svg { transform: scale(1.06); }
.os-brand b { font: 600 1.0625rem/1 var(--os-font-display); letter-spacing: -0.02em; white-space: nowrap; }
.os-topbar__ctx { display: flex; align-items: center; gap: 8px; min-width: 0; }
.os-topbar__ctx > .mud-menu { min-width: 0; }
.os-topbar__ctx .mud-menu-activator { min-width: 0; max-width: 100%; }
.os-ctx { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; height: 32px; padding: 0 6px 0 8px; border-radius: var(--os-radius-md);
  color: var(--os-text-2); font: var(--os-type-button); background: transparent; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.os-ctx:hover { background: var(--os-surface-hover); color: var(--os-text); }
.os-ctx i[data-i] { width: 18px; height: 18px; flex: none; color: var(--os-accent); }
.os-ctx .os-ctx__caret { color: var(--os-text-3); }
.os-ctx .os-ctx__lock { width: 16px; height: 16px; color: var(--os-text-3); }
.os-ctx b { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--os-text); font-weight: 500; }
/* The sections as icons (V1.66, owner 2026-11-09): one link per section, the current one on the soft accent with the gold
   notch under it; the short name only on a wide screen (>= 1440 px). The row never pushes the page wider (it scrolls inside
   itself in the last resort) */
.os-secnav { display: flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.os-secnav::-webkit-scrollbar { display: none; }
.os-secnav__item { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: var(--os-radius-md); color: var(--os-text-2); font: var(--os-type-button); text-decoration: none; white-space: nowrap;
  transition: background var(--os-dur-1), color var(--os-dur-1); }
.os-secnav__item i[data-i] { width: 20px; height: 20px; flex: none; }
.os-secnav__item:hover { background: var(--os-surface-hover); color: var(--os-text); }
.os-secnav__item:focus-visible { outline: 2px solid var(--os-focus); outline-offset: -2px; }
.os-secnav__item.is-current { background: var(--os-accent-soft); color: var(--os-accent-text); }
.os-secnav__item.is-current::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 3px; border-radius: 2px; background: var(--os-vein); }
.os-secnav__label { display: none; }
/* The place menu after the icons: a 1 px line between them (the mine is not one more section) */
.os-topbar__ctx > .os-secnav + .os-ctx-menu { padding-left: 6px; border-left: 1px solid var(--os-border); }
@media (min-width: 1440px) { .os-secnav__label { display: inline; } }
/* The context menu and the client's company picker open above the app bar (their popover is portaled to the body) */
.mud-popover:has(> .os-ctx-list), .mud-popover:has(.os-ctx-list) { z-index: calc(var(--os-z-appbar) + 2) !important; }
.os-ctx-list { min-width: 280px; padding: 4px 0; }
.os-ctx-loading { display: grid; gap: 8px; padding: 10px 16px; }
.picker-head { padding: 10px 16px 4px; font: var(--os-type-eyebrow); letter-spacing: var(--os-track-eyebrow); text-transform: uppercase; color: var(--os-text-3); }
.mine-item .mud-menu-item-text { display: flex; flex-direction: column; line-height: 1.25; }
.mine-item-name { color: var(--os-text); font-weight: 500; }
.mine-item-sub { color: var(--os-text-3); font: var(--os-type-caption); }
.mine-item.current .mine-item-name { color: var(--os-accent-text); font-weight: 600; }
.mine-item.os-notch::before { left: 4px; }
.section-item .mud-menu-item-icon { color: var(--os-accent); }
/* The company picker of a client of several companies (Shared\ClientCompanyPicker.razor): the context's look */
.mine-picker { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 32px; padding: 0 8px; border-radius: var(--os-radius-md);
  border: 1px solid var(--os-border); background: transparent; color: var(--os-text); font: var(--os-type-button); cursor: pointer; white-space: nowrap; }
.mine-picker:hover { background: var(--os-surface-hover); }
.mine-picker .mud-icon-root { flex: none; color: var(--os-accent); }
.mine-name { overflow: hidden; text-overflow: ellipsis; }

/* The command bar (OsCommandBar): the button in the middle, the dialog over the page */
.os-cmd { justify-self: center; display: flex; align-items: center; gap: 8px; width: min(100%, 560px); height: 34px; padding: 0 8px 0 12px; cursor: pointer;
  border-radius: var(--os-radius-md); background: var(--os-surface-sunken); border: 1px solid var(--os-border-subtle); color: var(--os-text-3); font: var(--os-type-small); text-align: left; }
.os-cmd:hover { border-color: var(--os-border); color: var(--os-text-2); }
.os-cmd i[data-i] { width: 18px; height: 18px; flex: none; }
.os-cmd > span:not(.os-kbd) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-kbd { font: 500 0.6875rem/1 var(--os-font-ui); padding: 3px 6px; border-radius: var(--os-radius-xs); background: var(--os-surface); border: 1px solid var(--os-border); color: var(--os-text-3); white-space: nowrap; }
.os-cmdk-back { position: fixed; inset: 0; z-index: 1; background: color-mix(in srgb, var(--os-canvas) 55%, transparent); }
.os-cmdk { position: fixed; z-index: 2; top: calc(var(--os-vein-h) + 12px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column;
  width: min(640px, calc(100vw - 2 * var(--os-page-x))); max-height: min(560px, calc(100dvh - 48px)); overflow: hidden;
  border-radius: var(--os-radius-lg); border: 1px solid var(--os-border); background: var(--os-surface-raised); box-shadow: var(--os-shadow-3); }
.os-cmdk__field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-bottom: 1px solid var(--os-border-subtle); color: var(--os-text-3); }
.os-cmdk__field i[data-i] { width: 20px; height: 20px; flex: none; }
.os-cmdk__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--os-text); font: var(--os-type-body); font-size: 1rem; }
.os-cmdk__input::placeholder { color: var(--os-text-3); }
.os-cmdk__field:focus-within { box-shadow: inset 0 -2px 0 var(--os-focus); }
.os-cmdk__list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.os-cmdk__group { padding: 10px 10px 4px; font: var(--os-type-eyebrow); letter-spacing: var(--os-track-eyebrow); text-transform: uppercase; color: var(--os-text-3); }
.os-cmdk__item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; border-radius: var(--os-radius-md); color: var(--os-text); font: var(--os-type-button); cursor: pointer; }
.os-cmdk__item.is-active { background: var(--os-accent-soft); color: var(--os-accent-text); box-shadow: inset 3px 0 0 var(--os-vein); }
.os-cmdk__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-cmdk__hint { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--os-text-3); font: var(--os-type-caption); }
.os-cmdk__empty { padding: 20px 10px; color: var(--os-text-3); font: var(--os-type-small); }
.os-cmdk__foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 14px; border-top: 1px solid var(--os-border-subtle); color: var(--os-text-3); font: var(--os-type-caption); }
.os-cmdk__foot .os-kbd + .os-kbd { margin-left: 2px; }

/* The tools on the right: Send a ticket, the test server, the version, theme, EN | FR, the bell, the user menu */
.os-tools { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.os-tools .os-btn--icon { --h: 34px; }
.os-tools .os-version { color: var(--os-text-3); font-variant-numeric: tabular-nums; }
.os-tools .test-server-chip { color: var(--os-warn-text); border-color: var(--os-warn); text-decoration: none; }
.send-ticket-chip i[data-i] { color: var(--os-accent); }
.os-lang { display: inline-flex; padding: 2px; border-radius: var(--os-radius-md); border: 1px solid var(--os-border); margin: 0 4px; }
.os-lang button { border: 0; background: transparent; color: var(--os-text-3); font: 500 0.75rem/1 var(--os-font-ui); padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.os-lang button:hover { color: var(--os-text); }
.os-lang button.on { background: var(--os-surface-sunken); color: var(--os-text); }
.os-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--os-accent-soft);
  color: var(--os-accent-text); font: 600 0.75rem/1 var(--os-font-ui); flex: none; }
.os-avatar--sm { width: 22px; height: 22px; font-size: 0.625rem; }
.os-avatar--lg { width: 40px; height: 40px; font-size: 0.875rem; }

/* The user menu (OsUserMenu): the avatar, then a panel under it */
.os-usermenu { position: relative; display: flex; min-width: 0; }
.os-usermenu__button { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 220px; height: 40px; padding: 0 10px 0 4px; border: 1px solid transparent;
  border-radius: var(--os-radius-pill); background: transparent; color: var(--os-text); font: var(--os-type-button); cursor: pointer; }
.os-usermenu__button:hover, .os-usermenu__button[aria-expanded="true"] { background: var(--os-surface-hover); border-color: var(--os-border-subtle); }
.os-usermenu__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-usermenu__back { position: fixed; inset: 0; z-index: 1; }
.os-usermenu__panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 2; display: flex; flex-direction: column; width: min(340px, calc(100vw - 2 * var(--os-page-x)));
  max-height: calc(100dvh - var(--os-topbar-h) - 24px); overflow-y: auto; border-radius: var(--os-radius-lg); border: 1px solid var(--os-border);
  background: var(--os-surface-raised); box-shadow: var(--os-shadow-3); color: var(--os-text); }
.os-usermenu__panel:focus { outline: none; }
.os-usermenu__panel:focus-visible { outline: 2px solid var(--os-focus); outline-offset: 2px; }
.os-usermenu__who { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--os-border-subtle); }
.os-usermenu__who > div { min-width: 0; }
.os-usermenu__who .os-caption { overflow-wrap: anywhere; }
.os-usermenu__title { font: var(--os-type-h4); }
.os-usermenu__code { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.os-usermenu__code i[data-i] { width: 14px; height: 14px; }
.os-usermenu__group { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--os-border-subtle); }
.os-usermenu__group:empty { display: none; }
.os-usermenu__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.os-usermenu__row--stacked { flex-direction: column; align-items: stretch; gap: 6px; }
.os-usermenu__link { display: flex; align-items: center; gap: 10px; min-height: 32px; margin: 0 -8px; padding: 0 8px; border-radius: var(--os-radius-md); color: var(--os-text); font: var(--os-type-button); text-decoration: none; }
.os-usermenu__link:hover { background: var(--os-surface-hover); }
.os-usermenu__link i[data-i] { width: 18px; height: 18px; color: var(--os-text-2); }
.os-usermenu__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 8px; }
.os-usermenu__group.an-menu-item, .os-usermenu__link.an-menu-item { display: none; }

/* A radio group (OsChoiceGroup): side by side, or one per line with a hint (the density) */
.os-choice { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--os-radius-md); background: var(--os-surface-sunken); border: 1px solid var(--os-border-subtle); }
.os-choice button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--os-text-2); font: var(--os-type-button); font-size: 0.8125rem; cursor: pointer; white-space: nowrap; text-align: left; }
.os-choice button i[data-i] { width: 16px; height: 16px; flex: none; }
.os-choice button:hover { color: var(--os-text); }
.os-choice button[aria-checked="true"] { background: var(--os-surface); color: var(--os-text); box-shadow: var(--os-shadow-1); }
:root[data-theme="dark"] .os-choice button[aria-checked="true"] { background: var(--os-surface-raised); }
.os-choice--stacked { display: grid; grid-template-columns: 1fr 1fr; }
.os-choice--stacked button { min-height: 44px; padding: 6px 10px; white-space: normal; }
.os-choice__text { display: flex; flex-direction: column; gap: 1px; }
.os-choice__text small { color: var(--os-text-3); font: var(--os-type-caption); }

/* The app bar (AppHeader): crumb, tabs (they scroll sideways with a fade, never wrap), then Tour, Ask, Activity, a logo */
.os-appbar { display: flex; align-items: stretch; gap: 20px; height: var(--os-appbar-h); padding: 0 var(--os-page-x);
  background: var(--os-surface); border-bottom: 1px solid var(--os-border-subtle); }
.os-appbar:not(:has(.os-appname, .os-appbar__end > *)) { display: none; }
.os-appbar { position: relative; }
.os-appbar > * { flex: none; }
.os-appname { display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 0.9375rem/1 var(--os-font-ui); color: var(--os-text); white-space: nowrap; }
.os-appname .crumb { color: var(--os-text-3); font: var(--os-type-small); font-weight: 500; text-decoration: none; }
.os-appname .crumb:hover { color: var(--os-accent-text); }
.os-appname .crumb-sep { color: var(--os-text-3); }
.os-appname__app { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--os-radius-md); }
.os-appname__text { overflow: hidden; text-overflow: ellipsis; }
.os-appname__stage { display: inline-flex; flex: none; }   /* V1.69: the app's stage beside its name (AppStageBadge) */
.os-icontile { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--os-radius-md); background: var(--os-accent-soft); color: var(--os-accent-text); }
.os-icontile i[data-i], .os-icontile .mud-icon-root { width: 18px; height: 18px; }
.os-icontile--lg { width: 40px; height: 40px; }
.os-icontile--lg i[data-i] { width: 22px; height: 22px; }
.os-apptabs { position: relative; display: flex; flex: 0 1 auto; align-items: stretch; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.os-apptabs::-webkit-scrollbar { display: none; }
.os-apptabs:has(> :nth-child(5)) { mask-image: linear-gradient(90deg, black calc(100% - 32px), transparent); }
.os-apptabs .apptab-menu { display: flex; align-self: stretch; }
.os-apptabs .apptab-menu > .mud-menu-activator { display: flex; align-self: stretch; }
.os-appbar .apptab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; background: none; color: var(--os-text-2);
  font: var(--os-type-button); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color var(--os-dur-1); }
.os-appbar .apptab::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; transition: background var(--os-dur-2) var(--os-ease-standard); }
.os-appbar .apptab:hover { color: var(--os-text); }
.os-appbar .apptab:hover::after { background: var(--os-border-strong); }
.os-appbar .apptab.active { color: var(--os-text); }
.os-appbar .apptab.active::after { background: var(--os-accent); }
.os-appbar .apptab:focus-visible { outline-offset: -2px; }
.os-appbar .apptab .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--os-radius-pill);
  background: var(--os-surface-sunken); color: var(--os-text-2); font: 600 0.6875rem/1 var(--os-font-ui); font-variant-numeric: tabular-nums; }
.os-appbar .apptab .caret { margin-left: 2px; font-size: 0.7rem; color: var(--os-text-3); }
.os-appbar .apptab.alert { color: var(--os-bad-text); }
.os-appbar .apptab.alert .count { background: var(--os-bad); color: var(--os-on-bad); }
/* The right of the app bar (.os-appbar__end, MainLayout's outlets app-tour, app-ask, app-activity): Tour (ghost), "Ask about this
   page" (.os-ask look: the AI's spark), Activity, 8 px apart; their own margin-left: auto (aihelp.css, audit.css, tours.css) is
   undone. On a phone they fold into the More menu (below). */
.os-appbar__end > * { align-self: center; margin-left: 0 !important; }
.os-appbar .os-appbar__more { display: none; align-self: center; }
.os-appbar__back { position: fixed; inset: 0; z-index: 2; }
.os-appbar .tour-start { border-color: transparent; background: transparent; color: var(--os-text-2); }
.os-appbar .tour-start:hover { background: var(--os-surface-hover); color: var(--os-text); }
.os-appbar :is(.ask-page-button, .au-button) { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--os-radius-md);
  border: 1px solid var(--os-border); background: var(--os-surface); color: var(--os-text); font: var(--os-type-button); cursor: pointer; white-space: nowrap; }
.os-appbar :is(.ask-page-button, .au-button):hover, .os-appbar :is(.ask-page-button, .au-button).on { border-color: var(--os-border-strong); background: var(--os-surface); }
.os-appbar .ask-page-button .mud-icon-root { color: var(--os-ai); }
.os-appbar .au-button .mud-icon-root { color: var(--os-text-2); }
.os-appbar .appbar-logo { align-self: center; max-width: 220px; height: 32px; object-fit: contain; }
.os-appbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.os-appbar__end:empty { display: none; }
.os-appbar .os-tabs { height: 100%; }
/* The app's sections on a phone (AppHeader, 2026-11-08): below 600 px an app with more than 3 tabs (AppSectionRules.MaxInlineTabs)
   shows ONE section button next to its name ("Access" and a caret, .os-appsections.is-sheet); it opens the same tabs as a bottom sheet
   (.os-appsheet.is-open: title "Sections", every section on its own 48 px line, the current one with the gold notch). Tablets,
   computers and the apps with up to 3 tabs: the sheet's frame is display: contents, the underline tabs as above. */
.os-appsections, .os-appsheet__head, .os-appsheet__back { display: none; }
.os-appsheet { display: contents; }
@keyframes os-sheet-in { from { transform: translateY(32px); opacity: 0; } }
@media (max-width: 599.98px) {
  .os-appbar .os-appsections.is-sheet { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 4px; align-self: center; min-width: 0; height: 32px;
    padding: 0 6px 0 10px; border: 1px solid var(--os-border); border-radius: var(--os-radius-pill); background: var(--os-surface); color: var(--os-text);
    font: var(--os-type-button); white-space: nowrap; cursor: pointer; transition: border-color var(--os-dur-1), background var(--os-dur-1); }
  .os-appbar .os-appsections.is-sheet:hover, .os-appbar .os-appsections.is-sheet[aria-expanded="true"] { border-color: var(--os-border-strong); background: var(--os-surface-hover); }
  .os-appsections__icon:empty { display: none; }
  .os-appsections__icon { display: inline-flex; color: var(--os-text-2); }
  .os-appsections__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .os-appsections__caret { flex: none; color: var(--os-text-3); transition: transform var(--os-dur-2) var(--os-ease-standard); }
  .os-appsections[aria-expanded="true"] .os-appsections__caret { transform: rotate(180deg); }
  .os-appbar:has(.os-appsections.is-sheet) .os-appname__text { max-width: 28vw; }
  .os-appbar .os-appsheet.is-sheet { display: none; }
  .os-appbar .os-appsheet__back { display: block; position: fixed; inset: 0; z-index: 3; background: var(--os-scrim); animation: os-fade-in var(--os-dur-3) var(--os-ease-out); }
  .os-appbar .os-appsheet.is-sheet.is-open { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; max-height: min(80dvh, 640px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); border: 1px solid var(--os-border); border-bottom: 0;
    border-radius: var(--os-radius-xl) var(--os-radius-xl) 0 0; background: var(--os-surface-raised); box-shadow: var(--os-shadow-3);
    animation: os-sheet-in var(--os-dur-4) var(--os-ease-out); }
  .os-appsheet.is-open .os-appsheet__head { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 12px 10px 20px;
    border-bottom: 1px solid var(--os-border-subtle); }
  .os-appsheet__grip { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; border-radius: var(--os-radius-pill); background: var(--os-border-strong); transform: translateX(-50%); }
  .os-appsheet__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--os-text); font: var(--os-type-h3); }
  .os-appsheet__title small { overflow: hidden; color: var(--os-text-3); font: var(--os-type-caption); text-overflow: ellipsis; white-space: nowrap; }
  .os-appsheet__close { margin-left: auto; }
  .os-appbar .os-appsheet.is-open .os-apptabs { flex: 1 1 auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px; min-height: 0;
    padding: 8px; overflow: hidden auto; mask-image: none; overscroll-behavior: contain; }
  .os-appbar .os-appsheet.is-open .os-apptabs > * { flex: none; }
  .os-appbar .os-appsheet.is-open .apptab { justify-content: flex-start; width: 100%; min-height: 48px; padding: 0 16px 0 20px; border-radius: var(--os-radius-md);
    color: var(--os-text-2); font: var(--os-type-body); white-space: normal; text-align: left; }
  .os-appbar .os-appsheet.is-open .apptab::after { display: none; }
  .os-appbar .os-appsheet.is-open .apptab:hover { background: var(--os-surface-hover); color: var(--os-text); }
  .os-appbar .os-appsheet.is-open .apptab.active { background: var(--os-accent-soft); color: var(--os-text); font-weight: 600; }
  .os-appbar .os-appsheet.is-open .apptab.active::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--os-vein); }
  .os-appbar .os-appsheet.is-open .apptab-menu, .os-appbar .os-appsheet.is-open .apptab-menu > .mud-menu-activator { display: block; width: 100%; }
  .os-appbar .os-appsheet.is-open .mg-appsearch { align-self: stretch; margin: 8px 0 0; padding: 0 4px; }
  .os-appbar .os-appsheet.is-open .mg-appsearch input { width: 100%; }
  /* The page behind stays still while the sheet is open (its scroll area and the body; nothing to restore: CSS only) */
  html:has(.os-appsheet.is-open), body:has(.os-appsheet.is-open), html:has(.os-appsheet.is-open) main.content { overflow: hidden; overscroll-behavior: none; }
  /* A menu of a section (Monitoring's Clients menu): its list above the sheet */
  body:has(.os-appsheet.is-open) .mud-popover-open { z-index: calc(var(--os-z-appbar) + 2) !important; }
}
.os-ask { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--os-radius-md);
  border: 1px solid var(--os-border); background: var(--os-surface); color: var(--os-text); font: var(--os-type-button); cursor: pointer; white-space: nowrap; }
.os-ask:hover { border-color: var(--os-border-strong); }
.os-notch { position: relative; }
.os-notch::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--os-vein); }

/* Wall density (Design system.md 2.11, the user menu's Wall): dark forced (MainLayout), a 48 px strip with the clock and the
   freshness instead of the command bar, the language and the theme; a 2 px line that runs once per rotation when a page
   rotates its panels (html[data-wall-rotate]: its seconds in --os-wall-rotate) */
:root[data-density="wall"] { --os-topbar-h: 48px; }
.os-wallclock { display: none; }
[data-density="wall"] .os-wallclock { display: inline-flex; align-items: baseline; gap: 10px; justify-self: end; font-variant-numeric: tabular-nums; }
[data-density="wall"] .os-wallclock b { font: 600 1.25rem/1 var(--os-font-display); color: var(--os-text); }
[data-density="wall"] .os-topbar { grid-template-columns: auto auto minmax(0, 1fr) auto; }
[data-density="wall"] :is(.os-cmd, .os-lang, .os-theme, .os-version, .send-ticket-text) { display: none; }
.os-wallline { display: none; }
html[data-wall-rotate][data-density="wall"] .os-wallline { display: block; height: 2px; background: var(--os-accent); transform-origin: 0 50%;
  animation: os-wall-rotate calc(var(--os-wall-rotate, 30) * 1s) linear infinite; }
@keyframes os-wall-rotate { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { html[data-wall-rotate] .os-wallline { animation: none; } }

/* The shell by width: a laptop tightens, a tablet keeps the command bar's icon, a phone keeps one line at 360 px */
@media (max-width: 1279.98px) {
  .os-topbar { gap: 12px; }
  .os-usermenu__name, .os-tools .os-version { display: none; }
  .os-usermenu__button { padding: 0 4px; }
}
@media (max-width: 959.98px) {
  .os-cmd { width: 34px; padding: 0; justify-content: center; justify-self: end; background: transparent; border-color: transparent; }
  .os-cmd span, .os-cmd .os-kbd { display: none; }
  .send-ticket-text { display: none; }
  .os-ctx__place { max-width: 140px; }
}
@media (max-width: 599.98px) {
  .os-topbar { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px; }
  .os-topbar:not(.no-switch) .os-brand b { display: none; }
  .os-ctx { gap: 2px; padding: 0 2px 0 4px; }
  .os-ctx__place, .os-ctx .os-ctx__lock { display: none; }
  .os-secnav { gap: 0; }
  .os-secnav__item { min-width: 30px; height: 32px; padding: 0 5px; }
  .os-topbar__ctx > .os-secnav + .os-ctx-menu { padding-left: 2px; }
  .os-secnav__item i[data-i] { width: 18px; height: 18px; }
  .os-secnav__item.is-current::after { left: 6px; right: 6px; }
  .os-topbar__ctx { gap: 2px; }
  .os-tools { gap: 0; }
  .os-tools .os-lang, .os-tools .os-theme, .os-tools .os-version, .os-tools .test-server-chip span { display: none; }
  /* No user menu (the public pages: sign-in, rating, ticket, legal): the language and the theme stay in the bar */
  .os-tools:not(:has(.os-usermenu)) .os-lang { display: inline-flex; }
  .os-tools:not(:has(.os-usermenu)) .os-theme { display: inline-flex; }
  .os-usermenu__link.an-menu-item { display: flex; }
  .mine-picker .mine-name { display: none; }
  .os-appbar { gap: 12px; }
  .os-appname .crumb, .os-appname .crumb-sep { display: none; }
  .os-appname__text { max-width: 40vw; }
  /* The More menu: the right group folds under a ... button, then opens as a small menu under it */
  .os-appbar:has(.os-appbar__end > *) .os-appbar__more { display: inline-flex; margin-left: auto; --h: 36px; }
  .os-appbar__end { display: none; position: absolute; top: calc(100% + 4px); right: var(--os-page-x); z-index: 3; flex-direction: column; align-items: stretch;
    gap: 4px; min-width: 220px; padding: 6px; border-radius: var(--os-radius-lg); border: 1px solid var(--os-border); background: var(--os-surface-raised); box-shadow: var(--os-shadow-3); }
  .os-appbar.is-more-open .os-appbar__end { display: flex; }
  .os-appbar .os-appbar__end > * { justify-content: flex-start; width: 100%; height: 36px; }
  .os-appbar__end :is(.tour-start span, .ask-page-label, .au-button-label) { display: inline !important; }
  .os-apptabs { mask-image: linear-gradient(90deg, black calc(100% - 32px), transparent); }
  .os-cmdk { top: 8px; width: calc(100vw - 16px); }
  .os-cmdk__foot { display: none; }
}
@media (max-width: 380px) {
  .os-brand b { display: none; }
}

/* ---------- Page and grid (full width, never a max-width) ---------- */
.os-page { display: grid; gap: var(--os-gutter); padding: 24px var(--os-page-x) 40px; min-width: 0; align-content: start; }
.os-grid { display: grid; gap: var(--os-gutter); grid-template-columns: repeat(var(--os-cols), minmax(0, 1fr)); min-width: 0; }
.os-grid > * { grid-column: span min(var(--span, var(--os-cols)), var(--os-cols)); min-width: 0; }
@media (max-width: 959.98px) { .os-grid > * { grid-column: 1 / -1; } }
@media (min-width: 600px) and (max-width: 959.98px) { .os-grid > .os-half-sm { grid-column: span 4; } }
/* xxl and wall: 16 columns; a 12-column span scales by 4/3 unless the template sets --span-xxl */
@media (min-width: 2560px) { .os-grid > * { grid-column: span var(--span-xxl, round(calc(var(--span, 12) * 4 / 3), 1)); } }
.os-cards { display: grid; gap: var(--os-gutter); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--os-card-min, 280px)), 1fr)); }
.os-stack { display: grid; gap: var(--os-gutter); align-content: start; min-width: 0; }
.os-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.os-spacer { flex: 1; }

/* ---------- Page header: standard / hero / compact ---------- */
.os-pagehead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 24px; padding: 4px 0 4px; }
.os-pagehead__title { display: grid; gap: 4px; min-width: 0; }
.os-pagehead__crumbs { display: flex; align-items: center; gap: 4px; font: var(--os-type-caption); color: var(--os-text-3); }
.os-pagehead__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: var(--os-type-caption); color: var(--os-text-3); margin-top: 2px; }
.os-pagehead__meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--os-border-strong); }
.os-pagehead__desc { color: var(--os-text-2); max-width: var(--os-prose); margin: 4px 0 0; }
.os-pagehead__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.os-live { display: inline-flex; align-items: center; gap: 6px; color: var(--os-good-text); font-weight: 500; }
.os-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--os-good); box-shadow: 0 0 0 3px var(--os-good-soft); animation: os-pulse 2s ease-in-out infinite; }
.os-stale { display: inline-flex; align-items: center; gap: 4px; color: var(--os-warn-text); font-weight: 500; }
.os-stale i[data-i] { width: 14px; height: 14px; }
@keyframes os-pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
.os-pagehead--hero { position: relative; overflow: hidden; padding: 24px 28px; border-radius: var(--os-radius-xl); background: var(--os-surface);
  border: 1px solid var(--os-panel-line); box-shadow: var(--os-shadow-1); }
.os-pagehead--hero > * { position: relative; }
.os-pagehead--hero::before { content: ""; position: absolute; inset: 0 0 0 38%; background: var(--os-accent-brand); opacity: .55;
  -webkit-mask: var(--os-contours) right center / cover no-repeat, linear-gradient(90deg, transparent 0, #000 45%);
  -webkit-mask-composite: source-in; mask: var(--os-contours) right center / cover no-repeat, linear-gradient(90deg, transparent 0, #000 45%); mask-composite: intersect; }
:root[data-theme="dark"] .os-pagehead--hero::before { opacity: .75; }
.os-pagehead--hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 420px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--os-logo-gold) 14%, transparent), transparent); pointer-events: none; }
.os-pagehead--compact { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 48px; padding: 0 16px; border-radius: var(--os-radius-lg);
  background: var(--os-surface); border: 1px solid var(--os-panel-line); }
.os-pagehead--compact .os-h1 { font: var(--os-type-h2); }

/* ---------- Panel / card ---------- */
.os-panel { position: relative; container-type: inline-size; min-width: 0; background: var(--os-surface); border: 1px solid var(--os-panel-line);
  border-radius: var(--os-radius-lg); box-shadow: var(--os-shadow-1); padding: var(--os-panel-pad); }
.os-panel--flush { padding: 0; overflow: hidden; }
.os-panel__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-bottom: 14px; min-width: 0; }
.os-panel--flush > .os-panel__head { padding: 16px var(--os-panel-pad) 0; margin-bottom: 12px; }
.os-panel__head .t { display: grid; gap: 2px; min-width: 0; flex: 1 1 160px; }
.os-panel__title { font: var(--os-type-h3); letter-spacing: var(--os-track-h3); margin: 0; }
.os-panel__sub { font: var(--os-type-caption); color: var(--os-text-3); }
.os-panel__actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; flex: none; max-width: 100%; }
.os-panel__foot { margin: 16px calc(-1 * var(--os-panel-pad)) calc(-1 * var(--os-panel-pad)); padding: 10px var(--os-panel-pad); border-top: 1px solid var(--os-border-subtle);
  font: var(--os-type-caption); color: var(--os-text-3); display: flex; align-items: center; gap: 8px; }
.os-panel--sunken { background: var(--os-surface-sunken); box-shadow: none; border-color: transparent; }
.os-panel--interactive { cursor: pointer; transition: box-shadow var(--os-dur-2) var(--os-ease-standard), transform var(--os-dur-2) var(--os-ease-standard), border-color var(--os-dur-2); }
.os-panel--interactive:hover { box-shadow: var(--os-shadow-2); transform: translateY(-1px); border-color: var(--os-border); }
[data-chart-order="ops"] .os-panel--interactive:hover, .wall-mode .os-panel--interactive:hover { transform: none; box-shadow: var(--os-shadow-1); border-color: var(--os-border-strong); }
.os-panel--selected { box-shadow: inset 0 0 0 2px var(--os-accent), var(--os-shadow-1); }
.os-panel[class*="os-panel--status-"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rail); }
.os-panel--status-good { --rail: var(--os-good); } .os-panel--status-warn { --rail: var(--os-warn); }
.os-panel--status-bad { --rail: var(--os-bad); } .os-panel--status-info { --rail: var(--os-info); }

/* App tile (home, admin, tools: one shape) */
.os-apptile { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start; overflow: hidden; }
.os-apptile .os-icontile--lg { grid-row: span 2; }
.os-apptile b { font: var(--os-type-h3); }
.os-apptile span { font: var(--os-type-caption); color: var(--os-text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-apptile::after { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--os-logo-gold), var(--os-vein)); transition: width var(--os-dur-3) var(--os-ease-out); }
.os-apptile:hover::after, .os-apptile.is-hover::after { width: 100%; }

/* ---------- Buttons (MudButton is styled to the same look) ---------- */
.os-btn { --h: var(--os-control-h); display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: max-content; height: var(--h);
  padding: 0 12px; border-radius: var(--os-radius-md); border: 1px solid var(--os-border); background: var(--os-surface); color: var(--os-text);
  font: var(--os-type-button); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background var(--os-dur-1), border-color var(--os-dur-1), color var(--os-dur-1), transform var(--os-dur-1); }
.os-btn:hover { border-color: var(--os-border-strong); background: color-mix(in srgb, var(--os-surface) 100%, transparent); box-shadow: inset 0 0 0 100px var(--os-surface-hover); }
.os-btn:active { transform: scale(.98); }
.os-btn i[data-i] { width: 18px; height: 18px; color: var(--os-text-2); }
.os-btn--primary { background: var(--os-accent-fill); border-color: var(--os-accent-fill); color: var(--os-on-accent-fill); box-shadow: var(--os-highlight), var(--os-shadow-1); }
.os-btn--primary:hover { background: var(--os-accent-fill-hover); border-color: var(--os-accent-fill-hover); box-shadow: var(--os-highlight), var(--os-shadow-1); }
.os-btn--primary i[data-i] { color: inherit; }
.os-btn--ghost { background: transparent; border-color: transparent; color: var(--os-text-2); }
.os-btn--ghost:hover { color: var(--os-text); border-color: transparent; }
.os-btn--danger { background: var(--os-bad); border-color: var(--os-bad); color: var(--os-on-bad); }
.os-btn--danger-ghost { background: transparent; border-color: transparent; color: var(--os-bad-text); }
.os-btn--sm { --h: 28px; padding: 0 10px; font-size: 13px; border-radius: var(--os-radius-sm); }
.os-btn--lg { --h: 40px; padding: 0 16px; font-size: 14px; }
.os-btn--icon { width: var(--h); padding: 0; background: transparent; border-color: transparent; color: var(--os-text-2); }
.os-btn--icon i[data-i] { width: 20px; height: 20px; color: inherit; }
.os-btn--icon:hover { color: var(--os-text); }
.os-btn[aria-busy="true"] { cursor: progress; }
.os-btn[disabled] { opacity: .4; pointer-events: none; }
.os-btn .os-count { margin-left: 2px; }

/* ---------- Badges, status, tags, chips, counts ---------- */
.os-badge { --b: var(--os-neutral); --bt: var(--os-neutral-text); --bs: var(--os-neutral-soft);
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--os-radius-pill);
  background: var(--bs); color: var(--bt); font: 500 12px/1 var(--os-font-ui); white-space: nowrap; }
.os-badge i[data-i] { width: 14px; height: 14px; color: var(--b); margin-left: -2px; }
.os-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--b); }
.os-badge--solid { background: var(--b); color: var(--on, #fff); }
.os-badge--solid i[data-i] { color: inherit; }
.os-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--b); }
.os-badge--sm { height: 18px; padding: 0 6px; font-size: 11px; }
.is-good { --b: var(--os-good); --bt: var(--os-good-text); --bs: var(--os-good-soft); --on: var(--os-on-good); }
.is-warn { --b: var(--os-warn); --bt: var(--os-warn-text); --bs: var(--os-warn-soft); --on: var(--os-on-warn); }
.is-bad  { --b: var(--os-bad);  --bt: var(--os-bad-text);  --bs: var(--os-bad-soft);  --on: var(--os-on-bad); }
.is-info { --b: var(--os-info); --bt: var(--os-info-text); --bs: var(--os-info-soft); --on: var(--os-on-info); }
.is-brand { --b: var(--os-accent); --bt: var(--os-accent-text); --bs: var(--os-accent-soft); --on: var(--os-on-accent); }
/* Status in dense tables: dot + word, never a filled pill (50 rows must not shout) */
.os-status { display: inline-flex; align-items: center; gap: 7px; color: var(--os-text-2); white-space: nowrap; }
.os-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--b, var(--os-neutral)); flex: none; }
.os-status--alarm::before { border-radius: 2px; }
.os-status--pulse::before { animation: os-pulse-dot 2s ease-in-out infinite; }
@keyframes os-pulse-dot { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--b) 25%, transparent); } }
.os-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: var(--os-radius-sm); border: 1px solid var(--os-border);
  background: var(--os-surface); color: var(--os-text-2); font: 500 12px/1 var(--os-font-ui); white-space: nowrap; }
.os-tag i[data-i] { width: 14px; height: 14px; color: var(--os-text-3); }
.os-tag--mono { font: 400 11.5px/1 var(--os-font-mono); font-variant-numeric: slashed-zero; }
.os-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.os-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--os-radius-pill); border: 1px solid var(--os-border);
  background: var(--os-surface); color: var(--os-text-2); font: 500 13px/1 var(--os-font-ui); white-space: nowrap; cursor: pointer; }
.os-chip i[data-i] { width: 16px; height: 16px; }
.os-chip:hover { border-color: var(--os-border-strong); color: var(--os-text); }
.os-chip--on { background: var(--os-accent-soft); border-color: color-mix(in srgb, var(--os-accent) 35%, transparent); color: var(--os-accent-text); }
.os-chip--ghost { border-style: dashed; }
.os-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--os-radius-pill);
  background: var(--os-surface-sunken); color: var(--os-text-2); font: 600 11px/1 var(--os-font-ui); font-variant-numeric: tabular-nums; }
.os-count--alert { background: var(--os-bad); color: var(--os-on-bad); }
.os-marker { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--os-radius-xs); font: var(--os-type-eyebrow); letter-spacing: .05em; text-transform: uppercase; }
.os-marker--demo { background: var(--os-ai-soft); color: var(--os-ai-text); }
.os-marker--live { background: var(--os-good-soft); color: var(--os-good-text); }

/* ---------- Tabs: underline (navigation) and segmented (views) ---------- */
.os-tabs { position: relative; display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.os-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--os-text-2); font: var(--os-type-button);
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: color var(--os-dur-1); }
.os-tab:hover { color: var(--os-text); }
.os-tab[aria-selected="true"], .os-tab[aria-current="page"] { color: var(--os-text); }
.os-tabs__ink { position: absolute; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--os-accent); transition: transform var(--os-dur-2) var(--os-ease-standard), width var(--os-dur-2) var(--os-ease-standard); }
.os-tabs--page { height: 40px; border-bottom: 1px solid var(--os-border-subtle); }
.os-seg { display: inline-flex; align-items: center; gap: 2px; height: var(--os-control-h); padding: 2px; border-radius: var(--os-radius-md); background: var(--os-surface-sunken); border: 1px solid var(--os-border-subtle); }
.os-seg button { height: 100%; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--os-text-2); font: var(--os-type-button); font-size: 13px; cursor: pointer; white-space: nowrap; }
.os-seg button[aria-pressed="true"] { background: var(--os-surface); color: var(--os-text); box-shadow: var(--os-shadow-1); }
:root[data-theme="dark"] .os-seg button[aria-pressed="true"] { background: var(--os-surface-raised); }

/* ---------- Toolbar / filter bar ---------- */
.os-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.os-search { display: flex; align-items: center; gap: 8px; height: var(--os-control-h); width: clamp(220px, 24vw, 340px); padding: 0 10px; border-radius: var(--os-radius-md);
  border: 1px solid var(--os-border-input); background: var(--os-field); color: var(--os-text-3); font: var(--os-type-small); }
.os-search i[data-i] { width: 18px; height: 18px; }
.os-search > span:not(.os-kbd) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- KPI tile ---------- */
/* KPI row: tiles never stretch into giants nor leave orphans. data-n = how many tiles (3, 4, 6 or 8); the container
   (not the window) picks the columns: n, n/2 or 2 (container queries, so a row inside a span-8 panel adapts too). */
.os-kpis { container-type: inline-size; min-width: 0; }
.os-kpis__in { display: grid; gap: var(--os-gutter); grid-template-columns: repeat(var(--c, 2), minmax(0, 1fr)); }
@container (min-width: 520px)  { .os-kpis__in[data-n="3"] { --c: 3; } .os-kpis__in[data-n="6"] { --c: 3; } }
@container (min-width: 760px)  { .os-kpis__in[data-n="4"] { --c: 4; } .os-kpis__in[data-n="8"] { --c: 4; } }
@container (min-width: 1080px) { .os-kpis__in[data-n="6"] { --c: 6; } }
@container (min-width: 1480px) { .os-kpis__in[data-n="8"] { --c: 8; } }
@container (max-width: 279px)  { .os-kpis__in { --c: 1; } }
@container (max-width: 519px)  { .os-kpi { padding: 12px 14px 12px; } .os-kpi__value { font: var(--os-type-kpi-sm); font-size: 1.375rem; } }
.os-kpi { position: relative; display: flex; flex-direction: column; container-type: inline-size; min-width: 0; padding: 16px 18px 14px; background: var(--os-surface);
  border: 1px solid var(--os-panel-line); border-radius: var(--os-radius-lg); box-shadow: var(--os-shadow-1); text-decoration: none; color: inherit; }
.os-kpi__label { display: flex; align-items: flex-start; gap: 6px; min-height: calc(2 * 1.28em); font: var(--os-type-label); color: var(--os-text-2); }
.os-kpi__label > span:first-child { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-kpi__period { font: 500 11px/16px var(--os-font-ui); color: var(--os-text-3); }
.os-kpi__value { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; font: var(--os-type-kpi); letter-spacing: var(--os-track-kpi); color: var(--os-text); white-space: nowrap; }
.os-kpi__value small { font: 500 14px/1 var(--os-font-ui); letter-spacing: 0; color: var(--os-text-3); }
.os-kpi__delta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: var(--os-type-caption); color: var(--os-text-3); flex-wrap: wrap; }
.os-delta { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px 0 4px; border-radius: var(--os-radius-pill); font: 500 12px/1 var(--os-font-ui); font-variant-numeric: tabular-nums; background: var(--os-neutral-soft); color: var(--os-neutral-text); }
.os-delta i[data-i] { width: 14px; height: 14px; }
.os-delta.is-good { background: var(--os-good-soft); color: var(--os-good-text); }
.os-delta.is-bad { background: var(--os-bad-soft); color: var(--os-bad-text); }
.os-kpi__foot { margin-top: auto; padding-top: 12px; }
.os-spark { display: block; width: 100%; height: 34px; overflow: visible; }
.os-spark .ln { fill: none; stroke: var(--os-spark); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.os-spark .ar { fill: var(--os-spark); opacity: .12; }
.os-spark .tg { stroke: var(--os-chart-target); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.os-spark .pt { fill: var(--os-spark); stroke: var(--os-surface); stroke-width: 2; }
.os-meter { position: relative; height: 4px; border-radius: 2px; background: var(--os-surface-sunken); }
.os-meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--os-spark); }
.os-meter > i { position: absolute; top: -4px; width: 2px; height: 12px; border-radius: 1px; background: var(--os-text); }
.os-meter + .os-caption { display: block; margin-top: 6px; }
.os-kpi--alarm::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--os-bad); }
.os-kpi--stale .os-kpi__value, .os-kpi--stale .os-kpi__foot { opacity: .6; }
.os-kpi--lg .os-kpi__value { font: var(--os-type-kpi-lg); letter-spacing: var(--os-track-kpi); }
.os-kpi--sm { padding: 12px 14px; }
.os-kpi--sm .os-kpi__value { font: var(--os-type-kpi-sm); }
/* A KPI as a link: a stretched link under the tile's text (no button nor tooltip inside an <a>); the (i), Try again and the
   foot's own controls sit above it */
.os-kpi__link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.os-kpi__link:focus-visible { outline: none; }
.os-kpi--link .os-kpi__info, .os-kpi--link .os-kpi__error button, .os-kpi--link .os-kpi__foot a, .os-kpi--link .os-kpi__foot button { position: relative; z-index: 1; }
.os-kpi--link:hover { box-shadow: var(--os-shadow-2); border-color: var(--os-border); }
/* Figures strip: the KPI's sibling inside panels */
.os-figures { display: flex; flex-wrap: wrap; gap: 0; }
.os-figures > div { padding: 0 20px; border-left: 1px solid var(--os-border-subtle); display: grid; gap: 2px; }
.os-figures > div:first-child { padding-left: 0; border-left: 0; }
.os-figures b { font: var(--os-type-kpi-sm); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.os-figures span { font: var(--os-type-caption); color: var(--os-text-3); }

/* ---------- Table ---------- */
.os-table-wrap { overflow: auto; }
.os-table { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--os-type-small); }
.os-table th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 var(--os-cell-x); background: var(--os-surface-sunken); border-bottom: 1px solid var(--os-border);
  font: var(--os-type-label); color: var(--os-text-2); text-align: left; white-space: nowrap; }
.os-table th.num, .os-table td.num { text-align: right; }
.os-table td { height: var(--os-row-h); padding: 0 var(--os-cell-x); border-bottom: 1px solid var(--os-border-subtle); color: var(--os-text-2); white-space: nowrap; }
.os-table th:first-child, .os-table td:first-child { padding-left: var(--os-panel-pad); }
.os-table th:last-child, .os-table td:last-child { padding-right: var(--os-panel-pad); }
.os-table tbody tr { transition: background var(--os-dur-1); }
.os-table tbody tr:hover { background: var(--os-surface-hover); }
.os-table tr.is-selected { background: var(--os-surface-selected); }
.os-table tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--os-accent); }
.os-table tr.is-new { animation: os-flash 1.2s var(--os-ease-standard); }
@keyframes os-flash { from { background: var(--os-accent-soft); } }
.os-table tr:last-child td { border-bottom: 0; }
.os-table .main { color: var(--os-text); font-weight: 500; }
.os-table .sub { display: block; font: var(--os-type-caption); color: var(--os-text-3); margin-top: 1px; }
.os-table td.two { padding-top: 6px; padding-bottom: 6px; }
.os-table .rowact { opacity: 0; transition: opacity var(--os-dur-1); }
.os-table tr:hover .rowact, .os-table tr:focus-within .rowact, .os-table tr.is-selected .rowact { opacity: 1; }
@media (hover: none) { .os-table .rowact { opacity: 1; } }
.os-table-foot { display: flex; align-items: center; gap: 8px; padding: 10px var(--os-panel-pad); border-top: 1px solid var(--os-border-subtle); font: var(--os-type-caption); color: var(--os-text-3); }
[data-density="wall"] .os-table tbody tr:nth-child(even), .wall-mode .os-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--os-text) 2.5%, transparent); }

/* ---------- Forms ---------- */
.os-field { display: grid; gap: 6px; min-width: 0; }
.os-field > label { font: var(--os-type-label); color: var(--os-text); }
.os-field > label em { font-style: normal; color: var(--os-text-3); font-weight: 400; }
.os-input, .os-select, .os-textarea { width: 100%; height: var(--os-control-h); padding: 0 10px; border-radius: var(--os-radius-md); border: 1px solid var(--os-border-input);
  background: var(--os-field); color: var(--os-text); font: var(--os-type-body); outline: none; transition: border-color var(--os-dur-1), box-shadow var(--os-dur-1); }
.os-textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.os-select { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.os-input::placeholder, .os-textarea::placeholder { color: var(--os-text-3); }
.os-input:hover, .os-select:hover { border-color: var(--os-text-3); }
.os-input:focus, .os-input.is-focus, .os-textarea:focus { border-color: var(--os-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--os-focus) 24%, transparent); }
.os-input.is-error { border-color: var(--os-bad); }
.os-field__help { font: var(--os-type-caption); color: var(--os-text-3); }
.os-field__error { display: flex; align-items: center; gap: 4px; font: var(--os-type-caption); color: var(--os-bad-text); }
.os-field__error i[data-i] { width: 14px; height: 14px; }
.os-inputwrap { position: relative; }
.os-inputwrap .unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--os-text-3); font: var(--os-type-small); }
.os-check { display: inline-flex; align-items: center; gap: 8px; font: var(--os-type-body); cursor: pointer; }
.os-check .box { width: 16px; height: 16px; border-radius: var(--os-radius-xs); border: 1px solid var(--os-border-input); background: var(--os-field); display: inline-grid; place-items: center; }
.os-check .box.on { background: var(--os-accent); border-color: var(--os-accent); color: var(--os-on-accent); }
.os-check .box.on i[data-i] { width: 14px; height: 14px; }
.os-switch { width: 32px; height: 18px; border-radius: 9px; background: var(--os-border-strong); position: relative; flex: none; }
.os-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--os-knob); box-shadow: var(--os-shadow-1); transition: transform var(--os-dur-2) var(--os-ease-spring); }
/* The switch's input is visually hidden (.os-sr) before it: the switch shows its keyboard focus */
.os-check input:focus-visible + .os-switch { outline: 2px solid var(--os-focus); outline-offset: 2px; }
.os-switch.on { background: var(--os-accent); }
.os-switch.on::after { transform: translateX(14px); background: var(--os-on-accent); }
.os-radio { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--os-border-input); background: var(--os-field); display: inline-block; }
.os-radio.on { border: 5px solid var(--os-accent); }
.os-form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* ---------- Notices, empty, error ---------- */
.os-notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--os-radius-md); background: var(--bs, var(--os-info-soft)); color: var(--os-text);
  border: 1px solid var(--bb, var(--os-info-border)); font: var(--os-type-small); }
.os-notice i[data-i] { width: 18px; height: 18px; color: var(--b, var(--os-info)); margin-top: 1px; }
.os-notice.is-warn { --bb: var(--os-warn-border); } .os-notice.is-good { --bb: var(--os-good-border); } .os-notice.is-bad { --bb: var(--os-bad-border); }
.os-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 20px; }
.os-empty__ill { width: 160px; height: 100px; margin-bottom: 4px; }
.os-empty__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--os-surface-sunken); color: var(--os-text-3); margin-bottom: 4px; }
.os-empty__icon.is-good { background: var(--os-good-soft); color: var(--os-good); }
.os-empty__icon i[data-i] { width: 22px; height: 22px; }
.os-empty p { margin: 0; color: var(--os-text-2); max-width: 46ch; }
.os-empty .os-row { justify-content: center; margin-top: 6px; }
.os-error { position: relative; padding: 16px 18px 16px 22px; }
.os-error::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--os-bad); }
.os-error__t { display: flex; align-items: center; gap: 8px; font: var(--os-type-h3); }
.os-error__t i[data-i] { color: var(--os-bad); width: 20px; height: 20px; }
.os-error p { margin: 6px 0 12px; color: var(--os-text-2); }
.os-details { margin-top: 10px; padding: 10px 12px; border-radius: var(--os-radius-md); background: var(--os-surface-sunken); font: var(--os-type-mono); color: var(--os-text-2); white-space: pre-wrap; }
.os-offline { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 var(--os-page-x); background: var(--os-warn-soft); color: var(--os-warn-text); font: var(--os-type-small); border-bottom: 1px solid var(--os-warn-border); }
.os-offline i[data-i] { width: 16px; height: 16px; }
.os-demobar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--os-radius-lg); border: 1px dashed var(--os-vein); background: color-mix(in srgb, var(--os-ai-soft) 70%, transparent); font: var(--os-type-small); color: var(--os-text-2); }
.os-paper { background: #FFFFFF; color: #201E1A; border-radius: var(--os-radius-sm); box-shadow: var(--os-shadow-3); padding: 20px 24px; }

/* ---------- Toasts, dialog, drawer ---------- */
.os-toast { display: flex; align-items: flex-start; gap: 10px; width: min(440px, 100%); padding: 12px 12px 12px 14px; border-radius: var(--os-radius-lg); background: var(--os-surface-raised);
  border: 1px solid var(--os-border); box-shadow: var(--os-shadow-3); font: var(--os-type-small); color: var(--os-text); }
.os-toast > i[data-i] { width: 20px; height: 20px; color: var(--b); margin-top: 0; }
.os-toast .msg { flex: 1; padding-top: 1px; }
.os-toast .msg span { display: block; color: var(--os-text-3); font: var(--os-type-caption); margin-top: 2px; }
.os-dialog { width: min(480px, 100%); border-radius: var(--os-radius-xl); background: var(--os-surface-raised); border: 1px solid var(--os-border); box-shadow: var(--os-shadow-4); overflow: hidden; }
.os-dialog__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 8px 24px; }
.os-dialog__head h3 { flex: 1; }
.os-dialog__body { padding: 0 24px 20px; color: var(--os-text-2); }
.os-dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--os-border-subtle); background: var(--os-surface-sunken); }
.os-progress { position: relative; height: 4px; border-radius: 2px; background: var(--os-surface-sunken); overflow: hidden; }
.os-progress > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--os-accent); transition: width var(--os-dur-2); }
.os-progress--ind > span { width: 30%; animation: os-ind 1.2s var(--os-ease-standard) infinite; }
.os-progress--edge { position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 0; background: transparent; }
@keyframes os-ind { from { left: -30%; } to { left: 100%; } }
.os-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--os-border); border-top-color: var(--os-accent); animation: os-spin .8s linear infinite; flex: none; display: inline-block; }
.os-spinner--20 { width: 20px; height: 20px; } .os-spinner--24 { width: 24px; height: 24px; }
.os-btn--primary .os-spinner { border-color: color-mix(in srgb, var(--os-on-accent-fill) 35%, transparent); border-top-color: var(--os-on-accent-fill); }
@keyframes os-spin { to { transform: rotate(360deg); } }
.is-dimmed { opacity: .7; transition: opacity var(--os-dur-3); }

/* ---------- Skeleton: one keyframe, transform-only sweep (no repaint, works on iOS) ---------- */
.os-skel { position: relative; overflow: hidden; border-radius: var(--os-radius-xs); background: var(--os-surface-sunken); }
.os-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--os-surface) 70%, transparent), transparent); animation: os-sweep 1.6s ease-in-out infinite; }
:root[data-theme="dark"] .os-skel::after { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--os-text) 4.5%, transparent), transparent); }
@keyframes os-sweep { to { transform: translateX(100%); } }
.os-skel--line { height: 10px; } .os-skel--title { height: 22px; border-radius: var(--os-radius-sm); } .os-skel--value { height: 28px; border-radius: var(--os-radius-sm); }
.os-skel--circle { border-radius: 50%; }
.os-fadeup { animation: os-fadeup var(--os-dur-3) var(--os-ease-out) both; }
@keyframes os-fadeup { from { opacity: 0; transform: translateY(8px); } }

/* ---------- In-page loading stage (the scene card over the main panel after 1.2 s) ---------- */
.os-stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: var(--os-z-stage); width: 312px; padding: 16px 6px 16px;
  border-radius: var(--os-radius-xl); background: var(--os-surface-raised); border: 1px solid var(--os-border); box-shadow: var(--os-shadow-3); text-align: center;
  animation: os-stagein var(--os-dur-3) var(--os-ease-out) both; }
@keyframes os-stagein { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
.os-stage__scene { display: block; width: 300px; height: 184px; margin: 0 auto; }
.os-stage__cap { margin-top: 8px; font: var(--os-type-body); color: var(--os-text-2); }
.os-stage__what { margin-top: 2px; font: var(--os-type-caption); color: var(--os-text-3); }
.os-stage__slow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font: var(--os-type-caption); color: var(--os-warn-text); }

/* ---------- The ONE AI panel ---------- */
.os-ai { position: relative; }
.os-ai::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; border-radius: var(--os-radius-lg) 0 0 var(--os-radius-lg); background: var(--os-ai); }
.os-ai__mark { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px 0 5px; border-radius: var(--os-radius-xs); background: var(--os-ai-soft); color: var(--os-ai-text);
  font: 600 11px/1 var(--os-font-ui); letter-spacing: .05em; flex: none; }
.os-ai__mark svg { width: 12px; height: 12px; fill: var(--os-ai); }
.os-ai__mark.pop svg { animation: os-spark-pop 520ms var(--os-ease-spring) both; }
@keyframes os-spark-pop { from { transform: scale(.4) rotate(-45deg); opacity: 0; } }
.os-ai__body { font: var(--os-type-reading); color: var(--os-text); }
.os-ai__body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.os-ai__body li { position: relative; padding-left: 16px; }
.os-ai__body li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--os-ai); }
.os-ai__body b { font-weight: 600; font-variant-numeric: tabular-nums; }
/* An AI text's link to a site that is not allowed: its words, then its host (never a link) */
.os-ai__host { color: var(--os-text-3); font: var(--os-type-small); }
.os-ai__body sup { vertical-align: baseline; line-height: 0; }
.os-ai__body sup a, .os-ref { display: inline-grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; margin-left: 2px; border-radius: 4px; background: var(--os-surface-sunken);
  color: var(--os-text-2); font: 600 10px/1 var(--os-font-ui); text-decoration: none; vertical-align: 2px; }
.os-ai__sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font: var(--os-type-caption); color: var(--os-text-3); }
.os-ai__steps { display: grid; gap: 8px; margin: 2px 0 12px; font: var(--os-type-small); color: var(--os-text-2); }
.os-ai__steps div { display: flex; align-items: center; gap: 8px; }
.os-ai__steps i[data-i] { width: 16px; height: 16px; color: var(--os-good); }
.os-ai__steps .todo { color: var(--os-text-3); }
.os-ai__steps .todo::before { content: ""; width: 12px; height: 12px; margin: 0 2px; border-radius: 50%; border: 1.5px solid var(--os-border-strong); }
.os-ai__breathe svg { animation: os-breathe 1.2s ease-in-out infinite; }
@keyframes os-breathe { 50% { opacity: .45; } }
.os-ai__line { opacity: 0; animation: os-line var(--os-dur-3) var(--os-ease-out) forwards; }
@keyframes os-line { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.os-untraced { text-decoration: underline dotted var(--os-warn); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.os-ai--off::before { background: var(--os-border-strong); }
.os-suggest { border-radius: var(--os-radius-md); border: 1px solid var(--os-border); background: var(--os-surface); padding: 14px 16px; }
.os-suggest dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0; font: var(--os-type-small); }
.os-suggest dt { color: var(--os-text-3); }
.os-suggest dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.os-old { color: var(--os-text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--os-text-3) 70%, transparent); }
.os-new { padding: 1px 6px; border-radius: 4px; background: var(--os-ai-soft); color: var(--os-text); font-weight: 500; }
.os-conf { display: inline-flex; align-items: center; gap: 6px; font: var(--os-type-caption); color: var(--os-text-2); }
.os-conf b { display: inline-flex; gap: 2px; align-items: flex-end; }
.os-conf b i { width: 4px; border-radius: 1px; background: var(--os-border-strong); }
.os-conf b i:nth-child(1) { height: 6px; } .os-conf b i:nth-child(2) { height: 9px; } .os-conf b i:nth-child(3) { height: 12px; }
.os-conf.is-high b i { background: var(--os-good); } .os-conf.is-med b i:nth-child(-n+2) { background: var(--os-warn); }
.os-applied { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--os-radius-md); background: var(--os-surface-sunken); font: var(--os-type-small); color: var(--os-text-2);
  animation: os-collapse 420ms var(--os-ease-spring) both; }
.os-applied i[data-i] { width: 16px; height: 16px; color: var(--os-good); }
@keyframes os-collapse { from { transform: scaleY(1.6); opacity: 0; } }
.os-bubble-me { justify-self: end; max-width: 80%; padding: 8px 12px; border-radius: var(--os-radius-lg) var(--os-radius-lg) 4px var(--os-radius-lg); background: var(--os-surface-sunken); font: var(--os-type-small); }

/* ---------- Charts (custom SVG contract; ApexCharts gets the same values from ChartTheme.cs) ---------- */
.os-chart { display: block; width: 100%; overflow: visible; font: 400 var(--os-chart-font)/1 var(--os-font-ui); font-variant-numeric: tabular-nums; }
.os-chart .grid { stroke: var(--os-chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.os-chart .axis { stroke: var(--os-chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.os-chart .lbl { fill: var(--os-chart-label); }
.os-chart .lbl-2 { fill: var(--os-text-2); }
.os-chart .lbl-strong { fill: var(--os-text); font-weight: 500; }
.os-chart .s1 { stroke: var(--os-chart-1); fill: var(--os-chart-1); } .os-chart .s2 { stroke: var(--os-chart-2); fill: var(--os-chart-2); }
.os-chart .s3 { stroke: var(--os-chart-3); fill: var(--os-chart-3); } .os-chart .s4 { stroke: var(--os-chart-4); fill: var(--os-chart-4); }
.os-chart .s5 { stroke: var(--os-chart-5); fill: var(--os-chart-5); } .os-chart .s6 { stroke: var(--os-chart-6); fill: var(--os-chart-6); }
.os-chart .line { fill: none; stroke-width: var(--os-chart-line); stroke-linejoin: round; stroke-linecap: round; }
.os-chart .area { stroke: none; opacity: .12; }
.os-chart .bar { stroke: var(--os-surface); stroke-width: 2px; paint-order: stroke; }
.os-chart .target { stroke: var(--os-chart-target); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.os-chart .band { fill: var(--os-chart-band); }
.os-chart .shift { fill: var(--os-chart-shift); }
.os-chart .event { fill: var(--os-chart-event); }
.os-chart .now { stroke: var(--os-vein); stroke-width: 1; stroke-dasharray: 2 3; }
.os-chart .xh { stroke: var(--os-text-3); stroke-width: 1; stroke-dasharray: 2 2; }
.os-chart .dot { stroke: var(--os-surface); stroke-width: 2; }
.os-chart .cell { stroke: var(--os-surface); stroke-width: 2; }
.os-chart .draw { stroke-dasharray: var(--len, 0); stroke-dashoffset: var(--len, 0); animation: os-draw var(--os-dur-chart) var(--os-ease-out) forwards; }
@keyframes os-draw { to { stroke-dashoffset: 0; } }
.os-tip { position: absolute; pointer-events: none; min-width: 150px; padding: 8px 10px; border-radius: var(--os-radius-sm); background: var(--os-surface-raised); border: 1px solid var(--os-border);
  box-shadow: var(--os-shadow-3); font: var(--os-type-caption); color: var(--os-text-2); z-index: 5; }
.os-tip b { display: block; color: var(--os-text); font-weight: 600; margin-bottom: 4px; }
.os-tip div { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.os-tip div span:last-child { margin-left: auto; color: var(--os-text); font-weight: 500; padding-left: 12px; }
.os-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font: var(--os-type-caption); color: var(--os-text-2); }
.os-legend span { display: inline-flex; align-items: center; gap: 6px; }
.os-legend .ln { width: 14px; height: 2px; border-radius: 1px; background: var(--c); }
.os-legend .dash { width: 14px; height: 0; border-top: 1.5px dashed var(--os-chart-target); }

/* ---------- Reduced motion, wall, forced colours ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .os-skel::after { display: none; }
}
:root.wall-mode .os-skel::after, [data-density="wall"] .os-skel::after { display: none; }
:root.wall-mode .os-chart .draw, [data-density="wall"] .os-chart .draw { animation: none; stroke-dashoffset: 0; }
@media (forced-colors: active) {
  .os-panel, .os-kpi, .os-btn, .os-chip, .os-tag, .os-badge { border: 1px solid CanvasText; }
  .os-status::before, .os-ai::before { forced-color-adjust: none; }
  :focus-visible { outline-color: Highlight; }
}

/* ---------- List + detail template (panes scroll on their own; the page stays still) ---------- */
.os-ld { display: grid; gap: var(--os-gutter); grid-template-columns: minmax(520px, 1.35fr) minmax(420px, 1fr); align-items: start; min-height: 0; }
.os-ld__list, .os-ld__detail { min-width: 0; }
.os-ld--fixed { height: calc(100dvh - var(--os-shell-h) - var(--os-ld-top, 140px)); }
.os-ld--fixed > * { height: 100%; overflow: auto; }
@media (min-width: 1920px) { .os-ld--side { grid-template-columns: minmax(520px, 1.2fr) minmax(480px, 1.2fr) minmax(300px, .6fr); } }
@media (max-width: 1279.98px) { .os-ld { grid-template-columns: 1fr; } .os-ld__detail { display: none; } }

/* ---------- Responsive shell and headers ---------- */
@media (max-width: 959.98px) {
  /* minmax(0, 1fr): a row of page tabs scrolls instead of widening the page on a phone (V1.66) */
  .os-pagehead { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .os-pagehead__actions { justify-content: flex-start; }
  .os-pagehead--hero::before { inset: 0 0 0 20%; }
}
@media (max-width: 599.98px) {
  .os-appbar__end, .os-appname .os-tag { display: none; }
  .os-tabs { mask-image: linear-gradient(90deg, black 85%, transparent); }
  .os-pagehead--hero { padding: 18px 16px; border-radius: var(--os-radius-lg); }
  .os-page { padding-top: 16px; }
  .os-figures > div { padding: 0 12px; }
  .os-filterbar .os-search { width: 100%; }
  .os-table .hide-xs { display: none; }
}

/* ---------- Severity (Monitoring, Infrastructure, alarms: Severities.CssClass). The five levels on the status palette, light
   and dark (Design system.md 2.3); --sev / --sev-tint feed the legacy rules (.sev, .bar, .wall-*, .if-*, .m2-*). The chip's
   look per level beats monitoring.css's dark patch of .sev (same weight, later): critical solid, warning outlined ---------- */
.sev-critical { --sev: var(--os-bad);  --sev-tint: var(--os-bad-soft); }
.sev-major    { --sev: var(--os-bad);  --sev-tint: var(--os-bad-soft); }
.sev-minor    { --sev: var(--os-warn); --sev-tint: var(--os-warn-soft); }
.sev-warning  { --sev: var(--os-warn); --sev-tint: var(--os-warn-soft); }
.sev-info     { --sev: var(--os-info); --sev-tint: var(--os-info-soft); }
:root .sev:is(.sev-critical, .sev-major, .sev-minor, .sev-warning, .sev-info) { background: var(--sev-tint); color: var(--os-text); }
:root .sev:is(.sev-critical, .sev-major, .sev-minor, .sev-warning, .sev-info) .mud-icon-root { color: var(--sev); }
:root .sev.sev-critical { background: var(--os-bad); color: var(--os-on-bad); }
:root .sev.sev-critical .mud-icon-root { color: inherit; }
:root .sev.sev-warning { background: transparent; box-shadow: inset 0 0 0 1px var(--os-warn); }

/* ---------- MudBlazor 9.11 bridge: where Mud reads no theme value (Theme.cs maps the palette, type, shadows, z-index).
   Adapted from the reference: the button type comes from Theme.cs (a font shorthand here would undo Size.Small / Large),
   the height floor is for text buttons only (an icon button keeps its own size: chips, adornments, table rows), the
   tooltip rule has the weight of Mud's .mud-tooltip-default, a tooltip is no menu, Power BI's simulated charts keep
   their own tooltip ---------- */
.mud-button-root { border-radius: var(--os-radius-md); }
.mud-button-root:not(.mud-icon-button) { min-height: var(--os-control-h); }
.mud-button-filled:not(:disabled), .mud-button-filled:not(:disabled):hover { box-shadow: var(--os-highlight), var(--os-shadow-1) !important; }   /* no Material 3-layer shadow */
.mud-button-filled.mud-button-filled-primary:not(:disabled) { background-color: var(--os-accent-fill); color: var(--os-on-accent-fill); }   /* Taupe: the gold fill, Ink text */
.mud-button-filled.mud-button-filled-primary:not(:disabled):hover { background-color: var(--os-accent-fill-hover); }
/* Gold means "something you press" (owner 2026-11-10): every FILLED Color.Primary control wears the gold with Ink text,
   both themes: filled icon and toggle buttons, the buttons of a filled button group (OverrideStyles), chips, FABs and the
   selected day of a picker (.mud-theme-primary). Inside them Mud's primary variables point to the fill tokens, so Mud's
   own rest, hover (darken -> fill-hover), focus, active and ripple rules follow. What only shows a state (badges, avatars,
   filled alerts) and the text, outlined and indicator uses (checkbox, radio, switch, slider, progress, the tab line) keep
   the deep tan of the palette (--os-accent, light text on it: 5.4 light, 9.1 dark). */
:is(.mud-button-filled-primary, .mud-button-group-override-styles.mud-button-group-filled-primary .mud-button-root,
    .mud-chip-filled.mud-chip-color-primary, .mud-fab-primary, .mud-fab-filled-primary, .mud-theme-primary:not(.mud-badge)) {
  --mud-palette-primary: var(--os-accent-fill);
  --mud-palette-primary-darken: var(--os-accent-fill-hover);
  --mud-palette-primary-lighten: var(--os-accent-fill-hover);
  --mud-palette-primary-text: var(--os-on-accent-fill);
}
.mud-button-outlined { border-color: var(--os-border); color: var(--os-text); }                                    /* any colour → the secondary look */
.mud-input.mud-input-outlined .mud-input-outlined-border { border-color: var(--os-border-input); border-radius: var(--os-radius-md); }
.mud-input.mud-input-outlined:focus-within .mud-input-outlined-border { border-color: var(--os-accent); border-width: 1px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--os-focus) 24%, transparent); }
.os-field .mud-input-label { display: none; }                                                                      /* <OsField> puts the label above */
.mud-popover:not(.mud-tooltip), .mud-menu .mud-list { background: var(--os-surface-raised); border: 1px solid var(--os-border); border-radius: var(--os-radius-lg); }
.mud-dialog { border-radius: var(--os-radius-xl); background: var(--os-surface-raised); border: 1px solid var(--os-border);
  box-shadow: var(--os-shadow-4); }   /* MudBlazor writes a literal Material shadow here, not var(--mud-elevation-24) */
.mud-dialog .mud-dialog-title > .mud-typography-h6 { font: var(--os-type-h2); letter-spacing: var(--os-track-h2); }   /* a plain dialog title is an h6 (KPI style): spec 4.11 wants h2 */
.mud-snackbar { border-radius: var(--os-radius-lg); background: var(--os-surface-raised) !important; color: var(--os-text) !important;
  border: 1px solid var(--os-border); box-shadow: var(--os-shadow-3); font: var(--os-type-small); }
.mud-snackbar:is(.mud-alert-text-success, .mud-alert-filled-success, .mud-alert-outlined-success) .mud-snackbar-icon { color: var(--os-good); }
.mud-snackbar:is(.mud-alert-text-warning, .mud-alert-filled-warning, .mud-alert-outlined-warning) .mud-snackbar-icon { color: var(--os-warn); }
.mud-snackbar:is(.mud-alert-text-error, .mud-alert-filled-error, .mud-alert-outlined-error) .mud-snackbar-icon { color: var(--os-bad); }
.mud-snackbar:is(.mud-alert-text-info, .mud-alert-filled-info, .mud-alert-outlined-info) .mud-snackbar-icon { color: var(--os-info); }
.mud-tooltip, .mud-tooltip.mud-tooltip-default { background: var(--os-inverse); color: var(--os-inverse-text); font: var(--os-type-caption); border-radius: var(--os-radius-sm); }
.mud-tooltip.mud-tooltip-default.mud-tooltip-arrow::after { border-color: var(--os-inverse) transparent transparent transparent; }
.mud-progress-linear { border-radius: 2px; }   /* only for determinate progress; indeterminate page loaders go in wave 0.8 */
.apexcharts-tooltip:not(.pbi *) { background: var(--os-surface-raised) !important; border: 1px solid var(--os-border) !important; color: var(--os-text) !important;
  box-shadow: var(--os-shadow-3) !important; border-radius: var(--os-radius-sm) !important; }

/* ---------- Wave 0.5: what the Razor components of Client\Shared\Os and Shared\Charts need beyond the reference (the
   same tokens only). Each block names its component. ---------- */
/* A button that reads as a link (Undo, More) */
.os-link-btn { border: 0; padding: 0; background: none; color: var(--os-accent); font: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
/* PageHeader */
.os-pagehead__h { gap: 10px; }
.os-pagehead__crumbs a { color: inherit; text-decoration: none; }
.os-pagehead__crumbs a:hover { color: var(--os-text); text-decoration: underline; }
.os-pagehead__crumbs i[data-i] { width: 14px; height: 14px; }
.os-pagehead__metaskel { display: inline-block; width: min(320px, 70vw); height: 12px; }
.os-pagehead__tabs { grid-column: 1 / -1; }
.os-pagehead__sentinel { height: 0; }
.os-pagehead--sticky { position: sticky; top: 0; z-index: var(--os-z-pagebar); background: var(--os-canvas); transition: padding var(--os-dur-2) var(--os-ease-standard), box-shadow var(--os-dur-2); }
.os-pagehead--sticky.is-stuck { padding: 6px 0; box-shadow: 0 1px 0 var(--os-border-subtle); background: var(--os-surface-raised); }
.os-pagehead--sticky.is-stuck .os-h1 { font: var(--os-type-h2); }
.os-pagehead--sticky.is-stuck .os-pagehead__desc, .os-pagehead--sticky.is-stuck .os-eyebrow { display: none; }
.os-pagehead--compact .os-pagehead__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.os-pagehead--compact .os-pagehead__meta { margin-top: 0; }
/* Tag, AiButton */
.os-tag__x { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: -3px; padding: 0; border: 0; border-radius: var(--os-radius-xs); background: none; color: var(--os-text-3); cursor: pointer; }
.os-tag__x:hover { background: var(--os-surface-hover); color: var(--os-text); }
.os-tag__x i[data-i] { width: 12px; height: 12px; }
.os-aibtn__spark { width: 16px; height: 16px; fill: var(--os-ai); flex: none; }
/* OsSegmented, FilterChip, OsFilterBar */
.os-seg--sm { height: 28px; }
.os-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }   /* a phone: the options scroll, never overflow the page */
.os-seg button { flex: none; }
.os-seg button { display: inline-flex; align-items: center; gap: 6px; }
.os-seg button i[data-i] { width: 16px; height: 16px; }
.os-seg button:disabled { opacity: .4; cursor: default; }
.os-chip { padding: 0; cursor: default; }
.os-chip__b, .os-chip__x { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 10px; border: 0; border-radius: var(--os-radius-pill); background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.os-chip__x { padding: 0 8px 0 2px; margin-left: -6px; }
.os-chip__x i[data-i] { width: 14px; height: 14px; }
.os-chip b { font-weight: 600; }
.os-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--os-text); font: var(--os-type-small); outline: none; }
.os-search:focus-within { border-color: var(--os-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--os-focus) 24%, transparent); }
.os-filterbar--sticky { position: sticky; top: 0; z-index: var(--os-z-sticky); padding: 8px 0; background: var(--os-canvas); }
.os-filterbar--bulk { min-height: calc(var(--os-control-h) + 12px); padding: 6px 12px; border-radius: var(--os-radius-md); background: var(--os-accent-soft); color: var(--os-accent-text); }
/* KpiTile */
.os-kpi__info { display: inline-flex; color: var(--os-text-3); cursor: help; }
.os-kpi__info i[data-i] { width: 14px; height: 14px; }
.os-kpi__error { display: grid; gap: 8px; justify-items: start; margin-top: 8px; font: var(--os-type-small); color: var(--os-bad-text); }
.os-kpi__error > span { display: inline-flex; align-items: center; gap: 6px; }
.os-kpi__error i[data-i] { width: 16px; height: 16px; color: var(--os-bad); }
.os-kpi__skel { display: block; width: 46%; margin-top: 10px; }
.os-kpi__skel2 { display: block; width: 70%; margin-top: 10px; }
.os-kpi--skel { gap: 12px; }
.os-kpi--warn::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--os-warn); }
.os-kpi--wall .os-kpi__value { font: var(--os-type-kpi-xl); letter-spacing: var(--os-track-kpi); }
a.os-panel:focus-visible, .os-kpi--link:has(> .os-kpi__link:focus-visible) { outline: 2px solid var(--os-focus); outline-offset: 2px; }
/* Sparkline: the box stretches, the last point stays round (drawn in HTML) */
.os-sparkwrap { position: relative; width: 100%; }
.os-sparkwrap .os-spark { height: 100%; }
.os-spark__dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--os-spark); box-shadow: 0 0 0 2px var(--os-surface); }
/* Panel as a link, its refresh bar */
a.os-panel { display: block; color: inherit; text-decoration: none; }
.os-panel--interactive:focus-visible { outline: 2px solid var(--os-focus); outline-offset: 2px; }
.os-panel > .os-progress--edge { border-radius: var(--os-radius-lg) var(--os-radius-lg) 0 0; }
/* Notice */
.os-notice__body { flex: 1; min-width: 0; }
.os-notice__body > b { display: block; font-weight: 600; margin-bottom: 2px; }
.os-notice__action { margin-left: auto; flex: none; }
/* EmptyState: the page size has the contour texture behind its drawing (an allowed place, Design system.md 2.12) */
.os-empty--page { position: relative; padding: 40px 24px; }
.os-empty--page::before { content: ""; position: absolute; inset: 0; background: var(--os-accent-brand); opacity: .35; pointer-events: none;
  -webkit-mask: var(--os-contours) center / cover no-repeat, radial-gradient(closest-side, black, transparent); -webkit-mask-composite: source-in;
  mask: var(--os-contours) center / cover no-repeat, radial-gradient(closest-side, black, transparent); mask-composite: intersect; }
.os-empty--page > * { position: relative; }
.os-empty--inline { grid-auto-flow: row; padding: 16px 12px; gap: 4px; }
.os-empty--inline p { font: var(--os-type-small); }
.os-ill { overflow: visible; }
.os-ill .rail { stroke: var(--os-border-strong); stroke-width: 2.4; stroke-linecap: round; }
.os-ill .perch { stroke: var(--os-text-3); stroke-width: 3; stroke-linecap: round; }
.os-ill .bird { fill: var(--boot-bird); } .os-ill .wing { fill: var(--boot-wing); } .os-ill .beak { fill: var(--boot-beak); }
.os-ill .eye { fill: none; stroke: var(--os-logo-ink); stroke-width: 1.4; stroke-linecap: round; }
.os-ill .legs { stroke: var(--boot-beak); stroke-width: 1.6; stroke-linecap: round; }
.os-ill .zz { fill: none; stroke: var(--os-text-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.os-ill .tie { stroke: var(--os-border-strong); stroke-width: 3; }
.os-ill .cart { fill: var(--os-accent-brand); } .os-ill .rim { fill: var(--os-logo-ink); }
.os-ill .wheel { fill: var(--os-surface); stroke: var(--os-logo-ink); stroke-width: 3; }
/* ErrorState */
.os-error--inline { padding: 10px 12px 10px 16px; }
.os-error--inline .os-error__t { font: var(--os-type-small); font-weight: 500; }
.os-error--inline .os-error__t i[data-i] { width: 16px; height: 16px; }
.os-error--inline .os-row { margin-top: 6px; }
.os-details { position: relative; padding-right: 40px; }
.os-details__copy { position: absolute; right: 4px; top: 4px; }
/* Skeletons and page skeletons */
.os-skel--block { height: 120px; border-radius: var(--os-radius-sm); }
.os-skel--pill { border-radius: var(--os-radius-pill); }
.os-skel-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center; gap: var(--os-cell-x); height: var(--os-row-h); padding: 0 var(--os-panel-pad); border-bottom: 1px solid var(--os-border-subtle); }
.os-skel-row--head { height: 36px; background: var(--os-surface-sunken); border-bottom-color: var(--os-border); }
.os-skel-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--os-border-subtle); }
.os-skel-chart > .os-skel { flex: 1; border-radius: var(--os-radius-xs) var(--os-radius-xs) 0 0; }
.os-pageskel { display: grid; gap: var(--os-gutter); align-content: start; }
.os-pageskel__head { display: grid; gap: 6px; margin-bottom: 14px; }
.os-pageskel__lines { display: grid; gap: 10px; }
.os-pageskel__table { overflow: hidden; }
.os-loadable__region { padding: 4px 0; }
/* OsTable */
.os-table__check { width: 36px; }
.os-table__check input { width: 16px; height: 16px; accent-color: var(--os-accent); }
.os-table__act { width: 1%; text-align: right; }
.os-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.os-sort i[data-i] { width: 14px; height: 14px; opacity: .45; }
.os-sort i[data-i].on { opacity: 1; color: var(--os-text); }
th.num .os-sort { flex-direction: row-reverse; }
.os-table tr.is-link { cursor: pointer; }
.os-table tr.is-link:focus-visible { outline: 2px solid var(--os-focus); outline-offset: -2px; }
.os-table tr.is-highlight td:first-child { box-shadow: inset 2px 0 0 var(--os-vein); }
.os-table .os-table__empty td { height: auto; padding: 0; white-space: normal; }
.os-table tbody tr.os-table__empty:hover, .os-table tbody tr.os-table__skel:hover { background: transparent; }
.os-table__skel .os-skel { display: block; }
.os-table td.os-mono { font: var(--os-type-mono); font-size: 12px; }
/* The AI panel family */
.os-aipanel__head { display: flex; align-items: flex-start; gap: 10px; width: 100%; }
.os-aipanel__head .t { display: grid; gap: 2px; flex: 1; min-width: 0; }
.os-aipanel__head .os-ai__mark { margin-top: 1px; }
.os-aipanel__off { display: flex; align-items: flex-start; gap: 10px; color: var(--os-text-2); font: var(--os-type-small); }
.os-aipanel__off p { margin: 0 0 4px; }
.os-aipanel__off i[data-i] { color: var(--os-text-3); }
.os-aipanel__promise { margin: 0 0 12px; color: var(--os-text-2); }
.os-aipanel__wait { margin-top: 12px; }
.os-aipanel__previous { opacity: .7; margin-top: 12px; }
.os-aipanel__untraced { margin-top: 12px; }
.os-aipanel__caution { font: var(--os-type-caption); color: var(--os-text-3); }
.os-panel.os-ai .os-panel__foot { flex-wrap: wrap; }
.os-ai__lines > * { animation: os-line var(--os-dur-3) var(--os-ease-out) both; }
.os-ai__lines > :nth-child(2) { animation-delay: 120ms; } .os-ai__lines > :nth-child(3) { animation-delay: 240ms; }
.os-ai__lines > :nth-child(4) { animation-delay: 360ms; } .os-ai__lines > :nth-child(n+5) { animation-delay: 480ms; }
.os-ai__body p { margin: 0 0 10px; } .os-ai__body p:last-child { margin-bottom: 0; }
.os-ai__body ul { margin-bottom: 10px; }
.os-ai__body code { font: var(--os-type-mono); padding: 1px 4px; border-radius: var(--os-radius-xs); background: var(--os-surface-sunken); }
.os-suggest { position: relative; outline: none; }
.os-suggest:focus-visible { box-shadow: 0 0 0 2px var(--os-focus); }
.os-suggest__head { gap: 8px; }
.os-suggest__title { font: var(--os-type-h4); }
.os-suggest__arrow { width: 14px; height: 14px; color: var(--os-text-3); }
.os-suggest__reason { margin: 0 0 4px; font: var(--os-type-small); color: var(--os-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-suggest__reason.is-open { display: block; }
.os-suggest__actions { margin-top: 12px; }
.os-suggest__actions .os-kbd { margin-left: 2px; }
.os-btn--primary .os-kbd { background: transparent; border-color: color-mix(in srgb, var(--os-on-accent-fill) 40%, transparent); color: inherit; }
.os-conf.is-low b i:nth-child(1) { background: var(--os-text-3); }
/* Toasts (inside MudBlazor's snackbar) */
.os-toast__msg span { display: block; margin-top: 2px; font: var(--os-type-caption); color: var(--os-text-3); }
.os-toast__progress { display: grid; gap: 6px; min-width: 240px; }
.os-toast__progress .os-progress { width: 100%; }
/* Charts */
.os-chartpanel .os-legend { margin-bottom: 8px; }
.os-chartpanel__chart { position: relative; min-height: 120px; }
.os-chartpanel__table { max-height: 360px; overflow: auto; }
/* The /design page (Pages\DesignPage.razor) */
.os-design__toc { display: flex; flex-wrap: wrap; gap: 6px; }
.os-design__toc .os-tag { text-decoration: none; }
.os-design__sec { display: grid; gap: var(--os-gutter); scroll-margin-top: 16px; min-width: 0; }
.os-design__sec > h2 { margin-top: 16px; }
.os-design__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.os-design__row:last-child { margin-bottom: 0; }
.os-design__stack { display: grid; gap: 10px; align-content: start; }
.os-design__meters { display: grid; gap: 10px; max-width: 420px; }
.os-design__frame { position: relative; max-height: 560px; overflow: hidden; padding: 16px; border: 1px dashed var(--os-border); border-radius: var(--os-radius-md); background: var(--os-canvas); }
.os-design__palette { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; font: var(--os-type-caption); color: var(--os-text-2); }
.os-design__palette span { display: inline-flex; align-items: center; gap: 6px; }
.os-design__palette .os-swatch { width: 28px; height: 16px; border-radius: var(--os-radius-xs); }
.os-design__sparks { display: grid; gap: 16px; }
.os-design__densities { display: grid; gap: var(--os-gutter); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

/* ---------- Wave 0.6: the in-page loading stage (Client\Shared\Os\LoadingStage.razor, the first child of <main>): sticky at
   the top of the scrolling page, the card at 38 % of the window, the page dimmed to 55 % around it; it fades when the data
   comes. The celebration of a long job's toast (the pour, small). ---------- */
.os-stagehost { position: sticky; top: 0; z-index: var(--os-z-stage); height: 0; }
.os-stagehost .os-stage { top: 38vh; }
/* Leaving: never catches a click on the page it uncovers */
.os-stage--out { animation: os-stageout var(--os-dur-3) var(--os-ease-in) forwards; pointer-events: none; }
@keyframes os-stageout { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
main.content:has(> .os-stagehost .os-stage:not(.os-stage--out)) > :not(.os-stagehost) { opacity: .55; transition: opacity var(--os-dur-3); }
.os-stage__scene { position: relative; overflow: hidden; }
.os-stage__slow i[data-i], .os-stage__giveup i[data-i] { width: 14px; height: 14px; }
.os-stage__giveup { display: grid; gap: 8px; justify-items: center; margin-top: 10px; font: var(--os-type-caption); color: var(--os-warn-text); }
.os-stage__giveup > span { display: inline-flex; align-items: center; gap: 6px; }
.os-celebrate { display: flex; align-items: center; gap: 12px; }
.os-celebrate__scene { width: 120px; height: 74px; overflow: hidden; flex: none; }
.os-celebrate__scene .os-scene { transform: scale(.4); transform-origin: 0 0; }
/* Me > Appearance > Start-up scenes (Pages\MyAppearance.razor, SceneTile): the scenes at 0.6 scale, a click plays one again */
.os-appearance__gallery { --os-card-min: 240px; }
.os-appearance__choice { gap: 12px 20px; }
.os-scenetile { display: grid; gap: 10px; align-content: start; }
.os-scenetile__play { display: block; width: 180px; height: 110px; margin: 0 auto; padding: 0; border: 0; border-radius: var(--os-radius-md); background: none; overflow: hidden; cursor: pointer; }
.os-scenetile__play:focus-visible { outline: 2px solid var(--os-focus); outline-offset: 2px; }
.os-scenetile__stage { display: block; width: 300px; height: 184px; transform: scale(.6); transform-origin: 0 0; }
.os-scenetile__cap { font: var(--os-type-small); font-weight: 500; text-align: center; }
