@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/bricolage.woff2") format("woff2");
}
:root {
  --bg: #ffffff;
  --bg-2: #f4f6f8;
  --card: #ffffff;
  --card-2: #eef1f4;
  --line: #e3e7ec;
  --text: #101820;
  --muted: #55606b;
  --faint: #5f6b77;
  --brand: #00a077;
  --brand-soft: #ddf5ec;
  --accent: #00785a;
  --accent-2: #006f53;
  --accent-ink: #ffffff;
  --blue: #2f66d0;
  --green: #0e8a5f;
  --amber: #a06b00;
  --focus: #00a077;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,32,.05), 0 4px 16px rgba(16,24,32,.06);
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}

/* sections: the logo stays green; each section of the app takes one of three colours */
:root {
  --results: #00a077; --results-deep: #00785a; --results-soft: #d9f5ea;
  /* flag red: the highlight used across the app (sending a PV, icon details) */
  --red: #ce1126; --red-deep: #a50e1f; --red-soft: #fde6e9;
  /* four tones, no two neighbours alike: green (results, contribute), ochre (learn), blue (avis), coral (act).
     Flag red is the highlight (sending a PV, icon details). A run of many hues would read as a rainbow; keep to these. */
  --ochre: #f5a300; --ochre-deep: #855400; --ochre-soft: #ffefc7;
  --blue-sec: #1f6fe5; --blue-sec-deep: #1a5fd0; --blue-sec-soft: #e3eeff;
  --coral: #f2735e; --coral-deep: #b83f30; --coral-soft: #ffe9e3;
  --learn: var(--ochre); --learn-deep: var(--ochre-deep); --learn-soft: var(--ochre-soft);
  --avis: var(--blue-sec); --avis-deep: var(--blue-sec-deep); --avis-soft: var(--blue-sec-soft);
  --act: var(--coral); --act-deep: var(--coral-deep); --act-soft: var(--coral-soft);
  --contribute: var(--results); --contribute-deep: var(--results-deep); --contribute-soft: var(--results-soft);
}
.sec-results, body[data-section="results"] { --sec: var(--results); --sec-deep: var(--results-deep); --sec-soft: var(--results-soft); }
.sec-learn, body[data-section="learn"] { --sec: var(--learn); --sec-deep: var(--learn-deep); --sec-soft: var(--learn-soft); }
.sec-avis, body[data-section="avis"] { --sec: var(--avis); --sec-deep: var(--avis-deep); --sec-soft: var(--avis-soft); }
.sec-act, body[data-section="act"] { --sec: var(--act); --sec-deep: var(--act-deep); --sec-soft: var(--act-soft); }
.sec-contribute, body[data-section="contribute"] { --sec: var(--contribute); --sec-deep: var(--contribute-deep); --sec-soft: var(--contribute-soft); }
body[data-section="learn"], body[data-section="avis"], body[data-section="act"], body[data-section="contribute"], body[data-section="results"] {
  --accent: var(--sec-deep); --brand: var(--sec); --brand-soft: var(--sec-soft); --focus: var(--sec);
}
svg.bi .p1 { fill: var(--sec, var(--results)); }
svg.bi .p2 { fill: var(--sec-deep, var(--results-deep)); }
svg.bi .ink { fill: var(--red); }
svg.bi .w { fill: #fff; }
svg.bi .s-ink { stroke: var(--red); }
svg.bi .s-w { stroke: #fff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font);
  min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.015em; }
h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
svg { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.cta svg { width: 20px; height: 20px; }
.muted { color: var(--muted); }
.independent { font-size: .78rem; font-weight: 600; line-height: 1.35; color: var(--muted); margin: 0 0 .6rem; }
.faint { color: var(--faint); font-size: .88rem; }
.small { font-size: .88rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1rem; background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { height: 34px; width: auto; flex: none; display: block; }
.lang { margin-left: auto; display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex: none; }
.lang button {
  border: 0; background: none; padding: .3rem .55rem; border-radius: 7px; color: var(--muted);
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; cursor: pointer; min-width: 38px; min-height: 32px;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

main:focus { outline: none; }
main { max-width: 980px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.page-head { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 1rem; }
.page-head h1 { margin: 0; }
.back { border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; width: 40px; height: 40px; cursor: pointer; flex: none; color: var(--text); text-decoration: none; display: grid; place-items: center; }

/* bottom navigation */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #ffffff; border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(16,24,32,.04);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--faint); text-decoration: none; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.send span.dot svg { width: 22px; height: 22px; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a.send { color: var(--text); }
.nav a.send span.dot { background: var(--red); color: var(--accent-ink); border-radius: 12px; padding: 4px 12px; display: grid; place-items: center; }
.nav a.send[aria-current="page"] span.dot { box-shadow: 0 0 0 3px rgba(206,17,38,.25); }

/* cards and pillars */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .8rem; }
.stack > * + * { margin-top: .8rem; }
.grid2 { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.pillars { display: grid; gap: .75rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 640px) {
  .pillars { grid-template-columns: 1fr 1fr; }
}
.pillar {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; min-height: 84px;
  background: var(--sec-soft, var(--card)); border: 1px solid transparent; border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.pillar b { color: var(--sec-deep, var(--text)); }
.pillar:hover { border-color: var(--sec, #b9c3cd); box-shadow: var(--shadow); }
.pillar .ic { width: 48px; height: 48px; display: grid; place-items: center; flex: none; }
.pillar .ic svg.bi { width: 46px; height: 46px; }
.pillar b { display: block; font-size: 1.15rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.pillar span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pillar.wide { grid-column: 1 / -1; }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .6rem 1.1rem;
  border-radius: 11px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.cta.secondary { background: var(--bg-2); color: var(--text); border-color: var(--line); }
.cta.danger { background: var(--red); color: #fff; }
.cta.hot { background: var(--red); color: #fff; }
.cta.hot:hover { background: var(--red-deep); }
.cta:disabled { opacity: .55; cursor: not-allowed; }
.cta.block { width: 100%; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .6rem; text-align: center; }
.stat b { display: block; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: .72rem; color: var(--muted); line-height: 1.3; display: block; }

/* segmented controls and selects */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: .4rem .7rem; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: .86rem; font-weight: 600; min-height: 36px; }
.seg button[aria-pressed="true"] { background: #ffffff; color: var(--text); box-shadow: 0 1px 3px rgba(16,24,32,.12); }
select, input[type=text], input[type=tel], input[type=search], input[type=number], input[type=password], textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-weight: 600; margin: .9rem 0 .35rem; }
.help { color: var(--muted); font-size: .86rem; margin-top: .3rem; }

/* source cards and bars */
.source.official .badge:not(.ok):not(.warn):not(.bad) { color: #3d4751; background: #eef1f4; border-color: #d5dbe1; }
.source.party_compilation .badge:not(.ok):not(.warn):not(.bad) { color: #7d5300; background: #fff3d9; border-color: #efd08f; }
.source.citizen_platform .badge:not(.ok):not(.warn):not(.bad), .source.pv_upload .badge:not(.ok):not(.warn):not(.bad) { color: #00664c; background: var(--brand-soft); border-color: #a9dcc6; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .18rem .5rem; border-radius: 6px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { color: #0b6b4a; background: #e2f5ec; border-color: #a9dcc6; }
.badge.warn { color: #7d5300; background: #fff3d9; border-color: #efd08f; }
.badge.bad { color: #a3231f; background: #fde8e7; border-color: #f1b3af; }
.bars { margin-top: .6rem; }
.bar { display: grid; grid-template-columns: minmax(96px, 38%) 1fr auto; grid-template-areas: "name track val"; gap: .5rem; align-items: center; margin: .32rem 0; font-size: .88rem; }
.bar .name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { grid-area: track; }
.bar .val { grid-area: val; }
@media (max-width: 560px) {
  .bar { grid-template-columns: 1fr auto; grid-template-areas: "name val" "track track"; row-gap: .2rem; margin: .5rem 0; }
  .bar .name { white-space: normal; }
}
.bar .track { height: 12px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 6px; }
.bar .val { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 4.5rem; text-align: right; }
.coverage { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; margin: .4rem 0 .2rem; }
.coverage > div { height: 100%; background: var(--brand); }

/* map */
.map-wrap { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-wrap svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.map-wrap path { stroke: #ffffff; stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; }
.map-wrap path:hover, .map-wrap path:focus { stroke: var(--text); stroke-width: 2; outline: none; }
.map-wrap circle { stroke: #ffffff; stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-tip { position: absolute; left: .6rem; bottom: .6rem; right: .6rem; background: rgba(255,255,255,.96); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: .5rem .7rem; font-size: .85rem; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .6rem; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.crumbs { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .88rem; margin-bottom: .6rem; }
.crumbs button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: .2rem .1rem; }
.crumbs span { color: var(--faint); }

/* lists and tables */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a, .list .item { display: flex; gap: .7rem; align-items: center; justify-content: space-between; padding: .7rem .2rem; color: var(--text); text-decoration: none; }
.list a:hover { background: var(--bg-2); }
.link-ic { display: inline-flex; align-items: center; gap: .55rem; }
.link-ic svg.bi { width: 26px; height: 26px; }
.list .sub { color: var(--muted); font-size: .84rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* notices */
.notice { border-radius: 10px; padding: .7rem .85rem; background: var(--bg-2); border: 1px solid var(--line); font-size: .92rem; }
.notice.ok { border-color: #a9dcc6; background: #eef9f4; }
.notice.warn { border-color: #efd08f; background: #fff8e8; }
.notice.bad { border-color: #f1b3af; background: #fdf0ef; }
.code { font: 700 1.7rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .18em; background: var(--bg-2); border: 1px dashed var(--accent); border-radius: 10px; padding: .6rem .9rem; display: inline-block; }

/* uploads */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .5rem; margin-top: .6rem; }
.thumb { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; aspect-ratio: 3 / 4; overflow: hidden; display: grid; place-items: center; font-size: .8rem; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; width: 28px; height: 28px; cursor: pointer; }
.progress { height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.suggest { border: 1px solid var(--line); border-radius: 10px; margin-top: .3rem; background: var(--bg-2); max-height: 260px; overflow: auto; }
.suggest button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: .55rem .7rem; cursor: pointer; }
.suggest button:last-child { border-bottom: 0; }

/* prose */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: .3rem 0; }

.footer { color: var(--faint); font-size: .78rem; text-align: center; margin-top: 2rem; padding: 0 1rem; }
.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; min-height: 80px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .progress > div { transition: none; } }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); max-width: 460px; width: calc(100% - 2rem); padding: 1.2rem; }
dialog::backdrop { background: rgba(16,24,32,.45); }
