/* My Financial OS. Night, paper and a spectrum accent; hard corners everywhere; headings in Geist, text in Roboto Flex,
   figures in Roboto Mono. Fonts are part of the app (app/fonts), nothing is loaded from outside.
   Laptop: a side rail. Phone and iPad upright: a tab bar with the mark as menu button. */
@font-face { font-family: 'Geist'; src: url('../fonts/geist-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Roboto Flex'; src: url('../fonts/roboto-flex-latin.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('../fonts/roboto-mono-latin.woff2') format('woff2'); font-weight: 100 700; font-display: swap; }

:root {
  --bg: #0b0b10; --bg-diep: #050505; --vlak: #13131a; --vlak-2: rgba(255,255,255,.045); --vlak-3: rgba(255,255,255,.09);
  --tekst: #F4F4F1; --t2: rgba(244,244,241,.74); --t3: rgba(244,244,241,.5); --rand: rgba(255,255,255,.1); --rand-2: rgba(255,255,255,.2);
  --sp1: #9FF3FF; --sp2: #B7A6FF; --sp3: #FFB0E1; --sp4: #FFE08A;
  --spectrum: linear-gradient(100deg, var(--sp1), var(--sp2) 35%, var(--sp3) 65%, var(--sp4));
  --actie: #F4F4F1; --actie-t: #0A0A0A; --inkt: #0A0A0A; --link: #c9bdff;
  --goed: #4fe09a; --let: #FFE08A; --kritiek: #ff7a7a; --info: #9FF3FF;
  --goed-z: rgba(57,217,138,.13); --let-z: rgba(255,224,138,.13); --kritiek-z: rgba(255,93,93,.14); --info-z: rgba(159,243,255,.1);
  --glas: rgba(11,11,16,.72); --schaduw: 0 30px 80px rgba(0,0,0,.6);
  --kop: 'Geist', system-ui, sans-serif; --sans: 'Roboto Flex', system-ui, -apple-system, sans-serif; --mono: 'Roboto Mono', ui-monospace, Menlo, monospace;
  --e: cubic-bezier(.2,.8,.15,1); --zij: 280px; --tab: 62px; --snee: 9px; --z: clamp(16px, 2.6vw, 34px);
  /* chart series (js/charts.js): fixed order, checked for colour-blind separation on a dark surface */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #2f9e2f; --s7: #9085e9; --s8: #e66767; --s-other: #6d6c66;
  color-scheme: dark;
}
html[data-thema="papier"] {
  --bg: #F4F4F1; --bg-diep: #e9e9e4; --vlak: #ffffff; --vlak-2: rgba(10,10,10,.04); --vlak-3: rgba(10,10,10,.08);
  --tekst: #0A0A0A; --t2: rgba(10,10,10,.72); --t3: rgba(10,10,10,.52); --rand: rgba(10,10,10,.13); --rand-2: rgba(10,10,10,.26);
  --actie: #0A0A0A; --actie-t: #F4F4F1; --link: #4a36c9;
  --goed: #0c6d3c; --let: #7a5200; --kritiek: #b3261e; --info: #0b5d6b;
  --goed-z: rgba(12,109,60,.1); --let-z: rgba(180,120,0,.13); --kritiek-z: rgba(179,38,30,.1); --info-z: rgba(11,93,107,.09);
  --glas: rgba(244,244,241,.8); --schaduw: 0 30px 80px rgba(10,10,10,.22);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s-other: #a3a29b;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--tekst); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--kop); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(32px, 4.4vw, 54px); letter-spacing: -.05em; line-height: .98; }
h2 { font-size: 21px; margin: 0 0 12px; letter-spacing: -.03em; }
h3 { font-size: 16.5px; margin: 10px 0 8px; letter-spacing: -.02em; font-weight: 700; }
p { margin: 6px 0 12px; }
strong, b { font-weight: 650; }
.small { font-size: 13.5px; } .muted { color: var(--t3); } .big { font: 800 30px/1 var(--kop); letter-spacing: -.04em; margin: 4px 0; }
.good-t { color: var(--goed); } .bad-t { color: var(--kritiek); } .warn-t { color: var(--let); }
code, pre { font-family: var(--mono); font-size: .86em; }
.boot { min-height: 100svh; display: grid; place-items: center; color: var(--t3); }
.ic { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }
:focus-visible { outline: 2px solid var(--sp1); outline-offset: 2px; }
::selection { background: var(--sp2); color: var(--inkt); }

/* ---------- the mark and the name ---------- */
.merk { display: block; width: 34px; height: 34px; flex: none; }
.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--tekst); min-width: 0; }
.lockup-woord { display: inline-flex; align-items: center; gap: 5px; font: 400 21px/1 var(--kop); letter-spacing: -.05em; white-space: nowrap; }
.lockup-woord b { font-weight: 800; }
html[data-thema="papier"] .lockup .merk, html[data-thema="papier"] .lock-card .merk { background: #0A0A0A; padding: 4px; } /* the light mark needs night behind it on paper */
.lockup-woord em { font: 600 10px/1 var(--mono); font-style: normal; letter-spacing: .04em; padding: 4px 5px; background: var(--vlak-3); color: var(--t2); margin-left: 2px; }

/* ---------- shell: side rail on a laptop ---------- */
.layout { display: grid; grid-template-columns: var(--zij) minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; min-width: 0; padding: 20px 14px 14px; border-right: 1px solid var(--rand); background: linear-gradient(180deg, color-mix(in srgb, var(--vlak) 80%, var(--bg)), var(--bg-diep) 70%); overflow: hidden; z-index: 20; }
.brand { display: flex; align-items: center; padding: 2px 6px 20px; }
.side nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rand-2) transparent; display: grid; align-content: start; gap: 14px; margin: 0 -4px; padding: 0 4px; }
.nav-groep { display: grid; gap: 2px; }
.nav-kop { padding: 0 10px 4px; font-size: 12.5px; color: var(--t3); }
.side nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 5px 10px 5px 8px; color: var(--t2); transition: background .25s, color .25s, transform .4s var(--e); }
.side nav a:hover { background: var(--vlak-2); color: var(--tekst); text-decoration: none; transform: translateX(2px); }
.side nav a.on { background: linear-gradient(90deg, var(--vlak-3), var(--vlak-2)); color: var(--tekst); }
.side nav a.on::before { content: ''; position: absolute; left: -4px; top: 12px; bottom: 12px; width: 3px; background: var(--spectrum); }
.nav-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: var(--vlak-2); transition: background .25s; }
.side nav a.on .nav-ico { background: var(--spectrum); color: var(--inkt); clip-path: polygon(0 0, 100% 0, 100% 62%, 78% 100%, 0 100%); }
.nav-tekst { display: grid; min-width: 0; line-height: 1.15; }
.nav-tekst b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-tekst small { font-size: 11.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.nav-tekst small:empty { display: none; }
.nav-tel { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; background: var(--sp3); color: var(--inkt); font: 700 11px/22px var(--mono); text-align: center; }
.nav-tel:empty { display: none; }
.side-foot { margin-top: 12px; padding: 12px 6px 0; border-top: 1px solid var(--rand); display: grid; gap: 6px; }
.status-line { font-size: 13px; display: flex; align-items: center; gap: 8px; color: var(--t2); }
.side-foot .small { font-size: 12px; line-height: 1.35; }
/* a low laptop screen: first the short lines go, then the rows get lower, so every section stays in view */
@media (min-width: 900px) and (max-height: 900px) {
  .side { padding-top: 14px; padding-bottom: 10px; } .brand { padding-bottom: 12px; }
  .side nav { gap: 8px; } .side nav a { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }
  .nav-ico { width: 30px; height: 30px; } .nav-ico .ic { width: 18px; height: 18px; }
  .nav-tekst small { display: none; } .nav-kop { padding-bottom: 2px; font-size: 12px; }
  .side-foot { margin-top: 8px; padding-top: 8px; gap: 3px; } .side-foot #status .small { display: none; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .side nav { gap: 5px; } .side nav a { min-height: 31px; } .nav-ico { width: 26px; height: 26px; } .nav-ico .ic { width: 16px; height: 16px; }
  .side nav a.on::before { top: 6px; bottom: 6px; } .nav-tel { height: 19px; line-height: 19px; }
  .brand .merk { width: 28px; height: 28px; } .maker { display: none; }
}
.maker { display: flex; align-items: center; gap: 7px; margin-top: 4px; font: 400 12.5px/1 var(--kop); letter-spacing: -.03em; color: var(--t3); }
.maker b { font-weight: 800; color: var(--t2); }
.dot { width: 8px; height: 8px; display: inline-block; background: var(--t3); flex: none; }
.dot.on { background: var(--goed); } .dot.off { background: var(--let); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: none; }
main { flex: 1; width: 100%; max-width: 1320px; padding: clamp(22px, 3.2vw, 44px) var(--z) 72px; outline: none; }
main.in > * { animation: op .5s var(--e) both; }
main.in > :nth-child(2) { animation-delay: .04s; } main.in > :nth-child(3) { animation-delay: .08s; } main.in > :nth-child(n+4) { animation-delay: .12s; }
@keyframes op { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.demo-bar { background: var(--sp4); color: var(--inkt); padding: 9px var(--z); font-weight: 600; font-size: 13.5px; }
.tabbalk, .menu { display: none; }

/* ---------- shell: phone and upright iPad ---------- */
@media (max-width: 899px) {
  .layout { display: block; }
  .side { display: none; }
  .top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--glas); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); border-bottom: 1px solid var(--rand); }
  .top .lockup .merk { width: 28px; height: 28px; } .top .lockup-woord { font-size: 18px; }
  .top-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .top-status { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t3); }
  main { padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--tab) + env(safe-area-inset-bottom) + 56px) max(16px, env(safe-area-inset-left)); }
  .demo-bar { padding: 8px 16px; }
  /* the tab bar: four tabs and the mark as menu button, half above the bar in a notch */
  .tabbalk { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: radial-gradient(circle at 90% 0, transparent 35px, var(--tab-vlak, #0e0e15) 36px); }
  html[data-thema="papier"] .tabbalk { --tab-vlak: #0A0A0A; }
  .tabbalk::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, var(--rand-2) 0, var(--rand-2) calc(90% - 37px), transparent calc(90% - 37px), transparent calc(90% + 37px), var(--rand-2) calc(90% + 37px)); pointer-events: none; }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: rgba(244,244,241,.56); font-size: 11px; font-weight: 500; -webkit-tap-highlight-color: transparent; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .tab:hover { text-decoration: none; }
  .tab .ic { width: 23px; height: 23px; }
  .tab.on { color: #F4F4F1; font-weight: 650; }
  .tab.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--spectrum); }
  .tab-menu { justify-content: flex-end; padding-bottom: 8px; color: #F4F4F1; }
  .tab-knop { position: absolute; left: 50%; top: -29px; width: 58px; height: 58px; margin-left: -29px; display: grid; place-items: center; border-radius: 50%; background: #1c1c27; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.12), 0 8px 24px rgba(0,0,0,.45); transition: transform .4s var(--e), background .3s; }
  html[data-thema="papier"] .tab-knop { background: #0A0A0A; }
  .tab-knop .merk { width: 30px; height: 30px; }
  html.is-menu-open .tab-knop { transform: scale(1.08); background: #2a2a3a; }
  .tab-menu .tl-open, html.is-menu-open .tab-menu .tl-dicht { display: none; } html.is-menu-open .tab-menu .tl-open { display: inline; }
  /* the menu: full screen, opens as a circle from the button */
  .menu { display: block; position: fixed; inset: 0; z-index: 29; background: var(--bg); clip-path: circle(0 at 90% calc(100% - 40px)); transition: clip-path .5s cubic-bezier(.65,0,.35,1), visibility 0s .5s; visibility: hidden; }
  .menu.is-open { clip-path: circle(150vmax at 90% calc(100% - 40px)); visibility: visible; transition: clip-path .5s cubic-bezier(.65,0,.35,1); }
  html.is-menu-open { overflow: hidden; }
  .menu-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: calc(env(safe-area-inset-top) + 14px) max(16px, env(safe-area-inset-right)) calc(var(--tab) + env(safe-area-inset-bottom) + 60px) max(16px, env(safe-area-inset-left)); }
  .menu-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
  .menu-groep { margin-bottom: 20px; }
  .menu-groep h2 { font-size: 15px; font-weight: 600; font-family: var(--sans); letter-spacing: 0; color: var(--t3); margin: 0 0 6px; }
  .menu-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .mtegel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 62px; padding: 9px 10px; background: var(--vlak); box-shadow: inset 0 0 0 1px var(--rand); color: var(--tekst); }
  .mtegel:hover { text-decoration: none; }
  .mtegel.on { box-shadow: inset 0 0 0 1px var(--rand-2); background: linear-gradient(120deg, var(--vlak-3), var(--vlak)); }
  .mtegel.on .nav-ico { background: var(--spectrum); color: var(--inkt); clip-path: polygon(0 0, 100% 0, 100% 62%, 78% 100%, 0 100%); }
  .menu.is-open .mtegel { animation: op .42s var(--e) both; animation-delay: calc(.05s + var(--i, 0) * .022s); }
  .menu-voet { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--rand); }
  @media (min-width: 620px) { .menu-raster { grid-template-columns: repeat(3, 1fr); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- page parts ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: clamp(18px, 2.4vw, 30px); }
.page-head p { margin: 10px 0 0; max-width: 64ch; color: var(--t2); font-size: 15.5px; }
.page-actions, .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--vlak); box-shadow: inset 0 0 0 1px var(--rand); padding: 20px 22px; margin-bottom: 12px; }
.card.warn { background: var(--let-z); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--let) 30%, transparent); }
.card.bad { background: var(--kritiek-z); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kritiek) 34%, transparent); }
.card.note { background: var(--info-z); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 24%, transparent); }
.card.bad-border { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kritiek) 45%, transparent); }
.card.welcome ol { margin: 4px 0 8px; padding-left: 20px; } .card.welcome li { margin: 6px 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid2 > .card { margin-bottom: 0; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.note { background: var(--info-z); padding: 10px 14px; }
.err { color: var(--kritiek); }
.empty { padding: 30px 20px; text-align: center; color: var(--t3); border: 1px dashed var(--rand-2); margin-bottom: 12px; }
@media (max-width: 640px) { .card { padding: 16px 16px; } }

/* what counts now: one card, one button */
.nu { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 24px; padding: clamp(20px, 3vw, 30px); margin-bottom: 12px; background: var(--vlak); box-shadow: inset 0 0 0 1px var(--rand); overflow: hidden; isolation: isolate; }
.nu::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--spectrum); }
.nu::after { content: ''; position: absolute; z-index: -1; right: -12%; top: -70%; width: 62%; height: 190%; background: radial-gradient(closest-side, color-mix(in srgb, var(--sp2) 22%, transparent), transparent); pointer-events: none; }
.nu h2 { font-size: clamp(23px, 2.5vw, 32px); letter-spacing: -.04em; margin: 0 0 8px; }
.nu p { margin: 0; color: var(--t2); max-width: 62ch; }
.nu.goed::before { background: var(--goed); } .nu.kritiek::before { background: var(--kritiek); }
@media (max-width: 640px) { .nu { grid-template-columns: 1fr; } .nu .btn { justify-content: center; } }

