/* Swangz UI — the shared components both apps are built from (ui.js makes them).
   Status indicators, skeletons, empty and error states, tooltips, charts, tables, the time range
   control and the command menu. Every class starts with u- so it never collides with an app's own. */

/* ------------------------------------------------------------ architectural scene and glass
   One fixed image/scrim plane, without a full-screen blur or animation. App shells may
   override --scene-image. Utilities are opt-in; page-specific composition follows separately. */
body { min-height: 100vh; isolation: isolate; background: transparent; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--scene-scrim), var(--scene-scrim)), var(--scene-image) center / cover no-repeat;
}
body:has(.topbar) { --scene-image: url("/static/home-welcome.webp"); }
body:has(.gate) { --scene-image: url("/static/login-welcome.webp"); }
@media print {
  body::before { display: none; }
}

:is(.u-glass, .u-glass-strong, .u-glass-accent) {
  background: var(--glass-bg); border: 1px solid var(--glass-rim);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--tx-1);
}
.u-glass-strong { background: var(--glass-bg-strong); }
.u-glass-accent {
  background: var(--glass-bg-accent);
  /* Gold needs full-contrast copy, including labels that use supporting tokens. */
  --tx-2: var(--tx-1); --tx-3: var(--tx-1);
}
.u-glass-pill { border-radius: var(--radius-control); }
/* An inset surface is a tint only. This also guards accidental nested utility use. */
.u-glass-well,
:is(.u-glass, .u-glass-strong, .u-glass-accent) :is(.u-glass, .u-glass-strong, .u-glass-accent) {
  background: var(--glass-bg-strong); border: 1px solid var(--glass-rim);
  border-radius: var(--r-md); box-shadow: var(--glass-highlight);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.u-glass-lift { transition: transform var(--dur-2) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .u-glass-lift:hover { transform: var(--lift); border-color: var(--glass-rim-hover); }
}
.u-glass-lift:focus-within { border-color: var(--glass-rim-hover); }

/* Solid surfaces are the baseline when blur is unavailable or unwanted. Change the
   tokens too, so future consumers inherit the same fallback without repeating selectors. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, :root[data-theme] { --glass-bg: var(--ink-2); --glass-bg-strong: var(--ink-2); --glass-bg-accent: var(--ink-2); --glass-blur: none; --glass: var(--ink-2); }
}
@media (prefers-reduced-transparency: reduce) {
  :root, :root[data-theme] { --glass-bg: var(--ink-2); --glass-bg-strong: var(--ink-2); --glass-bg-accent: var(--ink-2); --glass-blur: none; --glass: var(--ink-2); }
  body::before { background: var(--ink-0); }
  html body * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --lift: none; }
  .u-glass-lift, .u-glass-lift:hover { transform: none; transition: none; }
  html .u-enter { animation: none; }
}
@media (forced-colors: active) {
  body::before { background: Canvas; }
  :is(.u-glass, .u-glass-strong, .u-glass-accent, .u-glass-well) {
    background: Canvas; color: CanvasText; border-color: CanvasText;
    -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
  }
}

/* ------------------------------------------------------------ text helpers */

.u-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.u-label { font-size: var(--t-micro); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--tx-3); }
.u-num { font-variant-numeric: tabular-nums; }
.u-mono { font-family: var(--mono); font-size: .92em; }
.u-kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-hi);
  background: var(--ink-2); color: var(--tx-2); font: 600 11px/1 var(--font); }
.u-evidence { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--tx-3); white-space: nowrap; }
.u-evidence svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------ status: a dot and a word, never colour alone */

.u-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tx-2); white-space: nowrap; line-height: 1; }
.u-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--tx-4); flex: none; position: relative; }
.u-status.plain { text-transform: none; letter-spacing: 0; font-weight: 650; font-size: 12.5px; }
.u-status.s-ok i, .u-status.s-live i, .u-status.s-active i, .u-status.s-streaming i, .u-status.s-healthy i, .u-status.s-ready i, .u-status.s-allowed i { background: var(--ok); }
.u-status.s-ok, .u-status.s-live, .u-status.s-active, .u-status.s-streaming, .u-status.s-healthy, .u-status.s-ready, .u-status.s-allowed { color: var(--ok-hi); }
.u-status.s-waiting i, .u-status.s-idle i, .u-status.s-watch i, .u-status.s-pending i, .u-status.s-medium i { background: var(--warn); }
.u-status.s-waiting, .u-status.s-watch, .u-status.s-pending, .u-status.s-medium { color: var(--warn-hi); }
.u-status.s-idle { color: var(--tx-2); }
.u-status.s-info i, .u-status.s-finished i, .u-status.s-system i, .u-status.s-low i { background: var(--info); }
.u-status.s-info, .u-status.s-system, .u-status.s-low { color: var(--info-hi); }
.u-status.s-finished { color: var(--tx-2); }
.u-status.s-blocked i, .u-status.s-failed i, .u-status.s-revoked i, .u-status.s-elevated i, .u-status.s-high i, .u-status.s-suspended i, .u-status.s-bad i { background: var(--bad); }
.u-status.s-blocked, .u-status.s-failed, .u-status.s-revoked, .u-status.s-elevated, .u-status.s-high, .u-status.s-suspended, .u-status.s-bad { color: var(--bad-hi); }
.u-status.s-unused i, .u-status.s-none i, .u-status.s-off i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tx-3); }
.u-status.s-unused, .u-status.s-none, .u-status.s-off { color: var(--tx-3); }
/* a live thing breathes: a slow halo, never a flash */
.u-status.breathe i::after, .u-breathe::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: currentColor; opacity: 0;
  animation: u-breathe var(--d-breathe) var(--e-in-out) infinite; }
