/* ============================================================================
   bos.css — the BOS look (chunk F9, 2026-11-04).

   Source of the look: the phone portal's design layer (WMS repo
   pbx2/portal/static/ds.css: navy left rail with icons and count pills, white
   cards with soft borders, pill buttons, Lato), with the WMS behaviour rules
   (docs/design_system.md §0, §12.1 phone drawer, §13.4 folding menu groups,
   §14 layout). Light only (Zalman 2026-11-04: "I do not need dark mode at
   all"). Every colour is a token below; pages use the tokens, never hex.

   RULE FOR PAGE BUILDERS: use the ds- classes and var(--ds-*) tokens, plus a
   page-local <style> for layout only. No new hex colours in a page. Macros for
   all of this live in templates/_components.html.

   COMPONENTS
     Type ......... .ds-h1 .ds-h2 .ds-h3 .ds-ov (overline) .ds-sub .ds-mut .ds-tnum .ds-a (link)
     Page ......... .ds-page > .ds-page-head > .ds-page-title + .ds-page-actions
                    .ds-grid-main (2/3 + 1/3)  .ds-stack  .ds-row (wrapping row)
     Buttons ...... .ds-b + .ds-b-pri | -ton | -out | -ghost | -danger | -stop
                    .ds-b-sm .ds-b-lg .ds-b-block .is-busy;  icon button .ds-ib (.ds-ib-o, .ds-ib-sm)
     Surfaces ..... .ds-card (.ds-card-h, .ds-card-b, .ds-card-f, .ds-card-flush)  .ds-divider
     Status ....... .ds-pill + .ds-pl-ok | -warn | -bad | -mid | -info (+ .ds-dot inside)
                    .ds-ct (count pill) + .ds-ct-alert
     People ....... .ds-av (round) .ds-av-sq (square client mark)
     Controls ..... .ds-in (input / textarea / select) .ds-field > .ds-lbl + .ds-in
                    .ds-in-wrap + .ds-unit  .ds-toggle  .ds-seg  .ds-tabs  .ds-srch
                    .ds-dd (styled select made by bos.js from select[data-dd])
     Help ......... .ds-help (the (i) chip, Rule AJ) + .ds-pop (its panel)
     Menus ........ .ds-menu-wrap > .ds-ib[data-menu] + .ds-menu > .ds-mi (.ds-mi-danger)
                    .ds-menu-sep .ds-menu-head — rare / destructive actions (Rule AQ)
     Tables ....... .ds-table-wrap > table.ds-table (.ds-num, .ds-strong, tr.on) .ds-cell-2
     Feedback ..... .ds-note + -ok | -warn | -bad | -info (inline banner; no toasts)
                    .ds-empty (.ds-empty-ic)  .ds-skel (loading)
     Modals ....... .ds-back > .ds-modal > .ds-mh / .ds-mb / .ds-mf  (bos.js BOS.open)
     Dashboard .... .ds-strip (headline numbers) .ds-meter (bar) .ds-minis .ds-pcard
                    .ds-list > .ds-li  .ds-bars
     Shell ........ .ds-rail* .ds-top* .ds-viewas (in _shell.html — chrome only)
   ============================================================================ */

/* ---------------------------------- fonts --------------------------------- */
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/lato-regular.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/lato-bold.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 900; font-display: swap; src: url('fonts/lato-black.woff2') format('woff2'); }

/* --------------------------------- tokens --------------------------------- */
:root {
    color-scheme: light;
    --ds-font: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* accent = meaning only: action, link, selected */
    --ds-pri: #1a6fe0;            /* primary button fill (white text, 4.9:1) */
    --ds-pri-hover: #1557b0;
    --ds-on-pri: #ffffff;
    --ds-link: #1a62c9;
    --ds-blue: #1a73e8;           /* bars, dots, focus */
    --ds-blue-soft: #e8f0fe;
    --ds-blue-tonal: #d3e3fd;
    --ds-blue-tonal-hover: #c0d6f7;
    --ds-blue-ink: #174ea6;
    --ds-on-tonal: #0b2e6b;

    /* ink */
    --ds-head: #0f1d3a;
    --ds-ink: #1f2430;
    --ds-ink-2: #3c4350;
    --ds-mut: #5c6370;
    --ds-mut-2: #6b7280;

    /* surfaces + lines */
    --ds-canvas: #f5f6f9;
    --ds-surface: #ffffff;
    --ds-sunk: #f8f9fb;
    --ds-hover: #eef0f4;
    --ds-line: #d8dbe1;
    --ds-line-strong: #c3c7cf;
    --ds-line-soft: #e8eaee;
    --ds-track: #eaedf2;
    --ds-row-hover: #f7f9fd;
    --ds-row-on: #eef4ff;

    /* meaning */
    --ds-ok: #188038;   --ds-ok-ink: #137333;   --ds-ok-bg: #e6f4ea;
    --ds-warn: #e8a000; --ds-warn-ink: #6e4d00; --ds-warn-bg: #fef4d8;
    --ds-bad: #d93a45;  --ds-bad-ink: #b3261e;  --ds-bad-bg: #fce8e6; --ds-bad-line: #f3c4c0;
    --ds-mid: #9aa0aa;  --ds-mid-ink: #3c4350;  --ds-mid-bg: #eef0f4;
    --ds-stop: #c92f3b;  /* white text on it: 5.3:1 — stop buttons, red count pills */

    /* the rail (navy in both themes) */
    --ds-rail-w: 240px;
    --ds-rail-slim: 72px;
    --ds-rail-bg: linear-gradient(180deg, #0f1d3a 0%, #132347 100%);
    --ds-rail-solid: #132347;
    --ds-rail-ink: #c9d1e1;
    --ds-rail-mut: #8d9dbd;
    --ds-rail-hover: rgba(255,255,255,.06);
    --ds-rail-on: rgba(255,255,255,.11);
    --ds-rail-line: rgba(255,255,255,.08);
    --ds-rail-accent: #7fb0ff;

    /* the (i) panel and dark chips */
    --ds-pop-bg: #0f1d3a;
    --ds-pop-ink: #e6ebf5;
    --ds-scrim: rgba(15,29,58,.42);

    /* spacing — one 4 px scale */
    --ds-s1: 4px; --ds-s2: 8px; --ds-s3: 12px; --ds-s4: 16px; --ds-s5: 20px; --ds-s6: 24px; --ds-s8: 32px;

    /* radii — one scale */
    --ds-r-sm: 8px;
    --ds-r: 10px;
    --ds-r-card: 14px;
    --ds-r-float: 18px;
    --ds-r-pill: 999px;

    /* elevation */
    --ds-sh-card: 0 0 0 1px rgba(15,29,58,.07), 0 1px 2px rgba(15,29,58,.04), 0 2px 6px -2px rgba(15,29,58,.05);
    --ds-sh-card-hover: 0 0 0 1px rgba(15,29,58,.10), 0 2px 4px rgba(15,29,58,.05), 0 8px 20px -8px rgba(15,29,58,.16);
    --ds-sh-float: 0 0 0 1px rgba(15,29,58,.07), 0 30px 60px -18px rgba(15,29,58,.38), 0 10px 22px -10px rgba(15,29,58,.18);
    --ds-sh-menu: 0 0 0 1px rgba(15,29,58,.08), 0 18px 40px -12px rgba(15,29,58,.30), 0 4px 12px -4px rgba(15,29,58,.12);
    --ds-ring: 0 0 0 3px rgba(26,115,232,.32);
    --ds-ring-c: #1a73e8;
}

/* ---------------------------------- base ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--ds-font); font-size: 14px; line-height: 1.45;
    color: var(--ds-ink); background: var(--ds-canvas);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--ds-link); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
/* no monospace anywhere: codes, card digits and step ids are Lato with even-width figures */
code, kbd, samp, pre { font-family: var(--ds-font); font-variant-numeric: tabular-nums; font-size: inherit; }
[hidden] { display: none !important; }
.ds-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-skip { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 8px 14px; border-radius: var(--ds-r); background: var(--ds-pri); color: var(--ds-on-pri); font-weight: 700; text-decoration: none; }
.ds-skip:focus { top: 12px; outline: none; box-shadow: var(--ds-ring); }

/* ---------------------------------- type ---------------------------------- */
.ds-h1 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; color: var(--ds-head); margin: 0; }
.ds-h2 { font-size: 16px; font-weight: 900; letter-spacing: -.005em; line-height: 1.3; color: var(--ds-head); margin: 0; }
.ds-h3 { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ds-head); margin: 0; }
.ds-ov { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ds-mut-2); }
.ds-sub { font-size: 14px; color: var(--ds-mut); margin: 4px 0 0; }
.ds-mut { color: var(--ds-mut); }
.ds-small { font-size: 12.5px; }
.ds-tnum { font-variant-numeric: tabular-nums; }
.ds-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ds-a { color: var(--ds-link); font-weight: 700; text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; font: inherit; font-weight: 700; }
.ds-a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ds-a:focus-visible { outline: none; box-shadow: var(--ds-ring); border-radius: 4px; }

