/* dash.plan4me.ai: the founder dashboard.
   Tokens, type and components copied from website/styles.css. The brand is
   light only, so this page is too. Inter carries the headings and the display
   figures; the site's .mono (Fragment Mono, 400, letter-spacing 0) carries the
   small data surfaces: axis labels, numeric table columns, cohort cells, bar
   counts, funnel rates and tooltips. */

:root {
  color-scheme: light;
  --primary-background: #fafafa;
  --card-background: #ededed;
  --primary-text: #171717;
  --neutral-100: #f0f0f0;
  --neutral-300: #e6e6e6;
  --neutral-500: #5c5c5c;
  --neutral-700: #363636;
  --neutral-800: #242424;
  --white: #ffffff;
  --darken-50: rgba(0, 0, 0, 0.06);
  --secondary-text: var(--neutral-500);
  --forest: #1b5e20;
  --forest-tint: #eef3f0;
  --warn: #8a6116;
  --warn-tint: #f2ebdc;
  --bad: #b3261e;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Fragment Mono', ui-monospace, 'SF Mono', monospace;
  --rounded-md: 16px;
  --rounded-lg: 24px;

  /* Chart roles, validated on #fafafa/#ededed. Forest stays the UI accent, never a series. */
  --ink: var(--primary-text);
  --sec: var(--neutral-500);
  --surface: var(--white);
  --line: var(--neutral-300);
  --line-2: var(--neutral-100);
  --s1: #2f8a3a;
  --s2: #2b6cb0;
  --s3: #d9731a;
  --s4: #8e4a9e;
  --mute-bar: #c9c9c9;

  /* Revenue tiers above the line, cost categories below it. */
  --r1: #256e2e;
  --r2: #3f9e4c;
  --r3: #8fcb96;
  --c1: #2b6cb0;
  --c2: #d9731a;
  --c3: #8e4a9e;
  --c4: #8a6116;
  --c5: #b5b5b5;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--primary-background);
  color: var(--primary-text);
  font-family: var(--f-sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: -0.025em;
  -webkit-font-smoothing: antialiased;
  padding-inline: 24px;
  padding-block: 0 64px;
  overflow-x: clip;
}
::selection { background: var(--neutral-800); color: var(--white); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1140px; margin: 0 auto; }

/* Nav, as on the site */
.nav { display: flex; align-items: center; gap: 12px; padding: 20px 0; }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.04em; font-size: 18px; }
.nav__glyph { width: 32px; height: 32px; border-radius: 9px; background: var(--neutral-800); display: inline-flex; align-items: center; justify-content: center; color: var(--white); font-size: 13px; font-weight: 700; letter-spacing: -0.02em; }
.nav__page { color: var(--secondary-text); font-weight: 500; font-size: 18px; letter-spacing: -0.025em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--rounded-md); font-size: 18px; font-weight: 500; letter-spacing: -0.025em; white-space: nowrap; border: 0; cursor: pointer; font-family: inherit; transition: background .2s, box-shadow .2s; }
.btn--primary { background: var(--neutral-800); color: var(--white); box-shadow: inset 0 -4px 4px -2px rgba(0, 0, 0, .25); }
.btn--primary:hover { background: var(--neutral-700); }

/* The token gate: one white panel on the paper. */
.gate { display: flex; justify-content: center; padding: 56px 0; }
.gate__panel { width: 100%; max-width: 420px; }
.gate form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.gate__label { font-size: 14px; font-weight: 500; color: var(--sec); }
.gate__input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--f-mono); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.gate__input:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.gate__msg { font-size: 15px; font-weight: 600; color: var(--bad); letter-spacing: -0.02em; }

/* The dashboard frame is a site card: #ededed, 24px radius, no border, no shadow.
   Inner panels are white. */
.board { background: var(--card-background); color: var(--ink); border-radius: var(--rounded-lg); padding: 32px; display: flex; flex-direction: column; gap: 20px; font-size: 16px; letter-spacing: -0.02em; }
.board .topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.board .topbar .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.04em; font-size: 18px; }
.board .topbar .page { color: var(--sec); font-weight: 500; }
.board .topbar .page b { color: var(--ink); font-weight: 600; }
.board .range { display: flex; gap: 4px; margin-left: auto; }
.board .range b { font-size: 14px; font-weight: 500; padding: 7px 11px; border-radius: 10px; color: var(--sec); cursor: pointer; user-select: none; }
.board .range b.on { background: var(--neutral-800); color: var(--white); }

.panel { background: var(--surface); border-radius: var(--rounded-md); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.panel .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel .hd h4 { font-size: 18px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.17; }
.panel .hd .sub { font-size: 14px; color: var(--sec); font-weight: 500; }
.panels-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panels-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }

/* Lede and figures: Inter 700, tight, like the price figures. */
.lede-row { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: end; }
.lede { font-size: 32px; font-weight: 600; line-height: 1.14; letter-spacing: -0.05em; max-width: 26ch; text-wrap: balance; min-height: 1.14em; }
.lede em { font-style: normal; color: var(--forest); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi { background: var(--surface); border-radius: var(--rounded-md); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.kpi .l { font-size: 14px; font-weight: 500; color: var(--sec); }
.kpi .v { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; min-height: 44px; }
.kpi .d { font-size: 14px; color: var(--sec); font-weight: 500; }
.kpi .d.up { color: var(--forest); }
.kpi .d.down { color: var(--bad); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--sec); font-weight: 500; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.legend .grp { color: var(--sec); margin-right: 2px; }

svg { display: block; width: 100%; max-width: 100%; }
svg text { font-family: var(--f-mono); fill: var(--sec); font-size: 11.5px; font-weight: 400; letter-spacing: 0; }
svg .grid { stroke: var(--line-2); }
svg .axis { stroke: var(--line); }

table.plain { color: inherit; width: 100%; border-collapse: collapse; font-size: 15px; letter-spacing: -0.02em; }
table.plain th { text-align: left; font-weight: 500; color: var(--sec); font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
table.plain td { padding: 10px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.plain td.num, table.plain th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-weight: 400; letter-spacing: 0; }
table.plain tr:last-child td { border-bottom: 0; }
table.plain td.hi { color: var(--bad); font-weight: 600; }
table.plain tr.total td { border-top: 1px solid var(--line); font-weight: 700; letter-spacing: -0.03em; }
table.plain tr.total td.neg { color: var(--bad); }
table.plain td.dim { color: var(--sec); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 9px; }

.bar-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; font-size: 15px; }
.bar-row .track { display: block; height: 10px; background: var(--card-background); border-radius: 5px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; background: var(--s1); border-radius: 5px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--sec); font-family: var(--f-mono); font-weight: 400; letter-spacing: 0; }
.bar-row.mute .fill { background: var(--mute-bar); }
.note { font-size: 14px; color: var(--sec); font-weight: 500; }

.pl-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.pl-head .fig { display: flex; flex-direction: column; gap: 2px; }
.pl-head .fig .l { font-size: 13px; color: var(--sec); font-weight: 500; }
.pl-head .fig .v { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; min-height: 44px; }
.pl-head .fig .v.neg { color: var(--bad); }

.callout { font-size: 15px; font-weight: 500; color: var(--ink); background: var(--forest-tint); border-radius: 10px; padding: 10px 14px; }
.callout b { color: var(--forest); font-weight: 700; }

/* Funnel wall */
.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; min-height: 232px; }
.fcol { display: flex; flex-direction: column; gap: 8px; justify-content: end; }
.fcol .n { font-size: 36px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.fcol .n.zero { color: var(--sec); }
.fcol .lbl { font-size: 14px; color: var(--sec); line-height: 1.3; font-weight: 500; }
.fcol .col { border-radius: 8px 8px 0 0; background: var(--s1); min-height: 4px; position: relative; overflow: hidden; }
.fcol .col .and { position: absolute; left: 0; right: 0; bottom: 0; background: var(--s2); }
.fcol .col .and::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--surface); }
.fcol .rate { font-size: 13px; color: var(--sec); font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-weight: 400; letter-spacing: 0; min-height: 2.66em; }
.fcol .rate b { color: var(--ink); font-weight: 600; }
.fcol .rate.drop b { color: var(--bad); }

.cohort { display: grid; grid-template-columns: 80px repeat(5, 1fr); gap: 4px; font-size: 13px; align-items: center; }
.cohort .h { color: var(--sec); font-size: 12px; text-align: center; font-weight: 500; }
.cohort .wk { color: var(--sec); font-weight: 500; }
.cohort .c { height: 34px; border-radius: 8px; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--ink); }

.tip { position: fixed; pointer-events: none; z-index: 10; background: var(--neutral-800); color: var(--white); font-family: var(--f-mono); font-size: 13px; font-weight: 400; letter-spacing: 0; padding: 7px 10px; border-radius: 10px; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; opacity: 0; transition: opacity .12s; font-variant-numeric: tabular-nums; }
.tip.show { opacity: 1; }
.tip b { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

/* Narrower screens: grids collapse to one column, nothing scrolls sideways. */
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .panels-2, .panels-3-2 { grid-template-columns: 1fr; }
  .lede-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .funnel { grid-template-columns: repeat(3, 1fr); min-height: 0; }
  .fcol .n { font-size: 28px; }
  /* Three columns on a phone leave the rate about ten mono characters a
     line, so the caption takes a third one and the row has to make room
     for it or the bars stop sharing a baseline. */
  .fcol .rate { min-height: 4em; }
}
@media (max-width: 640px) {
  body { padding-inline: 16px; }
  .board { padding: 20px; gap: 16px; }
  .board .range { margin-left: 0; }
  .panel { padding: 18px; }
  .lede { font-size: 26px; }
  .kpi { padding: 16px 18px; }
  .kpi .v, .pl-head .fig .v { font-size: 36px; min-height: 36px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 112px 1fr 34px; gap: 8px; font-size: 14px; }
  .cohort { grid-template-columns: 56px repeat(5, 1fr); gap: 3px; }
  .cohort .c { font-size: 11.5px; height: 30px; border-radius: 7px; }
  .cohort .wk { font-size: 12px; }
  table.plain { font-size: 14px; }
  table.plain th { font-size: 12px; }
}
