/* ==========================================================================
   Kompaz — stylesheet
   Owner: Jim. Ported from vijfassenkompas.html (the POC) and extended to cover
   the dashboard, forms, the activity list, suggestions and notifications.
   Design tokens and the light/dark blocks below are the POC's, unchanged.
   ========================================================================== */

/* ---------- tokens (from the POC — do not restyle, only extend) ---------- */
:root {
  color-scheme: light;
  --ground:      #f5f7f8;
  --surface:     #fdfdfc;
  --surface-2:   #eef1f3;
  --ink:         #101418;
  --ink-2:       #4c5560;
  --muted:       #838d99;
  --hairline:    #e2e6ea;
  --hairline-2:  #cdd4da;
  --now:         #2a78d6;
  --now-soft:    rgba(42,120,214,0.13);
  --cmp:         #eb6834;
  --cmp-soft:    rgba(235,104,52,0.11);
  --focus:       #2a78d6;
  --shadow:      0 1px 2px rgba(16,20,24,0.05), 0 8px 24px -14px rgba(16,20,24,0.28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground:     #0e1114;
    --surface:    #171b1f;
    --surface-2:  #1f252a;
    --ink:        #f4f6f8;
    --ink-2:      #b6bec7;
    --muted:      #7f8993;
    --hairline:   #262c32;
    --hairline-2: #333b43;
    --now:        #3987e5;
    --now-soft:   rgba(57,135,229,0.18);
    --cmp:        #d95926;
    --cmp-soft:   rgba(217,89,38,0.16);
    --focus:      #3987e5;
    --shadow:     0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -14px rgba(0,0,0,0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground:     #0e1114;
  --surface:    #171b1f;
  --surface-2:  #1f252a;
  --ink:        #f4f6f8;
  --ink-2:      #b6bec7;
  --muted:      #7f8993;
  --hairline:   #262c32;
  --hairline-2: #333b43;
  --now:        #3987e5;
  --now-soft:   rgba(57,135,229,0.18);
  --cmp:        #d95926;
  --cmp-soft:   rgba(217,89,38,0.16);
  --focus:      #3987e5;
  --shadow:     0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -14px rgba(0,0,0,0.8);
}

/* Extensions to the token set. Status hues are reserved for state and are never
   reused as a data series colour. --now / --cmp above are the only series hues:
   validated for CVD separation and >=3:1 against both surfaces. */
:root {
  --good:      #1f7a52;
  --good-soft: rgba(31,122,82,0.12);
  --warn:      #8a6414;
  --warn-soft: rgba(138,100,20,0.12);
  --bad:       #a8322a;
  --bad-soft:  rgba(168,50,42,0.12);
  --radius:    12px;
  --radius-sm: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --good:      #46b585;
    --good-soft: rgba(70,181,133,0.16);
    --warn:      #cf9f3d;
    --warn-soft: rgba(207,159,61,0.16);
    --bad:       #e0685e;
    --bad-soft:  rgba(224,104,94,0.16);
  }
}
:root[data-theme="dark"] {
  --good:      #46b585;
  --good-soft: rgba(70,181,133,0.16);
  --warn:      #cf9f3d;
  --warn-soft: rgba(207,159,61,0.16);
  --bad:       #e0685e;
  --bad-soft:  rgba(224,104,94,0.16);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1140px; margin: 0 auto; padding: 40px 24px 80px; }
@media (max-width: 640px) { .wrap { padding: 24px 16px 64px; } }

:where(a) { color: var(--now); }
:where(a):focus-visible,
:where(button, [tabindex], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--surface); color: var(--ink); border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; text-decoration: none;
  transition: top .12s ease;
}
.skip-link:focus { top: 16px; }

/* ---------- header ---------- */
.masthead {
  display: flex; flex-direction: column; gap: 14px;
  padding-bottom: 26px; border-bottom: 1px solid var(--hairline-2);
}
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.08; margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.northstar {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 17px; line-height: 1.55; color: var(--ink-2);
  max-width: 62ch; margin: 0;
  border-left: 3px solid var(--now); padding-left: 16px;
}
.northstar:empty::before { content: "Nog geen north star bepaald."; color: var(--muted); font-style: italic; }
.masthead-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.masthead-bar .spacer { margin-left: auto; }
.whoami { font-size: 12.5px; color: var(--muted); }