.u-status.breathe i { color: var(--ok); }
@keyframes u-breathe { 0% { transform: scale(.6); opacity: .45; } 70% { transform: scale(1.6); opacity: 0; } 100% { opacity: 0; } }

/* soft badge */
.u-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-chip); font-size: 11.5px; font-weight: 650;
  color: var(--tx-2); background: var(--ink-3); white-space: nowrap; }
.u-badge svg { width: 12px; height: 12px; }
.u-badge.ok { color: var(--ok-hi); background: var(--ok-soft); }
.u-badge.info { color: var(--info-hi); background: var(--info-soft); }
.u-badge.warn { color: var(--warn-hi); background: var(--warn-soft); }
.u-badge.bad { color: var(--bad-hi); background: var(--bad-soft); }
.u-badge.gold { color: var(--accent-tx); background: var(--accent-soft); }
.u-badge.agent { color: var(--agent); background: var(--agent-soft); }
.u-badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-hi); }

/* change against a named period: the arrow and the sign carry it, the colour only agrees */
.u-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--tx-2); white-space: nowrap; }
.u-delta svg { width: 13px; height: 13px; }
.u-delta.good { color: var(--ok-hi); }
.u-delta.bad { color: var(--bad-hi); }

/* ------------------------------------------------------------ avatars */

.u-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: .02em;
  color: var(--accent-tx); background: linear-gradient(140deg, var(--ink-4), var(--ink-2)); border: 1px solid var(--line-hi); }
.u-avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.u-avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.u-avatar.xl { width: 72px; height: 72px; font-size: 22px; }

/* ------------------------------------------------------------ loading, empty, error */

.u-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-4) 45%, var(--ink-3) 90%);
  background-size: 300% 100%; animation: u-shimmer 1.6s linear infinite; }
@keyframes u-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.u-skel.line { height: 12px; margin: 6px 0; }
.u-skel.big { height: 28px; width: 50%; margin: 10px 0 8px; }
.u-skel-rows { display: grid; gap: 14px; padding: 16px 18px; }
.u-skel-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 80px; gap: 12px; align-items: center; }
.u-skel-row .u-skel.dot { width: 34px; height: 34px; border-radius: 50%; }
.u-skel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.u-skel-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; background: var(--ink-1); }

.u-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; color: var(--tx-2); }
.u-state .ic { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--ink-3); color: var(--tx-2); margin-bottom: 4px; }
.u-state .ic svg { width: 20px; height: 20px; }
.u-state h3 { margin: 0; font-size: 16px; font-weight: 680; letter-spacing: -.01em; color: var(--tx-1); }
.u-state p { margin: 0; max-width: 46ch; font-size: 13.5px; }
.u-state .act { margin-top: 8px; }
.u-state.ok .ic { background: var(--ok-soft); color: var(--ok-hi); }
.u-state.bad .ic { background: var(--bad-soft); color: var(--bad-hi); }
.u-state.compact { padding: 22px 16px; }

.u-connecting { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--tx-2); }

/* ------------------------------------------------------------ tooltips */

.u-tip { position: fixed; z-index: var(--z-tip); max-width: 280px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--ink-4); color: var(--tx-1);
  font-size: 12.5px; line-height: 1.45; font-weight: 500; box-shadow: var(--shadow-lg); pointer-events: none; opacity: 0; transform: translateY(2px);
  transition: opacity var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out); border: 1px solid var(--line-hi); }
.u-tip.in { opacity: 1; transform: none; }
.u-tip b { display: block; font-weight: 700; font-size: 13px; }
.u-tip .k { display: flex; align-items: center; gap: 6px; color: var(--tx-2); font-size: 11.5px; }
.u-tip .k i { width: 12px; height: 2px; border-radius: 1px; background: var(--viz-1); }
[data-tip] { cursor: help; }
button[data-tip], a[data-tip] { cursor: pointer; }
.u-info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: var(--radius-chip); color: var(--tx-3); vertical-align: -3px; border: 0; background: none; padding: 0; }
.u-info svg { width: 14px; height: 14px; }
.u-info:hover, .u-info:focus-visible { color: var(--accent-tx); }

/* ------------------------------------------------------------ charts */

