/*! Corbel — sales dashboard for an online and in-store shop — © 2026 Hasib (OVERSHOOT). All rights reserved. Licensed to sjouglard@laboratorioena.com (order INS-2F63AC79), not sold: see LICENSE.md. */
/* =========================================================================
   CORBEL — shell + shared kit. Page styles live in css/<page>.css and are
   imported by their page module.

   Look: cool paper under a slow pastel mesh of sky, seafoam and blush.
   Cards are frosted panes (a translucent fill and a lit rim — no
   backdrop-filter on cards: the mesh is smooth enough that blur would buy
   nothing and cost a layer each). The key items are solid pastel tiles —
   sky, mint, coral, lemon — and one deep ocean tile. A dark dock floats on
   the left, an ink pill marks the page in the tabs across the top, and a
   glass row opens the pages inside a grouped tab. Urbanist carries
   everything, with tabular figures.

   Motion rule: GSAP owns every transform and opacity tween. CSS only
   transitions colour and opacity. Nothing animates layout.
   ========================================================================= */

:root {
  /* Type: the house dashboard system — Urbanist only, 500 / 600 / 700. */
  --font: 'Urbanist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: var(--font);
  --mono: var(--font);
  --fs-2xs: 11px;     /* badges, counts, chart ticks */
  --fs-xs: 12px;      /* meta, small text, table headers, pills */
  --fs-sm: 12.5px;    /* labels, card subtitles, chips, legends */
  --fs-md: 13.5px;    /* buttons, table cells, menus, toasts */
  --fs-base: 14px;    /* body */
  --fs-lg: 15px;      /* card titles */
  --fs-xl: 17px;      /* search input, section headings */
  --fs-2xl: 20px;     /* modal titles */
  --fs-3xl: 22px;     /* drawer titles, KPI figures */
  --fs-4xl: 26px;     /* large figures */
  --fs-display: 34px; /* the one hero figure on a screen */

  /* paper, mesh and panes */
  --bg: #e6ecef;
  --mesh-a: #bcd9f2; --mesh-b: #bfe6d6; --mesh-c: #f6cfc7;
  --glass: rgba(255, 255, 255, .5);
  --glass-2: rgba(255, 255, 255, .66);
  --glass-3: rgba(255, 255, 255, .86);
  --rim: rgba(255, 255, 255, .82);
  /* anything that floats above the page (menus, sheets, toasts' panels) is
     OPAQUE: legibility must never depend on backdrop-filter */
  --float: #fbfcfd;
  --panel: transparent;
  --surface: #fbfcfd;                    /* opaque: dots, rings, inner fields */
  --surface-2: rgba(255, 255, 255, .55); /* inner panels and hovers on a pane */
  --well: rgba(20, 32, 42, .06);
  --line: rgba(20, 32, 42, .09);
  --line-2: rgba(20, 32, 42, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 24px 48px -30px rgba(28, 60, 82, .3);
  --shadow-lift: 0 1px 2px rgba(20, 32, 42, .05), 0 14px 30px -16px rgba(28, 60, 82, .3);
  --shadow-pop: 0 24px 60px -18px rgba(20, 40, 56, .34), 0 2px 6px rgba(20, 40, 56, .08);

  --text: #14202a;
  --muted: #4c5a65;
  --faint: #5f6d78;

  /* ocean is the accent ("this one", links, the highlighted bar) */
  --primary: #2a6f9a;
  --primary-2: #8ec3ea;
  --primary-ink: #1d5578;
  --primary-soft: #d6e8f5;
  --on-primary: #ffffff;
  --ink-btn: #14202a; --on-ink-btn: #f3f7f8;
  --pill: #14202a;    --on-pill: #f3f7f8;
  --dock: #14202a;    --on-dock: #f3f7f8;

  /* solid tiles for the key items: pastel fills read ink on top, in both themes */
  --sky: #a9d2f1; --mint: #a7e1ca; --coral: #f6b4a3; --lemon: #f1e08f;
  --ocean: #1f4d6a; --on-ocean: #f3f7f8;
  --oc-1: #a9d2f1; --oc-2: #a7e1ca; --oc-3: #f1e08f;   /* accents on the deep tile */
  --sat: 1;   /* hue-tinted avatars and product tiles: 0 turns them grey */
  --on-tile: #14202a;

  /* chart series: ocean, sky, sea-green, coral, amber */
  --c1: #2a6f9a; --c2: #8ec3ea; --c3: #2f9a7e; --c4: #df7659; --c5: #cf9426;
  --hatch: rgba(42, 111, 154, .22);
  --hatch-bg: rgba(42, 111, 154, .05);
  --heat-0: #e3ebef; --heat-1: #cbe1f0; --heat-2: #98c5e5; --heat-3: #5a9bc8; --heat-4: #2a6f9a;

  --up: #22735c; --up-soft: #d5eee4;
  --down: #b1412a; --down-soft: #f8e1da;
  --warn: #85580a; --warn-soft: #f5ead2;
  --sea: #1b6e78; --sea-soft: #d3ecee;

  --r-xs: 8px;
  --r-sm: 14px;
  --r: 22px;
  --r-lg: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Shell geometry: the dock floats at --dock-x; content starts one gutter
     after it. --side-w is how far fixed page bars (bulk actions, unsaved
     changes) start from the left; --tabbar-h is what the bottom dock takes
     on tablets and phones. On very wide screens the frame stops at --app-max. */
  --dock-x: 20px; --dock-w: 60px;
  --gut: clamp(16px, 1.6vw, 28px);
  --app-max: 1840px;
  --side-w: calc(var(--dock-x) + var(--dock-w));
  --tabbar-h: 0px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c1216;
  --mesh-a: rgba(70, 140, 200, .32); --mesh-b: rgba(46, 160, 128, .24); --mesh-c: rgba(230, 120, 95, .15);
  --glass: rgba(255, 255, 255, .05);
  --glass-2: rgba(255, 255, 255, .085);
  --glass-3: #1d272e;
  --rim: rgba(255, 255, 255, .075);
  --float: #1a242b;
  --surface: #172129;
  --surface-2: rgba(255, 255, 255, .06);
  --well: rgba(255, 255, 255, .065);
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 48px -30px rgba(0, 0, 0, .7);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 32px -16px rgba(0, 0, 0, .75);
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08);

  --text: #e8eef1;
  --muted: #a7b3bb;
  --faint: #8d9aa3;

  --primary: #79b6e3;
  --primary-2: #a9d2f1;
  --primary-ink: #a9d2f1;
  --primary-soft: rgba(121, 182, 227, .15);
  --on-primary: #0c1216;
  --ink-btn: #e8eef1; --on-ink-btn: #0f171c;
  --pill: #e8eef1;    --on-pill: #0f171c;
  --dock: rgba(255, 255, 255, .08); --on-dock: #e8eef1;
  --ocean: #24597a;

  --c1: #79b6e3; --c2: #b8daf3; --c3: #5fcaa8; --c4: #f09a82; --c5: #e7b552;
  --hatch: rgba(140, 195, 235, .26);
  --hatch-bg: rgba(140, 195, 235, .06);
  --heat-0: #172128; --heat-1: #1d3a50; --heat-2: #27597b; --heat-3: #3e83b4; --heat-4: #8ec3ea;

  --up: #6fd3b0; --up-soft: rgba(111, 211, 176, .13);
  --down: #f2937c; --down-soft: rgba(242, 147, 124, .13);
  --warn: #e8bd62; --warn-soft: rgba(232, 189, 98, .13);
  --sea: #6ccbd3; --sea-soft: rgba(108, 203, 211, .13);
  color-scheme: dark;
}

