/* SYGNAL admin kit (S2): tokens and components.
 *
 * Source of truth for every value: the approved design (docs/admin-redesign:
 * artboards/Kit.dc.html, kit-helmet.html, design-spec.json visualSystem).
 *
 * Rules for this file:
 *   - Everything is prefixed: tokens --ui-*, classes ui-*. The legacy console
 *     already has .btn, .badge, .nav-item, .tab and --muted/--line/--bg with
 *     other values, and legacy markup is never renamed.
 *   - Mobile-first: the base rules are the phone (< 768 px); then
 *     @media (min-width: 768px), (min-width: 1024px), (min-width: 1280px).
 *   - Element-level rules only in the S3 block near the end (html, body and
 *     the controls' font). A component still sets its own font, margins and
 *     box model, because it may sit inside legacy markup with its own rules.
 *   - Every target is at least 44 x 44 px. Inputs are 16 px below 768 px so
 *     iOS never zooms.
 *   - States are drawn by the real selector and by [data-force="hover" |
 *     "pressed" | "focus"], which the component sheet (/kit.html) uses to show
 *     a state without an inline style. One rule per state, never two copies.
 */

/* ── Inter (OFL-1.1), self-hosted ─────────────────────────────────────────
 * From @fontsource/inter 5.3.0 (npm, shasum 866278dc2357659f8be1755c8b67f29d3697b440),
 * latin subset, files/inter-latin-{400,500,600,700}-normal.woff2, byte for byte.
 * Licence: /fonts/OFL.txt. No third-party request. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Colour (design-spec visualSystem.colors; ratios are checked by admin_tests/unit/contrast.test.mjs) */
  --ui-ink: #0F1B2D;
  --ui-slate: #4A5568;
  --ui-muted: #5B6778;
  --ui-line: #E3E8EF;
  --ui-line-strong: #C9D1DC;
  --ui-input: #7B8798;
  --ui-bg: #F4F6F9;
  --ui-surface: #FFFFFF;
  --ui-surface-2: #F8FAFC;
  --ui-on-fill: #FFFFFF;
  --ui-brand: #2D5FAF;
  --ui-brand-700: #1A3D7A;
  --ui-brand-800: #15325F;
  --ui-brand-50: #EEF3FB;
  --ui-focus: #3B82F6;
  --ui-success: #15803D;
  --ui-success-50: #F0FDF4;
  --ui-warning: #B45309;
  --ui-warning-50: #FFFBEB;
  --ui-danger: #B91C1C;
  --ui-danger-50: #FEF2F2;
  --ui-danger-line: #F1B5B5;
  --ui-danger-600: #DC2626;
  --ui-danger-800: #991B1B;
  --ui-chart-1: #2D5FAF;
  --ui-chart-2: #EB6834;
  --ui-chart-3: #0E9384;
  --ui-seq-100: #CDE2FB;
  --ui-seq-700: #104281;
  --ui-toast-action: #9EC5F4;
  --ui-overlay: rgba(15, 27, 45, 0.48);

  /* Radius: only these six values */
  --ui-radius-control: 10px;
  --ui-radius-pop: 12px;
  --ui-radius-card: 14px;
  --ui-radius-dialog: 16px;
  --ui-radius-sheet: 20px;
  --ui-radius-pill: 999px;

  /* Elevation (level 2 is a border plus this hairline once content scrolls under) */
  --ui-shadow-1: 0 1px 2px rgba(15, 27, 45, 0.06);
  --ui-shadow-1-hover: 0 6px 16px rgba(15, 27, 45, 0.10);
  --ui-shadow-2: 0 1px 0 #E3E8EF;
  --ui-shadow-3: 0 12px 32px rgba(15, 27, 45, 0.18);
  --ui-shadow-4: 0 24px 64px rgba(15, 27, 45, 0.28);

  /* Space: 4 px base */
  --ui-space-4: 4px;
  --ui-space-8: 8px;
  --ui-space-12: 12px;
  --ui-space-16: 16px;
  --ui-space-20: 20px;
  --ui-space-24: 24px;
  --ui-space-32: 32px;
  --ui-space-40: 40px;
  --ui-space-48: 48px;
  --ui-space-64: 64px;

  /* Layout, phone first (retuned at 768 / 1280 below) */
  --ui-page-pad: 16px;
  --ui-gap: 12px;
  --ui-section-gap: 24px;
  --ui-card-pad: 16px;
  --ui-target: 44px;
  /* Height of the bottom tab bar; 0 outside the console (the S3 block below sets it). Toasts clear it. */
  --ui-bottom-bar-h: 0px;
  --ui-safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Type */
  --ui-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ui-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ui-input-size: 16px;
  --ui-input-line: 24px;
}
@media (min-width: 768px) {
  :root { --ui-page-pad: 24px; --ui-gap: 20px; --ui-section-gap: 32px; --ui-card-pad: 20px; --ui-input-size: 15px; --ui-input-line: 22px; }
}
@media (min-width: 1280px) {
  :root { --ui-page-pad: 32px; --ui-gap: 24px; --ui-section-gap: 40px; }
}

/* Every kit element sizes by its border box (the legacy reset does this in
   index.html; /kit.html has no reset). Attribute selectors, not element rules. */
[class^="ui-"], [class*=" ui-"],
[class^="ui-"]::before, [class*=" ui-"]::before,
[class^="ui-"]::after, [class*=" ui-"]::after { box-sizing: border-box; }

/* A page built only from the kit (today: /kit.html). */
.ui-page {
  margin: 0;
  min-height: 100vh;
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.ui-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Type scale ─────────────────────────────────────────────────────────── */
.ui-display { margin: 0; font-family: var(--ui-font); font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ui-h1 { margin: 0; font-family: var(--ui-font); font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; }
.ui-h2 { margin: 0; font-family: var(--ui-font); font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.005em; }
.ui-h3 { margin: 0; font-family: var(--ui-font); font-size: 16px; line-height: 24px; font-weight: 600; }
.ui-body { margin: 0; font-size: 15px; line-height: 22px; font-weight: 400; }
.ui-body-strong { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.ui-small { margin: 0; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ui-muted); }
.ui-slate { color: var(--ui-slate); }
.ui-num { font-variant-numeric: tabular-nums; }
.ui-mono { font-family: var(--ui-font-mono); font-size: 14px; line-height: 20px; }
@media (min-width: 768px) {
  .ui-display { font-size: 40px; line-height: 44px; }
  .ui-h1 { font-size: 28px; line-height: 34px; }
  .ui-h2 { font-size: 20px; line-height: 28px; }
}

/* ── Icons (Lucide sprite /icons.svg) ───────────────────────────────────── */
.ui-i { display: inline-block; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; overflow: visible; }
.ui-i--14 { width: 14px; height: 14px; stroke-width: 2; }
.ui-i--16 { width: 16px; height: 16px; }
.ui-i--18 { width: 18px; height: 18px; }
.ui-i--22 { width: 22px; height: 22px; }
.ui-i--24 { width: 24px; height: 24px; }
.ui-i--28 { width: 28px; height: 28px; }
.ui-i--40 { width: 40px; height: 40px; stroke-width: 1.5; }

/* ── Focus: one ring everywhere ─────────────────────────────────────────── */
.ui-btn:focus-visible, .ui-chip:focus-visible, .ui-seg__opt:focus-visible, .ui-tab:focus-visible,
.ui-tile:focus-visible, .ui-menu-row:focus-visible, .ui-switch:focus-visible, .ui-check:focus-visible,
.ui-row-link:focus-visible, .ui-toast__close:focus-visible,
.ui-btn[data-force~="focus"], .ui-chip[data-force~="focus"], .ui-tile[data-force~="focus"] {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}

/* ── Buttons: six kinds, three sizes ────────────────────────────────────── */
.ui-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 44px;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 1.5px solid transparent;
  border-radius: var(--ui-radius-control);
  background: transparent;
  box-shadow: none;
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.ui-btn--md { min-height: 44px; }
.ui-btn--lg { min-height: 52px; padding: 0 24px; font-size: 16px; line-height: 24px; }
.ui-btn--row { padding: 0 14px; font-size: 14px; line-height: 20px; }
.ui-btn--block { display: flex; width: 100%; }
.ui-btn--wrap { white-space: normal; padding-top: 8px; padding-bottom: 8px; }
.ui-btn--split { gap: 6px; padding: 0 12px 0 14px; }

.ui-btn--primary { background: var(--ui-brand); color: var(--ui-on-fill); }
.ui-btn--primary[data-force~="hover"] { background: var(--ui-brand-700); color: var(--ui-on-fill); }

.ui-btn--secondary { background: var(--ui-surface); border-color: var(--ui-line-strong); color: var(--ui-ink); }
.ui-btn--secondary[data-force~="hover"] { background: var(--ui-bg); border-color: var(--ui-brand); color: var(--ui-ink); }

.ui-btn--tertiary { padding: 0 12px; background: transparent; color: var(--ui-brand); }
.ui-btn--tertiary[data-force~="hover"] { background: var(--ui-brand-50); color: var(--ui-brand); }

.ui-btn--danger { background: var(--ui-surface); border-color: var(--ui-danger-line); color: var(--ui-danger); }
.ui-btn--danger[data-force~="hover"] { background: var(--ui-danger-50); border-color: var(--ui-danger); color: var(--ui-danger); }

.ui-btn--danger-solid { background: var(--ui-danger-600); color: var(--ui-on-fill); }
.ui-btn--danger-solid[data-force~="hover"] { background: var(--ui-danger); color: var(--ui-on-fill); }

.ui-btn--icon { width: 44px; height: 44px; padding: 0; background: transparent; border-color: transparent; color: var(--ui-slate); }
.ui-btn--icon[data-force~="hover"] { background: var(--ui-bg); color: var(--ui-ink); }

@media (hover: hover) {
  .ui-btn--primary:hover { background: var(--ui-brand-700); color: var(--ui-on-fill); }
  .ui-btn--secondary:hover { background: var(--ui-bg); border-color: var(--ui-brand); color: var(--ui-ink); }
  .ui-btn--tertiary:hover { background: var(--ui-brand-50); color: var(--ui-brand); }
  .ui-btn--danger:hover { background: var(--ui-danger-50); border-color: var(--ui-danger); color: var(--ui-danger); }
  .ui-btn--danger-solid:hover { background: var(--ui-danger); color: var(--ui-on-fill); }
  .ui-btn--icon:hover { background: var(--ui-bg); color: var(--ui-ink); }
}

/* Pressed and toggled come AFTER hover (same specificity, so source order
   decides): a button held down under a mouse shows Pressed, not Hover, and an
   open More button keeps its tint while the pointer is still on it — as the
   approved kit draws them (artboards/Kit.dc.html; helmet: :hover then :active). */
.ui-btn--primary:active, .ui-btn--primary[data-force~="pressed"] { background: var(--ui-brand-800); color: var(--ui-on-fill); transform: translateY(1px); }
/* Secondary pressed changes the fill only (Kit.dc.html: the border stays; under a mouse Hover's border holds). */
.ui-btn--secondary:active, .ui-btn--secondary[data-force~="pressed"] { background: var(--ui-brand-50); color: var(--ui-ink); transform: translateY(1px); }
.ui-btn--tertiary:active, .ui-btn--tertiary[data-force~="pressed"] { background: var(--ui-brand-50); color: var(--ui-brand-700); transform: translateY(1px); }
.ui-btn--danger:active, .ui-btn--danger[data-force~="pressed"] { background: var(--ui-danger-50); border-color: var(--ui-danger); color: var(--ui-danger); transform: translateY(1px); }
.ui-btn--danger-solid:active, .ui-btn--danger-solid[data-force~="pressed"] { background: var(--ui-danger-800); color: var(--ui-on-fill); transform: translateY(1px); }
.ui-btn--icon.is-on, .ui-btn--icon[aria-pressed="true"], .ui-btn--icon[aria-expanded="true"] { background: var(--ui-brand-50); color: var(--ui-brand); }
.ui-btn--icon.is-done { color: var(--ui-success); }

/* Working: a spinner replaces the icon, the label says "...ing", width holds. */
.ui-btn[aria-busy="true"] { cursor: progress; }
.ui-spin { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: var(--ui-radius-pill); border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #FFFFFF; animation: ui-spin .8s linear infinite; }
.ui-spin--dark { border-color: rgba(15, 27, 45, 0.18); border-top-color: var(--ui-ink); }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Disabled: last, so it wins over hover and pressed. Always paired with a reason in words. */
.ui-btn:disabled, .ui-btn[aria-disabled="true"] { cursor: not-allowed; transform: none; }
.ui-btn--primary:disabled, .ui-btn--primary[aria-disabled="true"],
.ui-btn--danger-solid:disabled, .ui-btn--danger-solid[aria-disabled="true"] { background: var(--ui-line-strong); border-color: transparent; color: var(--ui-slate); }
.ui-btn--secondary:disabled, .ui-btn--secondary[aria-disabled="true"],
.ui-btn--danger:disabled, .ui-btn--danger[aria-disabled="true"] { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-muted); }
.ui-btn--tertiary:disabled, .ui-btn--tertiary[aria-disabled="true"] { background: transparent; color: var(--ui-muted); }
.ui-btn--icon:disabled, .ui-btn--icon[aria-disabled="true"] { background: transparent; color: var(--ui-line-strong); }

/* One Primary per bar, two Secondary, the rest in More. */
.ui-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.ui-actions--end { justify-content: flex-end; }

/* ── Popover menu (More, + New) ─────────────────────────────────────────── */
.ui-menu { display: flex; flex-direction: column; width: 232px; max-width: calc(100vw - 32px); margin: 0; padding: 6px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pop); box-shadow: var(--ui-shadow-3); font-family: var(--ui-font); }
.ui-menu--create { width: 320px; }
.ui-menu-row { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; padding: 0 12px; border: 0; border-radius: var(--ui-radius-control); background: transparent; color: var(--ui-ink); font-family: var(--ui-font); font-size: 15px; line-height: 22px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.ui-menu-row[data-force~="hover"] { background: var(--ui-bg); color: var(--ui-ink); }
.ui-menu-row--create { min-height: 64px; }
.ui-menu-row__text { display: flex; flex-direction: column; min-width: 0; }
.ui-menu-row__label { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ui-ink); }
.ui-menu-row__desc { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ui-muted); }
@media (hover: hover) { .ui-menu-row:hover { background: var(--ui-bg); color: var(--ui-ink); } }

