/* Ten Goede · Effect tab (ef-), nameting page (exs-), save indicator.
   Diverging pair for "better ↔ worse" (validated for colour-vision deficiency
   against both surfaces): blue ↔ red with a neutral grey middle. */
:root {
  --ef-better: #2a78d6; --ef-better-2: #8db7ea;
  --ef-worse: #e34948; --ef-worse-2: #f0a3a2;
  --ef-same: #dcdad5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ef-better: #3987e5; --ef-better-2: #2a4f7c; --ef-worse: #e66767; --ef-worse-2: #7a3534; --ef-same: #45443f; }
}
:root[data-theme="dark"] { --ef-better: #3987e5; --ef-better-2: #2a4f7c; --ef-worse: #e66767; --ef-worse-2: #7a3534; --ef-same: #45443f; }

.ef { min-width: 0; }
.ef-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.ef-head h2 { font-size: var(--t-xl); line-height: 1.3; margin: 4px 0 6px; }
.ef-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ef-kicker .chip { text-transform: none; letter-spacing: 0; }
.ef-loading { display: flex; align-items: center; gap: 8px; margin: 14px 0; }
.ef-metrics { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* goals */
.ef-goals td, .ef-steps td { vertical-align: middle; }
.ef-goals td:first-child { min-width: 180px; max-width: 300px; }
.ef-src { display: block; margin-top: 2px; font-size: var(--t-xs); max-width: 280px; overflow: hidden; }
.ef-src a { max-width: 100%; }
.ef-col-viz { width: 1%; white-space: nowrap; }
.ef-edit { margin-left: 4px; vertical-align: middle; opacity: .6; }
.ef-edit:hover, .ef-edit:focus-visible { opacity: 1; }
.ef-bullet, .ef-steps svg { display: block; overflow: visible; }
.ef-b-track { stroke: var(--line-2); stroke-width: 2; stroke-linecap: round; }
.ef-b-target { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 2; }
.ef-b-move { stroke-width: 3; stroke-linecap: round; stroke: var(--ink-4); }
.ef-b-move[data-tone="ok"] { stroke: var(--ok); }
.ef-b-move[data-tone="bad"] { stroke: var(--bad); }
.ef-b-before { fill: var(--sheet); stroke: var(--ink-3); stroke-width: 2; }
.ef-b-after { fill: var(--ink); stroke: var(--sheet); stroke-width: 2; }
.ef-b-after[data-tone="ok"] { fill: var(--ok); }
.ef-b-after[data-tone="bad"] { fill: var(--bad); }
.ef-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; }
.ef-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ef-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ef-k-before { background: var(--sheet); box-shadow: inset 0 0 0 2px var(--ink-3); }
.ef-k-after { background: var(--ink); }
.ef-k-target { width: 2px !important; height: 12px !important; border-radius: 0 !important; background: repeating-linear-gradient(var(--ink) 0 2px, transparent 2px 4px); }

/* weekly trend */
.ef-chart { position: relative; overflow-x: auto; }
.ef-svg { display: block; width: 100%; min-width: 560px; height: auto; touch-action: pan-y; }
.ef-band { fill: var(--sunk); }
.ef-band.after { fill: var(--accent-soft); opacity: .7; }
.ef-band-l { font-size: 11px; fill: var(--ink-3); font-weight: 500; }
.ef-grid { stroke: var(--line); stroke-width: 1; }
.ef-ax { font-size: 11px; fill: var(--ink-3); font-family: var(--f-ui); }
.ef-ax.strong { fill: var(--ink-2); font-weight: 600; }
.ef-goal-line { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ef-live { stroke: var(--ink); stroke-width: 1.5; }
.ef-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ef-cross { stroke: var(--ink-3); stroke-width: 1; pointer-events: none; }
.ef-dot { fill: var(--accent); stroke: var(--sheet); stroke-width: 2; pointer-events: none; }
.ef-tip { position: absolute; top: 28px; min-width: 170px; padding: 8px 10px; border-radius: var(--r); background: var(--sheet); box-shadow: 0 0 0 1px var(--line), var(--shadow); font-size: var(--t-xs); pointer-events: none; display: flex; flex-direction: column; gap: 2px; z-index: 2; }
.ef-tip b { font-size: var(--t-m); color: var(--ink); }
.ef-tip span { color: var(--ink-3); }

/* experience */
.ef-score { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--sunk); margin-bottom: 18px; }
.ef-score > div { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.ef-score small { font-size: var(--t-xs); color: var(--ink-3); font-weight: 500; }
.ef-score b { font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.ef-score-arrow { color: var(--ink-4); }
.ef-themes { display: flex; flex-direction: column; }
.ef-theme { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.1fr); gap: 8px 20px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.ef-theme-t b { display: block; font-weight: 600; }
.ef-theme-t small { color: var(--ink-3); font-size: var(--t-xs); }
.ef-theme .ef-q { grid-column: 1 / -1; }
.ef-div { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; }
.ef-div i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 600; min-width: 3px; }
.ef-a-veel-beter { background: var(--ef-better); color: #fff; }
.ef-a-beter { background: var(--ef-better-2); color: var(--ink); }
.ef-a-gelijk { background: var(--ef-same); color: var(--ink); }
.ef-a-slechter { background: var(--ef-worse-2); color: var(--ink); }
.ef-a-veel-slechter { background: var(--ef-worse); color: #fff; }
.ef-legend i[class^="ef-a-"] { border-radius: 2px; }
.ef-q { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 0; padding: 8px 10px; border-radius: var(--r); background: var(--ev-interview-soft); font-size: var(--t-s); color: var(--ink-2); }
.ef-q small { display: block; color: var(--ink-3); font-size: var(--t-xs); margin-top: 2px; }
.ef-h3 { font-size: var(--t-m); margin: 22px 0 8px; }
.ef-remarks { display: flex; flex-direction: column; gap: 8px; }
.ef-remarks li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: var(--t-s); }
.ef-remarks small { display: block; color: var(--ink-3); font-size: var(--t-xs); margin-top: 3px; }

/* conclusion */
.ef-gen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px dashed var(--ev-ai-line); border-radius: var(--r-l); background: var(--ev-ai-soft); }
.ef-ai-h { font-weight: 600; color: var(--ink); margin: 10px 0 4px; font-size: var(--t-s); }
.ef-ai-l { list-style: disc; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.ef-form fieldset { border: 0; padding: 0; margin: 0; }
.ef-form .check { align-items: flex-start; }

/* side: measurement plan */
.ef-plan { display: flex; flex-direction: column; gap: 0; }
.ef-plan li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; position: relative; }
.ef-plan li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 26px; bottom: -6px; width: 2px; background: var(--line); }
.ef-plan li > div { flex: 1; min-width: 0; }
.ef-plan b { display: block; font-size: var(--t-s); }
.ef-plan small { color: var(--ink-3); font-size: var(--t-xs); }
.ef-plan-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--sheet); display: grid; place-items: center; margin-top: 1px; color: var(--on-ink); position: relative; z-index: 1; }
.ef-plan li[data-st="afgerond"] .ef-plan-dot { background: var(--ok); border-color: var(--ok); }
.ef-plan li[data-st="open"] .ef-plan-dot { border-color: var(--warn); background: var(--warn-soft); }
.ef-plan li[data-st="vervallen"] { opacity: .55; }
.ef-method p + p { margin-top: 8px; }
.ef-method .ev { vertical-align: -2px; }