/* ── palettes ─────────────────────────────────────────────────────────
   The tokens above are the Pastel palette. A palette is chosen in Settings →
   Appearance and lands on <html data-palette> before first paint (index.html).
   Mono — black and white — is the default. Every palette keeps the meaning
   colours (up, down, attention) so a status never depends on the palette.
   The four tile slots keep their names (sky, mint, lemon, coral) whatever
   colour a palette pours into them. */

/* Mono: paper and ink. The key tile is solid ink (paper in dark mode); the
   rest step down through greys. */
:root[data-palette="mono"] {
  --bg: #efefed;
  --mesh-a: #e1e1de; --mesh-b: #f9f9f7; --mesh-c: #e6e6e3;
  --glass: rgba(255, 255, 255, .64); --glass-2: rgba(255, 255, 255, .78); --glass-3: rgba(255, 255, 255, .94);
  --rim: rgba(255, 255, 255, .92);
  --float: #fcfcfb; --surface: #fcfcfb;
  --well: rgba(17, 17, 17, .06); --line: rgba(17, 17, 17, .09); --line-2: rgba(17, 17, 17, .17);
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 22px 44px -30px rgba(0, 0, 0, .22);
  --text: #121212; --muted: #4f4f4c; --faint: #636360;
  --primary: #121212; --primary-2: #a3a39e; --primary-ink: #121212; --primary-soft: #e4e4e1; --on-primary: #ffffff;
  --pill: #121212; --on-pill: #f6f6f4; --ink-btn: #121212; --on-ink-btn: #f6f6f4; --dock: #121212; --on-dock: #f6f6f4;
  --sky: #121212; --mint: #ffffff; --lemon: #e2e2de; --coral: #d2d2cd;
  --ocean: #121212; --oc-1: #ffffff; --oc-2: #8e8e89; --oc-3: #cfcfca;
  --c1: #121212; --c2: #b4b4af; --c3: #6a6a66; --c4: #8e8e89; --c5: #c8c8c3;
  --hatch: rgba(0, 0, 0, .16); --hatch-bg: rgba(0, 0, 0, .035);
  --heat-0: #e8e8e5; --heat-1: #d0d0cc; --heat-2: #a6a6a1; --heat-3: #696965; --heat-4: #121212;
  --sea: #3f3f3c; --sea-soft: #e4e4e1;
  --sat: 0;
}
:root[data-palette="mono"][data-theme="dark"] {
  --bg: #0b0b0b;
  --mesh-a: rgba(255, 255, 255, .05); --mesh-b: rgba(255, 255, 255, .025); --mesh-c: rgba(255, 255, 255, .035);
  --glass: rgba(255, 255, 255, .045); --glass-2: rgba(255, 255, 255, .08); --glass-3: #202020;
  --rim: rgba(255, 255, 255, .075);
  --float: #1a1a1a; --surface: #161616;
  --well: rgba(255, 255, 255, .065); --line: rgba(255, 255, 255, .085); --line-2: rgba(255, 255, 255, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 48px -30px rgba(0, 0, 0, .8);
  --text: #ededeb; --muted: #a9a9a5; --faint: #8e8e8a;
  --primary: #ededeb; --primary-2: #6c6c68; --primary-ink: #ffffff; --primary-soft: rgba(255, 255, 255, .1); --on-primary: #111111;
  --pill: #ededeb; --on-pill: #111111; --ink-btn: #ededeb; --on-ink-btn: #111111; --dock: rgba(255, 255, 255, .08); --on-dock: #ededeb;
  /* ink inverts to paper: the key tile is the brightest thing on the page */
  --sky: #f0f0ee; --mint: #d6d6d2; --lemon: #c2c2bd; --coral: #ababa6;
  --ocean: #222222;
  --c1: #ededeb; --c2: #6c6c68; --c3: #a9a9a5; --c4: #8e8e8a; --c5: #c4c4bf;
  --hatch: rgba(255, 255, 255, .2); --hatch-bg: rgba(255, 255, 255, .04);
  --heat-0: #1a1a1a; --heat-1: #2e2e2e; --heat-2: #4c4c4a; --heat-3: #8a8a86; --heat-4: #ededeb;
  --sea: #c4c4bf; --sea-soft: rgba(255, 255, 255, .1);
}

/* Ocean: blues and aqua over the pastel base */
:root[data-palette="ocean"] {
  --bg: #e4ebf0;
  --mesh-a: #b4d3ef; --mesh-b: #b6e2e6; --mesh-c: #cfe0f3;
  --sky: #9fcbef; --mint: #9fdce0; --lemon: #cfe3f5; --coral: #8fc6d6;
  --ocean: #173f5f; --oc-1: #9fcbef; --oc-2: #9fdce0; --oc-3: #ffffff;
}
:root[data-palette="ocean"][data-theme="dark"] {
  --bg: #0a1118; --mesh-a: rgba(60, 130, 200, .34); --mesh-b: rgba(40, 160, 170, .24); --mesh-c: rgba(90, 140, 210, .16);
  --ocean: #1e4c70;
}
/* Sage: greens and sand */
:root[data-palette="sage"] {
  --bg: #e9ebe4;
  --mesh-a: #cfe3c8; --mesh-b: #e6e2c6; --mesh-c: #c9e2d6;
  --primary: #2f6b4f; --primary-2: #9ccdb2; --primary-ink: #245640; --primary-soft: #dcede3;
  --sky: #bfe0c4; --mint: #a9dcc6; --lemon: #ece2a8; --coral: #e9c9a7;
  --ocean: #234a3a; --oc-1: #bfe0c4; --oc-2: #ece2a8; --oc-3: #ffffff;
  --c1: #2f6b4f; --c2: #9ccdb2; --c3: #5c9a3e; --c4: #d0864f; --c5: #c79a2a;
  --hatch: rgba(47, 107, 79, .22); --hatch-bg: rgba(47, 107, 79, .05);
  --heat-0: #e5ebe3; --heat-1: #cfe5d6; --heat-2: #9fcbb0; --heat-3: #5f9e7c; --heat-4: #2f6b4f;
}
:root[data-palette="sage"][data-theme="dark"] {
  --bg: #0c120f; --mesh-a: rgba(80, 160, 110, .28); --mesh-b: rgba(200, 180, 90, .14); --mesh-c: rgba(60, 150, 130, .2);
  --primary: #8fd1ad; --primary-2: #b9e3c8; --primary-ink: #b9e3c8; --primary-soft: rgba(143, 209, 173, .15);
  --ocean: #2a5845;
  --c1: #8fd1ad; --c2: #c9e8d3; --c3: #a6d36f; --c4: #f0a576; --c5: #e7c159;
  --hatch: rgba(150, 215, 175, .26); --hatch-bg: rgba(150, 215, 175, .06);
  --heat-0: #151d18; --heat-1: #1d3a2b; --heat-2: #295c43; --heat-3: #3f8d64; --heat-4: #8fd1ad;
}

/* the swatch that shows each palette in Settings (four tile colours) */
.pal { display: flex; flex-wrap: wrap; gap: 10px; }
.pal__opt {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 6px; border-radius: 999px;
  background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-md); font-weight: 600; color: var(--muted);
  transition: box-shadow .2s, color .2s;
}
.pal__opt:hover { color: var(--text); }
.pal__opt[aria-checked="true"] { color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.pal__sw { display: grid; grid-template-columns: 1fr 1fr; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); flex: none; }
.pal__sw i { display: block; }

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 500 var(--fs-base)/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--sky); color: var(--on-tile); }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-weight: 600; letter-spacing: .01em; } /* ids (orders, SKUs): tabular, set apart by weight */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--pill); color: var(--on-pill); font-weight: 600; }
.skip:focus { top: 12px; }
.up { color: var(--up); } .down { color: var(--down); }