/* ── Badges and count pills ─────────────────────────────────────────────── */
.ui-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; margin: 0; padding: 0 9px; border-radius: var(--ui-radius-pill); font-family: var(--ui-font); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.ui-badge .ui-i { width: 14px; height: 14px; stroke-width: 2; }
.ui-badge--neutral { background: var(--ui-bg); color: var(--ui-slate); }
.ui-badge--brand { background: var(--ui-brand-50); color: var(--ui-brand); }
.ui-badge--outline { background: var(--ui-surface); color: var(--ui-brand); box-shadow: inset 0 0 0 1.5px var(--ui-brand); }
.ui-badge--success { background: var(--ui-success-50); color: var(--ui-success); }
.ui-badge--warning { background: var(--ui-warning-50); color: var(--ui-warning); }
.ui-badge--danger { background: var(--ui-danger-50); color: var(--ui-danger); }
.ui-badge--test { background: var(--ui-surface); color: var(--ui-slate); border: 1px dashed var(--ui-input); }

.ui-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin: 0; padding: 0 6px; border-radius: var(--ui-radius-pill); background: var(--ui-bg); color: var(--ui-slate); font-family: var(--ui-font); font-size: 12px; line-height: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-count--danger { background: var(--ui-danger-50); color: var(--ui-danger); }
.ui-count--brand { background: var(--ui-brand-50); color: var(--ui-brand); }
.ui-count--ink { background: var(--ui-ink); color: var(--ui-on-fill); }

/* ── Chips (filters) ────────────────────────────────────────────────────── */
.ui-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ui-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 16px; border: 1.5px solid var(--ui-line-strong); border-radius: var(--ui-radius-pill); background: var(--ui-surface); color: var(--ui-slate); font-family: var(--ui-font); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-chip[data-force~="hover"] { border-color: var(--ui-brand); color: var(--ui-ink); }
.ui-chip.is-on, .ui-chip[aria-pressed="true"] { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-on-fill); }
.ui-chip.is-on .ui-count, .ui-chip[aria-pressed="true"] .ui-count { background: rgba(255, 255, 255, 0.18); color: var(--ui-on-fill); }
@media (hover: hover) { .ui-chip:hover { border-color: var(--ui-brand); color: var(--ui-ink); } .ui-chip.is-on:hover, .ui-chip[aria-pressed="true"]:hover { border-color: var(--ui-ink); color: var(--ui-on-fill); } }

/* ── Segmented control: the whole 44 px column is the hit area ──────────── */
.ui-seg { display: inline-flex; align-items: stretch; height: 44px; max-width: 100%; margin: 0; padding: 0 4.5px; border-radius: var(--ui-radius-pill); background: var(--ui-surface); box-shadow: inset 0 0 0 1.5px var(--ui-line-strong); }
.ui-seg--fill { display: flex; width: 100%; }
.ui-seg__opt { position: relative; z-index: 0; display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: var(--ui-radius-pill); background: transparent; color: var(--ui-slate); font-family: var(--ui-font); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-seg--fill .ui-seg__opt { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.ui-seg__opt::before { content: ''; position: absolute; z-index: -1; top: 4.5px; bottom: 4.5px; left: 0; right: 0; border-radius: var(--ui-radius-pill); background: transparent; }
.ui-seg__opt.is-on, .ui-seg__opt[aria-checked="true"], .ui-seg__opt[aria-pressed="true"] { color: var(--ui-on-fill); }
.ui-seg__opt.is-on::before, .ui-seg__opt[aria-checked="true"]::before, .ui-seg__opt[aria-pressed="true"]::before { background: var(--ui-ink); }
.ui-seg__opt[data-force~="hover"] { color: var(--ui-ink); }
@media (hover: hover) { .ui-seg__opt:hover { color: var(--ui-ink); } .ui-seg__opt.is-on:hover, .ui-seg__opt[aria-checked="true"]:hover, .ui-seg__opt[aria-pressed="true"]:hover { color: var(--ui-on-fill); } }

/* ── Tabs: equal status cells on the phone (up to 5, never scrolling), underline tabs from 768 ── */
.ui-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 0; padding: 0; }
.ui-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; height: 56px; margin: 0; padding: 0 2px; border: 0; border-radius: var(--ui-radius-control); background: var(--ui-bg); color: var(--ui-slate); font-family: var(--ui-font); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; }
.ui-tab__label { overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.ui-tab .ui-count { min-width: 0; height: auto; padding: 0; background: transparent; color: var(--ui-ink); font-size: 16px; line-height: 20px; }
.ui-tab .ui-count--danger { color: var(--ui-danger); }
.ui-tab.is-on, .ui-tab[aria-current="page"], .ui-tab[aria-selected="true"] { background: var(--ui-brand-50); color: var(--ui-brand); box-shadow: inset 0 -2px 0 var(--ui-brand); }
.ui-tab.is-on .ui-count, .ui-tab[aria-current="page"] .ui-count, .ui-tab[aria-selected="true"] .ui-count { color: var(--ui-brand); }
@media (hover: hover) { .ui-tab:hover { color: var(--ui-ink); } .ui-tab.is-on:hover, .ui-tab[aria-current="page"]:hover, .ui-tab[aria-selected="true"]:hover { color: var(--ui-brand); } }
@media (min-width: 768px) {
  .ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-line); }
  .ui-tab { flex-direction: row; gap: 8px; height: 48px; margin-bottom: -1px; padding: 0 14px; border-radius: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ui-slate); font-size: 15px; line-height: 22px; box-shadow: none; }
  .ui-tab .ui-count { min-width: 20px; height: 20px; padding: 0 6px; background: var(--ui-bg); color: var(--ui-slate); font-size: 12px; line-height: 16px; }
  .ui-tab .ui-count--brand { background: var(--ui-brand-50); color: var(--ui-brand); }
  .ui-tab .ui-count--danger { background: var(--ui-danger-50); color: var(--ui-danger); }
  .ui-tab.is-on, .ui-tab[aria-current="page"], .ui-tab[aria-selected="true"] { background: transparent; color: var(--ui-ink); border-bottom-color: var(--ui-brand); box-shadow: none; }
  .ui-tab.is-on .ui-count, .ui-tab[aria-current="page"] .ui-count, .ui-tab[aria-selected="true"] .ui-count { background: var(--ui-brand-50); color: var(--ui-brand); }
  .ui-tab.is-on .ui-count--danger, .ui-tab[aria-current="page"] .ui-count--danger { background: var(--ui-danger-50); color: var(--ui-danger); }
  /* The selected underline tab stays ink under the pointer (Kit.dc.html: .tab:hover then .tab.is-on); the brand hover colour is the phone cell's. */
  .ui-tab.is-on:hover, .ui-tab[aria-current="page"]:hover, .ui-tab[aria-selected="true"]:hover { color: var(--ui-ink); }
}

