/* TrackBeast design system, direction A "Ledger" (28 Nov 2026; before: "Look D"). One stylesheet, one accent colour
   (blue; orange only for an FTD and a full cap), a white top bar with the menu (a bottom bar on phones), details in
   side drawers, light and dark from the same tokens. Geist for everything, Geist Mono for codes; both are served
   from /static/fonts (the pages allow no other host). Written phone-first: the base rules are for a 360 px wide
   screen, wider screens add to them. Every component is shown on the operator's /styleguide page: change it here,
   check it there. No page carries a style of its own: sizes that depend on data are SVG attributes or .w0-.w100. */

@font-face{font-family:"Geist";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/geist-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Geist";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/geist-latin-wght-normal.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:"Geist Mono";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/geist-mono-latin-wght-normal.woff2) format("woff2")}

/* ---------- tokens ---------- */
:root{
  /* light theme "Graphite · Steel Blue" (owner, 4 Dec 2026): crisp white, graphite text, steel blue buttons, the open
     menu item, the Live badge and the chat bubble in graphite with a light blue highlight. Only colours changed. */
  --bg:#e7ebf1;--surface:#fbfcfe;--surface-2:#f3f6fa;   /* Frost (owner, 4 Dec 2026: "go with E Frost"): a cool page, cool-white cards */
  --line:#dbe1e9;--line-2:#dbdbdf;--line-soft:#e7ebf1;
  --text:#0a0a0c;--text-2:#34343b;--text-3:#5c5c66;
  --accent:#1d4ed8;--accent-hover:#1e3a8a;--accent-soft:#eef2ff;--accent-line:#c7d2fe;--accent-dark:#1e3a8a;--accent-mid:#6b8ef0;--on-accent:#fff;
  --rail:#ffffff;--rail-text:#34343b;--rail-dim:#6b6b75;--rail-hover:#f2f2f4;
  --ok:#1d7a4a;--ok-bg:#e7f4ec;--warn:#92400e;--warn-bg:#fef3c7;--bad:#b42318;--bad-bg:#fdecec;
  --info:#26262d;--info-bg:#ececef;--ftd:#c2410c;--ftd-bg:#ffedd5;--neutral-bg:#f1f1f3;
  --console:#f59e0b;--console-ink:#141a26;--console-soft:#fef3c7;--console-text:#92400e;
  --up:#1d7a4a;--down:#b42318;--full:#ea580c;--track:#e5e5e8;--now:#0a0a0c;--series-2:#9a9aa5;
  --shadow:0 1px 2px rgba(15,30,60,.07),0 4px 12px rgba(15,30,60,.06);
  --shadow-lg:0 20px 48px rgba(10,10,12,.16),0 0 0 1px rgba(10,10,12,.04);
  --btn-fill:linear-gradient(135deg,#1e40af 0%,#2563eb 100%);--btn-fill-hover:linear-gradient(135deg,#1e3a8a,#1d4ed8);
  --btn-glow:0 1px 2px rgba(30,64,175,.25),0 4px 10px rgba(37,99,235,.16);
  --nav-on-bg:#0f0f12;--nav-on-text:#fff;--nav-on-icon:#93c5fd;--nav-on-ring:0 0 0 1px #0f0f12 inset,0 4px 12px rgba(10,10,12,.18);
  --bubble-bg:#0f0f12;--bubble-ink:#93c5fd;--bubble-hover:#27272a;--live-bg:#0f0f12;--live-ink:#93c5fd;
  --radius:12px;--radius-sm:8px;--side:0px;--top:60px;--tabs:62px;--tap:44px;--drawer:760px;
  --head:"Geist",ui-sans-serif,system-ui,sans-serif;
  --body:"Geist",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  --mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  /* sizes (compact scale, 2 Dec 2026; SEGMENTS 143): ONE scale for every page. Spacing 4/8/12/16/20/24; one control
     height for text fields, drop-down lists (the app's own too), date and search fields, buttons and the chips of a
     segmented control (--ctl), a small one (--ctl-sm) and an in-table one (--ctl-xs); one tick box / radio size (--check);
     one table cell padding and one card padding; the text sizes of the page, a table, a button and a page title. Written
     phone-first like the rest: a finger's 44 px controls and 16 px field text on a phone (smaller makes iOS zoom), the
     compact desktop sizes from 900 px with a fine pointer (32 / 28 / 24 px controls, 13 px text, a table row of about
     32 px), and never under 40 px for a coarse pointer at any width (the media blocks after the theme blocks). Never a
     size of its own per page. The filter panels (ui.filter_panel, ui.ticks) and the date ranges (ui.date_range /
     date_field) keep the sizes they had before the compact scale (owner, 2 Dec 2026: they stay as they are): the block
     "the filter panels and the date ranges keep their sizes" gives them the earlier values of these tokens. */
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:20px;--sp-6:24px;
  --ctl:44px;--ctl-sm:40px;--ctl-xs:32px;--field-fs:16px;--field-py:9px;--field-px:12px;
  --btn-py:9px;--btn-px:16px;--btn-fs:13.5px;--btn-sm-py:6px;--btn-sm-px:12px;--btn-sm-fs:13px;
  --fs:14px;--fs-table:13.5px;--fs-h1:22px;--badge-py:2px;--badge-px:8px;--badge-fs:12px;
  --fs-sm:13px;--fs-label:12.5px;--fs-h2:14px;--fs-stat:22px;--tap:44px;--bubble:48px;--badge-r:6px;--badge-fw:550;--seg-on:#fff;
  --pop-py:12px;--pop-px:14px;--gap:12px;--ta-min:72px;
  --check:14px;--tick:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --cell-y:8px;--cell-x:10px;--card-pad:12px;--card-px:12px;--field-gap:12px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){
    --btn-fill:var(--accent);--btn-fill-hover:var(--accent-hover);--btn-glow:none;
    --nav-on-bg:var(--accent-soft);--nav-on-text:var(--accent-dark);--nav-on-icon:currentColor;--nav-on-ring:none;
    --bubble-bg:var(--accent);--bubble-ink:var(--on-accent);--bubble-hover:var(--accent-hover);--live-bg:var(--ok-bg);--live-ink:var(--ok);
    --bg:#111214;--surface:#18191c;--surface-2:#1e1f23;
    --line:#2b2d32;--line-2:#383a40;--line-soft:#222428;
    --text:#ececee;--text-2:#c3c5ca;--text-3:#8d9098;
    --accent:#7aa2ff;--accent-hover:#a3bfff;--accent-soft:#1c2435;--accent-line:#2f3f66;--accent-dark:#a3bfff;--accent-mid:#5a7fe0;--on-accent:#0b0f18;
    --rail:#18191c;--rail-text:#c3c5ca;--rail-dim:#8d9098;--rail-hover:#222428;
    --ok:#5fd4a0;--ok-bg:#12261e;--warn:#f2c14e;--warn-bg:#2b2410;--bad:#f28b82;--bad-bg:#2e1715;
    --info:#93b4ff;--info-bg:#18233a;--ftd:#f6a560;--ftd-bg:#2e1f10;--neutral-bg:#26272b;
    --console-soft:#2b2410;--console-text:#f2c14e;
    --up:#4cc98f;--down:#f07b72;--full:#f39a4f;--track:#2b2d32;--now:#ececee;--series-2:#6b7280;
    --shadow:0 1px 2px rgba(0,0,0,.4);--shadow-lg:0 18px 44px rgba(0,0,0,.6);--seg-on:#2e3035;
    --tick:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%230b1020' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme:dark;
  }
}
:root[data-theme=dark]{
  --btn-fill:var(--accent);--btn-fill-hover:var(--accent-hover);--btn-glow:none;
  --nav-on-bg:var(--accent-soft);--nav-on-text:var(--accent-dark);--nav-on-icon:currentColor;--nav-on-ring:none;
  --bubble-bg:var(--accent);--bubble-ink:var(--on-accent);--bubble-hover:var(--accent-hover);--live-bg:var(--ok-bg);--live-ink:var(--ok);
  --bg:#111214;--surface:#18191c;--surface-2:#1e1f23;
  --line:#2b2d32;--line-2:#383a40;--line-soft:#222428;
  --text:#ececee;--text-2:#c3c5ca;--text-3:#8d9098;
  --accent:#7aa2ff;--accent-hover:#a3bfff;--accent-soft:#1c2435;--accent-line:#2f3f66;--accent-dark:#a3bfff;--accent-mid:#5a7fe0;--on-accent:#0b0f18;
  --rail:#18191c;--rail-text:#c3c5ca;--rail-dim:#8d9098;--rail-hover:#222428;
  --ok:#5fd4a0;--ok-bg:#12261e;--warn:#f2c14e;--warn-bg:#2b2410;--bad:#f28b82;--bad-bg:#2e1715;
  --info:#93b4ff;--info-bg:#18233a;--ftd:#f6a560;--ftd-bg:#2e1f10;--neutral-bg:#26272b;
  --console-soft:#2b2410;--console-text:#f2c14e;
  --up:#4cc98f;--down:#f07b72;--full:#f39a4f;--track:#2b2d32;--now:#ececee;--series-2:#6b7280;
  --shadow:0 1px 2px rgba(0,0,0,.4);--shadow-lg:0 18px 44px rgba(0,0,0,.6);--seg-on:#2e3035;
  --tick:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%230b1020' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme:dark;
}
/* the compact scale: a tablet keeps the finger's sizes with a smaller small control; a desktop with a mouse gets
   32 / 28 / 24 px controls and 13 px text; a touch screen of any width never goes under 40 px */
@media (min-width:720px){:root{--ctl-sm:36px}}
@media (min-width:900px){:root{--ctl:32px;--ctl-sm:28px;--ctl-xs:24px;--field-fs:13px;--field-py:5px;--field-px:9px;
  --btn-py:4px;--btn-px:12px;--btn-fs:13px;--btn-sm-py:3px;--btn-sm-px:10px;--btn-sm-fs:12.5px;
  --fs:13px;--fs-table:13px;--fs-h1:20px;--badge-py:1px;--badge-px:7px;--badge-fs:11.5px;--pop-py:10px;--pop-px:12px;
  --cell-y:6px;--cell-x:10px;--card-pad:12px;--card-px:14px;--field-gap:10px;--top:52px;
  --fs-sm:12px;--fs-label:12px;--fs-h2:14px;--fs-stat:20px;--tap:34px;--bubble:44px}}
@media (min-width:900px) and (pointer:coarse){:root{--ctl:40px;--ctl-sm:40px;--ctl-xs:32px;--field-fs:16px;--tap:44px}}
/* the filter panels and the date ranges keep their sizes (owner, 2 Dec 2026): the tokens as they were before the
   compact scale, for the whole component (its button, its panel and what is in it). Their text was the page's 14.5 px. */
details.filter-pop,details.date-pop{--ctl:44px;--ctl-sm:40px;--ctl-xs:32px;--field-fs:16px;--field-py:9px;--field-px:12px;
  --btn-py:9px;--btn-px:16px;--btn-fs:13.5px;--btn-sm-py:6px;--btn-sm-px:12px;--btn-sm-fs:13px;
  --badge-py:3px;--badge-px:10px;--badge-fs:12px;--pop-py:12px;--pop-px:14px;--field-gap:14px;--ta-min:96px;font-size:14.5px;
  --fs-sm:13px;--fs-label:12.5px;--badge-r:999px;--badge-fw:600}
/* ... and their own headings stay as they were (the app's card titles are no longer upper case) */
details.filter-pop h2,details.date-pop h2{font-size:13px;font-weight:600;margin:0 0 12px;letter-spacing:.05em;text-transform:uppercase;color:var(--text-3);line-height:inherit}
.table details.filter-pop,.table details.date-pop{font-size:13.5px}   /* inside a table: the table's text as it was */
@media (min-width:720px){details.filter-pop,details.date-pop{--ctl-sm:36px}}
@media (min-width:900px){details.filter-pop,details.date-pop{--ctl:38px;--ctl-sm:32px;--ctl-xs:26px;--field-fs:14px;--field-py:7px;--field-px:11px;
  --btn-py:8px;--btn-px:14px;--btn-sm-py:5px;--btn-sm-px:11px}}

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font:var(--fs)/1.5 var(--body);color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;min-height:100vh;min-height:100dvh}
a{color:var(--accent);text-decoration:none}
a:hover{color:var(--accent-hover);text-decoration:underline}
h1{font-family:var(--head);font-size:var(--fs-h1);font-weight:700;letter-spacing:-.02em;margin:0;line-height:1.15}
/* card titles: Title Case in the text colour, never upper case or spaced out (SEGMENTS 144) */
h2{font-size:var(--fs-h2);font-weight:600;margin:0 0 var(--sp-3);letter-spacing:-.005em;color:var(--text);line-height:1.3}
h3{font-size:13px;font-weight:600;margin:0 0 var(--sp-2);color:var(--text-2)}
p{margin:0 0 12px}
small,.small{font-size:var(--fs-sm)}
.muted{color:var(--text-3)}
.mono,code{font-family:var(--mono);font-size:.92em}
code{background:var(--neutral-bg);padding:1px 5px;border-radius:5px;overflow-wrap:anywhere}
.num,.tnum{font-variant-numeric:tabular-nums}
.nowrap{white-space:nowrap}
svg.icon{width:18px;height:18px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
[hidden]{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- the shell: a white top bar with the menu (a bottom bar on phones) and the chat bubble ---------- */
.mark{width:30px;height:30px;border-radius:8px;background:var(--text);color:var(--surface);display:grid;place-items:center;flex-shrink:0;
  font-family:var(--head);font-weight:700;font-size:13px;letter-spacing:-.02em}
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:8px;height:var(--top);padding:0 12px;background:var(--surface);border-bottom:1px solid var(--line)}
.topbar .grow{flex:1}
.topbar .where{display:flex;align-items:center;gap:10px;color:var(--text);font-weight:700;font-size:16px;letter-spacing:-.01em;min-width:0;flex:0 1 auto}
.topbar .where:hover{text-decoration:none}
.topbar .where .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar .search{display:none}
.topbar .clock{display:none}
/* phones: the menu is a bar at the bottom with four pages and "More" */
.rail{position:fixed;z-index:40;left:0;right:0;bottom:0;height:calc(var(--tabs) + env(safe-area-inset-bottom,0px));padding:6px 6px env(safe-area-inset-bottom,0px);
  background:var(--rail);border-top:1px solid var(--line);display:flex;align-items:stretch;gap:2px}
.rail .item{flex:1 1 0;min-width:0;display:none;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px 2px;border-radius:10px;
  color:var(--rail-text);font-size:11px;font-weight:500;line-height:1.2;text-align:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent}
.rail .item.tab,.rail .more>summary.item{display:flex}
.rail .item span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail .item svg{width:21px;height:21px}
.rail .item:hover{text-decoration:none;color:var(--text);background:var(--rail-hover)}
.rail .item.on,.rail .more.on-phone>summary.item{color:var(--accent)}
.rail .item .count{position:absolute;top:2px;left:calc(50% + 6px);background:var(--full);color:#fff;border-radius:999px;font-size:10px;font-weight:700;padding:0 5px;line-height:15px}
.rail .more{flex:1 1 0;min-width:0;display:flex}
.rail .more>summary{flex:1;list-style:none;height:100%}
.rail .more>summary::-webkit-details-marker{display:none}
.sheet{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg);padding:10px}
.sheet .group+.group{margin-top:8px;padding-top:8px;border-top:1px solid var(--line-soft)}
.sheet h3{font-size:var(--fs-label);color:var(--text-3);margin:var(--sp-1) 10px;font-weight:600}
.sheet .link{display:flex;align-items:center;gap:10px;width:100%;min-height:var(--tap);padding:var(--sp-1) 10px;border-radius:var(--radius-sm);color:var(--text);
  font:inherit;font-weight:500;background:none;border:0;cursor:pointer;text-align:left}
.sheet .link svg{width:calc(var(--tap) - 10px);height:calc(var(--tap) - 10px);padding:calc((var(--tap) - 28px) / 2);border-radius:var(--radius-sm);background:var(--accent-soft);color:var(--accent);stroke-width:1.9}
.sheet .link:hover{background:var(--neutral-bg);text-decoration:none}
.sheet .link.on{background:var(--accent-soft);color:var(--accent-dark);font-weight:600}
.sheet .link .count{margin-left:auto;background:var(--warn-bg);color:var(--warn);border-radius:999px;font-size:12px;font-weight:650;padding:1px 8px}
.acct .sheet .link svg{width:18px;height:18px;padding:0;background:none;color:var(--text-3)}
.rail .more>.sheet{position:fixed;left:8px;right:8px;bottom:calc(var(--tabs) + env(safe-area-inset-bottom,0px) + 8px);max-height:calc(100dvh - var(--tabs) - 80px);overflow-y:auto;
  display:grid;grid-template-columns:1fr 1fr;gap:0 8px;align-content:start}
.rail .more>.sheet .group{margin:0;padding:0 0 6px;border:0}
.rail .more>.sheet .group:empty{display:none}
.app{min-width:0;padding-bottom:calc(var(--tabs) + env(safe-area-inset-bottom,0px))}
.acct{position:relative;flex-shrink:0}
.acct>summary{list-style:none;cursor:pointer;border-radius:50%;display:block}
.acct>summary::-webkit-details-marker{display:none}
.acct>.sheet{position:absolute;right:0;top:calc(100% + 8px);width:min(280px,calc(100vw - 24px));z-index:50}
.acct .who{padding:6px 10px 10px;border-bottom:1px solid var(--line-soft);margin-bottom:6px;font-size:var(--fs-sm);color:var(--text-3);overflow-wrap:anywhere}
.acct .who b{display:block;color:var(--text);font-weight:600;font-size:var(--fs)}
.avatar{width:min(var(--ctl),36px);height:min(var(--ctl),36px);border-radius:50%;background:var(--accent-soft);color:var(--accent-dark);display:grid;place-items:center;
  font-weight:700;font-size:13px;flex-shrink:0;text-transform:uppercase}
.icon-btn{background:none;border:1px solid var(--line);color:var(--text-2);width:var(--ctl);height:var(--ctl);padding:0;
  border-radius:10px;display:grid;place-items:center;cursor:pointer;flex-shrink:0}
.icon-btn:hover{background:var(--neutral-bg);color:var(--text)}
/* the AI Assistant: a chat bubble at the bottom right of every page (above the bottom bar on phones) */
/* 44 px with a mouse (48 on a phone), in the surface colour with the accent icon: present, never louder than the page.
   The page keeps room for it at its foot (main's padding) and the bulk bars keep their right end clear of it. */
.chat-bubble{position:fixed;z-index:45;right:16px;bottom:calc(var(--tabs) + env(safe-area-inset-bottom,0px) + 12px);width:var(--bubble);height:var(--bubble);border-radius:50%;
  background:var(--surface);color:var(--accent);border:1px solid var(--line-2);display:grid;place-items:center;box-shadow:0 6px 18px rgba(20,26,38,.16)}
.chat-bubble svg{width:20px;height:20px}
.chat-bubble:hover{background:var(--accent);border-color:var(--accent);color:var(--on-accent);text-decoration:none}
@media (max-width:719px){body:has(details.pop[open]) .chat-bubble,body:has(.sel-list) .chat-bubble{display:none}}   /* a phone's bottom sheet is never under it */
.ai-open .chat-bubble{display:none}
.moon{display:none}
:root[data-theme=dark] .sun{display:none}
:root[data-theme=dark] .moon{display:inline-flex}
.sun{display:inline-flex}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]) .sun{display:none}
  :root:not([data-theme=light]) .moon{display:inline-flex}
}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--head);font-weight:700;font-size:16px;letter-spacing:-.01em;color:var(--text);min-width:0}
.brand:hover{text-decoration:none}
.brand .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brand .sub{display:block;font-family:var(--body);font-size:12px;font-weight:500;color:var(--text-3);letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

main{padding:14px 14px calc(var(--bubble) + var(--sp-6));max-width:1400px;margin:0 auto}
.page-head{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin-bottom:var(--gap)}
.page-head .grow{flex:1}
.page-head p{flex:0 0 100%;margin:0;color:var(--text-2);min-width:0;overflow-wrap:anywhere}
.page-head .actions{display:flex;gap:var(--sp-2);flex-wrap:wrap;margin-left:auto}
.crumb{display:inline-flex;align-items:center;gap:4px;color:var(--accent);font-size:var(--fs-sm);font-weight:600;margin-bottom:4px;min-height:var(--ctl-sm)}
.crumb svg{width:15px;height:15px}

@media (min-width:900px){
  .topbar{padding:0 24px;gap:16px}
  .topbar .where{flex:0 0 auto}
  .topbar .search-link{display:none}
  .rail{position:static;height:auto;padding:0;border:0;background:none;gap:2px;flex:0 1 auto;min-width:0}
  .rail .item,.rail .more>summary.item{display:flex;flex:0 0 auto;flex-direction:row;gap:6px;padding:6px 9px;border-radius:8px;font-size:13px;font-weight:500;color:var(--text-2)}
  .rail .item svg,.rail .more>summary.item svg{width:16px;height:16px}
  .rail .item.on{background:var(--nav-on-bg);color:var(--nav-on-text);font-weight:600;box-shadow:var(--nav-on-ring)}
  .rail .item.on .icon{color:var(--nav-on-icon)}
  .rail .more.on-phone>summary.item{color:var(--text-2)}
  .rail .more.on>summary.item{background:var(--accent-soft);color:var(--accent-dark);font-weight:600}
  .rail .item .count{position:static;margin-left:2px}
  .rail .more{flex:0 0 auto;display:block;position:relative}
  .rail .more>.sheet{position:absolute;left:0;right:auto;top:calc(100% + 10px);bottom:auto;width:720px;max-width:calc(100vw - 48px);max-height:calc(100vh - 90px);
    grid-template-columns:repeat(3,minmax(0,1fr));padding:14px}
  .rail .more>.sheet .group{padding:0 6px}
  .rail .more>.sheet .group+.group{border-left:1px solid var(--line-soft)}
  .rail .more>.sheet .phone-only{display:none}
  .topbar .clock{display:block;font-size:12.5px;color:var(--text-3);white-space:nowrap}
  .app{padding-bottom:0}
  .topbar .search{display:flex;align-items:center;gap:8px;flex:0 1 240px;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:0 10px;height:var(--ctl);color:var(--text-3)}
  .topbar .search input{border:0!important;background:transparent!important;min-height:0!important;padding:0!important;flex:1;min-width:0;font-size:13.5px!important;outline:0!important}
  .topbar .search:focus-within{border-color:var(--accent);background:var(--surface)}
  .chat-bubble{right:24px;bottom:24px}
  main{padding:var(--sp-4) var(--sp-6) calc(var(--bubble) + 40px)}
}
@media (min-width:900px){.rail .item.foot span{display:none}}
@media (min-width:900px) and (max-width:1599px){.topbar .search{display:none}.topbar .search-link{display:grid}}
@media (min-width:900px) and (max-width:1279px){.rail .item span,.rail .more>summary span{display:none}.rail .item.on span{display:inline}}

/* ---------- the side drawer (direction A): details beside the list ---------- */
.drawer-scrim{position:fixed;inset:var(--top) 0 0 0;z-index:55;background:rgba(20,26,38,.22)}
.drawer{position:fixed;z-index:56;top:var(--top);right:0;bottom:0;width:min(var(--drawer),100vw);background:var(--surface);box-shadow:-18px 0 44px rgba(20,26,38,.16);
  display:flex;flex-direction:column}
.drawer-head{display:flex;align-items:center;gap:var(--sp-2);padding:var(--sp-2) var(--sp-4);border-bottom:1px solid var(--line-soft)}
.drawer-head .grow{flex:1}
.drawer-head .icon-btn{width:var(--ctl-sm);height:var(--ctl-sm);border-radius:var(--radius-sm)}
.drawer-body{flex:1;overflow-y:auto;padding:var(--sp-4) var(--sp-4) 40px;overscroll-behavior:contain}
.drawer-loading{padding:24px 0}
.drawer-page h1{font-size:var(--fs-h1)}
.drawer-page .crumb{display:none}
.drawer-page .cols,.drawer-page .cols.lead,.drawer-page .split{grid-template-columns:minmax(0,1fr)}
.drawer-page .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
.drawer-open body{overflow:hidden}
@media (min-width:900px){.drawer-body{padding:var(--sp-4) var(--sp-5) 48px}}
@media (max-width:899px){.drawer-scrim{inset:0}.drawer{top:0}}

.sg-drawer{border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;max-width:var(--drawer);margin-bottom:12px}
.chat-bubble.sg-static{position:static;display:inline-grid}

/* ---------- cards ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:var(--card-pad);margin-bottom:var(--gap);box-shadow:var(--shadow);min-width:0}
.card>:last-child{margin-bottom:0}
.card-head{display:flex;align-items:center;gap:var(--sp-2) var(--sp-3);flex-wrap:wrap;margin-bottom:var(--sp-2)}
.card-head h2{margin:0;flex:1}
.card-head form.pull-now{display:flex;gap:var(--sp-2);flex-wrap:wrap;align-items:center}   /* SEGMENTS 149: Pull Now with chosen days */
@media (min-width:900px){.card{padding:var(--card-pad) var(--card-px)}}
.grid{display:grid;gap:var(--gap);grid-template-columns:1fr}
.grid>.card{margin-bottom:0}
@media (min-width:720px){.grid.two{grid-template-columns:1fr 1fr}.grid.three{grid-template-columns:repeat(3,1fr)}}
.grid{margin-bottom:var(--gap)}
.grid>*{min-width:0}
.stat .label{font-size:var(--fs-label);color:var(--text-2);font-weight:600}
.stat .value{font-family:var(--head);font-size:var(--fs-stat);font-weight:700;letter-spacing:-.02em;line-height:1.2;margin-top:4px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.stat .hint{font-size:var(--fs-sm);color:var(--text-2)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-2);min-height:var(--ctl);padding:var(--btn-py) var(--btn-px);
  border-radius:var(--radius-sm);border:1px solid var(--line-2);background:var(--surface);color:var(--text);
  font:inherit;font-size:var(--btn-fs);font-weight:600;cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .12s,border-color .12s}
.btn:hover{background:var(--surface-2);border-color:var(--text-3);color:var(--text);text-decoration:none}
.btn.primary{background:var(--btn-fill);border-color:transparent;color:var(--on-accent);box-shadow:var(--btn-glow)}
.btn.primary:hover{background:var(--btn-fill-hover);border-color:transparent;color:var(--on-accent)}
.btn.danger{color:var(--bad);border-color:color-mix(in srgb,var(--bad) 35%,var(--line))}
.btn.danger:hover{background:var(--bad-bg)}
.btn.ghost{border-color:transparent;background:none;color:var(--text-2)}
.btn.ghost:hover{background:var(--neutral-bg);color:var(--text)}
.btn.sm{min-height:var(--ctl-sm);padding:var(--btn-sm-py) var(--btn-sm-px);font-size:var(--btn-sm-fs)}
.btn:disabled,.btn[aria-disabled=true]{opacity:.5;cursor:not-allowed}
.btn.block{width:100%}
.btn-row{display:flex;gap:var(--sp-2);flex-wrap:wrap;align-items:center}
.btn-row.end{justify-content:flex-end}
.htmx-request.btn,.htmx-request .btn{opacity:.6;pointer-events:none}

/* ---------- forms ---------- */
form{margin:0}
.field{margin-bottom:var(--field-gap)}
.field>label,.label{display:block;font-size:var(--fs-label);font-weight:600;margin-bottom:var(--sp-1);color:var(--text-2)}
.field .help{font-size:var(--fs-label);color:var(--text-3);margin-top:var(--sp-1)}
.field .error{font-size:var(--fs-sm);color:var(--bad);margin-top:var(--sp-1)}
input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=submit],[type=button]),select,textarea{
  width:100%;min-height:var(--ctl);padding:var(--field-py) var(--field-px);border:1px solid var(--line-2);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text);font:inherit;font-size:var(--field-fs);-webkit-appearance:none;appearance:none}
select{background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);
  background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;background-size:5px 5px;background-repeat:no-repeat;padding-right:34px}
textarea{min-height:var(--ta-min);resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent)}
input::placeholder{color:var(--text-3)}
input.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:24px;letter-spacing:.3em;text-align:center}
.form-grid{display:grid;gap:0 var(--sp-4);grid-template-columns:1fr}
@media (min-width:720px){.form-grid{grid-template-columns:1fr 1fr}.form-grid .wide{grid-column:1/-1}}
.check{display:flex;align-items:center;gap:var(--sp-2);min-height:var(--ctl)}
/* tick boxes and radios: one size, drawn by the app (a box, the accent when ticked, a ring when focused). The tick-box
   lists of the filter panels keep the browser's own (they are the reference and stay as they are); .switch is drawn
   on its own; the hidden ones (.daybtn, .seg-radio) keep their 1 px. */
input:where([type=checkbox],[type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)){
  -webkit-appearance:none;appearance:none;flex:none;width:var(--check);height:var(--check);margin:0;padding:0;vertical-align:-3px;cursor:pointer;
  border:1.5px solid var(--text-3);border-radius:3px;background:var(--surface) no-repeat center/100% 100%;transition:background-color .12s,border-color .12s}
