/* Finance Lab for SELANA
   Tokens taken from selana.nl (Shopify theme CSS variables, read on 29 Oct 2026):
   background 37,36,34 · secondary 64,61,57 · border 70,69,67 · heading 255,252,242
   primary button 54,78,173 · secondary button 232,240,230 / 46,95,79
   success 46,158,123 · warning 203,161,53 · low stock 222,42,42
   headings Garamond 400 · text Mona Sans 400/600 · button radius 2px · block radius 8px */

:root {
  --bg: #252422;
  --bg-2: #403d39;
  --bg-3: #2d2b28;
  --line: #464543;
  --line-2: #7c7c7a;
  --cream: #fffcf2;
  --ink: rgba(255, 255, 255, 0.84);
  --muted: rgba(255, 252, 242, 0.62);
  --faint: rgba(255, 252, 242, 0.4);
  --royal: #364ead;
  --royal-2: #6f86e6;
  --royal-3: #405de6;
  --mint: #e8f0e6;
  --pine: #2e5f4f;
  --moss: #2e9e7b;
  --moss-bg: #273c34;
  --ochre: #cba135;
  --ochre-2: #ae8a38;
  --ochre-bg: #312d23;
  --signal: #de2a2a;
  --signal-2: #f0766c;
  --sand: #f3e5b6;

  --font-display: "EB Garamond", Garamond, Baskerville, "Times New Roman", serif;
  --font-text: "Mona Sans", "Helvetica Neue", Arial, sans-serif;

  --r-btn: 2px;
  --r-block: 8px;
  --r-small: 4px;
  --gutter: 24px;
  --max: 1280px;
  --measure: 62ch;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--cream); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--royal-2);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--cream);
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.08;
}

h1 { font-size: clamp(42px, 6vw, 76px); max-width: 16ch; }
h2 { font-size: clamp(32px, 3.6vw, 46px); max-width: 20ch; }
h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.01em; }
h4 { font-family: var(--font-text); font-weight: 600; font-size: 15px; color: var(--cream); letter-spacing: 0; }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--cream); }
em { font-style: italic; }
small, .small { font-size: 13px; }

/* SELANA's own eyebrow convention: Mona Sans 600, uppercase, 1px tracking */
.eyebrow {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(37, 36, 34, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.brand .name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.brand .for {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.nav {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--cream); border-bottom-color: var(--line-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 26px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--royal); color: var(--cream); }
.btn-primary:hover { background: #2f459a; color: var(--cream); }
.btn-secondary { background: var(--mint); color: var(--pine); }
.btn-secondary:hover { background: #dbe8d8; color: var(--pine); }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--cream); }
.btn-small { height: 40px; padding: 0 18px; font-size: 12px; }

/* ---------- sections ---------- */
.section {
  padding: 88px 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.section-head .lede { color: var(--ink); font-size: 17px; }
@media (min-width: 1024px) {
  .section-head { grid-template-columns: 5fr 6fr; gap: 48px; align-items: end; }
  .section-head .lede { padding-bottom: 6px; }
}

/* ---------- hero ---------- */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; gap: 36px; }
.hero-grid > *, .hero-head > *, .hero-copy > *, .module > *, .journal > *, .statements > *, .about > *, .commentary > *, .section-head > * { min-width: 0; }
.hero-head { display: grid; gap: 24px; }
.hero-copy { display: grid; gap: 16px; align-content: end; }
@media (min-width: 1024px) {
  .hero-head { grid-template-columns: 7fr 5fr; gap: 64px; align-items: end; }
  .hero-copy { padding-bottom: 8px; }
}
.hero .intro { max-width: 52ch; font-size: 18px; color: var(--ink); margin: 0; }
.hero .note { color: var(--muted); font-size: 14px; max-width: 52ch; margin: 0; }
.disclosure {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.disclosure .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ochre);
}
@media (min-width: 1024px) {
  .hero { padding: 96px 0 96px; }
}

/* ---------- unit bar (hero visual) ---------- */
.unit-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-block);
  background: var(--bg-3);
  padding: 28px 24px 24px;
}
.unit-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 24px;
  margin-bottom: 18px;
}
.unit-panel-head .title { font-family: var(--font-display); font-size: 24px; color: var(--cream); }
.unit-panel-head .title span { color: var(--muted); font-size: 18px; }
.unit-bar {
  display: flex;
  width: 100%;
  height: 58px;
  gap: 2px;
  border-radius: var(--r-small);
  overflow: hidden;
}
.unit-bar .seg {
  position: relative;
  height: 100%;
  min-width: 2px;
  transition: flex-basis 0.25s ease;
  overflow: hidden;
}
.unit-bar .seg .lbl {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bg);
  white-space: nowrap;
  opacity: 0;
}
.unit-bar .seg.wide .lbl { opacity: 1; }
.unit-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) { .unit-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.unit-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.unit-legend .sw { width: 10px; height: 10px; border-radius: 2px; }
.unit-legend .v { color: var(--cream); font-weight: 600; }
.unit-legend .pct { color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---------- controls ---------- */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 28px;
  margin-top: 26px;
}
.control { display: grid; gap: 6px; }
.control .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}
.control label { color: var(--ink); }
.control output { color: var(--cream); font-weight: 600; }
.control .src { color: var(--faint); font-size: 11px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-2);
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--royal-2);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--royal-2);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--royal-2);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--royal-2);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--royal-2); }