/* the mesh — three soft fields that drift (transform only, one GSAP tween each) */
.mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mesh i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .95; will-change: transform; }
.mesh__a { width: 62vmax; height: 62vmax; left: -18vmax; top: -24vmax; background: radial-gradient(closest-side, var(--mesh-a), transparent); }
.mesh__b { width: 70vmax; height: 70vmax; right: -24vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--mesh-b), transparent); }
.mesh__c { width: 46vmax; height: 46vmax; right: 8vmax; top: -16vmax; background: radial-gradient(closest-side, var(--mesh-c), transparent); }

/* load gate: the shell is hidden until main.ts plays the entrance */
html.js:not(.failsafe) .app { visibility: hidden; }
html.js.ready .app { visibility: visible; }

/* ── shell ────────────────────────────────────────────────────────────── */
/* Nothing inside the app may widen the page: `clip` cuts it off without
   making a scroll container, so sticky and window scrolling keep working. */
.app {
  overflow-x: hidden; overflow-x: clip;
  max-width: var(--app-max); margin: 0 auto;
  padding: 22px var(--gut) 40px calc(var(--dock-x) + var(--dock-w) + var(--gut));
}
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; border-radius: 14px; }
.brand__mark {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--pill); color: var(--on-pill);
}
.brand__mark .ico { width: 20px; height: 20px; }
.brand__txt { display: grid; line-height: 1.2; min-width: 0; }
.brand__txt b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__txt small { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }

/* top tabs: one row on desktop, a scrolling strip below 1081px */
.tabs {
  justify-self: center; min-width: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: none; border-radius: 999px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--rim);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__track { position: relative; display: flex; gap: 2px; padding: 4px; width: max-content; }
.tab, .tabs__pill > span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px;
  font-size: var(--fs-md); font-weight: 600; white-space: nowrap;
}
.tab { position: relative; z-index: 1; color: var(--text); transition: background-color .2s; }
.tab:hover { background: var(--well); }
.tab[aria-current]:hover { background: none; }
.tabs__pill {
  position: absolute; inset: 0; z-index: 2; display: flex; gap: 2px; padding: 4px;
  background: var(--pill); color: var(--on-pill); pointer-events: none; opacity: 0;
}
.tab__count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--well); color: inherit;
  font-size: var(--fs-2xs); font-weight: 700; line-height: 16px; text-align: center;
}
.tab__count:empty { display: none; }
.tabs__pill .tab__count { background: rgba(255, 255, 255, .18); }
:root[data-theme="dark"] .tabs__pill .tab__count { background: rgba(0, 0, 0, .12); }

.top__tools { display: flex; align-items: center; gap: 10px; justify-self: end; }
.team { display: flex; padding: 0 4px; }
.team .av { position: relative; margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.team .av:nth-child(1) { z-index: 4; } .team .av:nth-child(2) { z-index: 3; } .team .av:nth-child(3) { z-index: 2; }
.me { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; padding: 2px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--rim); }
.me .av { width: 38px; height: 38px; }
.bell__dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 2px var(--bg); }

/* the dock: a dark pill floating at the left edge, centred with auto margins
   (never translateY — GSAP owns its transform) */
.dock {
  position: fixed; z-index: 30;
  left: max(var(--dock-x), calc((100vw - var(--app-max)) / 2 + var(--dock-x)));
  top: 0; bottom: 0; margin: auto 0; height: fit-content;
  display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 999px;
  background: var(--dock); color: var(--on-dock); box-shadow: 0 20px 40px -18px rgba(10, 20, 30, .5);
}
:root[data-theme="dark"] .dock { -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 1px var(--line), 0 20px 40px -18px rgba(0, 0, 0, .6); }
.dock__btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; opacity: .74; transition: opacity .2s, background-color .2s; }
.dock__btn:hover, .dock__btn:focus-visible, .dock__btn[aria-current="page"] { opacity: 1; background: rgba(255, 255, 255, .13); }
.dock__btn:focus-visible { outline-color: var(--on-dock); }
.dock__btn[aria-current="page"]::after { content: ''; position: absolute; right: 3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--mint); }
.dock__upgrade .ico { color: var(--lemon); }
.dock__sep { height: 1px; margin: 4px 10px; background: rgba(255, 255, 255, .14); }
.dock__count {
  position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--coral); color: var(--on-tile); font-size: var(--fs-2xs); font-weight: 700; line-height: 18px; text-align: center;
}
.dock__count:empty { display: none; }
.dock__tip {
  position: absolute; left: calc(100% + 14px); top: 0; bottom: 0; margin: auto 0; height: fit-content;
  padding: 6px 10px; border-radius: 10px; background: var(--float); color: var(--text); box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .18s var(--ease);
}
.dock__tip kbd { margin-left: 4px; }
.dock__btn:hover .dock__tip, .dock__btn:focus-visible .dock__tip { opacity: 1; }

.main { position: relative; min-width: 0; outline: none; }

/* page head: the title, the glass sub-tab row of a grouped tab, live shoppers */
.head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px clamp(20px, 2.4vw, 36px); margin-bottom: 20px; min-height: 48px; }
.head__title { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.04; font-weight: 600; letter-spacing: -.025em; outline: none; white-space: nowrap; }
.head__title .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.head__title .ch { display: inline-block; }

.subtabs {
  min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: 999px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--rim), var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs__track { position: relative; display: flex; gap: 2px; padding: 4px; width: max-content; }