input:where([type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)){border-radius:50%}
input:where([type=checkbox],[type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):hover:not(:disabled){border-color:var(--accent)}
input:where([type=checkbox]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):checked{background-color:var(--accent);border-color:var(--accent);background-image:var(--tick)}
input:where([type=checkbox]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):indeterminate{background-color:var(--accent);border-color:var(--accent);
  background-image:linear-gradient(var(--on-accent),var(--on-accent));background-size:8px 2px}
input:where([type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):checked{border-color:var(--accent);
  background-image:radial-gradient(circle,var(--accent) 0,var(--accent) 3px,transparent 4px)}
input:where([type=checkbox],[type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):focus:not(:focus-visible){outline:0}
input:where([type=checkbox],[type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
input:where([type=checkbox],[type=radio]):where(:not(.switch,.ticklist *,.ticks-all *,.filter-body *)):disabled{opacity:.5;cursor:not-allowed}
.check input{accent-color:var(--accent)}
@media (forced-colors:active){input:where([type=checkbox],[type=radio]):where(:not(.switch)){-webkit-appearance:auto;appearance:auto;background:none}}

/* ---------- tables: rows on wide screens, one card per row on phones ---------- */
.table-wrap{overflow-x:auto}
table.table{width:100%;border-collapse:collapse}
.table{font-size:var(--fs-table)}
.table th{text-align:left;font-size:12px;font-weight:600;color:var(--text-3);padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line);white-space:nowrap;background:var(--surface-2)}
.table th:first-child{border-top-left-radius:8px}.table th:last-child{border-top-right-radius:8px}
.table td{padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line-soft);vertical-align:middle}
.table tr:last-child td{border-bottom:none}
.table td.actions{text-align:right;white-space:nowrap}
.table td.actions details[open],.table td.actions form .field{text-align:left;white-space:normal}
.table .strong,.strong{font-weight:600}
.table a.strong{color:var(--text)}
.table a.strong:hover{color:var(--accent)}
@media (max-width:719px){
  .table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .table,.table tbody,.table tr,.table td{display:block;width:100%}
  .table tr{border:1px solid var(--line);border-radius:12px;padding:6px 12px;margin-bottom:10px;background:var(--surface)}
  .table td{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:7px 0;border-bottom:1px solid var(--line-soft);text-align:right;overflow-wrap:anywhere}
  .table td::before{content:attr(data-label);font-size:12.5px;font-weight:560;color:var(--text-3);text-align:left;flex-shrink:0}
  .table td:last-child{border-bottom:none}
  .table td.actions{justify-content:flex-end;flex-wrap:wrap;gap:8px}
  .table td.actions::before{display:none}
  .table td.head{font-weight:600;font-size:15px;text-align:left;justify-content:flex-start}
  .table td.head::before{display:none}
  .card.flush-phone{padding:0;border:none;background:none;box-shadow:none}
}

/* ---------- badges ---------- */
.badge{display:inline-flex;align-items:center;gap:5px;padding:var(--badge-py) var(--badge-px);border-radius:var(--badge-r);font-size:var(--badge-fs);font-weight:var(--badge-fw);line-height:1.35;
  background:var(--neutral-bg);color:var(--text-2);white-space:nowrap}
.badge.ftd{background:var(--ftd-bg);color:var(--ftd)}
.badge.ok{background:var(--ok-bg);color:var(--ok)}
.badge.warn{background:var(--warn-bg);color:var(--warn)}
.badge.bad{background:var(--bad-bg);color:var(--bad)}
.badge.info{background:var(--info-bg);color:var(--info)}

/* ---------- flash messages ---------- */
.flashes{display:grid;gap:var(--sp-2);margin-bottom:var(--sp-4);scroll-margin-top:calc(var(--top) + var(--sp-3))}
.flash{display:flex;gap:10px;align-items:flex-start;padding:8px 12px;border-radius:var(--radius-sm);border:1px solid transparent;
  background:var(--ok-bg);color:var(--ok);font-weight:520}
.flash.error{background:var(--bad-bg);color:var(--bad)}
.flash.info{background:var(--info-bg);color:var(--info)}
.flash.error{border-color:color-mix(in srgb,var(--bad) 30%,transparent)}
.flash svg{margin-top:2px}
.flash .body{flex:1;min-width:0}
/* toasts (SEGMENTS 144): an outcome that went well, at the top right under the top bar (clear of the chat bubble, the
   bulk bars and a phone's bottom bar); app.js fades it after 5 seconds. Errors and warnings stay banners. */
.toasts{position:fixed;z-index:90;top:calc(var(--top) + var(--sp-2));right:var(--sp-3);left:var(--sp-3);display:flex;flex-direction:column;align-items:flex-end;gap:var(--sp-2);pointer-events:none}
.toasts:empty{display:none}
.flash.toast{pointer-events:auto;width:auto;max-width:min(420px,100%);align-items:center;padding:var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3);background:var(--text);color:var(--surface);
  border:0;box-shadow:var(--shadow-lg);font-size:var(--fs);font-weight:500;animation:toast-in .18s ease-out}
.flash.toast svg{margin:0;color:var(--ok-bg)}
.flash.toast.same svg{color:var(--surface)}
.flash.toast .body{overflow-wrap:anywhere}
.toast-x{flex:none;display:grid;place-items:center;width:var(--ctl-sm);height:var(--ctl-sm);border:0;border-radius:6px;background:none;color:inherit;opacity:.7;cursor:pointer;padding:0}
.toast-x:hover{opacity:1;background:rgba(127,127,127,.25)}
.toast-x svg{width:14px;height:14px}
.flash.toast.out{opacity:0;transform:translateY(-4px);transition:opacity .25s,transform .25s}
@keyframes toast-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.flash.toast{animation:none}.flash.toast.out{transition:none}}
@media (min-width:720px){.toasts{left:auto;right:var(--sp-6)}}
@media print{.toasts{display:none}}
.copybox{display:flex;gap:8px;align-items:stretch;margin-top:8px}
.copybox code{flex:1;min-width:0;display:block;padding:var(--field-py) var(--field-px);background:var(--surface);color:var(--text);border:1px solid var(--line);
  border-radius:var(--radius-sm);overflow-wrap:anywhere;font-weight:400}

/* ---------- empty state ---------- */
.empty{text-align:center;padding:var(--sp-6) var(--sp-4);color:var(--text-2)}
.empty .art{width:44px;height:44px;border-radius:12px;background:var(--accent-soft);color:var(--accent-dark);display:grid;place-items:center;margin:0 auto 12px}
.empty .art svg{width:22px;height:22px}
.empty h2{margin-bottom:4px;font-family:var(--head);font-size:15px;text-transform:none;letter-spacing:-.01em;color:var(--text)}
.empty p{max-width:420px;margin:0 auto 14px}

/* ---------- confirm dialog ---------- */
dialog.confirm{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--text);
  padding:var(--sp-5);width:min(92vw,420px);box-shadow:var(--shadow-lg)}
dialog.confirm::backdrop{background:rgba(10,12,18,.5)}
dialog.confirm p{font-size:var(--fs);margin-bottom:var(--sp-4)}

/* ---------- the quick jump (SEGMENTS 150): Ctrl K / ⌘K, a field and its results over the page ---------- */
dialog.jump{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--text);padding:0;
  width:min(calc(100vw - 32px),560px);margin:12vh auto auto;box-shadow:var(--shadow-lg);overflow:hidden}
dialog.jump::backdrop{background:rgba(10,12,18,.45)}
.jump-field{display:flex;align-items:center;gap:10px;padding:0 14px;border-bottom:1px solid var(--line);color:var(--text-3)}
.jump-field input{flex:1;min-width:0;border:0!important;background:transparent!important;outline:0!important;box-shadow:none!important;
  padding:14px 0!important;font-size:15px!important;color:var(--text)}
.jump-field kbd,.jump-foot kbd,.jump-kbd kbd{font:inherit;font-size:11px;line-height:1.5;padding:0 5px;border:1px solid var(--line-2);border-radius:4px;color:var(--text-3);background:var(--surface-2)}
.jump-results{max-height:min(52vh,420px);overflow-y:auto}
.jump-list{list-style:none;margin:0;padding:6px}
.jump-opt a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;color:var(--text);min-height:var(--ctl)}
.jump-opt a:hover{text-decoration:none}
.jump-opt[aria-selected=true] a{background:var(--accent-soft);color:var(--accent-dark)}
.jump-kind{flex:0 0 96px;font-size:11.5px;font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:.03em}
.jump-label{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jump-hint{margin-left:auto;font-size:var(--fs-sm);color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.jump-none{padding:14px;margin:0;color:var(--text-3);font-size:var(--fs-sm)}
.jump-foot{margin:0;padding:8px 14px;border-top:1px solid var(--line-soft)}
.jump-kbd{display:inline-flex;align-items:center;margin-left:auto}
.jump-kbd:hover{text-decoration:none}
.topbar .search-link.jump-only{display:grid}
.jump-page .jump-list{padding:6px 0}
.jump-sample{max-width:560px;padding:0;overflow:hidden}
@media (max-width:599px){dialog.jump{margin-top:8px}.jump-kind{flex-basis:84px}.jump-foot{display:none}}

/* New Run's live count (SEGMENTS 150) */
.run-count{display:block;margin:var(--sp-3) 0 var(--sp-2);font-size:var(--fs)}
.start-at .date-pop{width:100%}

/* ---------- preview of a change (before -> after) ---------- */
.preview{border:1px solid var(--accent-line);background:var(--accent-soft);border-radius:var(--radius);padding:var(--sp-3);margin:var(--sp-3) 0}
.preview h3{color:var(--accent-dark);margin-bottom:6px;font-size:13px}
.preview .summary{font-weight:580;margin-bottom:10px}
.diff{display:grid;gap:8px;margin:0 0 12px;padding:0;list-style:none}
.diff li{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:9px 12px}
.diff .what{font-size:var(--fs-label);color:var(--text-3);font-weight:560}
.diff .vals{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;margin-top:3px}
.diff .old{color:var(--bad);text-decoration:line-through;overflow-wrap:anywhere}
.diff .new{color:var(--ok);font-weight:580;overflow-wrap:anywhere}
.diff .arrow{color:var(--text-3)}

/* ---------- audit log ---------- */
.log{list-style:none;margin:0;padding:0}
.log>li{padding:var(--sp-3) 0;border-bottom:1px solid var(--line-soft)}
.log>li:last-child{border-bottom:none}
.log .line{display:flex;gap:10px;align-items:flex-start;flex-wrap:wrap}
.log .text{flex:1;min-width:200px}
.log .meta{font-size:var(--fs-sm);color:var(--text-3);margin-top:2px}
.log .undone .sum{text-decoration:line-through;color:var(--text-3)}
details.more>summary{cursor:pointer;color:var(--text-2);font-size:var(--fs);min-height:var(--ctl-sm);display:inline-flex;align-items:center}
details.more[open]>summary{margin-bottom:8px}

/* ---------- key-value list ---------- */
.kv{display:grid;grid-template-columns:1fr;gap:2px 16px;margin:0}
.kv dt{font-size:var(--fs-label);color:var(--text-3);font-weight:560;margin-top:var(--sp-2)}
.kv dd{margin:0;overflow-wrap:anywhere}
@media (min-width:720px){.kv{grid-template-columns:180px 1fr}.kv dt{margin-top:0;padding:var(--sp-1) 0}.kv dd{padding:var(--sp-1) 0}}

/* ---------- sign-in pages ---------- */
body.plain{display:grid;place-items:center;padding:24px 14px}
.auth{width:100%;max-width:400px}
.auth .brand{justify-content:center;margin-bottom:18px;font-size:19px}
.auth .card{padding:22px}
.auth h1{font-size:22px;margin-bottom:6px}
.auth .lead{color:var(--text-2);margin-bottom:16px}
.auth .foot{text-align:center;color:var(--text-3);font-size:13px;margin-top:14px}
.qr{display:grid;place-items:center;background:#fff;border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px;margin:0 auto 12px;width:max-content;max-width:100%}
.qr svg{display:block;width:232px;height:232px;max-width:100%}
.steps{margin:0 0 14px;padding-left:20px;color:var(--text-2)}
.steps li{margin-bottom:6px}

/* ---------- style guide helpers ---------- */
.swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
.swatch{border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;font-size:12.5px}
.swatch i{display:block;height:44px}
.swatch span{display:block;padding:6px 8px;color:var(--text-2)}
.sw-bg{background:var(--bg)}.sw-surface{background:var(--surface)}.sw-line{background:var(--line)}.sw-text{background:var(--text)}
.sw-text-2{background:var(--text-2)}.sw-text-3{background:var(--text-3)}.sw-accent{background:var(--accent)}.sw-accent-soft{background:var(--accent-soft)}
.sw-rail{background:var(--rail)}.sw-ftd{background:var(--ftd)}
.sw-ok{background:var(--ok)}.sw-warn{background:var(--warn)}.sw-bad{background:var(--bad)}.sw-info{background:var(--info)}
.stack>*+*{margin-top:10px}
form+.field,.btn-row+.field{margin-top:var(--sp-4)}

/* ---------- module 1: notices, filters, usage meter, compare table, invoice ---------- */
.notice{display:flex;gap:10px;align-items:flex-start;padding:var(--sp-2) var(--sp-3);border-radius:var(--radius-sm);margin:0 0 var(--sp-3);font-size:var(--fs);border:1px solid transparent}
.notice svg{flex:none;width:18px;height:18px;margin-top:2px}
.notice>div{flex:1;min-width:0}
.notice.warn{background:var(--warn-bg);color:var(--warn)}
.notice.support{background:var(--info-bg);color:var(--info);align-items:center;flex-wrap:wrap}
.notice form{margin:0}
.filters{display:grid;gap:10px;margin:0 0 14px;align-items:end}
.filters .field{margin:0}
@media (min-width:720px){.filters{grid-template-columns:2fr 1fr 1fr auto}}
.meter{display:inline-flex;flex-direction:column;gap:4px;min-width:130px}
.meter .bar{display:block;height:6px;border-radius:3px;background:var(--neutral-bg);overflow:hidden}
.meter .bar i{display:block;height:100%;background:var(--accent);border-radius:3px}
.meter.high .bar i{background:var(--warn)}
.meter.full .bar i{background:var(--bad)}
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}
.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}
.bad-text{color:var(--bad);font-weight:600}
.table.compare tr.changed td{background:var(--accent-soft)}
.table td.num,.table th.num{text-align:right}
.pre{white-space:pre-line}
.invoice{max-width:760px}
.inv-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin:0 0 20px}
.inv-title{font-size:1.5rem;font-weight:700}
.invoice .label{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--text-3);margin:0 0 4px}
.invoice .grid{margin:0 0 20px}
.card h3{margin:var(--sp-4) 0 var(--sp-2)}
.card form+h2,.card .form-grid+h2{margin-top:var(--sp-5)}
@media print{
  .topbar,.rail,.no-print,.flashes,.notice,dialog{display:none!important}
  body,main,.app{background:#fff!important;margin:0!important;padding:0!important}
  .card.invoice{box-shadow:none;border:0;max-width:none}
}
.card form+form{margin-top:var(--sp-4)}
.btn-row form+form,.card-head form+form,.notice form+form{margin-top:0}

/* ---------- module 2: jobs, brands, connections, recipes ---------- */
.chips{margin:0 0 var(--gap)}
.codebox{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px;margin:0 0 12px;max-height:420px;overflow:auto;color:var(--text)}
.split{display:grid;gap:var(--gap);grid-template-columns:1fr}
.split>div{min-width:0}
@media (min-width:900px){.split{grid-template-columns:1fr 1fr}}
.result{display:flex;gap:10px;align-items:flex-start;padding:var(--sp-2) var(--sp-3);border-radius:var(--radius-sm);margin:0 0 var(--sp-3);font-weight:560}
.result.ok{background:var(--ok-bg);color:var(--ok)}
.result.bad{background:var(--bad-bg);color:var(--bad)}
.result svg{margin-top:2px}
/* a list of small forms rows (recipe fields, values to fill in): stacked on phones, one line each on wide screens */
.rows{display:grid;gap:var(--sp-2);margin:0 0 var(--gap)}
.rows .row{display:grid;gap:8px;grid-template-columns:1fr;padding:10px;border:1px solid var(--line-soft);border-radius:var(--radius-sm);background:var(--surface-2)}
.rows .row label{font-size:12px;color:var(--text-3);font-weight:560;display:block;margin-bottom:3px}
.rows .row label.check{display:flex;font-size:var(--fs);color:var(--text);font-weight:500;margin:0}
@media (min-width:900px){
  .rows .row{grid-template-columns:repeat(var(--cols,4),minmax(0,1fr));align-items:end}
  .rows.c2 .row{--cols:2}.rows.c3 .row{--cols:3}.rows.c5 .row{--cols:5}.rows.c6 .row{--cols:6}
}
details.section{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);margin-bottom:var(--gap);box-shadow:var(--shadow)}
details.section>summary{cursor:pointer;padding:var(--sp-2) var(--sp-3);font-weight:600;display:flex;align-items:center;gap:var(--sp-2);min-height:var(--ctl);list-style:none}
details.section>summary::-webkit-details-marker{display:none}
details.section>summary::before{content:"+";width:22px;height:22px;border-radius:6px;background:var(--neutral-bg);display:grid;place-items:center;color:var(--text-2);font-weight:600;flex-shrink:0}
details.section[open]>summary::before{content:"−"}
details.section>summary .hint{font-weight:400;color:var(--text-3);font-size:var(--fs-sm);margin-left:auto;text-align:right}
details.section>.inside{padding:var(--sp-1) var(--sp-3) var(--sp-3);border-top:1px solid var(--line-soft)}
.inside>h3:first-child{margin-top:12px}
.inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap;min-width:0}
.inline select,.inline input{width:auto;min-width:0;flex:1 1 140px}
@media (max-width:719px){
  .table td:has(>form.inline){flex-wrap:wrap}
  .table td>form.inline{flex:1 1 100%}
  .table td.actions>form.inline,.table td>form.inline.sw{flex:0 0 auto}  /* a row of small buttons (Rotate, Revoke) */
}
/* ONE tab style (SEGMENTS 144): views of a page or a list are underline tabs (.views, .dtabs); a choice of 2-4
   exclusive options (periods, Cards / List, Group by) is a segmented control (.tabs, .seg, .seg-radio), all drawn alike:
   a light track with the chosen option raised on it. */
.tabs,.seg{display:inline-flex;align-items:stretch;gap:2px;flex-wrap:wrap;margin:0 0 var(--gap);background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:2px;max-width:100%;font-size:13px;min-height:var(--ctl)}
.tabs a,.seg a,.seg-radio label{display:inline-flex;align-items:center;padding:0 10px;border-radius:6px;color:var(--text-2);font-size:13px;font-weight:500;white-space:nowrap;background:none;border:0}
.tabs a:hover,.seg a:hover,.seg-radio label:hover{text-decoration:none;color:var(--text);background:var(--neutral-bg)}
.tabs a,.seg a,.seg-radio label{min-height:calc(var(--ctl) - 6px)}
@media (max-width:719px){.tabs a,.seg a,.seg-radio label{min-height:40px}}
.tabs a.on,.seg a.on,.seg-radio label:has(input:checked){background:var(--seg-on);color:var(--text);font-weight:600;box-shadow:0 1px 2px rgba(20,26,38,.08),0 0 0 1px var(--line)}
ul.plain{list-style:none;margin:0 0 12px;padding:0}
ul.plain li{padding:3px 0;color:var(--text-2);overflow-wrap:anywhere}

/* ---------- module 4: boxes, rows, the week-grid hours picker ---------- */
@media (min-width:720px){.form-grid.three{grid-template-columns:repeat(3,1fr)}}
.grid.stats{grid-template-columns:1fr 1fr}
@media (min-width:900px){.grid.stats{grid-template-columns:repeat(4,1fr)}}
ul.notes{margin:0 0 var(--sp-3);padding-left:18px;color:var(--text-2);font-size:var(--fs)}
ul.notes li{margin:3px 0}
.table td .badge+.small{margin-left:4px}
.hours-simple input{min-width:0}
.weekgrid{margin:0 0 var(--gap)}
.wg-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.wg-sum{color:var(--text-2);margin:8px 0 0}
/* wide screens: a day per line, the 24 hours across (two cells an hour) */
.wg-board{display:grid;grid-template-columns:42px repeat(48,minmax(0,1fr));gap:1px;user-select:none;-webkit-user-select:none}
.wg-l{font-size:11px;color:var(--text-3);display:flex;align-items:center}
.wg-l.time{grid-column:span 2;justify-content:flex-start;padding-left:1px}
.wg-l.day{font-weight:600;color:var(--text-2);font-size:12px}
.wg-c{appearance:none;-webkit-appearance:none;border:0;padding:0;margin:0;min-height:26px;background:var(--neutral-bg);border-radius:2px;cursor:pointer;touch-action:none}
.wg-c.half{margin-right:1px}
.wg-c.on{background:var(--accent)}
.wg-c.now{box-shadow:inset 0 0 0 2px var(--warn)}
.wg-c:focus-visible{outline:2px solid var(--text);outline-offset:1px;position:relative;z-index:1}
/* phones: a day per column, the day runs downwards; the time labels at the side still scroll the page */
.wg-board.tall{grid-template-columns:44px repeat(7,minmax(0,1fr));gap:1px 3px}
.wg-board.tall .wg-l.time{grid-column:auto;align-items:flex-start;line-height:1;height:16px}
.wg-board.tall .wg-l.day{justify-content:center;padding-bottom:4px;position:sticky;top:var(--top);background:var(--surface);z-index:1}
.wg-board.tall .wg-c{min-height:16px;border-radius:2px;margin:0}
.wg-board.tall .wg-c.half{margin-bottom:2px}
.btn-row+.card,.btn-row+.grid{margin-top:var(--gap)}
.checks{display:flex;flex-wrap:wrap;gap:0 18px}

/* module 5: small bar charts (SVG, no script), money tables */
.spark{margin:14px 0 0}
.spark figcaption{font-size:var(--fs-sm);font-weight:560;margin-bottom:6px}
.spark svg{display:block;width:100%;height:56px;border-bottom:1px solid var(--line)}
.spark rect{fill:var(--accent)}
.spark svg.tall{height:120px}
.table td.num,.table th.num{text-align:right;font-variant-numeric:tabular-nums}
@media (max-width:719px){.table td.num{text-align:left}}
.table tr.total td{font-weight:650;border-top:2px solid var(--line)}
/* module 7: fraud rules (one line per check) */
.table tr.group td{background:var(--neutral-bg);color:var(--text-2);font-size:var(--fs-sm);font-weight:560}
.fraud-rules select{min-width:130px}
.fraud-rules input[type=number]{width:90px}
a.badge:hover{text-decoration:none;filter:brightness(.97)}
@media (max-width:719px){.fraud-rules select,.fraud-rules input[type=number]{width:auto;flex:1 1 120px}}
@media (max-width:719px){.table tr.group td{justify-content:flex-start}}

/* ---------- the assistant (module 8) ---------- */
.ai-meter{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin:0 0 var(--gap)}
.ai-chat{display:flex;flex-direction:column;gap:18px;margin:0 0 18px}
.ai-turn{display:flex;flex-direction:column;gap:8px}
.ai-said{border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;background:var(--surface);max-width:860px;min-width:0}
.ai-said.you{align-self:flex-end;background:var(--accent-soft);border-color:transparent}
.ai-said.it{align-self:flex-start;width:100%}
.ai-said .who{font-size:12px;color:var(--text-3);margin-bottom:4px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.ai-said .words{white-space:pre-wrap;overflow-wrap:anywhere}
.ai-steps{margin:0 0 12px;padding-left:20px;display:flex;flex-direction:column;gap:12px}
.ai-steps li.bad .summary{color:var(--bad)}
.ai-ask textarea{width:100%}
.flash.warn{background:var(--warn-bg);color:var(--warn)}

/* ---------- alerts (module 10) ---------- */
.alert-chats{margin-top:16px}
.alert-chat{border:1px solid var(--line);border-radius:var(--radius);padding:var(--card-pad) var(--card-px);background:var(--surface);min-width:0}
.alert-chat h3{margin:0;overflow-wrap:anywhere}
fieldset.checks{border:0;margin:0 0 12px;padding:0;min-width:0}
fieldset.checks legend{font-size:var(--fs-label);font-weight:560;color:var(--text-2);padding:0;margin-bottom:6px;width:100%}
.warn-text{color:var(--warn)}
.badge.locked{background:var(--bad-bg);color:var(--bad)}

/* ================= Look D components (all on /styleguide) ================= */
/* a list: view tabs, one toolbar, the table edge to edge, a pager */
.card.list{padding:0}
.card.list>.table-wrap{border-top:1px solid var(--line)}
.card.list .table th{border-radius:0}
.card.list>.empty{border-top:1px solid var(--line)}
.card.list>.inside,.card.list>.card-head{padding:var(--sp-3) var(--sp-4)}
.card.list>.card-head{margin:0}
.views,.dtabs{display:flex;gap:var(--sp-4);padding:var(--sp-1) var(--sp-3) 0;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none;font-size:13px}
.views a,.dtabs a{display:flex;gap:6px;align-items:center;padding:var(--sp-2) 2px;margin-bottom:-1px;border-bottom:2px solid transparent;color:var(--text-2);font-size:13px;font-weight:500;white-space:nowrap}
.views a:hover,.dtabs a:hover{text-decoration:none;color:var(--text)}
.views a.on,.dtabs a.on{color:var(--text);font-weight:600;border-bottom-color:var(--accent)}
.views a .n,.dtabs .n{font-size:12px;color:var(--text-3);font-weight:500;font-variant-numeric:tabular-nums}
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px}
.toolbar .grow{flex:1}
.toolbar .hint{font-size:13px;color:var(--text-3);min-width:0}
.toolbar input:not([type=checkbox],[type=radio],[type=hidden]),.toolbar select{width:auto;min-width:0}
.toolbar .dates{display:flex;align-items:center;gap:6px;color:var(--text-3);font-size:13px;min-width:0}
.toolbar .dates input{flex:1 1 120px;min-width:0;width:100%}
.toolbar .find{display:flex;flex:1 1 220px;min-width:0;max-width:420px;margin-left:auto}
.toolbar .find input{flex:1;border-top-right-radius:0;border-bottom-right-radius:0;border-right:0}
.toolbar .find .btn{border-top-left-radius:0;border-bottom-left-radius:0}
.chip{display:inline-flex;align-items:center;gap:6px;background:var(--accent-soft);border:1px solid var(--accent-line);color:var(--accent-dark);border-radius:999px;padding:4px 6px 4px 12px;font-size:13px;font-weight:500;max-width:100%}
.chip a{color:inherit;padding:0 5px;font-size:15px;line-height:1;border-radius:50%}
.chip a:hover{text-decoration:none;background:var(--accent-line)}
.sumline{display:flex;flex-wrap:wrap;gap:6px 20px;padding:0 12px 8px;font-size:13px;color:var(--text-2)}
.sumline b{font-variant-numeric:tabular-nums;color:var(--text)}
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-top:1px solid var(--line);font-size:13px;color:var(--text-2)}
.table td .sub,.sub{display:block;font-size:12px;color:var(--text-3);font-weight:400}
.table td.num,.table th.num{text-align:right;font-variant-numeric:tabular-nums}
@media (min-width:720px){.table.wide{min-width:980px}.card.list>.table-wrap{overflow-x:auto}}
@media (max-width:719px){.card.list{border:0;background:none;box-shadow:none;border-radius:0}.card.list>.table-wrap{border:0}
  .card.list .toolbar,.card.list .views,.card.list .pager,.card.list>.inside,.card.list>.card-head,.card.list .sumline{background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:10px}
  .card.list .views{padding:4px 8px 0}.card.list .views a{margin-bottom:0}
  .toolbar .find{max-width:none;flex-basis:100%;margin-left:0}.toolbar .dates{flex:1 1 100%}}