/* ── Cards, tiles, wells ────────────────────────────────────────────────── */
.ui-card { margin: 0; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); color: var(--ui-ink); }
.ui-card--pad { padding: var(--ui-card-pad); }
.ui-card__title { display: flex; flex-direction: column; margin: 0 0 12px; }

.ui-well { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: var(--ui-radius-control); }
.ui-well--sm { width: 36px; height: 36px; }
.ui-well--44 { width: 44px; height: 44px; }
.ui-well--72 { width: 72px; height: 72px; }
.ui-well--brand { background: var(--ui-brand-50); color: var(--ui-brand); }
.ui-well--warning { background: var(--ui-warning-50); color: var(--ui-warning); }
.ui-well--danger { background: var(--ui-danger-50); color: var(--ui-danger); }
.ui-well--success { background: var(--ui-success-50); color: var(--ui-success); }
.ui-well--neutral { background: var(--ui-bg); color: var(--ui-slate); }

/* Tile groups are always 4, 6 or 8: 2 across on the phone, 4 from 1024. */
.ui-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ui-gap); margin: 0; }
@media (min-width: 1024px) { .ui-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ui-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-width: 0; min-height: 104px; margin: 0; padding: 14px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); color: var(--ui-ink); font-family: var(--ui-font); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
a.ui-tile, button.ui-tile { cursor: pointer; text-align: left; }
.ui-tile[data-force~="hover"] { border-color: var(--ui-brand); box-shadow: var(--ui-shadow-1-hover); }
@media (hover: hover) { a.ui-tile:hover, button.ui-tile:hover { border-color: var(--ui-brand); box-shadow: var(--ui-shadow-1-hover); color: var(--ui-ink); } }
.ui-tile__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ui-tile__count { font-size: 28px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ui-ink); }
.ui-tile__count--zero { color: var(--ui-slate); }
.ui-tile__go { display: none; color: var(--ui-muted); }
.ui-tile__text { display: flex; flex-direction: column; min-width: 0; }
.ui-tile__label { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--ui-ink); }
.ui-tile__meta { display: none; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ui-slate); }
.ui-tile__meta--clear { display: block; color: var(--ui-success); font-weight: 600; }
.ui-tile__meta--error { display: block; color: var(--ui-danger); font-weight: 600; }
.ui-tile .ui-well { width: 36px; height: 36px; }
@media (min-width: 768px) {
  .ui-tile { min-height: 136px; padding: 20px; }
  .ui-tile .ui-well { width: 40px; height: 40px; }
  .ui-tile__top { justify-content: flex-start; }
  .ui-tile__count { font-size: 36px; line-height: 40px; }
  .ui-tile__go { display: inline-block; margin-left: auto; }
  .ui-tile__label { font-size: 16px; line-height: 24px; }
  .ui-tile__meta { display: block; }
}

/* ── Skeleton, empty state, banner, danger zone ─────────────────────────── */
.ui-skeleton { display: block; height: 12px; border-radius: 6px; background: var(--ui-line); animation: ui-pulse 1.4s ease-in-out infinite; }
.ui-skeleton--count { width: 44px; height: 32px; border-radius: 8px; }
.ui-skeleton--line { width: 70%; }
.ui-skeleton--short { width: 40%; }
@keyframes ui-pulse { 50% { opacity: .55; } }

.ui-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0; padding: 32px 16px; text-align: center; font-family: var(--ui-font); }
.ui-empty__title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ui-ink); }
.ui-empty__text { margin: 0; max-width: 360px; font-size: 15px; line-height: 22px; color: var(--ui-slate); }

.ui-banner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin: 0; padding: 12px 16px; border-radius: var(--ui-radius-control); border: 1px solid transparent; font-family: var(--ui-font); font-size: 15px; line-height: 22px; color: var(--ui-ink); }
.ui-banner > .ui-i { margin-top: 1px; }
.ui-banner__text { flex: 1 1 200px; min-width: 0; margin: 0; }
.ui-banner .ui-btn { margin: -8px -8px -8px auto; }
.ui-banner--info { background: var(--ui-brand-50); }
.ui-banner--info > .ui-i { color: var(--ui-brand); }
.ui-banner--warning { background: var(--ui-warning-50); }
.ui-banner--warning > .ui-i { color: var(--ui-warning); }
.ui-banner--danger { background: var(--ui-danger-50); border-color: var(--ui-danger-line); }
.ui-banner--danger > .ui-i { color: var(--ui-danger); }

.ui-danger-zone { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: var(--ui-card-pad); background: var(--ui-surface); border: 1px solid var(--ui-danger-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); }
.ui-danger-zone__title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ui-danger); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.ui-field { display: block; min-width: 0; margin: 0; }
.ui-label { display: block; margin: 0 0 6px; font-family: var(--ui-font); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ui-ink); }
.ui-help { display: block; margin: 6px 0 0; font-family: var(--ui-font); font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ui-muted); }
.ui-error { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; font-family: var(--ui-font); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ui-danger); }
.ui-error[hidden] { display: none; }
.ui-error .ui-i { width: 16px; height: 16px; margin-top: 1px; }
/* Element-qualified so it outranks the legacy console's input[type="text"] rules (same specificity, later file). */
input.ui-input, select.ui-input, textarea.ui-input, .ui-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--ui-input);
  border-radius: var(--ui-radius-control);
  background: var(--ui-surface);
  box-shadow: none;
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: var(--ui-input-size);
  line-height: var(--ui-input-line);
  font-weight: 400;
  transition: none;
  -webkit-appearance: none;
  appearance: none;
}
textarea.ui-input { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
select.ui-input { padding-right: 44px; cursor: pointer; }
input.ui-input::placeholder, textarea.ui-input::placeholder { color: var(--ui-muted); opacity: 1; }
input.ui-input:focus, select.ui-input:focus, textarea.ui-input:focus { outline: 2px solid var(--ui-focus); outline-offset: 2px; border-color: var(--ui-input); box-shadow: none; }
input.ui-input[aria-invalid="true"], select.ui-input[aria-invalid="true"], textarea.ui-input[aria-invalid="true"] { border-color: var(--ui-danger); }
input.ui-input[readonly], input.ui-input:disabled, select.ui-input:disabled { background: var(--ui-surface-2); color: var(--ui-slate); border-color: var(--ui-line-strong); }
/* A control with an icon or affix inside it: $ prefix, currency suffix, lock, select chevron. */
.ui-control { position: relative; display: block; min-width: 0; }
.ui-control > .ui-i { position: absolute; top: 12px; right: 12px; pointer-events: none; color: var(--ui-slate); }
.ui-control__prefix, .ui-control__suffix { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; pointer-events: none; font-family: var(--ui-font); font-size: var(--ui-input-size); line-height: var(--ui-input-line); color: var(--ui-muted); }
.ui-control__prefix { left: 14px; }
.ui-control__suffix { right: 14px; font-size: 13px; font-weight: 600; }
.ui-control--prefix input.ui-input { padding-left: 30px; }
.ui-control--suffix input.ui-input { padding-right: 56px; }
.ui-control--icon input.ui-input { padding-right: 44px; }

.ui-search { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 0 10px 0 14px; border: 0; border-radius: var(--ui-radius-control); background: var(--ui-bg); color: var(--ui-muted); font-family: var(--ui-font); }
.ui-search:focus-within { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
input.ui-search__input { flex: 1; min-width: 0; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ui-ink); font-family: var(--ui-font); font-size: var(--ui-input-size); line-height: var(--ui-input-line); outline: none; -webkit-appearance: none; appearance: none; }
input.ui-search__input:focus { outline: none; box-shadow: none; }
input.ui-search__input::placeholder { color: var(--ui-muted); opacity: 1; }
.ui-kbd { display: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-slate); font-family: var(--ui-font); font-size: 12px; font-weight: 600; }
@media (min-width: 1024px) { .ui-kbd { display: inline-flex; } }

/* Checkbox: a 20 px box drawn inside a 44 x 44 hit area. */
input.ui-check, .ui-pm__body input[type="checkbox"] { flex: none; width: 44px; height: 44px; margin: 0 -12px; padding: 0; border: 0; border-radius: var(--ui-radius-control); background: transparent no-repeat center / 20px 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='0.75' y='0.75' width='18.5' height='18.5' rx='4.25' fill='%23FFFFFF' stroke='%237B8798' stroke-width='1.5'/%3E%3C/svg%3E"); cursor: pointer; -webkit-appearance: none; appearance: none; }
input.ui-check:checked, .ui-pm__body input[type="checkbox"]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect width='20' height='20' rx='5' fill='%232D5FAF'/%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input.ui-check:disabled { cursor: not-allowed; opacity: .5; }
.ui-check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; padding: 4px 0 4px 12px; font-family: var(--ui-font); cursor: pointer; }
.ui-check-row + .ui-check-row { border-top: 1px solid var(--ui-line); }
.ui-check-row__text { display: flex; flex-direction: column; min-width: 0; }
.ui-check-row__label { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ui-ink); overflow-wrap: anywhere; }
.ui-check-row__note { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ui-muted); overflow-wrap: anywhere; }