/* ---------------------------------- page ---------------------------------- */
.ds-page { padding: 28px 32px 48px; max-width: 1480px; min-width: 0; }
.ds-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; min-height: 40px; }
.ds-page-title { min-width: 0; flex: 1 1 220px; }
.ds-page-title .ds-h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.ds-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ds-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ds-sec-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; min-width: 0; flex-wrap: wrap; }
.ds-sec-h > .ds-sec-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* -------------------------------- buttons --------------------------------- */
.ds-b {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 36px; padding: 0 16px; border-radius: var(--ds-r-pill); border: none;
    font-family: var(--ds-font); font-size: 13.5px; font-weight: 700; line-height: 1;
    cursor: pointer; white-space: nowrap; text-decoration: none; position: relative;
    transition: background .15s ease, box-shadow .15s ease, color .15s ease;
}
.ds-b svg { width: 16px; height: 16px; flex: none; }
.ds-b:hover { text-decoration: none; }
.ds-b:active:not(:disabled) { transform: translateY(1px); }
.ds-b:focus-visible { outline: none; box-shadow: var(--ds-ring); }
.ds-b:disabled, .ds-b[aria-disabled="true"] { opacity: .5; cursor: default; }
.ds-b.is-busy { cursor: progress; opacity: .75; }
.ds-b-pri { background: var(--ds-pri); color: var(--ds-on-pri); }
.ds-b-pri:hover:not(:disabled) { background: var(--ds-pri-hover); color: var(--ds-on-pri); }
.ds-b-ton { background: var(--ds-blue-tonal); color: var(--ds-on-tonal); }
.ds-b-ton:hover:not(:disabled) { background: var(--ds-blue-tonal-hover); }
.ds-b-out { background: var(--ds-surface); color: var(--ds-ink); box-shadow: inset 0 0 0 1px var(--ds-line); }
.ds-b-out:hover:not(:disabled) { background: var(--ds-sunk); box-shadow: inset 0 0 0 1px var(--ds-line-strong); }
.ds-b-out:focus-visible { box-shadow: inset 0 0 0 1px var(--ds-ring-c), var(--ds-ring); }
.ds-b-ghost { background: transparent; color: var(--ds-ink-2); }
.ds-b-ghost:hover:not(:disabled) { background: var(--ds-hover); color: var(--ds-ink); }
.ds-b-danger { background: var(--ds-surface); color: var(--ds-bad-ink); box-shadow: inset 0 0 0 1px var(--ds-bad-line); }
.ds-b-danger:hover:not(:disabled) { background: var(--ds-bad-bg); }
/* stops money (Pause / Emergency stop): never quieter than the button that spends it */
.ds-b-stop { background: var(--ds-stop); color: #fff; }
.ds-b-stop:hover:not(:disabled) { filter: brightness(1.07); }
.ds-b-sm { height: 30px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.ds-b-sm svg { width: 14px; height: 14px; }
.ds-b-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.ds-b-block { width: 100%; }

.ds-ib {
    width: 36px; height: 36px; border-radius: var(--ds-r); border: none; background: transparent;
    color: var(--ds-mut); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; flex: none; padding: 0; position: relative; transition: background .15s, color .15s;
}
.ds-ib svg { width: 18px; height: 18px; }
.ds-ib:hover { background: var(--ds-hover); color: var(--ds-ink); }
.ds-ib:focus-visible { outline: none; box-shadow: var(--ds-ring); }
.ds-ib[aria-expanded="true"] { background: var(--ds-blue-soft); color: var(--ds-blue-ink); box-shadow: inset 0 0 0 1px var(--ds-blue); }
.ds-ib-o { background: var(--ds-surface); box-shadow: inset 0 0 0 1px var(--ds-line); }
.ds-ib-sm { width: 30px; height: 30px; border-radius: var(--ds-r-sm); }
.ds-ib-sm svg { width: 16px; height: 16px; }

/* -------------------------------- surfaces -------------------------------- */
.ds-card { background: var(--ds-surface); border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-card); min-width: 0; }
.ds-card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; min-width: 0; }
.ds-card-h .ds-h2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ds-card-h > .ds-card-act { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.ds-card-b { padding: 0 20px 20px; }
.ds-card-f { padding: 12px 20px; border-top: 1px solid var(--ds-line-soft); font-size: 13px; color: var(--ds-mut); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-card-flush { padding: 0; }
.ds-divider { height: 1px; background: var(--ds-line-soft); border: 0; margin: 0; }

/* --------------------------------- status --------------------------------- */
.ds-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--ds-r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1; flex: none; }
.ds-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: currentColor; }
.ds-pl-ok { background: var(--ds-ok-bg); color: var(--ds-ok-ink); }       .ds-pl-ok .ds-dot { background: var(--ds-ok); }
.ds-pl-warn { background: var(--ds-warn-bg); color: var(--ds-warn-ink); } .ds-pl-warn .ds-dot { background: var(--ds-warn); }
.ds-pl-bad { background: var(--ds-bad-bg); color: var(--ds-bad-ink); }    .ds-pl-bad .ds-dot { background: var(--ds-bad); }
.ds-pl-mid { background: var(--ds-mid-bg); color: var(--ds-mid-ink); }    .ds-pl-mid .ds-dot { background: var(--ds-mid); }
.ds-pl-line { background: transparent; color: var(--ds-ink-2); box-shadow: inset 0 0 0 1px var(--ds-line); font-weight: 700; }
.ds-pl-line svg { width: 13px; height: 13px; color: var(--ds-mut-2); }
.ds-pl-info { background: var(--ds-blue-soft); color: var(--ds-blue-ink); } .ds-pl-info .ds-dot { background: var(--ds-blue); }
/* a live thing (ordering now): the dot breathes, unless reduced motion */
.ds-dot.live { box-shadow: 0 0 0 0 currentColor; animation: ds-live 2.4s ease-out infinite; color: var(--ds-blue); }
@keyframes ds-live { 0% { box-shadow: 0 0 0 0 rgba(26,115,232,.45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(26,115,232,0); } }
.ds-ct { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--ds-r-pill); font-size: 11.5px; font-weight: 900; background: var(--ds-blue-soft); color: var(--ds-blue-ink); font-variant-numeric: tabular-nums; flex: none; }
.ds-ct-alert { background: var(--ds-stop); color: #fff; }
.ds-ct-mid { background: var(--ds-mid-bg); color: var(--ds-mid-ink); }

.ds-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; color: #fff; letter-spacing: .02em; background: linear-gradient(135deg, #1557b0, #4a90e8); }
.ds-av-sq { flex: none; width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13.5px; letter-spacing: .02em; color: var(--ds-blue-ink); background: var(--ds-blue-soft); }
.ds-av-sq.t1 { color: #0b6b5f; background: #e0f5f1; } .ds-av-sq.t2 { color: #6a1fa8; background: #f3e8fd; }
.ds-av-sq.t3 { color: #8a4b00; background: #fef3e0; } .ds-av-sq.t4 { color: #a3134a; background: #fde7ef; }

/* -------------------------------- controls -------------------------------- */
.ds-in {
    width: 100%; min-width: 0; height: 40px; padding: 0 12px;
    border: none; border-radius: var(--ds-r); background: var(--ds-surface);
    box-shadow: inset 0 0 0 1px var(--ds-line); font-family: var(--ds-font); font-size: 14px; color: var(--ds-ink);
    outline: none; transition: box-shadow .15s;
}
textarea.ds-in { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
select.ds-in { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; }
.ds-in:hover { box-shadow: inset 0 0 0 1px var(--ds-line-strong); }
.ds-in:focus { box-shadow: inset 0 0 0 1px var(--ds-ring-c), var(--ds-ring); }
.ds-in::placeholder { color: var(--ds-mut-2); }
.ds-in:disabled { background: var(--ds-sunk); color: var(--ds-mut); cursor: default; }
.ds-in.ds-in-bad, .ds-in[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--ds-bad); }
.ds-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ds-lbl { font-size: 12.5px; font-weight: 700; color: var(--ds-ink-2); display: flex; align-items: center; gap: 6px; }
.ds-err { font-size: 12.5px; font-weight: 700; color: var(--ds-bad-ink); }
.ds-in-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.ds-in-wrap .ds-in { padding-right: 52px; }
.ds-in-wrap .ds-unit { position: absolute; right: 12px; font-size: 12.5px; color: var(--ds-mut-2); pointer-events: none; }
.ds-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.ds-toggle { position: relative; display: inline-flex; width: 40px; height: 24px; flex: none; cursor: pointer; }
.ds-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.ds-toggle span { position: absolute; inset: 0; border-radius: var(--ds-r-pill); background: var(--ds-line-strong); transition: background .18s; }
.ds-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,29,58,.3); transition: transform .18s ease; }
.ds-toggle input:checked + span { background: var(--ds-pri); }
.ds-toggle input:checked + span::after { transform: translateX(16px); }
.ds-toggle input:focus-visible + span { box-shadow: var(--ds-ring); }
.ds-toggle input:disabled + span { opacity: .5; }
.ds-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }

.ds-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--ds-hover); border-radius: var(--ds-r); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ds-seg::-webkit-scrollbar { display: none; }
.ds-seg > button, .ds-seg > a { height: 30px; padding: 0 12px; border: none; background: transparent; border-radius: var(--ds-r-sm); font-size: 13px; font-weight: 700; color: var(--ds-mut); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; flex: none; }
.ds-seg > button:hover, .ds-seg > a:hover { color: var(--ds-head); }
.ds-seg > .on, .ds-seg > [aria-pressed="true"], .ds-seg > [aria-current] { background: var(--ds-surface); color: var(--ds-head); box-shadow: 0 1px 2px rgba(15,29,58,.10), 0 0 0 1px rgba(15,29,58,.05); }
.ds-seg > button:focus-visible, .ds-seg > a:focus-visible { outline: none; box-shadow: var(--ds-ring); }
.ds-seg .ds-n { font-size: 11px; color: var(--ds-mut-2); font-variant-numeric: tabular-nums; }
.ds-seg > .on .ds-n, .ds-seg > [aria-pressed="true"] .ds-n { color: var(--ds-blue-ink); }

.ds-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ds-line-soft); overflow-x: auto; scrollbar-width: none; }
.ds-tabs::-webkit-scrollbar { display: none; }
.ds-tabs > a, .ds-tabs > button { flex: none; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: none; background: none; font-size: 14px; font-weight: 700; color: var(--ds-mut); cursor: pointer; text-decoration: none; position: relative; white-space: nowrap; }
.ds-tabs > a:hover, .ds-tabs > button:hover { color: var(--ds-head); }
.ds-tabs > .on, .ds-tabs > [aria-selected="true"], .ds-tabs > [aria-current] { color: var(--ds-link); }
.ds-tabs > .on::after, .ds-tabs > [aria-selected="true"]::after, .ds-tabs > [aria-current]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ds-blue); }
.ds-tabs > a:focus-visible, .ds-tabs > button:focus-visible { outline: none; box-shadow: inset var(--ds-ring); border-radius: var(--ds-r-sm); }

.ds-srch { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--ds-r); background: var(--ds-surface); box-shadow: inset 0 0 0 1px var(--ds-line); color: var(--ds-mut-2); min-width: 0; }
.ds-srch:focus-within { box-shadow: inset 0 0 0 1px var(--ds-ring-c), var(--ds-ring); }
.ds-srch svg { width: 16px; height: 16px; flex: none; }
.ds-srch input { border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--ds-ink); width: 100%; min-width: 0; padding: 0; }
.ds-srch input::placeholder { color: var(--ds-mut-2); }

/* styled select (bos.js builds it from <select data-dd>; the real select stays for forms) */
.ds-dd { position: relative; min-width: 0; width: 100%; }
.ds-dd > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.ds-dd-btn { width: 100%; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: none; border-radius: var(--ds-r); background: var(--ds-surface); box-shadow: inset 0 0 0 1px var(--ds-line); color: var(--ds-ink); font-size: 14px; text-align: left; cursor: pointer; }
.ds-dd-btn:hover { box-shadow: inset 0 0 0 1px var(--ds-line-strong); }
.ds-dd-btn:focus-visible, .ds-dd-btn[aria-expanded="true"] { outline: none; box-shadow: inset 0 0 0 1px var(--ds-ring-c), var(--ds-ring); }
.ds-dd-btn > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-dd-btn > svg { width: 16px; height: 16px; color: var(--ds-mut-2); flex: none; }
.ds-dd-btn:disabled { background: var(--ds-sunk); color: var(--ds-mut); cursor: default; }
.ds-dd .ds-menu { left: 0; right: 0; width: auto; max-height: 280px; overflow-y: auto; }
.ds-dd .ds-mi[aria-selected="true"] { color: var(--ds-link); }
.ds-dd .ds-mi[aria-selected="true"]::after { content: ""; margin-left: auto; width: 14px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(2px, -2px); }

/* --------------------------------- help (i) -------------------------------- */
.ds-help { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-mut); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; cursor: pointer; padding: 0; flex: none; font-family: Georgia, 'Times New Roman', serif; font-style: italic; line-height: 1; vertical-align: middle; }
.ds-help:hover { color: var(--ds-link); border-color: var(--ds-blue); }
.ds-help:focus-visible { outline: none; box-shadow: var(--ds-ring); }
.ds-help[aria-expanded="true"] { background: var(--ds-pri); border-color: var(--ds-pri); color: #fff; }
.ds-pop { position: fixed; z-index: 1270; width: min(340px, calc(100vw - 24px)); padding: 14px 16px; background: var(--ds-pop-bg); color: var(--ds-pop-ink); border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-float); font-size: 13px; line-height: 1.5; font-weight: 400; font-style: normal; font-family: var(--ds-font); text-transform: none; letter-spacing: 0; }
.ds-pop b, .ds-pop strong { color: #fff; }
.ds-pop p { margin: 0; } .ds-pop p + p { margin-top: 8px; }
.ds-pop ul { margin: 0; padding-left: 18px; } .ds-pop li + li { margin-top: 4px; }

/* ---------------------------------- menus ---------------------------------- */
.ds-menu-wrap { position: relative; display: inline-flex; }
.ds-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; min-width: 200px; padding: 6px; background: var(--ds-surface); border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-menu); display: none; width: max-content; max-width: calc(100vw - 16px); text-align: left; }
.ds-menu.open { display: block; }
.ds-menu.ds-menu-left { left: 0; right: auto; }
.ds-mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 12px; border: none; background: none; border-radius: var(--ds-r-sm); font-size: 14px; font-weight: 700; color: var(--ds-ink); text-align: left; cursor: pointer; text-decoration: none; white-space: nowrap; }
.ds-mi svg { width: 17px; height: 17px; flex: none; color: var(--ds-mut); }
.ds-mi:hover, .ds-mi:focus-visible { background: var(--ds-hover); outline: none; text-decoration: none; color: var(--ds-ink); }
.ds-mi:disabled { opacity: .5; cursor: default; }
.ds-mi-danger, .ds-mi-danger svg { color: var(--ds-bad-ink); }
.ds-mi-danger:hover, .ds-mi-danger:focus-visible { background: var(--ds-bad-bg); color: var(--ds-bad-ink); }
.ds-menu-sep { height: 1px; background: var(--ds-line-soft); margin: 6px 4px; }
.ds-menu-head { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ds-mut-2); }

