:root {
  --ink: #1a1030;
  --canvas: #f6f0e6;
  --surface: #fffdf8;
  --surface-2: #f8f1e4;
  --border: rgba(92, 61, 20, 0.12);
  --border-strong: rgba(92, 61, 20, 0.22);
  --text: #241533;
  --muted: #6b5878;
  --primary: #8a2f4b;
  --accent: #6d2140;
  --gold: #b5812f;
  --gold-soft: #f3e2c2;
  --jade: #0f6e56;
  --sapphire: #1d4e89;
  --sidebar: 248px;
  --topbar: 64px;
  --row: 44px;
  --type: 14px;
  --success-bg: #e5f6ef;
  --success-fg: #0c6b4d;
  --warning-bg: #fff1d6;
  --warning-fg: #8a5a12;
  --danger-bg: #fde8ea;
  --danger-fg: #9f2d3c;
  --info-bg: #e7eef8;
  --info-fg: #1d4e89;
  --neutral-bg: #f3eadc;
  --neutral-fg: #5c4a38;
  --shadow: 0 1px 2px rgba(36, 21, 51, 0.05), 0 14px 36px rgba(92, 45, 28, 0.08);
  --shadow-pop: 0 28px 70px rgba(26, 16, 48, 0.22);
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --canvas: #120c1c;
  --surface: #1c1428;
  --surface-2: #261b34;
  --border: rgba(232, 196, 140, 0.14);
  --border-strong: rgba(232, 196, 140, 0.28);
  --text: #f8f1e6;
  --muted: #d4c3b0;
  --ink: #0d0814;
  --gold: #e2b65c;
  --gold-soft: #3a2c18;
  --primary: #e7b0c0;
  --accent: #c46b86;
  --success-bg: #0d3328;
  --success-fg: #7ddeb8;
  --warning-bg: #3d2c12;
  --warning-fg: #f5d089;
  --danger-bg: #3f1820;
  --danger-fg: #ffb3c0;
  --info-bg: #152844;
  --info-fg: #b9d2f5;
  --neutral-bg: #2a2138;
  --neutral-fg: #f0e4d4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 44px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 28px 70px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--type);
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 380px at 0% -8%, rgba(181, 129, 47, 0.18), transparent 55%),
    radial-gradient(700px 320px at 100% 0%, rgba(138, 47, 75, 0.1), transparent 50%),
    var(--canvas);
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.app { display: flex; min-height: 100%; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background:
    radial-gradient(420px 220px at 20% 0%, rgba(226, 182, 92, 0.22), transparent 60%),
    linear-gradient(180deg, #2a1844 0%, #1a1030 42%, #141028 100%);
  color: #e8eef8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.brand-lockup {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e2b65c, #8a6230);
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 12px; overflow: auto; }
.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c9d4e6;
  text-align: left;
}
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(226, 182, 92, 0.28), rgba(255, 255, 255, 0.06));
  color: #fff8ea;
  box-shadow: inset 3px 0 0 #e2b65c;
}
.side-link .count {
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: #f04438;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}
.side-note {
  margin-top: auto;
  padding: 16px 18px 20px;
  color: #9aabc2;
  font-size: 12px;
  line-height: 1.5;
}
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: var(--topbar);
  height: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.scopes, .top-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.scopes { flex: 1 1 420px; }
.ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--neutral-bg);
}
.ranges button {
  height: 30px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.ranges button[aria-pressed="true"] {
  background: linear-gradient(180deg, #f8e7c4, #e2b65c);
  color: #1a1030;
  box-shadow: 0 1px 2px rgba(26, 16, 48, 0.18);
}
.top-actions { margin-left: auto; }
select.control, button.control, input.control {
  height: 36px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 0 10px;
}
#monthFilter { max-width: 240px; }
#brandFilter { max-width: 160px; }
button.primary {
  height: 36px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: linear-gradient(180deg, #c4964a, #8a6230);
  color: #1a1030;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
button.primary:hover { filter: brightness(1.06); }
button.secondary, button.danger {
  height: 36px;
  border-radius: 10px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
button.secondary:hover { background: var(--surface-2); }
button.danger { color: var(--danger-fg); border-color: #f3c3be; }
button.ghost {
  height: auto;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  padding: 0;
  text-align: left;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e2b65c, #8a6230);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.who small { display: block; color: var(--muted); font-size: 11px; }
.who b { font-weight: 600; }

main { padding: 24px 28px 72px; max-width: 1440px; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kicker { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
h1 { font-family: var(--display); font-size: 34px; line-height: 1.12; font-weight: 560; letter-spacing: -0.03em; margin: 0; }
h2 { font-family: var(--display); font-size: 20px; line-height: 1.3; font-weight: 560; letter-spacing: -0.02em; margin: 0 0 10px; }
h3 { font-size: 15px; line-height: 1.4; font-weight: 650; margin: 0; }
.lede { max-width: 820px; margin: 8px 0 0; color: var(--text); }
.banner {
  background: linear-gradient(90deg, #1a1030, #3a2148 55%, #6d2140);
  color: #f8f1e6;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(226, 182, 92, 0.35);
}
.banner .ghost { color: #e2b65c; }
.banner button { margin-left: 8px; }
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi { padding: 14px 16px 16px; position: relative; overflow: hidden; }
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.kpi-row .kpi:nth-child(5n + 1)::before { background: #b5812f; }
.kpi-row .kpi:nth-child(5n + 2)::before { background: #0f6e56; }
.kpi-row .kpi:nth-child(5n + 3)::before { background: #1d4e89; }
.kpi-row .kpi:nth-child(5n + 4)::before { background: #8a2f4b; }
.kpi-row .kpi:nth-child(5n + 5)::before { background: #6d4a1f; }
.kpi-row .kpi:nth-child(5n + 1) { background: linear-gradient(180deg, #fff8ec, var(--surface)); }
.kpi-row .kpi:nth-child(5n + 2) { background: linear-gradient(180deg, #eef8f4, var(--surface)); }
.kpi-row .kpi:nth-child(5n + 3) { background: linear-gradient(180deg, #f2f6fc, var(--surface)); }
.kpi-row .kpi:nth-child(5n + 4) { background: linear-gradient(180deg, #fdf3f5, var(--surface)); }
.kpi-row .kpi:nth-child(5n + 5) { background: linear-gradient(180deg, #f8f3ea, var(--surface)); }
.kpi button.tile {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
}
.kpi .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kpi .value {
  font-family: var(--display);
  font-size: clamp(24px, 1.8vw, 32px);
  line-height: 1.15;
  font-weight: 560;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 4px;
  color: #1a1030;
}
html[data-theme="dark"] .kpi .value { color: var(--gold); }
html[data-theme="dark"] .kpi-row .kpi:nth-child(5n + 1) { background: linear-gradient(180deg, #2c2214, var(--surface)); }
html[data-theme="dark"] .kpi-row .kpi:nth-child(5n + 2) { background: linear-gradient(180deg, #10261f, var(--surface)); }
html[data-theme="dark"] .kpi-row .kpi:nth-child(5n + 3) { background: linear-gradient(180deg, #132033, var(--surface)); }
html[data-theme="dark"] .kpi-row .kpi:nth-child(5n + 4) { background: linear-gradient(180deg, #2c1520, var(--surface)); }
html[data-theme="dark"] .kpi-row .kpi:nth-child(5n + 5) { background: linear-gradient(180deg, #261c14, var(--surface)); }
.kpi .sub { color: var(--muted); font-size: 12px; line-height: 1.4; min-height: 2.6em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-2 > *, .grid-3 > *, .split > * { min-width: 0; }
.funnel-row, button.brand-line, .trend {
  display: grid;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.funnel-row { grid-template-columns: minmax(88px, 140px) minmax(0, 1fr) auto; margin: 8px 0; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--neutral-bg); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #e2b65c, #8a2f4b); border-radius: inherit; }
.brand-line { grid-template-columns: minmax(88px, 140px) minmax(0, 1fr) auto; margin: 8px 0; }
button.brand-line { border: 0; background: transparent; padding: 4px 0; color: inherit; border-radius: 8px; }
.seg { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--neutral-bg); }
.seg i { display: block; height: 100%; }
.seg .collected { background: var(--success-fg); }
.seg .billed { background: var(--info-fg); }
.seg .unbilled { background: var(--warning-fg); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.legend b { font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.aging .bucket {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  text-align: left;
  color: inherit;
  width: 100%;
}
.aging .bucket:hover, .trend:hover, button.brand-line:hover, .filters button:hover { background: var(--surface-2); }
.trend {
  grid-template-columns: 4.6rem minmax(48px, 1fr) auto minmax(0, max-content);
  border: 0;
  background: transparent;
  padding: 6px 0;
  color: inherit;
  text-align: left;
}
.trend .kicker { white-space: nowrap; }
.aging .amt { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.card:has(table) { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}
td { padding: 0 8px; height: var(--row); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: color-mix(in srgb, var(--neutral-bg) 65%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.success { background: var(--success-bg); color: var(--success-fg); }
.chip.warning { background: var(--warning-bg); color: var(--warning-fg); }
.chip.danger { background: var(--danger-bg); color: var(--danger-fg); }
.chip.info { background: var(--info-bg); color: var(--info-fg); }
.chip.neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.brand { display: inline-flex; align-items: center; gap: 6px; }
.brand i { width: 8px; height: 8px; border-radius: 50%; }
.brand.arena i { background: #2563eb; }
.brand.nexa i { background: #7c3aed; }
.brand.re i { background: #b45309; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters button {
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 0 12px;
}
.filters button[aria-pressed="true"] {
  background: #1a1030;
  color: #f8e7c4;
  border-color: transparent;
}
.bulkbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.pager { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 8px; }
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.attention li:last-child { border-bottom: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 12px; }
.check { list-style: none; margin: 0; padding: 0; }
.check li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.match-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.match-foot .label { color: var(--muted); font-size: 11px; font-weight: 600; }
.drawer-back { position: fixed; inset: 0; background: rgba(7, 11, 20, 0.46); z-index: 20; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 21;
  box-shadow: var(--shadow-pop);
  overflow: auto;
  padding: 20px;
}
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }
.steps span { font-size: 12px; color: var(--muted); }
.steps span.on { color: var(--success-fg); font-weight: 700; }
.waterfall { width: 100%; }
.waterfall td { height: 32px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; height: 36px; color: var(--muted); white-space: nowrap; padding: 0 10px; }
.tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.empty { color: var(--muted); padding: 12px 0; }
.palette {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.5);
  z-index: 30;
  display: grid;
  align-items: start;
  justify-content: center;
  padding-top: 12vh;
}
.palette .panel {
  width: min(640px, calc(100% - 32px));
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.palette input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--border); padding: 0 16px; background: transparent; }
.palette button.hit { width: 100%; text-align: left; border: 0; background: transparent; min-height: 44px; padding: 8px 16px; }
.palette button.hit[aria-selected="true"], .palette button.hit:hover { background: var(--surface-2); }
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  z-index: 40;
  box-shadow: var(--shadow-pop);
}
.phone { max-width: 420px; margin: 0 auto 72px; }
.earn-hero {
  background: linear-gradient(155deg, #3a2148, #1a1030 55%, #6d2140);
  color: #f8f1e6;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(226, 182, 92, 0.35);
}
.earn-hero .value { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; }
.case-card {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  min-height: 56px;
  box-shadow: var(--shadow);
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: none;
  grid-template-columns: repeat(4, 1fr);
  z-index: 6;
}
body.role-dse .sidebar, body.role-dse .topbar .scopes { display: none; }
body.role-dse .bottom-nav { display: grid; }
body.role-dse main { padding: 16px 16px 88px; }
body.role-dse .app { display: block; }
.bottom-nav button { border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.bottom-nav button[aria-current="page"] { color: var(--gold); }
body.compact { --row: 36px; --type: 13px; }
body.comfortable { --row: 48px; --type: 14px; }
body.touch { --row: 56px; --type: 16px; }
body.standard { --row: 42px; }
kbd {
  font-family: var(--font);
  font-size: 11px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--muted);
}
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.chart-grid.two { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.chart-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 8px; align-items: center; }
.donut { width: 100%; height: auto; overflow: visible; }
.donut .donut-total { fill: var(--text); font-family: var(--display); font-size: 16px; }
.donut .donut-sub { fill: var(--muted); font-family: var(--font); font-size: 9px; }
.donut path, .donut circle, .trend-svg g { cursor: pointer; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.legend-list button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent; text-align: left; padding: 3px 0; color: inherit; }
.legend-list b { font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.trend-scroll { overflow-x: auto; }
.trend-svg { width: 100%; height: auto; min-width: 640px; }
.trend-svg text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.funnel-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.funnel-step {
  border: 0;
  color: #fffdf8;
  border-radius: 12px;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  font-weight: 650;
}
.funnel-step:disabled { cursor: default; }
.pivot { border-collapse: separate; border-spacing: 4px; }
.pivot th, .pivot td { border: 0; border-radius: 8px; text-align: center; height: 40px; padding: 0; }
.pivot td button { width: 100%; min-height: 40px; font-weight: 700; }
@media (max-width: 1180px) {
  .grid-3, .aging, .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 20px 16px 72px; }
}
@media (max-width: 860px) {
  .kpi-row, .grid-2, .grid-3, .split, .aging, .match-foot, .chart-grid, .chart-grid.two, .chart-row { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .menu-btn { display: inline-flex !important; }
  .top-actions { width: 100%; }
  .who small { display: none; }
  h1 { font-size: 26px; }
  .funnel-row, .brand-line { grid-template-columns: minmax(72px, 110px) minmax(0, 1fr); }
  .funnel-row b, .brand-line b { grid-column: 1 / -1; }
}
.menu-btn { display: none; align-items: center; }
body.nav-open .sidebar { display: flex; position: fixed; z-index: 15; box-shadow: var(--shadow-pop); }
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(226, 182, 92, 0.35), transparent 55%),
    radial-gradient(600px 300px at 100% 100%, rgba(138, 47, 75, 0.18), transparent 50%),
    #1a1030;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.signed-out .login-gate { display: flex; }
body.signed-out .app, body.signed-out .bottom-nav { display: none; }
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-pop);
}
.login-card h1 { margin: 0; }
.login-card input { width: 100%; }
.file-btn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