/* Switch: a 44 x 26 track in a 60 x 44 button. */
.ui-switch { position: relative; flex: none; display: inline-block; width: 60px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: var(--ui-radius-control); background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-switch::before { content: ''; position: absolute; left: 8px; top: 9px; width: 44px; height: 26px; border-radius: var(--ui-radius-pill); background: var(--ui-line-strong); transition: background-color .12s; }
.ui-switch::after { content: ''; position: absolute; left: 10px; top: 11px; width: 22px; height: 22px; border-radius: var(--ui-radius-pill); background: #FFFFFF; box-shadow: 0 1px 2px rgba(15, 27, 45, 0.25); transition: left .12s; }
.ui-switch[aria-checked="true"]::before { background: var(--ui-brand); }
.ui-switch[aria-checked="true"]::after { left: 28px; }
.ui-switch:disabled { cursor: not-allowed; opacity: .5; }

/* Stepper: minus 44 | value 56 | plus 44. */
.ui-stepper { display: inline-flex; align-items: center; margin: 0; border: 1.5px solid var(--ui-line-strong); border-radius: var(--ui-radius-control); background: var(--ui-surface); overflow: hidden; }
.ui-stepper .ui-btn--icon { border-radius: 0; }
.ui-stepper__value { width: 56px; text-align: center; font-family: var(--ui-font); font-size: 16px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ui-ink); }

/* ── Table: cards on the phone, a real table from 768 ───────────────────── */
.ui-table-card { margin: 0; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); overflow: hidden; }
.ui-table { width: 100%; margin: 0; border-collapse: collapse; font-family: var(--ui-font); font-size: 15px; line-height: 22px; color: var(--ui-ink); }
.ui-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ui-table tbody, .ui-table tr, .ui-table td { display: block; }
.ui-table tr { padding: 16px; border-bottom: 1px solid var(--ui-line); }
.ui-table tbody tr:last-child { border-bottom: 0; }
.ui-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; padding: 2px 0; text-align: right; }
.ui-table td::before { content: attr(data-label); flex: none; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ui-slate); text-align: left; }
.ui-table td.ui-table__lead { justify-content: flex-start; padding-bottom: 8px; text-align: left; }
.ui-table td.ui-table__lead::before, .ui-table td.ui-table__actions::before { content: none; }
.ui-table td.ui-table__actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.ui-table td.ui-table__actions .ui-btn { flex: 1 1 140px; }
@media (min-width: 768px) {
  .ui-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .ui-table thead { display: table-header-group; }
  .ui-table tbody { display: table-row-group; }
  .ui-table tr { display: table-row; padding: 0; border-bottom: 0; }
  .ui-table th, .ui-table td { display: table-cell; }
  .ui-table th { height: 44px; padding: 0 16px; background: var(--ui-surface-2); border-bottom: 1px solid var(--ui-line); color: var(--ui-slate); font-size: 13px; line-height: 18px; font-weight: 600; text-align: left; white-space: nowrap; }
  .ui-table td { height: 64px; padding: 0 16px; border-bottom: 1px solid var(--ui-line); text-align: left; vertical-align: middle; }
  .ui-table td::before { content: none; }
  .ui-table td.ui-table__lead, .ui-table td.ui-table__actions { padding: 0 16px; }
  .ui-table td.ui-table__actions { white-space: nowrap; }
  .ui-table td.ui-table__actions .ui-btn { flex: none; margin-right: 8px; }
  .ui-table td.ui-table__actions .ui-btn:last-child { margin-right: 0; }
  .ui-table tbody tr:last-child td { border-bottom: 0; }
  .ui-table th.ui-table__num, .ui-table td.ui-table__num { text-align: right; }
}
@media (min-width: 768px) and (hover: hover) { .ui-table tbody tr:hover td { background: var(--ui-surface-2); } }
/* A row's name is its link: 44 px tall so it is a real target, never nested around the row buttons. */
.ui-row-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ui-ink); font-weight: 600; text-decoration: none; }
@media (hover: hover) { .ui-row-link:hover { color: var(--ui-brand); text-decoration: underline; } }
.ui-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--ui-brand-50); color: var(--ui-brand); font-family: var(--ui-font); font-size: 13px; font-weight: 700; }
.ui-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ui-person__text { display: flex; flex-direction: column; min-width: 0; text-align: left; }

/* ── Overlays: scrim, dialog, sheet, drawer ─────────────────────────────── */
.ui-scrim { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; margin: 0; padding: 0; background: var(--ui-overlay); animation: ui-fade .16s ease-out; font-family: var(--ui-font); -webkit-font-smoothing: antialiased; }
.ui-scrim[hidden] { display: none; }
/* Below 768: a bottom sheet, full width, 20 px top corners, above the home indicator. */
.ui-dialog, .ui-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-height: calc(100% - 24px);
  margin: 0;
  padding: 0 16px calc(16px + var(--ui-safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ui-surface);
  border-radius: var(--ui-radius-sheet) var(--ui-radius-sheet) 0 0;
  box-shadow: var(--ui-shadow-4);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 22px;
  text-align: left;
  animation: ui-sheet-in .2s ease-out;
}
.ui-dialog__grab { display: block; flex: none; width: 36px; height: 4px; margin: 6px auto 0; border-radius: var(--ui-radius-pill); background: var(--ui-line-strong); }
.ui-dialog__head { display: flex; align-items: flex-start; gap: 16px; }
.ui-dialog__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ui-dialog__title { margin: 0; font-family: var(--ui-font); font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.005em; color: var(--ui-ink); overflow-wrap: anywhere; }
.ui-dialog__body { margin: 0; font-size: 15px; line-height: 22px; font-weight: 400; color: var(--ui-slate); white-space: pre-wrap; overflow-wrap: anywhere; }
.ui-dialog__body:empty { display: none; }
.ui-dialog__list { max-height: 46vh; overflow-y: auto; margin: 0; padding: 0; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); }
/* Phone: full-width 52 px buttons, stacked; the confirm on top, Cancel nearest the thumb. */
.ui-dialog__foot { display: flex; flex-direction: column-reverse; gap: 8px; margin: 0; padding-top: 4px; }
.ui-dialog__foot .ui-btn { width: 100%; min-height: 52px; padding: 8px 24px; font-size: 16px; line-height: 24px; white-space: normal; }
.ui-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
@media (min-width: 768px) {
  .ui-scrim { align-items: center; padding: 24px; }
  /* From 768: a 480 px card, 16 px corners, 24 px padding, buttons at 44 on the right. */
  .ui-dialog, .ui-sheet { width: 480px; max-width: 100%; max-height: calc(100% - 48px); padding: 24px; border-radius: var(--ui-radius-dialog); animation-name: ui-pop-in; }
  .ui-dialog__grab { display: none; }
  .ui-dialog__title { font-size: 20px; line-height: 28px; }
  .ui-dialog__foot { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; padding-top: 0; }
  .ui-dialog__foot .ui-btn { width: auto; max-width: 100%; min-height: 44px; padding: 0 18px; font-size: 15px; line-height: 22px; }
}
@keyframes ui-fade { from { background-color: rgba(15, 27, 45, 0); } }
@keyframes ui-sheet-in { from { transform: translateY(24px); } }
/* Movement only, never scale: a scaled 44 px target measures 43 while it animates. */
@keyframes ui-pop-in { from { transform: translateY(8px); } }

/* Drawer: a full-screen sheet on the phone; 480 px from the right from 768. */
.ui-scrim--drawer { align-items: stretch; justify-content: flex-end; }
.ui-drawer { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; padding: 0; background: var(--ui-surface); color: var(--ui-ink); font-family: var(--ui-font); font-size: 15px; line-height: 22px; animation: ui-sheet-in .2s ease-out; }
.ui-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 64px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--ui-line); }
.ui-drawer__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.ui-drawer__foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; flex: none; padding: 12px 16px calc(12px + var(--ui-safe-bottom)); border-top: 1px solid var(--ui-line); background: var(--ui-surface); }
.ui-drawer__foot .ui-btn { width: 100%; min-height: 52px; padding: 0 16px; font-size: 16px; line-height: 24px; white-space: normal; }
@media (min-width: 768px) {
  .ui-scrim--drawer { align-items: stretch; padding: 0; }
  .ui-drawer { width: 480px; max-width: 100%; box-shadow: var(--ui-shadow-4); animation-name: ui-drawer-in; }
  .ui-drawer__head { padding: 0 12px 0 24px; }
  .ui-drawer__body { padding: 24px; }
  .ui-drawer__foot { display: flex; justify-content: space-between; padding: 16px 24px; }
  .ui-drawer__foot .ui-btn { width: auto; min-height: 44px; padding: 0 18px; font-size: 15px; line-height: 22px; }
}
@keyframes ui-drawer-in { from { transform: translateX(24px); } }

/* ── Toasts: ink, 48 px, above the home indicator and the bottom bar ───── */
.ui-toast-wrap { position: fixed; z-index: 1100; left: 16px; right: 16px; bottom: calc(16px + var(--ui-bottom-bar-h) + var(--ui-safe-bottom)); display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; padding: 0; pointer-events: none; font-family: var(--ui-font); }
.ui-toast { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 2px 4px 2px 16px; border-radius: var(--ui-radius-control); background: var(--ui-ink); box-shadow: var(--ui-shadow-3); color: var(--ui-on-fill); font-size: 14px; line-height: 20px; font-weight: 500; pointer-events: auto; animation: ui-toast-in .18s ease-out; }
.ui-toast > .ui-i { color: var(--ui-on-fill); }
.ui-toast__text { flex: 1 1 auto; min-width: 0; padding: 12px 0; overflow-wrap: anywhere; }
.ui-toast__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: var(--ui-radius-control); background: transparent; color: var(--ui-toast-action); cursor: pointer; }
@media (hover: hover) { .ui-toast__close:hover { background: rgba(255, 255, 255, 0.10); } }
.ui-toast.is-leaving { opacity: 0; transition: opacity .2s; }
@keyframes ui-toast-in { from { transform: translateY(8px); } }
@media (min-width: 768px) {
  .ui-toast-wrap { left: 24px; right: auto; bottom: calc(24px + var(--ui-bottom-bar-h) + var(--ui-safe-bottom)); width: 420px; max-width: calc(100vw - 48px); }
}