/* square tags (a fraud check's result) and a dot with words (a brand right now) */
.tag{display:inline-block;font-size:12px;font-weight:600;border-radius:6px;padding:2px 8px;background:var(--neutral-bg);color:var(--text-2);white-space:nowrap}
.tag.ok{background:var(--ok-bg);color:var(--ok)}.tag.warn{background:var(--warn-bg);color:var(--warn)}.tag.bad{background:var(--bad-bg);color:var(--bad)}
.state{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.state::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--series-2);flex-shrink:0}
.state.ok::before{background:#16a34a}.state.warn::before{background:#d97706}.state.bad::before{background:#dc2626}
.state.bad{color:var(--bad);font-weight:600}

/* number tiles: a big number, today and yesterday, a trend line */
.kpis{display:grid;grid-template-columns:1fr 1fr;gap:var(--sp-3) 0}
.kpi{display:flex;flex-direction:column;gap:4px;padding:2px 14px;border-left:1px solid var(--line);min-width:0}
.kpi:nth-child(2n+1){border-left:0;padding-left:0}
.kpi .label{font-size:var(--fs-label);color:var(--text-2);font-weight:600}
.kpi .row{display:flex;align-items:flex-end;justify-content:space-between;gap:4px 8px;flex-wrap:wrap}
.kpi .value{font-family:var(--head);font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.02em;line-height:1.15;white-space:nowrap}
.kpi .side{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0}
.kpi .foot{font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums}
.trend{font-size:12px;font-weight:600;color:var(--text-3);white-space:nowrap}
.trend.up{color:var(--up)}.trend.down{color:var(--down)}
svg.sparkline{width:64px;height:22px;display:block;overflow:visible}
svg.sparkline polyline{fill:none;stroke:var(--series-2);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
svg.sparkline.up polyline{stroke:var(--up)}svg.sparkline.down polyline{stroke:var(--down)}
@media (min-width:720px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.kpis.four{grid-template-columns:repeat(4,minmax(0,1fr))}
  .kpi,.kpi:nth-child(2n+1){border-left:1px solid var(--line);padding:2px 16px}.kpi:first-child,.kpis:not(.four) .kpi:nth-child(3n+1),.kpis.four .kpi:nth-child(4n+1){border-left:0;padding-left:0}
  .kpi .value{font-size:22px}}
@media (min-width:1300px){.kpi .value{font-size:24px}}
.cols{display:grid;gap:var(--gap);grid-template-columns:minmax(0,1fr);align-items:start}
.cols>div{min-width:0}
@media (min-width:1100px){.cols{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.cols.lead{grid-template-columns:minmax(0,5fr) minmax(0,6fr)}}
.card-head .more-link{font-size:13px;font-weight:600;white-space:nowrap}

/* bars: a cap (used of a limit), a ranking, hours of a day with the "now" line */
.bar{display:block;height:8px;border-radius:999px;background:var(--track);overflow:hidden;min-width:40px}
.bar i{display:block;height:100%;border-radius:999px;background:var(--accent)}
.bar.full i{background:var(--full)}
.caprow{display:grid;grid-template-columns:minmax(0,45%) 1fr auto;gap:12px;align-items:center;font-size:13px;padding:5px 0}
.caprow .name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.caprow .n{text-align:right;font-variant-numeric:tabular-nums;color:var(--text-2);white-space:nowrap}
.cap{display:flex;align-items:center;gap:10px;min-width:150px}
.cap .bar{flex:1}
.cap .n{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px}
svg.hoursbar{display:block;width:100%;min-width:120px;height:16px;overflow:visible}
svg.hoursbar .track{fill:var(--track)}
svg.hoursbar .open{fill:var(--accent-mid)}
svg.hoursbar.off .open{fill:var(--series-2)}
svg.hoursbar .now{stroke:var(--now);stroke-width:2;vector-effect:non-scaling-stroke}
.hours{display:flex;flex-direction:column;gap:3px;min-width:150px}
.hours .txt{font-size:12px;color:var(--text-2);font-variant-numeric:tabular-nums}
.hours-scale{display:flex;justify-content:space-between;font-size:11px;color:var(--text-3)}

/* an on/off switch: a button that posts the action */
.switch{appearance:none;-webkit-appearance:none;-moz-appearance:none;border:0;cursor:pointer;display:inline-block;width:38px;height:22px;border-radius:999px;padding:0;margin:0;vertical-align:middle;flex-shrink:0;
  background:var(--line-2) radial-gradient(circle at 11px 50%,#fff 0,#fff 8.5px,transparent 9.5px) no-repeat}
.switch[aria-checked=true],input[type=checkbox].switch:checked{background:var(--accent) radial-gradient(circle at 27px 50%,#fff 0,#fff 8.5px,transparent 9.5px) no-repeat}
.switch:disabled{opacity:.55;cursor:not-allowed}

/* "needs your attention" */
.attn{display:flex;flex-direction:column;gap:8px}
.attn .line{display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-2) var(--sp-3);border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--line-soft);color:var(--text)}
.attn .line::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--text-3);flex:none}
.attn .line.bad{background:var(--bad-bg)}.attn .line.bad::before{background:var(--down)}
.attn .line.warn{background:var(--ftd-bg)}.attn .line.warn::before{background:var(--full)}
.attn .line .txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:var(--fs-sm);color:var(--text-2)}
.attn .line .txt b{font-size:var(--fs);font-weight:600;color:var(--text)}
.attn .line a{font-size:var(--fs-sm);font-weight:600;white-space:nowrap}
.attn .calm{color:var(--text-2);font-size:var(--fs);display:flex;gap:8px;align-items:center}
.attn .calm svg{color:var(--up)}

/* charts (SVG, no script): lines, bars */
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;color:var(--text-2)}
.legend i{display:inline-block;width:10px;height:3px;border-radius:2px;background:var(--series-2);vertical-align:middle;margin-right:4px}
.legend i.s2{background:var(--accent)}.legend i.s3{background:var(--full)}
svg.lines{display:block;width:100%;height:auto;overflow:visible}
svg.lines .gridline{stroke:var(--line);stroke-width:1;vector-effect:non-scaling-stroke}
svg.lines polyline{fill:none;stroke:var(--series-2);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
svg.lines polyline.s2{stroke:var(--accent)}
svg.lines polyline.s3{stroke:var(--full);stroke-dasharray:6 4}
.axis{display:flex;justify-content:space-between;font-size:11px;color:var(--text-3);margin-top:4px}
svg.bars{display:block;width:100%;height:150px;border-bottom:1px solid var(--line)}
svg.bars rect{fill:var(--accent)}
.rank{display:grid;grid-template-columns:minmax(0,110px) 1fr 48px;gap:8px;align-items:center;font-size:13px;padding:3px 0}
.rank .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank .n{text-align:right;font-variant-numeric:tabular-nums}

/* what happened, step by step */
ol.timeline{list-style:none;margin:0;padding:0}
ol.timeline li{display:grid;grid-template-columns:48px 14px minmax(0,1fr);gap:0 10px}
ol.timeline .t{font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums;padding-top:1px;text-align:right}
ol.timeline .t small{display:block;font-size:11px}
ol.timeline .dot{display:flex;flex-direction:column;align-items:center}
ol.timeline .dot::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--series-2);margin-top:4px;flex:none}
ol.timeline .dot::after{content:"";flex:1;width:2px;background:var(--line);margin:2px 0}
ol.timeline li:last-child .dot::after{background:transparent}
ol.timeline li.ok .dot::before{background:#16a34a}ol.timeline li.accent .dot::before{background:var(--accent)}
ol.timeline li.warn .dot::before{background:#d97706}ol.timeline li.bad .dot::before{background:#dc2626}
ol.timeline .what{padding-bottom:var(--sp-3);min-width:0;overflow-wrap:anywhere}
ol.timeline .what b{display:block;font-weight:600;font-size:var(--fs)}
ol.timeline .what span{font-size:var(--fs-sm);color:var(--text-2)}

/* a lead's header: the name with its state */
.title-row{display:flex;align-items:center;gap:10px 12px;flex-wrap:wrap}
.page-head .lede{flex:0 0 100%;margin:0;color:var(--text-2);font-size:var(--fs)}

/* a list whose table holds forms of its own: the toolbar is one card, the table the next, drawn as one */
@media (min-width:720px){.card.list.top{margin-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom:0}
  .card.list.top+.card{border-top-left-radius:0;border-top-right-radius:0}}

/* the brand edition's dashboard: an affiliate against its cap (name, bar, used / cap, FTDs), a CRM right now */
.caprow.four{grid-template-columns:minmax(0,34%) 1fr auto 60px}
.crmrow{display:flex;flex-direction:column;gap:2px;padding:7px 0;border-top:1px solid var(--line-soft)}
.crmrow:first-of-type{border-top:0}
.chips{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;margin:0 0 12px}
.chip.plain{padding:4px 12px}
.crm-countries+.crm-countries,.crm-countries~[data-preview-slot]+.crm-countries{margin-top:18px;padding-top:16px;border-top:1px solid var(--line-soft)}
/* the week as bars, one day a line (an affiliate's working hours) */
.weekbars{margin:0 0 16px}
.weekbars .wb{display:grid;grid-template-columns:40px minmax(0,1fr) minmax(96px,auto);gap:12px;align-items:center;padding:5px 0;font-size:13px}
.weekbars .wb.head{font-size:12px;color:var(--text-3);font-weight:600}
.weekbars .wb.today b{color:var(--accent-dark)}
.weekbars .wb .txt{font-variant-numeric:tabular-nums;color:var(--text-2);text-align:right}
.weekbars .hours-scale{margin:2px 0 0 52px;padding-right:calc(96px + 12px)}
/* the portal's overview: reasons with their code, countries with leads and FTDs */
.rank.wide{grid-template-columns:minmax(0,46%) 1fr 48px;padding:6px 0}
.rank.wide .name{white-space:normal}
.rank.two{grid-template-columns:minmax(0,120px) 1fr 48px 36px}
.bar.grey i{background:var(--series-2)}

/* ---------- the operator console: an amber badge and a label, never mistaken for a client's back office ---------- */
.console .mark{background:var(--console);color:var(--console-ink)}
.console-label{display:inline-block;margin-left:6px;padding:2px 9px;border-radius:999px;background:var(--console-soft);color:var(--console-text);font-size:12px;font-weight:600;white-space:nowrap}
.console .topbar .where{color:var(--text);flex-basis:auto}
.console .topbar .where b{font-family:var(--head);font-weight:700}
.kpi .value.bad-text{color:var(--bad)}
.termrow{display:grid;grid-template-columns:minmax(0,34%) 1fr auto;gap:12px;align-items:center;font-size:13px;padding:6px 0}
.termrow .n{text-align:right;font-variant-numeric:tabular-nums;color:var(--text-2);white-space:nowrap}
.kpi a.value{color:var(--text)}
.kpi a.value:hover{color:var(--accent);text-decoration:none}
.kpi a.value.bad-text{color:var(--bad)}
.card-head form.inline select{flex:0 0 auto}
/* module 12: the credit line the country database's licence asks for (DB-IP, CC BY 4.0), under every client page */
.page-credit{margin:var(--sp-6) 0 0;font-size:var(--fs-label);color:var(--text-3)}
.page-credit a{color:inherit}

/* ---------- the settings pages: a menu of their own beside the content; a row of tabs on a phone ---------- */
.with-subnav{display:block}
.subnav{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;margin:0 0 14px;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:12px}
.subnav h2{display:none}
.subnav a{flex:none;padding:var(--sp-2) var(--sp-3);border-radius:var(--radius-sm);color:var(--text-2);font-size:var(--fs);white-space:nowrap}
.subnav a:hover{text-decoration:none;background:var(--neutral-bg);color:var(--text)}
.subnav a.on{background:var(--accent-soft);color:var(--accent-dark);font-weight:600}
.subnav-body{min-width:0}
@media (min-width:1000px){
  .with-subnav{display:grid;grid-template-columns:230px minmax(0,1fr);gap:20px;align-items:start}
  .subnav{flex-direction:column;gap:2px;padding:12px;border-radius:var(--radius);margin:0;position:sticky;top:calc(var(--top) + 16px);overflow:visible}
  .subnav h2{display:block;font-size:var(--fs-label);color:var(--text-3);margin:0;padding:6px 10px}
  .subnav h2:not(:first-child){padding-top:14px}
  .subnav a{white-space:normal;padding:5px 10px;font-size:var(--fs)}
}
.settings-row{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--sp-4);padding:var(--sp-3) 0;border-top:1px solid var(--line-soft)}
.settings-row:first-of-type{border-top:0;padding-top:0}
.settings-row .txt{display:flex;flex-direction:column;gap:2px;font-size:var(--fs-sm);color:var(--text-2);min-width:0}
.settings-row .txt b{font-size:var(--fs);font-weight:600;color:var(--text)}
.person{display:flex;align-items:center;gap:10px;min-width:0}
.person .avatar{width:32px;height:32px;font-size:12px}
.rolegrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:var(--gap);font-size:var(--fs-sm)}
.rolegrid>div{border:1px solid var(--line);border-radius:10px;padding:var(--sp-3);display:flex;flex-direction:column;gap:4px;color:var(--text-2)}
.rolegrid b{color:var(--text);font-weight:600}
.tag.ai{background:var(--accent-soft);color:var(--accent-dark)}.tag.support{background:var(--warn-bg);color:var(--warn)}.tag.system{background:var(--info-bg);color:var(--info)}
.packs{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.pack{display:flex;flex-direction:column;gap:2px;border:1px solid var(--line-2);border-radius:10px;padding:var(--sp-2) var(--sp-3);font-size:var(--fs-sm);color:var(--text-2)}
.pack b{color:var(--text);font-weight:600}
.kpi .value.small{font-size:18px;white-space:normal}
@media (min-width:1300px){.kpi .value.small{font-size:20px}}

/* a plain note (not a warning, not the support-session banner) */
.notice.info{background:var(--info-bg);color:var(--info)}
/* forms that sit in a page header's buttons stay one line each */
.page-head .actions form.inline{flex:0 0 auto}
.page-head .actions form.inline .btn{white-space:nowrap}

/* a lead's "Brand response": one attempt per fold, what we sent beside what came back (stacked on a phone) */
details.resp{border:1px solid var(--line);border-radius:10px;margin:0 0 10px;background:var(--surface)}
details.resp>summary{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;padding:var(--sp-2) var(--sp-3);cursor:pointer;font-size:var(--fs)}
details.resp[open]>summary{border-bottom:1px solid var(--line)}
.respline{display:grid;gap:8px 16px;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:12px}
.respline dt{font-size:12px;color:var(--text-3)}
.respline dd{margin:0;font-size:var(--fs);overflow-wrap:anywhere}
.pair{display:grid;gap:12px;grid-template-columns:minmax(0,1fr);padding:0 12px 12px}
.pair>div{min-width:0}
.pair-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 6px}
.pair-head h3{margin:0;font-size:13px}
.pair .codebox{margin:0;max-height:420px;overflow:auto}
@media (min-width:720px){.respline{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media (min-width:900px){.pair{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
/* SEGMENTS 132: one block per integration, Trackbox-like rows (Registration, Response Time, Status / Deposit Pull) */
.br-block{border:1px solid var(--line);border-radius:12px;padding:10px;margin:0 0 14px;background:var(--surface-2)}
.br-title{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding:2px 4px 10px;font-size:var(--fs)}
.br-block details.resp{margin:0 0 8px}
.br-block details.resp:last-child{margin-bottom:0}
.br-row>summary,.br-line{gap:6px 18px}
.br-line{display:flex;flex-wrap:wrap;align-items:center;padding:var(--sp-2) var(--sp-3);margin:0 0 var(--sp-2);border:1px solid var(--line);border-radius:10px;
  background:var(--surface);font-size:var(--fs)}
.br-name{font-weight:600;min-width:9.5em}
.br-fact{display:inline-flex;gap:6px;align-items:center}
.br-fact>span:first-child{color:var(--text-3);font-size:12.5px}
.br-when{margin-left:auto;font-size:12.5px}
.respline .br-wide{grid-column:span 2}
.codebox.code-x{white-space:pre;overflow-wrap:normal;overflow:auto}
@media (max-width:519px){.br-block{padding:6px}.br-name{min-width:0;width:100%}.br-when{margin-left:0}}

/* tick-box lists of a filter panel (ui.ticks): a value, its count; long lists scroll and can be searched */
.ticks{border:1px solid var(--line);border-radius:10px;background:var(--surface);padding:8px 10px 6px;margin:0;min-width:0}
.ticks legend{font-size:12.5px;font-weight:600;color:var(--text-2);padding:0 4px}
.ticks legend .n{font-weight:500;color:var(--accent-dark)}
.ticks .ticks-find{width:100%;min-height:32px;padding:4px 9px;font-size:13px;margin:0 0 6px}
.ticklist{max-height:204px;overflow-y:auto;display:flex;flex-direction:column}
.ticklist label{display:flex;align-items:center;gap:8px;padding:5px 2px;font-size:13.5px;cursor:pointer;border-radius:6px;min-height:30px}
.ticklist label:hover{background:var(--surface-2)}
.ticklist label[hidden]{display:none}
.ticklist label span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ticklist label b{font-weight:500;font-size:12.5px;color:var(--text-3)}
.ticklist input{flex:none;margin:0}
.toolbar .dates select{width:auto}
@media (max-width:719px){.toolbar .dates{flex-wrap:wrap}.toolbar .dates select{flex:1 1 100%}}

/* ---------- the Leads page like Trackbox's (28 Nov 2026): one row of filter lists that scrolls sideways, pins,
   menus for columns and views, sortable headers, ticks and the bulk bar ---------- */
.leads-page{position:relative}
.filterrow{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 10px;margin:0 0 10px;scroll-snap-type:x proximity;overscroll-behavior-x:contain}
.filterrow>.ticks{flex:0 0 228px;scroll-snap-align:start;position:relative}
.filterrow>.ticks.pinned{border-color:var(--accent-line);box-shadow:inset 0 2px 0 var(--accent)}
.ticks .pin{position:absolute;top:2px;right:6px;border:0;background:none;padding:2px 4px;font-size:12px;line-height:1;cursor:pointer;opacity:.35;filter:grayscale(1);border-radius:6px}
.ticks .pin:hover,.ticks .pin:focus-visible{opacity:.8}
.ticks.pinned .pin{opacity:1;filter:none}
.ticks-all{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text-3);padding:2px 2px 4px;border-bottom:1px solid var(--line-soft);margin-bottom:2px;cursor:pointer}
.ticks-all input{margin:0}
details.pop{position:relative;display:inline-block}
details.pop>summary{list-style:none;cursor:pointer}
details.pop>summary::-webkit-details-marker{display:none}
details.pop[open]>summary{background:var(--accent-soft);border-color:var(--accent-line);color:var(--accent-dark)}
.pop-body{position:absolute;z-index:45;top:calc(100% + 6px);left:0;width:min(380px,calc(100vw - 32px));max-height:70vh;overflow:auto;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:var(--pop-py) var(--pop-px);text-align:left;white-space:normal}
.pop-body.up{top:auto;bottom:calc(100% + 8px)}
.pop-body label.field{display:grid;gap:4px;margin:0 0 10px;font-size:13px;font-weight:600;color:var(--text-2)}
.pop-body label.field input,.pop-body label.field select,.pop-body label.field textarea{font-weight:400}
.pop-body .btn-row{margin-top:6px}
.cols-on{list-style:none;margin:0 0 10px;padding:0;border-bottom:1px solid var(--line);padding-bottom:8px}
.cols-on li{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:30px}
.cols-on label,.cols-off label{display:flex;align-items:center;gap:8px;font-size:13.5px;cursor:pointer;min-width:0}
.cols-on .moves{display:flex;gap:2px}
.cols-on .moves a{padding:2px 7px;border-radius:6px;color:var(--text-2)}
.cols-on .moves a:hover{background:var(--surface-2);text-decoration:none}
.cols-off{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 10px;margin-bottom:8px}
.cols-off label{min-height:28px}
.cols-off small{color:var(--text-3);font-size:11px;margin-left:auto;white-space:nowrap}
.view-list{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:6px}
.leadgrid th a.sort{color:inherit;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.leadgrid th a.sort:hover{text-decoration:none;color:var(--text)}
.leadgrid th .arrow{opacity:.35;font-size:12px}
.leadgrid th a.sort.on{color:var(--text)}
.leadgrid th a.sort.on .arrow{opacity:1;color:var(--accent-dark)}
.leadgrid th.pick,.leadgrid td.pick{width:calc(var(--check) + var(--cell-x) + 8px);padding-right:0}
.leadgrid td.pick input,.leadgrid th.pick input{margin:0}
.advanced{margin:0 0 12px}
.advanced>summary{cursor:pointer;font-weight:600;font-size:13.5px;color:var(--text-2);padding:4px 0}
.adv-grid{display:grid;gap:10px;grid-template-columns:minmax(0,1fr);margin-top:8px}
@media (min-width:900px){.adv-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.adv-grid textarea{width:100%;font-size:13px}
.weekdays{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 8px}
.daybtn{position:relative;cursor:pointer}
.daybtn input{position:absolute;opacity:0;width:1px;height:1px}
.daybtn span{display:inline-block;padding:5px 9px;border:1px solid var(--line);border-radius:999px;font-size:12.5px;color:var(--text-2);background:var(--surface)}
.daybtn input:checked+span{background:var(--accent-soft);border-color:var(--accent-line);color:var(--accent-dark);font-weight:600}
.daybtn input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.hours{display:flex;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--text-2)}
.hours label{display:flex;align-items:center;gap:6px}
.hours input{width:auto}
.param-row{display:flex;gap:6px;margin:0 0 6px}
.param-row select{flex:0 1 50%;min-width:0}.param-row input{flex:1 1 50%;min-width:0}
.bulkbar{display:none;position:sticky;bottom:calc(var(--tabs) + 10px);z-index:35;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:12px 0 0;padding:var(--sp-2) calc(var(--bubble) + var(--sp-5)) var(--sp-2) var(--sp-3);
  background:var(--surface);border:1px solid var(--accent-line);border-radius:var(--radius);box-shadow:var(--shadow-lg)}
@media (min-width:720px){.bulkbar{bottom:12px}}
.leads-page:has(input[data-pick]:checked) .bulkbar{display:flex}
.bulkbar .picked{font-size:var(--fs);color:var(--text-2)}
.bulkbar .picked b{font-size:var(--fs);color:var(--text)}
.bulkbar .all-match{min-height:auto;font-size:13px}
.bulkbar .bulk-actions{display:flex;flex-wrap:wrap;gap:6px;margin-left:auto}
@media (max-width:719px){.pop-body,.pop-body.up{position:fixed;left:8px;right:8px;top:auto;bottom:calc(var(--tabs) + 16px);width:auto;max-height:65vh}
  .bulkbar .bulk-actions{margin-left:0}.filterrow>.ticks{flex-basis:78vw}}
.pager select{width:auto;min-width:0;display:inline-block}
.cols-pick{width:min(440px,calc(100vw - 32px))}
.cols-off{grid-template-columns:minmax(0,1fr)}
.leads-page .card.list:has(.toolbar details[open]){position:relative;z-index:36}
/* ---------- the AI Assistant panel (module 8, 28 Nov 2026): opened by the top bar's button over any page ----------
   The whole screen on a phone, a drawer at the right on a wider screen. Its inside is _assistant_panel.html. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.ai-panel{position:fixed;z-index:60;inset:0;display:flex;flex-direction:column;background:var(--bg);color:var(--text)}
.ai-panel[hidden]{display:none}
.ai-panel-head{display:flex;align-items:center;gap:8px;height:var(--top);padding:0 12px;background:var(--surface);border-bottom:1px solid var(--line);flex-shrink:0}
.ai-panel-head h2{display:flex;align-items:center;gap:8px;margin:0;font-size:16px}
.ai-panel-head h2 svg{width:18px;height:18px;color:var(--accent)}
.ai-panel-head .grow{flex:1}
.ai-panel-body{flex:1;min-height:0;display:flex;flex-direction:column}
.ai-panel-inner{flex:1;min-height:0;display:flex;flex-direction:column}
.ai-loading{padding:16px}
.ai-thread{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 12px;display:flex;flex-direction:column;gap:14px}
.ai-thread .ai-meter{margin:0}
.ai-thread .ai-said{max-width:100%}
.ai-thread .ai-said.you{max-width:88%}
.ai-thread .flash{margin:0}
.ai-hello{border:1px dashed var(--line-2);border-radius:var(--radius);padding:12px 14px;background:var(--surface)}
.ai-hello p{margin:0 0 6px}
.ai-attached{display:flex;align-items:center;gap:6px;margin-top:6px;overflow-wrap:anywhere}
.ai-attached svg,.ai-said .words svg{width:15px;height:15px;vertical-align:-2px}
.ai-compose{flex-shrink:0;background:var(--surface);border-top:1px solid var(--line);padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))}
.ai-compose textarea{width:100%;resize:vertical;min-height:64px;max-height:40vh}
.ai-compose-row{display:flex;align-items:center;gap:8px;margin-top:8px;min-width:0}
.ai-compose-row .grow{flex:1}
.ai-compose-row .btn svg{width:16px;height:16px}
.ai-attach{cursor:pointer}
.ai-attach.disabled{opacity:.5;pointer-events:none}
.ai-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-compose-help{margin:8px 0 0}
.ai-attach:focus-within{outline:2px solid var(--accent);outline-offset:2px}
html.ai-open{overflow:hidden}
/* ---------- the chat window (SEGMENTS 141): the layout of a support messenger in TrackBeast's colours ----------
   A round launcher at the bottom right (a chevron while open), a window above it (380 px, up to 700 px tall, 24 px
   corners), the whole screen on a phone. Home (a gradient header, cards), Messages, Help, a conversation (grey
   bubbles for the agent, accent bubbles for the person, quick replies, a rounded composer with a round send button). */
.tbw{--tbw-r:24px;--tbw-grey:var(--neutral-bg);background:var(--surface)}
.tbw-launcher .tbw-launch-shut{display:none}
.ai-open .tbw-launcher .tbw-launch-open{display:none}
.ai-open .tbw-launcher .tbw-launch-shut{display:grid}
.tbw-launcher>span{display:grid;place-items:center}
.tbw-launch-badge:empty{display:none}
.tbw-launch-badge{position:absolute;top:-2px;right:-2px}
.tbw-count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:var(--surface);font-size:11px;font-weight:600;line-height:1}
.ai-open .tbw-launch-badge{display:none}
.tbw-inner{position:relative;background:var(--surface)}
.tbw-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column}
.tbw .grow{flex:1}
.tbw-icon{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;border:0;background:none;color:var(--text-2);cursor:pointer;flex-shrink:0}
.tbw-icon:hover{background:var(--tbw-grey);color:var(--text);text-decoration:none}
.tbw-icon svg{width:20px;height:20px}
.tbw-avatar{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--surface);border:2px solid var(--surface);box-shadow:0 0 0 1px var(--line);overflow:hidden;flex-shrink:0}
.tbw-avatar img{width:20px;height:auto}
.tbw-avatar.tbw-ai{background:var(--accent);color:var(--on-accent);box-shadow:none}
.tbw-avatar.tbw-ai svg{width:16px;height:16px}
/* Home */
.tbw-hero{padding:20px 20px 72px;background:linear-gradient(180deg,var(--accent) 0%,var(--accent-mid) 55%,var(--surface) 100%);color:var(--on-accent)}
.tbw-hero-top{display:flex;align-items:center;gap:8px}
.tbw-logo{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--surface)}
.tbw-logo img{width:24px;height:auto}
.tbw-team{display:flex}
.tbw-team .tbw-avatar+.tbw-avatar{margin-left:-8px}
.tbw-hero .tbw-x{color:var(--on-accent)}
.tbw-hero .tbw-x:hover{background:rgba(255,255,255,.18);color:var(--on-accent)}
.tbw-hello{margin:36px 0 0;font-size:28px;line-height:1.15;font-weight:700;color:var(--on-accent);text-transform:none;letter-spacing:-.01em}
.tbw-hello span{display:block;opacity:.75}
.tbw-cards{display:flex;flex-direction:column;gap:12px;padding:0 16px 16px;margin-top:-56px}
.tbw-cards .flashes{margin:0}
.tbw-card{display:block;background:var(--surface);border-radius:12px;box-shadow:0 4px 16px rgba(20,26,38,.10),0 0 0 1px var(--line-soft);padding:14px 16px;color:var(--text);text-decoration:none}
a.tbw-card:hover,.tbw-card-btn:hover{text-decoration:none;box-shadow:0 6px 20px rgba(20,26,38,.14),0 0 0 1px var(--line)}
.tbw-card-label{display:block;font-size:13px;font-weight:600;margin-bottom:10px}
.tbw-row{display:flex;align-items:center;gap:10px;min-width:0}
.tbw-lines{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.tbw-lines b{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tbw-lines span{font-size:13px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tbw-when{font-size:12px;color:var(--text-3);white-space:nowrap}
.tbw-action{display:flex;align-items:center;gap:12px}
.tbw-card-form{padding:0}
.tbw-card-btn{display:flex;align-items:center;gap:12px;width:100%;padding:14px 16px;border:0;background:none;font:inherit;color:inherit;text-align:left;cursor:pointer;border-radius:12px}
.tbw-go{color:var(--accent);display:grid;place-items:center}
.tbw-go svg{width:20px;height:20px}
.tbw-search{padding:8px}
.tbw-find{display:flex;align-items:center;background:var(--tbw-grey);border-radius:10px;padding:0 4px 0 12px}
.tbw-find input{flex:1;min-width:0;border:0!important;background:transparent!important;outline:0!important;min-height:40px;padding:0!important;font:inherit;font-size:14px}
.tbw-find-btn{border:0;background:none;color:var(--accent);display:grid;place-items:center;width:36px;height:36px;cursor:pointer}
.tbw-find-btn svg{width:18px;height:18px}
.tbw-find:focus-within{box-shadow:0 0 0 2px var(--accent)}
.tbw-find-top{margin:12px 16px 4px}
.tbw-articles{list-style:none;margin:6px 0 0;padding:0}
.tbw-article{display:flex;align-items:center;gap:10px;padding:10px 8px;border-radius:8px;color:var(--text);text-decoration:none;font-size:14px}
.tbw-article:hover{background:var(--tbw-grey);text-decoration:none}
.tbw-article>span{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tbw-article small{color:var(--text-3);font-size:12.5px}
.tbw-article svg,.tbw-collection summary svg{width:18px;height:18px;color:var(--accent);flex-shrink:0}
.tbw-flat{padding:0 8px}
/* bars, tabs, lists */
.tbw-bar{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;height:56px;padding:0 8px;border-bottom:1px solid var(--line-soft);flex-shrink:0}
.tbw-bar h2{margin:0;text-align:center;font-size:16px;font-weight:600}
.tbw-bar-side{display:flex;justify-content:center}
.tbw-tabs{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line-soft);background:var(--surface);flex-shrink:0;padding-bottom:env(safe-area-inset-bottom,0px)}
.tbw-tab{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;padding:10px 0 12px;color:var(--text-3);font-size:12.5px;font-weight:500;text-decoration:none}
.tbw-tab svg{width:22px;height:22px}
.tbw-tab:hover{color:var(--text);text-decoration:none}
.tbw-tab.on{color:var(--accent)}
.tbw-tab.on svg{fill:var(--accent-soft)}
.tbw-tab .tbw-count{position:absolute;top:6px;left:calc(50% + 6px)}
.tbw-list{list-style:none;margin:0;padding:4px 0 84px}
.tbw-conv{display:flex;align-items:center;gap:12px;padding:12px 16px;color:var(--text);text-decoration:none;min-width:0}
.tbw-conv:hover{background:var(--surface-2);text-decoration:none}
.tbw-conv .tbw-lines b{font-weight:500}
.tbw-conv.unread .tbw-lines b{font-weight:700}
.tbw-conv.unread .tbw-lines span{color:var(--text)}
.tbw-meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.tbw-dot{width:8px;height:8px;border-radius:50%;background:var(--bad);display:block}
.tbw-empty{padding:24px 16px;text-align:center;list-style:none}
.tbw-pill{position:absolute;left:50%;transform:translateX(-50%);bottom:76px;display:inline-flex;align-items:center;gap:8px;padding:10px 18px;border-radius:999px;background:var(--accent);color:var(--on-accent);font-weight:600;font-size:14px;box-shadow:0 8px 20px rgba(47,79,209,.35);text-decoration:none}
.tbw-pill:hover{background:var(--accent-hover);color:var(--on-accent);text-decoration:none}
.tbw-pill svg{width:16px;height:16px}
.tbw-count-line{margin:12px 16px 4px;font-size:13px;color:var(--text-3)}
.tbw-collection{border-bottom:1px solid var(--line-soft)}
.tbw-collection summary{display:flex;align-items:center;gap:10px;padding:14px 16px;cursor:pointer;list-style:none}
.tbw-collection summary::-webkit-details-marker{display:none}
.tbw-collection summary>span{flex:1;display:flex;flex-direction:column;gap:2px}
.tbw-collection summary small{color:var(--text-3);font-size:12.5px}
.tbw-collection[open] summary svg{transform:rotate(90deg)}
.tbw-article-page{padding:16px 20px 24px;display:block}
.tbw-article-page h3{font-size:20px;margin:0 0 12px}
.tbw-article-page p{font-size:14.5px;line-height:1.55;color:var(--text-2)}
.tbw-article-page .tbw-steps{margin:0 0 var(--sp-3);padding-left:var(--sp-5);font-size:14.5px;line-height:1.55;color:var(--text-2)}
.tbw-article-page .tbw-steps li{margin:0 0 var(--sp-1)}
.ai-help-link{display:flex;align-items:center;gap:var(--sp-1);margin:var(--sp-2) 0 0}
.ai-help-link svg{width:1em;height:1em;flex:none}
/* "Our Server IPs" (SEGMENTS 149): on an integration's page and in the integration help article */
.server-ips p{margin:2px 0 0}
.tbw-article-page .server-ips{margin:16px 0;padding:12px;border:1px solid var(--line);border-radius:var(--radius-sm)}
.tbw-article-page .server-ips h4{margin:0;font-size:14px}
.tbw-article-page .server-ips p{font-size:13px}
/* a conversation */
.tbw-head{display:flex;align-items:center;gap:10px;height:64px;padding:0 8px;border-bottom:1px solid var(--line-soft);flex-shrink:0}
.tbw-head-words{display:flex;flex-direction:column;min-width:0}
.tbw-head-words b{font-size:15px}
.tbw-head-words span{font-size:12.5px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tbw-conversation .tbw-scroll{padding:16px 14px 8px;gap:12px}
.tbw-msgs{display:flex;flex-direction:column;gap:10px}
.tbw-msg{display:flex;flex-direction:column;max-width:86%;min-width:0}
.tbw-msg.you{align-self:flex-end;align-items:flex-end}
.tbw-msg.it{align-self:flex-start;align-items:flex-start}
.tbw-bubble{padding:11px 15px;border-radius:20px;font-size:14.5px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.tbw-msg.it .tbw-bubble{background:var(--tbw-grey);color:var(--text);border-bottom-left-radius:6px}
.tbw-msg.you .tbw-bubble{background:var(--accent);color:var(--on-accent);border-bottom-right-radius:6px}
.tbw-meta-line{font-size:12px;color:var(--text-3);margin:5px 4px 0}
.tbw-note{align-self:center;max-width:92%;text-align:center;font-size:12.5px;color:var(--text-3);background:var(--surface-2);border-radius:10px;padding:6px 12px}
.tbw-cardmsg{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 14px;box-shadow:0 2px 10px rgba(20,26,38,.06);display:flex;flex-direction:column;gap:8px;min-width:240px;max-width:100%}
.tbw-cardmsg p{margin:0;font-size:14px}
.tbw-cardmsg form{display:flex;flex-direction:column;gap:10px;margin:0}
.tbw-cardmsg-head{display:flex;align-items:center;gap:8px;font-size:14px}
.tbw-cardmsg-head svg{width:18px;height:18px;color:var(--accent)}
.tbw-secure{border-color:var(--accent-line)}
.tbw-field{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:500}
.tbw-field em{font-style:normal;font-weight:500;color:var(--ok);font-size:12px}
.tbw-field input{width:100%}
.tbw-done{display:flex;align-items:center;gap:6px;color:var(--ok);font-size:13.5px;font-weight:500}
.tbw-done svg{width:16px;height:16px}
.tbw-facts{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:0;font-size:13.5px}
.tbw-facts dt{color:var(--text-3);font-weight:500}
.tbw-facts dd{margin:0;overflow-wrap:anywhere}
.tbw-result{display:flex;flex-direction:column;gap:6px;border-top:1px solid var(--line-soft);padding-top:8px}
.tbw-result:first-of-type{border-top:0;padding-top:0}
.tbw-result summary{cursor:pointer;font-size:13px;color:var(--accent)}
.tbw-pre{max-height:220px;overflow:auto;font:12px/1.45 var(--mono);background:var(--surface-2);border-radius:8px;padding:8px 10px;margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.tbw-typing{display:flex;align-items:center;gap:4px}
.tbw-typing i{width:7px;height:7px;border-radius:50%;background:var(--text-3);opacity:.5;animation:tbw-dot 1.2s infinite}
.tbw-typing i:nth-child(2){animation-delay:.2s}
.tbw-typing i:nth-child(3){animation-delay:.4s}
.tbw-typing span{margin-left:6px;font-size:13px;color:var(--text-3)}
@keyframes tbw-dot{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.tbw-typing i{animation:none}}
.tbw-replies{display:flex;flex-direction:column;align-items:flex-end;gap:6px;margin-top:4px}
.tbw-replies form{margin:0}
.tbw-reply{border:1.5px solid var(--accent);background:var(--surface);color:var(--accent);border-radius:999px;padding:7px 14px;font:inherit;font-size:14px;font-weight:500;cursor:pointer}
.tbw-reply:hover{background:var(--accent-soft)}
.tbw-compose{flex-shrink:0;padding:8px 12px calc(10px + env(safe-area-inset-bottom,0px));background:var(--surface);border-top:0}
.tbw-box{border:1.5px solid var(--line-2);border-radius:20px;padding:8px 8px 6px 14px;background:var(--surface)}
.tbw-box:focus-within{border-color:var(--accent)}
.tbw-box textarea{width:100%;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;resize:none;min-height:24px!important;max-height:30vh;padding:4px 0!important;font:inherit;font-size:14.5px;field-sizing:content}
.tbw-box-row{display:flex;align-items:center;gap:6px;min-width:0}
.tbw-box-row .tbw-icon{width:32px;height:32px}
.tbw-box-row label.tbw-icon:focus-within{outline:2px solid var(--accent);outline-offset:1px}
.tbw-send{width:34px;height:34px;border-radius:50%;border:0;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;cursor:pointer;flex-shrink:0}
.tbw-send svg{width:18px;height:18px}
.tbw-box:not(.has-words) .tbw-send{background:var(--line-2);color:var(--text-3)}
.tbw-send:disabled{opacity:.6;cursor:default}
.tbw-fine{margin:6px 4px 0;font-size:12px;color:var(--text-3)}
.tbw .ai-thread{padding:16px 14px 8px}
.tbw .ai-said{border:0;background:none;padding:0}
.tbw .ai-said.you{background:var(--accent);color:var(--on-accent);border-radius:20px 20px 6px 20px;padding:11px 15px;max-width:86%}
.tbw .ai-said.you .who{display:none}
.tbw .ai-said.it{background:var(--tbw-grey);border-radius:20px 20px 20px 6px;padding:11px 15px;max-width:94%;width:auto}
.tbw .ai-said.it .who{font-size:12px}
.tbw .ai-turn>.tbw-meta-line{align-self:flex-start}
.tbw .preview,.tbw .ai-done{border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:var(--surface);margin-top:10px}
.tbw .preview h3{font-size:13px;margin:0 0 8px}
.tbw .ai-meter{margin:0}
.tbw-inline{margin-top:12px}
@media (min-width:720px){
  .ai-panel.tbw{inset:auto 24px 96px auto;width:380px;height:min(700px,calc(100vh - 120px));border-radius:var(--tbw-r);overflow:hidden;
                box-shadow:0 5px 40px rgba(20,26,38,.16),0 0 0 1px var(--line-soft)}
  html.ai-open{overflow:auto}
  .ai-open .chat-bubble.tbw-launcher{display:grid}
}
.sg-ai-panel{border:1px solid var(--line);border-radius:24px;overflow:hidden;max-width:380px;background:var(--surface);box-shadow:0 5px 40px rgba(20,26,38,.16)}
.sg-ai-panel .ai-panel-inner{height:620px}
.sg-row{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}
.sg-row .sg-ai-panel{flex:1 1 320px}

/* ---------- direction A: the Leads page as drawn (28 Nov 2026) ---------- */
.badge.neutral{background:var(--neutral-bg);color:var(--text-2)}
.badge.info{background:var(--accent-soft);color:var(--accent-dark)}
/* the lead types are the list's view tabs like every other list's (SEGMENTS 144: no pills, dots or coloured counts) */
.leads-page .views .dot{display:none}
/* the table: one compact line a lead, pills with a dot, a highlighted row under the pointer */
.leadgrid{font-size:var(--fs-table)}
.leadgrid th{font-size:12px;font-weight:600;color:var(--text-3);background:var(--surface-2);white-space:nowrap}
.leadgrid td{white-space:nowrap;vertical-align:middle}
.leadgrid tbody tr{cursor:pointer}
.leadgrid tbody tr:hover td{background:#f5f7ff}
.leadgrid tbody tr:has(input[data-pick]:checked) td{background:#f5f7ff}
.leadgrid tbody tr:has(input[data-pick]:checked) td:first-child{box-shadow:inset var(--sp-1) 0 0 var(--accent)}
.leadgrid td .badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.85}
.leadgrid td a.badge:hover{text-decoration:none;filter:brightness(.97)}
.leadgrid td a.strong{color:var(--text);font-weight:600}
.table .who{display:inline-flex;align-items:center;gap:8px}
.table .ini{width:22px;height:22px;border-radius:6px;display:inline-grid;place-items:center;font-style:normal;font-size:10.5px;font-weight:700;flex-shrink:0}
.table .swatch{width:8px;height:8px;border-radius:2px;display:inline-block;flex-shrink:0}
.table .flag{font-style:normal;font-size:15px;line-height:1}
.ini.h0{background:#e0e7ff;color:#3730a3}.ini.h1{background:#fae8ff;color:#86198f}.ini.h2{background:#dcfce7;color:#166534}
.ini.h3{background:#ffedd5;color:#9a3412}.ini.h4{background:#e0f2fe;color:#075985}.ini.h5{background:#fef9c3;color:#854d0e}
.swatch.h0{background:#0f766e}.swatch.h1{background:#7c3aed}.swatch.h2{background:#2f4fd1}.swatch.h3{background:#c2410c}.swatch.h4{background:#0e7490}.swatch.h5{background:#a16207}
.copy-email{border:0;background:none;padding:0;font:inherit;color:var(--text);cursor:copy;display:inline-flex;align-items:center;gap:6px;position:relative}
.copy-email svg{width:14px;height:14px;opacity:0;color:var(--text-3)}
.copy-email:hover svg,.copy-email:focus-visible svg{opacity:1}
/* colour only where it means something (SEGMENTS 144): a low fraud score is plain text; brands and affiliates are text,
   their initials in one neutral tone, no coloured squares */
.leadgrid a.plain-n{color:var(--text-2);font-variant-numeric:tabular-nums}
.leadgrid a.plain-n:hover{color:var(--accent)}
.table i.ini{background:var(--neutral-bg);color:var(--text-2)}
.table i.swatch{display:none}
.copy-email.copied{color:var(--ok)}
.copy-email.copied::after{content:"Copied";padding:1px 6px;border-radius:6px;background:var(--ok-bg);color:var(--ok);font-size:11px;font-weight:600}
.copy-email.copied svg{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .leadgrid tbody tr:hover td,:root:not([data-theme=light]) .leadgrid tbody tr:has(input[data-pick]:checked) td{background:var(--accent-soft)}}
:root[data-theme=dark] .leadgrid tbody tr:hover td,:root[data-theme=dark] .leadgrid tbody tr:has(input[data-pick]:checked) td{background:var(--accent-soft)}
@media (max-width:719px){.leadgrid td{white-space:normal}}

/* ---------- adjustable columns (owner, 28 Nov 2026): a handle at the right edge of every header cell ---------- */
.table thead th{position:relative}
.col-grip{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;z-index:2;touch-action:none}
.col-grip::after{content:"";position:absolute;top:25%;bottom:25%;right:0;width:1px;background:var(--line-2);opacity:0;transition:opacity .12s}
.table thead th:hover .col-grip::after,.col-grip:hover::after{opacity:1}
.cols-dragging,.cols-dragging *{cursor:col-resize!important;user-select:none}
.cols-dragging .col-grip::after{opacity:1;background:var(--accent)}
table.cols-fixed{table-layout:fixed;max-width:none}
table.cols-fixed td,table.cols-fixed th{overflow:hidden;text-overflow:ellipsis}
@media (max-width:719px){.col-grip{display:none}}

/* ---------- sortable tables (owner, 1 Dec 2026; SEGMENTS 137): the Leads page's arrow on every table's headers.
   a.sort = a list sorted on the server (ui.sort_th); button.sort = one sorted in the browser (app.js) ---------- */
.table th a.sort{color:inherit;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.table th a.sort:hover{text-decoration:none;color:var(--text)}
.table th .arrow{opacity:.35;font-size:12px}
.table th a.sort.on{color:var(--text)}
.table th a.sort.on .arrow{opacity:1;color:var(--accent-dark)}
th button.sort{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;display:inline-flex;align-items:center;gap:4px;white-space:nowrap;text-align:inherit;max-width:100%}
th button.sort:hover{color:var(--text)}
th button.sort::after{content:"↕";opacity:.35;font-size:12px}
th[aria-sort] button.sort{color:var(--text)}
th[aria-sort="ascending"] button.sort::after{content:"↑";opacity:1;color:var(--accent-dark)}
th[aria-sort="descending"] button.sort::after{content:"↓";opacity:1;color:var(--accent-dark)}
table.cols-fixed th button.sort{overflow:hidden;text-overflow:ellipsis}

/* ---------- direction A: the Affiliates page as drawn ---------- */
.spark7{display:block;fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.table td.ftd-n{color:var(--ftd)}
.table td.note-cell{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.table .who>span{display:flex;flex-direction:column;min-width:0}
.notes3{display:grid;gap:var(--gap);margin:var(--gap) 0}
.notes3 .card{display:flex;flex-direction:column;gap:4px;margin:0;font-size:var(--fs)}
@media (min-width:720px){.notes3{grid-template-columns:repeat(3,minmax(0,1fr))}}
.table .who{white-space:nowrap}
.table .who .sub{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-affiliates] td{white-space:nowrap}
/* ---------- direction A: the Brands page as drawn (cards, or a list) ---------- */
.seg{margin:0}
.brand-cards{display:grid;gap:var(--gap);margin:var(--gap) 0}
@media (min-width:900px){.brand-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
.brand-card{display:grid;gap:var(--sp-3);margin:0}
.bc-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:15px}
.bc-head .grow{flex:1}
.bc-head .who{display:inline-flex;align-items:center;gap:10px}
.bc-head .ini{width:28px;height:28px;border-radius:8px;display:inline-grid;place-items:center;font-style:normal;font-size:11.5px;font-weight:700}
.bc-head a.strong{color:var(--text);font-weight:700}
.bc-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.bc-stats div{display:flex;flex-direction:column;gap:2px}
.bc-stats span{font-size:var(--fs-label);color:var(--text-3)}
.bc-stats b{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums}
.bc-stats b.small-n{font-size:var(--fs);font-weight:600}
.bc-stats b.ftd-n,.ftd-n{color:var(--ftd)}
.bc-stats b.bad-n{color:var(--bad)}
table.mini{width:100%;border-collapse:collapse;font-size:var(--fs-table)}
table.mini th{text-align:left;font-weight:500;color:var(--text-3);padding:4px 0}
table.mini td{padding:var(--cell-y) 0;border-top:1px solid var(--line-soft)}
.ok-t{color:var(--ok);font-weight:600}
@media (max-width:560px){.bc-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* ---------- direction A: the Boxes page as drawn (each box with its rows) ---------- */
.box-cards{display:grid;gap:var(--gap);margin:var(--gap) 0}
.box-card{margin:0;overflow:hidden}
.bx-head{display:flex;align-items:center;gap:var(--sp-2) var(--sp-3);flex-wrap:wrap;padding:var(--sp-3) var(--sp-4);border-bottom:1px solid var(--line-soft)}
.bx-head h2{margin:0;font-size:15px;font-weight:650;letter-spacing:-.01em;color:var(--text)}
.bx-head h2 a{color:inherit}
.bx-head .grow{flex:1}
.bx-empty{padding:var(--sp-3) var(--sp-4);margin:0}
/* ---------- direction A: number tiles above a list (Deposits) ---------- */
.dep-tiles{display:grid;gap:var(--gap);margin-bottom:var(--gap)}
.dep-tiles .kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:var(--card-pad) var(--card-px);box-shadow:var(--shadow)}
.kpi .value.ftd-n{color:var(--ftd)}
.kpis.dep-tiles .kpi,.kpis.dep-tiles .kpi:first-child,.kpis.dep-tiles .kpi:nth-child(n){padding:var(--card-pad) var(--card-px);border:1px solid var(--line)}
/* ---------- direction A: the Overview as drawn ---------- */
.dash-tiles{display:grid;gap:var(--gap);grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:var(--sp-2)}
@media (min-width:900px){.dash-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (min-width:1300px){.dash-tiles{grid-template-columns:repeat(6,minmax(0,1fr))}}
.dash-tiles .kpi,.dash-tiles .kpi:first-child,.dash-tiles .kpi:nth-child(n){background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:var(--card-pad) var(--card-px);box-shadow:var(--shadow)}
.dash-note{margin:0 0 var(--gap)}
.feed{list-style:none;margin:0;padding:0;display:grid}
.feed li{display:flex;align-items:center;gap:10px;padding:var(--sp-2) 0;border-top:1px solid var(--line-soft);font-size:var(--fs);min-width:0}
.feed li:first-child{border-top:0}
.feed .time{color:var(--text-3);width:44px;flex-shrink:0}
.feed .what{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.feed .what a{color:var(--text);font-weight:500}
.badge.live::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.card-head .live{margin-left:8px}
/* the segmented control made of radios (Reports' "Group by") */
.seg-radio label{cursor:pointer}
.seg-radio input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.seg-radio label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:-2px}
.by-more{display:grid;gap:2px;max-height:320px;overflow-y:auto;min-width:200px}
/* ---------- direction A: tabs inside a page or a drawer ---------- */
.dtabs{padding:0;margin:0 0 var(--sp-4)}
/* ---------- an affiliate's traffic rules (28 Nov 2026) ---------- */
fieldset.rule{border:1px solid var(--line);border-radius:var(--radius);padding:var(--card-pad) var(--card-px);margin:0 0 var(--sp-3)}
fieldset.rule legend{padding:0 6px;font-weight:600}
.rule-then{display:grid;gap:6px;margin-top:10px}
.rules-now{margin:0;padding-left:20px;display:grid;gap:8px}
.rules-now li span{display:block;color:var(--text-2);font-size:var(--fs-sm)}
/* ---------- notes on a lead (28 Nov 2026) ---------- */
.notes-list{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.notes-list li{display:flex;gap:10px}
.notes-list p{margin:2px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.avatar.sm{width:30px;height:30px;font-size:12px}

/* ---------- after the critique of the drawings (owner, 29 Nov 2026) ---------- */
.badge.review{background:var(--surface);box-shadow:inset 0 0 0 1px var(--accent-line);color:var(--accent-dark)}
a.kpi.decide{color:inherit;text-decoration:none;border-radius:var(--radius)}
a.kpi.decide.on .label{color:var(--accent-dark);font-weight:600}
a.kpi.decide:hover .value{color:var(--accent)}
.views a .n.due{padding:1px 7px;border-radius:999px;background:var(--accent);color:var(--on-accent);font-weight:600}
.dep-effect{margin:6px 0 8px;padding-left:18px;display:grid;gap:4px;font-size:var(--fs)}
.ai-keys{margin:4px 0 0}
.ai-keys kbd{font:inherit;font-size:11.5px;padding:0 4px;border:1px solid var(--line-2);border-radius:4px}
@media (max-width:719px){
  .btn,.ai-chip,select,input[type=search],input[type=text],input[type=date]{min-height:var(--ctl)}
  .ai-keys{display:none}
}

@media (max-width:719px){   /* the phone drawing: two short tiles, the list right under them */
  .kpis.dep-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .kpis.dep-tiles .kpi:nth-child(3),.kpis.dep-tiles .kpi .small{display:none}
  .kpis.dep-tiles .kpi,.kpis.dep-tiles .kpi:nth-child(n){padding:10px 12px}
}

/* ---------- module 5: settle a balance, copy a deal ---------- */
.table td.actions details.settle-pop{display:inline-block;vertical-align:middle;margin-right:4px}
.table td.actions details.settle-pop[open]{display:block;max-width:560px;margin:0 0 8px auto}
.settle-pop>summary{font-weight:600;color:var(--accent-dark)}
.settle-sum{margin:0 0 10px}
.copy-of{margin:0 0 12px}
@media (max-width:719px){
  .table td.actions details.settle-pop[open]{max-width:none;width:100%}
}

/* ---------- module 2: status colours (a colour per common status, statuses.COLOURS) ----------
   Each status badge is a soft background with dark text (light text on a dark background in dark mode), every pair
   well past 4.5:1. No orange: it is kept for an FTD and a full cap. */
:root{
  --st-grey-bg:#f1f2f5;--st-grey:#3c4557;--st-blue-bg:#dbeafe;--st-blue:#1e40af;--st-green-bg:#e7f4ec;--st-green:#1d6b42;
  --st-teal-bg:#ccfbf1;--st-teal:#115e59;--st-purple-bg:#ede9fe;--st-purple:#5b21b6;--st-pink-bg:#fce7f3;--st-pink:#9d174d;
  --st-red-bg:#fdecec;--st-red:#b42318;--st-yellow-bg:#fef9c3;--st-yellow:#713f12;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme=light]){
    --st-grey-bg:#26272b;--st-grey:#c3c5ca;--st-blue-bg:#152445;--st-blue:#93c5fd;--st-green-bg:#0d2c22;--st-green:#6ee7b7;
    --st-teal-bg:#0b2b2a;--st-teal:#5eead4;--st-purple-bg:#261a45;--st-purple:#c4b5fd;--st-pink-bg:#3a1229;--st-pink:#f9a8d4;
    --st-red-bg:#3a1618;--st-red:#fca5a5;--st-yellow-bg:#2f2a0a;--st-yellow:#fde047;
  }
}
:root[data-theme=dark]{
  --st-grey-bg:#26272b;--st-grey:#c3c5ca;--st-blue-bg:#152445;--st-blue:#93c5fd;--st-green-bg:#0d2c22;--st-green:#6ee7b7;
  --st-teal-bg:#0b2b2a;--st-teal:#5eead4;--st-purple-bg:#261a45;--st-purple:#c4b5fd;--st-pink-bg:#3a1229;--st-pink:#f9a8d4;
  --st-red-bg:#3a1618;--st-red:#fca5a5;--st-yellow-bg:#2f2a0a;--st-yellow:#fde047;
}
.badge.st-grey{background:var(--st-grey-bg);color:var(--st-grey)}
.badge.st-blue{background:var(--st-blue-bg);color:var(--st-blue)}
.badge.st-green{background:var(--st-green-bg);color:var(--st-green)}
.badge.st-teal{background:var(--st-teal-bg);color:var(--st-teal)}
.badge.st-purple{background:var(--st-purple-bg);color:var(--st-purple)}
.badge.st-pink{background:var(--st-pink-bg);color:var(--st-pink)}
.badge.st-red{background:var(--st-red-bg);color:var(--st-red)}
.badge.st-yellow{background:var(--st-yellow-bg);color:var(--st-yellow)}
button.badge{border:0;font-family:inherit;cursor:pointer}
button.badge:hover{filter:brightness(.95)}
button.badge:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* the colour picker on the common list: one round swatch a colour, the chosen one ringed */
.swatches{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.swatches button{width:28px;height:28px;padding:0;border-radius:50%;border:2px solid transparent;cursor:pointer}
.swatches button[aria-pressed=true]{border-color:var(--text)}
.swatches button.st-grey{background:var(--st-grey-bg);box-shadow:inset 0 0 0 1px var(--line-2)}
.swatches button.st-blue{background:var(--st-blue)}.swatches button.st-green{background:var(--st-green)}
.swatches button.st-teal{background:var(--st-teal)}.swatches button.st-purple{background:var(--st-purple)}
.swatches button.st-pink{background:var(--st-pink)}.swatches button.st-red{background:var(--st-red)}
.swatches button.st-yellow{background:var(--st-yellow-bg);box-shadow:inset 0 0 0 1px var(--st-yellow)}
@media (max-width:719px){.swatches button{width:40px;height:40px}}
/* "Map" on the Leads page: a raw status not mapped yet, and the common statuses to choose from */
.map-cell{display:inline-flex;align-items:center;gap:8px}
.map-pick{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.leadgrid td .map-pick .badge::before{display:none}
@media (max-width:719px){.map-pick .badge{min-height:40px;padding:6px 14px}}

/* ---------- module 7: the fraud section of a lead's Overview (_fraud_result.html, _both_ips.html; SEGMENTS 130) ---------- */
.result.none{background:var(--neutral-bg);color:var(--text-2)}
.ip-pair{margin-top:4px;margin-bottom:8px}
.ip-side{border:1px solid var(--line);border-left-width:4px;border-radius:var(--radius-sm);padding:var(--card-pad) var(--card-px);min-width:0}
.ip-side.ok{border-left-color:var(--ok)}
.ip-side.bad{border-left-color:var(--bad)}
.ip-side.none,.ip-side.match{border-left-color:var(--line)}
.ip-side h3,.ip-side h4{margin:0 0 6px;font-size:13.5px}
.ip-side .kv{grid-template-columns:auto 1fr;gap:0 12px}
.ip-side .kv dt,.ip-side .kv dd{margin:0;padding:3px 0;font-size:13px}
.fraud-top{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;margin:0 0 16px}
.fraud-top .fraud-state{flex:1;min-width:160px}
.fraud-top .fraud-state .badges{display:flex;flex-wrap:wrap;gap:6px}
.fraud-top .fraud-state p{margin:6px 0 0}
.fraud-top .fraud-again{flex-basis:100%;border-bottom:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.fraud-top .fraud-again p{margin:0}
@media (min-width:720px){.fraud-top .fraud-again{flex-basis:auto}}
.fraud-score{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:92px;padding:10px 14px;border-radius:var(--radius);
  background:var(--neutral-bg);color:var(--text-2)}
.fraud-score .n{font-size:26px;font-weight:700;line-height:1.05}
.fraud-score .l{font-size:var(--fs-label);font-weight:600}
.fraud-score.ok{background:var(--ok-bg);color:var(--ok)}
.fraud-score.warn{background:var(--warn-bg);color:var(--warn)}
.fraud-score.bad{background:var(--bad-bg);color:var(--bad)}
.fraud-card{border:1px solid var(--line);border-radius:var(--radius-sm);padding:var(--card-pad) var(--card-px);min-width:0}
.fraud-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.fraud-card-head h3{margin:0;font-size:var(--fs)}
.facts{list-style:none;margin:0;padding:0;display:grid;gap:0}
.facts li{display:flex;align-items:center;gap:8px;padding:var(--sp-1) 0;border-top:1px solid var(--line-soft);font-size:var(--fs-sm)}
.facts li:first-child{border-top:0}
.facts .k{flex:1;color:var(--text-2);min-width:0}
.facts .v{font-weight:600;text-align:right}
.facts .dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--text-3);opacity:.55}
.facts .dot.ok{background:var(--ok);opacity:1}
.facts .dot.bad{background:var(--bad);opacity:1}
.both-ips{margin-top:16px}
.both-ips>h3{margin:0 0 10px}

/* module 3 additions (30 Nov 2026): the lines of a parameter replacement rule */
.param-lines select,.param-lines input{width:100%;min-width:110px}

/* ---------- module 5: the dashboard's monthly goals, top brands and boxes, best days (SEGMENTS 109) ---------- */
@media (min-width:720px){details.pop.end>.pop-body{left:auto;right:0}}
.goal{padding:8px 0}
.goal+.goal{border-top:1px solid var(--line)}
.goal-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:var(--fs);margin-bottom:6px}
.goal-head .n{flex:1;text-align:right;font-variant-numeric:tabular-nums;color:var(--text-2)}
.goalbar{display:block;position:relative;height:10px;border-radius:999px;background:var(--track);overflow:hidden}
.goalbar i{position:absolute;left:0;top:0;height:100%;border-radius:999px}
.goalbar .pace{background:var(--accent-line)}
.goalbar .done{background:var(--accent)}
.goal p{margin:6px 0 0}
.best-days{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px 24px}
.best-days h3{margin:0 0 4px;font-size:13px}
.bar.ftd i{background:var(--full)}

/* ---------- module 4, all box rows in one table (30 Nov 2026): the week charts, sortable headings, the bulk bar ---------- */
/* a row's week: 7 lines (Monday first) x 24 hours in the account's time zone; sizes are SVG attributes */
svg.weekchart{display:block;width:144px;max-width:100%;height:42px}
svg.weekchart .track{fill:var(--track)}
svg.weekchart .open{fill:var(--accent)}
svg.weekchart .half{fill:var(--accent-mid);opacity:.6}
svg.weekchart.off .open,svg.weekchart.off .half{fill:var(--series-2)}
.weekcell{display:grid;gap:3px;min-width:144px}
/* "open somewhere": a box's week, darker the more of its rows are open in that hour */
svg.weeksum{display:block;width:100%;max-width:620px;height:auto}
svg.weeksum .lbl{font-size:9px;fill:var(--text-3);font-family:inherit}
svg.weeksum .l0{fill:var(--track)}
svg.weeksum .l1{fill:var(--accent-line)}
svg.weeksum .l2{fill:var(--accent-mid)}
svg.weeksum .l3{fill:var(--accent)}
.weekkey{display:flex;flex-wrap:wrap;gap:6px 14px;margin:8px 0 0;font-size:12px;color:var(--text-2)}
.weekkey span{display:inline-flex;align-items:center;gap:6px}
.weekkey i{width:12px;height:12px;border-radius:2px;background:var(--track)}
.weekkey i.l1{background:var(--accent-line)}.weekkey i.l2{background:var(--accent-mid)}.weekkey i.l3{background:var(--accent)}
.allrows th a.sort{color:inherit;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.allrows th a.sort:hover{text-decoration:none;color:var(--text)}
.allrows th .arrow{opacity:.35;font-size:12px}
.allrows th a.sort.on{color:var(--text)}
.allrows th a.sort.on .arrow{opacity:1;color:var(--accent-dark)}
.rowsbulk{position:sticky;bottom:calc(var(--tabs) + 10px);z-index:35;background:var(--surface);border-top:1px solid var(--line);border-radius:0 0 var(--radius) var(--radius);padding-right:calc(var(--bubble) + var(--sp-5))}
@media (min-width:720px){.rowsbulk{bottom:0}.pop-body.wide{width:min(620px,calc(100vw - 32px))}}
.rowsbulk .hint b{color:var(--accent-dark)}

/* module 10, the Telegram lead feed (segment 108): a chat's feed settings under its alerts, and a message as sent */
.feed-box{margin-top:12px;border-top:1px solid var(--line-soft);padding-top:8px}
.feed-box>summary .badge{margin-left:8px}
.feed-box .form-grid{margin:10px 0}
.feed-sample{overflow-wrap:anywhere;font-size:13px}

/* module 3, part 2 (affiliate sign-up, traffic rules for many affiliates, an affiliate hidden from the numbers) */
.join-web{position:absolute!important;left:-9999px;width:1px;height:1px;overflow:hidden}   /* the sign-up form's field no person fills in */
.switch-row{display:flex;gap:12px;align-items:flex-start;margin:6px 0 4px}
.switch-row>span{display:grid;gap:2px;font-size:var(--fs)}
table[data-signups] input.sm{min-height:var(--ctl-sm);padding:0 8px;font-size:13px;max-width:170px}
table[data-signups] td.actions{white-space:normal}
table[data-signups] td.actions form.inline{display:inline-flex;gap:6px;align-items:center;margin:2px 0}

/* module 5, revenue share and billing cycles (segments 111 and 112): a statement's entries under their cycle */
.table tr.group td{background:var(--neutral-bg);font-size:13px;border-top:1px solid var(--line)}
.table tr.group td.num{color:var(--text-2);white-space:nowrap}

/* ---------- ready links (segment 115): webhooks and tracker templates ---------- */
.howto-grid{display:grid;grid-template-columns:1fr;gap:var(--sp-2) var(--sp-6)}
@media (min-width:760px){.howto-grid{grid-template-columns:1fr 1fr}}
.howto-grid h3{margin-top:0}
details.pb-template{margin-top:14px}

/* The Distribution Hub's Inject dialog (_dist_hub.html): step 3 follows the path chosen in step 2 */
.dh .dh-path{border:0;margin:0 0 10px;padding:0;display:flex;flex-wrap:wrap;gap:4px 14px}
.dh .dh-path legend{font-size:13px;font-weight:600;color:var(--text-2);margin-bottom:4px;padding:0}
.dh:has(input[name=path][value=brand]:checked) .dh-box{display:none}
.dh:has(input[name=path][value=box]:checked) .dh-brand{display:none}
.dh .check.dh-brand{margin:0 0 10px}

.dh-sample{max-width:380px}

/* ---------- module 7, check fraud on demand (segment 117): the button in a lead's fraud score cell and on its Fraud check tab ---------- */
.leadgrid .btn.fraud-ask{min-height:var(--ctl-xs);padding:2px 8px;font-size:12px;white-space:nowrap;
  background:var(--chk-bg);color:var(--chk-ink);border-color:var(--chk-line);font-weight:600}   /* refined indigo (owner, 4 Dec 2026) */
.leadgrid .btn.fraud-ask:hover{background:var(--chk-bg-hover);border-color:var(--chk-ink)}
.leadgrid .badge + .btn.fraud-ask{margin-left:6px}
.fraud-again{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line-soft)}
.fraud-again p{margin:0;flex:1 1 260px}

/* ---------- the logo kit (brand/): the beast in the top bar, the whole logo on sign-in pages ---------- */
.mark:has(img){width:30px;height:30px;background:none;border-radius:0}
.mark img,.logo img{display:block;width:100%;height:auto}
.logo{display:block;width:190px;max-width:70vw}
.auth .brand{flex-direction:column;gap:6px}
img.on-dark{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) img.on-dark{display:block}:root:not([data-theme=light]) img.on-light{display:none}}
:root[data-theme=dark] img.on-dark{display:block}
:root[data-theme=dark] img.on-light{display:none}
/* the top bar shows the whole logo (not the account's name) */
.logo.top{width:132px;flex-shrink:0}
@media (max-width:719px){.logo.top{width:112px}}

/* the Dashboard's top (1 Dec 2026): Filter, the dates, Apply on the left, the periods on the right */
.dash-head .actions .tabs{margin:0}
.dash-head .filterbar{order:3;flex:1 1 auto}
.dash-head .actions{order:4}
/* dates and filters of every page (SEGMENTS 128, ui.date_range / ui.date_field / ui.filter_panel): a button that opens
   its menu where it sits; the dates: clickable months (app.js data-range-cal); the filters: a row of tick-box lists */
.filterbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
details.pop>summary .badge{margin-left:2px}
.date-btn{font-variant-numeric:tabular-nums;white-space:nowrap}
.date-btn .icon{flex:none}
.field details.date-pop{display:block}
.field .date-btn{width:100%;justify-content:flex-start;font-weight:400}
.pop-body.filter-body{width:min(1180px,calc(100vw - 32px))}
.pop-body.filter-body.n1{width:min(300px,calc(100vw - 32px))}
.pop-body.filter-body.n2{width:min(540px,calc(100vw - 32px))}
.pop-body.filter-body.n3{width:min(780px,calc(100vw - 32px))}
.pop-body.filter-body.n4{width:min(1020px,calc(100vw - 32px))}
.filter-body .card-head{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.filter-body .card-head h2{margin:0;flex:1;font-size:15px}
.filter-body .filterrow{margin:0}
.filter-body .filterrow>.ticks{flex:1 0 220px}
.filter-body .filters{margin:10px 0 0}
.filter-body .advanced{margin:10px 0 0}
.pop-body.cal-pop{width:min(600px,calc(100vw - 32px))}
.pop-body.cal-pop.one{width:min(320px,calc(100vw - 32px))}
.cal-pop.one>input{width:100%;margin-bottom:6px}
.range-fields{display:flex;gap:10px}
.range-fields label.field{flex:1;min-width:0}
.cal-months{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:4px 0 6px}
.cal-pop.one .cal-months{grid-template-columns:1fr}
.cal-head{display:flex;align-items:center;justify-content:center;position:relative;font-weight:600;font-size:13.5px;min-height:30px;margin-bottom:4px}
.cal-nav.prev{position:absolute;left:0}
.cal-nav.next{position:absolute;right:0}
.cal-nav{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px;width:30px;height:30px;cursor:pointer;font-size:16px;line-height:1}
.cal-nav:hover{background:var(--surface-2)}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px 0}
.cal-wd{font-size:11.5px;color:var(--text-3);text-align:center;padding:2px 0}
.cal-day{border:0;background:none;color:var(--text);font:inherit;font-size:13px;height:32px;border-radius:8px;cursor:pointer;font-variant-numeric:tabular-nums}
.cal-day:hover:not(:disabled){background:var(--surface-2)}
.cal-day:disabled{color:var(--text-3);opacity:.45;cursor:default}
.cal-day.today{box-shadow:inset 0 0 0 1px var(--accent-line)}
.cal-day.in{background:var(--accent-soft);border-radius:0}
.cal-day.start,.cal-day.end{background:var(--accent);color:var(--on-accent);font-weight:600}
.worldmap{display:block;width:100%;height:auto;margin:4px 0 10px}
.worldmap{overflow:hidden}
.worldmap path{stroke:var(--surface);stroke-width:.6;fill:var(--text-3);fill-opacity:.22}
.worldmap path.m1{fill:var(--accent);fill-opacity:.18}
.worldmap path.m2{fill:var(--accent);fill-opacity:.34}
.worldmap path.m3{fill:var(--accent);fill-opacity:.52}
.worldmap path.m4{fill:var(--accent);fill-opacity:.72}
.worldmap path.m5{fill:var(--accent);fill-opacity:1}
.worldmap path:hover{stroke:var(--text-2);stroke-width:1}
.map-empty{text-align:center;margin:-4px 0 10px}
@media (max-width:640px){.cal-months{grid-template-columns:1fr}.dash-head .actions{flex:0 0 100%;margin-left:0}}
/* offers (SEGMENTS 127): the landing page in a list, tracking links and pixels in a table */
.landing{overflow-wrap:anywhere}
.table .copybox{margin-top:0}
@media (min-width:641px){.table .copybox{min-width:260px}}
@media (max-width:640px){.table .copybox{flex:1;min-width:0}}
@media (min-width:1300px){.dash-tiles.three{grid-template-columns:repeat(3,minmax(0,1fr))}}
.cal-pop input[type=date]{width:100%;min-width:0}
.page-filters{margin:0 0 var(--gap)}
.page-filters select{width:auto}
.card.list:has(.toolbar details[open]){position:relative;z-index:36}
/* the Leads page's top (1 Dec 2026): title, Filter, dates and Apply on the left and the periods on the right, as on the
   Dashboard; under them the lead types as tabs, with Columns, Views and the search at the end of that row */
.leads-head .actions .tabs{margin:0}
.views-row{display:flex;align-items:stretch;gap:var(--sp-2);border-bottom:1px solid var(--line);flex-wrap:wrap}
.views-row .views{flex:1 1 auto;min-width:0;border-bottom:0;align-self:flex-end}
.views-tools{display:flex;align-items:center;gap:6px;padding:var(--sp-2) var(--sp-3);flex:0 1 auto;margin-left:auto;min-width:0}
.views-tools .find{display:flex;min-width:0;width:380px;flex:0 1 auto}
.views-tools .find input{flex:1;min-width:0;border-top-right-radius:0;border-bottom-right-radius:0;border-right:0}
.views-tools .find .btn{border-top-left-radius:0;border-bottom-left-radius:0}
.leads-tools:not(:has(.chip)){display:none}
@media (max-width:640px){.leads-head .actions{flex:0 0 100%;margin-left:0}.views-row .views{flex:0 0 100%}
  .views-tools{flex:0 0 100%;padding:6px 12px 8px}.views-tools .find{flex:1 1 0;width:auto}}
.btn.icon-only{padding-left:0;padding-right:0;width:var(--ctl);justify-content:center}
.btn.icon-only svg{margin:0}
.btn.icon-only.on{background:var(--accent-soft);border-color:var(--accent-line);color:var(--accent-dark)}
/* a deposit's decisions in place (SEGMENTS 136): the time left of its hold, Approve and Decline as icon buttons and
   Extend Review, each opening a small menu where it sits (details.row-pop: placed over the page by app.js, so the row
   never widens and the table never cuts it off; a sheet at the bottom on a phone) */
.dep-decide{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap;white-space:nowrap}
.countdown{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:13px;color:var(--text-2);font-variant-numeric:tabular-nums;margin-right:4px}
.countdown svg{width:15px;height:15px;color:var(--accent)}
.countdown.done{color:var(--text-3)}
.btn.icon-only.sm{width:var(--ctl-sm);min-height:var(--ctl-sm)}
.btn.dec-ok{color:var(--ok)}
.btn.dec-no{color:var(--bad)}
details.row-pop[open]>summary.dec-ok{background:var(--ok-bg);border-color:color-mix(in srgb,var(--ok) 35%,var(--line));color:var(--ok)}
details.row-pop[open]>summary.dec-no{background:var(--bad-bg);border-color:color-mix(in srgb,var(--bad) 35%,var(--line));color:var(--bad)}
.table td.actions details.row-pop[open]{text-align:right}
.pop-body.confirm-pop{text-align:left;white-space:normal}
.pop-body.confirm-pop p{margin:0 0 var(--sp-2);font-size:var(--fs)}
@media (min-width:720px){.pop-body.confirm-pop .btn-row{justify-content:flex-end}}
@media (min-width:720px){details.pop.row-pop>.pop-body{position:fixed;top:auto;left:auto;right:auto}.pop-body.confirm-pop{width:260px}}


/* ---------- every drop-down list is the app's own (SEGMENTS 138; app.js, the block at its end) ----------
   .sel-native: the <select> that stays the form's field, hidden. .sel-btn: the button in its place, drawn like a field
   (and sized like a select wherever a page sizes selects). .sel-list: the list, like the app's menus (surface, line,
   radius, shadow; the chosen option in the accent with a check mark); a bottom sheet on phones like .pop-body. */
select.sel-native,input.sel-native{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:0!important;
  border:0!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important;flex:none!important}
.sel-btn{display:flex;align-items:center;width:100%;min-width:0;min-height:var(--ctl);padding:var(--field-py) 34px var(--field-py) var(--field-px);border:1px solid var(--line-2);
  border-radius:var(--radius-sm);color:var(--text);font:inherit;font-size:var(--field-fs);line-height:1.4;text-align:left;cursor:pointer;
  background:var(--surface) no-repeat;background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%);
  background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%;background-size:5px 5px}
.sel-btn .sel-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sel-btn:hover:not(:disabled){border-color:var(--text-3)}
.sel-btn:focus-visible,.sel-btn[aria-expanded=true]{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent);border-radius:var(--radius-sm)}
.sel-btn:disabled{background-color:var(--surface-2);color:var(--text-3);cursor:not-allowed}
.sel-btn.sel-invalid{border-color:var(--bad);outline-color:var(--bad)}
/* where a page sizes its selects, the button follows */
.inline .sel-btn{width:auto;flex:1 1 140px}
.fraud-rules .sel-btn{min-width:130px}
@media (max-width:719px){.fraud-rules .sel-btn{width:auto;flex:1 1 120px}}
.toolbar .sel-btn,.pager .sel-btn,.page-filters .sel-btn,.toolbar .dates .sel-btn{width:auto}
.pager .sel-btn{display:inline-flex}
.card-head form.inline .sel-btn{flex:0 0 auto}
@media (max-width:719px){.toolbar .dates .sel-btn{flex:1 1 100%}}
.pop-body label.field .sel-btn{font-weight:400}
.param-row .sel-btn{flex:0 1 50%}
.param-lines .sel-btn{width:100%;min-width:110px}
.sel-list{position:fixed;z-index:70;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow-lg);padding:6px;text-align:left;white-space:normal;font-size:14px;font-weight:400;color:var(--text);text-transform:none;letter-spacing:0}
.sel-list input[type=search].sel-find{flex:none;width:100%;min-height:var(--ctl-sm);margin:0 0 6px;padding:6px 10px;font-size:14px}
.sel-opts{overflow-y:auto;overscroll-behavior:contain;max-height:320px;outline:0}
.sel-opt{position:relative;display:flex;flex-direction:column;justify-content:center;min-height:34px;padding:6px 30px 6px 10px;border-radius:6px;cursor:pointer;
  color:var(--text);line-height:1.35}
.sel-opt span{overflow-wrap:anywhere}
.sel-opt small{font-size:12px;color:var(--text-3)}
.sel-opt:hover,.sel-opt.on{background:var(--surface-2)}
.sel-opt.on{box-shadow:inset 0 0 0 1px var(--line-2)}
.sel-opt[aria-selected=true]{background:var(--accent-soft);color:var(--accent-dark);font-weight:600}
.sel-opt[aria-selected=true].on{box-shadow:inset 0 0 0 1px var(--accent-line)}
.sel-opt[aria-selected=true]::after{content:"";position:absolute;right:12px;top:50%;width:5px;height:10px;margin-top:-7px;
  border:solid var(--accent);border-width:0 2px 2px 0;transform:rotate(45deg)}
.sel-opt[aria-disabled=true]{color:var(--text-3);opacity:.6;cursor:not-allowed;background:none}
.sel-group{padding:8px 10px 4px;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.sel-group:not(:first-child){border-top:1px solid var(--line-soft);margin-top:4px}
.sel-empty{padding:8px 10px;font-size:13px;color:var(--text-3)}
@media (max-width:719px){
  .sel-list{left:8px;right:8px;top:auto;bottom:calc(var(--tabs) + 16px);max-height:65vh;padding:8px}
  .sel-list .sel-opts{max-height:none;flex:1 1 auto;min-height:0}
  .sel-opt{min-height:44px;font-size:15px}
}
@media print{.sel-list{display:none}}

/* ---------- the Add Affiliate wizard and its API Details box (SEGMENTS 140) ----------
   One form; without JavaScript every step shows one under the other. app.js data-wizard adds .stepping to the form:
   then only the step marked .now shows, the stepper marks done / now, and Back / Next appear. */
.stepper{list-style:none;margin:0 0 var(--sp-4);padding:0;display:flex;gap:var(--sp-2);overflow-x:auto;scrollbar-width:none;counter-reset:none}
.stepper li{flex:1 1 0;min-width:max-content;display:flex;align-items:center;gap:var(--sp-2)}
.stepper li:not(:last-child)::after{content:"";flex:1;min-width:12px;height:1px;background:var(--line-2)}
.stepper a{display:flex;align-items:center;gap:var(--sp-2);min-height:var(--ctl);padding:0 2px;border-radius:var(--radius-sm);
  color:var(--text-2);font-size:13px;font-weight:500;white-space:nowrap}
.stepper a:hover{text-decoration:none;color:var(--text)}
.stepper .n{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;
  background:var(--neutral-bg);color:var(--text-3);font-size:12px;font-weight:600}
.stepper a.now{color:var(--text);font-weight:600}
.stepper a.now .n{background:var(--accent);color:var(--on-accent)}
.stepper a.done .n{background:var(--ok-bg);color:var(--ok)}
.wizard-step{scroll-margin-top:calc(var(--top) + 12px)}
form.wizard.stepping .wizard-step:not(.now){display:none}
.wizard-nav{display:flex;gap:var(--sp-2);align-items:center;margin-top:var(--sp-4)}
.wizard-nav .grow{flex:1}
.wizard fieldset.choice{border:0;margin:0 0 var(--sp-4);padding:0;min-width:0}
.wizard fieldset.choice>legend,.wizard fieldset.ticks>legend{font-size:13px;font-weight:600;color:var(--text-2);padding:0;margin-bottom:4px}
.wizard fieldset.ticks{border:0;margin:0 0 var(--sp-4);padding:0;min-width:0}
.wizard .indent{padding-left:calc(var(--check) + var(--sp-2))}
.pw-row{display:flex;gap:6px;align-items:stretch}
.pw-row input{flex:1;min-width:0}
.summary dt{display:flex;gap:8px;align-items:baseline}
.summary dd{color:var(--text-2)}
.modal-scrim{position:fixed;inset:0;z-index:80;background:rgba(10,12,18,.5);display:flex;align-items:center;justify-content:center;padding:16px}
.modal{width:100%;max-width:560px;max-height:calc(100vh - 32px);overflow-y:auto;background:var(--surface);color:var(--text);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:var(--sp-5)}
.modal h2{margin-bottom:4px}
.modal .btn-row{margin-top:var(--sp-4);justify-content:flex-end}
.kv.two-col{margin-top:12px}
@media (min-width:560px){.kv.two-col{grid-template-columns:max-content 1fr}.kv.two-col dt{margin-top:0;padding-top:6px}.kv.two-col dd{padding-top:6px}}
.handoff dd.mono{font-family:var(--mono);font-size:13px}

/* ---------- the compact scale (2 Dec 2026, SEGMENTS 143): one line a row, small controls inside a table ----------
   A list of class .oneline keeps every cell on one line from 720 px (a cell of class .cut ends in "…" and its title
   holds the whole); its sub-lines follow on the same line. Buttons inside a table row are the in-table size
   (--ctl-xs: 24 px with a mouse, 32 px for a finger), so a row with buttons stays about as tall as one without. */
@media (min-width:720px){
  .table.oneline td{white-space:nowrap}
  .table.oneline td .sub{display:inline;margin-left:6px}
  .table.oneline td .badge+.badge{margin-left:4px}
  .table.oneline td.cut{max-width:150px;overflow:hidden;text-overflow:ellipsis}
  .table.oneline td.head.cut{max-width:220px}
  .table.oneline td.cut>span{display:inline}
  .table td .btn:not(details.date-pop .btn,details.filter-pop .btn){min-height:var(--ctl-xs);padding-top:0;padding-bottom:0}
  .table td .btn.icon-only:not(details.date-pop .btn,details.filter-pop .btn){width:var(--ctl-xs)}
  .table td:has(.btn){padding-top:calc(var(--cell-y) - 2px);padding-bottom:calc(var(--cell-y) - 2px)}
  .table td .switch{vertical-align:middle}
}
.table td .pop-body .btn:not(details.date-pop .btn,details.filter-pop .btn){min-height:var(--ctl-sm);padding:var(--btn-sm-py) var(--btn-sm-px)}
@media (min-width:720px){
  .table.oneline .who>span{flex-direction:row;align-items:baseline;gap:6px}
  .table.oneline .who .sub{margin-left:0;max-width:200px}
}
/* a button with a menu of other ways (Add Affiliate): the main way, then a narrow button that opens the others */
.splitbtn{display:inline-flex;align-items:stretch}
.splitbtn>.btn{border-top-right-radius:0;border-bottom-right-radius:0}
.splitbtn>details.split-more>summary.btn{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:color-mix(in srgb,var(--on-accent) 35%,var(--accent));
  padding-left:0;padding-right:0;width:var(--ctl);height:100%}
.splitbtn>details.split-more>summary svg{width:16px;height:16px}
.pop-body.menu{width:260px;padding:6px;display:grid;gap:2px}
.pop-body.menu a{display:flex;flex-direction:column;gap:1px;padding:7px 10px;border-radius:var(--radius-sm);color:var(--text)}
.pop-body.menu a:hover{background:var(--surface-2);text-decoration:none}
.pop-body.menu a b{font-weight:600;font-size:13px}
.pop-body.menu a span{font-size:12px;color:var(--text-3)}
.narrow-form{max-width:440px}
.page-head .seg{margin-left:auto}
/* the Dashboard's Set Goals: two short number fields side by side, sized to what they hold */
.pop-body.goals-pop{width:min(280px,calc(100vw - 32px))}
@media (max-width:719px){.pop-body.goals-pop{width:auto}}
.goals-pop .pair-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.goals-pop label.field{margin:0 0 8px;font-size:12px}
.goals-pop .btn-row{margin-top:0}
@media (max-width:719px){.table.oneline td.actions:not(:has(*)){display:none}}   /* a phone card shows no empty Action line */

/* ---------- foundations (SEGMENTS 144): the affiliate portal's rejection reasons lead with the sentence; the API code
   beside it is a quiet chip (affiliates' integrations read it, so it stays) ---------- */
.rank.wide .name .sub.mono{display:table;margin-top:2px;padding:0 5px;border-radius:4px;background:var(--neutral-bg);font-size:11px;color:var(--text-3)}
/* a section title inside a card keeps a gap above it (never touching the Save before it) */
.card>h2:not(:first-child),.card>.card-head:not(:first-child){margin-top:var(--sp-5)}
.card.list>.card-head:not(:first-child){margin-top:0}
.toasts.sg-static{position:static;align-items:flex-start;margin:0 0 var(--sp-3);pointer-events:auto}   /* the style guide shows a toast in place */

/* ========== list pages and form pages (SEGMENTS 145, part B of the redesign's foundations) ==========
   A list ends at its table: "Add X" opens its form page in the drawer (.form-page); a row's other actions sit in its
   "⋯" menu (details.row-menu, ui.row_menu); a phone card shows only the cells marked data-ph (table.ph-few) plus the
   row's head and actions; a refused form shows its message by the field (ui.ferr) or at its top (ui.form_error). */
.form-page{max-width:560px}
.drawer-page .form-page{max-width:none}
.form-page .form-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
.form-page .btn-row{margin-top:var(--sp-4,16px)}
.flash.form-error{margin-bottom:var(--sp-3,12px)}
.flash.field-error{margin-top:6px;padding:6px 10px;font-size:13px}
.flash.field-error svg{width:15px;height:15px}
[aria-invalid="true"]:not(.switch){border-color:var(--bad)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--bad) 18%,transparent)}
.table td.actions details.row-menu{display:inline-block;vertical-align:middle}
.table td.actions details.row-menu>summary{list-style:none}
details.row-menu>summary::-webkit-details-marker{display:none}
.pop-body.menu.row-menu-body{width:200px;text-align:left;white-space:normal}
.pop-body.menu .menu-form{margin:0;display:block}
.pop-body.menu a[role=menuitem],.pop-body.menu button.menu-item{display:block;width:100%;padding:7px 10px;border:0;border-radius:var(--radius-sm);
  background:none;color:var(--text);font:inherit;font-size:13px;font-weight:500;text-align:left;cursor:pointer;text-decoration:none}
.pop-body.menu a[role=menuitem]:hover,.pop-body.menu button.menu-item:hover,.pop-body.menu [role=menuitem]:focus-visible{background:var(--surface-2);outline:none}
.pop-body.menu button.menu-item.danger{color:var(--bad)}
.pop-body.menu hr{border:0;border-top:1px solid var(--line-soft);margin:4px 0}
@media (max-width:719px){
  .table.ph-few td:not([data-ph]):not(.head):not(.actions):not(.pick){display:none}
  .table.ph-few td.actions:not(:has(*)){display:none}
}
@media (max-width:719px){.table.ph-few td.pick{justify-content:flex-start}.table.ph-few td.pick::before{display:none}}
@media (min-width:720px){.table.oneline td.cut.wide,.table.oneline td.cut.ev-text{max-width:min(420px,40vw)}}
body:not(:has(input[form=bulk][data-pick]:checked)) .rowsbulk[data-bulkbar]{display:none}
@media (min-width:720px){   /* a rule's week and today's hours inside a one-line row: as tall as a line of text */
  .table.oneline svg.weekchart{display:inline-block;vertical-align:middle;width:72px;height:21px}
  .table.oneline svg.hoursbar{display:inline-block;vertical-align:middle;width:110px;min-width:0;height:10px;margin-right:6px}
  .table.oneline .hours{flex-direction:row;align-items:center;flex-wrap:nowrap;gap:6px}
  .table.oneline .person .avatar{width:22px;height:22px;font-size:10px}
}   /* All Box Rules: the bar only once a rule is ticked */
.views a.t-deleted{margin-left:auto;color:var(--text-3)}
.views a.t-deleted.on{color:var(--text)}
/* the Leads columns menu (bug L-1): a grip to drag, the arrows show on hover and keyboard focus only */
.cols-on li{justify-content:flex-start}
.cols-on li label{flex:1}
.cols-on .grip{display:inline-flex;color:var(--text-3);cursor:grab;touch-action:none;padding:2px 0}
.cols-on .grip svg{width:14px;height:14px;fill:currentColor;stroke:none}
.cols-on li.dragging{background:var(--surface-2);border-radius:6px}
.cols-on li.dragging .grip{cursor:grabbing}
.cols-on li:first-child .mv-left,.cols-on li:last-child .mv-right{visibility:hidden}
@media (hover:hover){.cols-on .moves{opacity:0}.cols-on li:hover .moves,.cols-on li:focus-within .moves{opacity:1}}

/* ---------- bugs of the click-test, group 1 (SEGMENTS 146) ----------
   Deposits (D-3): the table fits its card at 1,280 px: narrower cells, the review note and decline reason in the
   Status cell's title (under the badge on a phone), Extend Review an icon. Leads: every row one line of the same height
   (the "Manual" marker beside its badge, the Check Score button inside the line); the Columns menu's Apply always in
   sight (L-2). */
@media (min-width:720px){
  .table.oneline[data-deposits] th,.table.oneline[data-deposits] td{padding-left:8px;padding-right:8px}
  .table.oneline[data-deposits] td.cut{max-width:110px}
  .table.oneline[data-deposits] td.head.cut{max-width:170px}
  .table.oneline[data-deposits] td .dep-why{display:none}
  .table.oneline[data-deposits] .countdown{margin-right:0}
  .leadgrid tbody td{height:calc(var(--ctl-xs) + 11px)}
  .leadgrid td .sub{display:inline;margin-left:6px}
}
.cols-pick>.btn-row{position:sticky;bottom:-10px;margin:8px -12px -10px;padding:8px 12px;background:var(--surface);border-top:1px solid var(--line-soft)}
/* the Add Affiliate wizard (W-5): a Traffic Rules choice has its gap between the circle and its words; the Deals step shows
   only the fields of the chosen deal type */
.rule-then>label.check{display:flex;align-items:center;gap:var(--sp-2)}
/* the sign-in page's message below the sign-in block, out of its flow (P-2): the centred block and its fields keep
   their place whatever the message says */
.auth{position:relative}
.auth>.auth-msg{position:absolute;top:100%;left:0;right:0}
.auth>.auth-msg .flashes{margin:var(--sp-3) 0 0}

/* ===== Phase 2, group 2 fixes (SEGMENTS 147): Brands, Boxes, Fraud, Events, Webhooks, Offers, Credits, AI chat, across the app ===== */
.card.list [data-weights]>.inside{padding:var(--sp-3) var(--sp-4)}   /* F-1: Threshold and Action keep the card's inner edge */
@media (max-width:719px){   /* X-2: on a phone the filter panel's lists stand one under the other, not in a sideways strip */
  .filter-body .filterrow{flex-wrap:wrap;overflow-x:visible;scroll-snap-type:none}
  .filter-body .filterrow>.ticks{flex:1 1 100%}
  .filter-body .ticklist{max-height:168px}
}
/* the API Document card's own Choose File button (the browser's file field is hidden inside it) */
.tbw-pickrow{display:flex;align-items:center;gap:8px;min-width:0}
.tbw-pick{position:relative;cursor:pointer;flex:0 0 auto}
.tbw-pick:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.tbw-pickrow .ai-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

/* ---------- Add Affiliate like Trackbox (SEGMENTS 148) ----------
   The pop-up over a list: the drawer drawn in the middle (a[data-modal-open], app.js), wide enough for the wizard; on a
   phone it fills the screen. The wizard's first step has a side column (Relations, Preferences); a choice's own fields
   show while it is chosen (CSS :has, no script); "+ Add Another Deal" opens the next deal (details), one at a time. */
.drawer.as-modal{top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:min(1040px,calc(100vw - 48px));
  height:min(860px,calc(100vh - 48px));border-radius:var(--radius);border:1px solid var(--line);box-shadow:var(--shadow-lg)}
.drawer-open:has(.drawer.as-modal:not([hidden])) .drawer-scrim{inset:0;background:rgba(10,12,18,.45)}
.drawer.as-modal .drawer-page>.page-head h1{font-size:var(--fs-h2)}
.drawer.as-modal .drawer-page .wizard-step{box-shadow:none;border:0;padding:0}
.drawer.as-modal [data-handoff-box]{max-width:none;max-height:none;border:0;box-shadow:none;padding:0;overflow:visible}
@media (max-width:719px){.drawer.as-modal{top:0;left:0;transform:none;width:100vw;height:100%;border-radius:0;border:0}}
.wizard-cols{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--sp-5)}
@media (min-width:960px){.wizard-cols{grid-template-columns:minmax(0,1fr) 240px}}
.wizard-side{border-top:1px solid var(--line-soft);padding-top:var(--sp-3)}
@media (min-width:960px){.wizard-side{border-top:0;border-left:1px solid var(--line-soft);padding:0 0 0 var(--sp-4)}}
.wizard-side h3{font-size:13px;font-weight:600;color:var(--text-2);margin:0 0 6px}
.wizard-side h3:not(:first-child){margin-top:var(--sp-4)}
.wizard-main details.more{margin-top:var(--sp-2)}
.wizard .form-grid>fieldset.choice{margin:0}
.drawer.as-modal:has([data-handoff-box]){height:auto;max-height:calc(100vh - 48px)}
.wizard .check.always{margin-top:var(--sp-2)}
.wizard fieldset:has(input[data-own]):not(:has(input[data-own]:checked)) .own-only{display:none}
.wizard fieldset:not(:has(input[name=box_mode][value=select]:checked)) .bx-select,
.wizard fieldset:not(:has(input[name=box_mode][value=create]:checked)) .bx-create{display:none}
.deal:has(.deal-kind option[value=""]:checked) .dk,
.deal:has(.deal-kind option[value="cpa"]:checked) .dk:not(.dk-cpa),
.deal:has(.deal-kind option[value="cpl"]:checked) .dk:not(.dk-cpl),
.deal:has(.deal-kind option[value="crg"]:checked) .dk:not(.dk-crg),
.deal:has(.deal-kind option[value="revshare"]:checked) .dk:not(.dk-revshare){display:none}
details.deal-more{margin-top:var(--sp-3)}
details.deal-more>summary{list-style:none;display:inline-flex}
details.deal-more>summary::-webkit-details-marker{display:none}
details.deal-more:not([open]) ~ details.deal-more{display:none}
details.deal-more[open]>summary{background:none;border:0;padding:0;font-weight:600;min-height:0;margin-bottom:6px;pointer-events:none}
details.deal-more:not([open]) .when-open,details.deal-more[open] .when-closed{display:none}
.wizard .postbacks{margin-top:var(--sp-4)}
.signup-page{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2) var(--sp-4);padding:var(--sp-3) var(--sp-4);border-bottom:1px solid var(--line-soft)}
.signup-page h3{margin:0;font-size:13px}
.signup-page p{margin:0}
.drawer.as-modal:has([data-handoff-box]) [data-drawer-full]{display:none}
/* the Affiliates list is wide: its row menu stays in sight at the right edge (SEGMENTS 148) */
@media (min-width:720px){table[data-affiliates] th.actions,table[data-affiliates] td.actions{position:sticky;right:0;z-index:2;background:var(--surface);box-shadow:-8px 0 8px -8px rgba(20,26,38,.18)}}

/* ---------- redesign phase 4a: the Leads page and a lead's page as drawn on 2 Dec 2026 (SEGMENTS 151) ----------
   The owner's "Option A": Filter, the days, Apply and the period buttons on the title line; the lead types as underline
   tabs with counts under it, with the search, Columns and Views on that line; the card holds only the table and its
   top becomes the bulk bar while leads are ticked (.la-bulk, sticky under the top bar); one-line rows of 34 px, the
   lead type (and a status) as a dot and a word, no brand squares, initials or flags; a Fraud Score as a plain number,
   coloured only from 35. On a phone each lead is a card (td.lc: name, time, affiliate · country, type, brand or a risky
   score). A lead's page: two columns (the lead and its tracking parameters; deposits and the latest steps), the Fraud
   Check below with plain fact lists and Registration vs Autologin as one table, and the Brand Response one card per
   integration with its Registration / Status Pull / Deposit Pull rows. The filter panel and the date range are
   untouched. Colours are tokens only. */
.ldot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:7px;vertical-align:1px;background:var(--text-3);flex:none}
.ldot.t-leads{background:var(--accent)}.ldot.t-depositors{background:var(--ftd)}.ldot.t-failures{background:var(--text-2)}
.ldot.t-unassigned{background:var(--bad)}.ldot.t-soft{background:var(--warn)}
.ldot.st-grey{background:var(--st-grey)}.ldot.st-blue{background:var(--st-blue)}.ldot.st-green{background:var(--st-green)}
.ldot.st-teal{background:var(--st-teal)}.ldot.st-purple{background:var(--st-purple)}.ldot.st-pink{background:var(--st-pink)}
.ldot.st-red{background:var(--st-red)}.ldot.st-yellow{background:var(--st-yellow)}
.ldot-w{white-space:nowrap}

/* the title line */
.leads-head{margin-bottom:0;align-items:center}
.leads-head h1{margin:0}
@media (min-width:720px){
  .leads-head .filterbar{order:3;flex:0 0 auto;margin-left:auto}
  .leads-head .actions{order:4;margin-left:0;padding-left:var(--sp-3);border-left:1px solid var(--line)}
}
/* the lead types, the search, Columns and Views on one line under the title */
.la-types{margin-top:10px;border-bottom:1px solid var(--line);align-items:flex-end;gap:var(--sp-2) var(--sp-6)}
.la-types .views{padding:0;gap:22px;border-bottom:0}
.la-types .views a{min-height:38px;padding:0 1px;font-weight:500}
.la-types .views a.on{font-weight:500}
.la-types .views a .n{font-weight:400}
.la-types .views-tools{padding:0 0 6px}
.la-find{display:inline-flex;align-items:center;gap:8px;width:280px;max-width:100%;min-height:var(--ctl);padding:0 10px;border:1px solid var(--line-2);
  border-radius:var(--radius-sm);background:var(--surface);color:var(--text-3);cursor:text}
.la-find:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.la-find svg{width:16px;height:16px;flex:none}
.views-tools .la-find input{flex:1;min-width:0;min-height:0;height:calc(var(--ctl) - 2px);padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;outline:0}
.leads-page .leads-tools{margin:10px 0 0;padding:0}
/* the card holds only the table; its top is the bulk bar while leads are ticked */
.la-card{margin-top:14px}
.la-card>.table-wrap{border-top:0}
.la-bulk{display:none;position:sticky;top:var(--top);z-index:25;flex-wrap:wrap;align-items:center;gap:6px;min-height:44px;margin:0;padding:6px 12px 6px 14px;
  background:var(--accent-soft);border-bottom:1px solid var(--accent-line);border-radius:var(--radius) var(--radius) 0 0}
.leads-page:has(input[data-pick]:checked) .la-bulk{display:flex}
.la-bulk .picked{font-weight:600;color:var(--accent-dark);font-size:var(--fs)}
.la-bulk .picked b{font-weight:600;color:inherit;font-size:inherit}
.la-bulk .all-match{min-height:0;margin:0 10px 0 6px;font-size:12.5px;color:var(--accent);gap:6px}
.la-bulk .bulk-actions{display:flex;flex-wrap:wrap;gap:6px}
.la-bulk .la-clear{margin-left:auto}
.la-bulk .pop-body{z-index:40}
/* the rows: one line of 34 px */
.la-grid th{font-weight:500;color:var(--text-3);background:var(--surface-2)}
.la-grid td a.lk{color:var(--text);font-weight:500}
.la-grid td a.lk:hover{color:var(--accent)}
.la-grid td a.lid{font-family:var(--mono);font-size:12px;color:var(--text-3)}
.la-grid td a.lid:hover{color:var(--accent)}
.la-grid a.plain-n.risk{color:var(--warn);font-weight:600}
.la-grid a.plain-n.risk.high{color:var(--bad)}
.la-grid .copy-email{color:var(--text)}
.la-grid th.lc,.la-grid td.lc{display:none}
@media (min-width:720px){
  .la-grid th{height:30px;padding-top:0;padding-bottom:0}
  .la-grid tbody td{height:34px;padding-top:0;padding-bottom:0}
}
/* the pager: "1–50 of 2,080", Rows, Previous, Next */
.la-pager{min-height:44px;padding:4px 14px;color:var(--text-3);font-size:12.5px}
.la-rows{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px}
.la-rows label{display:inline-flex;align-items:center;gap:8px}
.la-pager .btn[aria-disabled=true]{opacity:.5;pointer-events:none}
/* a phone: Filter and the days side by side, the periods one line that scrolls; each lead a card */
@media (max-width:719px){
  .leads-head .filterbar{flex:1 1 100%;display:flex;gap:8px;flex-wrap:nowrap}
  .leads-head .filterbar>details{flex:1 1 0;min-width:0}
  .leads-head .filterbar>details:last-of-type{flex-grow:1.4}
  .leads-head .filterbar>details>summary{width:100%;justify-content:center}
  .leads-head .la-apply{display:none}
  .leads-head .actions{flex:1 1 100%;margin:0;overflow-x:auto;scrollbar-width:none}
  .leads-head .actions .tabs{flex-wrap:nowrap;width:max-content}
  .la-types{margin-top:6px}
  .la-types .views{gap:20px}
  .la-types .views a{min-height:44px}
  .la-types .views-tools{flex:1 1 100%;padding:8px 0}
  .la-types .la-find{flex:1 1 0;width:auto}
  .la-card{margin-top:10px}
  .la-card .table-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
  .la-bulk{border-radius:var(--radius);border:1px solid var(--accent-line);margin-bottom:8px}
  .la-grid tr{display:flex;align-items:flex-start;gap:10px;margin:0;padding:12px 14px;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;background:var(--surface)}
  .la-grid tbody tr:last-child{border-bottom:0}
  .la-grid td{display:none}
  .la-grid td.pick,.la-grid td.lc{display:block;width:auto;padding:0;border:0;text-align:left}
  .la-grid td.pick::before,.la-grid td.lc::before{display:none}
  .la-grid td.pick{padding-top:2px}
  .la-grid td.lc{flex:1 1 auto;min-width:0}
  .la-grid td.lc a{display:block;color:var(--text);font-size:13px;line-height:1.4}
  .la-grid td.lc a:hover{text-decoration:none}
  .lc-top{display:flex;justify-content:space-between;gap:8px;font-size:14px}
  .lc-top b{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .lc-where{display:block;margin-top:2px}
  .lc-type{display:block;margin-top:4px}
  .lc-type .ldot{margin-right:6px}
  .la-grid .risk{color:var(--warn)}.la-grid .risk.high{color:var(--bad)}
  .la-pager{background:none;border-top:0;padding:10px 2px}
}

/* a lead's page: the header */
.lp-head .title-row{flex:1 1 auto;min-width:0}
.lp-head h1{margin:0}
.lp-type{display:inline-flex;align-items:center;font-weight:500;color:var(--text-2)}
.lp-type .ldot{margin-right:6px}
.lp-type.t-leads{color:var(--accent)}.lp-type.t-depositors{color:var(--ftd)}.lp-type.t-unassigned{color:var(--bad)}.lp-type.t-soft{color:var(--warn)}
.lp-acts{display:flex;align-items:center;gap:6px;margin-left:auto}
.lp-acts details[data-inject] .pop-body{width:min(360px,calc(100vw - 32px))}
.lp-head .lede{font-size:12.5px;color:var(--text-3);margin-top:2px}
.lp-head .lede .mono{font-size:12px}
/* the Overview: two columns from 1,100 px (one in the drawer) */
.lp-cols{display:grid;gap:12px;grid-template-columns:minmax(0,1fr);align-items:start}
@media (min-width:1100px){.lp-cols{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}}
.drawer .lp-cols{grid-template-columns:minmax(0,1fr)}
.lp-cols>.card,.lp-side>.card{margin:0}
.lp-side{display:flex;flex-direction:column;gap:12px;min-width:0}
.lp-lead h2,.lp-deps h2,.lp-steps h2{margin:0 0 6px;font-size:var(--fs-h2)}
.lp-lead h2.lp-sub{margin:14px 0 6px;padding-top:12px;border-top:1px solid var(--line-soft)}
@media (min-width:720px){
  .lp-kv{grid-template-columns:130px minmax(0,1fr);column-gap:12px}
  .lp-kv dt{font-size:12.5px;font-weight:400;padding:5px 0}
  .lp-kv dd{padding:5px 0}
}
.lp-kv .sub{display:block}
.lp-mark{display:block}
.lp-ua{color:var(--text-3)}
.lp-ink{color:var(--text)}
/* deposits: one line each, the decisions at its end */
.lp-dep-list{list-style:none;margin:0;padding:0}
.lp-dep{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:8px 0;border-top:1px solid var(--line-soft)}
.lp-dep-main{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-width:0;flex:1 1 260px}
.lp-dep-end{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-left:auto}
/* the latest steps */
.lp-tl{list-style:none;margin:0 0 6px;padding:0}
.lp-tl li{display:grid;grid-template-columns:96px 12px minmax(0,1fr);column-gap:10px;align-items:start}
.lp-tl .t{color:var(--text-3);font-size:12px;padding:6px 0}
.lp-tl .d{width:7px;height:7px;border-radius:50%;background:var(--accent-line);margin-top:11px}
.lp-tl .d.ftd{background:var(--ftd)}
.lp-tl .x{padding:5px 0;min-width:0;overflow-wrap:anywhere}
/* the Fraud Check: the score, then plain fact lists (only a risky answer in colour), then one comparison table */
.lp-fraud{margin-top:12px}
.lp-fraud .fraud-top{gap:14px;margin:10px 0 0;padding-bottom:14px;border-bottom:1px solid var(--line-soft)}
.lp-score{font-size:24px;font-weight:650;letter-spacing:-.02em;line-height:1}
.lp-score.warn{color:var(--warn)}.lp-score.bad{color:var(--bad)}
.lp-fraud .fraud-state .badges{align-items:center;gap:8px}
.lp-fraud .fraud-state p{margin:2px 0 0;font-size:12px}
.lp-facts{display:grid;grid-template-columns:minmax(0,1fr);gap:16px 24px;padding-top:12px}
@media (min-width:900px){.lp-facts{grid-template-columns:repeat(3,minmax(0,1fr))}}
.lp-facts .fraud-card{border:0;border-radius:0;padding:0}
.lp-facts .fraud-card-head{align-items:baseline;margin:0 0 4px}
.lp-facts .fraud-card-head h3{font-size:13px;font-weight:600}
.lp-n{color:var(--text);font-weight:600}.lp-n.warn{color:var(--warn)}.lp-n.bad{color:var(--bad)}
.lp-facts .facts li{padding:5px 0;border-top:1px solid var(--line-soft);font-size:12.5px}
.lp-facts .facts li:first-child{border-top:1px solid var(--line-soft)}
.lp-facts .facts .k{color:var(--text-3)}
.lp-facts .facts .v{font-weight:400;color:var(--text)}
.lp-facts .facts .v.bad{color:var(--warn);font-weight:600}
.lp-fraud .both-ips{margin-top:18px;padding-top:14px;border-top:1px solid var(--line-soft)}
.lp-cmp-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:0 0 8px}
.lp-cmp-head h3{margin:0;font-size:13px;font-weight:600}
.lp-cmp{width:100%;max-width:860px;border-collapse:collapse;font-size:12.5px}
.lp-cmp th{text-align:left;font-weight:500;color:var(--text-3);font-size:12px;padding:6px 10px;border-bottom:1px solid var(--line)}
.lp-cmp td{padding:0 10px;height:30px;border-bottom:1px solid var(--line-soft)}
.lp-cmp th:first-child,.lp-cmp td:first-child{width:90px;padding-left:0}
.lp-cmp td.v{font-weight:500;color:var(--text-3)}
.lp-cmp td.v.ok{color:var(--ok)}.lp-cmp td.v.bad{color:var(--bad)}
.lp-fraud .both-ips>.small{margin:8px 0 0}
/* the Brand Response: a card per integration, a row per request (Registration, Status Pull, Deposit Pull) that opens */
.lp-br{margin:0 0 12px;overflow:visible}
.lp-br-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:12px 16px}
.lp-br-head h2{margin:0;font-size:14px;font-weight:600}
.lp-br-when{margin-left:auto}
.br-grid{border-top:1px solid var(--line)}
.br-th,.br-grid details.br-row>summary{display:grid;grid-template-columns:170px 110px 60px 60px minmax(0,1fr) 160px 76px;align-items:center;column-gap:12px;padding:0 16px}
.br-th{min-height:30px;background:var(--surface-2);border-bottom:1px solid var(--line);font-size:12px;font-weight:500;color:var(--text-3)}
.br-grid details.br-row{border:0;border-radius:0;margin:0;background:none;border-bottom:1px solid var(--line-soft)}
.br-grid details.br-row:last-child{border-bottom:0}
.br-grid details.br-row>summary{min-height:34px;gap:0 12px;list-style:none;font-size:13px}
.br-grid details.br-row>summary::-webkit-details-marker{display:none}
.br-grid details.br-row>summary .br-name{font-weight:400;min-width:0}
.br-grid details.br-row[open]>summary{background:var(--accent-soft);border-bottom:0}
.br-grid details.br-row[open]>summary .br-name{font-weight:500}
.br-grid details.br-row:not([open]) .when-open,.br-grid details.br-row[open] .when-closed{display:none}
.br-more{justify-self:end}
.br-more .btn{min-height:26px;padding:0 8px;font-size:12.5px}
.br-open{background:var(--accent-soft);padding:0 4px 4px}
.br-open .respline{padding:8px 12px}
@media (max-width:899px){
  .br-th{display:none}
  .br-grid details.br-row>summary{display:flex;flex-wrap:wrap;gap:6px 12px;padding:8px 12px}
  .br-grid details.br-row>summary .br-name{font-weight:600;flex:1 1 100%}
  .br-more{margin-left:auto}
}
.drawer .br-th{display:none}
.drawer .br-grid details.br-row>summary{display:flex;flex-wrap:wrap;gap:6px 12px;padding:8px 12px}
.drawer .br-grid details.br-row>summary .br-name{font-weight:600;flex:1 1 100%}
.drawer .br-more{margin-left:auto}
.la-grid .map-cell .sub{display:inline-block;max-width:120px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
.br-grid details.br-row>summary b{font-weight:400}
@media (max-width:719px){
  .la-grid tbody tr:hover td,.la-grid tbody tr:has(input[data-pick]:checked) td{background:none;box-shadow:none}
  .la-grid tbody tr:has(input[data-pick]:checked){background:var(--accent-soft);box-shadow:inset var(--sp-1) 0 0 var(--accent)}
}
/* the tick column is never resized: its grip would sit over the "tick every lead" box */
.la-grid th.pick,.la-grid td.pick{min-width:calc(var(--check) + var(--cell-x) + 8px)}
.la-grid th.pick .col-grip{display:none}

/* ========== phase 4b: Deposits and Affiliates as drawn (SEGMENTS 152) ==========
   The drawings "Deposits", "Phone-Deposits", "Affiliates", "Affiliate-Drawer" and "Affiliate-Page". Everything of this
   round is in this block (another round edits the Leads pages at the same time). */

/* a search field with its icon and no button (Enter searches): the end of a list's tab row */
.find.bare{display:flex;align-items:center;gap:6px;min-height:var(--ctl);padding:0 var(--field-px);border:1px solid var(--line-2);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text-3);width:300px;max-width:100%;cursor:text}
.find.bare:focus-within{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent)}
.find.bare svg{width:15px;height:15px;flex:none}
.find.bare input{border:0!important;outline:0!important;box-shadow:none!important;padding:0!important;min-height:0!important;background:transparent;flex:1;min-width:0}
.views-tools .find.bare{width:300px;flex:0 1 auto}
.aff-tools .find.bare{width:260px}
@media (max-width:640px){.views-tools .find.bare,.aff-tools .find.bare{flex:1 1 0;width:auto}}

/* the line under a list: how many, and what is owed (Affiliates) */
.list-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);flex-wrap:wrap;min-height:40px;padding:6px var(--sp-4);
  border-top:1px solid var(--line-soft);color:var(--text-3);font-size:12.5px}
.list-foot .links{display:flex;gap:var(--sp-3)}
.list-foot .links a{color:var(--text-3)}
.list-foot .links a:hover{color:var(--accent)}

/* ---------- Deposits ---------- */
.dep-head .actions{align-items:center}
.dep-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:0;margin-bottom:var(--gap)}
.dep-strip .ds{display:flex;flex-direction:column;gap:2px;padding:12px 16px;min-width:0;color:inherit;text-decoration:none}
.dep-strip .ds+.ds{border-left:1px solid var(--line-soft)}
.dep-strip a.ds:hover{background:var(--surface-2);text-decoration:none}
.dep-strip .label{font-size:12px;color:var(--text-3);font-weight:500}
.dep-strip .value{font-family:var(--head);font-size:20px;font-weight:650;letter-spacing:-.01em;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dep-strip .value.ftd-n{color:var(--ftd)}
.dep-strip .ds-next{font-family:var(--body);font-size:12.5px;font-weight:400;letter-spacing:0;color:var(--text-3)}
.dep-strip .ds-short{display:none}
@media (max-width:719px){
  .dep-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dep-strip .ds-amount{display:none}
  .dep-strip .ds{padding:10px 12px}
  .dep-strip .value{font-size:18px}
  .dep-strip .ds-next,.dep-strip .ds-long{display:none}
  .dep-strip .ds-short{display:inline}
}
.time-left{font-variant-numeric:tabular-nums}
.table[data-deposits] td.dep-amount .strong{font-weight:600}
.table[data-deposits] .dep-decide{justify-content:flex-end;gap:4px}
.table[data-deposits] .dep-decide [data-extended]{margin-right:6px}
.table[data-deposits] td.dep-sub{display:none}
.dep-more{width:280px}
.dep-more .ph-extend{display:none;margin-top:var(--sp-3);padding-top:var(--sp-3);border-top:1px solid var(--line-soft)}
@media (max-width:719px){.dep-more .ph-extend{display:block}}
.dep-more .kv dt:first-child{margin-top:0}
.btn.dec-ok,.btn.dec-no{background:var(--surface)}
@media (min-width:720px){
  .table.oneline[data-deposits] td.dep-email.cut{max-width:230px}
  .table.oneline[data-deposits] td.dep-aff.cut,.table.oneline[data-deposits] td.dep-brand.cut,.table.oneline[data-deposits] td.dep-conn.cut{max-width:150px}
  .table.oneline[data-deposits] td.dep-status.cut{max-width:none}
  .table.oneline[data-deposits] td.dep-time.cut{max-width:180px}
  .table[data-deposits] td.dep-act{width:1%}
}
/* a phone: each deposit a card of three lines (the drawing "Phone-Deposits"): the email and the amount; the affiliate and
   the brand; the state, the time left and the decisions */
@media (max-width:719px){
  .dep-list .table[data-deposits] tr{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"email email email amount" "sub sub sub sub" "status time . act";
    gap:2px 8px;align-items:center;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;margin:0;padding:12px 16px}
  .dep-list .table[data-deposits] tr:last-child{border-bottom:0}
  .dep-list .table[data-deposits] td{display:block;width:auto;padding:0;border:0;text-align:left;min-width:0}
  .dep-list .table[data-deposits] td::before{display:none}
  .dep-list .table[data-deposits] td.dep-date,.dep-list .table[data-deposits] td.dep-aff,.dep-list .table[data-deposits] td.dep-country,
  .dep-list .table[data-deposits] td.dep-brand,.dep-list .table[data-deposits] td.dep-conn{display:none}
  .dep-list .table[data-deposits] td.dep-email{grid-area:email;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dep-list .table[data-deposits] td.dep-amount{grid-area:amount;text-align:right}
  .dep-list .table[data-deposits] td.dep-amount .strong{font-weight:650}
  .dep-list .table[data-deposits] td.dep-sub{display:block;grid-area:sub;color:var(--text-3);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dep-list .table[data-deposits] td.dep-email.no-email{display:none}
  .dep-list .table[data-deposits] tr:has(td.no-email) td.dep-sub{grid-area:email;color:var(--text);font-weight:600;font-size:15px}
  .dep-list .table[data-deposits] tr:has(td.no-email){grid-template-areas:"email email email amount" "status time . act"}
  .dep-list .table[data-deposits] td.dep-status{grid-area:status;margin-top:6px}
  .dep-list .table[data-deposits] td.dep-status .dep-why{display:none}
  .dep-list .table[data-deposits] td.dep-time{grid-area:time;margin-top:6px;color:var(--text-3);font-size:13px}
  .dep-list .table[data-deposits] td.dep-time .time-left::after{content:" left"}
  .dep-list .table[data-deposits] td.dep-act{grid-area:act;margin-top:6px;display:flex;justify-content:flex-end}
  .dep-list .table[data-deposits] [data-extend]{display:none}   /* Extend Review: on a wide screen and in a lead's page */
  .dep-list .table[data-deposits] [data-extended]{display:none}
  .dep-list .table[data-deposits] .dep-decide .btn.icon-only{width:36px;min-height:36px}
}

/* ---------- Affiliates list ---------- */
.aff-list td.head .muted{font-weight:400}
.aff-list td.head .badge{margin-left:4px}
@media (min-width:720px){.table.oneline.aff-list td.head.cut{max-width:260px}.table.oneline.aff-list td.cut{max-width:160px}}

/* ---------- an affiliate's page and drawer: the head, one form per tab, the bar "Unsaved changes" ---------- */
.aff-head .title-row .muted{font-size:var(--fs)}
.aff-head .actions{align-items:center}
.aff-head .lede{font-size:12.5px;color:var(--text-3)}
.tabform{padding:0;overflow:visible}
.tabform .tf-sec{border:0;margin:0;padding:var(--sp-4) var(--sp-4) var(--sp-2);min-width:0}
.tabform>.tf-sec~.tf-sec{border-top:1px solid var(--line-soft)}
.tabform .field>label.check{display:flex;font-weight:500;color:var(--text)}
.tabform .tf-inline .sel-btn{width:100%}
.rule-grid .rg-inline .sel-btn{width:auto;flex:0 1 180px}
.rule-grid .rg-stop .sel-btn{width:100%}
.rules-foot>details>summary.btn{color:var(--accent);border-color:transparent;background:none}
.aff-list td[data-label=Balance] a{color:var(--text)}
.aff-list td[data-label=Balance] a.bad-text{color:var(--bad)}
.rules-sets .rs-h{margin-top:var(--sp-4)}
.rules-sets .rules-now{margin:0 0 4px;padding-left:18px;font-size:12.5px}
.rules-sets .rules-now li{margin:4px 0}
.rules-sets .rules-now span{display:block;color:var(--text-3)}
.tabform .tf-says{margin:0 0 var(--sp-2)}
@media (min-width:720px){main .savebar{padding-right:calc(var(--sp-4) + 56px)}.drawer-page .savebar{padding-right:var(--sp-4)}
  .table[data-deposits] .pop-body.confirm-pop{width:320px}}
.tabform>.flash.form-error{margin:var(--sp-3) var(--sp-4) 0}
.tabform .tf-sec>legend{float:left;width:100%;padding:0;margin:0 0 var(--sp-2);font-size:13px;font-weight:600;color:var(--text)}
.tabform .tf-sec>legend+*{clear:both}
.tabform .form-grid .span2,.tabform .form-grid .kv.span2{grid-column:1/-1}
.tabform .tf-inline{display:flex;flex-wrap:wrap;gap:4px var(--sp-5);align-items:flex-end}
.tabform .tf-inline .field{margin-bottom:var(--sp-2);min-width:160px}
.tabform .tf-inline.tf-wide .field{flex:0 1 220px}
.tabform .tf-read{margin:0;min-height:var(--ctl);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tabform .tf-unit{display:flex;align-items:center;gap:6px}
.tabform .tf-unit input{width:90px;text-align:right}
.tabform .sw-row{min-height:var(--ctl)}
.tabform .card-head{padding:var(--sp-3) var(--sp-4)}
.tabform .inside{padding:0 var(--sp-4)}
.tabform details.more{margin-top:var(--sp-2)}
.tabform>.table-wrap,.tabform .tf-sec .table-wrap{border:1px solid var(--line-soft);border-radius:var(--radius-sm)}
.tabform.card.list>.table-wrap{border-left:0;border-right:0;border-radius:0}
.tabform .field.changed>label,.tabform .field.changed>.label,.tabform .rg-row.changed .rg-k span{display:flex;align-items:center;gap:6px}
.tabform .field.changed>label::after,.tabform .field.changed>.label::after,.tabform .rg-row.changed .rg-k span::after{content:"";width:6px;height:6px;border-radius:50%;background:var(--accent)}
.tabform .changed input:not([type=checkbox],[type=radio]),.tabform .changed select,.tabform .changed textarea{border-color:var(--accent-mid)}
.tabform .was{font-size:12px;color:var(--text-3);margin-top:4px}
.tabform-card{padding:0;min-width:0}
.tabform-card>.tabform{border:0;box-shadow:none;margin:0}
.savebar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:var(--sp-2);padding:12px var(--sp-4);margin-top:var(--sp-2);
  background:var(--surface);border-top:1px solid var(--line);border-radius:0 0 var(--radius) var(--radius);box-shadow:0 -8px 20px rgba(20,26,38,.05)}
.savebar .sb-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);flex:none}
.savebar .sb-title{font-weight:500}
.savebar .sb-grow{flex:1}
.savebar:not(.live) .sb-dot,.savebar:not(.live) .sb-title,.savebar:not(.live) .sb-what,.savebar:not(.live) .sb-discard{display:none}   /* without script: a plain Save */
.savebar.live{display:none}
form.dirty>.savebar.live,form.dirty .savebar.live{display:flex}
.drawer-page .savebar{bottom:-1px}
@media (max-width:719px){.savebar{padding:10px 12px;bottom:var(--tabs,0px)}.savebar .sb-what{display:none}}

/* the Traffic Rules tab: a rule a row (Rule · Setting · When It Stops a Lead), the account's rule sets beside it */
.rules-cols{display:flex;gap:var(--sp-4);flex-wrap:wrap;align-items:flex-start}
.rules-cols>.tabform-card{flex:999 1 640px;max-width:1000px}
.rules-cols>.rules-sets{flex:1 1 260px}
.rules-fs{border:0;margin:0;padding:0;min-width:0}
.rule-grid .rg-head,.rule-grid .rg-row{display:grid;grid-template-columns:200px minmax(0,1fr) 220px;gap:var(--sp-4);padding:10px var(--sp-4)}
.rule-grid .rg-head{font-size:12px;font-weight:500;color:var(--text-3);padding-top:10px;padding-bottom:6px}
.rule-grid .rg-row{border-top:1px solid var(--line-soft);align-items:start}
.rule-grid .rg-row.changed{background:color-mix(in srgb,var(--accent-soft) 55%,var(--surface))}
.rule-grid .rg-k{font-weight:500;min-height:var(--ctl);align-items:center}
.rule-grid .rg-set{min-width:0}
.rule-grid .rg-set textarea{min-height:var(--ctl);max-width:420px}
.rule-grid .rg-inline{display:flex;align-items:center;gap:6px 8px;flex-wrap:wrap;min-height:var(--ctl)}
.rule-grid .rg-inline select{width:auto;max-width:180px}
.rule-grid .rg-inline input:not(.rg-num){width:160px}
.rule-grid .rg-inline textarea{flex:1 1 200px}
.rule-grid .rg-num{width:90px;text-align:right}
.rule-grid .rg-today{margin-left:6px}
.rule-grid .rg-stop select{width:100%}
.rule-grid .rg-fixed{display:flex;align-items:center;min-height:var(--ctl);color:var(--text-2)}
.rule-grid .rg-set p.small{margin:6px 0 0}
.rule-grid .rg-set .weekgrid{margin:0}
.rules-foot{padding:10px var(--sp-4);border-top:1px solid var(--line-soft)}
.rules-foot>details>summary{color:var(--accent);padding-left:4px;padding-right:4px}
.rules-foot .pop-body{width:300px}
.rules-sets h2{font-size:14px;margin:0 0 10px}
.rules-sets .rs-row{display:flex;justify-content:space-between;gap:var(--sp-2);padding:8px 0;border-top:1px solid var(--line-soft)}
.rules-sets p{margin:8px 0 0}
@media (max-width:899px){
  .rule-grid .rg-head{display:none}
  .rule-grid .rg-row{grid-template-columns:minmax(0,1fr);gap:6px}
  .rule-grid .rg-stop select{width:auto;max-width:100%}
}

/* ---------- fix round of 3 Dec 2026 (owner's list): the Leads grid's fraud score as a pill the size of its Check
   button, coloured by the result (green clean, amber flagged, red failed) ---------- */
.leadgrid a.fraud-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:var(--ctl-xs);
  min-width:3.4em;padding:2px 8px;border-radius:var(--radius-sm);border:1px solid transparent;font-size:12px;font-weight:600;
  font-variant-numeric:tabular-nums;text-decoration:none}
.leadgrid a.fraud-pill.ok{background:var(--ok-bg);color:var(--ok)}
.leadgrid a.fraud-pill.warn{background:var(--warn-bg);color:var(--warn)}
.leadgrid a.fraud-pill.bad{background:var(--bad-bg);color:var(--bad)}
/* the four score bands, "Tint + Fine Ring" (owner, 4 Dec 2026): a mid tint, the band's text, a 1 px inner ring */
.leadgrid a.fraud-pill.b0{background:var(--fs0-bg);color:var(--fs0-ink);box-shadow:inset 0 0 0 1px var(--fs0-ring)}
.leadgrid a.fraud-pill.b1{background:var(--fs1-bg);color:var(--fs1-ink);box-shadow:inset 0 0 0 1px var(--fs1-ring)}
.leadgrid a.fraud-pill.b2{background:var(--fs2-bg);color:var(--fs2-ink);box-shadow:inset 0 0 0 1px var(--fs2-ring)}
.leadgrid a.fraud-pill.b3{background:var(--fs3-bg);color:var(--fs3-ink);box-shadow:inset 0 0 0 1px var(--fs3-ring)}
.leadgrid a.fraud-pill:hover{border-color:currentColor;text-decoration:none}
.leadgrid a.fraud-pill,.leadgrid .btn.fraud-ask{min-width:58px}   /* the pill and the Check button: one size */
/* Boxes: each box is its head line only; its rules are on its own page; a search by name in the tabs row */
.views .bx-find{margin-left:auto;display:flex;gap:var(--sp-2);align-items:center}
.box-card.bx-only .bx-head{border-bottom:0}
/* the country pickers (app.js input[data-countries] / [data-country]): the drop-down's own list, plus Clear and Done */
.cp-list .cp-row{display:flex;justify-content:flex-end;gap:var(--sp-2);margin-top:6px;padding-top:6px;border-top:1px solid var(--line-soft)}
.cp-btn .sel-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* working hours as rows of days + From–To (owner, 3 Dec 2026, like Trackbox's): above the week grid, which stays */
.hr-rows{display:grid;gap:var(--sp-2);margin-bottom:var(--sp-3)}
.hr-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2)}
.hr-row .hr-days{display:flex;flex-wrap:wrap;gap:4px}
.hr-row input[type=time]{width:auto;min-width:7.5em}
.hr-row .hr-rm{min-width:var(--ctl-sm);font-size:16px;line-height:1}
.hr-rows .hr-add{justify-self:start}
/* the Filter and date buttons as tall as their toolbar neighbours on a computer (owner, 3 Dec 2026); the panels they
   open keep their own sizes (the pinned block at the top) */
@media (min-width:900px) and (pointer:fine){
  details.filter-pop>summary.btn,details.date-pop>summary.btn{min-height:32px;padding-top:4px;padding-bottom:4px;font-size:13px}
}

/* ---------- compact pages (owner, 3 Dec 2026; SEGMENTS 156) ----------
   .setrows / .setrow: a setting as one row, what it is on the left (.sr-l: its label and help), its control on the right
   (.sr-c); stacked on a phone. .numf: a number sized to its content, right-aligned digits, its unit inside the field
   (.unit), a soft fill that turns white with a blue ring while typed in; .sr-c.text: a text field or list of one
   medium width with the same fill. [data-show-when] (app.js): a field shown only when another field has a value. */
.setrows{display:flex;flex-direction:column}
.setrow{display:grid;gap:var(--sp-2);padding:10px 0;border-top:1px solid var(--line-soft);align-items:center;margin:0}
.setrow:first-child{border-top:0;padding-top:2px}
.setrow:last-child{padding-bottom:2px}
@media (min-width:720px){.setrow{grid-template-columns:minmax(0,1fr) auto;gap:var(--sp-4)}}
.setrow .sr-l{display:flex;flex-direction:column;gap:1px;min-width:0}
.setrow .sr-l>label,.setrow .sr-l>.label{font-weight:500;color:var(--text);margin:0}
.setrow .sr-l .help{margin:0}
.setrow .sr-c{display:flex;align-items:center;gap:var(--sp-2);flex-wrap:wrap;min-width:0}
@media (min-width:720px){.setrow .sr-c{justify-content:flex-end}}
.setrow .sr-c.text{width:100%}
@media (min-width:720px){.setrow .sr-c.text{width:280px}}
.setrow .sr-c.text>*{flex:1;min-width:0}
.setrow .sr-c.wide{width:100%}
@media (min-width:720px){.setrow.wide{grid-template-columns:1fr}.setrow .sr-c.wide{justify-content:flex-start}}
.numf{display:inline-flex;align-items:center;gap:6px;width:124px;flex:none;min-height:var(--ctl);padding:0 var(--field-px);
  background:var(--surface-2);border:1px solid transparent;border-radius:var(--radius-sm);transition:border-color .15s,background-color .15s,box-shadow .15s}
.numf:hover{border-color:var(--line-2)}
.numf:focus-within{background:var(--surface);border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.numf input{flex:1;min-width:0;width:auto;min-height:calc(var(--ctl) - 2px);padding:0;border:0;background:none;text-align:right;
  font-variant-numeric:tabular-nums;font-weight:500;-moz-appearance:textfield}
.numf input:focus{outline:0}
.numf input::-webkit-outer-spin-button,.numf input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.numf .unit{color:var(--text-3);font-size:var(--fs-label);white-space:nowrap}
.numf.wide{width:160px}
.setrow .sr-c.text input,.setrow .sr-c.text select,.setrow .sr-c.text .sel-btn,.setrow .sr-c.text textarea{background-color:var(--surface-2);border-color:transparent}
.setrow .sr-c.text input:hover,.setrow .sr-c.text .sel-btn:hover{border-color:var(--line-2)}
.setrow .sr-c.text input:focus{background-color:var(--surface)}
.card-head .btn-row{margin:0}
[data-show-when][hidden]{display:none!important}
.cols2{display:grid;gap:var(--sp-3);grid-template-columns:minmax(0,1fr);align-items:start}
@media (min-width:1100px){.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}.cols2>.card{margin:0}}
@media (prefers-reduced-motion:reduce){.numf{transition:none}}
/* every field of the app, the soft look (owner, 3 Dec 2026: "make it in every input box across the app"): a light fill
   with a faint edge, a firmer edge under the pointer, white with a blue ring while typed in. Sizes are unchanged
   (the filter panels and date ranges keep theirs); numbers are right-aligned digits of one width and never wider than
   they need (.numf puts the unit inside). */
input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=submit],[type=button],[type=range],[type=color]),select,textarea,.sel-btn{
  background-color:var(--surface-2);border-color:var(--line-soft);transition:border-color .15s,background-color .15s,box-shadow .15s}
