/* Torus Capital fundraising report. Light mode only. */
:root {
  color-scheme: light only;
  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f4f3ef;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e6e5de;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --good: #0b7a34;
  --bad: #c0322f;
  /* categorical hues — fixed order, validated (CVD + normal-vision safe) */
  --cat-0: #2f6fd0; /* blue   */
  --cat-1: #b8742a; /* amber  */
  --cat-2: #1b9e77; /* teal   */
  --cat-3: #7d3ac4; /* purple */
  --accent: #2f6fd0;
  /* status (reserved — always with a label, never color-alone) */
  --won: #0b7a34;
  --lost: #c0322f;
  --active: #2f6fd0;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
a { color: var(--cat-0); }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
}
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 20px; margin: 0 0 2px; }
.brand-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.gate label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.gate input[type="password"] {
  width: 100%; font-size: 15px; padding: 11px 12px;
  border-radius: var(--radius); border: 1px solid var(--baseline);
  background: var(--plane); color: var(--text-primary);
}
.gate input:focus { outline: 2px solid var(--cat-0); outline-offset: 1px; border-color: transparent; }
.gate button {
  width: 100%; margin-top: 16px; padding: 11px 12px;
  font-size: 15px; font-weight: 600; color: #fff;
  background: var(--cat-0); border: none; border-radius: var(--radius); cursor: pointer;
}
.gate button:disabled { opacity: 0.6; cursor: default; }
.gate-error { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }
.gate-note { color: var(--muted); font-size: 12px; margin-top: 20px; }

/* ---------- layout ---------- */
.hidden { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
header.page { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
header.page h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.meta-line { color: var(--muted); font-size: 12.5px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head .hint { color: var(--muted); font-size: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 14px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- hero ---------- */
.hero {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.hero .label { color: var(--text-secondary); font-size: 13px; margin: 0 0 6px; }
.hero .big { font-size: 46px; font-weight: 720; letter-spacing: -0.03em; line-height: 1; }
.hero .sub { color: var(--muted); font-size: 13px; margin-top: 10px; }
.hero-right { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.meter-track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter-fill { height: 100%; background: var(--won); border-radius: 999px; }
.meter-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); }
.hero-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.hero-facts .f { display: flex; flex-direction: column; }
.hero-facts .f .fk { color: var(--muted); font-size: 11.5px; }
.hero-facts .f .fv { font-size: 18px; font-weight: 640; letter-spacing: -0.01em; }

/* ---------- KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 820px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 15px;
  border-top: 3px solid var(--accent, var(--cat-0));
}
.tile .k { color: var(--text-secondary); font-size: 12px; margin: 0 0 8px; display: flex; align-items: center; gap: 7px; }
.tile .k .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.tile .v { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.delta { font-size: 12.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }

/* ---------- charts (SVG) ---------- */
.card h3 { font-size: 14px; margin: 0 0 2px; font-weight: 600; }
.card .csub { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.card svg { width: 100%; height: auto; display: block; }
.bar { transition: opacity 0.1s; }
.bar:hover { opacity: 0.82; cursor: default; }
.axis-label, .val-label { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.val-label { fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--baseline); stroke-width: 1; }

/* ---------- horizontal bars (funnel / channels / breakdowns) ---------- */
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; }
.hbar .hb-label { font-size: 12.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 7px; }
.hbar .hb-label .dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.hbar .hb-track { background: var(--surface-2); border-radius: 6px; height: 22px; overflow: hidden; }
.hbar .hb-fill { height: 100%; border-radius: 6px; min-width: 2px; }
.hbar .hb-val { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-primary); min-width: 44px; text-align: right; }
.hbar .hb-val .muted { color: var(--muted); }

/* stacked share bar (channels) */
.share { display: flex; height: 30px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.share .seg { height: 100%; min-width: 3px; display: flex; align-items: center; justify-content: center; }
.share .seg span { color: #fff; font-size: 11.5px; font-weight: 600; padding: 0 6px; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.legend .li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-secondary); }
.legend .li .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .li b { color: var(--text-primary); font-weight: 640; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 12px; text-align: left; }
table.tbl th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr + tr td { border-top: 1px solid var(--grid); }
table.tbl td .dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 20px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pill.won { color: var(--won); background: rgba(11, 122, 52, 0.1); }
.pill.lost { color: var(--lost); background: rgba(192, 50, 47, 0.1); }
.pill.active { color: var(--active); background: rgba(47, 111, 208, 0.1); }
.pill.warn { color: #9a6a00; background: rgba(184, 116, 42, 0.14); }

/* ---------- coverage panel ---------- */
.coverage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
@media (max-width: 820px) { .coverage { grid-template-columns: 1fr; } }
.cov-row { display: grid; grid-template-columns: 1fr 70px 46px; align-items: center; gap: 10px; }
.cov-row .cov-label { font-size: 12.5px; color: var(--text-secondary); }
.cov-track { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cov-fill { height: 100%; background: var(--cat-0); border-radius: 999px; }
.cov-fill.empty { background: var(--baseline); }
.cov-pct { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* empty state */
.empty-state { color: var(--muted); font-size: 12.5px; padding: 10px 0; }

/* notes / footer */
.notes { margin-top: 8px; }
.notes .note { color: var(--text-secondary); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.notes .note::before { content: "•"; color: var(--muted); }
footer.page { margin-top: 42px; padding-top: 16px; border-top: 1px solid var(--grid); color: var(--muted); font-size: 12px; }

/* tooltip */
#tip {
  position: fixed; pointer-events: none;
  background: var(--text-primary); color: var(--surface);
  padding: 6px 9px; border-radius: 7px; font-size: 12px;
  opacity: 0; transition: opacity 0.08s; white-space: nowrap; z-index: 10;
  font-variant-numeric: tabular-nums;
}
