:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --ink: #141a2e;
  --muted: #586079;
  --line: #dfe3ee;
  --accent: #003399;      /* EU blue */
  --accent-ink: #ffffff;
  --accent-soft: #e6ecf8;
  --gold: #ffcc00;        /* EU gold */
  --gold-ink: #141a2e;
  --band: #003399;
  --band-ink: #ffffff;
  --band-muted: #c9d4f0;
  --good: #2f6b4f;
  --warn: #8a5a12;
  --bad: #9b2c2c;
  --m0: #dde4f4; --m1: #b3c3ec; --m2: #7d97de; --m3: #3f63c6; --m4: #0b2f8f;
  --map-other: #eff1f4; --map-edge: #ffffff;
  --radius: 10px;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1222;
    --surface: #151c31;
    --ink: #e8ebf4;
    --muted: #9ba5c0;
    --line: #26304b;
    --accent: #8fa9ff;
    --accent-ink: #0d1222;
    --accent-soft: #1f2a4a;
    --gold: #ffd633;
    --gold-ink: #0d1222;
    --band: #0a1f66;
    --band-ink: #ffffff;
    --band-muted: #b3c1ea;
    --good: #7cc4a0;
    --warn: #e0b46a;
    --bad: #ec8b8b;
    --m0: #232e52; --m1: #2b4aa0; --m2: #4a70d8; --m3: #8aa6f5; --m4: #d0dcff;
    --map-other: #1a2135; --map-edge: #0d1222;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.top { background: var(--surface); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; }
#brand-mark { display: inline-flex; width: 30px; height: 30px; border-radius: 7px; background: var(--band); }
#brand-mark .ring { fill: var(--gold); }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .925rem; font-weight: 500; }
nav a:hover { color: var(--ink); background: var(--accent-soft); }
nav a.active { color: var(--ink); background: var(--accent-soft); }

main.wrap { padding-top: 32px; padding-bottom: 48px; min-height: 60vh; }

