/* ════════════════════════════════════════════════════════════════════════
   MailMan Console — app.css · THE design system (shared by every page)
   Dark & premium · violet→indigo · same brand language as mailman.website

   HOW TO USE (module builders — read this first):
   ─ Every page links this file:  <link rel="stylesheet" href="/assets/app.css" />
   ─ App pages use <body class="app">, copy the shell markup (bg + sidebar +
     scrim + .main[topbar + content]) from /overview/index.html, mark THIS
     page's sidebar link with  class="nav-item is-active" aria-current="page",
     and end the body with  <script src="/assets/app.js"></script>.
   ─ The login page uses <body class="app auth"> and must NOT load app.js.
   ─ Fonts (link per page, with preconnect):
       Bricolage Grotesque  → display: page titles, card titles   (var(--display))
       Instrument Sans      → body & UI                           (var(--body))
       JetBrains Mono       → data, metrics, labels, code         (var(--mono))

   TABLE OF CONTENTS
     01 Tokens                08 KPI / stat tiles       15 Progress bar & ring
     02 Reset & base          09 Pills · badges · chips 16 Avatars
     03 Background layers     10 Data tables            17 Charts (inline SVG)
     04 App shell: sidebar    11 Tabs & segmented       18 Feed / activity
     05 App shell: topbar     12 Forms & controls       19 Callouts & empty states
     06 Page scaffolding      13 Toolbar / filter row   20 Detail drawer & scrim
     07 Buttons               14 Date-range pill        21 Quick links
     22 Auth (login)          23 Utilities              24 Responsive
     25 Motion & reduced-motion
   ════════════════════════════════════════════════════════════════════════ */


/* ══ 01 · TOKENS ══════════════════════════════════════════════════════════ */
:root {
  /* surfaces & lines (from the marketing site — do not invent new grays) */
  --bg:        #08080c;
  --bg-2:      #0c0c13;
  --surface:   #101019;
  --surface-2: #14141f;
  --surface-3: #191926;
  --line:      #232334;
  --line-2:    #2c2c40;

  /* ink */
  --ink:       #f3f2f8;
  --ink-soft:  #c8c6d6;
  --muted:     #918fa6;
  --faint:     #63617a;

  /* brand accents */
  --violet:    #8b6dff;
  --indigo:    #5b4be6;
  --iris:      #a48bff;

  /* status (reserved for state — pills, deltas, callouts; never chart series) */
  --ok:        #57e6a7;
  --warn:      #f5b95c;
  --danger:    #f7768e;
  --info:      #6ac8ff;

  --grad:      linear-gradient(120deg, #b9a5ff, #8b6dff 42%, #5b4be6);
  --grad-soft: linear-gradient(120deg, #a48bff, #6a58ea);

  /* chart series — CVD-validated categorical ramp on var(--surface).
     Assign s1→s6 IN ORDER, never cycled; a series keeps its slot everywhere
     (Email=s1, SMS=s2, Chat/WhatsApp=s3, Voice=s4 across the whole console). */
  --chart-1: #8b6dff;   /* violet  (brand)   */
  --chart-2: #009865;   /* teal              */
  --chart-3: #b27902;   /* amber             */
  --chart-4: #1984b7;   /* azure             */
  --chart-5: #957cee;   /* iris              */
  --chart-6: #5b4be6;   /* indigo  (brand)   */
  --chart-dim: #4e4d68; /* context series (previous period, benchmark) */

  /* ordinal / sequential violet ramp (funnels, heat cells) — light = more */
  --ramp-1: #a89aff;
  --ramp-2: #907df2;
  --ramp-3: #7964d7;
  --ramp-4: #634bbc;
  --ramp-5: #4e32a2;

  /* type */
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout */
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --content-max: 1520px;
  --pad: clamp(18px, 2.6vw, 30px);
  --gap: 16px;

  /* radii */
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;

  /* elevation */
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 24px 60px -34px rgba(0,0,0,.75);
  --shadow-pop:  0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -18px rgba(0,0,0,.85), 0 0 40px -22px rgba(123,92,255,.45);
  --glow-hover:  0 22px 50px -30px rgba(123,92,255,.7);
}


/* ══ 02 · RESET & BASE ════════════════════════════════════════════════════ */
* { box-sizing: border-box; }
html { overflow-anchor: none; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
strong, b { font-weight: 600; }

::selection { background: rgba(139,109,255,.32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 3px;
  border-radius: 6px;
}

/* themed thin scrollbars (sidebar, table wraps, drawer) */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -48px; left: 16px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--line-2);
  color: var(--ink); font-size: 13px; transition: top .2s ease;
}
.skip-link:focus-visible { top: 12px; }


/* ══ 03 · BACKGROUND LAYERS ═══════════════════════════════════════════════
   <div class="bg" aria-hidden="true">
     <div class="bg-grid"></div><div class="bg-glow"></div><div class="bg-noise"></div>
   </div>
   Login additionally inserts <div class="bg-aurora a1"></div> / .a2 before .bg-glow. */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }

.bg-glow {
  position: absolute; top: -30vh; left: 50%;
  width: min(1100px, 130vw); height: min(1100px, 130vw);
  transform: translateX(-50%);
  background: radial-gradient(circle at center,
    rgba(123,92,255,.30) 0%, rgba(91,75,230,.14) 34%, rgba(91,75,230,0) 66%);
  filter: blur(8px);
}
.app .bg-glow { opacity: .5; }          /* subtler behind data UI */
.auth .bg-glow { opacity: 1; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 30%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 30%, transparent 76%);
}

.bg-aurora {
  position: absolute; width: 46vw; height: 46vw;
  min-width: 380px; min-height: 380px;
  border-radius: 50%; filter: blur(90px); opacity: .5;
}
.bg-aurora.a1 { top: 4%; left: -8%; background: radial-gradient(circle, rgba(139,109,255,.5), transparent 62%); animation: drift1 26s ease-in-out infinite; }
.bg-aurora.a2 { bottom: -14%; right: -10%; background: radial-gradient(circle, rgba(69,90,240,.42), transparent 62%); animation: drift2 32s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(6%, 5%); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-6%,-4%); } }