/* --------------------------------- tables --------------------------------- */
.ds-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--ds-ink); }
.ds-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ds-mut-2); padding: 12px 16px 10px; border-bottom: 1px solid var(--ds-line-soft); vertical-align: bottom; line-height: 1.3; }
.ds-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ds-table th button:focus-visible { box-shadow: var(--ds-ring); border-radius: 4px; }
.ds-table th[aria-sort] { color: var(--ds-ink-2); }
.ds-table td { padding: 12px 16px; border-bottom: 1px solid var(--ds-line-soft); vertical-align: middle; }
.ds-table tbody tr { transition: background .12s; }
.ds-table tbody tr:hover { background: var(--ds-row-hover); }
.ds-table tbody tr.on { background: var(--ds-row-on); }
.ds-table tbody tr:last-child td { border-bottom: none; }
.ds-table th:first-child, .ds-table td:first-child { padding-left: 20px; }
.ds-table th:last-child, .ds-table td:last-child { padding-right: 20px; }
.ds-table .ds-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-table th.ds-num { white-space: normal; }
.ds-table .ds-strong { font-weight: 700; color: var(--ds-head); }
.ds-table .ds-act { width: 1%; white-space: nowrap; text-align: right; }
.ds-table td { overflow-wrap: break-word; }
/* fixed columns (WMS design_system §7.3): every dense table carries ds-fixed and a
   <colgroup> of widths, so a long value never pushes the other columns around. A name,
   store or account is one line with an ellipsis (.ds-clip, full text in title=""); a
   wrapping cell breaks between words only (break-word, never anywhere). Under its
   --ds-minw the table scrolls inside its card instead of squashing. */
.ds-table.ds-fixed { table-layout: fixed; min-width: var(--ds-minw, 0); }
.ds-table.ds-fixed th { white-space: normal; overflow-wrap: normal; }
.ds-table .ds-clip, .ds-table .ds-clip > a, .ds-cell-2 > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ds-table .ds-clip > a { display: block; }
.ds-table .ds-nw { white-space: nowrap; }
.ds-table col.c-tick { width: 52px; } .ds-table col.c-act { width: 64px; }
.ds-cell-2 { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; gap: 1px; }
.ds-cell-2 > :last-child:not(:first-child) { font-size: 12.5px; color: var(--ds-mut); }
.ds-cell-2 > a:first-child, .ds-cell-2 > b:first-child { font-weight: 700; color: var(--ds-head); text-decoration: none; }
.ds-cell-2 > a:first-child:hover { text-decoration: underline; text-underline-offset: 2px; }
.ds-cell-2 > a:first-child:focus-visible { outline: none; box-shadow: var(--ds-ring); border-radius: 4px; }
.ds-sub-bad { display: block; font-size: 12px; font-weight: 700; color: var(--ds-bad-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* sortable column heads: the whole head is the button; the arrow shows on the sorted one */
.ds-table th a.ds-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.ds-table th a.ds-sort:hover { color: var(--ds-head); }
.ds-table th a.ds-sort:focus-visible { outline: none; box-shadow: var(--ds-ring); border-radius: 4px; }
.ds-table th a.ds-sort svg { width: 12px; height: 12px; flex: none; }
.ds-table th.ds-num a.ds-sort { flex-direction: row-reverse; }
/* one pager for every list (WMS design_system §7.1) */
.ds-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 10px 20px; border-top: 1px solid var(--ds-line-soft); font-size: 13px; color: var(--ds-mut); }
.ds-pager-n { font-variant-numeric: tabular-nums; }
.ds-pager-b { display: flex; gap: 4px; }
/* one filter bar for every list: changes apply at once (bos.js), no "Show …" button */
.ds-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--ds-line-soft); }
.ds-filters .ds-field { flex: 0 1 190px; min-width: 140px; }
.ds-filters .ds-field .ds-lbl { font-size: 11.5px; color: var(--ds-mut); }
.ds-filters .ds-srch { flex: 1 1 240px; height: 40px; }
.ds-filters .ds-filters-x { flex: none; margin-left: auto; align-self: center; }
/* a folding filter bar: on a desktop the fold is invisible (its fields sit in the bar) */
.ds-filters-more { display: block; flex: 999 1 380px; min-width: 0; }
.ds-filters-more > .ds-filters-sum { display: none; }
.ds-filters-in { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.ds-filters-f > .ds-srch { order: 2; align-self: flex-end; }
.ds-filters-f > .ds-filters-x { order: 3; }
@media (max-width: 760px) {
    .ds-filters-f .ds-filters-more { flex: 1 1 100%; }
    .ds-filters-f > .ds-srch { order: -1; }
    .ds-filters-f .ds-filters-more > .ds-filters-sum { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--ds-r); box-shadow: inset 0 0 0 1px var(--ds-line); background: var(--ds-surface); font-size: 14px; font-weight: 700; color: var(--ds-ink-2); cursor: pointer; list-style: none; }
    .ds-filters-f .ds-filters-sum::-webkit-details-marker { display: none; }
    .ds-filters-f .ds-filters-sum svg { width: 16px; height: 16px; color: var(--ds-mut-2); }
    .ds-filters-f .ds-filters-sum .ds-fold-caret { margin-left: auto; }
    .ds-filters-f .ds-filters-sum:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--ds-ring-c), var(--ds-ring); }
    .ds-filters-f .ds-filters-more[open] > .ds-filters-in { display: flex; flex-wrap: wrap; gap: 8px 10px; padding-top: 10px; }
    .ds-filters-f .ds-filters-more:not([open]) .ds-fold-caret { transform: rotate(-90deg); }
    .ds-filters { padding: 12px 16px; gap: 8px 10px; }
    .ds-filters .ds-field { flex: 1 1 calc(50% - 5px); min-width: 0; }
    .ds-filters .ds-srch { flex: 1 1 100%; }
    .ds-filters .ds-filters-x { margin-left: 0; }
}
.ds-filters + .ds-table-wrap .ds-table th { padding-top: 12px; }