/* empty state with the cycle */
.ef-empty { max-width: 760px; margin: 0 auto; }
.ef-cycle { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; counter-reset: c; }
.ef-cycle li { padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sheet); counter-increment: c; }
.ef-cycle li::before { content: counter(c); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mute-soft); font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.ef-cycle li.cur { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ef-cycle li.cur::before { background: var(--ink); color: var(--on-ink); }
.ef-cycle b { display: block; font-size: var(--t-s); }
.ef-cycle small { color: var(--ink-3); font-size: var(--t-xs); }

@media (max-width: 700px) {
  .ef-theme { grid-template-columns: 1fr; }
  .ef-cycle { grid-template-columns: 1fr 1fr; }
  .ef-score b { font-size: 26px; }
  .ef-col-viz { display: none; }
}

/* nameting (participant page) */
.exs-score { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.exs-n { position: relative; }
.exs-n input { position: absolute; opacity: 0; inset: 0; }
.exs-n span { display: grid; place-items: center; height: 40px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--sheet); font-weight: 600; cursor: pointer; }
.exs-n input:checked + span { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.exs-n input:focus-visible + span { box-shadow: var(--focus); }
.exs-q { margin-top: 14px !important; }
.exs-q legend { font-weight: 600; font-size: var(--t-s); margin-bottom: 6px; }
.exs-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.exs-o { position: relative; }
.exs-o input { position: absolute; opacity: 0; inset: 0; }
.exs-o span { display: inline-flex; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--sheet); font-size: var(--t-s); cursor: pointer; }
.exs-o input:checked + span { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.exs-o input:focus-visible + span { box-shadow: var(--focus); }
@media (max-width: 480px) { .exs-score { grid-template-columns: repeat(5, 1fr); } }

/* save indicator (sidebar) */
.sync-ind { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; transition: background .2s; }
.sync-ind[data-state="saving"] { background: var(--warn); }
.sync-ind[data-state="offline"], .sync-ind[data-state="error"] { background: var(--bad); }

/* ── goals: difference, source, reasons ─────────────────────────────── */
.ef-delta { white-space: nowrap; }
.ef-d-good { color: var(--ok); font-weight: 600; }
.ef-d-bad { color: var(--bad); font-weight: 600; }
.ef-why { display: block; margin-top: 4px; font-size: var(--t-xs); color: var(--ink-3); max-width: 260px; white-space: normal; line-height: 1.4; }
.ef-goals tr.ef-manual td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.ef-srctag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-s); color: var(--ink-2); white-space: nowrap; }
.ef-conf { font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--mute-soft); color: var(--ink-3); }
.ef-conf[data-c="hoog"] { background: var(--ok-soft); color: var(--ok); }
.ef-conf[data-c="middel"] { background: var(--warn-soft); color: var(--warn); }
.ef-conf[data-c="laag"] { background: var(--bad-soft); color: var(--bad); }
.ef-also { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; color: var(--ink-2); line-height: 1.5; }
.ef-also svg { flex: none; margin-top: 3px; color: var(--bad); }
.ef-fu { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.ef-fu .input { max-width: 100%; }
.ef-days, .st-days { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ef-days .check small { display: inline; margin-left: 4px; }
.ef-hist-act { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

/* ── measurements (em-) ─────────────────────────────────────────────── */
.em-tbl td { vertical-align: top; }
.em-method { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--ink-3); max-width: 320px; white-space: normal; line-height: 1.4; }
.em-tbl tr.em-gone td { color: var(--ink-4); }
.em-tbl tr.em-gone td b, .em-tbl tr.em-gone td.strong { text-decoration: line-through; text-decoration-color: var(--ink-4); }
.em-newkpi { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; justify-self: start; font: inherit; font-size: var(--t-s); }
.em-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.em-drop { display: grid; place-items: center; text-align: center; padding: 28px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r-l); cursor: pointer; background: var(--sunk); }
.em-drop:hover, .em-drop:focus-within { border-color: var(--accent); }
.em-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.em-drop > span { display: grid; gap: 4px; justify-items: center; color: var(--ink-2); }
.em-drop small { color: var(--ink-3); font-size: var(--t-xs); }
.em-sample { margin: 8px 0 0; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); font: 12px/1.6 var(--f-mono); color: var(--ink-2); overflow-x: auto; }