.bg-noise {
  position: absolute; inset: 0;
  opacity: .05; mix-blend-mode: soft-light; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ══ 04 · APP SHELL — SIDEBAR ═════════════════════════════════════════════
   <aside class="sidebar" id="sidebar" aria-label="Primary navigation">
     <a class="side-brand" href="/overview">…mark svg… <span class="side-name">MailMan</span> <span class="side-tag">Console</span></a>
     <nav class="side-nav">
       <a class="nav-item is-active" aria-current="page" href="/overview">…icon…<span>Overview</span></a>
       <div class="nav-group">
         <p class="nav-label">Messaging</p>
         <a class="nav-item" href="…">…icon…<span>Label</span></a>
       </div>
     </nav>
     <div class="side-foot">…plan card…</div>
   </aside>
   Mobile: <body> gets .nav-open (app.js) → sidebar slides in over the scrim. */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 90;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(16,16,25,.92), rgba(10,10,16,.92));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}

.side-brand {
  display: flex; align-items: center; gap: 10px;
  flex: none; height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.side-brand .mark { width: 26px; height: 26px; filter: drop-shadow(0 3px 10px rgba(123,92,255,.45)); }
.side-name {
  font-family: var(--display); font-weight: 800; font-size: 17px;
  letter-spacing: -.02em; color: var(--ink);
}
.side-tag {
  margin-left: 2px; padding: 3px 7px;
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--iris); border: 1px solid rgba(139,109,255,.32);
  border-radius: 999px; background: rgba(139,109,255,.08);
}

.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px 18px; }

.nav-group { margin-top: 18px; }
.nav-label {
  margin: 0 0 4px; padding: 0 10px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
}

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: color .16s ease, background .16s ease;
}
.nav-item svg.ni { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav-item .ext { width: 11px; height: 11px; margin-left: auto; opacity: 0; transition: opacity .16s ease; }
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.nav-item:hover .ext { opacity: .7; }

.nav-item.is-active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(139,109,255,.16), rgba(139,109,255,.05));
}
.nav-item.is-active::before {           /* violet accent bar */
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 2.5px; border-radius: 4px; background: var(--grad);
  box-shadow: 0 0 10px rgba(139,109,255,.8);
}
.nav-item.is-active svg.ni { color: var(--iris); opacity: 1; }

.side-foot { flex: none; padding: 14px 14px 16px; border-top: 1px solid var(--line); }
.plan-card {
  padding: 12px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: radial-gradient(130% 120% at 0% 0%, rgba(139,109,255,.10), transparent 60%), rgba(255,255,255,.015);
}
.plan-card .plan-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 7px;
}
.plan-card .plan-row b { color: var(--ink-soft); font-weight: 500; }
.plan-card .plan-foot { margin: 8px 0 0; font-family: var(--mono); font-size: 10px; color: var(--faint); }


/* ══ 05 · APP SHELL — TOPBAR ══════════════════════════════════════════════
   <header class="topbar">
     <button class="icon-btn nav-toggle" id="mm-nav-toggle" aria-expanded="false" aria-controls="sidebar" aria-label="Open navigation">…</button>
     <nav class="crumbs" aria-label="Breadcrumb"><a href="/overview">Console</a><span class="sep">/</span><span aria-current="page">Overview</span></nav>
     <label class="global-search">…svg…<input id="global-search" type="search" placeholder="Search…"><kbd>⌘K</kbd></label>
     <div class="topbar-actions">
       <button class="btn btn-primary btn-sm">…+ svg…<span class="btn-label">New</span></button>
       <button class="icon-btn has-dot" aria-label="Notifications — 3 unread">…bell…<span class="dot-badge">3</span></button>
       <details class="user-menu"> <summary>…avatar + email…</summary> <div class="menu">…</div> </details>
     </div>
   </header> */
.main { margin-left: var(--sidebar-w); min-height: 100svh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 var(--pad);
  background: rgba(8,8,12,.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar .nav-toggle { display: none; }  /* appears ≤960px */

.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  color: var(--faint); white-space: nowrap;
}
.crumbs a:hover { color: var(--muted); }
.crumbs .sep { color: var(--line-2); }
.crumbs [aria-current="page"] { color: var(--ink-soft); }

.global-search {
  position: relative; flex: 1; max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--faint); cursor: text;
  transition: border-color .16s ease, background .16s ease;
}
.global-search:focus-within { border-color: rgba(139,109,255,.55); background: rgba(139,109,255,.06); }
.global-search svg { width: 14px; height: 14px; flex: none; }
.global-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-family: var(--body); font-size: 13.5px; color: var(--ink);
}
.global-search input::placeholder { color: var(--faint); }
.global-search kbd {
  flex: none; padding: 2px 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  background: rgba(255,255,255,.02);
}

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* user menu (native <details> dropdown; app.js closes on outside click/Esc) */
.user-menu { position: relative; }
.user-menu summary {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 6px 4px 4px; border-radius: 999px;
  border: 1px solid transparent;
  list-style: none; cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { border-color: var(--line); background: rgba(255,255,255,.03); }
.user-menu[open] summary { border-color: var(--line-2); background: rgba(255,255,255,.04); }
.user-email { font-size: 13px; color: var(--ink-soft); }
.user-menu .chev { width: 12px; height: 12px; color: var(--faint); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 224px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-pop);
}
.menu-head {
  padding: 9px 11px 10px; margin-bottom: 4px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em;
  color: var(--faint); border-bottom: 1px solid var(--line);
}
.menu-head b { display: block; margin-top: 3px; font-weight: 500; font-size: 11.5px; color: var(--ink-soft); }
.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 11px; border-radius: 8px;
  font-size: 13px; color: var(--ink-soft); text-align: left;
}
.menu-item svg { width: 14px; height: 14px; color: var(--muted); }
.menu-item:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.menu-item.menu-danger { color: var(--danger); }
.menu-item.menu-danger svg { color: var(--danger); }
.menu-item.menu-danger:hover { background: rgba(247,118,142,.09); color: var(--danger); }


/* ══ 06 · PAGE SCAFFOLDING ════════════════════════════════════════════════
   <main class="content" id="main">
     <div class="page-head">
       <div><h1 class="page-title">Overview</h1><p class="page-sub">…</p></div>
       <div class="page-actions">…buttons / date pill…</div>
     </div>
     …sections…
   </main>
   <footer class="content-foot">© 2026 MailMan · Console</footer> */
