/* =========================================================================
   SiteOS — design system
   Tokens, base, layout shell and every shared component.
   Page-specific styles live in modules.css, phone tweaks in mobile.css.
   ========================================================================= */

:root {
  color-scheme: light;
  --bg:#f1f2ee; --surface:#ffffff; --surface-2:#f6f7f3; --surface-3:#eceee8; --surface-hover:#f3f4f0;
  --border:#e6e8e1; --border-2:#d8dbd2;
  --text:#121411; --text-2:#5a5e56; --text-3:#8b8f86;
  --accent:#2563eb; --accent-2:#1d4fd8; --accent-soft:#e3ecfd; --accent-ink:#ffffff; --accent-text:#1e4fc4;
  --ink:#121411; --ink-2:#262923; --ink-text:#ffffff; --ink-text-2:#a7ab9f;
  --good:#1d9a57; --good-soft:#e1f4e8; --warn:#b97800; --warn-soft:#fcf0d6;
  --bad:#d9443e; --bad-soft:#fce5e3; --info:#2a78d6; --info-soft:#e2edfb; --sky-soft:#dde9f6;
  --c1:#2a78d6; --c2:#eb6834; --c3:#1baf7a; --c4:#eda100; --c5:#e87ba4; --c6:#008300; --c7:#4a3aa7; --c8:#e34948; --c0:#a3a79d;
  --chart-bar:#1b1d19; --chart-hl:#2563eb; --chart-grid:#eceee8; --ring-track:#eef0ea;
  --heat-none:#f4f5f1; --heat-0:#e9ebe5; --heat-1:#cfe0fc; --heat-2:#93b8f8; --heat-3:#4f86ee; --heat-4:#1d4fd8;
  --shadow-xs:0 1px 2px rgba(18,20,17,.04);
  --shadow-sm:0 1px 2px rgba(18,20,17,.05),0 2px 8px -2px rgba(18,20,17,.06);
  --shadow:0 1px 2px rgba(18,20,17,.04),0 8px 24px -8px rgba(18,20,17,.1);
  --shadow-lg:0 32px 72px -20px rgba(18,20,17,.28),0 4px 12px rgba(18,20,17,.06);
  --focus:0 0 0 3px rgba(37,99,235,.3);
  --r-xs:8px; --r-sm:12px; --r:16px; --r-lg:22px; --r-xl:28px; --r-pill:999px;
  --ease:cubic-bezier(.2,.8,.2,1); --spring:cubic-bezier(.34,1.56,.64,1);
  --sidebar:252px; --sidebar-c:80px; --topbar:76px; --gap:16px;

  --font:'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* ---- Derived helpers (additions to the Life OS token list above; nothing above is changed) ---- */
  /* Content that sits on an ink surface (ink flips to light in dark mode). */
  --ink-accent:#7aa7ff; --ink-wash:rgba(255,255,255,.08); --ink-line:rgba(255,255,255,.1);
  --scroll-shadow:rgba(18,20,17,.1);
  /* Status colours nudged towards the text colour: for small text on soft backgrounds (WCAG AA). */
  --good-text:color-mix(in srgb, var(--good) 76%, var(--text));
  --warn-text:color-mix(in srgb, var(--warn) 76%, var(--text));
  --bad-text:color-mix(in srgb, var(--bad) 80%, var(--text));
  --info-text:color-mix(in srgb, var(--info) 80%, var(--text));
  /* Solid red fills that carry text (danger button, alert badge). */
  --bad-solid:color-mix(in srgb, var(--bad) 88%, #000); --on-bad:#ffffff;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg:#0b0c0a; --surface:#141613; --surface-2:#1a1c18; --surface-3:#22251f; --surface-hover:#1c1e1a;
  --border:#23261f; --border-2:#31352c; --text:#f1f3ec; --text-2:#a8ada0; --text-3:#71766a;
  --accent:#6ea0ff; --accent-2:#5b8ff5; --accent-soft:#12244a; --accent-ink:#06142e; --accent-text:#8db4ff;
  --ink:#f1f3ec; --ink-2:#dfe2d8; --ink-text:#0b0c0a; --ink-text-2:#5f6358;
  --good:#3fc47d; --good-soft:#13291c; --warn:#e3a52a; --warn-soft:#2d2410;
  --bad:#f06a64; --bad-soft:#321614; --info:#5a9ef0; --info-soft:#132338; --sky-soft:#15212e;
  --c1:#3987e5; --c2:#d95926; --c3:#199e70; --c4:#c98500; --c5:#d55181; --c6:#1f9a1f; --c7:#9085e9; --c8:#e66767; --c0:#6b7065;
  --chart-bar:#4a4e44; --chart-hl:#6ea0ff; --chart-grid:#22251f; --ring-track:#242720;
  --heat-none:#121411; --heat-0:#1e211b; --heat-1:#14284f; --heat-2:#1f4290; --heat-3:#3a6fd8; --heat-4:#6ea0ff;
  --shadow-xs:0 1px 2px rgba(0,0,0,.3); --shadow-sm:0 1px 2px rgba(0,0,0,.35);
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-lg:0 32px 72px -16px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.04);
  --focus:0 0 0 3px rgba(110,160,255,.3);
  --ink-accent:#1d4fd8; --ink-wash:rgba(0,0,0,.07); --ink-line:rgba(0,0,0,.1);
  --scroll-shadow:rgba(255,255,255,.07);
  --bad-solid:var(--bad); --on-bad:#1a0806;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01','cv11';
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
svg.i { flex: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* Thin scrollbars: 10px wide, thumb inset by a 3px border in the page colour. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border: 3px solid var(--bg); border-radius: 999px; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }
::-webkit-scrollbar-corner { background: transparent; }
/* Scroll areas that sit on a card, modal or menu: inset with a transparent border instead. */
.card ::-webkit-scrollbar-thumb, .modal ::-webkit-scrollbar-thumb, .palette ::-webkit-scrollbar-thumb,
.menu::-webkit-scrollbar-thumb, textarea::-webkit-scrollbar-thumb { border-color: transparent; background-clip: padding-box; }
/* Firefox has no ::-webkit-scrollbar. (Setting these in Chrome would switch the rules above off.) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
}

/* ---------- Utilities ---------- */
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: .92em; }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.gap-sm { gap: 6px !important; }
.wrap { flex-wrap: wrap; }