.u-chart { position: relative; margin: 0; }
.u-chart svg { display: block; width: 100%; overflow: visible; }
.u-chart .grid line { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.u-chart .axis text { fill: var(--viz-axis); font: 500 10.5px var(--font); font-variant-numeric: tabular-nums; }
.u-chart .col { fill: var(--viz-1); transition: opacity var(--d-fast); }
.u-chart.tone-2 .col { fill: var(--viz-2); }
.u-chart .col.zero { fill: var(--viz-muted); }

/* Glass tube bars (R5): translucent rounded columns, the current one accent-lit with a floating value label.
   Colours live here once; motion is transform and opacity only. */
.u-tubes { --tube-a: rgba(255, 255, 255, .42); --tube-b: rgba(255, 255, 255, .08); --tube-rim: rgba(255, 255, 255, .55); --tube-hi: rgba(255, 255, 255, .55);
  --tube-sel-a: #F7C25A; --tube-sel-b: rgba(190, 110, 22, .62); --pill-bg: #F4EFE8; --pill-tx: #1A1612; }
html[data-theme="light"] .u-tubes { --tube-a: rgba(70, 56, 40, .46); --tube-b: rgba(70, 56, 40, .13); --tube-rim: rgba(70, 56, 40, .64); --tube-hi: rgba(255, 255, 255, .7);
  --tube-sel-a: #A86A06; --tube-sel-b: rgba(120, 66, 8, .78); --pill-bg: #1A1612; --pill-tx: #FBF6EE; }
.u-tubes .tube-a { stop-color: var(--tube-a); } .u-tubes .tube-b { stop-color: var(--tube-b); }
.u-tubes .tube-sel-a { stop-color: var(--tube-sel-a); } .u-tubes .tube-sel-b { stop-color: var(--tube-sel-b); }
.u-chart .u-tubes .col { stroke: var(--tube-rim); stroke-width: 1; }
.u-chart .u-tubes .col.on { stroke: var(--tube-sel-a); }
.u-chart .u-tubes .col-hi { fill: var(--tube-hi); opacity: .55; pointer-events: none; }
.u-tubes .u-pill { pointer-events: none; opacity: 1; }
.u-tubes .u-pill.none { opacity: 0; }
.u-tubes .u-pill.ready { transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1) linear; }
.u-tubes .pill { fill: var(--pill-bg); }
.u-tubes .pill-t { fill: var(--pill-tx); font: 700 11px var(--font); font-variant-numeric: tabular-nums; dominant-baseline: auto; transform: translateY(0); }
.u-tubes.grow .tube { opacity: 0; transform: scaleY(0); transform-origin: 50% 100%; transform-box: fill-box; }
.u-tubes.grow .u-pill { opacity: 0; }
.u-tubes.grow.in .tube { opacity: 1; transform: none; transition: transform 760ms var(--ease-out) calc(var(--i) * 26ms), opacity 360ms linear calc(var(--i) * 26ms); }
.u-tubes.grow.in .u-pill:not(.none) { opacity: 1; transition: transform var(--dur-2) var(--ease-out), opacity 300ms linear 600ms; }
@media (prefers-reduced-motion: reduce) {
  .u-tubes.grow .tube, .u-tubes.grow.in .tube { opacity: 1; transform: none; transition: none; }
  .u-tubes .u-pill.ready, .u-tubes.grow .u-pill, .u-tubes.grow.in .u-pill:not(.none) { transition: none; opacity: 1; }
  .u-tubes .u-pill.none, .u-tubes.grow .u-pill.none { opacity: 0; }
}
.u-chart .hit { fill: transparent; cursor: default; outline: none; }
.u-chart .hit:focus-visible + .col, .u-chart .hit:hover + .col { opacity: .78; }
.u-chart .hit:focus-visible { stroke: var(--focus); stroke-width: 1.5; }
.u-chart .line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.u-chart .area { fill: var(--viz-1); opacity: .1; }
.u-chart.tone-2 .line { stroke: var(--viz-2); }
.u-chart.tone-2 .area { fill: var(--viz-2); }
.u-chart .end { fill: var(--viz-1); stroke: var(--ink-1); stroke-width: 2; }
.u-chart.tone-2 .end { fill: var(--viz-2); }
.u-chart .cross { stroke: var(--tx-3); stroke-width: 1; opacity: 0; shape-rendering: crispEdges; }
.u-chart .cross.on { opacity: .7; }
.u-chart .end-label { fill: var(--tx-1); font: 650 11px var(--font); font-variant-numeric: tabular-nums; }
.u-chart .overlay { fill: transparent; }
.u-chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; }
.u-chart-empty p { margin: 0; max-width: 46ch; }
.u-chart-empty .what { font-size: 15px; font-weight: 600; color: var(--tx-1); }
.u-chart-empty .why { font-size: 11px; color: var(--tx-2); }
.u-chart-empty .btn { margin-top: 8px; }
.u-chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.u-chart-foot button { background: none; border: 0; padding: 0; color: var(--tx-3); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.u-chart-foot button:hover { color: var(--tx-1); }
/* a 24px target (WCAG 2.5.8) without moving the chart: the extra height is taken back by the margins */
.u-chart-foot button { min-height: 24px; margin: -3px 0; }
.u-chart-table { margin-top: 8px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.u-chart-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.u-chart-table th, .u-chart-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.u-chart-table td:last-child, .u-chart-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.u-chart.refreshing { opacity: .55; transition: opacity var(--d-base); }

.u-spark { display: block; width: 100%; height: 28px; overflow: visible; }
.u-spark .line { fill: none; stroke: var(--viz-muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.u-spark .area { fill: var(--viz-1); opacity: .08; }
.u-spark .end { fill: var(--viz-1); stroke: var(--ink-1); stroke-width: 2; }
.u-spark.tone-2 .end { fill: var(--viz-2); }
.u-spark.tone-2 .area { fill: var(--viz-2); }

/* ranked bars: name, value, a thin bar */
.u-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.u-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 18px; }
.u-bars li > a, .u-bars li > .nm { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; font-weight: 600; font-size: 13.5px; }
.u-bars li > a span, .u-bars li > .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-bars li > a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.u-bars .val { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; text-align: right; }
.u-bars .val small { display: block; font-weight: 500; color: var(--tx-3); font-size: 11.5px; }
.u-bars .track { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--ink-3); overflow: hidden; }
.u-bars .track i { display: block; height: 100%; border-radius: 0 2px 2px 0; background: var(--viz-1); }
.u-bars.tone-2 .track i { background: var(--viz-2); }

/* ------------------------------------------------------------ tables: sortable, sticky, cards on phones */

.u-table-wrap { overflow-x: auto; max-width: 100%; }
.u-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.u-pager-range { margin-right: auto; color: var(--tx-2); font-size: 13px; }
.u-table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.u-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.u-table th, .u-table td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.u-table thead th { position: sticky; top: 0; z-index: 1; background: var(--ink-2); font-size: 12px; font-weight: 650; letter-spacing: .01em;
  color: var(--tx-3); white-space: nowrap; }
.u-table th.num, .u-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.u-table th button { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.u-table th button:hover { color: var(--tx-1); }
.u-table th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.u-table th button svg { width: 12px; height: 12px; opacity: 0; }
.u-table th[aria-sort] button { color: var(--tx-1); }
.u-table th[aria-sort] button svg { opacity: 1; }
.u-table th[aria-sort="descending"] button svg { transform: rotate(180deg); }
.u-table tbody tr:last-child td { border-bottom: 0; }
.u-table tbody tr.click { cursor: pointer; }
.u-table tbody tr.click:hover td, .u-table tbody tr.click:focus-within td { background: var(--ink-2); }
.u-table tbody tr.click:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.u-table .sub { display: block; margin-top: 3px; color: var(--tx-3); font-size: 12px; font-weight: 400; line-height: 1.45; }
.u-table td { overflow-wrap: anywhere; }
.u-table tbody tr:hover td { background: var(--ink-2); }
.u-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.u-cell strong { font-weight: 650; }
/* BRIEF 10.10.2: a long table scrolls inside its panel, so the sticky header below has a box to stick to. Phones show cards and print
   shows every row, so the limit is screen and desktop only; a side sheet already scrolls as a whole, and two scrollbars are not allowed. */
@media screen and (min-width: 761px) {
  .u-table-wrap:not(.sheet *, .u-sheet *) { max-height: max(320px, calc(100dvh - 390px)); overflow-y: auto; scroll-padding-top: 48px; }
}
.u-table-more { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; }

@media (max-width: 760px) {
  .u-table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .u-table.cards, .u-table.cards tbody, .u-table.cards tr, .u-table.cards td { display: block; width: 100%; }
  .u-table.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .u-table.cards td { border: 0; padding: 5px 0; text-align: left !important; display: grid; grid-template-columns: minmax(88px, .8fr) minmax(0, 1.2fr); gap: 12px; white-space: normal; }
  .u-table.cards td > * { min-width: 0; }
  .u-table.cards td.num { font-variant-numeric: tabular-nums; }
  .u-table.cards .u-status { white-space: normal; line-height: 1.4; }
  .u-table.cards tr:hover td { background: none; }
  .u-table.cards td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 550; color: var(--tx-3); padding-top: 2px; }
  .u-table.cards td.lead { display: block; padding-bottom: 6px; }
  .u-table.cards td.lead::before { display: none; }
  /* a quiet button that names the row wraps on phones instead of widening the card, and sits flush with the labels below */
  .u-table.cards td.lead > .btn:is(.quiet, .btn--quiet, .btn--ghost) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; justify-content: flex-start;
    padding: 6px 0; line-height: 1.35; min-height: 44px; height: auto; }
  .u-table.cards td.hide-sm { display: none; }
}

/* ------------------------------------------------------------ glass lists: panel, search pill, progress, favourite */

.u-list { overflow: hidden; }
/* The panel is large and its rows change, so a live backdrop blur here was repainted on every hover and filter (software p95 100-683 ms,
   against 33-67 ms with it off). A denser tint carries the glass look instead; rim, highlight and shadow come from .u-glass-strong. */
.u-list { --list-bg: rgba(22, 19, 17, .86); --list-head: #161311; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--list-bg); }
:root[data-theme="light"] .u-list { --list-bg: rgba(250, 247, 242, .94); --list-head: #FAF7F2; }
@media (prefers-reduced-transparency: reduce) { .u-list, :root[data-theme="light"] .u-list { --list-bg: var(--ink-2); --list-head: var(--ink-2); } }
.u-list > header { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--glass-rim); }
.u-list-title h2 { margin: 0; font-size: 16px; font-weight: 680; letter-spacing: -.01em; color: var(--tx-1); }
.u-list-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--tx-2); }
.u-list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; margin-left: auto; }
.u-search { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-control); background: var(--glass-bg-strong);
  border: 1px solid var(--glass-rim); box-shadow: var(--glass-highlight); color: var(--tx-2); min-width: 0; transition: border-color var(--dur-1) var(--ease-out); }
