/* AXE Command Center — shared design system (mockup).
   Colors come from the trustaxe.com website (site/site.css, "Teal & Grey"): white header, deep teal actions on a
   cool grey page, deep teal-ink dark bands. No neon. Barlow for UI, Barlow Condensed for display, JetBrains Mono
   for numbers and IDs. Light look only, by choice. Module styles live in css/<module>.css. */

:root {
  --bg: #eef2f2;
  --surface: #ffffff;
  --surface-2: #f5f8f8;
  --surface-3: #e9f0f0;
  --ink: #15262b;
  --ink-2: #4d6067;
  --ink-3: #586a71;
  --line: #d6dfe0;
  --line-2: #e6ecec;
  --ctl-line: #9aabb0;
  --brand: #1f5c63;
  --brand-deep: #174a50;
  --brand-soft: #e1eeef;
  --brand-tint: #f0f6f6;
  --band: #15262b;
  --band-2: #1c3238;
  --band-ink: #e6f0f1;
  --band-muted: #a9c0c3;
  --band-eyebrow: #7fc5cc;
  --band-rule: rgba(255, 255, 255, .12);
  --ok: #2c7a4b; --ok-soft: #e1f2e7;
  --warn: #8a5a00; --warn-soft: #fbf0d9;
  --bad: #b23b2e; --bad-soft: #f8e3df;
  --quar: #7a4fb0; --quar-soft: #efe7f8;
  --info: #1f5c63; --info-soft: #e1eeef;
  /* chart series: teal family first, then the flag colors softened */
  --c1: #1f5c63; --c2: #3e8f97; --c3: #7fc5cc; --c4: #b9dfe2; --c5: #8a5a00; --c6: #7a4fb0; --c7: #2c7a4b; --c8: #b23b2e;
  --shadow-1: 0 1px 2px rgba(21, 38, 43, .06), 0 2px 8px rgba(21, 38, 43, .05);
  --shadow-2: 0 2px 6px rgba(21, 38, 43, .08), 0 14px 40px rgba(21, 38, 43, .14);
  --r: 12px; --r-sm: 8px; --r-xs: 6px;
  --f-ui: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-head: "Barlow Condensed", "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --f-semi: "Barlow Semi Condensed", "Barlow", sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --top-h: 56px;
  --side-w: 236px;
  --tabbar-h: 64px;
  --gutter: 24px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.num, .mono { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.app { min-height: 100%; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--top-h) minmax(0, 1fr); }
.side { grid-row: 1 / span 2; background: var(--band); color: var(--band-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 0 16px; z-index: 30; }
.side .logo { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px; border-bottom: 1px solid var(--band-rule); color: #fff; text-decoration: none; }
.side .logo img { height: 24px; width: auto; }
.side .logo span { font: 600 15px/1.1 var(--f-semi); letter-spacing: .02em; color: var(--band-muted); }
.side .group { padding: 14px 10px 4px; }
.side .group-label { font: 700 11px var(--f-num); letter-spacing: .12em; text-transform: uppercase; color: var(--band-eyebrow); padding: 0 10px 6px; opacity: .85; }
.navlink { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--band-ink); font-weight: 600; font-size: 14.5px; text-decoration: none; position: relative; }
.navlink svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.navlink:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.navlink[aria-current="page"] { background: rgba(127,197,204,.16); color: #fff; }
.navlink[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--band-eyebrow); }
.navlink .count { margin-left: auto; font: 600 11.5px var(--f-num); background: rgba(255,255,255,.12); color: var(--band-ink); border-radius: 999px; padding: 1px 7px; }
.side .foot { margin-top: auto; padding: 12px 18px 0; border-top: 1px solid var(--band-rule); font-size: 12.5px; color: var(--band-muted); }

.top { grid-column: 2; position: sticky; top: 0; z-index: 25; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter); min-width: 0; }
.top .crumb { font: 600 15px var(--f-semi); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .crumb b { color: var(--ink); }
.top .spacer { flex: 1; }
.top .search { position: relative; width: min(360px, 34vw); }
.top .search input { width: 100%; height: 38px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 0 14px 0 36px; }
.top .search svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--ink-3); }
.top .iconbtn { position: relative; }
.top .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.top .me { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.top .mobile-logo { display: none; }

.main { grid-column: 2; min-width: 0; padding: 22px var(--gutter) 48px; }
.page { display: grid; gap: 18px; min-width: 0; }

.tabbar { display: none; }

/* ---------- page header and toolbar ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.ph .t { display: grid; gap: 4px; min-width: 0; }
.ph .eyebrow { font: 700 11.5px var(--f-num); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.ph h1 { font: 700 30px/1.05 var(--f-head); letter-spacing: -.005em; }
.ph .sub { color: var(--ink-2); font-size: 14.5px; }
.ph .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tb { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.tb .grow { flex: 1; }
.tb .tb-search { position: relative; min-width: 200px; }
.tb .tb-search input { padding-left: 32px; }
.tb .tb-search svg { position: absolute; left: 10px; top: 12px; width: 15px; height: 15px; color: var(--ink-3); }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid var(--ctl-line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.lg { min-height: 46px; padding: 10px 20px; font-size: 15.5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.input, select.input, textarea.input { width: 100%; min-height: 40px; border: 1px solid var(--ctl-line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 11px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,92,99,.18); }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--ctl-line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; min-height: 36px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 38px; height: 22px; border-radius: 999px; background: #c5d0d2; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); min-width: 0; }
.card.pad, .card .pad { padding: 16px 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; flex-wrap: wrap; }
.card-h h2, .card-h h3 { font: 700 18px/1.15 var(--f-semi); }
.card-h .sub { font-size: 13px; color: var(--ink-3); }
.card-b { padding: 12px 18px 16px; }
.band { background: var(--band); color: var(--band-ink); border-radius: var(--r); position: relative; overflow: hidden; }
.band .muted { color: var(--band-muted); }
.band .eyebrow { color: var(--band-eyebrow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.split.wide-side { grid-template-columns: minmax(0, 1fr) 420px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--shadow-1); min-width: 0; text-align: left; font: inherit; color: inherit; }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--brand); }
.kpi .k { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.kpi .v { font: 700 28px/1.1 var(--f-head); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta { font: 600 12px var(--f-num); padding: 1px 6px; border-radius: 999px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }

/* badges, chips, avatars */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; letter-spacing: .01em; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.quar { background: var(--quar-soft); color: var(--quar); }
.badge.info, .badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.solid { background: var(--brand); color: #fff; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ctl-line); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; min-height: 32px; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .x { font-weight: 700; opacity: .8; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 12px var(--f-semi); color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }

/* tables */
.tablewrap { overflow-x: auto; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 700 11.5px var(--f-num); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--brand-tint); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--f-num); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 10px 14px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { font: 600 11.5px var(--f-num); background: var(--surface-3); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }

/* lists and timelines */
.list { display: grid; }
.li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.li .meta { font-size: 12.5px; color: var(--ink-3); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .ti { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.timeline .ti svg { width: 12px; height: 12px; }
.timeline .tt { font-weight: 600; font-size: 14px; }
.timeline .td { font-size: 13px; color: var(--ink-2); }
.timeline .tm { font-size: 12px; color: var(--ink-3); }

/* progress */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); display: grid; gap: 8px; justify-items: center; }
.empty svg { width: 28px; height: 28px; opacity: .6; }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; background: rgba(21, 38, 43, .42); z-index: 80; animation: fadeIn .15s ease-out; }
.modal { position: fixed; z-index: 81; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-2); animation: popIn .16s ease-out; }
.modal.lg { width: min(920px, calc(100vw - 32px)); }
.modal.sm { width: min(440px, calc(100vw - 32px)); }
.modal-h, .drawer-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2, .drawer-h h2 { font: 700 20px/1.15 var(--f-semi); }
.modal-b, .drawer-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer { position: fixed; z-index: 81; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-2); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: slideIn .2s ease-out; }
.drawer.wide { width: min(760px, 100vw); }
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2); animation: popIn .18s ease-out; pointer-events: auto; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); }
.toast.ok::before { content: "✓"; color: #9fe0b5; }
.toast.bad::before { content: "!"; color: #ffb4a8; font-weight: 800; }
.toast button { background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 6px; padding: 2px 8px; font-weight: 700; cursor: pointer; }
.menu { position: fixed; z-index: 85; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-2); padding: 4px; min-width: 200px; max-height: 60vh; overflow: auto; animation: popIn .12s ease-out; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; min-height: 36px; }
.menu button:hover, .menu button:focus-visible { background: var(--brand-soft); outline: none; }
.menu button[aria-checked="true"] { font-weight: 700; color: var(--brand); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu .lbl { font: 700 11px var(--f-num); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 10px 2px; }
.tip { position: fixed; z-index: 95; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow-2); max-width: 260px; line-height: 1.35; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.toast, .menu { animation-name: fadeUp; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* AI accents (used by AI drafts and summaries) */
.ai { display: inline-flex; align-items: center; gap: 6px; font: 700 11.5px var(--f-num); letter-spacing: .06em; text-transform: uppercase; color: var(--quar); }
.ai svg { width: 14px; height: 14px; }
.ai-box { border: 1px solid #d9c9ef; background: linear-gradient(180deg, #faf6ff, #ffffff); border-radius: var(--r-sm); padding: 12px 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split, .split.wide-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1024px) {
  :root { --side-w: 68px; --gutter: 20px; }
  .side .logo span, .side .group-label, .navlink .lbl, .navlink .count, .side .foot { display: none; }
  .side .logo { padding: 0; justify-content: center; }
  .side .logo img { height: 18px; }
  .navlink { justify-content: center; padding: 10px; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top .search { width: 240px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top-h) minmax(0, 1fr); }
  .side { display: none; }
  .top, .main { grid-column: 1; }
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .top .mobile-logo { display: block; height: 20px; }
  .top .search { display: none; }
  .top .me .nm { display: none; }
  .main { padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--band); padding-bottom: env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--band-rule); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--band-muted); font: 600 11px var(--f-ui); text-decoration: none; border: 0; background: none; cursor: pointer; min-height: var(--tabbar-h); }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar [aria-current="page"] { color: #fff; }
  .tabbar [aria-current="page"] svg { color: var(--band-eyebrow); }
  .ph h1 { font-size: 26px; }
  .kpis, .g2, .g3, .g4, .fgrid { grid-template-columns: minmax(0, 1fr); }
  .kpis.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 24px; }
  .modal { top: auto; bottom: 0; left: 0; transform: none; width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetUp .2s ease-out; }
  .drawer, .drawer.wide { width: 100vw; }
  .toasts { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  .hide-phone { display: none !important; }
}
@media (min-width: 641px) { .only-phone { display: none !important; } }
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } }

/* More sheet (phone) */
.sheet-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sheet-nav a { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); font-weight: 600; font-size: 13px; text-align: center; text-decoration: none; }
.sheet-nav a svg { width: 22px; height: 22px; color: var(--brand); }