/* -------------------------------- feedback -------------------------------- */
.ds-note { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--ds-r); font-size: 13.5px; line-height: 1.45; background: var(--ds-blue-soft); color: var(--ds-blue-ink); overflow-wrap: anywhere; }
.ds-note > svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.ds-note > .ds-note-t { flex: 1; min-width: 0; }
.ds-note > .ds-note-act { flex: none; margin: -4px -4px -4px 0; }
.ds-note-ok { background: var(--ds-ok-bg); color: var(--ds-ok-ink); }
.ds-note-warn { background: var(--ds-warn-bg); color: var(--ds-warn-ink); }
.ds-note-bad { background: var(--ds-bad-bg); color: var(--ds-bad-ink); }
.ds-note-info { background: var(--ds-blue-soft); color: var(--ds-blue-ink); }
.ds-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--ds-mut); font-size: 14px; }
.ds-empty-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--ds-blue-soft); color: var(--ds-blue-ink); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.ds-empty-ic svg { width: 24px; height: 24px; }
.ds-empty-t { font-size: 15px; font-weight: 900; color: var(--ds-head); }
.ds-empty .ds-b { margin-top: 8px; }
.ds-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--ds-hover) 0%, var(--ds-sunk) 50%, var(--ds-hover) 100%); background-size: 200% 100%; animation: ds-skel 1.4s ease-in-out infinite; height: 12px; }
@keyframes ds-skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --------------------------------- modals --------------------------------- */
.ds-back { position: fixed; inset: 0; z-index: 1240; background: var(--ds-scrim); display: none; align-items: center; justify-content: center; padding: 16px; }
.ds-back.open { display: flex; }
.ds-modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--ds-surface); border-radius: var(--ds-r-float); box-shadow: var(--ds-sh-float); color: var(--ds-ink); }
.ds-modal.wide { max-width: 640px; }
.ds-mh { display: flex; align-items: center; gap: 12px; padding: 20px 24px 8px; }
.ds-mh h2, .ds-mh h3 { font-size: 18px; font-weight: 900; color: var(--ds-head); margin: 0; letter-spacing: -.01em; line-height: 1.3; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ds-mh .ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--ds-blue-soft); color: var(--ds-blue-ink); }
.ds-mh .ic.bad { background: var(--ds-bad-bg); color: var(--ds-bad-ink); }
.ds-mh .ic svg { width: 20px; height: 20px; }
.ds-mb { padding: 8px 24px 4px; font-size: 14px; line-height: 1.5; color: var(--ds-ink-2); }
.ds-mb p { margin: 0 0 10px; }
.ds-mb .ds-field + .ds-field { margin-top: 12px; }
.ds-mf { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 16px 24px 20px; flex-wrap: wrap; }
.ds-mf .ds-msg { margin-right: auto; }
.ds-msg { font-size: 12.5px; font-weight: 700; color: var(--ds-mut); overflow-wrap: anywhere; }
.ds-msg.ok { color: var(--ds-ok-ink); } .ds-msg.err { color: var(--ds-bad-ink); } .ds-msg:empty { display: none; }

/* ============================ DASHBOARD PIECES ============================ */
/* headline strip: one card, hairline-divided cells (WMS design_system §14.6) */
.ds-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--ds-surface); border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-card); overflow: hidden; }
.ds-strip-c { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 18px; min-width: 0; color: inherit; text-decoration: none; position: relative; }
.ds-strip-c + .ds-strip-c { box-shadow: inset 1px 0 0 var(--ds-line-soft); }
a.ds-strip-c:hover { background: var(--ds-row-hover); }
a.ds-strip-c:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ds-ring-c); }
.ds-strip-v { font-size: 28px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; color: var(--ds-head); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ds-strip-v small { font-size: 14px; font-weight: 700; color: var(--ds-mut); letter-spacing: 0; }
.ds-strip-s { font-size: 12.5px; color: var(--ds-mut); }
.ds-strip-c.bad .ds-strip-v { color: var(--ds-bad-ink); }
.ds-strip-c .ds-meter { margin-top: 4px; }
a.ds-strip-c .ds-go { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; color: var(--ds-mut-2); opacity: 0; transition: opacity .12s; }
a.ds-strip-c:hover .ds-go, a.ds-strip-c:focus-visible .ds-go { opacity: 1; }

/* a thin bar; spans inside are segments (widths inline) */
.ds-meter { display: flex; height: 6px; border-radius: var(--ds-r-pill); background: var(--ds-track); overflow: hidden; gap: 2px; }
.ds-meter > span { display: block; height: 100%; background: var(--ds-blue); min-width: 0; }
.ds-meter > span:first-child { border-radius: var(--ds-r-pill) 0 0 var(--ds-r-pill); }
.ds-meter > .ok { background: var(--ds-ok); } .ds-meter > .warn { background: var(--ds-warn); }
.ds-meter > .bad { background: var(--ds-bad); } .ds-meter > .mid { background: var(--ds-mid); }
.ds-meter.lg { height: 8px; }

/* mini stat row: label over number, hairline-divided */
.ds-minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ds-line-soft); border-radius: var(--ds-r); }
.ds-mini { padding: 8px 10px; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.ds-mini + .ds-mini { border-left: 1px solid var(--ds-line-soft); }
.ds-mini-l { font-size: 11px; font-weight: 700; color: var(--ds-mut-2); line-height: 1.2; min-height: 2.4em; display: flex; align-items: flex-end; }
.ds-mini-v { font-size: 16px; font-weight: 900; color: var(--ds-head); font-variant-numeric: tabular-nums; line-height: 1.2; }
.ds-mini.bad .ds-mini-v { color: var(--ds-bad-ink); }
.ds-mini.zero .ds-mini-v { color: var(--ds-mut-2); font-weight: 700; }
a.ds-mini:hover { background: var(--ds-row-hover); }
a.ds-mini:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ds-ring-c); border-radius: var(--ds-r-sm); }

