/* lid.eg.je — component styles
   Token-driven. All colors via var(--*) from tokens.css.
*/

* { box-sizing: border-box; }

.app {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: var(--num-feat);
  /* Container queries on .app so the Tweaks "viewport emulator" (which sets
     a max-width on .app to 390/820px) actually triggers responsive rules,
     instead of relying on window.innerWidth via @media. */
  container-type: inline-size;
  container-name: app;
}
.app a { color: inherit; text-decoration: none; }
.app a:hover { color: var(--brand); }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  height: 56px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
}
@container app (max-width: 720px) {
  .topbar { height: 50px; }
  .topbar__inner { padding: 8px 14px; gap: 8px; }
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand__name { font-weight: 700; }
.brand__tld { color: var(--ink-faint); font-weight: 500; }

/* Pulse indicator: Click → Lead → Cash (brand wordmark presence) */
.pulse {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: default;
}
.pulse__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background 0.2s;
}
.pulse__dot[data-on="1"] { background: var(--brand); box-shadow: 0 0 0 3px var(--shine); }
.pulse__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.nav a {
  padding: 7px 10px;
  border-radius: var(--r-2);
  color: var(--ink-muted);
  font-size: var(--t-meta);
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.is-active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav__sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 6px;
}

.user-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: var(--r-1);
  background: var(--brand-bg);
  color: var(--brand);
  border: 1px solid var(--border);
}
.user-tag--btn {
  appearance: none;
  cursor: pointer;
  transition: background 0.12s;
}
.user-tag--btn:hover {
  background: var(--brand);
  color: var(--brand-fg);
}

.lang-toggle,
.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  border-radius: var(--r-2);
  cursor: pointer;
  text-transform: uppercase;
}
.theme-toggle { padding: 6px 8px; min-width: 30px; }
.lang-toggle:hover, .theme-toggle:hover { background: var(--surface-2); color: var(--ink); }

/* ── Subnav (admin section nav row) ─────────────────────────── */
.subnav {
  position: sticky;
  top: 56px;
  z-index: 9;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.subnav__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subnav__inner::-webkit-scrollbar { display: none; }
.subnav__row {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 6px 0;
  width: max-content;
}
.subnav__a {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  font-size: var(--t-meta);
  color: var(--ink-muted);
  white-space: nowrap;
  border-radius: var(--r-2);
  letter-spacing: -0.001em;
}
.subnav__a:hover { color: var(--ink); background: var(--surface-2); }
.subnav__a.is-active {
  color: var(--ink);
  background: var(--surface);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--border);
}
@container app (max-width: 720px) {
  .subnav { top: 50px; }
  .subnav__inner { padding: 0 14px; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  color: var(--ink-muted);
  margin-bottom: 12px;
  padding: 4px 6px;
  margin-left: -6px;
  border-radius: var(--r-1);
}
.back-link:hover { color: var(--brand); background: var(--shine); }

/* ── Main scaffold ──────────────────────────────────────────── */
/* Container queries (`@container app (...)`) used throughout admin.css
   / me.css / public.css need a container ancestor — declare the body
   here so every responsive rule actually fires when the window narrows. */
body.app {
  container-type: inline-size;
  container-name: app;
}

.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}
@container app (max-width: 720px) {
  .main { padding: 18px 14px 80px; }
}

/* Belt-and-suspenders: regular media queries so devices/browsers
   without container-query support (older Safari, in-app webviews)
   still collapse the grids on narrow viewports. */
