/* LeaveShift — one stylesheet, read once at start-up and served from memory.

   This is a page a business owner or their accountant will look at once and
   decide in about four seconds whether to trust. So: light by default, close to
   the register and the ledger rather than to a dashboard; a deep harbour blue
   that reads institutional without reading like a bank's marketing; and money
   set in tabular figures so a column of it lines up.

   Two semantic colours, kept well away from the accent: sienna where the bill
   goes up, green where it comes down. Neither is a warning. An employer whose
   bill falls is not getting away with anything and one whose bill rises is not
   being punished — the Act changed, and this is the arithmetic. */

:root {
  --bg: #eef1f4;
  --card: #ffffff;
  --sunk: #f4f6f8;
  --line: #d8dee5;
  --ink: #131a21;
  --dim: #55636f;
  --faint: #7d8994;

  --brand: #17506e;
  --brand-ink: #ffffff;
  --brand-soft: #e3edf3;

  --up: #b0492a;      /* costs more */
  --down: #1c7053;    /* costs less */
  --flat: #5b6873;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(19, 26, 33, 0.06), 0 4px 14px rgba(19, 26, 33, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1418;
    --card: #161d23;
    --sunk: #1b232a;
    --line: #2a343d;
    --ink: #e8edf1;
    --dim: #a0adb8;
    --faint: #74818d;
    --brand: #2b7ba3;
    --brand-ink: #06131b;
    --brand-soft: #16303f;
    --up: #e08163;
    --down: #56b894;
    --flat: #8d99a4;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 calc(30px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* -------------------------------------------------------------- the hero */

.hero {
  background: var(--brand); color: var(--brand-ink);
  padding: 26px 0 30px; margin-bottom: 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 650; letter-spacing: 0.01em; opacity: 0.92;
}
.mark {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.16); font-size: 12px; font-weight: 700;
}
.hero h1 {
  margin: 16px 0 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em;
  text-wrap: balance; max-width: 20ch;
}
.lede { margin: 12px 0 0; font-size: 16px; line-height: 1.62; opacity: 0.93; max-width: 62ch; }
.lede b { font-weight: 700; }
.clock {
  margin: 16px 0 0; padding: 8px 12px; display: inline-block;
  background: rgba(255, 255, 255, 0.13); border-radius: 8px;
  font-size: 13.5px; font-variant-numeric: tabular-nums;
}

@media (min-width: 620px) { .hero h1 { font-size: 38px; } }

/* --------------------------------------------------------------- panels */

.card, .findings, .cta {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 16px 0;
}
.card h2, .cta h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -0.01em; }
.sub { margin: 0 0 12px; color: var(--dim); font-size: 14.5px; }
.tiny, .cap { margin: 12px 0 0; color: var(--faint); font-size: 13px; line-height: 1.55; }
.quiet { background: transparent; box-shadow: none; }
code {
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}

/* ----------------------------------------------------------------- form */