.content {
  width: 100%; max-width: var(--content-max);
  margin: 0 auto; padding: var(--pad);
  display: flex; flex-direction: column; gap: var(--gap);
  flex: 1;
}
.content > * { min-width: 0; max-width: 100%; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 2px;
}
.page-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  letter-spacing: -.025em; line-height: 1.1; color: var(--ink);
}
.page-title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-sub { margin-top: 5px; font-size: 13.5px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* generic responsive grids */
.grid { display: grid; gap: var(--gap); }
.grid > * { min-width: 0; }              /* let cards shrink; tables scroll inside .table-wrap */
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.main-side { grid-template-columns: minmax(0,2.1fr) minmax(300px,1fr); align-items: start; }

.content-foot {
  max-width: var(--content-max); width: 100%; margin: 0 auto;
  padding: 6px var(--pad) 22px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}

/* section heading outside cards (e.g. above quick links) */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 -4px; }
.section-title { font-family: var(--display); font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; color: var(--ink); }
.section-head .more { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.section-head .more:hover { color: var(--iris); }


/* ══ 07 · BUTTONS ═════════════════════════════════════════════════════════
   .btn.btn-primary   gradient CTA        .btn.btn-ghost   bordered secondary
   .btn.btn-subtle    quiet/text          .btn.btn-danger  destructive ghost
   sizes: .btn-sm · icon-only square: .icon-btn (+.has-dot → .dot-badge) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--body); font-size: 14px; font-weight: 500;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease,
              border-color .16s ease, color .16s ease, filter .16s ease;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:active { transform: translateY(0) !important; }

.btn-primary {
  color: #0a0a12; background: var(--grad);
  box-shadow: 0 10px 26px -10px rgba(123,92,255,.55), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 34px -12px rgba(123,92,255,.7), inset 0 1px 0 rgba(255,255,255,.35); }

.btn-ghost {
  color: var(--ink-soft); border-color: var(--line-2); background: rgba(255,255,255,.03);
}
.btn-ghost:hover {
  color: #fff; border-color: rgba(139,109,255,.65); background: rgba(139,109,255,.12);
  transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(139,109,255,.9);
}

.btn-subtle { color: var(--muted); }
.btn-subtle:hover { color: var(--ink); background: rgba(255,255,255,.05); }

.btn-danger { color: var(--danger); border-color: rgba(247,118,142,.32); background: rgba(247,118,142,.07); }
.btn-danger:hover { background: rgba(247,118,142,.14); border-color: rgba(247,118,142,.5); }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 13.5px; height: 13.5px; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 37px; height: 37px; flex: none;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.02); color: var(--muted);
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255,255,255,.05); }
.dot-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; color: #fff;
  background: var(--violet); border: 2px solid var(--bg); border-radius: 999px;
}


/* ══ 08 · CARDS & KPI TILES ═══════════════════════════════════════════════
   <section class="card">
     <header class="card-head"><div><h2 class="card-title">…</h2><p class="card-sub">…</p></div>
       <div class="card-tools">…seg / date-pill / buttons…</div></header>
     <div class="card-body">…</div>
   </section>

   KPI:
   <div class="kpi-grid">
     <article class="kpi"><div class="kpi-top"><span class="kpi-label">Revenue attributed</span>
       <span class="delta up">…▲ svg…12.4%</span></div>
       <p class="kpi-value">$128,460</p>
       <svg class="spark" viewBox="0 0 96 30">…</svg></article>
   </div> */
.card {
  position: relative;
  padding: 18px 20px 20px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.006)), var(--surface);
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.card-title {
  font-family: var(--display); font-weight: 600; font-size: 15.5px;
  letter-spacing: -.01em; color: var(--ink);
}
.card-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.card-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* tiles auto-fill; override the min tile width per page when a row must fit
   (e.g. 5 tiles → style="--kpi-min:196px" on the .kpi-grid) */
.kpi-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(var(--kpi-min, 218px), 1fr)); }

.kpi {
  padding: 15px 16px 13px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.006)), var(--surface);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--glow-hover); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.kpi-value {
  margin: 8px 0 2px;
  font-family: var(--mono); font-weight: 600; font-size: clamp(21px, 1.8vw, 25px);
  letter-spacing: -.04em; color: var(--ink); line-height: 1.1;
}
.kpi-value small { font-size: .62em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .spark { width: 100%; height: 32px; margin-top: 8px; }
.kpi-foot { margin-top: 6px; font-family: var(--mono); font-size: 10px; color: var(--faint); }

/* delta chip — direction × whether up is good: .up / .down / .flat */
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
  white-space: nowrap;
}
.delta { flex: none; }
.delta svg { width: 9px; height: 9px; flex: none; }
.delta.up   { color: var(--ok);     background: rgba(87,230,167,.09);  border: 1px solid rgba(87,230,167,.22); }
.delta.down { color: var(--danger); background: rgba(247,118,142,.09); border: 1px solid rgba(247,118,142,.22); }
.delta.flat { color: var(--muted);  background: rgba(255,255,255,.04); border: 1px solid var(--line); }


/* ══ 09 · PILLS · BADGES · CHIPS · TAGS ═══════════════════════════════════
   Status pill (tables, feeds):
     <span class="pill-status ok"><i></i>Active</span>
     variants: .ok .warn .danger .info .neutral  (dot + label — never color alone)
   Count badge:  <span class="badge">12</span>
   Filter chip:  <button class="chip is-on">VIP <span class="count">2,304</span></button>
   Tag:          <span class="tag">Bucharest</span> */
.pill-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  border: 1px solid var(--line); white-space: nowrap;
}
.pill-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.pill-status.ok      { color: var(--ok);     border-color: rgba(87,230,167,.25);  background: rgba(87,230,167,.07); }
.pill-status.warn    { color: var(--warn);   border-color: rgba(245,185,92,.25);  background: rgba(245,185,92,.07); }
.pill-status.danger  { color: var(--danger); border-color: rgba(247,118,142,.25); background: rgba(247,118,142,.07); }
.pill-status.info    { color: var(--info);   border-color: rgba(106,200,255,.25); background: rgba(106,200,255,.07); }
.pill-status.neutral { color: var(--muted);  border-color: var(--line);           background: rgba(255,255,255,.03); }
.pill-status.neutral i { box-shadow: none; }

.badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: rgba(139,109,255,.16);
  border: 1px solid rgba(139,109,255,.3);
  font-family: var(--mono); font-size: 10px; color: var(--iris);
}

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; white-space: nowrap;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.chip .count { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.chip svg { width: 12px; height: 12px; color: var(--faint); }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-on { border-color: rgba(139,109,255,.55); background: rgba(139,109,255,.13); color: #fff; }
.chip.is-on .count { color: var(--iris); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; color: var(--muted);
  white-space: nowrap;
}
.tag.violet { color: var(--iris); border-color: rgba(139,109,255,.3); background: rgba(139,109,255,.08); }


/* ══ 10 · DATA TABLES ═════════════════════════════════════════════════════
   <div class="table-wrap">              ← scroll container (x always, y if capped)
     <table class="table">
       <thead><tr><th>Name</th><th class="cell-num">Revenue</th>…</tr></thead>
       <tbody><tr>…<td class="cell-num">$24,830</td>…</tr></tbody>
     </table>
   </div>
   Add .table-wrap.max-h for sticky-header vertical scroll (set --table-max-h).
   Numeric cells: .cell-num (mono, tabular, right-aligned).
   Sorted column: <th aria-sort="descending" class="th-sort">Revenue <svg…></th>
   Footer/pagination: .table-pager below the wrap. */
.table-wrap {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(255,255,255,.008);
  overflow-x: auto;
}
.table-wrap.max-h { overflow-y: auto; max-height: var(--table-max-h, 460px); }

.table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 2;
  padding: 10px 14px; text-align: left;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  color: var(--ink-soft); vertical-align: middle; white-space: nowrap;
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover td { background: rgba(139,109,255,.045); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[tabindex]:focus-visible { outline: 2px solid var(--iris); outline-offset: -2px; }

.cell-num { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right !important; }
.cell-main { color: var(--ink); font-weight: 500; }
.cell-dim { color: var(--faint); }
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person .p-name { color: var(--ink); font-weight: 500; line-height: 1.25; }
.cell-person .p-mail { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.th-sort { color: var(--ink-soft) !important; }
.th-sort svg { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-left: 3px; color: var(--iris); }

/* tiny inline score meter for table cells:
   <span class="score"><i style="width:86%"></i></span><span class="score-num">86</span> */
.score {
  display: inline-block; vertical-align: middle;
  width: 52px; height: 4px; border-radius: 999px;
  background: rgba(139,109,255,.12); overflow: hidden;
}
.score i { display: block; height: 100%; border-radius: 999px; background: var(--grad-soft); }
.score.low i { background: var(--danger); }
.score.mid i { background: var(--warn); }
.score-num { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); vertical-align: middle; }

.table-pager {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--faint);
}
.table-pager .pager-btns { margin-left: auto; display: flex; gap: 6px; }
.table-pager .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.table-pager .icon-btn svg { width: 13px; height: 13px; }
.table-pager .icon-btn[disabled] { opacity: .4; pointer-events: none; }

/* row selection checkbox */
.row-check {
  appearance: none; width: 15px; height: 15px; margin: 0;
  border: 1px solid var(--line-2); border-radius: 4.5px;
  background: rgba(255,255,255,.02); cursor: pointer;
  display: inline-grid; place-items: center; vertical-align: middle;
  transition: background .14s ease, border-color .14s ease;
}
.row-check::after {
  content: ""; width: 8px; height: 8px; transform: scale(0);
  background: #0a0a12;
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 84% 4%, 38% 70%);
  transition: transform .14s ease;
}
.row-check:checked { background: var(--grad); border-color: transparent; }
.row-check:checked::after { transform: scale(1); }


/* ══ 11 · TABS & SEGMENTED CONTROL ════════════════════════════════════════
   Tabs (content switch; app.js wires [data-tab]/[data-tab-panel]):
     <div class="tabs" role="tablist">
       <button class="tab is-active" role="tab" aria-selected="true" data-tab="profile">Profile</button>…
     </div>
     <div data-tab-panel="profile">…</div> <div data-tab-panel="notes" hidden>…</div>

   Segmented (compact option switch, e.g. chart ranges; app.js wires .seg-btn):
     <div class="seg" role="group" aria-label="Range">
       <button class="seg-btn" aria-pressed="false">7D</button>
       <button class="seg-btn is-active" aria-pressed="true">30D</button>…
     </div> */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; padding: 9px 13px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  border-radius: 8px 8px 0 0;
  transition: color .15s ease, background .15s ease;
}
.tab:hover { color: var(--ink-soft); background: rgba(255,255,255,.03); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--grad);
}

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.025);
}
.seg-btn {
  padding: 5px 11px; border-radius: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
  color: var(--muted);
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.seg-btn:hover { color: var(--ink-soft); }
.seg-btn.is-active {
  color: var(--ink); background: var(--surface-3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 2px 8px -2px rgba(0,0,0,.55), 0 0 0 1px var(--line-2);
}


/* ══ 12 · FORMS & CONTROLS ════════════════════════════════════════════════
   Text input:   <input class="input" type="text">
   With icon:    <label class="search-field">…svg…<input class="input" type="search"></label>
   Select:       <select class="input select">…</select>
   Field block:  <div class="field"><label class="field-label" for="…">Email</label><input class="input" id="…"></div>
   Toggle:       <label class="switch"><input type="checkbox" checked><i></i><span class="switch-label">SMS consent</span></label>
   Slider:       <input class="range" type="range" min="0" max="100" value="60">  (app.js paints fill) */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

.input {
  height: 40px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.03);
  font-family: var(--body); font-size: 13.5px; color: var(--ink);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
  width: 100%;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: 0; border-color: rgba(139,109,255,.6); box-shadow: 0 0 0 3px rgba(139,109,255,.16); background: rgba(139,109,255,.05); }
.input[aria-invalid="true"] { border-color: rgba(247,118,142,.55); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(247,118,142,.15); }

.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23918fa6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 13px;
}
.select option { background: var(--surface-2); color: var(--ink); }

.search-field { position: relative; display: block; }
.search-field > svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--faint); pointer-events: none;
}
.search-field .input { padding-left: 35px; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 38px; height: 22px; margin: 0; cursor: pointer; }
.switch i {
  position: relative; flex: none;
  width: 38px; height: 22px; border-radius: 999px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line-2);
  transition: background .18s ease, border-color .18s ease;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted);
  transition: transform .18s ease, background .18s ease;
}
.switch input:checked + i { background: rgba(139,109,255,.28); border-color: rgba(139,109,255,.55); }
.switch input:checked + i::after { transform: translateX(16px); background: linear-gradient(135deg, #c3b2ff, #8b6dff); box-shadow: 0 0 10px rgba(139,109,255,.7); }
.switch input:focus-visible + i { outline: 2px solid var(--iris); outline-offset: 3px; }
.switch-label { font-size: 13px; color: var(--ink-soft); }

/* range slider — app.js sets --pct so the track fills to the thumb */
.range {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 22px; background: none; cursor: pointer; --pct: 50%;
}
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--violet) var(--pct), rgba(139,109,255,.14) var(--pct));
}
.range::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: linear-gradient(135deg, #c3b2ff, #8b6dff);
  border: 2px solid #0a0a12;
  box-shadow: 0 0 0 1px rgba(139,109,255,.5), 0 2px 10px rgba(123,92,255,.6);
}
.range::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(139,109,255,.14); }
.range::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--violet); }
.range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: linear-gradient(135deg, #c3b2ff, #8b6dff);
  border: 2px solid #0a0a12;
  box-shadow: 0 0 0 1px rgba(139,109,255,.5), 0 2px 10px rgba(123,92,255,.6);
}
.range:focus-visible { outline: 2px solid var(--iris); outline-offset: 4px; border-radius: 8px; }