input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=submit],[type=button],[type=range],[type=color]):hover:not(:disabled,:focus),select:hover:not(:disabled,:focus),textarea:hover:not(:disabled,:focus),.sel-btn:hover:not(:disabled){border-color:var(--line-2)}
input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=submit],[type=button],[type=range],[type=color]):focus,select:focus,textarea:focus,.sel-btn:focus-visible,.sel-btn[aria-expanded=true]{
  background-color:var(--surface);border-color:var(--accent);outline:0;box-shadow:0 0 0 3px var(--accent-soft)}
input:disabled,select:disabled,textarea:disabled{opacity:.6}
input[type=number]{text-align:right;font-variant-numeric:tabular-nums}
.field>input[type=number],.field>.numf,td input[type=number]{max-width:160px}
.numf input,.numf input:hover,.numf input:focus{background:none;border:0;box-shadow:none}
@media (prefers-reduced-motion:reduce){input,select,textarea,.sel-btn{transition:none}}

/* compact pages: settings + accounting balances (SEGMENTS 156) ----------
   The settings menu is a slim list beside the page (no card), a row of links on narrow screens. A card whose rows
   belong to several forms (.setrows>form) keeps one line between every row. The Billing Cycle and payment forms of a
   balance open from the page head (.head-pop: a form of its own width). */
