/* Quiet, compact, data-first. Small type, hairline borders, one accent. */
:root {
  --bg: #f7f8f7; --panel: #ffffff; --ink: #1c2420; --ink-2: #4a5550; --muted: #87918c; --line: #e6e9e7; --hover: #f2f4f3;
  --accent: #0a9f4c; --accent-soft: #e6f5ec; --bad: #c2453b; --bad-soft: #fbecea; --warn: #9a6400; --warn-soft: #fdf3e1;
  --s1: #0a9f4c; --s2: #3b7dd8; --s3: #8b5cd6;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121514; --panel: #181c1a; --ink: #e4e8e6; --ink-2: #b4bcb8; --muted: #7c8681; --line: #262c29; --hover: #1e2321;
    --accent: #2fc072; --accent-soft: #173024; --bad: #ef7b70; --bad-soft: #35201e; --warn: #e9b259; --warn-soft: #2e2516;
    --s1: #2fc072; --s2: #6ea4ee; --s3: #b393f0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121514; --panel: #181c1a; --ink: #e4e8e6; --ink-2: #b4bcb8; --muted: #7c8681; --line: #262c29; --hover: #1e2321;
  --accent: #2fc072; --accent-soft: #173024; --bad: #ef7b70; --bad-soft: #35201e; --warn: #e9b259; --warn-soft: #2e2516;
  --s1: #2fc072; --s2: #6ea4ee; --s3: #b393f0; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 max(16px, env(safe-area-inset-left, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo { height: 18px; width: auto; display: block; }
.product { font-size: 12px; font-weight: 500; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
nav { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.tab { border: 0; background: transparent; color: var(--ink-2); padding: 5px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.tab:hover { background: var(--hover); }
.tab.on { background: var(--hover); color: var(--ink); font-weight: 500; }
#who { color: var(--muted); margin: 0 6px 0 10px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 5px 6px; }
.link:hover { color: var(--ink); }

main { max-width: 1120px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h1 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
h2 { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 24px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; }

select, input { font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Stat strip: one bordered row, cells divided by hairlines. */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.stat { padding: 12px 14px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .k { font-size: 11px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v.pending { color: var(--muted); }
.stat .d { font-size: 11px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.chart { padding: 12px 14px 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); padding: 2px 0 2px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 500; font-size: 11px; background: var(--bg); position: sticky; top: 0; }
thead th:first-child { border-top-left-radius: 8px; } thead th:last-child { border-top-right-radius: 8px; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 500; background: var(--hover); color: var(--ink-2); }
.pill.Contacted { background: #e8f0fb; color: #2f62ad; }
.pill.Signed { background: var(--accent-soft); color: var(--accent); }
.pill.dq { background: var(--bad-soft); color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.Contacted { background: #1b2840; color: #8fb6f2; } }
:root[data-theme="dark"] .pill.Contacted { background: #1b2840; color: #8fb6f2; }
td select { padding: 2px 6px; font-size: 11.5px; color: var(--ink-2); }
.warn { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 6px 10px; font-size: 12px; margin: 0 0 12px; }
.empty { color: var(--muted); padding: 20px; text-align: center; font-size: 12px; }
.clickrow { cursor: pointer; }

.login { max-width: 320px; margin: 12vh auto 0; padding: 24px; }
.login .logo { height: 22px; margin-bottom: 18px; }
.login h1 { font-size: 15px; }
.login form { display: grid; gap: 8px; margin-top: 14px; }
.login label { font-size: 11px; color: var(--muted); font-weight: 500; }
.login input { font-size: 13px; padding: 7px 9px; }
.btn { font: inherit; font-size: 13px; font-weight: 500; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; margin-top: 4px; }
.err { color: var(--bad); font-size: 12px; min-height: 18px; }

@media (max-width: 760px) {

  #who { display: none; }
}

/* Two 3-up stat rows: outcomes, then cost. */
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.cost { margin-top: 8px; }
.stats.three .stat:last-child { grid-column: auto; }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 24px 0 8px; }
.sectionhead h2 { margin: 0; }

/* Daily volume: bars grow on hover, click selects a day. */
.daily .bar { cursor: pointer; outline: none; }
.daily .bar.zero { cursor: default; }
.daily .col { fill: var(--s1); opacity: .8; transform-box: fill-box; transform-origin: 50% 100%; transition: transform .14s ease, opacity .14s ease; }
.daily .cnt { fill: var(--ink-2); opacity: .9; transition: opacity .14s; }
.daily .bar:not(.zero):hover .col, .daily .bar:focus-visible .col { transform: scale(1.35, 1.06); opacity: 1; }
.daily .bar.on .col { fill: var(--accent); opacity: 1; transform: scale(1.35, 1.06); }
.daily .bar.dim .col { opacity: .3; }
.daily .bar.dim .cnt { opacity: .35; }
.daily .bar:focus-visible .hit { stroke: var(--accent); stroke-width: 1; }
@media (prefers-reduced-motion: reduce) { .daily .col { transition: none; } }

.chip { font: inherit; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.chip:hover { background: var(--hover); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 560px) {
  .stats.three { grid-template-columns: 1fr; }
  .stats.three .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stats.three .stat:first-child { border-top: 0; }
}