/* ══ S3: element-level base and the shell ═════════════════════════════════
 * The console's frame: top bar, bottom tab bar (phone), rail (768-1279),
 * sidebar (1280 and up), the Menu and Create sheets, the account menu and the
 * sub-page navigation. Drawn by /js/shell.js from SG.ROUTES; the look is
 * artboards/Main.dc.html (sidebar), TabletHome.dc.html (rail),
 * PhoneHome.dc.html and PhoneMenu.dc.html (bar, sheets), PhonePipeline.dc.html
 * (sub-page grid). Mobile-first like the rest of this file.
 *
 * Stacking, low to high: rail 20, top bar 30, Menu sheet 35/36, tab bar 40,
 * Create and account 60/61 — all under the legacy pipeline modal (100) and
 * confirm overlays (500), the kit's dialogs (1000) and toasts (1100).
 */

/* Element-level base. Legacy rules that name their own font or colour still
   win (they are more specific); this is what everything else inherits. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; }

/* Shell metrics, phone first. The safe areas are real only with
   viewport-fit=cover (index.html). */
:root {
  --ui-safe-top: env(safe-area-inset-top, 0px);
  --ui-safe-left: env(safe-area-inset-left, 0px);
  --ui-safe-right: env(safe-area-inset-right, 0px);
  --ui-topbar-h: 56px;
  --ui-tabbar-h: 64px;
  --ui-nav-w: 0px;
}
@media (min-width: 768px) { :root { --ui-topbar-h: 64px; --ui-tabbar-h: 0px; --ui-nav-w: 80px; } }
@media (min-width: 1280px) { :root { --ui-nav-w: 248px; } }
/* In the console, toasts (S2) clear the bottom tab bar. */
.ui-shell { --ui-bottom-bar-h: var(--ui-tabbar-h); }

/* ── Top bar: 56 px on the phone, 64 from 768 ───────────────────────────── */
.ui-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--ui-topbar-h) + var(--ui-safe-top));
  margin: 0;
  padding: var(--ui-safe-top) calc(12px + var(--ui-safe-right)) 0 calc(16px + var(--ui-safe-left));
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
  font-family: var(--ui-font);
}
.ui-topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ui-wordmark { display: block; width: auto; height: 20px; }
.ui-topbar__tag { display: none; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--ui-bg); color: var(--ui-slate); font-size: 12px; line-height: 16px; font-weight: 600; }
.ui-topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ui-topbar__new { display: none; }
.ui-btn--icon.ui-topbar__account { border-radius: var(--ui-radius-pill); }
.ui-initials { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--ui-radius-pill); background: var(--ui-brand-50); color: var(--ui-brand); font-family: var(--ui-font); font-size: 14px; line-height: 20px; font-weight: 700; }
@media (min-width: 768px) {
  .ui-topbar { gap: 16px; margin-left: calc(var(--ui-nav-w) + var(--ui-safe-left)); padding: var(--ui-safe-top) calc(24px + var(--ui-safe-right)) 0 24px; }
  .ui-topbar__actions { gap: 16px; }
  .ui-topbar__new { display: inline-flex; }
}
@media (min-width: 1280px) {
  /* The wordmark block tops the sidebar (Main.dc.html): same width, same right edge. */
  .ui-topbar { gap: 0; margin-left: 0; padding: var(--ui-safe-top) 0 0; border-bottom: 0; background: transparent; }
  .ui-topbar__brand { flex: none; align-self: stretch; width: calc(248px + var(--ui-safe-left)); padding: 0 24px 0 calc(24px + var(--ui-safe-left)); background: var(--ui-surface); border-right: 1px solid var(--ui-line); }
  .ui-wordmark { height: 24px; }
  .ui-topbar__tag { display: inline-flex; }
  .ui-topbar__actions { flex: 1 1 auto; align-self: stretch; justify-content: flex-end; margin-left: 0; padding: 0 calc(32px + var(--ui-safe-right)) 0 32px; background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); }
}

/* ── Rail (768-1279) and sidebar (1280 and up) ──────────────────────────── */
.ui-nav { display: none; }
.ui-nav__sections { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; }
.ui-nav__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; width: 80px; height: 64px; margin: 0; padding: 0; color: var(--ui-slate); font-family: var(--ui-font); font-size: 12px; line-height: 16px; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ui-nav__pill { display: flex; align-items: center; justify-content: center; width: 56px; height: 32px; border-radius: var(--ui-radius-pill); }
.ui-nav__item .ui-i { width: 24px; height: 24px; }
.ui-nav__item.is-on { color: var(--ui-brand); }
.ui-nav__item.is-on .ui-nav__pill { background: var(--ui-brand-50); }
.ui-nav__children { display: none; }
.ui-nav__account { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; margin-top: auto; padding: 12px 0; border-top: 1px solid var(--ui-line); }
.ui-nav__who { display: none; }
@media (hover: hover) {
  .ui-nav__item:hover { color: var(--ui-ink); }
  .ui-nav__item:hover .ui-nav__pill { background: var(--ui-bg); }
  .ui-nav__item.is-on:hover { color: var(--ui-brand); }
  .ui-nav__item.is-on:hover .ui-nav__pill { background: var(--ui-brand-50); }
}
@media (min-width: 768px) {
  .ui-nav {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: calc(var(--ui-nav-w) + var(--ui-safe-left));
    margin: 0;
    padding: calc(72px + var(--ui-safe-top)) 0 var(--ui-safe-bottom) var(--ui-safe-left);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--ui-surface);
    border-right: 1px solid var(--ui-line);
    font-family: var(--ui-font);
  }
}
/* A landscape phone is a tablet by width but only ~390 px tall: start higher, and the rail scrolls. */
@media (min-width: 768px) and (max-height: 600px) {
  .ui-nav { padding-top: calc(8px + var(--ui-safe-top)); }
}
@media (min-width: 1280px) {
  .ui-nav { top: calc(64px + var(--ui-safe-top)); padding-top: 24px; }
  .ui-nav__sections { align-items: stretch; }
  .ui-nav__item { flex-direction: row; justify-content: flex-start; gap: 12px; width: auto; height: 48px; margin: 0 12px; padding: 0 12px; border-radius: var(--ui-radius-control); font-size: 15px; line-height: 22px; }
  .ui-nav__pill { width: auto; height: auto; border-radius: 0; }
  .ui-nav__item .ui-i { width: 22px; height: 22px; }
  .ui-nav__item.is-on { background: var(--ui-brand-50); }
  .ui-nav__item.is-on .ui-nav__pill, .ui-nav__item.is-on:hover .ui-nav__pill { background: transparent; }
  .ui-nav__item.is-on::before { content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ui-brand); }
  .ui-nav__children.is-open { display: flex; flex-direction: column; gap: 4px; }
  .ui-nav__child { display: flex; align-items: center; gap: 10px; flex: none; height: 44px; margin: 0 12px; padding: 0 12px 0 46px; border-radius: var(--ui-radius-control); color: var(--ui-slate); font-family: var(--ui-font); font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .ui-nav__child.is-on { color: var(--ui-brand); font-weight: 600; }
  .ui-nav__dot { display: none; flex: none; width: 6px; height: 6px; margin-left: -16px; border-radius: var(--ui-radius-pill); background: var(--ui-brand); }
  .ui-nav__child.is-on .ui-nav__dot { display: block; }
  .ui-nav__account { flex-direction: row; gap: 12px; height: calc(72px + var(--ui-safe-bottom)); padding: 0 12px var(--ui-safe-bottom) 24px; }
  .ui-nav__who { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--ui-ink); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
}
@media (min-width: 1280px) and (hover: hover) {
  .ui-nav__item:hover { background: var(--ui-bg); }
  .ui-nav__item:hover .ui-nav__pill { background: transparent; }
  .ui-nav__item.is-on:hover { background: var(--ui-brand-50); }
  .ui-nav__child:hover { background: var(--ui-bg); color: var(--ui-ink); }
  .ui-nav__child.is-on:hover { color: var(--ui-brand); }
}

/* ── Bottom tab bar (below 768): 64 px plus the home indicator ──────────── */
.ui-tabbar {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  height: calc(var(--ui-tabbar-h) + 1px + var(--ui-safe-bottom));
  margin: 0;
  padding: 0 var(--ui-safe-right) var(--ui-safe-bottom) var(--ui-safe-left);
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-line);
  font-family: var(--ui-font);
}
@media (min-width: 768px) { .ui-tabbar { display: none; } }
.ui-tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; height: 64px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ui-slate); font-family: var(--ui-font); font-size: 12px; line-height: 16px; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ui-tabbar__item-label { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ui-tabbar__pill { display: flex; align-items: center; justify-content: center; width: 56px; height: 32px; border-radius: var(--ui-radius-pill); }
.ui-tabbar__item .ui-i { width: 24px; height: 24px; }
.ui-tabbar__item.is-on { color: var(--ui-brand); }
.ui-tabbar__item.is-on .ui-tabbar__pill { background: var(--ui-brand-50); }
/* New sits INSIDE the bar (never raised over the page). */
.ui-tabbar__item--new { gap: 0; }
.ui-tabbar__new { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--ui-radius-pill); background: var(--ui-brand); color: var(--ui-on-fill); }
@media (hover: hover) {
  .ui-tabbar__item:hover { color: var(--ui-ink); }
  .ui-tabbar__item.is-on:hover { color: var(--ui-brand); }
  .ui-tabbar__item--new:hover .ui-tabbar__new { background: var(--ui-brand-700); }
}