/* groups with rows: sign or date left, title and a short line, figure or arrow right */
.groep { margin: 0 0 clamp(20px, 2.6vw, 30px); }
.groep > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.groep > h2 a, .groep > h2 small { font: 400 13.5px/1.2 var(--sans); letter-spacing: 0; color: var(--t3); }
.rijen { display: grid; gap: 1px; background: var(--rand); box-shadow: 0 0 0 1px var(--rand); }
.rij { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 13px 16px; background: var(--vlak); color: var(--tekst); min-height: 58px; transition: background .25s; }
a.rij:hover, button.rij:hover { background: color-mix(in srgb, var(--vlak) 88%, var(--tekst)); text-decoration: none; }
button.rij { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }
.rij-teken { width: 34px; height: 34px; display: grid; place-items: center; background: var(--vlak-2); color: var(--t2); font: 700 13px/1 var(--mono); }
.rij-teken.goed { background: var(--goed-z); color: var(--goed); } .rij-teken.let { background: var(--let-z); color: var(--let); } .rij-teken.kritiek { background: var(--kritiek-z); color: var(--kritiek); } .rij-teken.info { background: var(--info-z); color: var(--info); }
.rij-dag { width: 42px; text-align: center; line-height: 1; } .rij-dag b { display: block; font: 800 19px/1 var(--kop); letter-spacing: -.03em; } .rij-dag span { font-size: 11.5px; color: var(--t3); }
.rij-wat { min-width: 0; display: grid; gap: 2px; } .rij-wat b { font-weight: 600; overflow-wrap: anywhere; } .rij-wat span { color: var(--t3); font-size: 13.5px; line-height: 1.35; }
.rij-eind { display: flex; align-items: center; gap: 10px; text-align: right; font: 600 15px/1.2 var(--mono); letter-spacing: -.01em; white-space: nowrap; color: var(--tekst); }
.rij-eind small { display: block; margin-top: 4px; font: 400 12px/1 var(--sans); color: var(--t3); letter-spacing: 0; }
.rij-eind .ic { color: var(--t3); width: 16px; height: 16px; }
.rij.zonder-teken { grid-template-columns: minmax(0, 1fr) auto; }
.rij > details, .rij > .rij-onder { grid-column: 1 / -1; }
@media (min-width: 1100px) { .rijen.twee { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .rij { padding: 12px 13px; gap: 4px 11px; } .rij-eind { font-size: 14px; } }

/* figures: the old tiles are rows now (label left, figure right) */
.kpis { display: grid; gap: 1px; background: var(--rand); box-shadow: 0 0 0 1px var(--rand); margin-bottom: 12px; }
.kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 16px; padding: 13px 16px; background: var(--vlak); }
.kpi-link { display: contents; color: inherit; }
.kpi > span:first-child, .kpi-link > span { grid-column: 1; color: var(--tekst); font-weight: 600; }
.kpi strong { grid-column: 2; grid-row: 1; font: 600 16px/1.2 var(--mono); letter-spacing: -.02em; text-align: right; white-space: nowrap; }
.kpi > .small { grid-column: 1 / -1; color: var(--t3); font-size: 13.5px; }
.kpi > details { grid-column: 1 / -1; }
.kpi-link:hover strong { color: var(--link); }
.kpi.warn strong { color: var(--let); } .kpi.bad strong { color: var(--kritiek); } .kpi.good strong { color: var(--goed); }
@media (min-width: 1100px) { .kpis { grid-template-columns: 1fr 1fr; } .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.warnings { display: grid; gap: 1px; background: var(--rand); box-shadow: 0 0 0 1px var(--rand); margin-bottom: 12px; }
.warn-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; background: var(--vlak); color: var(--tekst); font-size: 15px; }
.warn-item::before { content: ''; width: 9px; height: 9px; background: var(--info); }
.warn-item.bad::before { background: var(--kritiek); } .warn-item.warn::before { background: var(--let); }
.warn-item::after { content: ''; width: 8px; height: 8px; border-right: 1.7px solid var(--t3); border-top: 1.7px solid var(--t3); transform: rotate(45deg); }
.warn-item:hover { text-decoration: none; background: color-mix(in srgb, var(--vlak) 88%, var(--tekst)); }
ol.actions { margin: 0; padding-left: 22px; } ol.actions li { padding: 7px 0; border-bottom: 1px solid var(--rand); } ol.actions li:last-child { border: 0; }