.u-search:hover { border-color: var(--glass-rim-hover); }
.u-search:focus-within { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; }
.u-search svg { width: 15px; height: 15px; flex: none; }
.u-search input[type="search"] { all: unset; box-sizing: border-box; width: 190px; min-width: 0; height: auto; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 13px; color: var(--tx-1); }
.u-search input[type="search"]::placeholder { color: var(--tx-3); opacity: 1; }
.u-search input[type="search"]:focus-visible { outline: 0; box-shadow: none; border: 0; }
.u-search input::-webkit-search-cancel-button { appearance: none; }

/* The table inside a glass list: translucent, hairline rows, no blur on any row. */
.u-list .u-table thead th { background: var(--list-head); color: var(--tx-2); padding-top: 12px; padding-bottom: 10px; }
.u-list .u-table th, .u-list .u-table td { border-bottom-color: var(--glass-rim); }
.u-list .u-table td { color: var(--tx-1); }
.u-list .u-table td:has(> .u-star) { width: 1%; padding-right: 0; }
.u-list .u-table .sub { color: var(--tx-2); }
.u-list .u-table tbody tr:hover td, .u-list .u-table tbody tr.click:hover td, .u-list .u-table tbody tr.click:focus-within td { background: var(--glass-row-hover, rgba(255, 255, 255, .06)); }
:root[data-theme="light"] .u-list .u-table tbody tr:hover td { background: rgba(255, 255, 255, .55); }
.u-list .u-table-more { border-top-color: var(--glass-rim); }
.u-list .u-table.cards tr { border-bottom-color: var(--glass-rim); }

.u-progress { display: inline-flex; align-items: center; gap: 10px; min-width: 120px; width: 100%; max-width: 220px; }
.u-progress .bar { position: relative; flex: 1 1 auto; height: 6px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .18); }
:root[data-theme="light"] .u-progress .bar { background: rgba(70, 56, 40, .14); }
:root[data-theme="light"] .u-progress .bar i { background: linear-gradient(90deg, #8A600C, #A26F0F); }
:root[data-theme="light"] .u-progress.tone-2 .bar i { background: var(--viz-2); }
.u-progress .bar i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--viz-1), var(--accent)); transform-origin: left center;
  transform: scaleX(var(--p, 0)); animation: u-fill var(--dur-3) var(--ease-out) both; }