/* ── Main: clear of the rail / sidebar, and of the tab bar + home indicator ── */
.ui-main {
  display: block;
  min-width: 0;
  margin: 0;
  padding: var(--ui-page-pad) calc(var(--ui-page-pad) + var(--ui-safe-right)) calc(var(--ui-page-pad) + var(--ui-tabbar-h) + 1px + var(--ui-safe-bottom)) calc(var(--ui-page-pad) + var(--ui-safe-left));
}
@media (min-width: 768px) {
  .ui-main { margin-left: calc(var(--ui-nav-w) + var(--ui-safe-left)); padding: var(--ui-page-pad) calc(var(--ui-page-pad) + var(--ui-safe-right)) calc(48px + var(--ui-safe-bottom)) var(--ui-page-pad); }
  /* Legacy pages keep the width they were drawn for. */
  .ui-main > .dashboard-page { max-width: 1180px; margin-left: auto; margin-right: auto; }
}

/* ── Sub-pages of a section ─────────────────────────────────────────────── */
/* Phone: a white band with a 2-column grid of 44 px buttons (PhonePipeline.dc.html). */
.ui-subnav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: calc(-1 * var(--ui-page-pad)) calc(-1 * (var(--ui-page-pad) + var(--ui-safe-right))) 16px calc(-1 * (var(--ui-page-pad) + var(--ui-safe-left)));
  padding: 16px calc(var(--ui-page-pad) + var(--ui-safe-right)) 16px calc(var(--ui-page-pad) + var(--ui-safe-left));
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
  font-family: var(--ui-font);
}
.ui-subnav[hidden] { display: none; }
.ui-subnav__children { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.ui-subnav__link { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; margin: 0; padding: 0 8px; border: 1.5px solid transparent; border-radius: var(--ui-radius-control); background: var(--ui-bg); color: var(--ui-slate); font-size: 15px; line-height: 22px; font-weight: 600; text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ui-subnav__link[aria-current] { background: var(--ui-brand-50); border-color: var(--ui-brand); color: var(--ui-brand); }
@media (hover: hover) {
  .ui-subnav__link:hover { border-color: var(--ui-line-strong); color: var(--ui-ink); }
  .ui-subnav__link[aria-current]:hover { border-color: var(--ui-brand); color: var(--ui-brand); }
}
/* Tablet: 48 px underline tabs under the top bar. */
@media (min-width: 768px) {
  .ui-subnav { gap: 16px; max-width: 1180px; margin: 0 auto 24px; padding: 0; background: transparent; border-bottom: 0; }
  .ui-subnav__children { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-line); }
  .ui-subnav__link { flex: none; height: 48px; margin-bottom: -1px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; }
  .ui-subnav__link[aria-current] { background: transparent; border-bottom-color: var(--ui-brand); color: var(--ui-ink); }
}
@media (min-width: 768px) and (hover: hover) {
  .ui-subnav__link:hover { border-bottom-color: transparent; }
  .ui-subnav__link[aria-current]:hover { border-bottom-color: var(--ui-brand); color: var(--ui-ink); }
}
/* Desktop: the sidebar lists the children; only a child's own tabs stay here. */
@media (min-width: 1280px) {
  .ui-subnav__children, .ui-subnav--children-only { display: none; }
}

/* ── Sheets and popovers shared parts ───────────────────────────────────── */
.ui-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 0; }
.ui-sheet-head__title { margin: 0; font-family: var(--ui-font); font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.005em; color: var(--ui-ink); }
.ui-sheet-head .ui-btn--icon { margin-right: -10px; }

/* ── Menu sheet (phone): Partners, Training, Content; the bar stays visible ── */
.ui-menu-sheet { display: none; }
.ui-menu-sheet.is-open { display: block; }
/* From 768 the rail holds those sections: a sheet left open by a rotation must not show. */
@media (min-width: 768px) { .ui-menu-sheet.is-open { display: none; } }
.ui-menu-sheet__scrim { position: fixed; z-index: 35; top: 0; left: 0; right: 0; bottom: calc(var(--ui-tabbar-h) + 1px + var(--ui-safe-bottom)); margin: 0; background: var(--ui-overlay); animation: ui-fade .16s ease-out; }
.ui-menu-sheet__box {
  position: fixed;
  z-index: 36;
  top: calc(44px + var(--ui-safe-top));
  left: 0;
  right: 0;
  bottom: calc(var(--ui-tabbar-h) + 1px + var(--ui-safe-bottom));
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 calc(16px + var(--ui-safe-right)) 12px calc(16px + var(--ui-safe-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ui-surface);
  border-radius: var(--ui-radius-sheet) var(--ui-radius-sheet) 0 0;
  box-shadow: var(--ui-shadow-4);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  animation: ui-sheet-in .2s ease-out;
}
.ui-menu-sheet__box > .ui-dialog__grab { margin: 6px auto; }
.ui-menu-sheet__groups { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 0; }
.ui-menu-group__title { margin: 0; font-family: var(--ui-font); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ui-muted); }
.ui-menu-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 0; }
.ui-menu-tile { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; height: 72px; margin: 0; padding: 11px 12px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); color: var(--ui-ink); font-family: var(--ui-font); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ui-menu-tile__top { display: flex; align-items: flex-start; justify-content: space-between; height: 24px; color: var(--ui-brand); }
.ui-menu-tile .ui-i { width: 24px; height: 24px; }
.ui-menu-tile__label { min-width: 0; overflow: hidden; font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
@media (hover: hover) { .ui-menu-tile:hover { border-color: var(--ui-brand); box-shadow: var(--ui-shadow-1-hover); color: var(--ui-ink); } }
.ui-menu-sheet__foot { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.ui-menu-sheet__who { overflow-wrap: anywhere; }

/* ── Create: a 2 x 2 sheet below 768, a 320 px menu under + New from 768 ── */
.ui-create { display: none; }
.ui-create.is-open { display: block; }
.ui-create__scrim { position: fixed; z-index: 60; inset: 0; margin: 0; background: var(--ui-overlay); animation: ui-fade .16s ease-out; }
.ui-create__box {
  position: fixed;
  z-index: 61;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 24px);
  margin: 0;
  padding: 0 calc(16px + var(--ui-safe-right)) calc(12px + var(--ui-safe-bottom)) calc(16px + var(--ui-safe-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ui-surface);
  border-radius: var(--ui-radius-sheet) var(--ui-radius-sheet) 0 0;
  box-shadow: var(--ui-shadow-4);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  animation: ui-sheet-in .2s ease-out;
}
.ui-create__grab { margin: 6px auto; }
.ui-create__title { display: flex; align-items: center; min-height: 44px; }
.ui-create__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 0; }
.ui-create__item { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 144px; margin: 0; padding: 14px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); color: var(--ui-ink); font-family: var(--ui-font); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ui-create__well { width: 44px; height: 44px; }
.ui-create__text { display: flex; flex-direction: column; min-width: 0; margin-top: 10px; }
.ui-create__label { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ui-ink); }
.ui-create__desc { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ui-slate); }
.ui-create__cancel { margin: 16px 0 0; }
@media (hover: hover) { .ui-create__item:hover { border-color: var(--ui-brand); box-shadow: var(--ui-shadow-1-hover); color: var(--ui-ink); } }
@media (min-width: 768px) {
  .ui-create__scrim, .ui-create__grab, .ui-create__title, .ui-create__cancel { display: none; }
  .ui-create__box { top: var(--ui-pop-top, 72px); right: var(--ui-pop-right, 24px); bottom: auto; left: auto; width: 320px; max-width: calc(100vw - 32px); max-height: calc(100vh - var(--ui-pop-top, 72px) - 16px); padding: 6px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pop); box-shadow: var(--ui-shadow-3); animation-name: ui-pop-in; }
  .ui-create__items { display: flex; flex-direction: column; gap: 0; margin: 0; }
  .ui-create__item { flex-direction: row; align-items: center; gap: 12px; min-height: 64px; padding: 0 12px; border: 0; border-radius: var(--ui-radius-control); box-shadow: none; }
  .ui-create__well { width: 40px; height: 40px; }
  .ui-create__text { margin-top: 0; }
  .ui-create__label { font-size: 15px; line-height: 22px; }
  .ui-create__desc { color: var(--ui-muted); }
}
@media (min-width: 768px) and (hover: hover) { .ui-create__item:hover { background: var(--ui-bg); box-shadow: none; } }

/* ── Account menu: the signed-in email and Sign out, under its button ───── */
.ui-account { display: none; }
.ui-account.is-open {
  position: fixed;
  z-index: 61;
  top: var(--ui-pop-top, 64px);
  right: var(--ui-pop-right, 12px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 280px;
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 12px 12px 8px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-pop);
  box-shadow: var(--ui-shadow-3);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  animation: ui-pop-in .16s ease-out;
}
/* design-spec topBar: "the signed-in email (13 #5B6778)" — the .meta row PhoneMenu draws for the same line. */
.ui-account__who { margin: 0 0 4px; overflow-wrap: anywhere; }
.ui-btn--tertiary.ui-account__out { margin-left: -12px; }

/* One focus ring for the shell's own links. */
.ui-nav__item:focus-visible, .ui-nav__child:focus-visible, .ui-tabbar__item:focus-visible, .ui-subnav__link:focus-visible,
.ui-menu-tile:focus-visible, .ui-create__item:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; }


/* ══ S4: the Sales lists and the drawer ═══════════════════════════════════
 * Sales › Pipeline, Invoices and Subscriptions (js/pages/sales-lists.js), drawn
 * from PhonePipeline.dc.html below 768 and Pipeline.dc.html from 768, and the
 * pipeline modal as the kit's drawer. Mobile-first: the base rules are the phone.
 * A row carries its card lines AND its table cells; which show is decided by the
 * tiers at the end of this block: .ui-sl-phone (below 768), .ui-sl-wide (768 up),
 * .ui-sl-tab (768-1439), .ui-sl-desk (1440 up), .ui-sl-notab (not 768-1439) and
 * .ui-sl-nodesk (below 1440). The tablet table folds Sent and Dealer into the
 * customer line and the status under the age, so 834 needs no sideways scroll.
 * The full artboard table (fixed columns, Pipeline.dc.html is drawn at 1440) starts
 * at 1440: at 1280 the sidebar leaves 968 px, and those columns left the customer
 * 98 px on Pipeline and the invoice number 0 px on Invoices (browser:s4 at 1280).
 */

