/* ── Tokens ───────────────────────────────────────────────────────────────
   Spacing: 4 · 8 · 12 · 16 · 20 · 24 · 32 · 48   Radii: 8 · 12 · 16 · 999
   Contrast checked: body/secondary/muted text ≥ 4.5:1 on bg and surface,
   status chips ≥ 4.5:1, white on primary button ≥ 4.5:1 (light & dark). */
:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --border: #e3e2dd;
  --border-strong: #cfcec8;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #696863;
  --accent: #2368c4;
  --accent-btn: #2368c4;
  --accent-ink: #ffffff;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --pos: #0d7a3f;
  --neg: #c4302b;
  --st-rood: #c4302b;
  --st-rood-bg: #fdecea;
  --st-oranje: #954f00;
  --st-oranje-bg: #fff3e0;
  --st-groen: #0d7a3f;
  --st-groen-bg: #e7f5ec;
  --st-info: #3d5a80;
  --st-info-bg: #eaf0f7;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #2f2f2c;
    --border-strong: #45453f;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #8f8e86;
    --accent: #5b9bea;
    --accent-btn: #2f6fc4;
    --series-1: #3987e5;
    --series-2: #d95926;
    --pos: #3fbf75;
    --neg: #f06b66;
    --st-rood: #f06b66;
    --st-rood-bg: #3a1d1b;
    --st-oranje: #f0a64a;
    --st-oranje-bg: #3a2a14;
    --st-groen: #3fbf75;
    --st-groen-bg: #15301f;
    --st-info: #8fb1dd;
    --st-info-bg: #1b2533;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.skip:focus { top: 8px; }
.only-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .only-touch { display: inline; }
  .only-desktop { display: none; }
}

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar { padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; background: none; border: 0; padding: 8px 4px; margin-left: -4px; cursor: pointer; min-height: 44px; }
.brand-mark { width: 22px; height: 22px; fill: var(--accent-btn); flex: none; }
.market { position: relative; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.market-label { font-weight: 600; color: var(--text-2); }
.market-value { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font-weight: 650; font-size: 15px; }
.market-value:hover { border-color: var(--border-strong); }
.market-value svg { width: 14px; height: 14px; color: var(--text-3); }
.market-value.is-override { border-color: var(--st-oranje); }
.market-time { font-size: 12px; }
.spot-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; box-shadow: 0 10px 30px rgb(0 0 0 / .14); z-index: 30; }
.spot-pop label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.spot-row { display: flex; gap: 8px; }
.spot-row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.spot-pop p { margin: 10px 0 4px; }