kbd, .kbd {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  font: 500 11px/1 var(--mono); color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 7px; white-space: nowrap;
}

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar); transition: margin-left .28s var(--ease); }

/* Sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar); background: var(--bg);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  transition: width .28s var(--ease), padding .28s var(--ease), transform .32s var(--ease);
  overflow: hidden;
}
.brand { display: flex; align-items: center; height: 44px; padding: 0 6px; margin-bottom: 14px; }
.brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 14px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: #121411; color: #7aa7ff;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), var(--shadow-sm);
}
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; }
.brand-os { color: var(--text-3); font-weight: 450; }

.nav {
  flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px 8px; scrollbar-width: none;
  /* Soft edge shadows that only appear while there is more to scroll. */
  background:
    linear-gradient(var(--bg) 30%, transparent) top / 100% 24px no-repeat local,
    linear-gradient(transparent, var(--bg) 70%) bottom / 100% 24px no-repeat local,
    linear-gradient(var(--scroll-shadow), transparent) top / 100% 12px no-repeat scroll,
    linear-gradient(transparent, var(--scroll-shadow)) bottom / 100% 12px no-repeat scroll;
}
.nav::-webkit-scrollbar { display: none; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 0 12px 6px; white-space: nowrap;
  transition: opacity .2s;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 6px; margin-bottom: 2px; border-radius: 14px;
  color: var(--text-2); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .18s var(--ease), color .18s, box-shadow .18s;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-ic {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  transition: background .2s var(--ease), color .2s;
}
.nav-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.nav-item.active .nav-ic { background: var(--accent); color: var(--accent-ink); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.nav-badge.alert { background: var(--bad-solid); color: var(--on-bad); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; min-width: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #4a8af5);
  color: var(--accent-ink); font-size: 13px; font-weight: 650; letter-spacing: -.01em;
}
.user-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.user-meta b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--text-2); font-size: 12px; }
.collapse-btn {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 12px;
  background: none; border: 0; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500;
  white-space: nowrap; transition: background .18s, color .18s;
}
.collapse-btn:hover { background: var(--surface-hover); color: var(--text); }
.collapse-btn span { flex: 1; text-align: left; }
.collapse-btn svg { transition: transform .28s var(--ease); }
.sidebar .side-theme { display: none; }   /* phones only: see mobile.css */

