/* The ledger design language (2026-10-20): the successor to tokens.css, adopted page by page, Finance first.
   Served at /assets/ledger.css. A page that moves over links this INSTEAD of tokens.css, then its own stylesheet.

   Cool green-grey paper, navy ink, ledger green for anything you can act on, red ink for money owed.
   Schibsted Grotesk for headings and big figures, Public Sans for everything else. Pages link the fonts themselves:
   https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@600;700;800&family=Public+Sans:wght@400;500;600;700&display=swap

   The token names are tokens.css's, so a page's existing var(--accent) etc. keep working after the swap; the
   tokens.css component classes (.page, .card, .nav, .logo, .subcard, …) are restyled here under the same names.
   Light only. Do not add page-specific rules here. */

:root {
  color-scheme: light;

  /* surfaces */
  --bg-page: oklch(94.5% 0.012 170);      /* ledger paper */
  --bg-card: oklch(98.5% 0.005 170);
  --bg-subcard: oklch(99.6% 0.002 170);
  --bg-rec: oklch(95% 0.028 165);         /* icon badges, selected states */
  --bg-open: oklch(94% 0.03 165);
  --band: oklch(97.2% 0.014 165);         /* green-bar rows */
  --border: oklch(89% 0.012 200);
  --border-soft: oklch(93% 0.008 200);
  --border-strong: oklch(84% 0.016 210);
  --shadow: oklch(30% 0.04 240 / 0.22);

  /* ink */
  --accent: oklch(46% 0.09 165);          /* ledger green: links, controls, focus */
  --accent-hover: oklch(38% 0.09 165);
  --on-accent: oklch(99% 0.004 170);
  --text-heading: oklch(23% 0.035 255);   /* navy ink */
  --text-heading-2: oklch(25% 0.035 255);
  --text-body: oklch(30% 0.03 255);
  --text-muted: oklch(46% 0.025 250);
  --text-muted-2: oklch(46% 0.025 250);
  --text-muted-3: oklch(49% 0.022 250);
  --text-muted-4: oklch(51% 0.02 250);
  --text-faint: oklch(53% 0.02 250);
  --text-open: oklch(34% 0.06 165);
  --text-open-2: oklch(42% 0.06 165);
  --tab-inactive: oklch(62% 0.02 250);

  /* state: semantic, separate from the accent */
  --pos: oklch(48% 0.12 150);
  --neg: oklch(50% 0.17 27);              /* red ink: cards and anything owed */
  --warn: oklch(52% 0.13 70);
  --warn-bg: oklch(95% 0.035 80);
  --warn-border: oklch(85% 0.06 75);
  --status-up: oklch(58% 0.13 145);
  --status-down: oklch(58% 0.16 30);
  --status-unknown: oklch(70% 0.02 250);

  /* type: six steps, and nothing between them */
  --display: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 12px;     /* dates, captions, table headers */
  --fs-sm: 13.5px;   /* tables, notes, small labels */
  --fs-md: 15px;     /* body, figures in lists */
  --fs-lg: 19px;     /* section headings */
  --fs-xl: 26px;     /* page heading, tile figures */
  --fs-hero: 46px;   /* the one lead figure on a page */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── frame, as tokens.css had it ─────────────────────────────────────── */

.page { min-height: 100vh; display: flex; justify-content: center; padding: 32px 16px; }

.card {
  width: 480px;
  max-width: 100%;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: 0 24px 60px -24px var(--shadow);
  overflow: hidden;
  align-self: flex-start;
}

.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; background: var(--bg-card); }

.logo { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--text-heading-2); letter-spacing: -0.01em; }

.content { padding: 4px 20px 28px; display: flex; flex-direction: column; gap: 28px; }

/* Labels are sentence case now: no transform, no tracking */
.section-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted-3); margin-bottom: 10px; }
.eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--accent); margin-bottom: 6px; display: inline-block; }

.trip-title { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--text-heading); line-height: 1.25; }

.subcard { background: var(--bg-subcard); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }

.row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

.badge { font-size: var(--fs-xs); font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }

.muted { color: var(--text-muted); font-size: var(--fs-sm); }
.muted-sm { color: var(--text-muted-2); font-size: var(--fs-xs); }
.faint { color: var(--text-faint); }

.status-dot { width: 8px; height: 8px; border-radius: 999px; margin-top: 6px; flex-shrink: 0; }

.empty-state { font-size: var(--fs-sm); color: var(--text-muted); padding: 20px 0; text-align: center; }
.load-error { font-size: var(--fs-sm); color: var(--neg); padding: 20px 0; text-align: center; }

/* ── ledger components ───────────────────────────────────────────────── */

h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--text-heading); margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-lg); line-height: 1.3; }
h3 { font-size: var(--fs-md); line-height: 1.35; }

.num { font-variant-numeric: tabular-nums; }
.neg { color: var(--neg); }

/* A set-off block: a table, a chart, a form */
.panel { background: var(--bg-subcard); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; }

/* The one big figure on a page */
.hero-figure { font-family: var(--display); font-weight: 800; font-size: var(--fs-hero); line-height: 1.05; letter-spacing: -0.025em;
  color: var(--text-heading); font-variant-numeric: tabular-nums; }

/* Flat tiles: border change on hover, no lift or shadow */
.tile { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-subcard); color: inherit; }
a.tile:hover { border-color: var(--accent); color: inherit; }
.tile .k { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.tile .k span { font-weight: 400; }
.tile .v { display: block; font-family: var(--display); font-weight: 700; font-size: var(--fs-xl); line-height: 1.15; margin-top: 2px;
  color: var(--text-heading); font-variant-numeric: tabular-nums; }
.tile .n { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.tile .ib { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-rec); color: var(--accent); }
.tile .ib svg { display: block; width: 20px; height: 20px; }
.tile .ib img { width: 24px; height: 24px; border-radius: 6px; }

/* Things that need someone: one list, one line each */
.needs { border-left: 3px solid var(--warn); background: var(--warn-bg); border-radius: 0 12px 12px 0; padding: 12px 16px; font-size: var(--fs-sm); }
.needs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.needs li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.chip { font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; padding: 0 7px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-subcard); color: var(--warn); border: 1px solid var(--warn-border); }

/* Buttons */
.btn { font: 600 var(--fs-sm)/1 var(--sans); border-radius: 10px; padding: 9px 15px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); }
.btn:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.quiet { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn.quiet:hover:not(:disabled) { background: var(--bg-rec); border-color: var(--accent); }

/* Tables: sentence-case headers, tabular figures, green-bar banding on rows marked .band */
.scroll { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ledger th, .ledger td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--border-soft); }
.ledger th:first-child, .ledger td:first-child { text-align: left; }
.ledger thead th { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); }
.ledger tbody tr:last-child td { border-bottom: none; }
.ledger tr.band td { background: var(--band); }
.ledger tr.total td { font-weight: 700; color: var(--text-heading); border-top: 1px solid var(--border-strong); }

@media (prefers-reduced-motion: no-preference) {
  a.tile, .btn { transition: border-color .15s, background-color .15s; }
}