.subnav{background:none;border:0;padding:0 0 var(--sp-2);border-radius:0;border-bottom:1px solid var(--line-soft)}
@media (min-width:1000px){
  .with-subnav{grid-template-columns:184px minmax(0,1fr)}
  .subnav{padding:0;border-bottom:0}
  .subnav h2{padding:6px 10px 2px}
}
.setrows>form{margin:0}
.setrows>form>.setrow:first-child{border-top:1px solid var(--line-soft);padding-top:10px}
.setrows>form:first-child>.setrow:first-child{border-top:0;padding-top:2px}
.setrows>form>details.more{margin:0 0 var(--sp-2)}
.head-pop .pop-body{width:min(420px,calc(100vw - 32px))}
.head-pop .pop-body .form-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.alert-chat-row>summary{list-style:none;cursor:pointer}
.alert-chat-row>summary::-webkit-details-marker{display:none}
.alert-chat-row+.alert-chat-row>summary{border-top:1px solid var(--line-soft);padding-top:10px}
.alert-chat-row>.alert-chat{margin:0 0 var(--sp-3)}
.card-head>.dtabs{flex:1;margin:0;padding:0}
.steps3{display:grid;gap:var(--sp-4);grid-template-columns:minmax(0,1fr)}
@media (min-width:900px){.steps3{grid-template-columns:repeat(3,minmax(0,1fr))}}
.steps3 .step{display:flex;flex-direction:column;gap:var(--sp-2);min-width:0}
.steps3 .step>.label{font-weight:600;color:var(--text);margin:0}
.steps3 .step .notes,.steps3 .step p,.steps3 .step .btn-row{margin:0}
/* compact pages: traffic (SEGMENTS 156). New Run and a run's Edit (.run-form): parts with a small heading (.run-sect),
   fields in as many columns as the drawer or page has room for (.run-grid; the Distribution Hub's steps sit in it as
   fields), the status and affiliate tick lists side by side (.run-lists), the lead types as ticks drawn like chips
   (.chipticks), the count and Create Run held at the bottom (.savebar.run-foot). Send To in the Inject dialogs is a
   segmented choice (.dh .dh-path). */