@media (max-width: 960px) {
  .dash-body { grid-template-columns: 1fr !important; }
  .dash-side { position: static !important; }
  /* balance-hero — drop sticky CTA column under the values */
  .balance-hero { grid-template-columns: 1fr !important; }
  .balance-hero__cta { align-items: stretch !important; }
  .balance-hero__cta .btn { width: 100% !important; }
}
@media (max-width: 720px) {
  .main { padding: 18px 14px 80px; }
  /* Phone / small tablet — force 2 cols. With 8 KPI cards (me/stats)
     this gives a clean 4×2 grid. With 6 cards — 3×2. With 4 — 2×2.
     No orphan rows. */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid { grid-template-columns: 1fr !important; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .field { width: 100%; }
  /* topbar — compress paddings, hide non-essential, wrap pulse */
  .topbar__inner { padding: 8px 12px !important; gap: 6px; flex-wrap: wrap; row-gap: 4px; }
  .pulse__label { display: none; }
  .public-nav-link { padding: 6px 8px; font-size: 12px; }
  .user-tag { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* subnav — already overflow-x scroll, keep it tight */
  .subnav__a { white-space: nowrap; padding: 6px 10px; font-size: 12.5px; }
  /* inline funnel — vertical when cramped */
  .inline-funnel { flex-direction: column; align-items: stretch; gap: 8px; }
  .inline-funnel__arrow { transform: rotate(90deg); align-self: center; }
  /* page head — hero doesn't shout off-screen */
  .h1 { font-size: 22px !important; line-height: 1.1; }
  .page-head .h1 { font-size: clamp(20px, 6vw, 28px); }
  /* balance-hero values cap so they don't overflow */
  .balance-hero__value { font-size: clamp(24px, 8vw, 38px) !important; }
  .balance-hero__cols { grid-template-columns: 1fr !important; gap: 6px !important; }
  /* tables — show as cards on narrow if not already handled */
  .table-wrap { border-radius: 8px; }
  /* landing — sections tighten */
  .landing-section { padding: 36px 16px !important; }
  .landing-h1 { font-size: clamp(36px, 12vw, 64px) !important; }
  .landing-h2 { font-size: clamp(26px, 7vw, 36px) !important; }
  .landing-steps,
  .landing-verticals,
  .landing-tech { grid-template-columns: 1fr !important; }
  .landing-footer__inner { grid-template-columns: 1fr !important; gap: 18px !important; }
  .landing-proof { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
}
@media (max-width: 480px) {
  /* Below 480px — 2 cards per row stay readable down to ~360px. */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-cta { flex-direction: column; align-items: stretch; }
  .landing-cta .btn { width: 100%; text-align: center; }
}
@media (max-width: 360px) {
  /* Very tiny phones — accept single col. */
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Tabbar SVG icon — sized + currentColor so it inherits active-state tint. */
.tabbar svg.ico {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto 2px;
  color: inherit;
}

/* Audit log payload — collapsed shows first 80 chars in a <summary>;
   click to expand into a wrapped <pre> below. The cursor switches to
   pointer so the affordance is unmistakable. */
.payload { cursor: pointer; }
.payload summary { list-style: none; outline: none; }
.payload summary::-webkit-details-marker { display: none; }
.payload summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 4px;
  font-size: 9px;
  color: var(--ink-faint);
  transition: transform 100ms ease;
}
.payload[open] summary::before { transform: rotate(90deg); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-kicker);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.eyebrow__sep { color: var(--ink-faint); }
.eyebrow__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 4px;
}

.h1 {
  font-family: var(--font-h1);
  font-size: var(--t-h1);
  letter-spacing: var(--tracking-h1, -0.015em);
  line-height: 1.1;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  text-wrap: balance;
}
.subtitle {
  font-size: var(--t-body);
  color: var(--ink-muted);
  margin: 0 0 var(--s-6);
  max-width: 64ch;
  text-wrap: pretty;
}
.subtitle em {
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
}

.h2 {
  font-family: var(--font-ui);
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: var(--s-6) 0 var(--s-3);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.h2__count {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0;
}

/* ── KPI cards ──────────────────────────────────────────────── */
/* iOS-grade — generous breathing room (20/24), grouped table feel
   with hairline separators rendered via the 1px grid gap. Capped at
   4 columns max so that pages with 8 KPI (e.g. /me/stats) render as
   a tidy 2×4 instead of an awkward 7+1 when the viewport sits in the
   intermediate range where 8 don't quite fit but 7 do. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  overflow: hidden;
  margin-bottom: var(--s-6);
  box-shadow: var(--shadow-2);
}
@media (min-width: 1440px) {
  /* Big monitors — let 6 KPI pages (admin/dashboard) breathe. With 8
     KPI you'll see 6+2 which is visually balanced enough. */
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
.kpi-card {
  background: var(--surface);
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-width: 0;
  min-height: 124px;
  transition: background 120ms ease;
}
.kpi-card:hover { background: var(--surface-2); }
.kpi-card__unit {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
  white-space: nowrap;
}

.kpi-card__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kpi-card__value {
  font-family: var(--font-h1);
  font-size: var(--t-num);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  margin-top: 4px;
  word-break: keep-all;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.kpi-card__value small {
  font-size: var(--t-meta);
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
  font-family: var(--font-mono);
}
.kpi-card__foot {
  font-size: var(--t-meta);
  color: var(--ink-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kpi-card__foot a { color: var(--brand); }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: var(--r-1);
  white-space: nowrap;
}
.delta--up   { color: var(--ok);  background: var(--ok-bg); }
.delta--down { color: var(--bad); background: var(--bad-bg); }
.delta--flat { color: var(--ink-faint); background: var(--neut-bg); }

/* ── Dash body (main + side rail) ───────────────────────────── */
.dash-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--s-5);
  align-items: start;
}
@container app (max-width: 1100px) {
  .dash-body { grid-template-columns: 1fr; }
}

.dash-main { min-width: 0; }
.dash-side {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  position: sticky;
  top: 64px;
}

/* ── Panels ─────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel__title {
  font-family: var(--font-ui);
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.panel__title small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0;
}
.panel__action {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 4px 8px;
  border-radius: var(--r-1);
}
.panel__action:hover { background: var(--surface-3); color: var(--brand); }
.panel__body {
  padding: 12px 16px 14px;
}
.panel--ghost {
  background: transparent;
  box-shadow: none;
  border: 1px dashed var(--border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-4);
}
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}
@container app (max-width: 900px) {
  .split-grid { grid-template-columns: 1fr; }
}

/* ── Notif list (queues, alerts) ────────────────────────────── */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.notif {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: 11px 14px 11px 12px;
  border-top: 1px solid var(--border);
  position: relative;
  min-width: 0;
}
.notif:first-child { border-top: 0; }
.notif::before {
  content: "";
  display: block;
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: var(--ink-faint);
}
.notif--info::before  { background: var(--info); }
.notif--ok::before    { background: var(--ok); }
.notif--warn::before  { background: var(--warn); }
.notif--alert::before { background: var(--bad); }

.notif__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notif__title {
  font-weight: 500;
  color: var(--ink);
  font-size: var(--t-body);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.notif__body {
  font-size: 12.5px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
.notif__foot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.notif__action {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 4px 8px;
  border-radius: var(--r-1);
  white-space: nowrap;
}
.notif__action:hover { color: var(--brand); background: var(--shine); }

.notif--big {
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border) !important;
  box-shadow: var(--shadow-1);
}
.notif--big.notif--alert { background: var(--bad-bg); border-color: color-mix(in oklab, var(--bad) 30%, var(--border)); }
.notif--big.notif--warn  { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 30%, var(--border)); }
.notif-list--big {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.notif-list--big .notif { border-top: 0; }

/* ── Pill / badge ───────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 2px 7px 3px;
  border-radius: 999px;
  background: var(--neut-bg);
  color: var(--neut-fg);
  font-weight: 500;
  white-space: nowrap;
  text-transform: lowercase;
}
.pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.pill--pending  { background: var(--warn-bg); color: var(--warn); }
.pill--approved { background: var(--info-bg); color: var(--info); }
.pill--paid     { background: var(--ok-bg); color: var(--ok); }
.pill--rejected { background: var(--bad-bg); color: var(--bad); }
.pill--new      { background: var(--brand-bg); color: var(--brand); }
.pill--sale     { background: var(--ok-bg); color: var(--ok); }
.pill--hot      { background: var(--bad-bg); color: var(--bad); }
.pill--reco     { background: var(--brand-bg); color: var(--brand); }
.pill--active   { background: var(--ok-bg); color: var(--ok); }
.pill--banned   { background: var(--bad-bg); color: var(--bad); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-2);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-fg);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s, transform 0.06s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.07); color: var(--brand-fg); }
.btn:active { transform: translateY(0.5px); }

.btn--ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--ink); }

.btn--danger {
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--bad) 40%, var(--border));
  color: var(--bad);
}
.btn--danger:hover {
  background: var(--bad-bg);
  border-color: color-mix(in oklab, var(--bad) 50%, transparent);
  color: var(--bad);
}

.btn--sm { height: 28px; padding: 0 10px; font-size: var(--t-meta); }
.btn--lg { height: 40px; padding: 0 20px; font-size: var(--t-h3); }
.btn--block { width: 100%; }

.btn-row {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* link-button (ghost minimal) */
.linkbtn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 3px 6px;
  border-radius: var(--r-1);
  cursor: pointer;
}
.linkbtn:hover { color: var(--brand); background: var(--shine); }
.linkbtn--brand { color: var(--brand); }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-1);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-body);
  min-width: 600px;
}
.table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.table thead th.num { text-align: right; }
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink);
}
.table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.table tbody td b {
  font-weight: 600;
  color: var(--ink);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .muted { color: var(--ink-muted); }
.table .plate {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.table .id-cell {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* Mobile: table → card list */
@container app (max-width: 720px) {
  .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
  .table { min-width: 0; display: block; }
  .table thead { display: none; }
  .table tbody, .table tr { display: block; }
  .table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    margin-bottom: 10px;
    box-shadow: var(--shadow-1);
    padding: 4px 0;
  }
  .table tbody tr:hover { background: var(--surface); }
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    border-bottom: 1px dashed var(--border);
    padding: 8px 14px;
  }
  .table td.num { text-align: right; }
  .table tr td:last-child { border-bottom: 0; }
  .table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    flex-shrink: 0;
  }
}

