/* Momus palette (woonkaart, Brandbook V.01) in a shadcn-style layout: cards with a hairline
   border and 8px radius, a muted segmented tab list, quiet tables, small badges. */
:root {
  color-scheme: light;
  --m-ink: #141414; --m-paper: #FBFBFB; --m-grey: #F1F0EF; --m-archive: #EEE5E3;
  --m-green: #335E4D; --m-mint: #A8DCAB; --m-thistle: #E3CFED;
  --bg: var(--m-paper); --card: #fff; --muted-bg: var(--m-grey); --ink: var(--m-ink); --ink-2: #3d3d3b;
  --muted: #6f6e6a; --border: #e4e2de; --ring: #c9c7c2; --accent: var(--m-green); --pick: var(--m-mint);
  --block-2: var(--m-thistle); --ok: #2f7d4f; --warn: #b26a00; --bad: #b3261e; --bar: #141414; --grid: #ecebe8;
  --serif: "STK Bureau Serif", "Newsreader", Georgia, serif;
  --sans: "STK Bureau Sans", "Hanken Grotesk", system-ui, sans-serif;
  --r: 8px; --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141413; --card: #1c1c1b; --muted-bg: #262625; --ink: #f3f2ef; --ink-2: #cfcdc8; --muted: #9a9893;
    --border: #2f2f2d; --ring: #4a4945; --accent: var(--m-mint); --block-2: #2e2633;
    --ok: #8ac79d; --warn: #e3b25c; --bad: #f2a29c; --bar: #cfcdc8; --grid: #2a2a29;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413; --card: #1c1c1b; --muted-bg: #262625; --ink: #f3f2ef; --ink-2: #cfcdc8; --muted: #9a9893;
  --border: #2f2f2d; --ring: #4a4945; --accent: var(--m-mint); --block-2: #2e2633;
  --ok: #8ac79d; --warn: #e3b25c; --bad: #f2a29c; --bar: #cfcdc8; --grid: #2a2a29;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 22px; height: 22px; stroke-width: 2.2; }
.name { font: 500 22px/1 var(--serif); letter-spacing: -.01em; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--block-2); color: var(--ink); }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--muted-bg); border-radius: var(--r); margin-left: auto; overflow-x: auto; }
.tabs button { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 12px; border-radius: 6px;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .3s var(--ease), color .3s var(--ease); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.icon-btn { border: 1px solid var(--border); background: var(--card); border-radius: var(--r); width: 34px; height: 34px;
  display: grid; place-items: center; cursor: pointer; }

main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--pick); color: var(--m-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
select { border: 1px solid var(--border); border-radius: var(--r); background: var(--card); padding: 6px 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); user-select: none; }
.switch input { display: none; }
.switch span { width: 30px; height: 18px; border-radius: 999px; background: var(--ring); position: relative; transition: background .3s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); transition: transform .3s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(12px); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 900px) { .grid > * { grid-column: span 12; } .tabs button { padding: 6px 8px; } .top { padding: 10px 16px; flex-wrap: wrap; } main { padding: 16px; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 500 17px/1.2 var(--serif); }
.card h3 .sub { margin-left: auto; font: 12px var(--sans); color: var(--muted); }
.stat .k { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.stat .v { font: 400 38px/1.1 var(--serif); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--ring);
  font: 600 10px/1 var(--sans); color: var(--muted); cursor: help; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); white-space: nowrap; }
.badge.mint { background: var(--pick); border-color: transparent; color: var(--m-ink); }
.badge.thistle { background: var(--block-2); border-color: transparent; }
.badge.bad { color: var(--bad); border-color: currentColor; }
.lbl { display: inline-block; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 4px; font: 600 12px/1.5 var(--sans); color: #fff; }
.lbl.dark-text { color: #141414; }

.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--r); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { position: sticky; top: 0; background: var(--card); text-align: left; font-weight: 500; color: var(--muted);
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--muted-bg); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 220px; }
.muted { color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); }