/* ---------- navigation ---------- */
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 20px 0 26px; border-bottom: 1px solid var(--hairline);
}
.tabs button {
  font: inherit; font-size: 13.5px; font-weight: 600;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 12px; cursor: pointer; transition: color .12s, border-color .12s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--now); }
.tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 4px 4px 0 0; }

/* ---------- mode bar (POC) ---------- */
.modebar { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin: 22px 0 26px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  width: 40px; height: 22px; border-radius: 999px; background: var(--hairline-2);
  position: relative; transition: background .16s ease; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--surface); transition: transform .16s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.toggle input:checked + .switch { background: var(--cmp); }
.toggle input:checked + .switch::after { transform: translateX(18px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle-label { font-size: 13px; font-weight: 600; }
.cmpname {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: 7px; padding: 7px 11px; min-width: 210px;
}
.cmpname:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.savestate { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ---------- layout primitives ---------- */
.board { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 30px; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel-pad { padding: 18px 20px 20px; }
.panel-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--hairline);
}
.panel-head .spacer { margin-left: auto; }
.panel-title { font-size: 14px; font-weight: 700; letter-spacing: .01em; margin: 0; }
.panel-sub { font-size: 12.5px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 16px; }
h3 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: .01em; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-2); border-radius: var(--radius-sm);
  padding: 9px 14px; cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--now); border-color: var(--now); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); background: var(--now); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--bad); border-color: var(--hairline-2); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { font-size: 12.5px; padding: 6px 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.input, .textarea, .select {
  font: inherit; font-size: 14px; color: var(--ink); width: 100%;
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm); padding: 9px 11px;
}
.textarea { font-family: "Source Serif 4", Georgia, serif; resize: vertical; min-height: 64px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); font-style: italic; }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.hint { font-size: 12.5px; color: var(--muted); }
.error { font-size: 12.5px; color: var(--bad); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* the POC's free-text note field */
.fill {
  font: inherit; font-size: 13.5px; color: var(--ink); width: 100%;
  margin-top: 12px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid transparent; resize: vertical; min-height: 42px;
  font-family: "Source Serif 4", Georgia, serif;
}
.fill::placeholder { color: var(--muted); font-style: italic; }
.fill:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--hairline-2); }