/* how is this calculated */
details.how { margin-top: 6px; }
details.how summary { cursor: pointer; font-size: 13px; color: var(--t3); list-style: none; }
details.how summary::-webkit-details-marker { display: none; }
details.how summary::before { content: '+'; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 6px; box-shadow: inset 0 0 0 1px var(--rand-2); font: 600 11px/1 var(--mono); }
details.how[open] summary::before { content: '\2212'; }
details.how[open] summary { margin-bottom: 6px; }
.how-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.how-t td { padding: 5px 4px; border-bottom: 1px solid var(--rand); vertical-align: top; color: var(--t2); }
.how-t tr.tot td { font-weight: 650; color: var(--tekst); border-bottom: 1px solid var(--rand-2); }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--vlak); box-shadow: inset 0 0 0 1px var(--rand); margin-bottom: 10px; scrollbar-width: thin; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-weight: 500; color: var(--t3); font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--rand); vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--vlak-2); }
table.t tfoot td { font-weight: 650; border-top: 1px solid var(--rand-2); }
.num { text-align: right !important; font-family: var(--mono); font-size: .94em; letter-spacing: -.01em; white-space: nowrap; }
table.cf th[title] { font-weight: 600; color: var(--tekst); min-width: 200px; }
table.cf th .small { font-weight: 400; display: none; color: var(--t3); }
@media (min-width: 1100px) { table.cf th .small { display: block; } }
table.cf td.cur, table.cf th.cur { background: var(--vlak-3); }
.totals { display: flex; gap: 6px 22px; flex-wrap: wrap; justify-content: flex-end; font-size: 14.5px; padding: 6px 2px 14px; }
.totals strong { font-family: var(--mono); font-weight: 600; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; }
.dl dt { color: var(--t3); font-size: 14px; } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 10px; } }