.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 56px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { height: 14px; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; transition: width .45s var(--ease); }
.spark { display: grid; grid-template-columns: 1fr; gap: 10px; }
.spark-row { display: grid; grid-template-columns: 180px 1fr 50px; gap: 12px; align-items: center; font-size: 13px; }
.spark-row svg { width: 100%; height: 34px; stroke: none; }
.spark-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search { display: flex; align-items: center; gap: 8px; max-width: 520px; padding: 4px 4px 4px 12px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--card); margin-bottom: 20px; }
.search input { flex: 1; border: 0; outline: 0; background: none; padding: 6px 0; font-size: 15px; }
.btn { border: 0; border-radius: 6px; background: var(--ink); color: var(--bg); padding: 7px 14px; cursor: pointer; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.timeline .when { color: var(--muted); font-size: 12px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 9px; border-radius: 6px;
  font-size: 12px; max-width: 300px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.panel { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Rapport: long-form report page */
.report { max-width: 920px; margin: 0 auto; }
.report h1 { font: 500 34px/1.15 var(--serif); letter-spacing: -.015em; margin: 6px 0 12px; }
.report h2 { font: 500 24px/1.2 var(--serif); margin: 40px 0 12px; }
.report h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.report .lead { font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 70ch; margin: 0 0 20px; }
.report p, .report li { max-width: 75ch; }
.report ul, .report ol { padding-left: 20px; margin: 0; }
.report li { margin: 4px 0; }
.report .card ul { margin-top: 4px; }
.report table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report th, .report td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.report thead th { color: var(--muted); font-weight: 500; font-size: 12px; }
.report tbody th { font-weight: 500; white-space: nowrap; }
.report td.r, .report th.r { text-align: right; font-variant-numeric: tabular-nums; }
.report tr:last-child > * { border-bottom: 0; }
.report .table-wrap { overflow-x: auto; }
.report i.ok, .report i.warn, .report i.bad { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.report i.ok { background: var(--ok); } .report i.warn { background: var(--warn); } .report i.bad { background: var(--bad); }
.report .legend { font-size: 12px; color: var(--muted); display: flex; gap: 16px; margin: 8px 0 0; }
.report .src { border-top: 1px solid var(--border); padding: 18px 0 6px; }
.report .links { font-size: 13px; color: var(--muted); margin-top: 10px; }
.report .links a, .report table a { color: var(--accent); }
.report .small { font-size: 12px; }
.report code { font-size: 12px; background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; }
.report .todo li { margin: 6px 0; }
@media (max-width: 640px) { .report h1 { font-size: 26px; } .report tbody th { white-space: normal; } }
.report td, .report thead th { white-space: normal; }
.report th { position: static; cursor: default; }
.report tbody tr:hover { background: none; }
.report .table-wrap { max-height: none; }
.report .card.table-wrap { padding: 4px 6px; }
.report table.cov td:nth-child(n+2), .report table.cov thead th:nth-child(n+2) { min-width: 150px; }
.report table.srcs td:first-child { min-width: 200px; }

/* Data app round: text summaries instead of tiles, server tables, progress bars, folds */
.summary { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.summary b { font-weight: 600; color: var(--ink); font-size: 15px; }
.inp { border: 1px solid var(--border); border-radius: var(--r); background: var(--card); padding: 6px 10px; min-width: 180px; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--border); text-decoration: none; font-size: 13px; padding: 6px 12px; margin-left: auto; }
th.sortable { cursor: pointer; } th:not(.sortable) { cursor: default; }
.table-wrap.data { max-height: calc(100vh - 230px); }
.table-wrap.plain { max-height: none; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; font-size: 13px; }
.pager .icon-btn { width: 30px; height: 30px; font-size: 16px; }
.pager .icon-btn:disabled { opacity: .35; cursor: default; }
.ok-mark { color: var(--accent); font-size: 10px; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.ov { max-width: 980px; display: grid; gap: 28px; }
.ov h2 { font: 500 20px/1.2 var(--serif); margin: 0 0 10px; }
.ov h2 .sub { font: 400 12px var(--sans); color: var(--muted); margin-left: 8px; }
.matrix th, .matrix td { white-space: normal; }
.matrix tbody th { font-weight: 500; color: var(--ink); position: static; }
.matrix td .dot, .issues .dot { margin-right: 8px; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.issues b { font-weight: 500; margin-right: 6px; }
.prog-row { display: grid; grid-template-columns: 90px 1fr 56px; gap: 12px; align-items: center; font-size: 13px; margin: 8px 0; }
.prog { position: relative; height: 16px; background: var(--muted-bg); border-radius: 4px; display: flex; overflow: visible; }
.prog i { display: block; height: 100%; }
.prog i:first-child { border-radius: 4px 0 0 4px; }
.prog .h, .prog-legend .h { background: var(--m-green); }
.prog .m, .prog-legend .m { background: var(--m-mint); }
.prog .l, .prog-legend .l { background: var(--m-thistle); }
.prog .cbs { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.prog-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.prog-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
details.fold { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
details.fold > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
details.fold > summary::before { content: "▸ "; } details.fold[open] > summary::before { content: "▾ "; }
details.fold[open] > summary { margin-bottom: 10px; }
@media (max-width: 640px) { .inp { min-width: 0; flex: 1 1 140px; } .prog-row { grid-template-columns: 70px 1fr 48px; } }
.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