/* ── Intake ─────────────────────────────────────────────────────────────── */
.intake { padding: 64px 0 24px; text-align: center; }
.intake h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
.lede { color: var(--text-2); max-width: 580px; margin: 12px auto 32px; font-size: 16px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: 640px; margin: 0 auto; padding: 48px 24px;
  border: 2px dashed var(--border-strong); border-radius: 20px; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.dropzone.drag { transform: scale(1.01); border-style: solid; }
.dropzone.drag .dz-title::after { content: " – laat maar los"; color: var(--accent); }
.dz-icon { width: 36px; height: 36px; color: var(--accent); margin-bottom: 6px; }
.dz-title { font-size: 18px; font-weight: 600; }
.dz-sub { color: var(--text-2); font-size: 14px; }
kbd { font: 12px var(--mono); padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); margin: 0 1px; }
.intake .alert { max-width: 640px; margin: 16px auto 0; text-align: left; }
.intake-alt { margin-top: 16px; }
.intake-tips { list-style: none; padding: 0; margin: 20px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.intake-tips li::before { content: "✓ "; color: var(--pos); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 10px 8px; min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ── Progress ───────────────────────────────────────────────────────────── */
.progress { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; max-width: 720px; margin: 56px auto; }
.preview { width: 100%; max-height: 180px; object-fit: cover; object-position: top left; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--text-3); }
.steps li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active::before { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--text-2); }
.steps li.done::before { background: var(--accent-btn) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 8.5l2.5 2.5L12 5.5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") center/12px no-repeat; border-color: var(--accent-btn); }
.progress-hint { margin: 16px 0 0 30px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--r-md); padding: 12px 16px; margin: 16px 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; justify-content: space-between; }
.alert-error { background: var(--st-rood-bg); color: var(--st-rood); border: 1px solid color-mix(in srgb, var(--st-rood) 30%, transparent); }
.alert-warn { background: var(--st-oranje-bg); color: var(--st-oranje); }
.alert-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert .btn { color: var(--text); background: var(--surface); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s, opacity .15s, border-color .15s; text-align: center; }
.btn:disabled { opacity: .7; cursor: progress; }
.btn-primary { background: var(--accent-btn); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-btn) 86%, black); }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* ── Results / hero ─────────────────────────────────────────────────────── */
#results { padding: 24px 0 40px; }
.hero { padding: 24px; margin-top: 0; }
.hero-top { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.hero-title { font-size: clamp(22px, 3vw, 28px); font-weight: 700; margin: 12px 0 6px; }
.hero-sub { margin: 0; font-size: 14px; }
.hero-sub b { white-space: nowrap; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.focus-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 16px; }
.focus-item { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: start; }
.focus-item .chip { justify-self: start; }
.focus-title { font-weight: 600; }
.focus-pos { font-size: 13px; color: var(--accent); text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 28px; }
.focus-empty { margin: 16px 0 0; }
.manual #hero, .manual #kpis, .manual #warnings, .manual #narrativeCard, .manual #posTitle, .manual #positions, .manual #chartCard, .manual #scan { display: none; }
.manual .editor { margin-top: 0; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: 13px; color: var(--text-2); display: flex; gap: 4px; align-items: center; justify-content: space-between; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 2px; letter-spacing: -0.01em; white-space: nowrap; }
.kpi-hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* Uitleg-knopjes: 18px zichtbaar, 44px tikvlak */
.tip { position: relative; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin-left: 4px; border-radius: 50%; border: 1px solid var(--text-3); background: none; color: var(--text-3); font: 700 10.5px/1 Georgia, serif; font-style: italic; cursor: help; vertical-align: middle; }
.tip::before { content: ""; position: absolute; inset: -13px; }
.tip:hover, .tip[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.tip-pop { position: absolute; z-index: 40; padding: 10px 12px; border-radius: var(--r-sm); background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgb(0 0 0 / .2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-title { font-size: 17px; font-weight: 650; }
.section-title { font-size: 20px; font-weight: 700; margin: 32px 0 4px; }

.prose { margin-top: 4px; max-width: 72ch; }
.prose h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 18px 0 6px; }
.prose h3:first-child { margin-top: 4px; }
.prose p, .prose ul { margin: 0 0 8px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Position cards ─────────────────────────────────────────────────────── */
.positions { display: grid; gap: 12px; margin-top: 12px; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow); scroll-margin-top: 80px; }
.pcard:target, .pcard:focus { box-shadow: 0 0 0 2px var(--accent); }
.pcard[data-status="rood"] { border-left-color: var(--st-rood); }
.pcard[data-status="oranje"] { border-left-color: var(--st-oranje); }
.pcard[data-status="groen"] { border-left-color: var(--st-groen); }
.pcard-head { display: flex; justify-content: space-between; gap: 8px 12px; align-items: flex-start; flex-wrap: wrap; }
.pcard-title { font-weight: 650; font-size: 16px; }
.pcard-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.chip { --chip-ink: var(--surface); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip svg { width: 13px; height: 13px; flex: none; }
.chip-rood { background: var(--st-rood-bg); color: var(--st-rood); --chip-ink: var(--st-rood-bg); }
.chip-oranje { background: var(--st-oranje-bg); color: var(--st-oranje); --chip-ink: var(--st-oranje-bg); }
.chip-groen { background: var(--st-groen-bg); color: var(--st-groen); --chip-ink: var(--st-groen-bg); }
.chip-info { background: var(--st-info-bg); color: var(--st-info); --chip-ink: var(--st-info-bg); }
#heroStatus .chip { font-size: 13.5px; padding: 5px 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.metric { min-width: 0; margin: 0; }
.metric-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; }
.metric-value { margin: 2px 0 0; font-weight: 650; font-size: 15px; }
.metric-sub { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); }
.signals { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.signal { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; font-size: 14px; }
.signal .chip { justify-self: start; }
.signal-title { font-weight: 600; }
.signal-detail { color: var(--text-2); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table, .edit-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td, .edit-table th, .edit-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th, .edit-table th { font-weight: 600; color: var(--text-2); font-size: 12.5px; background: var(--surface); }
.edit-table th, .edit-table td { text-align: left; }
.th-sort { background: none; border: 0; padding: 6px 0; cursor: pointer; font-weight: 600; color: inherit; font-size: inherit; min-height: 32px; }
.th-sort:hover { color: var(--text); }
th[aria-sort] .th-sort { color: var(--text); }
th[aria-sort="descending"] .th-sort::after { content: " ↓"; }
th[aria-sort="ascending"] .th-sort::after { content: " ↑"; }
.data-table tr.hl td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.data-table tbody tr:hover td { background: var(--surface-2); }
.edit-table input, .edit-table select { width: 100%; min-width: 80px; min-height: 40px; padding: 7px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: inherit; }
.edit-table input[type="date"] { min-width: 140px; }
.edit-table input[aria-invalid="true"] { border-color: var(--st-rood); box-shadow: 0 0 0 1px var(--st-rood); }
.edit-table .td-del { width: 44px; text-align: right; }
.del { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 44px; height: 44px; background: none; border: 0; border-radius: var(--r-sm); color: var(--text-3); cursor: pointer; }
.del svg { width: 16px; height: 16px; }
.del:hover { color: var(--neg); background: var(--st-rood-bg); }
.del-text { display: none; }

.editor { position: relative; }
.editor summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; padding-left: 24px; position: relative; min-height: 44px; justify-content: center; }
.editor summary::-webkit-details-marker { display: none; }
.editor summary::before { content: ""; position: absolute; left: 4px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: translateY(-70%) rotate(-45deg); transition: transform .15s; }
.editor[open] summary::before { transform: translateY(-70%) rotate(45deg); }
.editor-title { font-weight: 650; font-size: 16px; }
.editor[open] summary { margin-bottom: 8px; }
.editor-help { margin: 0 0 12px; }
.editor-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* ── Chart ──────────────────────────────────────────────────────────────── */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; }
.sw-1 { background: var(--series-1); }
.sw-2 { background: var(--series-2); }
.chart-help { margin: 0 0 4px; }
.chart { position: relative; height: 300px; margin: 8px 0 8px; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; overflow: visible; display: block; }
.chart .grid line { stroke: var(--border); }
.chart .axis text { fill: var(--text-3); font-size: 11.5px; }
.chart .zero { stroke: var(--text-3); stroke-width: 1; }
.chart .spot { stroke: var(--text-3); stroke-dasharray: 3 3; }
.chart .spot-label { fill: var(--text-2); font-size: 11.5px; font-weight: 600; }
.chart .l1 { stroke: var(--series-1); stroke-width: 2; fill: none; stroke-linejoin: round; }
.chart .l2 { stroke: var(--series-2); stroke-width: 2; fill: none; stroke-linejoin: round; }
.chart .xh { stroke: var(--text-3); }
.chart .dot1 { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .dot2 { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgb(0 0 0 / .12); min-width: 180px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .tt-head { font-weight: 600; margin-bottom: 4px; }
.scen-details summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.scen-details[open] summary { margin-bottom: 4px; }

/* ── Scan ───────────────────────────────────────────────────────────────── */
.scan { margin-top: 32px; scroll-margin-top: 72px; }
.scan-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.scan-cta p { margin: 4px 0 0; max-width: 520px; }
.roll-grid { display: grid; gap: 20px; }
.roll-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 4px; }
.roll-title { font-size: 15px; font-weight: 650; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); width: fit-content; max-width: 100%; margin: 8px 0 16px; }
.tab { border: 0; background: none; min-height: 40px; padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; color: var(--text-2); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.show-more { margin-top: 8px; }
.m-strike { display: none; }
.scan-table th, .scan-table td { padding: 8px 7px; font-size: 13px; }
.filters { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; font-size: 13.5px; color: var(--text-2); }
.filters label { display: inline-flex; align-items: center; gap: 8px; }
.filters select { min-height: 40px; padding: 6px 8px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; }

.footer { color: var(--text-3); font-size: 12.5px; padding-top: 12px; padding-bottom: max(40px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .wrap { padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .topbar-inner { height: 52px; }
  .brand > span { font-size: 15px; }
  .brand .muted { display: none; }
  .market-time { display: none; }
  .intake { padding-top: 32px; }
  .dropzone { padding: 32px 18px; }
  .progress { grid-template-columns: 1fr; margin: 24px auto; gap: 20px; }
  .preview { max-height: 120px; }
  .progress-hint { margin-left: 0; }
  #results { padding-top: 16px; }
  .hero { padding: 18px; }
  .hero-actions { width: 100%; flex-wrap: nowrap; }
  .hero-actions .btn { flex: 1; padding: 8px 10px; font-size: 13.5px; white-space: nowrap; }
  table.stack td.m-hide { display: none; }
  .focus-pos { min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .m-strike { display: inline; }
  .scan-table td:first-child { font-weight: 650; }
  .scan-table td:first-child::before { content: none; }
  table.stack td { padding: 5px 0; }
  .show-more { width: 100%; }
  .focus-item, .signal { grid-template-columns: 1fr; gap: 4px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 19px; }
  .card { padding: 16px; }
  .pcard { padding: 14px 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .chart { height: 240px; }
  .scan-cta .btn { width: 100%; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 8px; }

  /* Tabellen worden kaartjes: geen horizontaal scrollen op de telefoon */
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right !important; border-bottom: 1px solid var(--border); padding: 7px 0; white-space: normal; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before { content: attr(data-label); color: var(--text-2); font-size: 12.5px; text-align: left; }
  table.stack td:first-child { font-size: 15px; }
  .data-table tr.hl td { background: none; }
  .data-table tr.hl { border-color: var(--accent); }
  .data-table tbody tr:hover td { background: none; }
  .edit-table.stack td { align-items: center; }
  .edit-table.stack td::before { min-width: 80px; }
  .edit-table.stack input, .edit-table.stack select { max-width: 60%; font-size: 16px; }
  .edit-table .td-del { width: 100%; justify-content: flex-end; }
  .edit-table .td-del::before { content: none; }
  .del { width: auto; padding: 0 10px; }
  .del-text { display: inline; font-size: 13.5px; }
  .editor-actions .btn { flex: 1; white-space: nowrap; padding: 10px; }
}