/* project card */
.ds-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.ds-pcard { container-type: inline-size; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; background: var(--ds-surface); border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-card); min-width: 0; position: relative; transition: box-shadow .15s; }
.ds-pcard:hover { box-shadow: var(--ds-sh-card-hover); }
.ds-pcard:focus-within { box-shadow: var(--ds-sh-card-hover); }
.ds-pcard-h { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.ds-pcard-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ds-pcard-name { font-size: 15.5px; font-weight: 900; color: var(--ds-head); text-decoration: none; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap:break-word; }
.ds-pcard-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.ds-pcard-name:focus-visible { outline: none; box-shadow: var(--ds-ring); border-radius: 4px; }
.ds-pcard-meta { font-size: 12.5px; color: var(--ds-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-pcard-side { display: flex; align-items: center; gap: 2px; flex: none; margin: -2px -6px 0 0; }
.ds-pcard-goal { font-size: 13px; color: var(--ds-ink-2); margin: -4px 0 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap:break-word; }
.ds-prog { display: flex; flex-direction: column; gap: 6px; }
.ds-prog-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ds-mut); }
.ds-prog-top b { font-size: 15px; font-weight: 900; color: var(--ds-head); font-variant-numeric: tabular-nums; }
.ds-money { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ds-mut); flex-wrap: wrap; }
.ds-money b { font-size: 13.5px; font-weight: 900; color: var(--ds-head); font-variant-numeric: tabular-nums; }
.ds-money .over { color: var(--ds-warn-ink); font-weight: 700; }
.ds-pcard-next { display: flex; align-items: center; gap: 10px; padding-top: 12px; margin-top: auto; border-top: 1px solid var(--ds-line-soft); font-size: 13px; min-width: 0; }
.ds-pcard-next .ds-next-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ds-pcard-next .ds-next-l { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ds-mut-2); }
.ds-pcard-next .ds-next-v { font-weight: 700; color: var(--ds-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-pcard-next .ds-next-v.bad { color: var(--ds-bad-ink); }
.ds-pcard-next .ds-next-m { font-size: 12px; color: var(--ds-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* a card that folds (details > summary.ds-card-h). data-phone-fold: open on a
   desktop, folded to its head and count on a phone (bos.js) */
details.ds-fold > summary { list-style: none; cursor: pointer; border-radius: var(--ds-r-card); }
details.ds-fold > summary::-webkit-details-marker { display: none; }
details.ds-fold > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ds-ring-c); }
details.ds-fold > summary .ds-card-act { margin-left: auto; }
.ds-fold-caret { width: 18px; height: 18px; flex: none; color: var(--ds-mut-2); transition: transform .15s ease; }
details.ds-fold > summary > .ds-fold-caret { margin-left: auto; }
details.ds-fold > summary > .ds-card-act + .ds-fold-caret { margin-left: 4px; }
details.ds-fold:not([open]) .ds-fold-caret { transform: rotate(-90deg); }
details.ds-fold:not([open]) > summary { padding-bottom: 16px; }
details.ds-fold > :last-child:not(summary) { padding-bottom: 6px; }
.ds-anchor { scroll-margin-top: 76px; }

/* phone jump bar: one tap to any section (WMS design_system §14.6) */
.ds-jump { display: none; }

@container (max-width: 290px) {
    .ds-mini { padding: 8px 6px 8px 8px; }
    .ds-mini-l { font-size: 10.5px; }
}

/* side lists: lead · text · trail */
.ds-list { display: flex; flex-direction: column; }
.ds-li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-width: 0; border-top: 1px solid var(--ds-line-soft); color: inherit; text-decoration: none; }
.ds-list > .ds-li:first-child { border-top: none; }
a.ds-li:hover { background: var(--ds-row-hover); }
a.ds-li:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ds-ring-c); }
.ds-li-lead { flex: none; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--ds-hover); color: var(--ds-mut); }
.ds-li-lead svg { width: 16px; height: 16px; }
.ds-li-lead.bad { background: var(--ds-bad-bg); color: var(--ds-bad-ink); }
.ds-li-lead.warn { background: var(--ds-warn-bg); color: var(--ds-warn-ink); }
.ds-li-lead.ok { background: var(--ds-ok-bg); color: var(--ds-ok-ink); }
.ds-li-lead.info { background: var(--ds-blue-soft); color: var(--ds-blue-ink); }
.ds-li-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ds-li-t > :first-child { font-weight: 700; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-li-t > :last-child:not(:first-child) { font-size: 12.5px; color: var(--ds-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-li-t.ds-li-wrap > span, .ds-li-t.ds-li-wrap > span:last-child:not(:first-child) { white-space: normal; overflow-wrap:break-word; }
.ds-li-trail { flex: none; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ds-ink); }

/* bar list: name · bar · value */
.ds-bars { display: flex; flex-direction: column; gap: 12px; }
.ds-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; }
.ds-bar-n { font-size: 13px; font-weight: 700; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-bar-v { font-size: 13px; font-weight: 900; color: var(--ds-head); font-variant-numeric: tabular-nums; }
.ds-bar .ds-meter { grid-column: 1 / -1; }

/* ================================== SHELL ================================= */
.ds-rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--ds-rail-w); z-index: 60;
    display: flex; flex-direction: column; padding: 16px 12px 12px;
    color: var(--ds-rail-ink); background: var(--ds-rail-bg);
    transition: width .18s ease, transform .2s ease;
}
.ds-main { margin-left: var(--ds-rail-w); min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; transition: margin-left .18s ease; }