/* phone: a table row becomes a compact block. The first cell is the title, the other cells follow as short
   "label value" pairs that wrap, and a cell with buttons closes the block on its own line. */
@media (max-width: 640px) {
  .table-wrap table.t:not(.cf) thead { display: none; }
  .table-wrap table.t:not(.cf), .table-wrap table.t:not(.cf) tbody { display: block; width: 100%; }
  .table-wrap table.t:not(.cf) tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 16px; padding: 12px 14px; border-bottom: 1px solid var(--rand-2); }
  .table-wrap table.t:not(.cf) tbody tr:last-child { border-bottom: 0; }
  .table-wrap table.t:not(.cf) td { display: block; border: 0; padding: 0; min-width: 0; font-size: 14px; color: var(--t2); text-align: left !important; }
  .table-wrap table.t:not(.cf) td::before { content: attr(data-label) '\00a0\00a0'; color: var(--t3); font: 400 12.5px/1.5 var(--sans); }
  .table-wrap table.t:not(.cf) td[data-label=""]::before, .table-wrap table.t:not(.cf) td:first-child::before { content: none; }
  .table-wrap table.t:not(.cf) td:first-child { flex: 1 1 100%; font-size: 15.5px; font-weight: 600; color: var(--tekst); }
  .table-wrap table.t:not(.cf) td:empty { display: none; }
  .table-wrap table.t:not(.cf) td.num { color: var(--tekst); white-space: normal; }
  .table-wrap table.t:not(.cf) td:has(.btn), .table-wrap table.t:not(.cf) td:has(select), .table-wrap table.t:not(.cf) td:has(input:not([type=checkbox])), .table-wrap table.t:not(.cf) td:has(.bar) { flex: 1 1 100%; }
  .table-wrap table.t:not(.cf) td:has(.btn) { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 4px; }
  .table-wrap table.t:not(.cf) td:has(.btn)::before { margin-right: auto; align-self: center; }
  .table-wrap table.t:not(.cf) td .small { display: inline; }
  .table-wrap table.t:not(.cf) td div.small::before { content: ' · '; }
  .table-wrap table.t:not(.cf) tfoot td:empty { display: none; }
  table.t tbody tr:hover td { background: none; }
}