.u-progress.tone-2 .bar i { background: var(--viz-2); }
.u-progress .v { flex: none; min-width: 3.2ch; text-align: right; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--tx-1); }
@keyframes u-fill { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .u-progress .bar i { animation: none; } }

.u-star { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-control-sm); cursor: pointer; color: var(--tx-3);
  transition: color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out); }
.u-star svg { width: 17px; height: 17px; }
.u-star:hover { color: var(--tx-1); background: var(--glass-rim); }
.u-star:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.u-star[aria-pressed="true"] { color: var(--accent-tx); }
.u-star[aria-pressed="true"] svg { fill: currentColor; }
@media (pointer: coarse) { .u-star { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .u-star { transition: none; } }

@media (max-width: 760px) {
  .u-list > header { padding: 14px 16px; }
  .u-list-tools { margin-left: 0; width: 100%; }
  .u-list-tools .u-seg { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .u-list-tools .u-seg button { flex: 0 0 auto; white-space: nowrap; }
  .u-search { width: 100%; }
  .u-search input[type="search"] { width: 100%; }
  .u-progress { max-width: none; }
  /* in card mode the favourite sits in the card's top-right corner instead of taking a row */
  .u-list .u-table.cards tr { position: relative; }
  .u-list .u-table.cards td:has(> .u-star) { position: absolute; top: 6px; right: 8px; display: block; width: auto; padding: 0; }
}

/* ------------------------------------------------------------ the time machine */

.u-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.u-seg::-webkit-scrollbar { display: none; }
.u-seg { scrollbar-width: none; }
/* Filter pills: a glass track, the pressed pill lighter. Tint only, no blur of their own. */
.u-seg { --seg-on: rgba(255, 255, 255, .10); --seg-on-rim: rgba(255, 255, 255, .5);
  display: inline-flex; min-width: 0; padding: 3px; gap: 2px; background: var(--glass-bg-strong); border: 1px solid var(--glass-rim); border-radius: var(--radius-tabbar);
  box-shadow: var(--glass-highlight); max-width: 100%; overflow-x: auto; }
:root[data-theme="light"] .u-seg { --seg-on: rgba(255, 255, 255, .95); --seg-on-rim: rgba(120, 86, 15, .38); }
.u-seg button { border: 1px solid transparent; background: none; padding: 5px 13px; min-height: 30px; border-radius: var(--radius-tab); font-weight: 600; font-size: 12.5px; color: var(--tx-2); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.u-seg button:hover { color: var(--tx-1); }
.u-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.u-seg button[aria-pressed="true"] { background: var(--seg-on); border-color: var(--seg-on-rim); color: var(--tx-1); box-shadow: var(--glass-highlight); }
.u-seg button .n { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11.5px; color: var(--tx-3); }
.u-seg button[aria-pressed="true"] .n { color: var(--tx-2); }
@media (max-width: 640px) {
  .u-seg { flex-wrap: wrap; overflow: visible; }
  .u-seg button { flex: 1 0 auto; min-height: 36px; max-width: 100%; white-space: normal; }
}
@media (pointer: coarse) { .u-seg button { min-height: 40px; } }
@media (prefers-reduced-motion: reduce) { .u-seg button { transition: none; } }
@media (forced-colors: active) {
  .u-seg, .u-seg button { border-color: CanvasText; }
  .u-seg button[aria-pressed="true"] { background: Highlight; color: HighlightText; }
}

.u-range .custom { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx-2); }
.u-range .custom input { min-height: 32px; padding: 3px 8px; width: auto; font-size: 12.5px; }
.u-range .tz { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--tx-3); }
.u-range .tz svg { width: 14px; height: 14px; }
.u-range .tz select { min-height: 30px; padding: 2px 26px 2px 8px; font-size: 12px; width: auto; background-color: var(--ink-2); }

/* ------------------------------------------------------------ command menu (Ctrl+K) */

.u-cmd-scrim { position: fixed; inset: 0; z-index: var(--z-cmd); background: var(--scrim); backdrop-filter: blur(3px); display: flex; justify-content: center;
  align-items: flex-start; padding: min(14vh, 120px) 16px 16px; opacity: 0; transition: opacity var(--d-base) var(--e-out); }
.u-cmd-scrim.in { opacity: 1; }
.u-cmd { width: min(640px, 100%); max-height: min(70vh, 620px); display: flex; flex-direction: column; background: var(--ink-1); border: 1px solid var(--line-hi);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(-6px) scale(.985); transition: transform var(--d-base) var(--e-out); }
.u-cmd-scrim.in .u-cmd { transform: none; }
.u-cmd-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.u-cmd-input svg { width: 18px; height: 18px; color: var(--tx-3); flex: none; }
.u-cmd-input input { flex: 1; min-height: 56px; border: 0 !important; background: none !important; box-shadow: none !important; font-size: 16px; padding: 0 !important; outline: none; }
.u-cmd-list { overflow-y: auto; padding: 6px; }
.u-cmd-group { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--tx-3); }
.u-cmd-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; }
.u-cmd-item .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ink-3); color: var(--tx-2); }
.u-cmd-item .ic svg { width: 16px; height: 16px; }
.u-cmd-item .t { min-width: 0; }
.u-cmd-item .t b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-cmd-item .t span { display: block; color: var(--tx-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-cmd-item .hint { color: var(--tx-3); font-size: 11.5px; }
.u-cmd-item[aria-selected="true"] { background: var(--ink-3); }
.u-cmd-item[aria-selected="true"] .ic { background: var(--accent-soft); color: var(--accent-tx); }
.u-cmd-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--tx-3); font-size: 11.5px; background: var(--ink-2); }
.u-cmd-foot span { display: inline-flex; align-items: center; gap: 5px; }
.u-cmd-empty { padding: 28px 16px; text-align: center; color: var(--tx-3); font-size: 13.5px; }