/* ---------- domain rows (POC) ---------- */
.rows { display: flex; flex-direction: column; gap: 12px; }
.row { padding: 16px 18px 15px; }
.row-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 2px; flex: none; align-self: center; background: var(--now); }
.dname { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.dq { font-family: "Source Serif 4", Georgia, serif; font-size: 14px; color: var(--ink-2); font-style: italic; }
.anchor {
  font-family: "Source Serif 4", Georgia, serif; font-size: 14.5px; line-height: 1.5;
  color: var(--ink-2); margin: 10px 0 0; min-height: 2.9em;
}
.anchor b { color: var(--ink); font-weight: 600; font-style: normal; font-family: Archivo, sans-serif; font-size: 13px; }

.scalerow { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.scale { display: inline-flex; border: 1px solid var(--hairline-2); border-radius: var(--radius-sm); overflow: hidden; }
.scale button {
  font: inherit; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums;
  width: 40px; height: 34px; border: 0; border-right: 1px solid var(--hairline);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: background .12s, color .12s;
}
.scale button:last-child { border-right: 0; }
.scale button:hover { background: var(--surface-2); color: var(--ink); }
.scale button[aria-pressed="true"] { background: var(--now); color: #fff; }
.scale.cmp button[aria-pressed="true"] { background: var(--cmp); color: #fff; }
.scale button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; z-index: 1; position: relative; }
.scalecap { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- rubric table (POC) ---------- */
.rubric { margin-top: 44px; }
.tablescroll { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
/* the wide rubric grid only — a table elsewhere (or inside .sr-only) must not
   inherit a 900px floor and blow out the page width */
.tablescroll table { min-width: 900px; }
.sr-only table { min-width: 0; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
thead th {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; border-bottom: 1px solid var(--hairline-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td.dcell { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
td.lvl { font-family: "Source Serif 4", Georgia, serif; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); width: 19%; }
.num { display: inline-block; font-family: Archivo, sans-serif; font-weight: 700; font-size: 11px; color: var(--muted); margin-right: 5px; }

.footnote { font-family: "Source Serif 4", Georgia, serif; font-size: 14px; color: var(--ink-2); max-width: 68ch; margin: 26px 0 0; }
.footnote b { font-family: Archivo, sans-serif; font-size: 13px; color: var(--ink); }

/* ==========================================================================
   Charts — radar.js and charts.js render into these
   ========================================================================== */

.chartpanel { padding: 18px 16px 14px; position: sticky; top: 16px; }
@media (max-width: 900px) { .chartpanel { position: static; } }
.chartwrap { position: relative; }
svg.radar, svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.radar text, svg.chart text { font-family: Archivo, sans-serif; }

/* focusable data points */
.hit { cursor: default; outline: none; }
.focus-ring { pointer-events: none; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 12px 6px 2px; border-top: 1px solid var(--hairline); margin-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.avg { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.tip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s ease;
  background: var(--ink); color: var(--ground); font-size: 12px; font-weight: 500;
  padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -140%);
  z-index: 5; max-width: 260px;
}
.tip.on { opacity: 1; }
.tip b { font-weight: 700; }
.tip .tip-line { display: block; white-space: nowrap; }

/* per-domain progress */
.progress-list { display: flex; flex-direction: column; }
.progress-row { padding: 14px 20px; border-bottom: 1px solid var(--hairline); }
.progress-row:last-child { border-bottom: 0; }
.progress-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.progress-name { font-size: 14px; font-weight: 700; }
.progress-score { margin-left: auto; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-score .of { color: var(--muted); font-weight: 500; }
.progress-none { margin-left: auto; font-size: 12.5px; color: var(--muted); font-style: italic; }
.progress-bar { display: flex; gap: 2px; margin-top: 9px; }
.progress-seg { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); }
.progress-seg.on { background: var(--now); }
.progress-seg.part { background: linear-gradient(to right, var(--now) var(--pct, 0%), var(--surface-2) var(--pct, 0%)); }
.progress-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-top: 8px; }
.progress-level {
  font-family: "Source Serif 4", Georgia, serif; font-size: 13.5px; line-height: 1.45;
  color: var(--ink-2); margin: 0; flex: 1 1 240px;
}
.delta { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }
.delta-flat { color: var(--muted); }

/* trend: one overall chart + per-domain small multiples */
.trend { display: flex; flex-direction: column; gap: 18px; }
.trend-main { position: relative; }
/* The main trend chart sizes its own viewBox to its pixel width (see charts.js),
   so it must not be rescaled here. The sparklines do stretch, on purpose. */
.trend-main svg.chart { width: 100%; height: auto; }
.spark svg.spark-svg { width: 100%; height: 56px; }
.spark-none { font-size: 12px; color: var(--muted); font-style: italic; margin: 10px 0 4px; }
.spark-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.spark {
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 10px 12px 8px; background: var(--surface);
}
.spark-head { display: flex; align-items: baseline; gap: 8px; }
.spark-name { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.spark-val { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.spark svg.chart { margin-top: 6px; }
.chart-cursor line { stroke: var(--hairline-2); stroke-width: 1; }
.chart-axis text { font-size: 10px; fill: var(--muted); font-weight: 600; }
.chart-grid line { stroke: var(--hairline); stroke-width: 1; }

/* empty / loading states */
.empty {
  text-align: center; padding: 34px 20px; color: var(--muted);
  font-family: "Source Serif 4", Georgia, serif; font-size: 14.5px; font-style: italic;
}
.empty .btn { font-family: Archivo, sans-serif; font-style: normal; margin-top: 14px; }
.skeleton { background: var(--surface-2); border-radius: var(--radius-sm); min-height: 14px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ==========================================================================
   Activities
   ========================================================================== */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity {
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
  padding: 15px 18px;
}
.activity-main { flex: 1 1 260px; min-width: 0; }
.activity-title { font-size: 15px; font-weight: 700; margin: 0; }
.activity-dates { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.activity-notes {
  font-family: "Source Serif 4", Georgia, serif; font-size: 13.5px; color: var(--ink-2);
  margin: 8px 0 0; max-width: 62ch;
}
.activity-scores { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border-radius: 999px; padding: 3px 10px;
}
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.activity-actions { display: flex; gap: 8px; align-items: center; }
.badge {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.badge-active { background: var(--good-soft); color: var(--good); }
.badge-done { background: var(--surface-2); color: var(--muted); }
.badge-planned { background: var(--now-soft); color: var(--now); }

/* ==========================================================================
   Suggestions
   ========================================================================== */
.suggestions { display: flex; flex-direction: column; gap: 12px; }
.suggestion { padding: 14px 18px; border-left: 3px solid var(--now); }
.suggestion h3 { font-size: 14px; }
.suggestion p {
  font-family: "Source Serif 4", Georgia, serif; font-size: 14px; color: var(--ink-2);
  margin: 6px 0 0; max-width: 64ch;
}
.suggestion .chip { margin-top: 10px; }

/* ==========================================================================
   Notifications — bell, panel and toasts
   ========================================================================== */
.bell { position: relative; }
.bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  border-radius: 999px; background: var(--cmp); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; padding: 0 4px;
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.notif-anchor { position: relative; }
.notif {
  display: flex; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--hairline); text-align: left;
}
.notif:last-child { border-bottom: 0; }
.notif-unread { background: var(--now-soft); }
.notif-body { min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 700; margin: 0; }
.notif-text { font-size: 13px; color: var(--ink-2); margin: 3px 0 0; }
.notif-time { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.notif-mark {
  width: 7px; height: 7px; border-radius: 50%; background: var(--now);
  flex: none; margin-top: 6px;
}
.notif-mark[data-read="true"] { background: transparent; }

/* ---------- page-level message bar ---------- */
/* One bar under the masthead for state that concerns the whole page: a failed
   load, a validation problem, a confirmed save. Variants carry a word as well as
   a colour, so the meaning never rests on hue alone. Pair with role="status";
   use role="alert" only for .banner-error. */
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 18px 0 0; padding: 11px 14px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline-2); border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.45;
}
.banner-info    { border-left-color: var(--now);  background: var(--now-soft); }
.banner-success { border-left-color: var(--good); background: var(--good-soft); }
.banner-warn    { border-left-color: var(--warn); background: var(--warn-soft); }
.banner-error   { border-left-color: var(--bad);  background: var(--bad-soft); }
.banner-title { font-weight: 700; }
.banner .btn { margin-left: auto; flex: none; }

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: flex; flex-direction: column; gap: 10px;
  width: min(340px, calc(100vw - 32px));
}
.toast {
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-left: 3px solid var(--now); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 12px 14px;
  animation: toast-in .18s ease-out;
}
.toast-milestone { border-left-color: var(--good); }
.toast-suggestion { border-left-color: var(--cmp); }
.toast-error { border-left-color: var(--bad); }
.toast-title { font-size: 13.5px; font-weight: 700; margin: 0; }
.toast-text { font-size: 13px; color: var(--ink-2); margin: 3px 0 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Branding (R6) — the mark is a compass needle inside its ring: Kompaz is a
   compass, and the long north arm is the north star. Inline SVG, no raster.
   The ring takes currentColor so it inherits the surrounding ink in either
   theme; the needle takes --now, the same accent the charts use.
   ========================================================================== */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { display: block; width: 24px; height: 24px; flex: none; }
.brand-mark .brand-ring { stroke: currentColor; opacity: .32; }
.brand-mark .brand-needle { fill: var(--now); }
.brand-name {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
  line-height: 1;
}
.brand-lg .brand-mark { width: 44px; height: 44px; }
.brand-lg .brand-name { font-size: 26px; }
.brand-lockup { display: flex; flex-direction: column; gap: 2px; }
.brand-tagline { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ==========================================================================
   The north star on the dashboard (R8) — "voldoende afstand van de andere
   elementen". It gets its own band of quiet: a label, the statement at reading
   size, and real space before the charts begin.
   ========================================================================== */
.northstar-hero, #northStarOut {
  position: relative;
  margin: 34px 0 40px;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--now);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.42;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 46ch;
  text-wrap: balance;
}
.northstar-hero::before, #northStarOut::before {
  content: "Je noorderster";
  display: block;
  font-family: Archivo, sans-serif;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin-bottom: 10px;
}
.northstar-hero:empty, #northStarOut:empty { color: var(--muted); font-style: italic; }
.northstar-hero:empty::after, #northStarOut:empty::after {
  content: "Nog geen noorderster bepaald — stel er een in bij Domeinen.";
  font-size: 16px;
}
@media (max-width: 640px) {
  .northstar-hero, #northStarOut { margin: 24px 0 30px; padding-left: 16px; }
}

/* ---------- auth / landing ---------- */
.landing {
  position: relative; z-index: 1;
  max-width: 560px; margin: 12vh auto 0; text-align: center; padding: 0 24px;
}
.landing .northstar { border-left: 0; padding-left: 0; margin: 18px auto 26px; text-align: left; }
.landing .brand { justify-content: center; margin-bottom: 26px; }
/* Everything on the landing screen except the sky sits ABOVE it. A positioned
   layer paints over plain in-flow content whatever its z-index, so the content
   has to be lifted explicitly — without this the sky swallows the login button. */
.landing > *:not(.starfield) { position: relative; z-index: 1; }

/* The animated sky (R5). A fixed layer BEHIND everything, that cannot be
   clicked and cannot cover the login control: the landing content above sets
   z-index 1, and this never rises past 0. Hidden entirely from assistive tech
   and from print. */
.starfield {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 52% 26%, var(--surface-2) 0%, var(--ground) 62%);
}
.starfield canvas { display: block; width: 100%; height: 100%; }
@media print { .starfield { display: none; } }

@media (prefers-reduced-motion: reduce) { *, *::after { transition: none !important; animation: none !important; } }
@media (forced-colors: active) {
  .panel, .btn, .notif-panel, .toast { border-color: CanvasText; }
  .progress-seg.on { background: Highlight; }
}

/* ==========================================================================
   ROUND 2 SURFACES
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Onboarding (R3 / KOM-9) — a stepped first run.
   The brief was "calm and unhurried, not a form to survive", so: one question
   per screen, a wide measure of whitespace, a serif lead, and controls that sit
   quietly at the bottom instead of shouting from the top.
   -------------------------------------------------------------------------- */
.onboarding {
  max-width: 680px; margin: 0 auto; padding: 8px 0 64px;
}
.onboarding .ob-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 36px 28px;
}
@media (max-width: 640px) { .onboarding .ob-card { padding: 24px 20px 20px; } }

/* step rail — numbers plus state, never colour alone */
.ob-progress {
  display: flex; align-items: center; gap: 0;
  margin: 0 0 26px; padding: 0; list-style: none;
}
.ob-step { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; }
.ob-step:last-child { flex: 0 0 auto; }
.ob-step-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--hairline-2);
}
.ob-step-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ob-step-rail { flex: 1 1 auto; height: 1px; background: var(--hairline-2); margin: 0 10px; min-width: 12px; }
.ob-step[data-state="current"] .ob-step-dot { background: var(--now); border-color: var(--now); color: #fff; }
.ob-step[data-state="current"] .ob-step-label { color: var(--ink); }
.ob-step[data-state="done"] .ob-step-dot { background: var(--now-soft); border-color: var(--now); color: var(--now); }
/* the tick is a glyph, so "done" survives greyscale and forced-colors */
.ob-step[data-state="done"] .ob-step-dot::after { content: "✓"; }
.ob-step[data-state="done"] .ob-step-number { display: none; }
@media (max-width: 640px) {
  .ob-step-label { display: none; }
  .ob-step { flex: 1 1 auto; }
}

.ob-eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
/* This lands on an <h2>, and the global h2 is a small uppercase section label —
   so the display treatment has to be stated, not inherited. */
.ob-title {
  font-size: clamp(22px, 3vw, 30px); line-height: 1.15; font-weight: 700;
  letter-spacing: -0.02em; margin: 8px 0 0; text-wrap: balance;
  text-transform: none; color: var(--ink);
}
.ob-lead {
  font-family: "Source Serif 4", Georgia, serif; font-size: 16.5px; line-height: 1.55;
  color: var(--ink-2); max-width: 54ch; margin: 12px 0 0;
}
.ob-body { margin-top: 26px; }
.ob-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--hairline);
}
.ob-actions .spacer { margin-left: auto; }
.ob-resume { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

/* --------------------------------------------------------------------------
   2. Categories and spheres (R1/R2 / KOM-8).
   IDENTITY IS NOT CARRIED BY HUE. Eight categories cannot be told apart by
   colour — no eight-hue set clears colour-blind separation, the same argument
   that made the trend chart small multiples. So a category is a SHAPE plus its
   label, and the two spheres get the one validated colour pair (--now / --cmp)
   AND their word. Greyscale, colour-blind and forced-colors readers all keep
   full information.
   -------------------------------------------------------------------------- */
.cat-glyph {
  display: inline-block; width: 1.1em; text-align: center; flex: none;
  color: var(--ink-2); font-size: 0.95em; line-height: 1;
}
/* one shape per category key, keyed off data-category — no JS needed */
[data-category="job"]              > .cat-glyph::before,
.cat-glyph[data-category="job"]::before              { content: "■"; }
[data-category="project"]          > .cat-glyph::before,
.cat-glyph[data-category="project"]::before          { content: "▲"; }
[data-category="studie"]           > .cat-glyph::before,
.cat-glyph[data-category="studie"]::before           { content: "◆"; }
[data-category="sport"]            > .cat-glyph::before,
.cat-glyph[data-category="sport"]::before            { content: "●"; }
[data-category="hobby"]            > .cat-glyph::before,
.cat-glyph[data-category="hobby"]::before            { content: "★"; }
[data-category="vrijwilligerswerk"] > .cat-glyph::before,
.cat-glyph[data-category="vrijwilligerswerk"]::before { content: "✚"; }
[data-category="zorg"]             > .cat-glyph::before,
.cat-glyph[data-category="zorg"]::before             { content: "♥"; }
[data-category="overig"]           > .cat-glyph::before,
.cat-glyph[data-category="overig"]::before           { content: "○"; }

/* picker: a radio card per category */
.cat-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px; margin: 0; padding: 0; border: 0;
}
.cat-option {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm); transition: border-color .12s, background .12s;
}
.cat-option:hover { background: var(--surface-2); }
.cat-option input { position: absolute; opacity: 0; pointer-events: none; }
.cat-option .cat-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cat-option .cat-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.cat-option:has(input:checked),
.cat-option.is-selected { border-color: var(--now); background: var(--now-soft); }
.cat-option:has(input:checked) .cat-glyph,
.cat-option.is-selected .cat-glyph { color: var(--now); }
.cat-option:has(input:focus-visible),
.cat-option.is-focused { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the category's own extra fields, revealed once one is chosen */
.cat-fields {
  margin-top: 18px; padding: 16px 18px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
}
.cat-fields-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 14px;
}
.cat-fields:empty { display: none; }

/* sphere: two options, the validated colour pair, each carrying its word */
.sphere-toggle { display: inline-flex; border: 1px solid var(--hairline-2); border-radius: var(--radius-sm); overflow: hidden; }
.sphere-toggle button {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border: 0; border-right: 1px solid var(--hairline);
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: background .12s, color .12s;
}
.sphere-toggle button:last-child { border-right: 0; }
.sphere-toggle button:hover { background: var(--surface-2); color: var(--ink); }
.sphere-toggle button[aria-pressed="true"][data-sphere="professioneel"] { background: var(--now); color: #fff; }
.sphere-toggle button[aria-pressed="true"][data-sphere="persoonlijk"]   { background: var(--cmp); color: #fff; }
.sphere-toggle button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; position: relative; z-index: 1; }

/* chips on an activity card */
.chip-cat { gap: 6px; }
.chip-sphere { font-weight: 700; }
.chip-sphere[data-sphere="professioneel"] { background: var(--now-soft); color: var(--now); }
.chip-sphere[data-sphere="persoonlijk"]   { background: var(--cmp-soft); color: var(--cmp); }

/* filtering and grouping the activity list */
.activity-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-chip {
  font: inherit; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--hairline-2); border-radius: 999px;
  transition: background .12s, border-color .12s, color .12s;
}
.filter-chip:hover { background: var(--surface-2); color: var(--ink); }
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.filter-chip[aria-pressed="true"] .cat-glyph { color: var(--ground); }
.filter-chip .filter-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-chip[aria-pressed="true"] .filter-count { color: var(--ground); opacity: .75; }
.filter-clear { margin-left: auto; }

.activity-group { margin-bottom: 26px; }
.activity-group-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.activity-group-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
.activity-group-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }

/* --------------------------------------------------------------------------
   3. CV / LinkedIn import proposal (R4 / KOM-10).
   The rule driving every choice here: the user must NEVER wonder whether this
   is saved. A proposal is drawn as provisional — dashed edge, a standing
   "nog niet opgeslagen" badge, and an action bar that stays in view — and it
   stops looking provisional only once it is actually stored.
   -------------------------------------------------------------------------- */
.import-panel { max-width: 780px; }
.import-paste { min-height: 190px; font-family: "Source Serif 4", Georgia, serif; }
.import-hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

.proposal {
  position: relative; margin-top: 22px; padding: 20px 22px 18px;
  background: var(--surface);
  border: 2px dashed var(--hairline-2); border-radius: var(--radius);
}
.proposal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.proposal-title { font-size: 15px; font-weight: 700; margin: 0; text-transform: none; color: var(--ink); }
.proposal-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  border-radius: 999px; padding: 4px 10px; margin-left: auto;
}
.proposal-status::before { content: "●"; font-size: 8px; letter-spacing: 0; }
.proposal-status[data-state="draft"]  { background: var(--warn-soft); color: var(--warn); }
.proposal-status[data-state="saving"] { background: var(--now-soft); color: var(--now); }
.proposal-status[data-state="saved"]  { background: var(--good-soft); color: var(--good); }
.proposal-status[data-state="saved"]::before { content: "✓"; font-size: 11px; }
/* accepted and stored: the provisional look drops away */
.proposal[data-state="saved"] { border-style: solid; border-color: var(--good); }

.proposal-rationale {
  font-family: "Source Serif 4", Georgia, serif; font-size: 14px; line-height: 1.55;
  color: var(--ink-2); margin: 10px 0 0; max-width: 64ch;
}
.proposal-section { margin-top: 22px; }
.proposal-section > h4 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 10px;
}
.proposal-domain {
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; background: var(--surface);
}
.proposal-domain-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.proposal-domain-head .input { font-weight: 700; }
.proposal-levels { display: flex; flex-direction: column; gap: 8px; }
.proposal-level { display: flex; align-items: flex-start; gap: 10px; }
.proposal-level-num {
  flex: none; width: 22px; height: 22px; margin-top: 8px;
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center;
}
.proposal-actions {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 22px -22px -18px; padding: 14px 22px;
  background: var(--surface); border-top: 1px solid var(--hairline);
  border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
}
.proposal-actions .spacer { margin-left: auto; }
.proposal-warning { font-size: 12.5px; color: var(--ink-2); }