/* Rail (collapsed sidebar, or forced at ≤1024px) */
.app.rail .sidebar { width: var(--sidebar-c); padding-left: 12px; padding-right: 12px; }
.app.rail .main { margin-left: var(--sidebar-c); }
.app.rail .brand { justify-content: center; padding: 0; }
.app.rail .brand-name,
.app.rail .nav-text,
.app.rail .user-meta,
.app.rail .collapse-btn span,
.app.rail .collapse-btn kbd { display: none; }
.app.rail .nav-label { font-size: 0; height: 1px; padding: 0; margin: 4px 12px 12px; background: var(--border); }
.app.rail .nav-group + .nav-group { margin-top: 12px; }
.app.rail .nav-item { justify-content: center; padding: 0; }
.app.rail .nav-badge { position: absolute; top: 3px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; box-shadow: 0 0 0 2px var(--bg); }
.app.rail .nav-item.active .nav-badge { box-shadow: 0 0 0 2px var(--surface); }
.app.rail .user { justify-content: center; padding: 4px 0; }
.app.rail .collapse-btn { justify-content: center; padding: 0; }
.app.rail .collapse-btn svg { transform: scaleX(-1); }
.app.forced-rail .collapse-btn { display: none; }

.scrim { display: none; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar); padding: 0 32px;
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.search-btn {
  flex: 0 1 420px; max-width: 420px; height: 44px; min-width: 120px;
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-3); font-size: 14px; cursor: pointer; text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color .18s, box-shadow .18s;
}
.search-btn:hover { border-color: var(--border-2); }
.search-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: border-color .18s, background .18s;
}
.pill-btn:hover { border-color: var(--border-2); background: var(--surface-hover); }
.pill-btn .chev { color: var(--text-3); flex: none; }
.site-pill { min-width: 0; flex: none; }
.site-pill-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sync-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.sync-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync-badge.good { background: var(--good-soft); color: var(--good-text); }
.sync-badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.sync-badge.bad { background: var(--bad-soft); color: var(--bad-text); }
.bell { position: relative; }
.bell .dot-alert { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); }

/* Site colour dot */
.dot-site { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tint, var(--c0)); flex: none; }
.dot-site.lg { width: 10px; height: 10px; }
.dot-site.all { background: conic-gradient(var(--c1) 0 25%, var(--c3) 0 50%, var(--c7) 0 75%, var(--c2) 0); }