.subtab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 999px;
  color: var(--muted); font-size: var(--fs-md); font-weight: 600; white-space: nowrap; transition: color .2s;
}
.subtab:hover, .subtab[aria-current] { color: var(--text); }
.subtabs__pill {
  position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none;
  background: var(--glass-3);
}
:root[data-theme="dark"] .subtabs__pill { background: rgba(255, 255, 255, .14); }

.live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px 0 12px; border-radius: 999px;
  background: var(--mint); color: var(--on-tile);
  font-size: var(--fs-md); font-weight: 600;
}
.live__dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live__dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid currentColor; opacity: 0;
  animation: ping 2.2s cubic-bezier(.2, .6, .3, 1) infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .9; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.live__n { display: inline-flex; height: 1.3em; overflow: hidden; line-height: 1.3; }
.odo { display: inline-block; width: .6em; height: 1.3em; overflow: hidden; text-align: center; } /* Urbanist has no tabular figures: fixed, centred columns */
.odo__strip { display: flex; flex-direction: column; }
.odo__strip span { height: 1.3em; }
.live__label { font-weight: 500; }

.views { }
.view { display: flex; flex-direction: column; gap: 16px; }

/* ── avatars ──────────────────────────────────────────────────────────── */
.av {
  --h: 206;
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: hsl(var(--h) calc(62% * var(--sat)) 88%);
  color: hsl(var(--h) calc(45% * var(--sat)) 24%);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em;
}
.av--sm { width: 28px; height: 28px; font-size: var(--fs-2xs); }
.av--lg { width: 56px; height: 56px; font-size: 18px; }
.av--more { background: var(--glass-3); color: var(--muted); }
:root[data-theme="dark"] .av:not(.av--more) { background: hsl(var(--h) calc(32% * var(--sat)) 28%); color: hsl(var(--h) calc(80% * var(--sat)) 88%); }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  background: var(--glass-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-weight: 600; font-size: var(--fs-md); white-space: nowrap;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.btn:hover { background: var(--glass-3); }
.btn .ico { width: 16px; height: 16px; }
.btn--primary, .btn--dark { background: var(--pill); color: var(--on-pill); box-shadow: none; }
.btn--primary:hover, .btn--dark:hover { background: color-mix(in srgb, var(--pill) 84%, var(--primary)); }
.btn--ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn--ghost:hover { background: var(--well); color: var(--text); }
.btn--danger { color: var(--down); }
.btn--sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
/* disabled reads as unavailable, not as a faded version of its colour */
.btn[disabled], .btn[aria-disabled="true"] { background: var(--well); color: var(--faint); box-shadow: none; cursor: not-allowed; }
.icon-btn {
  position: relative;
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--muted);
  transition: background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--well); color: var(--text); }
.ibtn {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .2s;
}
.ibtn--glass { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--rim); }
.ibtn:hover { background: var(--glass-3); }
.ibtn[aria-expanded="true"] { background: var(--pill); color: var(--on-pill); }
.link-btn { color: var(--primary-ink); font-weight: 600; font-size: var(--fs-sm); }
.link-btn:hover { text-decoration: underline; }
.more-link { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.more-link .ico { display: none; }
.more-link { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.more-link:hover { text-decoration-color: currentColor; color: var(--primary-ink); }

/* ── segmented control: equal columns, GSAP slides the pill ───────────── */
.seg {
  position: relative;
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 3px; border-radius: 999px;
  background: var(--well);
}
.seg__pill {
  position: absolute; left: 3px; top: 3px; bottom: 3px;
  border-radius: 999px;
  background: var(--glass-3);
  box-shadow: 0 2px 8px rgba(20, 40, 56, .1);
  pointer-events: none;
}
:root[data-theme="dark"] .seg__pill { background: rgba(255, 255, 255, .14); }
.seg button {
  position: relative; z-index: 1;
  height: 32px; padding: 0 14px;
  border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  transition: color .2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--text); }
.seg--sm button { height: 28px; padding: 0 11px; font-size: var(--fs-xs); }

/* ── cards: frosted panes ─────────────────────────────────────────────── */
.card {
  position: relative;
  border-radius: var(--r);
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--rim), var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 32px; }
.card__title { display: flex; align-items: center; gap: 6px; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.005em; }
/* card titles are words, not icon + words: the icon added nothing */
.card__title > svg.ico:first-child { display: none; }
.card__title .ico { width: 15px; height: 15px; color: var(--faint); }
.card__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__sub { color: var(--muted); font-size: var(--fs-sm); }

/* Solid tiles. A tile re-points the tokens its contents read, so every
   label, figure, chip and chart inside it stays legible without a rule of
   its own — and the pastel tiles stay pastel (ink on top) in dark mode. */
