/* Fonts are bundled in vendor/fonts (SIL OFL 1.1), not loaded from Google Fonts. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("vendor/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("vendor/fonts/atkinson-hyperlegible-mono-latin.woff2") format("woff2");
}

/* Voortgangsverkenner (#37), based on the owe-1 prototype. Layout: werkbalk bovenaan, daaronder verkenner-boom (links) en detailpaneel (rechts); op telefoonbreedte gestapeld. */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #0a1b3a;          /* HAN ink, zoals in de Brightspace-export van BSO */
  --muted: #56617a;
  --line: #dce1ea;
  --accent: #e50056;       /* HAN red: selectie en focus */
  --accent-soft: #fde8f0;
  --ok: #1d7f47;  --ok-soft: #e4f4ea;
  --warn: #a35f00; --warn-soft: #fbefdc;
  --bad: #c0283a;  --bad-soft: #fbe5e8;
  --idle: #7c869a; --idle-soft: #eceff4;
  --font-ui: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step-0: 0.875rem; --step-1: 1rem; --step-2: 1.25rem; --step-3: 1.6rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1322; --panel: #121b2e; --ink: #e7ecf6; --muted: #9ba6bd; --line: #25304a;
    --accent: #ff4d8a; --accent-soft: #3a1426;
    --ok: #45cf82; --ok-soft: #10301f; --warn: #f2a53d; --warn-soft: #3a2a10;
    --bad: #ff6f7d; --bad-soft: #3d1419; --idle: #8c96ab; --idle-soft: #1c2538;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1322; --panel: #121b2e; --ink: #e7ecf6; --muted: #9ba6bd; --line: #25304a;
  --accent: #ff4d8a; --accent-soft: #3a1426;
  --ok: #45cf82; --ok-soft: #10301f; --warn: #f2a53d; --warn-soft: #3a2a10;
  --bad: #ff6f7d; --bad-soft: #3d1419; --idle: #8c96ab; --idle-soft: #1c2538;
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: var(--step-1); line-height: 1.45; padding-inline: 16px; }
#app { max-width: 1320px; margin: 0 auto; padding-block: 16px 32px; display: flex; flex-direction: column; gap: 14px; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.2; }
h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

/* Werkbalk */
.bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.bar .title { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field select, .field input { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--step-0); }
.note { font-size: var(--step-0); background: var(--accent-soft); border-radius: 6px; padding: 6px 10px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Werkruimte */
.work { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .work { grid-template-columns: 1fr; } }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pane-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pane-head input[type="search"] { flex: 1 1 140px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; min-width: 0; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: var(--step-0); }

/* Boom */
.tree { list-style: none; margin: 0; padding: 6px 0; max-height: 72vh; overflow: auto; font-size: var(--step-0); }
.row { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px calc(10px + var(--depth) * 16px); cursor: pointer; border-left: 3px solid transparent; }
.row:hover { background: var(--bg); }
.row[aria-selected="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.row.future { color: var(--muted); }
.twisty { width: 14px; flex: none; text-align: center; color: var(--muted); font-size: 0.7rem; }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* Stoplicht */
.light { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px 1px 6px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; flex: none; }
.light::before { content: attr(data-sym); font-family: var(--font-mono); }
.light.ok { color: var(--ok); background: var(--ok-soft); }
.light.warn { color: var(--warn); background: var(--warn-soft); }
.light.bad { color: var(--bad); background: var(--bad-soft); }
.light.idle { color: var(--idle); background: var(--idle-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.idle { background: var(--idle); opacity: .5; }

/* Detail */
.detail { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: var(--step-0); color: var(--muted); }
.crumbs button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact b { font-size: var(--step-2); font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: var(--step-0); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--idle-soft); min-width: 80px; }
.stack span.ok { background: var(--ok); } .stack span.warn { background: var(--warn); } .stack span.bad { background: var(--bad); }
.reason { font-size: var(--step-0); color: var(--muted); }
.commit { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.commit-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.sha { font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--step-0); }
.files li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.files .path { font-family: var(--font-mono); font-size: 0.8rem; word-break: break-all; flex: 1 1 220px; }
.add { color: var(--ok); } .del { color: var(--bad); }
.kind { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--muted); }
pre.diff { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-x: auto; }
pre.diff .a { color: var(--ok); } pre.diff .h { color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--step-0); }
.empty { padding: 24px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: var(--step-0); color: var(--muted); align-items: center; }

/* Additions to the prototype: token, repo filter, settings, errors */
.token-row { display: flex; gap: 6px; }
.token-row input { flex: 1 1 200px; }
.error { margin: 0; font-size: var(--step-0); color: var(--bad); background: var(--bad-soft); border-radius: 6px; padding: 6px 10px; }
.options { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-start; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; margin: 0; padding: 0; }
.filter legend { float: left; margin-right: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: var(--step-0); cursor: pointer; }
.btn-link { border: 0; background: none; padding: 0 4px; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: var(--step-0); }
.settings summary { cursor: pointer; }
.settings-body { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: var(--step-0); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.settings-body label { display: flex; flex-direction: column; gap: 2px; }
.settings-body label.check { flex-direction: row; }
.crumbs { padding: 14px 18px 0; }
.mrs ul { margin: 4px 0 0; padding-left: 18px; font-size: var(--step-0); }
.token-row .btn { white-space: nowrap; }
td strong { white-space: nowrap; }
.token-ok { align-self: center; color: var(--ok); font-weight: 600; font-size: var(--step-0); white-space: nowrap; }
.field .error { margin-top: 4px; max-width: 32rem; }