/* ══ 13 · TOOLBAR / FILTER ROW ════════════════════════════════════════════
   One row above the content it scopes (never inside a chart card):
   <div class="toolbar">
     <label class="search-field">…</label>
     <select class="input select">…</select>
     <button class="date-pill">…</button>
     <span class="spacer"></span>
     <button class="btn btn-ghost btn-sm">Export</button>
     <button class="btn btn-primary btn-sm">+ Add contact</button>
   </div> */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search-field { flex: 1 1 220px; max-width: 340px; }
.toolbar .input, .toolbar .select { height: 38px; }
.toolbar .select { width: auto; flex: none; }
.toolbar .spacer { flex: 1; }


/* ══ 14 · DATE-RANGE PILL ═════════════════════════════════════════════════
   <button class="date-pill">…calendar svg…<span>Jun 12 – Jul 11, 2026</span>…chevron svg…</button> */
.date-pill {
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.025);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .01em; color: var(--ink-soft);
  white-space: nowrap; cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.date-pill svg { width: 13px; height: 13px; color: var(--faint); flex: none; }
.date-pill:hover { border-color: rgba(139,109,255,.5); background: rgba(139,109,255,.08); color: var(--ink); }


/* ══ 15 · PROGRESS — BAR & RING ═══════════════════════════════════════════
   Bar:  <div class="progress" role="progressbar" aria-valuenow="82" aria-valuemin="0" aria-valuemax="100">
           <i style="width:82%"></i></div>
         variants: .progress.ok / .warn / .danger (solid state color)
   Ring: <svg class="ring" viewBox="0 0 76 76" role="img" aria-label="Lead score 86 of 100">
           <circle class="ring-track" cx="38" cy="38" r="32"/>
           <circle class="ring-val" cx="38" cy="38" r="32" stroke-dasharray="172.9 201.1"/>
           <text class="ring-num" x="38" y="36">86</text><text class="ring-cap" x="38" y="50">score</text>
         </svg>
         (dasharray = pct×201.1 — circumference of r32) */
.progress {
  height: 6px; border-radius: 999px;
  background: rgba(139,109,255,.12);        /* track = lighter step of same ramp */
  overflow: hidden;
}
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.progress.ok     { background: rgba(87,230,167,.13); }  .progress.ok i     { background: var(--ok); }
.progress.warn   { background: rgba(245,185,92,.13); }  .progress.warn i   { background: var(--warn); }
.progress.danger { background: rgba(247,118,142,.13); } .progress.danger i { background: var(--danger); }
.progress.thin { height: 4px; }

.progress-row { display: flex; flex-direction: column; gap: 7px; }
.progress-row .progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted);
}
.progress-row .progress-meta b { color: var(--ink-soft); font-weight: 500; }

.ring { width: 76px; height: 76px; }
.ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: rgba(139,109,255,.14); }
.ring-val {
  stroke: var(--violet); stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  filter: drop-shadow(0 0 6px rgba(139,109,255,.55));
}
.ring-num {
  font-family: var(--mono); font-size: 19px; font-weight: 600;
  fill: var(--ink); text-anchor: middle; dominant-baseline: central;
}
.ring-cap {
  font-family: var(--mono); font-size: 7.5px; letter-spacing: .14em; text-transform: uppercase;
  fill: var(--faint); text-anchor: middle;
}