.tile--sky, .tile--mint, .tile--coral, .tile--lemon, .statbar > :first-child {
  --text: #14202a; --muted: rgba(20, 32, 42, .76); --faint: rgba(20, 32, 42, .7);
  --well: rgba(20, 32, 42, .08); --line: rgba(20, 32, 42, .12); --line-2: rgba(20, 32, 42, .2);
  --surface: rgba(255, 255, 255, .7); --surface-2: rgba(255, 255, 255, .4);
  --up: #1b5e4a; --up-soft: rgba(255, 255, 255, .55); --down: #8f3220; --down-soft: rgba(255, 255, 255, .55);
  --primary: #14202a; --primary-ink: #14202a; --c1: #14202a; --c2: rgba(20, 32, 42, .32); --c3: #14202a;
  --rim: rgba(255, 255, 255, .4);
  color: var(--text);
}
.tile--sky { background: var(--sky); } .tile--mint { background: var(--mint); }
.tile--coral { background: var(--coral); } .tile--lemon { background: var(--lemon); }
:is(.tile--ocean),
:root[data-palette="mono"]:not([data-theme="dark"]) :is(.tile--sky, .statbar > :first-child) {
  --text: #f3f7f8; --muted: rgba(243, 247, 248, .78); --faint: rgba(243, 247, 248, .7);
  --well: rgba(255, 255, 255, .12); --line: rgba(255, 255, 255, .14); --line-2: rgba(255, 255, 255, .24);
  --surface: var(--ocean); --surface-2: rgba(255, 255, 255, .08);
  --up: #8fe3c4; --up-soft: rgba(143, 227, 196, .16); --down: #ffb3a1; --down-soft: rgba(255, 179, 161, .16);
  --primary: #f3f7f8; --primary-ink: #f3f7f8; --c1: var(--oc-1); --c2: var(--oc-2); --c4: var(--oc-3);
  --rim: rgba(255, 255, 255, .1);
  background: var(--ocean); color: var(--text); box-shadow: none;
}
:root[data-theme="dark"] .tile--ocean { --surface: var(--ocean); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar__end { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* stat tile: label, figure, delta */
.stat { display: grid; gap: 6px; }
.stat__label { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.stat__val { font-size: var(--fs-4xl); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.stat__meta { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: var(--fs-sm); }

.delta {
  display: inline-flex; align-items: center; gap: 2px;
  height: 20px; padding: 0 7px 0 5px; border-radius: 999px;
  background: var(--up-soft); color: var(--up);
  font-size: var(--fs-2xs); font-weight: 700;
}
.delta .ico { width: 12px; height: 12px; stroke-width: 2.4; }
.delta.is-down { background: var(--down-soft); color: var(--down); }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--well); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--plain::before { display: none; }
.pill--blue { background: var(--primary-soft); color: var(--primary-ink); }
.pill--mint { background: var(--up-soft); color: var(--up); }
.pill--amber { background: var(--warn-soft); color: var(--warn); }
.pill--coral { background: var(--down-soft); color: var(--down); }
.pill--sea { background: var(--sea-soft); color: var(--sea); }
.pill--gray { background: var(--well); color: var(--muted); }

/* progress bar: GSAP scales the fill (scaleX), never its width */
.meter { height: 7px; border-radius: 99px; background: var(--well); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: var(--primary); transform-origin: 0 50%; }

/* ── tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; border-radius: 0 0 var(--r) var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th {
  position: sticky; top: 0;
  padding: 10px 14px; text-align: left;
  font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap;
  background: var(--surface-2);
  border-block: 1px solid var(--line);
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr[data-href], .table tr[data-id] { cursor: pointer; }
.table .num { text-align: right; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main b { font-weight: 600; }
.cell-main small { display: block; color: var(--faint); font-size: var(--fs-xs); }
th button.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font-weight: inherit; }
th button.sort .ico { width: 12px; height: 12px; opacity: .5; }
th button.sort[aria-sort] .ico { opacity: 1; color: var(--primary); }

/* ── form controls ────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  height: 40px; padding: 0 14px;
  border: 0; border-radius: 14px;
  background: var(--glass-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--text);
  transition: box-shadow .2s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--text); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 13px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 36px; border-radius: 999px; }

/* toggle switch: a real checkbox, the knob slides by transform */
.switch { position: relative; display: inline-flex; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch__track { width: 100%; height: 100%; border-radius: 99px; background: var(--line-2); transition: background-color .25s; }
.switch__knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
.switch input:checked ~ .switch__track { background: var(--c3); }
.switch input:checked ~ .switch__knob { transform: translateX(16px); }
.switch input:focus-visible ~ .switch__track { outline: 2px solid var(--text); outline-offset: 2px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink-btn); margin: 0; }

/* chips used as filters */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 999px;
  background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--pill); color: var(--on-pill); box-shadow: none; }

.empty { display: grid; place-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--muted); }
.empty b { color: var(--text); font-weight: 600; }