.dh .dh-path{display:flex;flex-direction:column;align-items:flex-start;gap:0;border:0;padding:0;margin:0 0 var(--field-gap)}
.dh .dh-path .seg{margin:0}
.run-sect{padding:var(--sp-2) 0 0;border-top:1px solid var(--line-soft)}
.run-sect:first-of-type{border-top:0;padding-top:0}
.run-sect>h3{margin:0 0 var(--sp-2);color:var(--text)}
.run-grid{display:grid;gap:0 var(--sp-4);grid-template-columns:repeat(auto-fill,minmax(200px,1fr));align-items:start}
.run-grid>.dh{display:contents}
.run-grid label.field{display:flex;flex-direction:column;gap:var(--sp-1)}
.run-grid label.field>span{font-size:var(--fs-label);font-weight:600;color:var(--text-2)}
.run-grid>.run-hours{grid-column:1/-1}
.run-lists{display:grid;gap:var(--sp-3);grid-template-columns:repeat(auto-fill,minmax(240px,1fr));margin:0 0 var(--field-gap)}
.chipticks{display:flex;flex-wrap:wrap;gap:6px}
.chipticks label{display:inline-flex;align-items:center;gap:6px;min-height:var(--ctl-sm);padding:0 12px 0 9px;border:1px solid var(--line);border-radius:999px;
  background:var(--surface);color:var(--text-2);font-size:var(--fs-sm);font-weight:500;cursor:pointer}