/* ------------------------------------------------------------ entering things */

.u-enter { animation: u-enter var(--d-slow) var(--e-out) both; }
@keyframes u-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.u-flash { animation: u-flash 2.4s var(--e-out); }
@keyframes u-flash { from { background-color: var(--accent-soft); } to { background-color: transparent; } }

@media (forced-colors: active) {
  .u-status i, .u-chart .col, .u-bars .track i { forced-color-adjust: none; }
  .u-badge { border: 1px solid CanvasText; }
}

/* SUI.donut — BRIEF 10.7 / dashboard-02: ring at the left, legend at the right. Colours are the reference's five. */
/* The legend keeps to 280px beside the ring, as in the reference, so on a full-width panel a count stays next to its
   name instead of at the far edge (Probe D2, 1440). */
.u-donut { --donut-orange: #F7AE62; display: grid; grid-template-columns: 146px minmax(0, 280px); justify-content: start; column-gap: clamp(20px, 7vw, 96px); align-items: center; padding: 10px 18px 31px 50px; }
.u-donut .ring { position: relative; width: 146px; height: 146px; }
.u-donut svg { display: block; width: 146px; height: 146px; }
.u-donut .mid { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 1px; }
.u-donut .mid small { font-size: 9px; line-height: 12px; color: var(--tx-2); }
.u-donut .mid b { font-size: 20px; line-height: 24px; font-weight: 700; color: var(--tx-1); font-variant-numeric: tabular-nums; }
.u-donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; min-width: 0; align-self: center; }
.u-donut li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 24px; font-size: 11px; }
.u-donut li i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.u-donut li a, .u-donut li .nm { min-width: 0; color: var(--tx-1); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-donut li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.u-donut li .val { color: var(--tx-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* BRIEF 10.1.3: lift the dark orange to the reference amber so arc and dot clear 3:1 over the room glass. */
.u-donut .t1 { stroke: var(--donut-orange); color: var(--donut-orange); } .u-donut .t2 { stroke: #45B4EE; color: #45B4EE; } .u-donut .t3 { stroke: #F3CF3F; color: #F3CF3F; }
.u-donut .t4 { stroke: #EE5C7C; color: #EE5C7C; } .u-donut .t5 { stroke: #3FCB8B; color: #3FCB8B; } .u-donut .t0 { stroke: var(--viz-muted); color: var(--viz-muted); }
/* Light: the reference has no light still, and its bright arcs fall under 3:1 on porcelain (the yellow measured 1.44:1 on
   #FCF8F2). Each hue is kept and darkened until arc and legend dot reach 3:1 there: 3.50, 3.38, 3.39, 3.80, 3.40, 3.5. */
html[data-theme="light"] .u-donut .t1 { stroke: #DB5F1F; color: #DB5F1F; } html[data-theme="light"] .u-donut .t2 { stroke: #1C8FCF; color: #1C8FCF; }
html[data-theme="light"] .u-donut .t3 { stroke: #A88200; color: #A88200; } html[data-theme="light"] .u-donut .t4 { stroke: #E0456A; color: #E0456A; }
html[data-theme="light"] .u-donut .t5 { stroke: #1A9A62; color: #1A9A62; } html[data-theme="light"] .u-donut .t0 { stroke: #8A8378; color: #8A8378; }
@media (max-width: 720px) { .u-donut { grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; padding-left: 18px; } .u-donut .ring, .u-donut svg { width: 112px; height: 112px; } }

/* One scrollbar everywhere (BRIEF 10.10.4): an 8px thumb, radius 4, set 2px in from the edge of a clear track.
   Chrome ignores ::-webkit-scrollbar once scrollbar-color is set, so the standard properties are for Firefox only. */
/* scrollbar-gutter: stable is set where a box scrolls up and down inside a page (the console rail's list). It is not set on
   html: a held gutter there moves the right-hand controls 12px off the measured 1440 frame. */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; } }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 6px; background: var(--scroll-thumb); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }

/* The control kit (BRIEF 10.10 point 5). Dropdown select: a box trigger, and a panel that opens under it. */
.u-select { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; margin: 0; padding: 0 10px 0 12px;
  border: 1px solid var(--glass-rim); border-radius: var(--radius-control); background: var(--glass-bg-strong); color: var(--tx-1);
  font: 600 13px/1.2 var(--font); text-align: left; cursor: pointer; }
.u-select.sm { min-height: 30px; }
.u-select svg { flex: none; width: 16px; height: 16px; }
.u-select .v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-select .v.ph { color: var(--tx-2); font-weight: 500; }
.u-select .chev { color: var(--tx-2); transition: transform .16s ease; }
.u-select[aria-expanded="true"] .chev { transform: rotate(180deg); }
.u-select:hover:not(:disabled), .u-select[aria-expanded="true"] { border-color: var(--line-hi); }
.u-select:active:not(:disabled) { transform: translateY(1px); }
.u-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.u-select:disabled { opacity: .45; cursor: not-allowed; }
.u-pop { position: fixed; z-index: calc(var(--z-cmd) + 5); display: flex; flex-direction: column; box-sizing: border-box; max-width: calc(100vw - 16px);
  max-height: min(360px, calc(100vh - 16px)); padding: 6px; border: 1px solid var(--glass-rim); border-radius: 12px; background: var(--ink-2); color: var(--tx-1);
  box-shadow: var(--glass-shadow); animation: u-pop-in .12s ease-out; }
.u-pop.up { animation-name: u-pop-up; }
@keyframes u-pop-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes u-pop-up { from { opacity: 0; transform: translateY(4px); } }
.u-pop-list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; outline: 0; }
.u-pop-list li { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 10px; box-sizing: border-box; border-radius: var(--radius-control-sm);
  font: 500 13px/1.3 var(--font); cursor: pointer; }
.u-pop-list li .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-pop-list li small { display: block; color: var(--tx-2); font-size: 11.5px; font-weight: 400; }
.u-pop-list li.on { background: var(--ink-3); }
.u-pop-list:focus-visible li.on, .u-pop-find:focus-within ~ .u-pop-list li.on { box-shadow: inset 0 0 0 2px var(--focus); }
.u-pop-list li[aria-selected="true"] { font-weight: 600; }
.u-pop-list li[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.u-pop-list .tick { flex: none; width: 16px; height: 16px; }
.u-pop-find { display: flex; align-items: center; gap: 8px; flex: none; min-height: 36px; margin: 0 0 6px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-control-sm); color: var(--tx-2); }
.u-pop-find:focus-within { border-color: var(--focus); }
.u-pop-find svg { flex: none; width: 15px; height: 15px; }
.u-pop .u-pop-search { flex: 1 1 auto; min-width: 0; width: auto; min-height: 0; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; outline: 0; color: var(--tx-1); font: 500 13px/1.2 var(--font); }
.u-pop-empty { margin: 0; padding: 10px; color: var(--tx-2); font-size: 13px; }
.u-pop-empty[hidden] { display: none; }
/* the More button and its menu (SUI.menuButton, SUI.menu) */
.u-more { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; box-sizing: border-box; width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-control-sm); background: transparent; color: var(--tx-2); font: 600 13px/1 var(--font); cursor: pointer; }
.u-more.sm { width: 30px; height: 30px; }
.u-more.worded { width: auto; padding: 0 10px 0 12px; border-color: var(--line); color: var(--tx-1); }
.u-more svg { flex: none; width: 18px; height: 18px; stroke-width: 2.6; }
.u-more[aria-expanded="true"] { background: var(--btn-fill); border-color: var(--btn-rim-hi); color: var(--tx-1); }
.u-more.worded:hover:not(:disabled) { background: var(--btn-fill); border-color: var(--btn-rim-hi); color: var(--tx-1); }
.u-more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.u-more:disabled { opacity: .4; cursor: not-allowed; }
.u-menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.u-menu [role="menuitem"] { display: flex; align-items: center; gap: 10px; flex: none; box-sizing: border-box; width: 100%; min-height: 36px; padding: 4px 10px; border: 0;
  border-radius: var(--radius-control-sm); background: transparent; color: var(--tx-1); font: 500 13.5px/1.25 var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.u-menu [role="menuitem"] svg { flex: none; width: 16px; height: 16px; color: var(--tx-2); }
.u-menu [role="menuitem"] .t { flex: 1 1 auto; min-width: 0; }
.u-menu [role="menuitem"] small { display: block; color: var(--tx-2); font-size: 11.5px; font-weight: 400; }
.u-menu [role="menuitem"]:focus { background: var(--ink-3); outline: 0; }
.u-menu [role="menuitem"]:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.u-menu [role="menuitem"].danger, .u-menu [role="menuitem"].danger svg { color: var(--bad-hi); }
.u-menu [role="menuitem"].danger:focus { background: var(--bad-soft); }
.u-menu [role="menuitem"][aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.u-menu hr { flex: none; width: auto; height: 1px; margin: 6px 4px; border: 0; background: var(--line); }
/* the split button (SUI.splitButton): one box, the action on the left and its variants behind the chevron */
.u-split { position: relative; isolation: isolate; display: inline-flex; align-items: stretch; flex: none; height: 36px; border-radius: var(--radius-control); }
.u-split.sm { height: 30px; border-radius: var(--radius-control-sm); }
.u-split button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; margin: 0; border: 1px solid var(--btn-rim);
  background: transparent; color: var(--tx-1); font: 600 13px/1 var(--font); white-space: nowrap; cursor: pointer; }
.u-split-main { padding: 0 14px; border-radius: var(--radius-control) 0 0 var(--radius-control); }
.u-split .u-split-more { width: 34px; padding: 0; border-left: 0; border-radius: 0 var(--radius-control) var(--radius-control) 0; }
.u-split.sm .u-split-main { padding: 0 11px; font-size: 12px; border-radius: var(--radius-control-sm) 0 0 var(--radius-control-sm); }
.u-split.sm .u-split-more { width: 30px; border-radius: 0 var(--radius-control-sm) var(--radius-control-sm) 0; }
.u-split svg { flex: none; width: 15px; height: 15px; }
.u-split .chev { transition: transform .16s ease; }
.u-split-more[aria-expanded="true"] .chev { transform: rotate(180deg); }
.u-split button:hover:not(:disabled), .u-split-more[aria-expanded="true"] { background: var(--btn-fill); }
.u-split button:active:not(:disabled) { transform: translateY(1px); }
.u-split button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--focus); outline-offset: 2px; }
.u-split button:disabled { opacity: .4; cursor: not-allowed; }
/* Primary: the two halves are one surface, the accent sweeps across both, a 1px line divides them (BRIEF 10.10.6). */
.u-split.primary { background: var(--btn-solid); }
.u-split.primary::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--btn-sweep); transform: scaleX(0); transform-origin: left center; transition: transform var(--d-base) var(--e-out); }
.u-split.primary:has(button:focus-visible)::after, .u-split.primary:has([aria-expanded="true"])::after, .u-split.primary.is-hover::after { transform: scaleX(1); }
@media (hover: hover) { .u-split.primary:hover::after { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .u-split.primary::after { transition: none; } }
.u-split.primary button, .u-split.primary button:hover:not(:disabled), .u-split.primary .u-split-more[aria-expanded="true"] { border-color: transparent; background: transparent; color: var(--btn-on-solid); }
.u-split.primary .u-split-more { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--btn-on-solid) 30%, transparent); }
/* the filter bar (SUI.filterBar): search, up to three dropdown filters, "More filters", and the active ones as chips underneath */
.u-filter { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.u-filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.u-filter .u-select.set { border-color: var(--accent); }
.u-filter-more { display: inline-flex; align-items: center; gap: 6px; flex: none; box-sizing: border-box; min-height: 36px; padding: 0 8px 0 10px; border: 1px solid transparent;
  border-radius: var(--radius-control); background: transparent; color: var(--tx-2); font: 600 13px/1 var(--font); white-space: nowrap; cursor: pointer; }
.u-filter-more svg { flex: none; width: 16px; height: 16px; transition: transform .16s ease; }
.u-filter-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.u-filter-more:hover, .u-filter-more[aria-expanded="true"] { background: var(--ink-3); color: var(--tx-1); }
.u-filter-more:focus-visible, .u-chip:focus-visible, .u-chip-clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.u-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.u-chips[hidden] { display: none; }
.u-chip { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; max-width: 100%; min-height: 28px; padding: 0 6px 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-chip); background: var(--ink-2); color: var(--tx-1); font: 500 12.5px/1 var(--font); cursor: pointer; }
.u-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.u-chip svg { flex: none; width: 14px; height: 14px; color: var(--tx-2); }
.u-chip:hover { border-color: var(--line-hi); background: var(--ink-3); }
.u-chip:hover svg { color: var(--tx-1); }
.u-chip-clear { min-height: 28px; padding: 0 6px; border: 0; border-radius: var(--radius-chip); background: transparent; color: var(--tx-2); font: 600 12.5px/1 var(--font);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.u-chip-clear:hover { color: var(--tx-1); }
/* the side sheet (SUI.sheet): slides in from the right over a scrim; the header and footer stay put, the body scrolls */
.u-sheet-scrim { position: fixed; inset: 0; z-index: var(--z-sheet); background: var(--scrim); opacity: 0; transition: opacity .18s ease-out; }
.u-sheet-scrim.in { opacity: 1; }
.u-sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-sheet) + 1); display: flex; flex-direction: column; box-sizing: border-box; width: 480px; max-width: 100vw;
  border-left: 1px solid var(--glass-rim); background: var(--ink-1); color: var(--tx-1); box-shadow: var(--glass-shadow); outline: 0;
  transform: translateX(100%); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.u-sheet.in { transform: none; }