kbd {
  font: 600 var(--fs-2xs) var(--font);
  padding: 2px 7px; border-radius: 7px;
  background: var(--glass-2); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

/* ── floating layers (opaque) ─────────────────────────────────────────── */
.pop {
  position: fixed; z-index: 60;
  width: min(360px, calc(100vw - 24px));
  border-radius: var(--r);
  background: var(--float);
  box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.pop__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop__head b { font-weight: 700; font-size: var(--fs-base); }
.pop__list { max-height: 380px; overflow-y: auto; }
.pop__list li { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pop__list li:last-child { border-bottom: 0; }
.pop__list li.is-unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.pop__list .n-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--well); color: var(--primary); }
.pop__list .n-ico .ico { width: 16px; height: 16px; }
.pop__list p { font-size: var(--fs-md); }
.pop__list small { color: var(--faint); font-size: var(--fs-xs); }

dialog { padding: 0; border: 0; color: var(--text); background: none; max-width: none; max-height: none; }
/* the page behind a dialog goes soft — one full-screen backdrop-filter, only
   while a dialog is open */
dialog::backdrop { background: rgba(14, 24, 32, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
:root[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .58); }

.finder { margin: 12vh auto auto; width: min(620px, calc(100vw - 24px)); }
.finder__box { border-radius: 24px; background: var(--float); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); overflow: hidden; }
.finder__field { display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 58px; border-bottom: 1px solid var(--line); color: var(--faint); }
.finder__field input { flex: 1; border: 0; background: none; outline: none; font-size: var(--fs-xl); color: var(--text); }
.finder__list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.finder__group { padding: 10px 10px 4px; font-size: var(--fs-2xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.finder__hit { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 14px; cursor: pointer; }
.finder__hit[aria-selected="true"] { background: var(--well); }
.finder__hit .lead { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--well); color: var(--muted); flex: none; }
.finder__hit .lead .ico { width: 16px; height: 16px; }
.finder__hit b { font-weight: 600; }
.finder__hit small { margin-left: auto; color: var(--faint); font-size: var(--fs-xs); }

.modal { margin: auto; width: min(520px, calc(100vw - 24px)); }
.modal__box { border-radius: 26px; background: var(--float); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 20px 22px 0; }
.modal__head h2 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.015em; }
.modal__head .icon-btn { margin-left: auto; }
.modal__body { padding: 16px 22px; display: grid; gap: 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 22px; }

/* the side sheet floats inside the window, like a drawer card */
.sheet { margin: 12px 12px 12px auto; height: calc(100dvh - 24px); width: min(460px, calc(100vw - 24px)); }
.sheet__box { height: 100%; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: var(--float); box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); }
.sheet__head { display: flex; align-items: center; gap: 10px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.sheet__head h2 { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.02em; }
.sheet__head .icon-btn { margin-left: auto; }
.sheet__body { flex: 1; overflow-y: auto; padding: 22px; display: grid; align-content: start; gap: 18px; }
.sheet__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); }

.toasts { position: fixed; z-index: 90; right: 18px; bottom: calc(var(--tabbar-h) + 18px); display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: min(400px, calc(100vw - 36px));
  padding: 10px 16px 10px 10px; border-radius: 999px;
  background: var(--pill); color: var(--on-pill);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-md); font-weight: 600;
  pointer-events: auto;
}
.toast__ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: var(--on-tile); flex: none; }
.toast__ico .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.toast button { margin-left: 6px; color: inherit; font-weight: 700; text-decoration: underline; }

.float-up { position: fixed; z-index: 70; pointer-events: none; font-weight: 700; font-size: var(--fs-md); color: var(--up); }

/* product tile: colour + monogram */
.thumb {
  --h: 200; --s: 40px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: calc(var(--s) * .3);
  background: hsl(var(--h) calc(52% * var(--sat)) 85%);
  color: hsl(var(--h) calc(42% * var(--sat)) 24%);
  font-size: calc(var(--s) * .32); font-weight: 700; letter-spacing: .02em;
}
:root[data-theme="dark"] .thumb { background: hsl(var(--h) calc(30% * var(--sat)) 28%); color: hsl(var(--h) calc(75% * var(--sat)) 88%); }
.modal.is-wide { width: min(760px, calc(100vw - 24px)); }
.sheet.is-wide { width: min(640px, calc(100vw - 24px)); }

/* theme switch: the new theme wipes in as a circle from the button (main.ts) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ── display type: every headline figure and page-level heading ─────────── */
.stat__val, .db-gauge__c b, .db-donut__c b, .an-main__total b, .an-split__pcts b, .an-donut__mid b,
.cus-hero__val, .cus-hero__name, .em-mail__hero h3, .hlp-hero h2, .hlp-article__title, .prd-sh__big {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.02em;
}

/* ── stat strip: the one way a page shows its headline figures ───────────
   A row of panes; the first — the page's key figure — is a solid tile in
   the page's own pastel (--tile, set per view below).
   <section class="card statbar" style="--n:4">
     <div class="stat"><p class="stat__label">…</p><p class="stat__val">…</p><p class="stat__meta">…</p></div> … */
.statbar { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 16px; padding: 0; background: none; box-shadow: none; }
.statbar > * { padding: 18px 20px; min-width: 0; border-radius: var(--r); background: var(--glass); box-shadow: inset 0 0 0 1px var(--rim), var(--shadow); }
.statbar > :first-child { background: var(--tile, var(--sky)); box-shadow: none; }
[data-view="orders"] { --tile: var(--sky); }
[data-view="products"] { --tile: var(--lemon); }
[data-view="customers"] { --tile: var(--coral); }
[data-view="analytics"] { --tile: var(--mint); }
[data-view="automations"] { --tile: var(--sky); }
[data-view="email"] { --tile: var(--coral); }
[data-view="integrations"] { --tile: var(--mint); }
[data-view="feedback"] { --tile: var(--lemon); }
@media (max-width: 1100px) {
  .statbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 560px) {
  .statbar { gap: 10px; }
  .statbar > * { padding: 16px; }
  .statbar .stat__val { font-size: var(--fs-3xl); }
}

/* tables on phones: mark low-priority cells with .t-opt and they step aside */
@media (max-width: 560px) { .table .t-opt { display: none; } }