/* wordmark */
.ds-rail-wm { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; min-width: 0; color: #fff; text-decoration: none; }
.ds-wm-mark { width: 32px; height: 32px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #1557b0, #1a73e8 55%, #4a90e8);
    box-shadow: 0 6px 14px -4px rgba(26,115,232,.65), inset 0 1px 0 rgba(255,255,255,.3); }
.ds-wm-mark svg { width: 18px; height: 18px; }
.ds-wm-t { font-size: 20px; font-weight: 900; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.ds-wm-env { font-size: 9px; font-weight: 900; letter-spacing: .1em; color: #3b2300; background: #f9ab00; border-radius: 4px; padding: 2px 5px; line-height: 1.1; }

/* nav list */
.ds-rail-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px 8px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.ds-rail-sec { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ds-rail-mut); padding: 14px 10px 4px; white-space: nowrap; overflow: hidden; }
.ds-rail-nav > .ds-rail-sec:first-child { padding-top: 4px; }
.ds-ri {
    display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; border-radius: 9px;
    color: var(--ds-rail-ink); font-size: 14px; font-weight: 400; cursor: pointer; border: none; background: none;
    width: 100%; text-align: left; text-decoration: none; white-space: nowrap; position: relative; flex: none;
    transition: background .12s, color .12s;
}
.ds-ri:hover { background: var(--ds-rail-hover); color: #fff; }
.ds-ri:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(127,176,255,.7); }
.ds-ri.active { background: var(--ds-rail-on); color: #fff; font-weight: 700; }
.ds-ri.active::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ds-rail-accent); }
.ds-ri .ico { width: 18px; height: 18px; flex: none; display: inline-flex; opacity: .9; }
.ds-ri .ico svg { width: 18px; height: 18px; }
.ds-ri.active .ico { opacity: 1; color: var(--ds-rail-accent); }
.ds-ri .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ds-ri .ds-ct { margin-left: auto; height: 19px; min-width: 22px; font-size: 11px; background: rgba(255,255,255,.10); color: var(--ds-rail-ink); }
.ds-ri.active .ds-ct { background: var(--ds-pri); color: #fff; }
.ds-ri .ds-ct-alert, .ds-ri.active .ds-ct-alert { background: var(--ds-stop); color: #fff; }
/* folding group (Admin): closed by default, remembered per browser (WMS §13.4b) */
.ds-ri-parent .caret { width: 16px; height: 16px; flex: none; margin-left: auto; color: var(--ds-rail-mut); transition: transform .15s ease; }
.ds-ri-parent[aria-expanded="true"] .caret { transform: rotate(90deg); }
.ds-ri-parent.has-active[aria-expanded="false"] { background: var(--ds-rail-on); color: #fff; font-weight: 700; }
.ds-subnav { display: none; flex-direction: column; gap: 2px; margin: 0 0 4px; }
.ds-subnav.open { display: flex; }
.ds-subnav .ds-ri { padding-left: 39px; height: 34px; font-size: 13.5px; }
.ds-subnav .ds-ri .ico { display: none; }
.ds-rail-foot { border-top: 1px solid var(--ds-rail-line); padding-top: 8px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.ds-rail-foot .ver { flex: 1; min-width: 0; font-size: 11.5px; color: var(--ds-rail-mut); padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-rail-btn { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--ds-rail-mut); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.ds-rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.ds-rail-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(127,176,255,.7); }
.ds-rail-btn svg { width: 18px; height: 18px; transition: transform .18s ease; }
/* the person menu at the rail's foot: avatar, name, role; opens upward */
.ds-rail-user { flex: 1; min-width: 0; }
.ds-rail-me { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 46px; padding: 0 8px 0 4px; border: none; border-radius: 10px; background: transparent; color: var(--ds-rail-ink); cursor: pointer; text-align: left; }
.ds-rail-me:hover, .ds-rail-me[aria-expanded="true"] { background: var(--ds-rail-hover); color: #fff; }
.ds-rail-me:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(127,176,255,.7); }
.ds-rail-me .ds-av { width: 30px; height: 30px; font-size: 11px; }
.ds-rail-me-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ds-rail-me-n b { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-rail-me-n small { font-size: 11.5px; color: var(--ds-rail-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-rail-me { position: relative; }
.ds-rail-me-dot { position: absolute; left: 27px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ds-stop); box-shadow: 0 0 0 2px var(--ds-rail-solid); }
.ds-rail-me .caret { width: 15px; height: 15px; flex: none; color: var(--ds-rail-mut); }
.ds-mi.on { color: var(--ds-link); }
.ds-mi .ds-mi-ct { margin-left: auto; }
.ds-menu-ver { padding: 6px 12px 4px; font-size: 11.5px; color: var(--ds-mut-2); }
/* more rows below the fold: the list fades at its foot (bos.js sets .more) */
.ds-rail-nav.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }

/* a short window: the rail tightens so every row stays on screen */
@media (min-width: 901px) and (max-height: 960px) {
    .ds-rail { padding-top: 12px; }
    .ds-rail-wm { padding-bottom: 10px; }
    .ds-ri { height: 32px; }
    .ds-rail-sec { padding: 10px 10px 4px; }
    .ds-rail-sec.ds-rail-gap { height: 6px; }
}
@media (min-width: 901px) and (max-height: 780px) {
    .ds-ri { height: 30px; font-size: 13.5px; }
    .ds-rail-sec { padding: 8px 10px 2px; }
}

/* top bar */
.ds-top { position: sticky; top: 0; z-index: 50; height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 20px 0 32px;
    background: color-mix(in srgb, var(--ds-canvas) 88%, transparent); border-bottom: 1px solid var(--ds-line-soft);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.ds-top-menu, .ds-top-brand { display: none; }
.ds-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ds-mut); white-space: nowrap; overflow: hidden; }
.ds-crumbs a { color: var(--ds-mut); text-decoration: none; font-weight: 700; }
.ds-crumbs a:hover { color: var(--ds-head); }
.ds-crumbs svg { width: 14px; height: 14px; flex: none; color: var(--ds-mut-2); }
.ds-crumbs .here { color: var(--ds-head); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.ds-top-act { display: flex; align-items: center; gap: 4px; flex: none; }
.ds-top .ds-ib .ds-ct { position: absolute; top: 2px; right: 0; height: 17px; min-width: 17px; padding: 0 5px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--ds-canvas); }
.ds-user { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 6px; border: none; background: transparent; border-radius: var(--ds-r-pill); cursor: pointer; color: var(--ds-ink); }
.ds-user:hover, .ds-user[aria-expanded="true"] { background: var(--ds-hover); }
.ds-user:focus-visible { outline: none; box-shadow: var(--ds-ring); }
.ds-user .ds-av { width: 32px; height: 32px; }
.ds-user-n { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; max-width: 180px; min-width: 0; }
.ds-user-n b { font-size: 13.5px; font-weight: 700; color: var(--ds-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ds-user-n small { font-size: 11.5px; color: var(--ds-mut); white-space: nowrap; }
.ds-user > svg { width: 16px; height: 16px; color: var(--ds-mut-2); flex: none; }
.ds-umenu { min-width: 270px; }
.ds-umenu-h { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; }
.ds-umenu-h .ds-av { width: 40px; height: 40px; font-size: 14px; }
.ds-umenu-h > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ds-umenu-h b { font-size: 14px; color: var(--ds-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-umenu-h small { font-size: 12.5px; color: var(--ds-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-bell { width: 340px; padding: 6px 0; }
.ds-bell .ds-menu-head { padding: 8px 16px 6px; }
.ds-bell .ds-li { padding: 10px 16px; }
.ds-bell-f { display: block; padding: 10px 16px 6px; border-top: 1px solid var(--ds-line-soft); font-size: 13px; }

/* "viewing as" band (F4 view-as) */
.ds-viewas { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 36px; padding: 4px 16px; background: #6e4d00; color: #fff3cf; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.ds-viewas a { color: #fff; }

.ds-scrim { display: none; }
.ds-phone-only { display: none; }
.ds-rail-sec.ds-rail-gap { padding: 0; height: 10px; }

/* --------------------------- desktop: slim rail --------------------------- */
@media (min-width: 901px) {
    body.rail-slim .ds-rail { width: var(--ds-rail-slim); padding-left: 12px; padding-right: 12px; }
    body.rail-slim .ds-main { margin-left: var(--ds-rail-slim); }
    body.rail-slim .ds-rail .ds-wm-t, body.rail-slim .ds-rail .ds-wm-env,
    body.rail-slim .ds-rail .lbl, body.rail-slim .ds-rail .caret,
    body.rail-slim .ds-rail .ver { display: none; }
    body.rail-slim .ds-rail .ds-rail-wm { padding: 2px 8px 18px 8px; justify-content: center; }
    body.rail-slim .ds-rail .ds-rail-sec { height: 1px; padding: 0; margin: 10px 8px; background: var(--ds-rail-line); font-size: 0; }
    body.rail-slim .ds-rail .ds-rail-nav > .ds-rail-sec:first-child { display: none; }
    body.rail-slim .ds-rail .ds-ri { justify-content: center; padding: 0; }
    body.rail-slim .ds-rail .ds-subnav { display: none; }
    body.rail-slim .ds-rail .ds-ri .ds-ct { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; margin: 0; background: var(--ds-pri); color: #fff; box-shadow: 0 0 0 2px var(--ds-rail-solid); }
    body.rail-slim .ds-rail .ds-ri .ds-ct-alert { background: var(--ds-stop); }
    body.rail-slim .ds-rail .ds-rail-foot { justify-content: center; flex-direction: column; }
    body.rail-slim .ds-rail .ds-rail-me { justify-content: center; padding: 0; }
    body.rail-slim .ds-rail .ds-rail-me { position: relative; }
.ds-rail-me-dot { position: absolute; left: 27px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ds-stop); box-shadow: 0 0 0 2px var(--ds-rail-solid); }
.ds-rail-me .caret { display: none; }
    .ds-top-user { display: none; }
    body.rail-slim .ds-rail [data-rail-slim] svg { transform: rotate(180deg); }
}

/* ------------------- phone + tablet: rail becomes a drawer ------------------ */
@media (max-width: 900px) {
    .ds-rail { width: min(300px, 86vw); transform: translateX(-102%); z-index: 90; box-shadow: none; padding-top: 14px; }
    body.nav-open .ds-rail { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.45); }
    .ds-scrim { display: block; position: fixed; inset: 0; z-index: 85; background: var(--ds-scrim); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    body.nav-open .ds-scrim { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }
    .ds-main { margin-left: 0; }
    .ds-rail [data-rail-slim] { display: none; }
    .ds-rail .ds-rail-user { display: none; }
    .ds-rail .ds-phone-only { display: inline-flex; }
    .ds-ri { height: 44px; }
    .ds-subnav .ds-ri { height: 42px; }

    .ds-top { height: 56px; padding: 0 8px 0 4px; gap: 2px; background: var(--ds-rail-solid); border-bottom: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: #fff; }
    .ds-top-menu { display: inline-flex; }
    .ds-top-brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: #fff; text-decoration: none; padding-left: 2px; }
    .ds-top-brand .ds-wm-mark { width: 28px; height: 28px; border-radius: 8px; }
    .ds-top-brand .ds-wm-mark svg { width: 16px; height: 16px; }
    .ds-top-brand .ds-wm-t { font-size: 18px; }
    .ds-crumbs { display: none; }
    .ds-top .ds-ib { width: 44px; height: 44px; border-radius: 50%; color: #dbe3f2; }
    .ds-top .ds-ib:hover, .ds-top .ds-ib[aria-expanded="true"] { background: rgba(255,255,255,.10); color: #fff; box-shadow: none; }
    .ds-top .ds-ib:focus-visible { box-shadow: 0 0 0 2px rgba(127,176,255,.75); }
    .ds-top .ds-ib .ds-ct { top: 5px; right: 4px; box-shadow: 0 0 0 2px var(--ds-rail-solid); background: var(--ds-stop); color: #fff; }
    .ds-user { padding: 0 4px; height: 44px; }
    .ds-user:hover, .ds-user[aria-expanded="true"] { background: rgba(255,255,255,.10); }
    .ds-user-n, .ds-user > svg { display: none; }
    .ds-top .ds-menu { position: fixed; top: 60px; right: 8px; left: auto; width: min(360px, calc(100vw - 16px)); max-height: calc(100dvh - 72px); overflow-y: auto; }

    .ds-page { padding: 20px 16px 40px; }
    .ds-page-head { align-items: flex-start; margin-bottom: 16px; }
    .ds-h1 { font-size: 23px; }
    .ds-grid-main { grid-template-columns: minmax(0, 1fr); }
    .ds-b, .ds-ib, .ds-mi { min-height: 40px; }
    .ds-b-sm { min-height: 36px; }
    .ds-card-h { padding: 14px 16px 10px; }
    .ds-card-b { padding: 0 16px 16px; }
    .ds-card-f { padding: 12px 16px; }
    .ds-li { padding: 10px 16px; }
    .ds-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-strip-c:nth-child(3) { box-shadow: inset 0 1px 0 var(--ds-line-soft); }
    .ds-strip-c:nth-child(4) { box-shadow: inset 1px 0 0 var(--ds-line-soft), inset 0 1px 0 var(--ds-line-soft); }
    .ds-strip-v { font-size: 24px; }
    .ds-strip-c { padding: 14px 16px 16px; }
    .ds-pgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .ds-jump { display: flex; gap: 4px; position: sticky; top: 56px; z-index: 40; margin: 12px -16px 0; padding: 8px 16px; overflow-x: auto; scrollbar-width: none;
        background: color-mix(in srgb, var(--ds-canvas) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
    .ds-jump::-webkit-scrollbar { display: none; }
    .ds-jump { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 40px; }
    .ds-jump a { flex: none; height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: var(--ds-r-pill); background: var(--ds-surface); box-shadow: inset 0 0 0 1px var(--ds-line); color: var(--ds-ink-2); font-size: 13px; font-weight: 700; text-decoration: none; }
    .ds-jump a:focus-visible { outline: none; box-shadow: var(--ds-ring); }
    .ds-anchor { scroll-margin-top: 112px; }
    /* a modal is a bottom sheet on a phone */
    .ds-back { align-items: flex-end; padding: 8px; }
    .ds-modal { max-height: calc(100dvh - 24px); }
    .ds-mf { flex-direction: column-reverse; align-items: stretch; }
    .ds-mf .ds-b { width: 100%; height: 44px; }
    .ds-mf .ds-msg { margin: 0; }
}
/* ---- phone: a table with class ds-cards becomes one purpose-built row per record ----
   line 1: tick box · the title · the one money number (data-ph="num") · ⋯ (td.ds-act)
   line 2: the meta cells, muted, separated by · (data-ph="m"), and the status pill at the
           right (data-ph="pill", or any cell that starts with a .ds-pill)
   line 3: the problem text in red (data-ph="prob")
   The title is the cell marked data-ph="t" (else the first cell). data-ph="hide" and a
   cell that only holds "—" (bos.js marks it .ds-blank) do not show. A cell without a
   data-ph shows as "Label value" on line 2 — the fallback for small admin tables. ---- */
@media (max-width: 760px) {
    .ds-table.ds-cards { min-width: 0 !important; table-layout: auto; }
    .ds-table.ds-cards, .ds-table.ds-cards tbody { display: block; }
    .ds-table.ds-cards colgroup { display: none; }
    .ds-table.ds-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .ds-table.ds-cards tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--ds-line-soft); position: relative; min-width: 0; }
    .ds-table.ds-cards tr::before { content: ""; order: 3; flex-basis: 100%; height: 0; }
    .ds-table.ds-cards tbody tr:last-child { border-bottom: none; }
    .ds-table.ds-cards td { display: block; order: 4; padding: 0 !important; border: none; min-width: 0; max-width: 100%; text-align: left; font-size: 13px; line-height: 1.4; color: var(--ds-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ds-table.ds-cards td[data-label]:not([data-label=""])::before { content: attr(data-label) " "; font-weight: 700; color: var(--ds-mut-2); }
    .ds-table.ds-cards td.ds-blank, .ds-table.ds-cards td[data-ph="hide"], .ds-table.ds-cards td:empty { display: none; }
    /* line 1 */
    .ds-table.ds-cards td.jb-tick-cell { order: 0; flex: none; width: auto; overflow: visible; }
    .ds-table.ds-cards td.jb-tick-cell::before, .ds-table.ds-cards td[data-ph]::before { content: none !important; }
    .ds-table.ds-cards td[data-ph="t"], .ds-table.ds-cards tr:not(:has(td[data-ph="t"])) > td:first-child:not(.jb-tick-cell) { order: 1; flex: 1 1 0; font-size: 15px; font-weight: 700; color: var(--ds-head); }
    .ds-table.ds-cards td[data-ph="t"]::before, .ds-table.ds-cards tr > td:first-child::before { content: none; }
    .ds-table.ds-cards td[data-ph="t"] .ds-cell-2 > :last-child:not(:first-child) { font-weight: 400; }
    .ds-table.ds-cards td[data-ph="num"] { order: 2; flex: none; margin-left: auto; font-size: 15px; font-weight: 900; color: var(--ds-head); font-variant-numeric: tabular-nums; }
    .ds-table.ds-cards td[data-ph="pill1"] { order: 2; flex: none; margin-left: auto; overflow: visible; }
    .ds-table.ds-cards td.ds-act { order: 2; flex: none; width: auto; overflow: visible; margin: -6px -8px -6px 0; }
    .ds-table.ds-cards td.ds-act::before { content: none; }
    /* line 2 */
    /* the meta cells share ONE line: they start at nothing, grow to their own width, and
       shrink with an ellipsis together before anything wraps */
    .ds-table.ds-cards td[data-ph="m"] { flex: 1 1 0; max-width: max-content; }
    .ds-table.ds-cards td[data-ph="m"] ~ td[data-ph="m"]:not(.ds-blank)::before { content: "·" !important; color: var(--ds-mut-2); margin-right: 6px; }
    .ds-table.ds-cards td[data-ph="m"] ~ td[data-ph="m"] { margin-left: -4px; }
    .ds-table.ds-cards td[data-ph="pill"], .ds-table.ds-cards td:has(> .ds-pill:first-child):not([data-ph]) { order: 5; flex: none; margin-left: auto; overflow: visible; }
    .ds-table.ds-cards td:has(> .ds-pill:first-child):not([data-ph])::before { content: none; }
    /* line 3 */
    .ds-table.ds-cards td[data-ph="prob"] { order: 6; flex: 1 1 100%; white-space: normal; font-weight: 700; color: var(--ds-bad-ink); }
    .ds-table.ds-cards td[data-ph="st"] { order: 6; flex: 1 1 100%; overflow: visible; }
    .ds-table.ds-cards td[data-ph="st"] > * { flex-direction: row !important; align-items: center !important; }
    .ds-table.ds-cards td.ds-act[data-ph="acts"] { order: 7; flex: 1 1 100%; margin: 4px 0 0; white-space: normal; }
    .ds-table.ds-cards td[data-ph="wrap"] { order: 6; flex: 1 1 100%; white-space: normal; }
    .ds-table.ds-cards tr.on { background: var(--ds-row-on); }
    .ds-table.ds-cards .ds-cell-2 { gap: 0; }

    /* the page's ONE primary button docks at the bottom, under the thumb;
       the rest of the head's controls stay where they are */
    .ds-page-actions.ds-dock::before { content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; height: calc(66px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--ds-surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
        box-shadow: 0 -1px 0 var(--ds-line-soft), 0 -8px 24px -12px rgba(15,29,58,.25); }
    .ds-page-actions.ds-dock > .ds-b-pri { position: fixed; z-index: 45; left: 16px; right: 16px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 46px; font-size: 14.5px; }
    body:has(.ds-dock) .ds-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
    .ds-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-mini:nth-child(3) { border-left: none; }
    .ds-mini:nth-child(n+3) { border-top: 1px solid var(--ds-line-soft); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