.u-sheet-head { display: flex; align-items: flex-start; gap: 12px; flex: none; padding: 20px 16px 16px 24px; border-bottom: 1px solid var(--line); }
.u-sheet-head > div { flex: 1 1 auto; min-width: 0; }
.u-sheet-head h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
.u-sheet-head p { margin: 4px 0 0; color: var(--tx-2); font-size: 13px; line-height: 1.45; }
.u-sheet-x { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid transparent;
  border-radius: var(--radius-control-sm); background: transparent; color: var(--tx-2); cursor: pointer; }
.u-sheet-x svg { width: 18px; height: 18px; }
.u-sheet-x:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.u-sheet-x:disabled { opacity: .45; cursor: not-allowed; }
.u-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; }
.u-sheet-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; flex: none; padding: 14px 24px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--ink-1); }
.u-sheet-ask { flex: 1 1 auto; margin: 0; font-size: 13.5px; font-weight: 600; }
@media (max-width: 640px) {   /* on phones the panel is a sheet along the bottom, with 44px rows */
  .u-select, .u-select.sm { min-height: 44px; }
  .u-pop { left: 8px; right: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); max-height: 70vh; border-radius: 16px;
    box-shadow: 0 0 0 100vmax var(--scrim); animation-name: u-pop-up; }
  .u-pop-list li { min-height: 44px; }
  .u-menu [role="menuitem"] { min-height: 44px; }
  .u-more, .u-more.sm, .u-table.cards td > .u-more { min-width: 44px; height: 44px; }   /* td > * would otherwise zero the minimum */
  .u-table th button { min-height: 44px; }
  .u-table.cards td.lead .u-cell { min-height: 44px; }
  .u-table.cards td.lead .u-cell a { display: inline-flex; align-items: center; min-height: 44px; }
  .u-pager .btn, .u-pager .btn.small { min-height: 44px; height: 44px; }
  .u-split, .u-split.sm { height: 44px; }
  .u-filter-row .u-search { flex: 1 1 100%; min-height: 44px; }
  .u-filter-row .u-search input[type="search"] { width: 100%; }
  .u-filter-row .u-select { flex: 1 1 140px; min-height: 44px; }
  .u-filter-more { min-height: 44px; }
  .u-chip, .u-chip-clear { min-height: 44px; }
  .u-sheet { width: 100vw; border-left: 0; }
  .u-sheet-head { padding-left: 16px; }
  .u-sheet-body { padding: 16px; }
  .u-sheet-foot { padding-left: 16px; padding-right: 16px; }
  .u-sheet-foot .btn, .u-sheet-x { min-height: 44px; }
  .u-sheet-x { width: 44px; height: 44px; }
  .u-split .u-split-more, .u-split.sm .u-split-more { width: 44px; }
  .u-pop-find { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .u-pop { animation: none; } .u-select .chev, .u-split .chev, .u-filter-more svg, .u-sheet, .u-sheet-scrim { transition: none; } }