/* ---------- readouts ---------- */
.readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 28px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}
.readout { padding: 18px 0 14px; }
.readout .k { font-size: 13px; color: var(--muted); }
.readout .v {
  font-family: var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 36px;
  line-height: 1.1;
  color: var(--cream);
  margin-top: 4px;
}
.readout .v.good { color: var(--moss); }
.readout .v.warn { color: var(--ochre); }
.readout .v.bad { color: var(--signal-2); }
.readout .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- two-column module ---------- */
.module {
  display: grid;
  gap: 32px;
}
@media (min-width: 1024px) {
  .module { grid-template-columns: 340px minmax(0, 1fr); gap: 48px; align-items: start; }
  .module.wide-left { grid-template-columns: 420px minmax(0, 1fr); }
}
.module .controls { margin-top: 0; grid-template-columns: 1fr; gap: 16px; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-block);
  background: var(--bg-3);
  padding: 22px 22px 20px;
}
.panel h4 { margin-bottom: 12px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .axis text { fill: var(--muted); font-family: var(--font-text); font-size: 11px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--line-2); stroke-width: 1; }
.chart .series-line { fill: none; stroke: var(--royal-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: var(--royal-2); opacity: 0.14; }
.chart .marker { fill: var(--royal-2); stroke: var(--bg); stroke-width: 2; }
.chart .event-line { stroke: var(--line-2); stroke-dasharray: 2 4; }
.chart .event-text { fill: var(--cream); font-size: 11px; font-family: var(--font-text); }
.chart .event-text.muted { fill: var(--muted); }
.chart .bar { fill: var(--ochre-2); }
.chart .bar.neg { fill: var(--ochre-2); opacity: 0.55; }
.chart .buffer { stroke: var(--muted); stroke-dasharray: 4 4; }
.chart .crosshair { stroke: var(--cream); stroke-opacity: 0.35; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-small);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--ink);
  min-width: 150px;
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 5;
}
.tooltip.show { opacity: 1; }
.tooltip .t { color: var(--cream); font-weight: 600; margin-bottom: 4px; }
.tooltip .r { display: flex; justify-content: space-between; gap: 14px; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .sw { width: 14px; height: 3px; border-radius: 2px; background: var(--royal-2); }
.legend .sw.bar { height: 10px; width: 10px; background: var(--ochre-2); }
.legend .sw.dash { background: none; border-top: 2px dashed var(--muted); height: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 28px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  color: var(--ink);
}
thead th {
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
tbody tr.sum td { color: var(--cream); font-weight: 600; border-top: 1px solid var(--line-2); }
tbody tr.total td { color: var(--cream); font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 2px solid var(--cream); }
tbody tr.group td { color: var(--muted); font-weight: 600; padding-top: 18px; border-bottom: none; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
tbody tr.indent td:first-child { padding-left: 24px; }
tbody tr.muted td { color: var(--muted); }
td.neg { color: var(--signal-2); }
td.pos { color: var(--moss); }
td.flag { color: var(--ochre); }
.sticky-col th:first-child, .sticky-col td:first-child {
  position: sticky; left: 0; background: var(--bg); z-index: 1;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--moss);
}
.check.fail { color: var(--signal-2); }
.check .ic {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--moss-bg);
  font-size: 10px;
}
.check.fail .ic { background: #3a2422; }

/* ---------- statements ---------- */
.statements { display: grid; gap: 32px; margin-top: 8px; }
@media (min-width: 1024px) { .statements { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.statement h3 { margin-bottom: 4px; }
.statement .period { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.statement table { font-size: 13px; }
.statement .table-wrap { margin-top: 10px; }
.links {
  margin: 36px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-block);
  background: var(--bg-3);
  display: grid;
  gap: 10px 32px;
}
@media (min-width: 900px) { .links { grid-template-columns: repeat(3, 1fr); } }
.links .link { font-size: 13.5px; color: var(--ink); }
.links .link b { color: var(--cream); font-weight: 600; }

/* ---------- budget vs actual ---------- */
.commentary {
  margin-top: 28px;
  display: grid;
  gap: 24px;
}
@media (min-width: 1024px) { .commentary { grid-template-columns: 7fr 5fr; gap: 48px; } }
.memo {
  border-left: 2px solid var(--line-2);
  padding-left: 20px;
}
.memo p { max-width: 58ch; font-size: 15px; }
.memo .from { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.rules { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.rules li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.rules .n { color: var(--muted); font-weight: 600; }

/* ---------- journal ---------- */
.journal { display: grid; gap: 24px; }
@media (min-width: 1024px) { .journal { grid-template-columns: 380px minmax(0, 1fr); gap: 48px; align-items: start; } }
.tx-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tx-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 13px 12px 13px 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.tx-list button .amt { color: var(--muted); font-size: 13px; }
.tx-list button:hover { color: var(--cream); }
.tx-list button[aria-selected="true"] {
  color: var(--cream);
  box-shadow: inset 3px 0 0 var(--royal-2);
  padding-left: 12px;
}
.tx-detail { border: 1px solid var(--line); border-radius: var(--r-block); background: var(--bg-3); padding: 24px; }
.tx-detail h3 { margin-bottom: 6px; }
.tx-detail .why { color: var(--ink); font-size: 15px; max-width: 60ch; margin-bottom: 18px; }
.tx-detail table td:nth-child(1) { text-align: left; }
.tx-detail table td.cr { padding-left: 32px; }
.effects { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.effects li {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--r-small);
  border: 1px solid var(--line-2);
  color: var(--ink);
}
.effects li.bs { border-color: var(--royal-2); }
.effects li.pl { border-color: var(--ochre); }
.effects li.cf { border-color: var(--moss); }

/* ---------- close checklist ---------- */
.close { margin-top: 8px; }
.close table td:nth-child(2), .close table th:nth-child(2) { text-align: left; }
.close table td:nth-child(3), .close table th:nth-child(3) { text-align: left; white-space: normal; min-width: 260px; }
.close table td:nth-child(4), .close table th:nth-child(4) { text-align: left; white-space: normal; min-width: 200px; }

/* ---------- about ---------- */
.about { display: grid; gap: 40px; }
@media (min-width: 1024px) { .about { grid-template-columns: 1fr 1fr; gap: 64px; } }
.about h3 { margin-bottom: 12px; }
.about p { font-size: 16px; }
.plan { list-style: none; padding: 0; margin: 0; }
.plan li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 70px 1fr; gap: 14px; font-size: 15px; }
.plan .d { color: var(--muted); font-weight: 600; font-size: 13px; padding-top: 2px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 13px;
  color: var(--muted);
}
footer p { max-width: 80ch; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.srcnote { font-size: 12px; color: var(--faint); margin-top: 10px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