/* ── Sidebar feed (activity stream) ─────────────────────────── */
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.feed li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  align-items: baseline;
  position: relative;
  padding-left: 14px;
}
.feed li:first-child { border-top: 0; }
.feed li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.feed li.feed--ok::before    { background: var(--ok); }
.feed li.feed--warn::before  { background: var(--warn); }
.feed li.feed--info::before  { background: var(--info); }
.feed li.feed--alert::before { background: var(--bad); }
.feed__time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.feed__title {
  color: var(--ink);
  font-weight: 500;
  grid-column: 1 / -1;
  margin-top: 1px;
}
.feed__meta {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

/* ── KV list (technical health, properties) ─────────────────── */
.kv {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  font-size: var(--t-body);
}
.kv dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.kv dd {
  margin: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── Quick action grid ──────────────────────────────────────── */
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.quick a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--surface-2);
  font-size: var(--t-meta);
  color: var(--ink);
  transition: background 0.12s;
}
.quick a:hover { background: var(--surface-3); border-color: var(--border-2); color: var(--brand); }
.quick svg { color: var(--ink-faint); flex-shrink: 0; }
.quick a:hover svg { color: var(--brand); }

/* ── Mobile bottom tabbar ───────────────────────────────────── */
.tabbar {
  display: none;
}
@container app (max-width: 720px) {
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px 10px;
    z-index: 20;
    box-shadow: 0 -1px 0 var(--border), 0 -8px 24px -8px rgba(0,0,0,0.08);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10px;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
    text-decoration: none;
  }
  .tabbar a.is-active { color: var(--brand); }
  .tabbar a svg { color: currentColor; }
}