/* Page */
.page { max-width: 1480px; margin: 0 auto; padding: 4px 32px 56px; container: page / inline-size; }
.page-enter { animation: pageIn .38s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 10px 0 24px; }
.page-head-text { min-width: 0; }
.eyebrow { font-size: 13px; color: var(--text-3); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.page-title { font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.page-sub { font-size: 14.5px; color: var(--text-2); margin-top: 8px; max-width: 680px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin: 28px 0 12px; }

/* ---------- Layout primitives ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.grid + .grid, .kpis + .grid, .grid + .kpis { margin-top: var(--gap); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.between { justify-content: space-between; }

/* ---------- Card ---------- */
.card {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-xs);
}
.card.ink { background: var(--ink); color: var(--ink-text); border-color: transparent; box-shadow: var(--shadow); }
.card.ink .card-sub, .card.ink .muted, .card.ink .faint { color: var(--ink-text-2); }
.card.ink .card-ic { background: var(--ink-wash); color: var(--ink-accent); }
.card.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.card.accent .card-sub, .card.accent .muted { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.card.accent .card-ic { background: color-mix(in srgb, var(--accent-ink) 16%, transparent); color: var(--accent-ink); }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.sky { background: var(--sky-soft); border-color: transparent; box-shadow: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 20px 22px 0; }
.card.interactive { cursor: pointer; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.card.interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
.card-ic {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.card-ic.tint { background: color-mix(in srgb, var(--tint) 14%, var(--surface)); color: var(--tint); }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.card-sub { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.card-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.card-foot { border-top: 1px solid var(--border); margin: 18px -22px -22px; padding: 14px 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.card.ink .card-foot { border-color: var(--ink-line); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); }
@container page (max-width: 807px) {
  .kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-xs);
}
.kpi-top { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
.kpi-top > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-ic { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.kpi-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.kpi-val { font-size: 30px; font-weight: 550; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-val small { font-size: 14px; font-weight: 500; letter-spacing: -.01em; color: var(--text-2); margin-left: 3px; }
.kpi-sub { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.kpi.accent .kpi-top, .kpi.accent .kpi-sub, .kpi.accent .kpi-val small { color: color-mix(in srgb, var(--accent-ink) 68%, transparent); }
.kpi.accent .kpi-ic { background: color-mix(in srgb, var(--accent-ink) 16%, transparent); color: var(--accent-ink); }
.kpi.ink { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.kpi.ink .kpi-top, .kpi.ink .kpi-sub, .kpi.ink .kpi-val small { color: var(--ink-text-2); }
.kpi.ink .kpi-ic { background: var(--ink-wash); color: var(--ink-accent); }
.kpi.bad .kpi-ic { background: var(--bad-soft); color: var(--bad); }
.kpi.bad .kpi-val { color: var(--bad); }

/* ---------- Delta ---------- */
.delta {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.delta.good { background: var(--accent); color: var(--accent-ink); }
.delta.bad { background: var(--bad-soft); color: var(--bad-text); }
.delta.flat { background: var(--surface-3); color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--surface-3); color: var(--text);
  font-size: 13.5px; font-weight: 550; line-height: 1; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .14s var(--ease), background .18s, border-color .18s, box-shadow .18s, opacity .18s, color .18s;
}
.btn:hover { background: var(--border-2); }
.btn:active { transform: scale(.97); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--ink); color: var(--ink-text); }
.btn.primary:hover { background: var(--ink-2); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: var(--accent-2); }
.btn.soft { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn.soft:hover { background: var(--surface-hover); border-color: var(--border-2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.danger { background: var(--bad-solid); color: var(--on-bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad-solid) 88%, #000); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading > svg { display: none; }
.btn.loading::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-icon {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer; box-shadow: var(--shadow-xs); -webkit-tap-highlight-color: transparent;
  transition: transform .14s var(--ease), background .18s, color .18s, border-color .18s;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-2); }
.btn-icon:active { transform: scale(.94); }
.btn-icon.sm { width: 32px; height: 32px; }
.btn-icon.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-icon.ghost:hover { background: var(--surface-hover); }
.btn-icon.danger:hover { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.btn-icon.loading > svg { animation: spin .8s linear infinite; }

/* ---------- Inputs & forms ---------- */
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-2); box-shadow: var(--focus); background: var(--surface); }
.textarea { height: auto; min-height: 96px; padding: 11px 14px; line-height: 1.55; resize: vertical; }
.textarea.mono, .input.mono { font-family: var(--mono); font-size: 13px; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8f86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
}
.input.sm, .select.sm { height: 34px; font-size: 13px; border-radius: 10px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: 13px; color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }

.form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 12px; }
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.w-full { grid-column: span 6; }
.field.w-half { grid-column: span 3; }
.field.w-third { grid-column: span 2; }
.field > label, .label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.field .req { color: var(--bad); }
.hint { font-size: 12px; color: var(--text-2); }
.field-err { font-size: 12px; font-weight: 500; color: var(--bad-text); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--bad); }
.field.invalid .input:focus, .field.invalid .textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 42px; cursor: pointer; font-size: 14px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch > span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-2); transition: background .22s var(--ease), box-shadow .15s; }
.switch > span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .36s var(--spring), background .22s;
}
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
:root[data-theme='dark'] .switch input:checked + span { background: #1b2a52; }

/* Segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
:root[data-theme='dark'] .seg button.active { background: var(--border-2); }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), color .2s, border-color .2s;
}
.tab:hover { color: var(--text); border-color: var(--border-2); }
.tab .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.tab.active { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.tab.active .count { background: var(--accent-ink); color: var(--accent); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 550; line-height: 1; white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.good { background: var(--good-soft); color: var(--good-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.bad { background: var(--bad-soft); color: var(--bad-text); }
.chip.info { background: var(--info-soft); color: var(--info-text); }
.chip.good .dot { background: var(--good); } .chip.warn .dot { background: var(--warn); }
.chip.bad .dot { background: var(--bad); } .chip.info .dot { background: var(--info); }
.chip.accent { background: var(--accent); color: var(--accent-ink); }
.chip.ink { background: var(--ink); color: var(--ink-text); }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-2); }
.chip.site { background: color-mix(in srgb, var(--tint) 12%, var(--surface)); color: color-mix(in srgb, var(--tint) 62%, var(--text)); }
.chip.site .dot-site { width: 7px; height: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row.link { cursor: pointer; }
.list-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; color: inherit; }
.list-btn > svg { color: var(--text-3); }
.list-btn:hover .ic-chip { background: var(--accent); color: var(--accent-ink); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 12.5px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .15s; }
.list-row:hover .row-actions, tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.ic-chip {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
  transition: background .15s, color .15s;
}
.ic-chip.sm { width: 28px; height: 28px; border-radius: 9px; }
.ic-chip.tint { background: color-mix(in srgb, var(--tint) 14%, var(--surface)); color: var(--tint); }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 12px; white-space: nowrap;
  font-size: 12px; font-weight: 550; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .shrink { width: 1%; white-space: nowrap; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 22px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 22px; }
.check { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }

/* Progress bar */
.pbar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent-2); transform-origin: left center; animation: growX .8s var(--ease) both; }
.pbar.over > i { background: var(--bad); }
.pbar.warn > i { background: var(--warn); }
.pbar.thin { height: 5px; }
@keyframes growX { from { transform: scaleX(0); } }

/* Ring */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--ring-track); }
.ring .val { stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); animation: ringIn 1.1s var(--ease) both; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.card.ink .ring .track, .kpi.ink .ring .track { stroke: var(--ink-line); }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--text-2); }
.lg-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg-item i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-item b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 20px; }
.empty-ic { width: 60px; height: 60px; border-radius: 20px; margin-bottom: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.empty-text { font-size: 13.5px; color: var(--text-2); max-width: 380px; }
.empty .btn { margin-top: 12px; }
.empty.error .empty-ic { background: var(--bad-soft); color: var(--bad); }
.empty.compact { padding: 24px 12px; }
.empty.compact .empty-ic { width: 44px; height: 44px; border-radius: 15px; margin-bottom: 6px; }

/* Skeleton */
.sk {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.sk-line { height: 12px; border-radius: 6px; }
.sk-title { height: 34px; width: 280px; max-width: 70%; border-radius: 12px; margin-top: 8px; }
.sk-eyebrow { height: 12px; width: 140px; border-radius: 6px; }
.sk-kpi { height: 124px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Tooltip */
.tooltip {
  position: fixed; top: 0; left: 0; z-index: 400; pointer-events: none;
  max-width: 260px; padding: 6px 10px; border-radius: 11px;
  background: var(--ink); color: var(--ink-text);
  font-size: 12px; font-weight: 500; line-height: 1.35;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(3px) scale(.98);
  transition: opacity .12s, transform .16s var(--ease);
}
.tooltip.show { opacity: 1; transform: none; }

/* Toasts */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  max-width: min(440px, calc(100vw - 32px)); min-height: 44px; padding: 8px 8px 8px 8px;
  background: var(--ink); color: var(--ink-text); border-radius: 18px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500;
  animation: toastIn .5s var(--spring) both;
}
.toast.out { animation: toastOut .22s var(--ease) both; }
.toast-ic { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.toast.bad .toast-ic { background: var(--bad-solid); color: var(--on-bad); }
.toast.info .toast-ic { background: var(--info); color: var(--surface); }
.toast-msg { flex: 1; min-width: 0; padding-right: 4px; }
.toast-act { flex: none; background: none; border: 0; padding: 6px 10px; border-radius: 10px; color: var(--ink-accent); font-weight: 650; cursor: pointer; }
.toast-act:hover { background: var(--ink-wash); }
.toast-x { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0; background: none; color: var(--ink-text-2); display: grid; place-items: center; cursor: pointer; }
.toast-x:hover { color: var(--ink-text); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* Modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background: rgba(10,12,9,.38);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn .2s var(--ease) both;
}
.modal {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 580px; max-height: calc(100dvh - 48px);
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: modalIn .42s var(--spring) both;
}
.modal.sm { max-width: 420px; } .modal.md { max-width: 580px; }
.modal.lg { max-width: 820px; } .modal.xl { max-width: 1040px; }
.modal-back.closing { animation: fadeOut .18s var(--ease) both; }
.modal-back.closing .modal { animation: modalOut .18s var(--ease) both; }
.sheet-handle { display: none; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 22px 4px; }
.modal-title { font-size: 19px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.modal-sub { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
.modal-body { padding: 16px 22px 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px 22px; }
.modal-foot .left { margin-right: auto; }
.modal.confirm { text-align: center; }
.modal.confirm .modal-body { padding: 26px 26px 6px; }
.modal.confirm .modal-foot { padding: 18px 22px 22px; }
.modal.confirm .modal-foot > .btn { flex: 1; }
.confirm-ic { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.confirm-ic.danger { background: var(--bad-soft); color: var(--bad); }
.confirm-text { color: var(--text-2); margin-top: 6px; font-size: 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* Menu */
.menu {
  position: fixed; z-index: 150; min-width: 220px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: menuIn .18s var(--ease) both; transform-origin: top;
}
.menu.up { transform-origin: bottom; }
.menu-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 10px; background: none; color: var(--text);
  font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; white-space: nowrap;
}
.menu-item > svg { color: var(--text-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-hover); box-shadow: none; }
.menu-item .grow { overflow: hidden; text-overflow: ellipsis; }
.menu-item .check-ic { color: var(--accent-text); }
.menu-item.danger, .menu-item.danger > svg { color: var(--bad-text); }
.menu-item.danger:hover { background: var(--bad-soft); }
.menu-item kbd { margin-left: 8px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-empty { padding: 14px 12px; color: var(--text-3); font-size: 13px; text-align: center; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* Command palette */
.palette-back {
  position: fixed; inset: 0; z-index: 120;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px;
  background: rgba(10,12,9,.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn .18s var(--ease) both;
}
.palette {
  width: 100%; max-width: 640px; overflow: hidden;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: modalIn .36s var(--spring) both;
}
.pal-input-row { height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 18px 0 20px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.pal-input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.pal-input:focus-visible { box-shadow: none; }
.pal-input::placeholder { color: var(--text-3); }
.pal-results { max-height: min(440px, 56vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.pal-group { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 14px; cursor: pointer; min-width: 0; }
.pal-item .ic-chip { width: 32px; height: 32px; border-radius: 10px; }
.pal-item .pal-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .pal-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .pal-hint { margin-left: auto; display: flex; gap: 4px; flex: none; }
.pal-item.active { background: var(--surface-hover); }
.pal-item.active .ic-chip { background: var(--accent); color: var(--accent-ink); }
.pal-empty { padding: 32px 16px; text-align: center; color: var(--text-3); }
.pal-foot { display: flex; align-items: center; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* Shortcut list (in "?" modal) */
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sc-keys { display: flex; gap: 4px; align-items: center; color: var(--text-3); font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8, .span-9 { grid-column: span 12; }
  .span-3.keep { grid-column: span 3; }
}
@media (max-width: 1100px) {
  .span-3.keep { grid-column: span 6; }
}
@media (max-width: 1024px) {
  .topbar { padding: 0 24px; }
  .page { padding: 4px 24px 48px; }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .sk { animation: none; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .scrim, .toasts, .tooltip, .page-actions, .row-actions, .btn, .btn-icon { display: none !important; }
  .main, .app.rail .main { margin: 0 !important; }
  .page { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card, .kpi { box-shadow: none; break-inside: avoid; border-color: #ddd; }
  .card.ink, .kpi.ink { background: #fff; color: #000; border: 1px solid #ddd; }
}