/* status words, bars, filters, tabs */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--t2); white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; background: var(--t3); flex: none; }
.badge.good { color: var(--goed); } .badge.good::before { background: var(--goed); }
.badge.warn { color: var(--let); } .badge.warn::before { background: var(--let); }
.badge.bad { color: var(--kritiek); } .badge.bad::before { background: var(--kritiek); }
.badge.info { color: var(--info); } .badge.info::before { background: var(--info); }
.badge.muted { opacity: .7; }
.bar { height: 5px; background: var(--vlak-3); overflow: hidden; min-width: 80px; margin: 5px 0; }
.bar.big { height: 8px; flex: 1; }
.bar i { display: block; height: 100%; background: var(--spectrum); }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.chips { display: flex; gap: 2px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { padding: 8px 13px; color: var(--t2); font-size: 14px; background: var(--vlak-2); transition: background .25s, color .25s; }
.chip.on { background: var(--actie); color: var(--actie-t); font-weight: 600; }
.chip:hover { text-decoration: none; background: var(--vlak-3); } .chip.on:hover { background: var(--actie); }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--rand); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; padding: 10px 0 12px; color: var(--t3); white-space: nowrap; font-size: 15.5px; font-weight: 500; }
.tabs a.on { color: var(--tekst); font-weight: 650; }
.tabs a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--spectrum); }
.tabs a:hover { text-decoration: none; color: var(--tekst); }
.steps { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px; }
.steps span { padding: 6px 12px; font-size: 13.5px; background: var(--vlak-2); color: var(--t3); }
.steps span.on { background: var(--actie); color: var(--actie-t); font-weight: 600; }
.steps span.done { background: var(--goed-z); color: var(--goed); }
.conf { font-size: 11.5px; padding: 1px 5px; margin-left: 5px; font-weight: 500; }
.conf.medium { background: var(--info-z); color: var(--info); } .conf.low { background: var(--let-z); color: var(--let); } .conf.none { background: var(--vlak-2); color: var(--t3); }
pre.ocr { white-space: pre-wrap; max-height: 220px; overflow: auto; background: var(--vlak-2); padding: 10px; }
ul.facts li { margin: 8px 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 1px; background: var(--rand); box-shadow: 0 0 0 1px var(--rand); }
.checklist li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; background: var(--vlak); }
.checklist li.done strong { color: var(--t3); text-decoration: line-through; text-decoration-thickness: 1px; }

