:root {
  --bg: #f4efe6;
  --bg-2: #efe6d8;
  --paper: #fffaf3;
  --ink: #2b1c12;
  --muted: #6d5848;
  --line: #e0d2c0;
  --accent: #8b3a1e;
  --accent-2: #c4783a;
  --gold: #c9a15b;
  --ok: #2f6b4f;
  --warn: #9a5b14;
  --shadow: 0 1px 0 rgba(43, 28, 18, 0.06);
  --font: "Segoe UI", "Calibri", system-ui, sans-serif;
  --display: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
body { min-height: 100vh; }
header {
  background: var(--ink);
  color: #f7efe4;
  padding: 28px 24px 22px;
}
header .wrap, main { max-width: 1100px; margin: 0 auto; }
header h1 {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
header p { margin: 0; color: #d9c7b4; max-width: 62ch; }
main { padding: 20px 24px 64px; }
main.narrow { max-width: 820px; }
h2 { font-family: var(--display); font-size: 1.45rem; margin: 8px 0 8px; }
p.lead, p.note { color: var(--muted); }
p.note { font-size: 0.92rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.45rem; font-family: var(--display); }
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat.leader b { color: var(--ok); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
#ranking-block .card:first-of-type tbody tr:first-child td { background: #eef6f0; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg-2);
}
.pill.speciaal { background: #f7ead6; color: var(--warn); border-color: #ead3ad; }
.pill.mix { background: #e7eef6; color: #345578; border-color: #c9d7e8; }
.pill.nieuw { background: #eef6f0; color: var(--ok); border-color: #cfe3d6; }
.pill.overschreven { background: var(--bg-2); color: var(--muted); }
.bars { display: grid; gap: 8px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 44px; gap: 10px; align-items: center; }
.bar-track { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar-svg { display: block; width: 100%; height: 100%; }
.bar-fill { fill: var(--accent); }
.line-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.line-chart .grid { stroke: var(--line); stroke-width: 1; }
.line-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.86rem;
  color: var(--ink);
}
.legend-swatch {
  width: 22px;
  height: 6px;
  border-radius: 99px;
  background: var(--flavor);
  flex: 0 0 auto;
}
.flavor-0 { --flavor: #8b3a1e; }
.flavor-1 { --flavor: #2f6b4f; }
.flavor-2 { --flavor: #345578; }
.flavor-3 { --flavor: #c4783a; }
.flavor-4 { --flavor: #6b3fa0; }
.flavor-5 { --flavor: #9a5b14; }
.flavor-6 { --flavor: #1d6a7a; }
.flavor-7 { --flavor: #a33b5c; }
.flavor-8 { --flavor: #4a6b2f; }
.flavor-9 { --flavor: #7a4a1d; }
.flavor-10 { --flavor: #2c4c7c; }
.flavor-11 { --flavor: #b85c38; }
.flavor-12 { --flavor: #5c6b1d; }
.flavor-13 { --flavor: #8b2e5b; }
.flavor-14 { --flavor: #3d5c4a; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button.btn, label.btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
  background: var(--ink);
  color: #f7efe4;
}
button.btn:disabled { cursor: wait; opacity: 0.65; }
button.btn.ghost, label.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.btn.danger { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.callout {
  background: #efe4d2;
  border: 1px solid #e0d2c0;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
}
.callout.error { background: #f8e8e3; border-color: #e1b8aa; color: #7a291c; }
.empty { color: var(--muted); padding: 8px 0 4px; }
.dropzone {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  background: var(--paper);
}
.dropzone.drag {
  border-color: var(--accent);
  background: var(--bg-2);
}
.dropzone p { margin: 0 0 12px; color: var(--muted); }
.hidden { display: none !important; }
label.field { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 650; }
input {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-2) 65%, transparent);
  outline-offset: 2px;
}
.privacy-note { background: var(--bg-2); border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
.privacy-note p { margin: 4px 0 0; color: var(--muted); }
.vote-intro, .rating-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.vote-intro h2, .rating-heading h2 { margin-top: 0; }
.rating-card { scroll-margin-top: 12px; }
.score-field { border: 0; border-top: 1px solid var(--line); padding: 12px 0; margin: 0; }
.score-field legend { padding: 12px 8px 0 0; font-weight: 650; }
.score-options { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 8px; max-width: 430px; }
.score-option { position: relative; cursor: pointer; }
.score-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.score-option span { display: block; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.score-option input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.score-option input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.purchase-options { display: flex; flex-wrap: wrap; gap: 16px; }
.purchase-options label { cursor: pointer; }
.purchase-options input { width: auto; }
.form-status { align-self: center; color: var(--muted); }
.vote-form { min-width: 0; }
.form-question { min-width: 0; padding: 20px; }
.form-question > legend { max-width: 100%; padding: 0 8px 0 0; font-family: var(--display); font-size: 1.25rem; font-weight: 700; }
.question-number { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 0.95rem/1 var(--font); }
.question-help { margin: 2px 0 16px; color: var(--muted); }
.flavor-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.flavor-option { position: relative; min-width: 0; cursor: pointer; }
.flavor-option > input, .matrix-option > input, .purchase-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.flavor-option-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; min-height: 86px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.flavor-option-title { align-self: center; font-weight: 700; }
.flavor-option-note { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; }
.flavor-option .pill { align-self: center; justify-self: end; }
.flavor-option > input:checked + .flavor-option-body { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); background: #fff8f2; }
.flavor-option > input:focus-visible + .flavor-option-body,
.matrix-option > input:focus-visible + .score-dot,
.purchase-options input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent-2) 65%, transparent); outline-offset: 2px; }
.selected-flavor { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); }
.selected-flavor strong, .selected-flavor span { display: block; }
.selected-flavor #selected-flavor-note { margin-top: 2px; color: var(--muted); font-size: 0.88rem; }
.selected-flavor .pill { flex: 0 0 auto; }
.likert-table-wrap { max-width: 100%; }
.likert-table { table-layout: fixed; }
.likert-table th:first-child { width: 29%; }
.likert-table thead th { text-align: center; text-transform: none; letter-spacing: 0; font-size: 0.76rem; }
.likert-table thead th:first-child { text-align: left; }
.likert-table thead th span { display: block; font-size: 1rem; color: var(--ink); }
.likert-table tbody th { color: var(--ink); font-size: 0.9rem; text-transform: none; letter-spacing: 0; }
.likert-table td { padding: 12px 4px; text-align: center; vertical-align: middle; }
.matrix-option { display: inline-grid; place-items: center; min-width: 38px; min-height: 38px; cursor: pointer; }
.score-dot { display: block; width: 22px; height: 22px; border: 2px solid #9d8e82; border-radius: 50%; background: #fff; }
.matrix-option > input:checked + .score-dot { border: 6px solid var(--ink); }
.mobile-score-label { display: none; }
.purchase-options { gap: 10px; }
.purchase-options label { position: relative; }
.purchase-options label span { display: block; min-width: 110px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.purchase-options input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.save-bar { display: flex; align-items: center; gap: 12px; }
.vote-form[aria-busy="true"] { opacity: 0.82; }
.vote-form fieldset:disabled .likert-table, .vote-form fieldset:disabled .purchase-options { opacity: 0.55; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field.full { grid-column: 1 / -1; }
.campaign-card { border-left: 4px solid var(--line); }
.campaign-card.status-open { border-left-color: var(--ok); }
.campaign-card.status-closed { border-left-color: var(--muted); }
.campaign-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.campaign-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 0.9rem; margin: 8px 0; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.inline-form .field { min-width: 150px; flex: 1; }
.invite-result { word-break: break-all; }
.invite-list { margin: 10px 0 0; padding: 0; list-style: none; }
.invite-list li { border-top: 1px solid var(--line); padding: 10px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.subsection { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.table-wrap { overflow-x: auto; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; }
@media (max-width: 720px) {
  .bar-row { grid-template-columns: 1fr; }
  header h1 { font-size: 1.55rem; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .vote-intro, .rating-heading, .campaign-head { display: block; }
  .invite-list li { display: block; }
  .form-question { padding: 16px; }
  .flavor-options { grid-template-columns: 1fr; }
  .selected-flavor { display: block; }
  .selected-flavor .pill { display: inline-block; margin-top: 8px; }
  .likert-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .likert-table, .likert-table tbody { display: block; width: 100%; }
  .likert-table tbody tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .likert-table tbody th { display: block; grid-column: 1 / -1; width: auto; padding: 0 0 7px; border: 0; }
  .likert-table tbody td { display: block; min-width: 0; padding: 0; border: 0; }
  .matrix-option { display: grid; gap: 4px; width: 100%; min-width: 0; min-height: 56px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .matrix-option:has(input:checked) { border-color: var(--ink); background: var(--bg-2); }
  .score-dot { width: 18px; height: 18px; }
  .matrix-option > input:checked + .score-dot { border-width: 5px; }
  .mobile-score-label { display: block; max-width: 100%; color: var(--muted); font-size: 0.66rem; line-height: 1.12; overflow-wrap: anywhere; }
  .purchase-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .purchase-options label span { min-width: 0; padding: 9px 4px; }
  .save-bar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 420px) {
  header { padding: 22px 16px 18px; }
  main { padding: 14px 12px 48px; }
  .card { padding: 14px; }
  .form-question { padding: 14px 12px; }
  .flavor-option-body { min-height: 0; }
}