/* ── benefits (eb-) ─────────────────────────────────────────────────── */
.eb-row { border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; display: grid; gap: 12px; min-width: 0; }
.eb-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--t-m); }
.eb-h > b { min-width: 0; }
.eb-cat { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: var(--mute-soft); color: var(--ink-2); white-space: nowrap; }
.eb-cat[data-c="tijd"] { background: var(--accent-soft); color: var(--accent-ink); }
.eb-cat[data-c="kosten"] { background: var(--ok-soft); color: var(--ok); }
.eb-cat[data-c="kwaliteit"] { background: var(--ev-measured-soft); color: var(--ev-measured); }
.eb-cat[data-c="compliance"] { background: var(--warn-soft); color: var(--warn); }
.eb-cat[data-c="ervaring"] { background: var(--ev-interview-soft); color: var(--ev-interview); }
.eb-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.eb-ladder > li { padding: 10px 12px; border-right: 1px solid var(--line); display: grid; gap: 4px; align-content: start; min-width: 0; }
.eb-ladder > li:last-child { border-right: 0; }
.eb-ladder > li[data-cur="true"] { background: var(--warn-soft); }
.eb-ladder > li[data-done="false"] .eb-st { color: var(--ink-4); }
.eb-st { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.eb-st i { font: 500 11px/16px var(--f-mono); width: 16px; height: 16px; border-radius: 50%; text-align: center; background: var(--mute-soft); color: var(--ink-3); font-style: normal; }
.eb-ladder > li[data-done="true"] .eb-st i { background: var(--ink); color: var(--on-ink); }
.eb-v { font-size: var(--t-l); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.eb-v.muted { font-weight: 500; font-size: var(--t-m); color: var(--ink-4); }
.eb-v.eb-prov { color: var(--ink-3); font-style: italic; font-weight: 600; }
.eb-ladder small { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; }
.eb-ladder .btn { justify-self: start; margin-top: 4px; }
.eb-mini { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 8px; }
.eb-calc { font: 12px/1.5 var(--f-mono); color: var(--ink-2); background: var(--sunk); border-radius: var(--r-s); padding: 7px 9px; overflow-wrap: anywhere; margin: 0; }
.eb-big { font-size: var(--t-l); font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .eb-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eb-ladder > li:nth-child(2) { border-right: 0; }
  .eb-ladder > li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ── improvement drawer (io-) ───────────────────────────────────────── */
.io-chain { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; align-items: center; font-size: var(--t-xs); }
.io-chain li { display: inline-flex; align-items: center; }
.io-chain li + li::before { content: ""; width: 10px; height: 1px; background: var(--line-2); }
/* a quiet path: only where the improvement is now stands out */
.io-chain a, .io-chain span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 999px; border: 1px solid transparent; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.io-chain a:hover { color: var(--ink); text-decoration: underline; }
.io-chain li[data-st="done"] a::before, .io-chain li[data-st="done"] span::before { content: "✓"; color: var(--ok); font-size: 10px; }
.io-chain li[data-st="now"] a, .io-chain li[data-st="now"] span { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); font-weight: 600; padding: 3px 8px; }
.io-chain li[data-st="todo"] a, .io-chain li[data-st="todo"] span, .io-chain li[data-st="skip"] span { color: var(--ink-4); }
.io-chain li[data-st="stop"] span { background: var(--mute-soft); color: var(--ink-3); }
.io-tbl td { vertical-align: top; }
.io-src { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--ink-3); }
.io-add { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--sunk); align-items: flex-end; }
.io-add > * { flex: 1 1 200px; min-width: 0; }
.io-add .field > span:first-child { font-size: var(--t-s); color: var(--ink-2); }
.io-add .field .hstack { flex-wrap: nowrap; }
.io-add .field .hstack .muted { flex: none; }
.io-add-w { flex-basis: 100%; }
.io-add .btn-row { justify-content: flex-end; }
.io-tag { display: inline-flex; margin-left: 2px; }
a.io-tag { text-decoration: none; }
.io-steps, .io-ins { display: grid; gap: 6px; max-height: 200px; overflow: auto; }
.io-steps { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.st-def { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--ink-3); max-width: 420px; line-height: 1.4; }
.ef-goals td.num { white-space: nowrap; }
.ef-delta small { display: block; font-size: var(--t-xs); color: var(--ink-3); font-weight: 400; }
.ef-srcline { display: block; margin-top: 3px; }
.ef-srcline .ef-srctag { font-size: var(--t-xs); color: var(--ink-3); }
.ef-out { min-width: 150px; }
.ef-out-h { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.ef-goals td:first-child { max-width: 240px; }
.ef-goals .ef-src a { max-width: 220px; }
.ef-out { min-width: 128px; }