/* ══ 16 · AVATARS ═════════════════════════════════════════════════════════
   <span class="avatar av-1">MI</span>  tints .av-1….av-5 · sizes .avatar-sm / .avatar-lg
   <span class="avatar-stack"><span class="avatar avatar-sm av-2">AP</span>…</span> */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .02em;
  color: var(--ink); border: 1px solid var(--line-2);
  background: var(--surface-3);
}
.avatar-sm { width: 28px; height: 28px; font-size: 9.5px; }
.avatar-lg { width: 46px; height: 46px; font-size: 14.5px; }
.av-1 { background: linear-gradient(135deg, rgba(139,109,255,.32), rgba(91,75,230,.16)); color: #cfc0ff; }
.av-2 { background: linear-gradient(135deg, rgba(87,230,167,.26), rgba(87,230,167,.08)); color: #9af0cd; }
.av-3 { background: linear-gradient(135deg, rgba(245,185,92,.26), rgba(245,185,92,.08)); color: #ffd9a0; }
.av-4 { background: linear-gradient(135deg, rgba(106,200,255,.26), rgba(106,200,255,.08)); color: #a8ddff; }
.av-5 { background: linear-gradient(135deg, rgba(247,118,142,.26), rgba(247,118,142,.08)); color: #ffb3c2; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -9px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }


/* ══ 17 · CHARTS — hand-authored inline SVG ═══════════════════════════════
   Wrapper:  <figure class="chart"><svg class="chart-svg" viewBox="0 0 760 300" role="img" aria-label="…">…</svg></figure>
   Series classes map to slots: .s1….s6 (+ .dim for context series).
   Primitives: .gridline .axisline (hairline, SOLID) · .line .area .dot .bar
               .donut-seg · .funnel-bar · .heat-cell · .r1….r5 (ordinal ramp)
   Sparklines: <svg class="spark" viewBox="0 0 96 30"><path class="spark-fill"…/>
               <path class="spark-line"…/><circle class="spark-dot"…/></svg>
   Legend:   <div class="legend"><span class="key"><i class="key-line s1"></i>This period</span>
             <span class="key"><i class="swatch s2"></i>SMS</span></div>
   Hover:    give any mark data-tip="line one&#10;line two" (+ tabindex="0" and
             aria-label) — app.js shows the shared .viz-tip. For line/area charts
             wrap per-x hit targets: <g class="xhit"><line class="cross"…/>
             <circle class="hl s1"…/><rect class="hit" data-tip="…"/></g>
   Table twin: <details class="chart-data"><summary>View data</summary>
               <div class="table-wrap">…table…</div></details> */
.chart { margin: 0; overflow-x: auto; overflow-y: hidden; }
.chart .chart-svg { min-width: 540px; }   /* keep axis text legible — chart scrolls inside its card on phones */
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg text {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em;
  fill: var(--faint);
}
.chart-svg .tick-y { text-anchor: end; }
.chart-svg .end-label { font-size: 10.5px; fill: var(--ink-soft); }

.gridline { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.axisline { stroke: rgba(255,255,255,.11); stroke-width: 1; }

.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.s1 { stroke: var(--chart-1); } .line.s2 { stroke: var(--chart-2); }
.line.s3 { stroke: var(--chart-3); } .line.s4 { stroke: var(--chart-4); }
.line.s5 { stroke: var(--chart-5); } .line.s6 { stroke: var(--chart-6); }
.line.dim { stroke: var(--chart-dim); }

.area { stroke: none; opacity: .1; }
.area.s1 { fill: var(--chart-1); } .area.s2 { fill: var(--chart-2); }
.area.s3 { fill: var(--chart-3); } .area.s4 { fill: var(--chart-4); }
.area.s5 { fill: var(--chart-5); } .area.s6 { fill: var(--chart-6); }

.dot { stroke: var(--surface); stroke-width: 2; }   /* 2px surface ring */
.dot.s1 { fill: var(--chart-1); } .dot.s2 { fill: var(--chart-2); }
.dot.s3 { fill: var(--chart-3); } .dot.s4 { fill: var(--chart-4); }
.dot.s5 { fill: var(--chart-5); } .dot.s6 { fill: var(--chart-6); }
.dot.dim { fill: var(--chart-dim); }

.bar { transition: filter .14s ease; }
.bar.s1 { fill: var(--chart-1); } .bar.s2 { fill: var(--chart-2); }
.bar.s3 { fill: var(--chart-3); } .bar.s4 { fill: var(--chart-4); }
.bar.s5 { fill: var(--chart-5); } .bar.s6 { fill: var(--chart-6); }
.bar:hover, .bar:focus-visible { filter: brightness(1.22); }

/* ordinal / sequential ramp fills (funnel stages, heat cells) */
.r1 { fill: var(--ramp-1); } .r2 { fill: var(--ramp-2); } .r3 { fill: var(--ramp-3); }
.r4 { fill: var(--ramp-4); } .r5 { fill: var(--ramp-5); }

.donut-seg { fill: none; stroke-width: 21; transition: filter .16s ease; }
.donut-seg.s1 { stroke: var(--chart-1); } .donut-seg.s2 { stroke: var(--chart-2); }
.donut-seg.s3 { stroke: var(--chart-3); } .donut-seg.s4 { stroke: var(--chart-4); }
.donut-seg.s5 { stroke: var(--chart-5); } .donut-seg.s6 { stroke: var(--chart-6); }
.donut-seg:hover, .donut-seg:focus-visible { filter: brightness(1.22) drop-shadow(0 0 6px rgba(139,109,255,.35)); }
.donut-center-num {
  font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -.03em;
  fill: var(--ink); text-anchor: middle;
}
.donut-center-cap {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase;
  fill: var(--faint); text-anchor: middle;
}

.heat-cell { transition: filter .14s ease; }
.heat-cell:hover, .heat-cell:focus-visible { filter: brightness(1.3); }

/* funnel text roles (SVG <text>) */
.funnel-name { fill: var(--ink-soft); font-size: 11px; }
.funnel-val { fill: var(--ink-soft); font-size: 11px; }
.funnel-val-in { fill: #0d0d16; font-weight: 600; }   /* value inside a light ramp bar */
.funnel-pct { fill: var(--faint); }
.funnel-adv { fill: var(--faint); font-size: 9.5px; letter-spacing: .05em; }

/* donut + side legend layout:
   <div class="donut-wrap"><svg class="chart-svg donut">…</svg>
     <div class="mix-rows"><div class="mix-row">…</div>…</div></div>
   <div class="mix-row"><span class="key"><i class="swatch s1"></i>Email</span>
     <span class="mix-val">251.8K</span><span class="mix-pct">61%</span></div> */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap .donut { width: 152px; height: 152px; flex: none; margin: 4px auto; }
.donut-wrap .mix-rows { flex: 1; min-width: 190px; }
.mix-row { display: flex; align-items: center; gap: 10px; padding: 8.5px 0; border-bottom: 1px solid var(--line); }
.mix-row:last-child { border-bottom: 0; }
.mix-row .key { flex: 1; font-family: var(--body); font-size: 12.5px; color: var(--ink-soft); }
.mix-val { font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
.mix-pct { font-family: var(--mono); font-size: 10.5px; color: var(--faint); min-width: 34px; text-align: right; }

/* hover layer (line/area charts) */
.xhit .cross { stroke: rgba(164,139,255,.45); stroke-width: 1; opacity: 0; transition: opacity .1s ease; }
.xhit .hl { opacity: 0; transition: opacity .1s ease; }
.xhit:hover .cross, .xhit:focus-within .cross,
.xhit:hover .hl,   .xhit:focus-within .hl { opacity: 1; }
.hit { fill: transparent; }
.hit:focus-visible { outline: none; fill: rgba(139,109,255,.06); stroke: rgba(164,139,255,.5); stroke-width: 1; }

/* sparkline (svg uses preserveAspectRatio="none"; strokes stay crisp) */
.spark { overflow: visible; }
.spark-line { fill: none; stroke: var(--chart-1); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-fill { fill: var(--chart-1); opacity: .1; }
.spark-dot { fill: var(--chart-1); stroke: var(--surface); stroke-width: 1.5; }
.spark-end { fill: none; stroke: var(--chart-1); stroke-width: 5.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* legend */
.legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: var(--muted);
}
.legend.above { margin-bottom: 12px; }             /* legend row placed above a chart */
.key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.key b { color: var(--ink-soft); font-weight: 500; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key-line { width: 14px; height: 2px; border-radius: 2px; flex: none; }
.swatch.s1, .key-line.s1 { background: var(--chart-1); }
.swatch.s2, .key-line.s2 { background: var(--chart-2); }
.swatch.s3, .key-line.s3 { background: var(--chart-3); }
.swatch.s4, .key-line.s4 { background: var(--chart-4); }
.swatch.s5, .key-line.s5 { background: var(--chart-5); }
.swatch.s6, .key-line.s6 { background: var(--chart-6); }
.swatch.dim, .key-line.dim { background: var(--chart-dim); }
.swatch.grad-ramp { background: linear-gradient(90deg, var(--ramp-5), var(--ramp-1)); width: 42px; }

/* shared tooltip node (created by app.js; textContent only) */
.viz-tip {
  position: fixed; z-index: 120; pointer-events: none;
  max-width: 260px; padding: 8px 11px;
  background: rgba(23,23,36,.96);
  border: 1px solid var(--line-2); border-radius: 9px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--ink-soft);
  white-space: pre-line;
  box-shadow: 0 14px 40px -12px rgba(0,0,0,.8), 0 0 24px -14px rgba(123,92,255,.5);
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.viz-tip.show { opacity: 1; transform: none; }
.viz-tip .tip-head { display: block; color: var(--faint); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }

/* chart data twin */
.chart-data { margin-top: 12px; }
.chart-data summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); cursor: pointer; list-style: none;
}
.chart-data summary::-webkit-details-marker { display: none; }
.chart-data summary::before { content: "▸"; font-size: 9px; transition: transform .15s ease; }
.chart-data[open] summary::before { transform: rotate(90deg); }
.chart-data summary:hover { color: var(--muted); }
.chart-data .table-wrap { margin-top: 10px; max-height: 240px; overflow-y: auto; }
.chart-data .table { min-width: 0; }


/* ══ 18 · FEED / ACTIVITY ═════════════════════════════════════════════════
   <ul class="feed">
     <li class="feed-item"><span class="feed-ico ok">…svg…</span>
       <p class="feed-text"><b>Cart recovery</b> won back order #7215 — <b>$96.40</b></p>
       <span class="feed-time">2m</span></li>
   </ul>  ico variants: (default violet) .ok .warn .info .danger */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.feed-item:first-child { padding-top: 2px; }
.feed-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.feed-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--iris); background: rgba(139,109,255,.09); border: 1px solid var(--line);
}
.feed-ico svg { width: 14px; height: 14px; }
.feed-ico.ok     { color: var(--ok);     background: rgba(87,230,167,.08); }
.feed-ico.warn   { color: var(--warn);   background: rgba(245,185,92,.08); }
.feed-ico.info   { color: var(--info);   background: rgba(106,200,255,.08); }
.feed-ico.danger { color: var(--danger); background: rgba(247,118,142,.08); }
.feed-text { flex: 1; font-size: 12.5px; line-height: 1.45; color: var(--muted); padding-top: 4px; }
.feed-text b { color: var(--ink-soft); font-weight: 500; }
.feed-time { flex: none; padding-top: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }


/* ══ 19 · CALLOUTS & EMPTY STATES ═════════════════════════════════════════
   <div class="callout ok"><span class="co-ico">…svg…</span>
     <div><p class="co-title">Send-time AI is paying off</p><p class="co-text">…</p></div></div>
   variants: (default violet) .ok .warn .info

   <div class="empty"><span class="empty-ico">…svg…</span>
     <h3>No notes yet</h3><p>Notes you add appear here for the whole team.</p>
     <button class="btn btn-ghost btn-sm">Add note</button></div> */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line); border-left-width: 2px; border-radius: var(--r-md);
  border-left-color: rgba(139,109,255,.55);
  background: linear-gradient(90deg, rgba(139,109,255,.06), transparent 55%), rgba(255,255,255,.012);
}
.co-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--iris); background: rgba(139,109,255,.1); border: 1px solid var(--line);
}
.co-ico svg { width: 15px; height: 15px; }
.co-title { font-size: 13px; font-weight: 600; color: var(--ink); font-family: var(--body); }
.co-text { margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.co-text b { color: var(--ink-soft); font-weight: 500; }
.callout.ok   { border-left-color: rgba(87,230,167,.55);  background: linear-gradient(90deg, rgba(87,230,167,.05),  transparent 55%), rgba(255,255,255,.012); }
.callout.ok .co-ico   { color: var(--ok);   background: rgba(87,230,167,.09); }
.callout.warn { border-left-color: rgba(245,185,92,.55);  background: linear-gradient(90deg, rgba(245,185,92,.05),  transparent 55%), rgba(255,255,255,.012); }
.callout.warn .co-ico { color: var(--warn); background: rgba(245,185,92,.09); }
.callout.info { border-left-color: rgba(106,200,255,.55); background: linear-gradient(90deg, rgba(106,200,255,.05), transparent 55%), rgba(255,255,255,.012); }
.callout.info .co-ico { color: var(--info); background: rgba(106,200,255,.09); }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 38px 22px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
}
.empty-ico {
  width: 44px; height: 44px; margin-bottom: 6px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--iris); border: 1px solid var(--line-2);
  background: radial-gradient(120% 120% at 30% 20%, rgba(139,109,255,.2), rgba(91,75,230,.04) 60%), var(--surface);
}
.empty-ico svg { width: 20px; height: 20px; }
.empty h3 { font-family: var(--display); font-weight: 600; font-size: 14.5px; color: var(--ink-soft); }
.empty p { font-size: 12.5px; color: var(--muted); max-width: 38ch; }
.empty .btn { margin-top: 10px; }


/* ══ 20 · DETAIL DRAWER & SCRIM ═══════════════════════════════════════════
   <aside class="drawer" id="contact-drawer" role="dialog" aria-modal="true" aria-label="Contact details" hidden? no—use .is-open>
     <header class="drawer-head">…title + <button class="icon-btn" data-drawer-close>✕</button></header>
     <div class="drawer-body">…</div>
     <footer class="drawer-foot">…actions…</footer>
   </aside>
   Open with any element:  data-drawer-open="contact-drawer"  (app.js wires it,
   adds body.drawer-open, manages Esc/scrim/focus return).
   The single <div class="scrim" data-scrim></div> serves nav drawer + detail drawer. */
.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4,4,9,.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .24s ease;
}
body.nav-open .scrim, body.drawer-open .scrim { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 85;
  width: min(430px, 96vw);
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px -40px rgba(0,0,0,.9);
  transform: translateX(103%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), visibility 0s linear .28s;
}
.drawer.is-open {
  transform: none; visibility: visible;
  transition: transform .28s cubic-bezier(.2,.7,.2,1);   /* visible instantly on open */
}
.drawer-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.drawer-head .drawer-title { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink); }
.drawer-head .icon-btn { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.drawer-foot { flex: none; display: flex; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.012); }
.drawer-foot .btn { flex: 1; }