/* ── The page heading (#ui-pagehead), above the sub-page grid ──────────── */
/* Phone: the top of one white band (heading, sub-page grid, status cells, chips, search). */
.ui-pagehead {
  display: block;
  margin: calc(-1 * var(--ui-page-pad)) calc(-1 * (var(--ui-page-pad) + var(--ui-safe-right))) 0 calc(-1 * (var(--ui-page-pad) + var(--ui-safe-left)));
  padding: 16px calc(var(--ui-page-pad) + var(--ui-safe-right)) 0 calc(var(--ui-page-pad) + var(--ui-safe-left));
  background: var(--ui-surface);
  font-family: var(--ui-font);
}
.ui-pagehead[hidden] { display: none; }
.ui-pagehead__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.ui-pagehead__titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ui-pagehead__crumb, .ui-pagehead__meta { display: none; }
.ui-pagehead__actions { display: flex; align-items: center; gap: 12px; flex: none; }
.ui-pagehead:not([hidden]) + .ui-subnav { margin-top: 0; padding-top: 12px; padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
/* A page whose content does NOT continue the white band (a form, a list of cards: the
   ops pages and the Sales forms, which mark their heading --closed) closes the band
   under the sub-pages as the band would close with no heading; otherwise its first
   chip or card started on the band's edge (combined review 2026-10-01). */
@media (max-width: 767.98px) {
  .ui-pagehead--closed:not([hidden]) + .ui-subnav { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--ui-line); }
}
@media (min-width: 768px) {
  .ui-pagehead { max-width: 1180px; margin: 0 auto 24px; padding: 0; background: transparent; }
  .ui-pagehead__row { align-items: flex-end; gap: 24px; }
  .ui-pagehead__crumb, .ui-pagehead__meta { display: block; }
  .ui-pagehead:not([hidden]) + .ui-subnav { margin: 0 auto 24px; padding: 0; }
}

/* The Filters button's dot: a filter beyond the tab and chip is on. */
.ui-sl-filtersbtn { position: relative; }
.ui-sl-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: var(--ui-radius-pill); background: var(--ui-brand); box-shadow: 0 0 0 2px var(--ui-surface); }

/* ── The page ───────────────────────────────────────────────────────────── */
.ui-sl { display: flex; flex-direction: column; gap: 12px; font-family: var(--ui-font); color: var(--ui-ink); }
.ui-sl-band {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 calc(-1 * (var(--ui-page-pad) + var(--ui-safe-right))) 4px calc(-1 * (var(--ui-page-pad) + var(--ui-safe-left)));
  padding: 16px calc(var(--ui-page-pad) + var(--ui-safe-right)) 16px calc(var(--ui-page-pad) + var(--ui-safe-left));
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
}
/* The 5 status cells fit 358 px (PhonePipeline: 8 px gaps, about 65 x 56 each). */
.ui-sl-tabs.ui-tabs { gap: 8px; }
.ui-sl-countsk { display: inline-block; width: 20px; height: 16px; }
/* Quick chips: a 2 x 2 grid on the phone; Needs new invoice is the banner there. */
.ui-sl-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.ui-sl-chips[hidden] { display: none; }
.ui-sl-chips .ui-chip { width: 100%; min-width: 0; padding: 0 12px; }
.ui-sl-chips .ui-chip.ui-sl-chip--needs { display: none; }
.ui-sl-filterrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ui-sl-search { flex: 1 1 100%; min-width: 0; }
.ui-sl-select { flex: none; width: 160px; }
.ui-sl-switch { align-items: center; gap: 4px; min-height: 44px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ui-slate); white-space: nowrap; }
.ui-sl-result { margin-left: auto; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.ui-sl-banners { display: flex; flex-direction: column; gap: 12px; }
.ui-sl-banners:empty, .ui-sl-showing:empty, .ui-sl-note:empty { display: none; }
@media (min-width: 768px) {
  .ui-sl { gap: 20px; max-width: 1180px; margin: 0 auto; }
  .ui-sl-band { gap: 20px; margin: 0; padding: 0; background: transparent; border-bottom: 0; }
  .ui-sl-tabs.ui-tabs { gap: 4px; }
  .ui-sl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .ui-sl-chips .ui-chip { width: auto; padding: 0 16px; }
  .ui-sl-chips .ui-chip.ui-sl-chip--needs { display: inline-flex; }
  .ui-sl-search { flex: 0 1 288px; background: var(--ui-surface); box-shadow: inset 0 0 0 1px var(--ui-input); }
  .ui-sl-select { width: 160px; }
}
@media (min-width: 1280px) { .ui-sl { gap: 24px; } }

/* ── Summary tiles (from 768): Pipeline.dc.html's four ──────────────────── */
.ui-sl-tile { min-height: 168px; gap: 10px; }
.ui-sl-tile__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ui-sl-tile__label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ui-slate); }
.ui-sl-tile__go { color: var(--ui-muted); }
.ui-sl-tile__value { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--ui-ink); overflow-wrap: anywhere; }
.ui-sl-tile__unit { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: 0; color: var(--ui-slate); }
.ui-sl-tile__num { display: flex; flex-direction: column; gap: 2px; }
.ui-sl-tile__foot { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-height: 36px; }
.ui-sl-bar { display: flex; gap: 2px; height: 10px; }
.ui-sl-bar__a, .ui-sl-bar__b { display: block; width: var(--w); min-width: 0; }
.ui-sl-bar__a { background: var(--ui-chart-1); border-radius: 4px 0 0 4px; }
.ui-sl-bar__b { background: var(--ui-chart-2); border-radius: 0 4px 4px 0; }
.ui-sl-tile__legend { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ui-slate); }
.ui-sl-tile__alert { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ui-danger); }
@media (min-width: 1280px) { .ui-sl-tile { min-height: 184px; } .ui-sl-tile__value { font-size: 36px; line-height: 44px; } }