/* Touch screens have no hover: a tapped tab must not keep its hover tint */
@media (hover: none) {
  .tab:hover, .ibtn:hover, .table tbody tr:hover { background: none; }
  .ibtn--glass:hover { background: var(--glass-2); }
  .dock__btn:hover:not([aria-current]) { background: none; opacity: .74; }
  .dock__btn:hover .dock__tip { opacity: 0; }
}

/* ══ responsive shell ════════════════════════════════════════════════════
   Desktop keeps the seven tabs in one row next to the brand. Below 1081px
   (tablets, small laptops, phones) the tabs become a scrolling strip on
   their own row and the dock becomes a bar at the bottom, in thumb reach. */
@media (max-width: 1280px) {
  .team { display: none; }
  .brand__txt small { display: none; }
}
@media (max-width: 1080px) {
  :root { --side-w: 0px; --tabbar-h: calc(80px + env(safe-area-inset-bottom)); }
  .app { padding: max(16px, env(safe-area-inset-top)) max(var(--gut), env(safe-area-inset-right)) calc(var(--tabbar-h) + 24px) max(var(--gut), env(safe-area-inset-left)); }
  .top { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; margin-bottom: 18px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .top__tools { grid-column: 2; grid-row: 1; }
  .dock {
    left: 0; right: 0; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; height: auto;
    flex-direction: row; padding: 6px;
  }
  .dock__sep { width: 1px; height: auto; margin: 10px 4px; }
  .dock__tip { display: none; }
  .dock__btn[aria-current="page"]::after { right: auto; left: 50%; top: auto; bottom: 3px; margin: 0 0 0 -2.5px; }
}
@media (max-width: 760px) {
  .brand__txt b { font-size: var(--fs-lg); }
  /* the tab strip runs edge to edge and fades at both ends, so it reads as scrollable */
  .tabs {
    margin: 0 calc(-1 * var(--gut)); padding: 0 calc(var(--gut) - 4px); width: calc(100% + 2 * var(--gut)); max-width: none;
    border-radius: 0; background: none; box-shadow: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .head { gap: 12px; margin-bottom: 16px; }
  .head__title { font-size: 28px; }
  .subtabs { order: 3; }
  .live__label { display: none; }
}
@media (max-width: 560px) {
  :root { --gut: 14px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .toasts { left: 12px; right: 12px; justify-items: stretch; }
  .toast { border-radius: 18px; }
}
/* the smallest phones: the dock's seven buttons still fit at 40px */
@media (max-width: 374px) {
  .dock { gap: 0; padding: 4px; }
  .dock__btn { width: 40px; height: 40px; }
  .dock__sep { margin: 10px 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .mesh i { will-change: auto; }
  .live__dot::after { animation: none; }
  .switch__knob { transition: none; }
}

/* touch screens: 44px targets, without changing how a mouse user sees it */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .btn { height: 44px; }
  .btn--sm { height: 38px; }
  .tab, .tabs__pill > span { padding-top: 12px; padding-bottom: 12px; }
  .subtab { padding-top: 11px; padding-bottom: 11px; }
  .seg button { min-height: 40px; }
  .seg--sm button { min-height: 34px; }
  .chip { height: 38px; padding: 0 14px; }
  .input, .select { height: 44px; }
  .switch input { inset: -10px; }
  .check input { width: 20px; height: 20px; }
  .more-link, .link-btn { min-height: 32px; }
}
/* 16px form text on phones and touch screens: anything smaller and iOS zooms in */
@media (pointer: coarse), (max-width: 720px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}

/* dialogs on phones: a sheet that rises from the bottom (ui.ts animates it) */
@media (max-width: 560px) {
  .modal, .modal.is-wide { margin: auto 0 0; width: 100vw; max-width: 100vw; }
  .modal__box { border-radius: 26px 26px 0 0; max-height: 92dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
  .modal__box::before { content: ''; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 99px; background: var(--line-2); }
  .modal__foot { position: sticky; bottom: 0; background: var(--float); padding-top: 12px; }
  .modal__foot .btn { flex: 1; }
  .sheet, .sheet.is-wide { margin: 0 0 0 auto; height: 100dvh; width: 100vw; }
  .sheet__box { border-radius: 0; }
  .sheet__foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .pop { left: 12px !important; right: 12px; width: auto; }
}
/* touch: small page-level controls keep their look but get a 44px hit area */
@media (pointer: coarse) {
  .view .icon-btn::after, .msg-row__star::after { content: ''; position: absolute; inset: -7px; }
  .msg-row__star { position: relative; }
  .view input[type="checkbox"] { min-width: 20px; min-height: 20px; }
  .view .chip { min-height: 36px; }
}
/* touch: text-sized controls grow their hit area to ≥ 28px without moving
   anything (padding out, the same margin back in) */
@media (pointer: coarse), (max-width: 720px) {
  .table th button.sort, .au-card__link, .an-plink, .ws-card__open, .ord-id, .cus-link {
    display: inline-block; padding-block: 5px; margin-block: -5px;
  }
  .msg-conv__order { height: auto; min-height: 28px; }
  .view input[type="checkbox"] { min-width: 26px; min-height: 26px; }
}

/* Mono has one key tone: every page's key figure is the ink tile (paper in dark) */
:root[data-palette="mono"] [data-view] { --tile: var(--sky); }