.chipticks label:hover{border-color:var(--line-2)}
.chipticks label:has(input:checked){background:var(--accent-soft);border-color:var(--accent-line);color:var(--accent-dark)}
.run-form>.savebar.run-foot{margin:var(--sp-3) calc(-1 * var(--card-px)) calc(-1 * var(--card-pad));flex-wrap:wrap}
.run-foot .run-foot-count{display:flex;flex-direction:column;gap:2px;min-width:0}
.run-foot .run-count{margin:0}
.run-foot .btn-row{margin:0}
/* Add Global Postback: the choice at the top shows one of its three forms (without :has all three show) */
.pb-add>.pb-kind{margin:0 0 var(--sp-3)}
.pb-add:has(input[name=pb_kind][value=url]:checked) .pb-tpl,
.pb-add:has(input[name=pb_kind][value=keitaro]:checked) .pb-own,
.pb-add:has(input[name=pb_kind][value=keitaro]:checked) .pb-binom,
.pb-add:has(input[name=pb_kind][value=binom]:checked) .pb-own,
.pb-add:has(input[name=pb_kind][value=binom]:checked) .pb-keitaro{display:none}
.pb-tpl>form+form{margin-top:var(--sp-4);padding-top:var(--sp-3);border-top:1px solid var(--line-soft)}
.pb-add:has(input[name=pb_kind]:checked) .pb-tpl>form+form{margin-top:0;padding-top:0;border-top:0}
.pb-macros{margin:var(--sp-2) 0 0;gap:4px 6px}
.pb-macros .help{margin:0}
button.chip{cursor:pointer;font:inherit;font-size:var(--fs-label);line-height:1.4}
.pb-macros .chip.copied{background:var(--ok-bg);border-color:var(--ok-bg);color:var(--ok)}
.chip.mono{font-family:var(--mono)}
/* an offer's tracking links: one short line each, the address cut with its whole text in the title (Copy copies it all) */
.link-line{display:flex;align-items:center;gap:var(--sp-2);min-width:0}
.link-line code.cut{flex:1;min-width:0;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-sm)}
.wh-rows{margin:0 0 var(--field-gap)}
/* compact pages: the deal's First Deposit range, From … Below … on one line */
.dep-range{display:flex;align-items:center;gap:var(--sp-2);flex-wrap:wrap}
/* New Run's statuses and affiliates: one line like a list field that opens the searchable tick list in place */
details.pop.run-pick-pop{position:relative;display:block;width:100%}
.run-pick-pop>summary.sel-btn{width:100%}
.run-pick-pop>summary{list-style:none}
.run-pick-pop>summary::-webkit-details-marker{display:none}
.run-pick-pop>.run-picks{position:absolute;z-index:30;top:calc(100% + 4px);left:0;right:0;min-width:240px;margin:0;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:var(--sp-2) var(--sp-3);max-height:320px;overflow:auto}
/* a postback's macros: the common ones, the rest under More */
.pb-more{display:contents}
.pb-more>summary{list-style:none;cursor:pointer}
.pb-more>summary::-webkit-details-marker{display:none}
.pb-more[open]>summary{display:none}
.pb-more>.chips{display:contents}

/* batch 2: reports (owner, 3 Dec 2026): a report of several levels as a tree, each parent with its own totals and the
   rows under it indented; the Save View pop-up in the page head */
.report-tree .ind1{display:inline-block;padding-left:var(--sp-5)}
.report-tree .ind2{display:inline-block;padding-left:calc(var(--sp-5) * 2)}
.report-tree tr.parent.lvl0>td{background:var(--neutral-bg)}
.report-tree tr.lvl1:not(.parent)>td,.report-tree tr.lvl2>td{color:var(--text-2)}
@media (max-width:719px){.report-tree .ind1,.report-tree .ind2{padding-left:0}}
.pop-body.save-view-pop{width:min(300px,calc(100vw - 32px))}
@media (max-width:719px){.pop-body.save-view-pop{width:auto}}
.save-view-pop .field{margin-bottom:var(--sp-3)}
.save-view-pop .seg{display:flex}
.save-view-pop .btn-row{margin-top:0}
/* batch 2: fraud (SEGMENTS 157) ----------
   Fraud rules as setting rows (_fraud_rules.html): each check's switch and name on the left, its weight on the right;
   the total as plain digits with its unit; a brand's own rules (.fr-own) under its Use Account Rules / Own Rules choice.
   The Route Tester (box_test.html): the New Run form's parts and grid (.run-form), the result card's boxes (.rt-box).
   A Fraud Score cell that is being checked (td[data-fraud-cell][hx-get]) keeps its muted "Checking…". */
.fr-check .sr-l{flex-direction:row;align-items:center;gap:var(--sp-2)}
.fr-check .sr-l .fr-on{display:inline-flex;align-items:center}
.fr-total .sr-l>.label{margin:0;font-size:inherit;font-weight:500;color:var(--text-2)}
.fr-sum{display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;width:124px;padding:0 var(--field-px);font-weight:600}
.fr-sum .unit{color:var(--text-3);font-size:var(--fs-label);font-weight:400}
.fr-own>.setrows>.setrow:first-child{border-top:1px solid var(--line-soft);padding-top:10px}
.rt-form .seg-radio{flex-wrap:wrap}
.rt-result .card-head .small{text-align:right}
.rt-box{margin-top:var(--sp-3)}
.rt-box>h3{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;margin:0 0 var(--sp-2)}
.rt-box .rt-why{white-space:normal;min-width:200px}

/* batch 3: answers (the assistant's small tables and the list of lead emails under an answer) */
.ai-table,.ai-emails{margin-top:var(--sp-2);overflow-x:auto;max-width:100%}
.ai-table .table,.ai-emails .table{font-size:var(--fs-sm)}
.ai-emails .table td{overflow-wrap:anywhere}
.ai-emails .btn{margin-left:var(--sp-1)}
/* batch 3: human (SEGMENTS 158): Talk to a Person in the chat window, the console's Support Desk, the AI's human pacing */
.tbw-avatar.tbw-person{background:var(--accent-soft);color:var(--accent-dark);font-weight:600;font-size:var(--fs-sm);box-shadow:0 0 0 1px var(--accent-line)}
.tbw-person-form{display:contents}
.tbw-person-form.tbw-card{display:block}
.tbw-said-by{display:flex;align-items:flex-end;gap:var(--sp-2)}
.tbw-said-by .tbw-avatar{width:28px;height:28px}
.tbw-from-person .tbw-meta-line{margin-left:36px}
.desk-msgs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--sp-3)}
.desk-msg{max-width:80%;padding:var(--sp-2) var(--sp-3);border-radius:var(--radius);background:var(--surface-2);border:1px solid var(--line)}
.desk-msg.human{align-self:flex-end;background:var(--accent-soft);border-color:var(--accent-line)}
.desk-msg.system{align-self:center;background:none;border-style:dashed;color:var(--text-3)}
.desk-who{font-weight:600;font-size:var(--fs-sm);display:flex;gap:var(--sp-2);flex-wrap:wrap;align-items:baseline}
.desk-body{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:var(--sp-1)}
/* help copy (SEGMENTS 160): a Help article in the chat window (helpcenter.Section): the opening paragraph, section
   headings, numbered steps as small accent circles, bullets, an example line, Troubleshooting questions and answers,
   and a "Please Note" callout. Tokens only, so light and dark follow the theme. */
.tbw-article-page p,.tbw-hsec .tbw-steps,.tbw-hsec .tbw-bullets,.tbw-qa{font-size:var(--fs);line-height:1.6;color:var(--text-2)}
.tbw-article-page>h3{margin:0 0 var(--sp-2)}
.tbw-article-page .tbw-intro{margin:0 0 var(--sp-3);color:var(--text)}
.tbw-hsec{margin:var(--sp-5) 0 0}
.tbw-hsec>h4{margin:0 0 var(--sp-2);font-size:var(--fs-h2);font-weight:600;color:var(--text)}
.tbw-hsec>p{margin:0 0 var(--sp-2)}
.tbw-hsec .tbw-steps{list-style:none;margin:0 0 var(--sp-2);padding:0;counter-reset:tbw-step;display:flex;flex-direction:column;gap:var(--sp-2)}
.tbw-hsec .tbw-steps li{counter-increment:tbw-step;position:relative;margin:0;padding-left:calc(var(--sp-6) + var(--sp-1))}
.tbw-hsec .tbw-steps li::before{content:counter(tbw-step);position:absolute;left:0;top:1px;width:var(--sp-5);height:var(--sp-5);border-radius:50%;
  display:flex;align-items:center;justify-content:center;background:var(--accent-soft);color:var(--accent-dark);box-shadow:inset 0 0 0 1px var(--accent-line);
  font-size:var(--fs-label);font-weight:600;line-height:1}
.tbw-hsec .tbw-bullets{margin:0 0 var(--sp-2);padding-left:var(--sp-5);display:flex;flex-direction:column;gap:var(--sp-1)}
.tbw-hsec .tbw-bullets li::marker{color:var(--accent)}
.tbw-hsec strong,.tbw-article-page .tbw-intro strong{color:var(--text);font-weight:600}
.tbw-code{display:block;margin:var(--sp-1) 0 var(--sp-2);padding:var(--sp-2) var(--sp-3);border:1px solid var(--line);border-radius:var(--radius-sm);
  background:var(--surface-2);font-family:var(--mono);font-size:var(--fs-label);color:var(--text);overflow-wrap:anywhere}
.tbw-qa{margin:0;display:flex;flex-direction:column;gap:var(--sp-2)}
.tbw-qa>div{padding:var(--sp-3);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-2)}
.tbw-qa dt{margin:0 0 var(--sp-1);font-weight:600;color:var(--text)}
.tbw-qa dd{margin:0}
.tbw-qa .ai-list{margin:var(--sp-1) 0;padding-left:var(--sp-5)}
.tbw-callout{margin:0;padding:var(--sp-3);border-radius:var(--radius-sm);background:var(--accent-soft);box-shadow:inset var(--sp-1) 0 0 var(--accent)}
.tbw-callout b{display:block;margin:0 0 var(--sp-1);font-size:var(--fs-label);color:var(--accent-dark)}
.tbw-callout p{margin:0;color:var(--text)}
/* chat window B (owner, 4 Dec 2026: "B · Slick, Refined"): a floating rounded window with soft colour washes, a frosted
   floating header, Home / Messages / Help as a floating frosted tab bar at the bottom (the chosen one a solid accent pill),
   a pill-shaped composer with a gradient send button, rounded bubbles (the person's an accent gradient on the right, ours
   grey on the left), tinted suggestion pills, rounder cards. The six names of the team each have their own colour; the AI
   wears the TrackBeast emblem. Tokens of the app, light and dark (Graphite); the chat's own values sit on .tbw. */
.tbw{--tbw-r:28px;--tbw-glass:rgba(255,255,255,.72);--tbw-lift:0 8px 24px rgba(20,26,38,.10);--tbw-soft:0 4px 16px rgba(20,26,38,.06);
  --tbw-grad:linear-gradient(135deg,var(--accent),var(--accent-mid));--tbw-glow:0 4px 12px color-mix(in srgb,var(--accent) 35%,transparent)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .tbw{--tbw-glass:rgba(24,25,28,.78);--tbw-lift:0 8px 24px rgba(0,0,0,.45);--tbw-soft:0 4px 16px rgba(0,0,0,.35)}}
:root[data-theme=dark] .tbw{--tbw-glass:rgba(24,25,28,.78);--tbw-lift:0 8px 24px rgba(0,0,0,.45);--tbw-soft:0 4px 16px rgba(0,0,0,.35)}
.tbw .tbw-inner,.sg-ai-panel .tbw-inner{background:radial-gradient(120% 60% at 0% 0%,var(--accent-soft) 0%,transparent 60%),
  radial-gradient(90% 50% at 100% 0%,color-mix(in srgb,var(--accent-mid) 14%,transparent) 0%,transparent 60%),var(--surface)}