/* ── The list: cards below 768, a table from 768 ────────────────────────── */
/* Below 768 the table is a column of cards: nothing in it is laid out as a table. */
.ui-sl-table { display: block; width: 100%; margin: 0; border-collapse: collapse; font-family: var(--ui-font); font-size: 15px; line-height: 22px; color: var(--ui-ink); }
/* No header on the phone: a card says what each line is (and its sort buttons must not be tab stops nobody sees). */
.ui-sl-table thead { display: none; }
.ui-sl-table tbody { display: flex; flex-direction: column; gap: 12px; }
/* A card (PhonePipeline .qcard): name and amount, the meta line, the badges, two buttons. */
.ui-sl-table tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); }
.ui-sl-table td { display: block; padding: 0; min-width: 0; }
.ui-sl-table td.ui-sl-c-cust { flex: 1 1 100%; }
.ui-sl-table td.ui-sl-c-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-sl-table td.ui-sl-c-acts { flex: 1 1 100%; margin-top: 2px; }
.ui-sl-cust { display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 0; color: var(--ui-ink); text-decoration: none; }
/* The whole card opens the record (PhonePipeline .stretch); the buttons sit above it. */
a.ui-sl-cust::after { content: ''; position: absolute; inset: 0; border-radius: var(--ui-radius-card); }
.ui-sl-acts { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ui-sl-acts--one { grid-template-columns: minmax(0, 1fr); }
.ui-sl-acts .ui-btn { width: 100%; padding: 0 8px; }
.ui-sl-cust__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ui-sl-cust__line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ui-sl-cust__name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; line-height: 24px; font-weight: 600; }
.ui-sl-cust__amount { flex: none; font-size: 16px; line-height: 24px; font-weight: 700; }
.ui-sl-cust__meta { display: block; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ui-sl-cust__badges { display: inline-flex; gap: 6px; }
.ui-sl-amt { white-space: nowrap; font-weight: 700; }
/* An invoice number is the record's name on Sales › Invoices: it wraps (at its
   hyphens first), it is never cut off with an ellipsis. */
.ui-sl-cust--inv .ui-sl-cust__name { white-space: normal; overflow-wrap: anywhere; }
.ui-sl-code { font-size: 13px; font-weight: 500; color: var(--ui-muted); }
.ui-sl-muted { color: var(--ui-muted); }
.ui-sl-paidby, .ui-sl-wasopen { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ui-slate); white-space: nowrap; }
.ui-sl-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 16px; }
.ui-sl-foot .ui-btn { width: 100%; min-height: 52px; font-size: 16px; line-height: 24px; }
.ui-sl-loading { display: flex; flex-direction: column; gap: 20px; padding: 16px; }
.ui-sl-skrow { display: flex; flex-direction: column; gap: 8px; }
a.ui-sl-cust:focus-visible { outline: none; }
a.ui-sl-cust:focus-visible::after { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
@media (hover: hover) {
  a.ui-sl-cust:hover .ui-sl-cust__name { color: var(--ui-brand); text-decoration: underline; }
  .ui-sl-table tr:hover { border-color: var(--ui-brand); }
}
@media (min-width: 768px) {
  /* A table in a card; it scrolls inside the card before the page ever would. */
  .ui-sl-tablecard { overflow-x: auto; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-1); }
  .ui-sl-table { display: table; }
  .ui-sl-table thead { display: table-header-group; }
  .ui-sl-table tbody { display: table-row-group; }
  .ui-sl-table tr { display: table-row; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  .ui-sl-table th, .ui-sl-table td, .ui-sl-table td.ui-sl-c-badge { display: table-cell; }
  .ui-sl-table th { height: 44px; padding: 0 16px; background: var(--ui-surface-2); border-bottom: 1px solid var(--ui-line); color: var(--ui-slate); font-size: 13px; line-height: 18px; font-weight: 600; text-align: left; white-space: nowrap; }
  .ui-sl-table td { height: 64px; padding: 8px 16px; border-bottom: 1px solid var(--ui-line); vertical-align: middle; white-space: nowrap; }
  .ui-sl-table tbody tr:last-child td { border-bottom: 0; }
  .ui-sl-table .ui-sl-num { text-align: right; }
  .ui-sl-table td.ui-sl-c-cust { white-space: normal; min-width: 180px; }
  .ui-sl-table td.ui-sl-c-badge > * + * { margin-left: 8px; }
  .ui-sl-table td.ui-sl-c-acts { margin-top: 0; }
  .ui-sl-acts { display: flex; flex-wrap: wrap; gap: 8px; }
  .ui-sl-acts .ui-btn { width: auto; padding: 0 14px; }
  a.ui-sl-cust::after { content: none; }
  a.ui-sl-cust:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; border-radius: var(--ui-radius-control); }
  .ui-sl-cust { min-height: 48px; }
  .ui-sl-cust__name { flex: 0 1 auto; font-size: 15px; line-height: 22px; }
  .ui-sl-cust--inv .ui-sl-cust__name { font-weight: 500; }
  .ui-sl-who__name, .ui-sl-who__email { display: block; }
  .ui-sl-sort { display: inline-flex; align-items: center; gap: 4px; min-width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ui-slate); font-family: var(--ui-font); font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; cursor: pointer; }
  .ui-sl-sort.is-on { color: var(--ui-ink); }
  .ui-sl-sort:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -2px; border-radius: var(--ui-radius-control); }
  .ui-sl-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 57px; margin: 0; padding: 0 20px; border-top: 1px solid var(--ui-line); }
  .ui-sl-foot .ui-btn { width: auto; min-height: 44px; font-size: 15px; line-height: 22px; }
  .ui-sl-requests + .ui-sl-foot { margin-top: 12px; border-top: 0; grid-template-columns: 1fr; justify-items: center; }
  .ui-sl-loading { padding: 20px; }
}
/* Desktop: the artboard's columns (Pipeline.dc.html, drawn at 1440), the customer takes the rest. */
@media (min-width: 1440px) {
  .ui-sl-table { table-layout: fixed; }
  .ui-sl-table td { overflow: hidden; text-overflow: ellipsis; }
  .ui-sl-table td.ui-sl-c-acts, .ui-sl-table td.ui-sl-c-badge { overflow: visible; }
  /* Money is never cut off: the column holds '$1,234,567.89', and the currency code
     drops under the number when the two do not fit on one line (Pipeline.dc.html
     draws whole dollars; real amounts carry cents). */
  .ui-sl-table td.ui-sl-c-amount { overflow: visible; text-overflow: clip; white-space: normal; }
  .ui-sl-table td.ui-sl-c-amount .ui-sl-amt { white-space: normal; }
  .ui-sl-table td.ui-sl-c-amount .ui-sl-code { white-space: nowrap; }
  /* Invoices: the customer's name and address end in an ellipsis, not a hard clip. */
  .ui-sl-who__name, .ui-sl-who__email { overflow: hidden; text-overflow: ellipsis; }
  .ui-sl-table th.ui-sl-w-date { width: 85px; }
  .ui-sl-table th.ui-sl-w-age { width: 95px; }
  .ui-sl-table th.ui-sl-w-status { width: 160px; }
  .ui-sl-table th.ui-sl-w-dealer { width: 105px; }
  .ui-sl-table th.ui-sl-w-amount { width: 144px; }
  .ui-sl-table th.ui-sl-w-acts2 { width: 279px; }
  .ui-sl-table th.ui-sl-w-acts1 { width: 184px; }
  .ui-sl-table th.ui-sl-w-who { width: 210px; }
  .ui-sl-acts { flex-wrap: nowrap; }
  .ui-sl-cust__name { overflow: hidden; text-overflow: ellipsis; }
}
/* Tablet and small laptop: the status sits under the age, the two buttons may stack. */
@media (min-width: 768px) and (max-width: 1439.98px) {
  .ui-sl-table td.ui-sl-c-badge > * + * { margin: 6px 0 0; }
  .ui-sl-table td.ui-sl-c-badge > .ui-badge, .ui-sl-table td.ui-sl-c-badge > span { display: flex; width: max-content; }
  .ui-sl-table td.ui-sl-c-acts { white-space: normal; }
  .ui-sl-table .ui-sl-cust__name, .ui-sl-table .ui-sl-cust__meta { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
}
@media (min-width: 768px) and (hover: hover) {
  .ui-sl-table tr:hover { border-color: transparent; }
  .ui-sl-table tbody tr:hover td { background: var(--ui-surface-2); }
  .ui-sl-sort:hover { color: var(--ui-ink); }
}

/* ── Requests: one card per request ─────────────────────────────────────── */
.ui-sl-requests { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ui-sl-request { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ui-sl-request__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ui-sl-request__org { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.ui-sl-request__who { margin: 0; font-size: 13px; line-height: 18px; color: var(--ui-slate); overflow-wrap: anywhere; }
.ui-sl-request__msg { margin: 4px 0 0; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.ui-sl-request__msg.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ui-sl-request__main > .ui-btn--tertiary { align-self: flex-start; margin-left: -12px; }
.ui-sl-request__acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) {
  .ui-sl-request { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px; }
  .ui-sl-request__acts { display: flex; flex-direction: column; gap: 8px; flex: none; width: 160px; }
}

/* ── The phone's Filters sheet (?panel=filters) ─────────────────────────── */
.ui-sl-sheet__box { gap: 16px; }
.ui-sl-switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.ui-sl-switchrow .ui-switch { margin-right: -8px; }
.ui-sl-sheet__foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 -16px; padding: 12px 16px 0; border-top: 1px solid var(--ui-line); }
.ui-sl-sheet__foot .ui-btn { width: 100%; padding: 0 12px; white-space: normal; }

/* ── The pipeline modal as the kit's drawer (index.html #pipeline-modal) ── */
/* Full screen on the phone, clear of the status bar and the home indicator. */
.ui-pm .ui-drawer__head { padding-top: var(--ui-safe-top); min-height: calc(64px + var(--ui-safe-top)); }
.ui-pm__title { min-width: 0; overflow-wrap: anywhere; }
.ui-pm__body { padding-bottom: calc(24px + var(--ui-safe-bottom)); }
/* Its forms are still the legacy ones (S8/S9 rebuild them). Every button, link,
   field and select in them is a 44 px target, and on the phone their fields get 16 px text
   so iOS does not zoom (the legacy markup sets 14 px inline: hence !important). */
.ui-pm__body button, .ui-pm__body a[href], .ui-pm__body select, .ui-pm__body textarea,
.ui-pm__body input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
/* Its checkboxes are the kit's check (input.ui-check above: a 44 px target drawn as a
   20 px box); the legacy markup sizes and spaces them inline, hence !important. */
.ui-pm__body input[type="checkbox"] { width: 44px !important; height: 44px !important; margin: 0 0 0 -12px !important; vertical-align: middle !important; }
/* …and the label around one is a row, so its text wraps beside the box, not under it. */
.ui-pm__body label:has(> input[type="checkbox"]) { display: flex; align-items: center; min-height: 44px; }
.ui-pm__body a[href] { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 767.98px) {
  .ui-pm__body input:not([type="checkbox"]):not([type="radio"]), .ui-pm__body select, .ui-pm__body textarea { font-size: 16px !important; }
}
@media (min-width: 768px) {
  .ui-pm .ui-drawer__head { padding-top: 0; min-height: 64px; }
  .ui-pm__body { padding-bottom: 24px; }
}

/* ── Which parts of a row show at which width (last, so they win) ──────── */
/* Cells are named with td/th so these outrank the cell rules above (0,2,1). */
.ui-sl-wide, .ui-sl-tab, .ui-sl-desk,
.ui-sl-table .ui-sl-wide, .ui-sl-table .ui-sl-tab, .ui-sl-table .ui-sl-desk,
.ui-sl-table td.ui-sl-wide, .ui-sl-table td.ui-sl-tab, .ui-sl-table td.ui-sl-desk { display: none; }
@media (min-width: 768px) {
  .ui-sl-phone, .ui-sl-notab, .ui-sl-table .ui-sl-phone, .ui-sl-table .ui-sl-notab,
  .ui-sl-table td.ui-sl-notab, .ui-sl-table th.ui-sl-notab, .ui-sl-table td.ui-sl-c-badge > .ui-sl-phone { display: none; }
  .ui-sl-wide, .ui-sl-tab, .ui-sl-table .ui-sl-tab { display: revert; }
  .ui-sl-table th.ui-sl-wide, .ui-sl-table td.ui-sl-wide, .ui-sl-table th.ui-sl-tab, .ui-sl-table td.ui-sl-tab { display: table-cell; }
  .ui-sl-tiles.ui-sl-wide { display: grid; }
  .ui-sl-select.ui-sl-wide, .ui-sl-result.ui-sl-wide, .ui-sl-cust__meta.ui-sl-wide { display: block; }
  .ui-sl-switch.ui-sl-wide, .ui-avatar.ui-sl-wide, .ui-sl-cust__badges.ui-sl-wide, .ui-sl-wide.ui-sl-inline { display: inline-flex; }
}
@media (min-width: 1440px) {
  .ui-sl-tab, .ui-sl-nodesk, .ui-sl-table .ui-sl-tab, .ui-sl-table .ui-sl-nodesk, .ui-sl-cust__meta.ui-sl-nodesk,
  .ui-sl-table td.ui-sl-tab, .ui-sl-table th.ui-sl-tab { display: none; }
  .ui-sl-desk, .ui-sl-notab, .ui-sl-table .ui-sl-desk { display: revert; }
  .ui-sl-table th.ui-sl-desk, .ui-sl-table td.ui-sl-desk, .ui-sl-table th.ui-sl-notab, .ui-sl-table td.ui-sl-notab { display: table-cell; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-scrim, .ui-dialog, .ui-sheet, .ui-drawer, .ui-toast, .ui-skeleton, .ui-spin,
  .ui-menu-sheet__scrim, .ui-menu-sheet__box, .ui-create__scrim, .ui-create__box, .ui-account.is-open { animation: none; }
  .ui-btn, .ui-tile, .ui-switch::before, .ui-switch::after { transition: none; }
}