/* buttons */
.btn { appearance: none; border: 0; background: var(--vlak-3); color: var(--tekst); height: 44px; padding: 0 18px; font: 600 14.5px/1 var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; text-decoration: none !important; box-shadow: inset 0 0 0 1px var(--rand); transition: transform .4s var(--e), background .3s, opacity .3s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: color-mix(in srgb, var(--vlak-3) 70%, var(--tekst) 12%); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary { background: var(--actie); color: var(--actie-t); box-shadow: none; padding-right: 22px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--snee) * 1.73), calc(100% - var(--snee)) 100%, 0 100%); }
.btn.primary:hover { background: color-mix(in srgb, var(--actie) 88%, var(--sp2)); }
.btn.spec { background: var(--spectrum); color: var(--inkt); box-shadow: none; padding-right: 22px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--snee) * 1.73), calc(100% - var(--snee)) 100%, 0 100%); }
.btn.danger { background: var(--kritiek-z); color: var(--kritiek); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kritiek) 45%, transparent); }
.btn.danger.ghost { background: transparent; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--t2); }
.btn.ghost:hover { background: var(--vlak-2); color: var(--tekst); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; --snee: 7px; }
.btn.small.primary { padding-right: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible { clip-path: none; }
.icon-btn { appearance: none; border: 0; background: var(--vlak-2); color: var(--tekst); cursor: pointer; width: 38px; height: 38px; display: inline-grid; place-items: center; font-size: 16px; transition: background .25s; }
.icon-btn.small { width: 28px; height: 28px; font-size: 13px; }
.icon-btn:hover { background: var(--vlak-3); }

/* forms */
input, select, textarea { font: 400 16px/1.4 var(--sans); color: var(--tekst); background: var(--vlak-2); border: 1px solid var(--rand); border-radius: 0; padding: 10px 13px; width: 100%; min-height: 46px; transition: border-color .25s, background .25s; }
textarea { min-height: 0; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--t2) 50%), linear-gradient(135deg, var(--t2) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select option { background: var(--vlak); color: var(--tekst); }
input[type=checkbox], input[type=radio] { width: 19px; height: 19px; min-height: 0; padding: 0; accent-color: var(--sp2); vertical-align: -4px; }
input[type=file] { padding: 9px; font-size: 14.5px; }
input[type=file]::file-selector-button { font: 600 13.5px/1 var(--sans); margin-right: 12px; height: 28px; padding: 0 10px; border: 0; background: var(--vlak-3); color: var(--tekst); cursor: pointer; }
input[type=date] { -webkit-appearance: none; appearance: none; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--sp2); background-color: var(--vlak-3); }
input::placeholder, textarea::placeholder { color: var(--t3); }
label { font-size: 14px; color: var(--t2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; margin-bottom: 16px; }
.form-grid .wide, .form-heading { grid-column: 1 / -1; }
.form-heading { margin: 14px 0 -2px; padding-top: 16px; border-top: 1px solid var(--rand); font-size: 17px; }
.form-grid .form-heading:first-child { border: 0; padding-top: 0; margin-top: 0; }
.field label { display: block; margin-bottom: 6px; font-weight: 500; }
.field .help { font-size: 12.5px; color: var(--t3); margin: 6px 0 0; line-height: 1.4; }
label.check { display: inline-flex; gap: 9px; align-items: center; font-weight: 500; color: var(--tekst); cursor: pointer; margin-right: 12px; font-size: 15px; }
label.check input { flex: none; } /* next to a text of several lines the box keeps its size */
.affix { display: flex; align-items: center; border: 1px solid var(--rand); background: var(--vlak-2); transition: border-color .25s; }
.affix span { padding: 0 2px 0 13px; color: var(--t3); font-family: var(--mono); }
.affix.right span { padding: 0 13px 0 2px; }
.affix input { border: 0; min-width: 0; background: transparent; font-family: var(--mono); font-size: 15.5px; }
.affix:focus-within { border-color: var(--sp2); }
.affix input:focus { background: transparent; }
input.mini { width: 6.5rem; display: inline-block; min-height: 38px; padding: 6px 10px; font-family: var(--mono); font-size: 15px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 150px; }
.inline-form label { display: inline-flex; align-items: center; gap: 6px; }
.inline-form .affix { display: inline-flex; width: 9.5rem; }
.quick .quick-grid { display: grid; grid-template-columns: 160px minmax(170px, 1.2fr) 110px 130px minmax(140px, 1fr) auto; gap: 10px; align-items: end; }
.quick label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.quick p { margin: 10px 0 0; }
@media (max-width: 1000px) { .quick .quick-grid { grid-template-columns: 1fr 1fr; } .quick .grow { grid-column: 1 / -1; } .quick .btn { grid-column: 1 / -1; justify-content: center; } }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* rates from a date, in the client/job dialog */
.rate-row { display: grid; grid-template-columns: 176px 130px repeat(3, minmax(100px, 1fr)) auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.rate-row label { display: grid; gap: 5px; font-size: 13px; min-width: 0; }
.rate-row .affix input { width: 100%; }
@media (max-width: 820px) { .rate-row { grid-template-columns: 1fr 1fr; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rand); } .rate-row .btn { justify-self: start; } }
hr { border: 0; border-top: 1px solid var(--rand); margin: 16px 0; }

/* dialog: a card on a laptop, a sheet from below on a phone */
dialog { border: 0; padding: 0; width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--vlak); color: var(--tekst); box-shadow: inset 0 0 0 1px var(--rand-2), var(--schaduw); }
dialog.wide { width: min(940px, calc(100vw - 24px)); }
dialog[open] { animation: vel-in .38s var(--e); }
dialog::backdrop { background: rgba(5,5,5,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes vel-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px 0; }
.dlg header h2 { margin: 0; font-size: 22px; }
.dlg-body { padding: 16px 22px 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.dlg-body:focus { outline: 0; }
.dlg-errors ul { margin: 0; padding: 10px 22px 10px 40px; background: var(--kritiek-z); color: var(--kritiek); font-size: 14.5px; }
.dlg footer { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--rand); justify-content: flex-end; }
.pdf-frame { width: 100%; height: 70vh; border: 1px solid var(--rand); background: #fff; }
@media (max-width: 640px) {
  dialog, dialog.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: calc(100dvh - env(safe-area-inset-top) - 18px); }
  dialog[open] { animation: vel-op .42s var(--e); }
  .dlg { max-height: calc(100dvh - env(safe-area-inset-top) - 18px); }
  .dlg header { padding-top: 22px; position: relative; }
  .dlg header::before { content: ''; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; background: var(--rand-2); }
  .dlg footer .btn { flex: 1 1 auto; justify-content: center; }
}
@keyframes vel-op { from { transform: translateY(100%); } to { transform: none; } }

/* lock and toast */
.lock { min-height: 100svh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 50% at 50% 0, color-mix(in srgb, var(--sp2) 16%, transparent), transparent), var(--bg); }
.lock-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: left; padding: 30px 28px; background: var(--vlak); box-shadow: inset 0 0 0 1px var(--rand), var(--schaduw); }
.lock-card .merk { width: 46px; height: 46px; margin-bottom: 6px; }
.lock-card h1 { font-size: 30px; }
.lock-card input { font: 600 22px/1 var(--mono); letter-spacing: .3em; }
.lock-card .btn { justify-content: center; }
.lock-card .lock-or { margin-top: 10px; }
.lock-card .err:empty { display: none; } /* a message only takes room when there is one */
.mark { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(max(24px, env(safe-area-inset-bottom)) + 8px); transform: translate(-50%, 20px); opacity: 0; transition: .3s var(--e); background: var(--actie); color: var(--actie-t); padding: 12px 16px; z-index: 100; max-width: calc(100vw - 32px); font-size: 14.5px; font-weight: 500; box-shadow: var(--schaduw); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #ff5d5d; color: #1a0505; }
@media (max-width: 899px) { .toast { bottom: calc(var(--tab) + env(safe-area-inset-bottom) + 40px); } }
@media (max-width: 640px) { .hide-sm { display: none; } }
@media print { .side, .top, .tabbalk, .menu, .demo-bar, .btn, .chips, .tabs { display: none !important; } .layout { display: block; } main { padding: 0; max-width: none; } .card { break-inside: avoid; box-shadow: none; } body { background: #fff; color: #000; } }

/* charts (js/charts.js) */
.chart { margin: 6px 0 10px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--rand); stroke-width: 1; } .chart .grid.zero { stroke: var(--rand-2); }
.chart .ax { fill: var(--t3); font: 11px var(--mono); } .chart .ax.val { fill: var(--t2); }
.chart .ring { stroke: var(--vlak); stroke-width: 2; }
.chart .guide { stroke: var(--rand-2); stroke-width: 1; opacity: 0; } .chart .hit.on .guide { opacity: 1; }
.chart path.hit.on { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: 13px; color: var(--t2); margin-bottom: 6px; }
.legend i, .chart-tip i, .hb-name i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 50; display: none; pointer-events: none; background: var(--vlak); color: var(--tekst); box-shadow: inset 0 0 0 1px var(--rand-2), 0 10px 30px rgba(0,0,0,.35); padding: 8px 10px; font-size: 13px; max-width: 280px; }
.chart-tip .muted { color: var(--t3); }
.chart-table summary { cursor: pointer; color: var(--t3); }
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(8rem, 15rem) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hb-track { height: 12px; background: var(--vlak-2); }
.hb-fill { display: block; height: 100%; }
.hb-val { font-family: var(--mono); white-space: nowrap; font-size: 13.5px; }
@media (max-width: 600px) { .hbar { grid-template-columns: 1fr auto; } .hb-track { grid-column: 1 / -1; grid-row: 2; } }
.range { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 10px; }
.goal-bar { height: 10px; background: var(--vlak-3); overflow: hidden; } .goal-bar i { display: block; height: 100%; background: var(--spectrum); }
.shot { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 14px; align-items: start; border-top: 1px solid var(--rand); padding-top: 12px; margin-top: 12px; }
.shot img { width: 100%; border: 1px solid var(--rand); }
@media (max-width: 700px) { .shot { grid-template-columns: 1fr; } }
.found { font-size: 14px; } .found td { padding: 4px 6px; }
tr.flag-warn td { background: var(--let-z); } tr.flag-bad td { background: var(--kritiek-z); }
.calc { font-family: var(--mono); font-size: 13px; background: var(--vlak-2); padding: 9px 12px; white-space: pre-wrap; }
input.bad { border-color: var(--kritiek); background: var(--kritiek-z); }
@media print { .range, .page-actions, #delSnap { display: none !important; } .calc { white-space: pre-wrap; } }
.found td:last-child { min-width: 13rem; } .found select { width: 100%; }
/* Expenses → Subscriptions & recurring */
.seg { display: inline-flex; gap: 2px; margin-bottom: 3px; }
.subs-bar { position: sticky; bottom: 0; display: flex; gap: 6px 22px; flex-wrap: wrap; justify-content: flex-end; padding: 12px 16px; background: var(--vlak); box-shadow: inset 0 0 0 1px var(--rand-2); font-size: 14.5px; z-index: 2; }
.subs-bar strong { font-family: var(--mono); font-weight: 600; }
@media (max-width: 899px) { .subs-bar { bottom: calc(var(--tab) + env(safe-area-inset-bottom) + 34px); } }
@media (max-width: 640px) { .subs-cell { text-align: right; min-width: 0; } .subs-cell .seg, .subs-cell .btn-row { justify-content: flex-end; } .subs-cell .btn-row { margin-top: 4px; } }
/* Google Calendar: list of calendars */
.stack { display: grid; gap: 8px; margin: 8px 0 14px; }