/* ---------- intro: full-width EU-blue band ---------- */
.hero { background: var(--band); color: var(--band-ink); width: 100vw; margin: -32px 0 28px calc(50% - 50vw); padding: 44px 0 40px; }
.hero-inner { max-width: 860px; margin: 0 auto; padding: 0 16px; display: flex; gap: 32px; align-items: center; justify-content: space-between; }
.hero h1 { font-size: 2.3rem; color: var(--band-ink); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--gold); margin-bottom: .6em; }
.hero .lede { font-size: 1.075rem; color: var(--band-muted); max-width: 580px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .stats { margin: 16px 0 0; font-size: .85rem; color: var(--band-muted); }
.hero .ring { flex: 0 0 auto; fill: var(--gold); }

/* ---------- map ---------- */
.map-card { margin-bottom: 22px; }
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.map-head h2 { margin: 0; font-size: 1.2rem; }
.eu-wide { font: inherit; font-size: .875rem; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.eu-wide .n { font-weight: 600; }
.eu-wide:hover, .eu-wide.sel { border-color: var(--accent); background: var(--accent-soft); }
.map-wrap { position: relative; max-width: 660px; margin: 0 auto; }
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-wrap path.other { fill: var(--map-other); stroke: var(--map-other); stroke-width: .6; }
.map-wrap .eu { stroke: var(--map-edge); stroke-width: 1; cursor: pointer; outline: none; }
.map-wrap .eu:hover, .map-wrap .eu:focus-visible { stroke: var(--gold); stroke-width: 2; }
.map-wrap .eu.sel { stroke: var(--gold); stroke-width: 3; }
.map-wrap circle.small { stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .825rem; line-height: 1.35; padding: 6px 9px; border-radius: 6px; white-space: nowrap; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.legend .key { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); }
.legend i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.by-country { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.by-country button { font: inherit; font-size: .8rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.by-country button b { font-weight: 600; margin-left: 2px; }
.by-country button.sel, .by-country button:hover { border-color: var(--gold); }

/* ---------- controls ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; flex: 0 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font: inherit; font-size: .9rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.idea.card { border-left: 3px solid var(--accent); }
.ideas { display: grid; gap: 12px; }
.idea { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.idea h3 { margin-bottom: .25em; }
.idea h3 a { color: var(--ink); text-decoration: none; }
.idea h3 a:hover { text-decoration: underline; }
.idea .excerpt { margin: .4em 0 .6em; }
.idea .excerpt p { margin: 0 0 .4em; }
.excerpt ul, .body ul { margin: .2em 0 .6em; padding-left: 1.3em; }
.excerpt li, .body li { margin: .15em 0; }
.meta { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-block; font-size: .78rem; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); }
.tag.scope { background: var(--band); color: var(--band-ink); }
.tag.scope::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: 1px; }

.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; padding: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); cursor: pointer; font: inherit; }
.vote:hover { border-color: var(--accent); color: var(--ink); }
.vote .arrow { font-size: .9rem; line-height: 1; }
.vote .n { font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.vote.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vote.on .n { color: var(--accent-ink); }
.vote:disabled { opacity: .6; cursor: default; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- idea page ---------- */
.back { display: inline-block; margin-bottom: 16px; font-size: .9rem; text-decoration: none; }
.detail { display: grid; grid-template-columns: 56px 1fr; gap: 18px; }
.body { font-size: 1.05rem; }
.body p:last-child { margin-bottom: 0; }
.comments { margin-top: 28px; }
.comment { padding: 14px 0; border-top: 1px solid var(--line); }
.comment .who { font-weight: 600; font-size: .9rem; }
.comment p { margin: .3em 0 0; white-space: pre-line; }

/* ---------- forms ---------- */
form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 500; font-size: .925rem; }
.field .hint { font-size: .825rem; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .925rem; }
.check input { margin-top: 5px; }
.count { font-size: .8rem; color: var(--muted); text-align: right; }
.count.over { color: var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; font-size: .95rem; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.btn.on-blue { background: transparent; border-color: var(--band-muted); color: var(--band-ink); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn:disabled { opacity: .6; cursor: default; }

.notice { padding: 14px 16px; border-radius: 8px; background: var(--accent-soft); margin-bottom: 18px; }
.done { text-align: center; padding: 36px 20px; }

/* ---------- prose pages ---------- */
.prose { max-width: 680px; }
.prose h2 { margin-top: 1.5em; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .75rem; text-align: center; }
.admin-list { display: grid; gap: 10px; }
.admin-item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.status { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.status.pending, .status.new { color: var(--warn); }
.status.approved, .status.accepted, .status.shortlisted, .status.done { color: var(--good); }
.status.rejected, .status.declined { color: var(--bad); }
.admin-item details summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.admin-item .full { white-space: pre-line; margin-top: 8px; }

/* ---------- footer + toast ---------- */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: .925rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--bad); color: #fff; }

@media (max-width: 600px) {
  .top { position: static; }
  h1 { font-size: 1.6rem; }
  .hero { padding: 32px 0 28px; }
  .hero h1 { font-size: 1.8rem; }
  .hero .ring { display: none; }
  .brand-name { font-size: 1.1rem; }
  .row2 { grid-template-columns: 1fr; }
  .idea, .detail { grid-template-columns: 1fr; gap: 10px; }
  .vote { flex-direction: row; gap: 6px; width: auto; padding: 5px 12px; justify-self: start; }
  .card { padding: 16px; }
}
.brand-wrap { display: inline-flex; align-items: baseline; flex-wrap: wrap; }
.brand-sub { font-family: var(--sans); font-weight: 500; font-size: .8rem; color: var(--muted); margin-left: 6px; }
.brand-sub a, #foot-text a { color: inherit; }
@media (max-width: 600px) { .brand-sub { display: block; margin-left: 40px; } }
.hero .eyebrow .parent-link { color: inherit; text-underline-offset: 3px; }
dl.themes dt { font-weight: 600; margin-top: 1em; }
dl.themes dd { margin: .2em 0 0; }

.human:empty { display: none; }
.human { margin: 4px 0; }
.similar { margin: .4em 0 0; }
ul.supporters { list-style: none; padding: 0; display: grid; gap: 10px; }
ul.supporters li, ul.supporters a { display: flex; align-items: center; gap: 12px; }
ul.supporters img { flex: none; border-radius: 50%; }
.hero-support { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 18px; font-size: .85rem; opacity: .9; }
.hero-support > span:first-child { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 600; }
.hero-support a, .hero-support .sup { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.hero-support a:hover span { text-decoration: underline; }
.hero-support img { border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }

/* ---------- keywords ---------- */
.tag.kw { border: 0; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 500; background: transparent; color: var(--accent); padding: 2px 4px; }
.tag.kw:hover { text-decoration: underline; }
.tag.kw.on { background: var(--accent); color: var(--accent-ink); padding: 2px 10px; }
.kw-filter:not(:empty) { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; }
.owner { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linklike { background: none; border: 0; padding: 0; margin-left: 8px; color: var(--muted, inherit); text-decoration: underline; cursor: pointer; font: inherit; }
img.wordmark { width: auto; border-radius: 0 !important; box-shadow: none !important; }

/* ---------- anonymous background questions ---------- */
fieldset.private { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px 4px; margin: 0; }
fieldset.private legend { font-weight: 600; padding: 0 6px; }
fieldset.private p { margin: 0 0 12px; }
table.tally { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tally td { padding: 4px 0; border-top: 1px solid var(--line); }
table.tally td:last-child { text-align: right; font-weight: 600; }
.hero-credit { margin-top: 14px; font-size: .85rem; opacity: .85; }

/* Header: Democracy27 logo, then the board's name and motto (v14). */
.brand-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo a { display: block; line-height: 0; }
.brand-logo img { height: 32px; width: auto; display: block; }
.brand-motto { flex-basis: 100%; font-size: .8rem; color: var(--muted); font-style: italic; margin-top: 2px; }
@media (max-width: 600px) { .brand-logo img { height: 26px; } .brand-motto { margin-left: 40px; } }
.hero .lede a { color: var(--gold); text-underline-offset: 3px; }
.hero .lede strong { color: var(--band-ink); }

/* Pathway picker on the submit form: one radio per pathway with its one-liner. */
fieldset.pathways { border: 0; padding: 0; margin: 0; }
fieldset.pathways legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.pathway { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.pathway input { margin-top: 4px; }
.pathway > span { display: flex; flex-direction: column; gap: 2px; }
.pathway:has(input:checked) { border-color: var(--band); box-shadow: 0 0 0 1px var(--band); }

/* The hard questions page. */
ol.questions { padding-left: 1.4em; }
ol.questions li { margin-bottom: 18px; }
ol.questions li::marker { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
ol.questions h2 { font-size: 1.15rem; margin: 0 0 .3em; }
ol.questions .q-ask { font-weight: 500; margin: 0 0 .25em; }
ol.questions .q-pathway { font-size: .825rem; color: var(--muted); margin: 0 0 .5em; }
.foot-credit { flex-basis: 100%; text-align: right; font-size: .75rem; opacity: .8; }
