/* Parc Estate's look: DM Sans, warm neutrals, a terracotta accent, square corners, headings at
   regular weight. Light only, because it sits inside their light WordPress page. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
}

:root {
  --paper: #ffffff;
  --tint: #f6f3ee;
  --tint-2: #efeae2;
  --rule: rgba(38, 38, 38, 0.14);
  --rule-strong: rgba(38, 38, 38, 0.32);
  --ink: #262626;
  --body: #3f3d38;
  --muted: #6b675f;
  --accent: #d6794d;        /* brand terracotta: fills, lines, focus */
  --accent-text: #a75e3c;   /* the same hue dark enough for text on white */
  --bv: #c8683d;
  --pv: #35606a;
  --good: #3f7d52;
  --focus: 0 0 0 3px rgba(214, 121, 77, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); }
body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { color: var(--ink); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }
h2 { font-size: 18px; line-height: 1.3; margin-bottom: 12px; }

.tool { max-width: 1180px; margin: 0 auto; padding: 24px 16px 32px; }
.tool-head { margin-bottom: 24px; max-width: 720px; }
.lede { margin: 8px 0 0; color: var(--muted); font-size: 17px; }

.tool-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.tool-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .tool-grid { grid-template-columns: 340px minmax(0, 1fr); gap: 40px; align-items: start; }
  .inputs { position: sticky; top: 16px; }
}

/* ---------- inputs */
.inputs { background: var(--tint); padding: 20px; border: 0; }
.field { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.field > label, .field > legend { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; padding: 0; }
.field output { font-weight: 600; color: var(--accent-text); }
.help { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }

.affix { display: flex; align-items: stretch; background: var(--paper); border: 1px solid var(--rule-strong); }
.affix:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.affix span { display: flex; align-items: center; padding: 0 0 0 12px; color: var(--muted); font-size: 15px; }
.affix.suffix span { padding: 0 12px 0 0; }
.affix input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); padding: 10px 12px; font-variant-numeric: tabular-nums; }
.affix.invalid { border-color: #a8382f; }

select { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 0; padding: 10px 12px; }
select:focus { outline: 0; border-color: var(--accent); box-shadow: var(--focus); }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--rule-strong); background: var(--paper); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 9px 8px; font-size: 15px; color: var(--body); cursor: pointer; }
.seg label + label span { border-left: 1px solid var(--rule-strong); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset var(--focus); }

.more { margin: 4px 0 12px; border-top: 1px solid var(--rule); padding-top: 12px; }
.more summary, .how summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
.more summary::-webkit-details-marker, .how summary::-webkit-details-marker { display: none; }
.more summary::before, .how summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--rule-strong); font-size: 14px; line-height: 1; }
.more[open] summary::before, .how[open] summary::before { content: "–"; }
.more[open] summary { margin-bottom: 14px; }