/* ── Filter row (above tables) ──────────────────────────────── */
.filter-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--s-4);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--surface);
}
.filter-row .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.filter-row .field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.filter-row select,
.filter-row input {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  padding: 6px 28px 6px 10px;
  font-family: var(--font-ui);
  font-size: var(--t-body);
  color: var(--ink);
  min-width: 130px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='currentColor' opacity='0.5' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filter-row input { background-image: none; padding-right: 10px; }

/* ── Bottom row / meta / muted prose ────────────────────────── */
.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: var(--s-4) 0 var(--s-2);
}
.muted { color: var(--ink-muted); }

.footer-note {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-note em { font-style: normal; color: var(--ink-muted); }

/* ── Card surface (offer cards, etc.) ───────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
}

/* ── Direction-specific accents ─────────────────────────────── */

/* signal: leans monospace, has subtle scan-line texture on dash bg */
[data-direction="signal"] .h1 {
  font-weight: 500;
  letter-spacing: -0.005em;
}
[data-direction="signal"] .kpi-card__value {
  font-weight: 500;
  letter-spacing: -0.01em;
}
[data-direction="signal"] .kpi-card {
  background-image: linear-gradient(180deg, transparent 0%, transparent calc(100% - 2px), var(--brand) calc(100% - 2px));
  background-repeat: no-repeat;
  background-size: 0 100%;
  transition: background-size 0.3s;
}
[data-direction="signal"] .kpi-card:hover {
  background-size: 100% 100%;
}

/* halcyon: serif h1, h2; warm tones; subtle paper grain */
[data-direction="halcyon"] {
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(28,25,20,0.03), transparent 50%);
}
[data-direction="halcyon"] .h1 { font-weight: 400; letter-spacing: -0.025em; }
[data-direction="halcyon"] .h1 em { font-style: italic; color: var(--brand); }
[data-direction="halcyon"] .kpi-card__value { font-weight: 400; letter-spacing: -0.02em; }
[data-direction="halcyon"] .h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; letter-spacing: -0.02em; }
[data-direction="halcyon"] .h2 em { font-style: italic; color: var(--brand); }

/* ledger: clean, no extra flourishes */
[data-direction="ledger"] .h1 { font-weight: 700; }