@media (min-width:720px){.ai-panel.tbw{border-radius:var(--tbw-r);box-shadow:0 24px 60px rgba(20,26,38,.18),0 0 0 1px var(--line-soft)}}
/* avatars: the AI's emblem, the team's six colours */
.tbw-avatar.sm{width:24px;height:24px;font-size:10px;border-width:0}
.tbw-avatar.sm img{width:16px}
.tbw-ai-av{background:var(--surface);box-shadow:0 0 0 1px var(--line)}
.tbw-avatar.tbw-person{color:#fff;font-weight:700;font-size:12px;box-shadow:none;border-color:var(--surface)}
.tbw-avatar.tbw-person.sm{font-size:10px}
.tbw-avatar.tbw-ag-eric{background:linear-gradient(135deg,#14b8a6,#0e7490)}
.tbw-avatar.tbw-ag-adam{background:linear-gradient(135deg,#f59e0b,#d97706)}
.tbw-avatar.tbw-ag-maria{background:linear-gradient(135deg,#f43f5e,#be123c)}
.tbw-avatar.tbw-ag-anna{background:linear-gradient(135deg,#8b5cf6,#6d28d9)}
.tbw-avatar.tbw-ag-kasper{background:linear-gradient(135deg,#22c55e,#15803d)}
.tbw-avatar.tbw-ag-mona{background:linear-gradient(135deg,#38bdf8,#2563eb)}
.tbw-avatar.tbw-ag-team{background:var(--tbw-grad,linear-gradient(135deg,var(--accent),var(--accent-mid)))}
.tbw-team{display:inline-flex;flex-shrink:0}
.tbw-team .tbw-avatar{border:2px solid var(--surface);margin-left:-8px}
.tbw-team .tbw-avatar:first-child{margin-left:0}
.tbw-team .tbw-avatar.sm{width:26px;height:26px}
/* the frosted floating header */
.tbw .tbw-head{height:auto;min-height:56px;margin:10px 10px 0;padding:6px 8px;gap:8px;border:1px solid var(--line-soft);border-radius:18px;
  background:var(--tbw-glass);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);box-shadow:0 2px 10px rgba(20,26,38,.05);position:relative;z-index:3}
.tbw .tbw-head-list{padding-left:14px}
.tbw-head-words b{font-size:14px;line-height:1.25}
.tbw-head-words span{display:flex;align-items:center;gap:5px;font-size:11.5px}
.tbw-dot-on,.tbw-dot-off{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ok);flex-shrink:0}
.tbw-dot-off{background:var(--text-3)}
.tbw .tbw-icon{width:32px;height:32px;border-radius:10px}
.tbw .tbw-icon svg{width:18px;height:18px}
.tbw-seg{margin:0;min-height:30px;font-size:12px}
.tbw-seg a{min-height:24px;padding:0 9px;font-size:12px}
/* the ⋯ menu */
.tbw-menu{position:relative}
.tbw-menu>summary{list-style:none}
.tbw-menu>summary::-webkit-details-marker{display:none}
.tbw-menu-list{position:absolute;right:0;top:calc(100% + 6px);z-index:6;width:248px;display:grid;padding:6px;background:var(--surface);
  border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg)}
.tbw-menu-list form{margin:0}
.tbw-menu-item{display:flex;align-items:center;gap:8px;width:100%;min-height:36px;padding:6px 10px;border:0;border-radius:9px;background:none;color:var(--text);
  font:inherit;font-size:13px;text-align:left;cursor:pointer;text-decoration:none}
.tbw-menu-item:hover{background:var(--surface-2);text-decoration:none}
.tbw-menu-item svg{width:16px;height:16px;color:var(--text-3);flex-shrink:0}
.tbw-menu-item span{flex:1}
.tbw-menu-item b{font-weight:600;color:var(--text-3)}
.tbw-menu-item[aria-pressed=true] b{color:var(--accent)}
/* the floating frosted tab bar at the bottom; the chosen tab a solid accent pill */
.tbw-inner>.tbw-tabs{position:absolute;left:12px;right:12px;bottom:12px;z-index:3;gap:4px;padding:4px;border:1px solid var(--line-soft);border-radius:18px;
  background:var(--tbw-glass);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);box-shadow:var(--tbw-lift)}
.tbw-inner:has(>.tbw-tabs)>.tbw-scroll{padding-bottom:84px}
.tbw .tbw-tab{padding:7px 0 6px;gap:1px;border-radius:14px;font-size:11.5px}
.tbw .tbw-tab svg{width:18px;height:18px}
.tbw .tbw-tab.on{background:var(--accent);color:var(--on-accent);box-shadow:var(--tbw-glow)}
.tbw .tbw-tab.on svg{fill:none}
.tbw .tbw-tab .tbw-count{top:2px}
.tbw .tbw-pill{bottom:84px;background:var(--tbw-grad);box-shadow:var(--tbw-glow)}
/* Home */
.tbw .tbw-hero{padding:18px 18px 14px;background:none;color:var(--text)}
.tbw .tbw-hero .tbw-x{color:var(--text-2)}
.tbw .tbw-hero .tbw-x:hover{background:var(--surface-2);color:var(--text)}
.tbw-hero .tbw-team{margin-right:4px}
.tbw-hero .tbw-ai-av.tbw-logo{width:32px;height:32px;border-radius:50%}
.tbw .tbw-hello{margin:22px 0 0;font-size:27px;letter-spacing:-.02em;color:var(--text)}
.tbw .tbw-hello span{opacity:1}
.tbw-hours{display:flex;align-items:center;gap:6px;margin:10px 0 0;font-size:12.5px;color:var(--text-3)}
.tbw .tbw-cards{margin-top:0;padding:0 14px 16px;gap:10px}
.tbw-ask{display:flex;align-items:center;gap:8px;padding:6px 6px 6px 16px;border:1px solid var(--line-soft);border-radius:999px;background:var(--surface);
  box-shadow:0 10px 28px rgba(20,26,38,.12);color:var(--text-3);text-decoration:none}
.tbw-ask:hover{text-decoration:none;color:var(--text-2)}
.tbw-ask>span:first-child{flex:1}
.tbw-ask .tbw-send{background:var(--tbw-grad);color:var(--on-accent);box-shadow:var(--tbw-glow)}
.tbw .tbw-card,.tbw-list-card{border-radius:18px;box-shadow:var(--tbw-soft),0 0 0 1px var(--line-soft)}
.tbw-list-card{background:var(--surface);overflow:hidden}
.tbw .tbw-card-btn{border-radius:18px}
.tbw-plug{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--accent-soft);color:var(--accent);flex-shrink:0}
.tbw-plug svg{width:16px;height:16px}
.tbw .tbw-find{border-radius:999px;background:var(--surface-2)}
/* Messages: Open / Archived, a row's Archive on hover (always on a touch screen) */
.tbw .tbw-list{margin:10px;padding:0;border:1px solid var(--line-soft);border-radius:18px;background:var(--surface);box-shadow:var(--tbw-soft);overflow:hidden}
.tbw-conv-row{display:flex;align-items:center;border-top:1px solid var(--line-soft)}
.tbw-conv-row:first-child{border-top:0}
.tbw-conv-row .tbw-conv{flex:1;min-width:0;padding:11px 8px 11px 14px}
.tbw-conv-act{margin:0 6px 0 0;opacity:0;transition:opacity .12s}
.tbw-conv-row:hover .tbw-conv-act,.tbw-conv-act:focus-within{opacity:1}
@media (hover:none){.tbw-conv-act{opacity:1}}
.tbw .tbw-dot{background:var(--accent)}
.tbw-center{text-align:center}
.tbw .tbw-list .tbw-empty{border:0}
/* a conversation: bubbles, notes, cards */
.tbw-stream{display:flex;flex-direction:column;gap:12px}
.tbw .tbw-bubble{border-radius:20px;padding:10px 13px}
.tbw .tbw-msg.you .tbw-bubble,.tbw .ai-said.you{background:var(--tbw-grad);border-bottom-right-radius:6px}
.tbw .tbw-msg.it .tbw-bubble{border-bottom-left-radius:6px}
.tbw .tbw-said-by{display:flex;align-items:flex-end;gap:8px;min-width:0}
.tbw .tbw-said-by .tbw-avatar{width:24px;height:24px}
.tbw-who{font-size:11px;color:var(--text-3);margin:0 0 2px 32px}
.tbw .tbw-note{background:none;padding:2px 0;max-width:100%;font-size:11.5px}
.tbw-note.tbw-sys{display:flex;align-items:center;gap:8px;align-self:stretch;white-space:nowrap}
.tbw-note.tbw-sys::before,.tbw-note.tbw-sys::after{content:"";flex:1;height:1px;background:var(--line-soft)}
.tbw-note.tbw-sys span{white-space:normal;text-align:center}
.tbw .tbw-card-row{max-width:100%;align-self:stretch;padding-left:32px}
.tbw .tbw-cardmsg,.tbw-away{border-radius:18px;border-color:var(--line-soft);box-shadow:var(--tbw-soft)}
.tbw .tbw-cardmsg .btn{border-radius:12px}
.tbw .btn.primary.tbw-btn-human,.tbw .tbw-btn-human{width:100%;justify-content:center;border:0;border-radius:12px;background:var(--tbw-grad);color:var(--on-accent);box-shadow:var(--tbw-glow)}
.tbw-human-form{margin:0}
.tbw-offer p{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--text-2)}
.tbw-away{display:grid;gap:8px;padding:11px 12px;border:1px solid var(--line);background:var(--warn-bg);color:var(--text)}
.tbw-away-head{display:flex;align-items:center;gap:8px;font-size:13px}
.tbw-away-head svg{width:16px;height:16px;color:var(--warn)}
.tbw-away p{margin:0;font-size:13px;color:var(--text-2)}
.tbw-away-opts{display:grid;gap:6px}
.tbw-away-opts .btn,.tbw-btn{width:100%;justify-content:center;border-radius:12px;background:var(--surface)}
.tbw-away-opts svg{width:15px;height:15px}
/* the rating card */
.tbw-rating{text-align:center}
.tbw-rating form{gap:10px}
.tbw-faces{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:0;padding:0;border:0;min-width:0}
.tbw-faces legend{width:100%;margin:0 0 8px;padding:0;font-weight:600;font-size:14px;color:var(--text)}
.tbw-face{cursor:pointer}
.tbw-face span[aria-hidden]{display:grid;place-items:center;width:40px;height:40px;border-radius:14px;font-size:22px;background:var(--surface-2);border:1px solid var(--line-soft)}
.tbw-face:hover span[aria-hidden]{border-color:var(--accent-line)}
.tbw-face:has(input:checked) span[aria-hidden]{background:var(--accent-soft);border-color:var(--accent)}
.tbw-face:has(input:focus-visible) span[aria-hidden]{outline:2px solid var(--accent);outline-offset:2px}
.tbw-rating textarea{width:100%;min-height:54px;border-radius:10px;font-size:13px}
/* an AI Assistant answer in the window: the emblem beside a grey bubble; a proposal keeps Apply / Undo and its credits */
.tbw .tbw-turn .ai-said.it{display:flex;align-items:flex-end;gap:8px;background:none;padding:0;border-radius:0;max-width:96%}
.tbw .tbw-turn .ai-said.it>.tbw-avatar{width:24px;height:24px}
.tbw-said-body{min-width:0;flex:1 1 auto;background:var(--tbw-grey);border-radius:20px 20px 20px 6px;padding:10px 13px}
.tbw-said-body .tbw-typing{min-height:20px}
.tbw .preview,.tbw .ai-done{border-radius:16px;border-color:var(--line-soft);box-shadow:var(--tbw-soft)}
.tbw-credits-used{margin:6px 0 0}
/* typed out (app.js): each word appears in place; a list item or table row once its first word is in */
.tbw-typing-out .tbw-w{visibility:hidden}
.tbw-typing-out .tbw-w.on{visibility:visible}
.tbw-typing-out li:not(.tbw-in),.tbw-typing-out tr:not(.tbw-in){display:none}
/* suggestions: tinted pills that send at once */
.tbw .tbw-replies{flex-direction:row;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.tbw-reply-form{margin:0}
.tbw .tbw-reply{border:0;background:var(--accent-soft);color:var(--accent-dark);font-size:13px;padding:6px 12px}
.tbw .tbw-reply:hover{background:color-mix(in srgb,var(--accent) 16%,var(--accent-soft))}
/* the composer: a pill with a gradient send button; the credits line under it */
.tbw .tbw-compose{background:transparent;padding:6px 12px calc(12px + env(safe-area-inset-bottom,0px))}
.tbw .tbw-box{display:flex;align-items:flex-end;gap:6px;border:1px solid var(--line-soft);border-radius:26px;padding:5px 5px 5px 8px;background:var(--surface);box-shadow:var(--tbw-lift)}
.tbw .tbw-box:focus-within{border-color:var(--accent-line)}
.tbw .tbw-box textarea{flex:1;min-width:0;padding:6px 2px!important}
.tbw .tbw-attach{width:30px;height:30px;border-radius:50%}
.tbw .tbw-attach:focus-within{outline:2px solid var(--accent);outline-offset:1px}
.tbw .tbw-send{width:32px;height:32px}
.tbw .tbw-box.has-words .tbw-send{background:var(--tbw-grad);box-shadow:var(--tbw-glow)}
.tbw-cred{display:flex;justify-content:flex-start;gap:8px;margin:6px 8px 0;font-size:11px;color:var(--text-3)}
.tbw-cred b{color:var(--text-2);font-weight:600}
.tbw .ai-compose-help{margin:4px 8px 0;font-size:11px}
/* the console's Support Desk: the agent's colour beside the name */
.desk-agent{display:inline-flex;align-items:center;gap:6px}
.desk-agent .tbw-avatar{width:22px;height:22px;font-size:10px;border-width:0}
.desk-face{font-size:20px;vertical-align:-3px}
.tbw .ai-compose-more{display:none}
.tbw .tbw-card-btn .tbw-lines b{white-space:normal}
.tbw-inner>.tbw-tabs{bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.tbw-inner:has(>.tbw-tabs)>.tbw-scroll{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}

/* chat window refine (owner, 4 Dec 2026): the bubble stands out on every page (filled with the accent, a ring of the
   page's colour and a deeper shadow); Open / Archived is a row of its own under the head, never squeezed by the count;
   an attachment is a chip under the box: an image's thumbnail (a click shows it large), its name and a remove button;
   a file over the limit is refused in a line of its own. */
.chat-bubble{background:var(--bubble-bg);color:var(--bubble-ink);border:2px solid var(--bg);
  box-shadow:0 0 0 1px var(--accent-line),0 8px 24px rgba(0,0,0,.32)}
.chat-bubble svg{width:22px;height:22px}
.chat-bubble:hover{background:var(--bubble-hover);border-color:var(--bg);color:var(--bubble-ink)}
.tbw-seg-row{display:flex;justify-content:center;padding:10px 12px 0;flex-shrink:0}
.tbw-seg-row .tbw-seg{flex:1;display:flex;max-width:320px}
.tbw-seg-row .tbw-seg a{flex:1;justify-content:center;white-space:nowrap}
.tbw-file{display:flex;align-items:center;gap:8px;margin:6px 8px 0;padding:5px 6px 5px 8px;border:1px solid var(--line-soft);
  border-radius:12px;background:var(--surface-2,var(--surface));font-size:12px;color:var(--text-2);max-width:100%}
.tbw-file[hidden]{display:none}
.tbw-file-thumb{width:36px;height:36px;object-fit:cover;border-radius:8px;cursor:zoom-in;flex-shrink:0;border:1px solid var(--line-soft)}
.tbw-file-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tbw-file-x{display:grid;place-items:center;width:24px;height:24px;border:0;border-radius:8px;background:transparent;color:var(--text-3);cursor:pointer;flex-shrink:0}
.tbw-file-x:hover{background:var(--line-soft);color:var(--text)}
.tbw-file-x svg{width:14px;height:14px}
.tbw-file.big{flex-wrap:wrap}
.tbw-file.big .tbw-file-thumb{order:3;width:100%;height:auto;max-height:240px;object-fit:contain;cursor:zoom-out;background:var(--bg)}
.tbw-file-err{margin:6px 10px 0;font-size:12px;color:var(--bad)}
.tbw-file-err[hidden]{display:none}
.badge.ok.live{background:var(--live-bg);color:var(--live-ink)}
/* Dashboard B "Paired Heights" (owner, 4 Dec 2026): a 12-column grid from 1100 px where the cards side by side end at
   about the same line (stretch; a card fills its cell); narrower, one column in the template's order. */
.dash-b{display:grid;gap:var(--gap);grid-template-columns:minmax(0,1fr);margin-bottom:var(--gap)}
.dash-b>div{min-width:0;display:flex;flex-direction:column}
.dash-b .card{margin-bottom:0}
.dash-b .dash-tiles{margin-bottom:0}
.dash-b .db-click{display:contents}
.db-side{gap:var(--gap)}
.db-duo{display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fit,minmax(220px,1fr));flex:1}
.db-duo>.card{min-width:0}
.db-duo .best-days{grid-template-columns:minmax(0,1fr)}
.map-ranks{min-width:0}
@media (min-width:1100px){
  .dash-b{grid-template-columns:repeat(12,minmax(0,1fr))}
  .db-tiles{grid-column:span 5}
  .db-chart{grid-column:span 7}
  .db-feed{grid-column:span 7}
  .db-side{grid-column:span 5}
  .db-map{grid-column:1/-1}
  .dash-b .dash-tiles.nine{grid-template-columns:repeat(3,minmax(0,1fr));height:100%;align-content:stretch}
  .db-chart>.card,.db-feed>.card,.db-map>.card{flex:1}
  .db-map .map-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--sp-6);align-items:center}
  .db-map .map-ranks{columns:2;column-gap:var(--sp-6)}
  .db-map .map-ranks .rank{break-inside:avoid}
  .db-map .worldmap{margin:0}
  .dash-b .dash-tiles.nine .kpi .row{flex-wrap:nowrap}
  .dash-b .dash-tiles.nine .kpi .value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dash-b .dash-tiles.nine svg.sparkline{width:48px}
  .dash-b .dash-tiles.nine .kpi .foot{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .db-chart>.card{display:flex;flex-direction:column}
  .db-chart svg.lines{flex:1;min-height:180px}
  .db-duo [data-dash=attention] .attn{max-height:340px;overflow-y:auto}
}
/* the compact filter strip (owner, 4 Dec 2026: "go with option b. and make it across the app in any filter menu"):
   every Filter panel (ui.filter_panel, the Leads page's) is a short strip: a slim head (Filters, Clear All, Apply), the
   lists side by side as columns split by hairlines (no boxes), a bold column header with "chosen / all", Select All and
   an underline-only search on one line, short lists (about five rows) that scroll inside with the chosen values on top.
   Only the panel's own inside changes; the Filter button, what is filtered and how stay as they were. */
.pop-body.filter-body{padding:0;overflow:hidden;border-radius:10px;width:min(1380px,calc(100vw - 32px))}
.pop-body.filter-body.n1{width:min(260px,calc(100vw - 32px))}
.pop-body.filter-body.n2{width:min(480px,calc(100vw - 32px))}
.pop-body.filter-body.n3{width:min(700px,calc(100vw - 32px))}
.pop-body.filter-body.n4{width:min(920px,calc(100vw - 32px))}
.filter-body .card-head{display:flex;align-items:center;gap:12px;min-height:36px;margin:0;padding:4px 10px 4px 14px;border-bottom:1px solid var(--line)}
.filter-body .card-head h2{margin:0;flex:1;font-size:13px;font-weight:650}
.filter-body .card-head .more-link{font-size:12.5px}
.filter-body .filterrow{display:grid;grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:minmax(190px,1fr);align-items:start;gap:0;margin:0;padding:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin;scroll-snap-type:none}   /* one row of a fixed height (owner, 4 Dec 2026: "make a fix height"): the columns that do not fit scroll to the right, each list scrolls up and down inside */
.filter-body .filterrow>.ticks{flex:none;border:0;border-left:1px solid var(--line);border-radius:0;background:transparent;padding:0 0 6px;margin:0;min-width:0;box-shadow:none}
.filter-body .filterrow>.ticks:first-child{border-left:0}
.filter-body .filterrow>.ticks.pinned{box-shadow:inset 0 2px 0 var(--accent);border-color:var(--line)}
.filter-body .ticks legend{float:left;width:100%;padding:8px 26px 4px 12px;font-size:13px;font-weight:650;color:var(--text);display:flex;align-items:baseline;gap:6px}
.filter-body .ticks legend .n{font:500 11.5px var(--mono);color:var(--text-3)}
.filter-body .ticks legend .n.on{color:var(--accent-dark)}
.filter-body .ticks legend+*{clear:both}
.filter-body .ticks .pin{top:6px;right:6px}
.filter-body .ticks-tools{clear:both;display:flex;align-items:center;gap:8px;padding:0 12px 6px}
.filter-body .ticks-tools .ticks-all{border:0;margin:0;padding:0;font-size:12px;flex:none}
.filter-body .ticks-tools:has(.ticks-find) .ticks-all span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.filter-body .ticks .ticks-find{flex:1;min-width:0;width:auto;min-height:0;height:24px;margin:0;padding:0 2px;font-size:12px;border:0;border-bottom:1px solid var(--line-2);border-radius:0;background:transparent;box-shadow:none}
.filter-body .ticks .ticks-find:focus{border-bottom-color:var(--accent);outline:0;box-shadow:none}
.filter-body .ticklist{clear:both;max-height:132px;padding:0 4px}
.filter-body .ticklist label{min-height:26px;padding:0 8px;gap:8px;font-size:12.5px;color:var(--text-2);border-radius:5px}
.filter-body .ticklist label:has(input:checked){order:-1;color:var(--text);font-weight:550;background:var(--accent-soft)}
.filter-body .ticklist label b{font:500 11px var(--mono)}
.filter-body input[type=checkbox],.filter-body input[type=radio]{width:13px;height:13px}
.filter-body .filters,.filter-body .advanced{margin:0;padding:10px 14px 12px;border-top:1px solid var(--line)}
@media (max-width:719px){   /* a phone keeps the lists one under the other (X-2), in a panel of a fixed height that scrolls */
  .filter-body .filterrow{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:1fr;overflow-x:hidden;overflow-y:auto;max-height:min(60vh,460px)}
  .filter-body .filterrow>.ticks{border-left:0;border-top:1px solid var(--line)}
  .filter-body .filterrow>.ticks:first-child{border-top:0}
}
.filter-body>p,.filter-body>.small{margin:0;padding:6px 14px 10px;border-top:1px solid var(--line)}
/* the Dashboard's lower half in matched pairs (owner, 4 Dec 2026: "look at this massive empty space"): Accounting across
   the page, then two cards per row that share the row's height (a taller list scrolls inside), a card left alone spans the row */
.dash-pairs{display:grid;gap:var(--gap);grid-template-columns:minmax(0,1fr);align-items:stretch;margin-bottom:var(--gap)}
.dash-pairs>.card{margin-bottom:0;min-width:0;display:flex;flex-direction:column}
.dash-pairs>.card>.table-wrap,.dash-pairs>.card>.log{flex:1}
@media (min-width:1100px){
  .dash-pairs{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .dash-pairs>.card.wide,.dash-pairs>.card:last-child:nth-child(odd of .card:not(.wide)){grid-column:1/-1}
  .dash-pairs>.card .log{max-height:420px;overflow-y:auto}
  .dash-pairs>[data-dash=caps]:not(:last-child){max-height:520px}
  .dash-pairs>[data-dash=caps]{overflow-y:auto}
  .dash-pairs>[data-dash=caps]:last-child:nth-child(odd of .card:not(.wide)){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:var(--sp-6);align-content:start}   /* across the page: the caps in two columns */
  .dash-pairs>[data-dash=caps]:last-child:nth-child(odd of .card:not(.wide))>.card-head{grid-column:1/-1}
}
/* the Settings menu: the Rail (owner, 4 Dec 2026: "option 3, and make sure to align the whole page perfectly").
   Wide screens: the account at the top (initials, name, edition and plan), the groups in small mono capitals, each a
   hairline rail whose current page carries a blue bar and a soft fill, the person's own page alone at the foot. The
   menu's first line (the account) sits on the page title's line and its column ends on the content's edge. Phones: one
   row of underline tabs, the group names as small labels between them. */
.subnav .sn-acct{display:none}
.subnav .sn-g,.subnav .sn-me{display:contents}
.subnav .sn-me .icon{display:none}
@media (min-width:1000px){
  .with-subnav{grid-template-columns:220px minmax(0,1fr);gap:var(--sp-6)}
  .subnav{display:flex;flex-direction:column;gap:0;padding:0;margin:0;border:0;background:none;position:sticky;top:calc(var(--top) + var(--sp-4))}
  .subnav .sn-acct{display:flex;align-items:center;gap:10px;height:calc(var(--ctl) + var(--gap));padding:0 2px var(--gap);border-bottom:1px solid var(--line)}   /* its line is the first card's top edge */
  .subnav .sn-av{flex:none;width:32px;height:32px;border-radius:8px;display:grid;place-items:center;background:var(--nav-on-bg);color:var(--nav-on-icon);font:600 12px var(--body);box-shadow:var(--nav-on-ring)}
  .subnav .sn-who{min-width:0;display:flex;flex-direction:column}
  .subnav .sn-who b{display:block;font-size:13.5px;font-weight:600;color:var(--text);line-height:1.3}
  .subnav .sn-who small{font-size:12px;color:var(--text-3);line-height:1.3}
  .subnav h2,.subnav h2:not(:first-child){display:block;margin:18px 0 6px;padding:0 0 0 14px;font:600 10.5px var(--mono);text-transform:uppercase;letter-spacing:.09em;color:var(--text-3)}
  .subnav .sn-g{display:flex;flex-direction:column;margin-left:2px;border-left:1px solid var(--line-2)}
  .subnav .sn-g a{display:block;margin-left:-1px;padding:6px 12px 6px 14px;border-left:2px solid transparent;border-radius:0 var(--radius-sm) var(--radius-sm) 0;color:var(--text-2);font-size:13.5px;font-weight:500;white-space:normal}
  .subnav .sn-g a:hover{background:none;color:var(--text);border-left-color:var(--line-2)}
  .subnav .sn-g a.on{color:var(--text);font-weight:600;border-left-color:var(--accent);background:linear-gradient(90deg,var(--accent-soft),transparent 80%)}
  .subnav .sn-me{display:block;margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}
  .subnav .sn-me a{display:flex;align-items:center;gap:8px;padding:6px 4px;border-radius:var(--radius-sm);color:var(--text-2);font-size:13.5px;font-weight:500}
  .subnav .sn-me a:hover{background:none;color:var(--text)}
  .subnav .sn-me a.on{color:var(--text);font-weight:600}
  .subnav .sn-me a.on .icon{color:var(--accent)}
  .subnav .sn-me .icon{display:block;width:16px;height:16px;color:var(--text-3)}
  .with-subnav .subnav-body>:first-child{margin-top:0}
  .with-subnav .subnav-body>.page-head:first-child{min-height:var(--ctl)}
  .with-subnav .subnav-body>.page-head:first-child>:is(h1,.title-row){min-height:var(--ctl);display:flex;align-items:center;margin:0}   /* every settings title takes one control's height: the menu's account line meets the first card */
  .with-subnav .subnav-body>.page-head:first-child>:is(p,.lede){line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}   /* a title's one line of words below it */
  .with-subnav:has(.subnav-body>.page-head:first-child>:is(p,.lede)) .sn-acct{height:calc(var(--ctl) + 8px + 20px + var(--gap))}   /* ...and the account line still meets the first card */
}
@media (min-width:1100px){.cols2{align-items:stretch}}   /* two cards side by side end on the same line ("align the whole page perfectly") */
@media (max-width:999px){
  .subnav{display:flex;align-items:flex-end;gap:16px;overflow-x:auto;scrollbar-width:none;margin:0 0 var(--sp-4);padding:0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none}
  .subnav h2{display:block;flex:none;align-self:center;margin:0;padding:0 0 0 10px;border-left:1px solid var(--line-2);font:600 10px var(--mono);text-transform:uppercase;letter-spacing:.08em;color:var(--text-3)}
  .subnav h2:first-of-type{padding-left:0;border-left:0}
  .subnav a,.subnav .sn-g a,.subnav .sn-me a{flex:none;padding:10px 0 9px;margin-bottom:-1px;border-radius:0;border-bottom:2px solid transparent;background:none;white-space:nowrap;color:var(--text-2);font-size:13.5px;font-weight:500}
  .subnav a:hover{background:none;color:var(--text)}
  .subnav a.on{background:none;color:var(--text);font-weight:600;border-bottom-color:var(--accent)}
}
/* the Fraud Score bands and the Check button, "Tint + Fine Ring" (owner, 4 Dec 2026): light (Frost), then dark */
:root{--fs0-bg:#d9f0e3;--fs0-ink:#11603a;--fs0-ring:#7cc5a0;--fs1-bg:#f9edbb;--fs1-ink:#5e4a05;--fs1-ring:#d9c05a;
  --fs2-bg:#fbe0c0;--fs2-ink:#7f4108;--fs2-ring:#e3a35e;--fs3-bg:#fadbd8;--fs3-ink:#941d16;--fs3-ring:#e6908a;
  --chk-bg:#eef0ff;--chk-bg-hover:#e2e5ff;--chk-ink:#3730a3;--chk-line:#c7c9fb}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--fs0-bg:#133a29;--fs0-ink:#8ee6b8;--fs0-ring:#2f7a56;
  --fs1-bg:#3a3412;--fs1-ink:#ecd877;--fs1-ring:#7d6d22;--fs2-bg:#432c16;--fs2-ink:#f9be7a;--fs2-ring:#8a5a2a;
  --fs3-bg:#46201f;--fs3-ink:#fca59d;--fs3-ring:#8c3b37;--chk-bg:#23244a;--chk-bg-hover:#2c2e5c;--chk-ink:#b4b8ff;--chk-line:#3d3f80}}
:root[data-theme=dark]{--fs0-bg:#133a29;--fs0-ink:#8ee6b8;--fs0-ring:#2f7a56;
  --fs1-bg:#3a3412;--fs1-ink:#ecd877;--fs1-ring:#7d6d22;--fs2-bg:#432c16;--fs2-ink:#f9be7a;--fs2-ring:#8a5a2a;
  --fs3-bg:#46201f;--fs3-ink:#fca59d;--fs3-ring:#8c3b37;--chk-bg:#23244a;--chk-bg-hover:#2c2e5c;--chk-ink:#b4b8ff;--chk-line:#3d3f80}