/* drawer helpers */
.qa-row { display: flex; gap: 8px; }               /* quick actions */
.qa-row .btn { flex: 1; }
.drawer-stats { display: flex; align-items: center; gap: 18px; }
.drawer-stats .kv { flex: 1; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
tr[data-drawer-open] { cursor: pointer; }

/* key-value list (drawer profile, settings) */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 12.5px; }
.kv dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding-top: 1px; }
.kv dd { margin: 0; color: var(--ink-soft); text-align: right; overflow-wrap: anywhere; }
.kv dd.mono { font-family: var(--mono); font-size: 11.5px; }


/* ══ 21 · QUICK LINKS (module tiles) ══════════════════════════════════════
   <div class="quick-grid">
     <a class="quicklink" href="/journeys"><span class="ql-ico">…svg stroke="url(#ig)"…</span>
       <span class="ql-name">Journeys</span><span class="ql-meta">14 active</span>
       <svg class="ql-arrow">…</svg></a>
   </div>
   Icons may use the shared gradient: include ONE hidden defs block per page:
   <svg width="0" height="0" style="position:absolute" aria-hidden="true"><defs>
     <linearGradient id="ig" x1="0" y1="0" x2="24" y2="24" gradientUnits="userSpaceOnUse">
       <stop stop-color="#c3b2ff"/><stop offset=".5" stop-color="#8b6dff"/><stop offset="1" stop-color="#5b4be6"/>
     </linearGradient></defs></svg> */