.reset { font: inherit; font-size: 13px; color: var(--accent-text); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.reset:focus-visible { outline: 0; box-shadow: var(--focus); }

/* ---------- results */
.results { min-width: 0; }
.verdict { border: 1px solid var(--rule); padding: 20px; }
.verdict .when { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.verdict .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.verdict .col { padding: 14px 16px 14px 0; }
.verdict .col + .col { padding-left: 16px; border-left: 1px solid var(--rule); }
.verdict .label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.verdict .amount { font-size: clamp(24px, 3.4vw, 32px); color: var(--ink); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.verdict .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.verdict .col.win .amount { color: var(--ink); }
.verdict .col.win .badge { display: inline-block; }
.badge { display: none; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 2px 6px; }
.verdict .diff { margin: 14px 0 0; font-size: 17px; color: var(--ink); }
.verdict .diff b { font-weight: 600; }
.verdict .note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.sw { display: inline-block; width: 12px; height: 3px; vertical-align: middle; }
.sw.bv { background: var(--bv); }
.sw.pv { background: var(--pv); }

.disclaimer { margin: 12px 0 0; padding: 10px 14px; background: var(--tint); font-size: 13px; line-height: 1.45; color: var(--body); }
.disclaimer strong { color: var(--ink); font-weight: 600; }

.block { margin-top: 32px; }
.legend { display: flex; gap: 18px; font-size: 14px; color: var(--body); margin: -4px 0 8px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .ref-key { width: 14px; border-top: 1px dashed var(--muted); }

.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .ref { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.bv { stroke: var(--bv); }
.chart .line.pv { stroke: var(--pv); }
.chart .dot.bv, .chart .mark.bv { fill: var(--bv); }
.chart .dot.pv, .chart .mark.pv { fill: var(--pv); }
.chart .mark { stroke: #fff; stroke-width: 2; }
.chart .cross { stroke: var(--rule-strong); stroke-width: 1; }
.chart-tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 8px 10px; min-width: 180px; }
.chart-tip strong { display: block; font-weight: 500; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; padding-left: 12px; }

.taxes { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 620px) { .taxes { grid-template-columns: 1fr 1fr; } }
.taxes table { width: 100%; border-collapse: collapse; font-size: 14px; }
.taxes caption { text-align: left; font-size: 14px; font-weight: 500; color: var(--ink); padding-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.taxes td { padding: 7px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.taxes td + td { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.taxes tr.total td { border-top: 1px solid var(--rule-strong); font-weight: 600; color: var(--ink); }
.taxes .why { display: block; font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); }
.table-wrap:focus-visible { outline: 0; box-shadow: var(--focus); }
table.years { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.years th, table.years td { padding: 8px 12px; text-align: right; }
table.years th:first-child, table.years td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); }
table.years thead th { font-weight: 500; color: var(--ink); background: var(--tint); vertical-align: bottom; white-space: normal; min-width: 92px; font-size: 13px; line-height: 1.3; }
table.years thead th:first-child { background: var(--tint); min-width: 0; }
table.years tbody tr + tr td { border-top: 1px solid var(--rule); }
table.years tr.sale td { font-weight: 600; color: var(--ink); background: var(--tint); }
table.years tr.sale td:first-child { background: var(--tint); }
table.years .pos { color: var(--good); }
table.years .neg { color: #a8382f; }
table.years .grp-bv { box-shadow: inset 0 -3px 0 var(--bv); }
table.years .grp-pv { box-shadow: inset 0 -3px 0 var(--pv); }

.how { border-top: 1px solid var(--rule); padding-top: 14px; }
.how[open] summary { margin-bottom: 12px; }
.how h3 { font-size: 15px; font-weight: 500; color: var(--ink); margin: 18px 0 6px; }
.how p, .how li { font-size: 14px; line-height: 1.55; }
.how ul { padding-left: 18px; margin: 6px 0; }
.how table { border-collapse: collapse; font-size: 13px; width: 100%; margin-top: 6px; }
.how th, .how td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--rule); vertical-align: top; }
.how th { font-weight: 500; color: var(--ink); background: var(--tint); }
.how .status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border: 1px solid currentColor; white-space: nowrap; }
.how .status.wet { color: var(--good); }
.how .status.voorstel { color: var(--accent-text); }
.how .status.aanname { color: var(--muted); }
.how a { color: var(--accent-text); }

.cta { margin-top: 28px; }
.cta a { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; padding: 12px 18px; font-size: 15px; }
.cta a:hover { background: #000; }
.cta a:focus-visible { outline: 0; box-shadow: var(--focus); }
.foot { margin-top: 20px; font-size: 12px; color: var(--muted); }

@media (max-width: 480px) {
  .tool { padding: 16px 16px 24px; }
  .inputs { padding: 16px; }
  .verdict { padding: 16px; }
  .verdict .col { padding-right: 10px; }
  .verdict .col + .col { padding-left: 10px; }
}

@media print {
  .inputs { position: static; }
  .chart-tip { display: none; }
  details.how { display: block; }
}