.egs {
  display: grid; gap: 8px; margin: 0 0 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.eg {
  cursor: pointer; font: inherit; text-align: left; display: grid; gap: 2px;
  background: var(--sunk); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
}
.eg b { font-size: 14px; font-weight: 650; }
.eg span { color: var(--dim); font-size: 12.5px; line-height: 1.45; }
.eg:hover { border-color: var(--brand); }
.eg.on { border-color: var(--brand); background: var(--brand-soft); }

textarea {
  width: 100%; min-width: 0; display: block;
  background: var(--sunk); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 12px;
  font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; resize: vertical;
}
.go {
  display: block; width: 100%; margin-top: 12px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 650;
  background: var(--brand); color: var(--brand-ink);
  border: 0; border-radius: 9px; padding: 13px;
}
.go:hover { filter: brightness(1.08); }
.eg:focus-visible, .go:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* -------------------------------------------------------------- verdict */

.verdict {
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--flat);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0;
}
.verdict.up { border-left-color: var(--up); }
.verdict.down { border-left-color: var(--down); }
.vlab { margin: 0; color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.big {
  margin: 6px 0 2px; font-size: 44px; line-height: 1.06; font-weight: 700;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.big.small { font-size: 26px; color: var(--dim); }
.big span { font-size: 17px; font-weight: 500; color: var(--dim); letter-spacing: 0; }
.verdict.up .big { color: var(--up); }
.verdict.down .big { color: var(--down); }
.pctline { color: var(--dim); font-size: 15px; font-variant-numeric: tabular-nums; }
.vhead { margin: 14px 0 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.vsay { margin: 6px 0 0; color: var(--dim); font-size: 14.5px; }

@media (min-width: 620px) { .big { font-size: 56px; } }

/* ----------------------------------------------------------------- bars */

.bars { display: grid; gap: 12px; }
.brow {
  display: grid; gap: 3px 12px; align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 620px) {
  .brow { grid-template-columns: 190px minmax(0, 1fr) 110px; }
  .bval { text-align: right; }
}
.blab { display: grid; gap: 1px; font-size: 14px; font-weight: 600; min-width: 0; }
.blab span { color: var(--faint); font-size: 12px; font-weight: 400; }
/* preserveAspectRatio="none" with a 0–1000 viewBox: the width comes from
   markup, because a strict Content-Security-Policy drops inline style
   attributes without a word and leaves a row of zero-width bars. */
.bsvg { display: block; width: 100%; height: 26px; }
.axis { stroke: var(--line); stroke-width: 4; }
.bar.pos { fill: var(--up); }
.bar.neg { fill: var(--down); }
.bval { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bval.pos { color: var(--up); }
.bval.neg { color: var(--down); }

/* --------------------------------------------------------------- tables */

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
table.t th, table.t td {
  padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: right;
}
table.t thead th { color: var(--faint); font-weight: 600; font-size: 11.5px; letter-spacing: 0.02em; }
/* A floor on the name column: `white-space: normal` without one lets a narrow
   scroll container squeeze it to one character per line — taller, not wider, so
   no overflow check ever sees it. */
table.t th.ln { text-align: left; font-weight: 600; white-space: normal; min-width: 120px; padding-left: 2px; }
table.t td { color: var(--dim); font-variant-numeric: tabular-nums; }
table.t td.amt { font-weight: 650; }
table.t td.up, table.t td.amt.up { color: var(--up); }
table.t td.down, table.t td.amt.down { color: var(--down); }
table.t tr.foot th.ln, table.t tr.foot td {
  border-bottom: 0; border-top: 2px solid var(--line); color: var(--ink); font-weight: 650;
}

/* ------------------------------------------------------------- findings */

.findings { padding: 2px 18px; }
.finding { border-top: 1px solid var(--line); padding: 15px 0; }
.finding:first-child { border-top: 0; }
.finding > b { display: block; font-size: 15.5px; line-height: 1.35; }
.finding > p { margin: 6px 0 0; color: var(--dim); font-size: 14.5px; }
.finding.up > b { color: var(--up); }
.finding.down > b { color: var(--down); }
.finding.flat > b { color: var(--brand); }

/* ---------------------------------------------------------------- lists */

.card.bad { border-color: var(--up); }
.list { margin: 0; padding-left: 20px; color: var(--dim); font-size: 14px; }
.list li { margin: 8px 0; }
.list b { color: var(--ink); }

/* ------------------------------------------------------------------ cta */

.cta { background: var(--brand-soft); border-color: var(--brand); }
.cta p { margin: 0 0 12px; font-size: 15px; color: var(--ink); }
.btn {
  display: inline-block; background: var(--brand); color: var(--brand-ink);
  text-decoration: none; font-weight: 650; font-size: 15px;
  border-radius: 9px; padding: 11px 18px;
}
.btn:hover { filter: brightness(1.08); }

.foot {
  margin-top: 26px; padding: 16px 0 0;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 13px;
}
.foot a { color: var(--dim); }