.quick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.quicklink {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 9px;
  padding: 15px 15px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005));
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.quicklink::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-md); pointer-events: none;
  background: radial-gradient(130% 100% at 0% 0%, rgba(139,109,255,.1), transparent 55%);
  opacity: 0; transition: opacity .2s ease;
}
.quicklink:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--glow-hover); }
.quicklink:hover::after { opacity: 1; }
.ql-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  background: radial-gradient(120% 120% at 30% 20%, rgba(139,109,255,.2), rgba(91,75,230,.04) 60%), var(--surface);
}
.ql-ico svg { width: 17px; height: 17px; }
.ql-name { font-family: var(--display); font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; color: var(--ink); }
.ql-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: -5px; }
.ql-arrow {
  position: absolute; top: 13px; right: 13px;
  width: 13px; height: 13px; color: var(--faint);
  opacity: 0; transform: translate(-3px, 3px);
  transition: opacity .2s ease, transform .2s ease;
}
.quicklink:hover .ql-arrow { opacity: 1; transform: none; color: var(--iris); }


/* ══ 22 · AUTH (login page) ═══════════════════════════════════════════════
   <body class="app auth"> — no sidebar/topbar, no app.js.
   <main class="auth-wrap"><section class="auth-card">…</section>
     <p class="auth-foot">…</p></main> */
.auth-wrap {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px; padding: clamp(18px, 4vw, 40px);
}
.auth-card {
  width: min(400px, 100%);
  padding: clamp(26px, 5vw, 36px) clamp(22px, 4.6vw, 34px) clamp(24px, 4.6vw, 30px);
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 40px 90px -40px rgba(0,0,0,.9), 0 0 60px -24px rgba(123,92,255,.55);
}
.auth-emblem {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: grid; place-items: center; border-radius: 16px;
  background: radial-gradient(120% 120% at 30% 20%, rgba(139,109,255,.22), rgba(91,75,230,.05) 60%), var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(139,109,255,.1), 0 18px 50px -18px rgba(123,92,255,.65), inset 0 1px 0 rgba(255,255,255,.05);
}
.auth-emblem svg { width: 30px; height: 30px; }
.auth-brand {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin-bottom: 4px;
}
.auth-brand .side-name { font-size: 19px; }
.auth-title {
  text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 21px;
  letter-spacing: -.02em; color: var(--ink);
}
.auth-sub { margin: 7px 0 22px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn-primary { width: 100%; margin-top: 4px; padding: 12px 17px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; }
.auth-link { font-size: 12.5px; color: var(--muted); transition: color .15s ease; }
.auth-link:hover { color: var(--iris); }
.form-error {
  display: none;
  align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(247,118,142,.35); background: rgba(247,118,142,.08);
  font-size: 12.5px; color: var(--danger);
}
.form-error.show { display: flex; }
.form-error svg { width: 14px; height: 14px; flex: none; }
.auth-foot { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--faint); text-align: center; }
.auth-foot b { color: var(--muted); font-weight: 400; }

@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.auth-card.shake { animation: shake .4s ease; }


/* ══ 23 · UTILITIES ═══════════════════════════════════════════════════════ */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink { color: var(--ink); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.eyebrow {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--iris);
}
.hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row .spacer { flex: 1; }
.mt-0 { margin-top: 0 !important; }


/* ══ 24 · RESPONSIVE ══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .user-email { display: none; }
}
@media (max-width: 1080px) {
  .grid.main-side { grid-template-columns: 1fr; }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 960px) {
  /* sidebar becomes a drawer */
  .sidebar {
    transform: translateX(-103%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.2,.7,.2,1), visibility 0s linear .28s;
    box-shadow: 30px 0 80px -40px rgba(0,0,0,.9);
    background: var(--bg-2);
  }
  body.nav-open .sidebar {
    transform: none; visibility: visible;
    transition: transform .28s cubic-bezier(.2,.7,.2,1);
  }
  .main { margin-left: 0; }
  .topbar .nav-toggle { display: inline-grid; }
  .crumbs { display: none; }
}
@media (min-width: 961px) {
  .sidebar { transform: none !important; visibility: visible !important; }
}
@media (max-width: 760px) {
  .global-search { display: none; }
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar { gap: 10px; }
  .page-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .grid.c4 { grid-template-columns: 1fr; }
  .btn .btn-label { display: none; }   /* icon-only "+ New" on phones */
  .btn:has(.btn-label) { padding-left: 11px; padding-right: 11px; }
  .kpi-value { font-size: 21px; }
  .card { padding: 15px 15px 17px; }
  .drawer { width: 100vw; border-left: 0; }
}
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
}


/* ══ 25 · MOTION & REDUCED MOTION ═════════════════════════════════════════
   Entrance: add .reveal (+ .d1….d8 for stagger) to top-level blocks.
   Charts: <path class="line s1 draw" pathLength="1" …> draws itself in;
           .area/.donut-seg fade via .fade. Pure CSS — no JS dependency. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
  .d1 { animation-delay: .04s; } .d2 { animation-delay: .1s; }
  .d3 { animation-delay: .16s; } .d4 { animation-delay: .22s; }
  .d5 { animation-delay: .3s; }  .d6 { animation-delay: .38s; }
  .d7 { animation-delay: .46s; } .d8 { animation-delay: .54s; }
  @keyframes rise { to { opacity: 1; transform: none; } }

  .line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawline 1.1s cubic-bezier(.4,0,.2,1) .25s forwards; }
  @keyframes drawline { to { stroke-dashoffset: 0; } }
  .fade { opacity: 0; animation: fadein .8s ease .55s forwards; }
  @keyframes fadein { to { opacity: 1; } }
  .area.fade { animation-name: fadearea; }
  @keyframes fadearea { to { opacity: .1; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bg-aurora { display: none; }
  .reveal { opacity: 1; transform: none; }
  .line.draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .fade, .area.fade { opacity: 1; }
  .area.fade { opacity: .1; }
}
