/* Archivo (SIL Open Font License 1.1, fonts/OFL.txt), served from this site: no request to Google. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
  src: url(fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Swiss Political Map, banknote world.
   The map is an engraved plate on security paper: values print as line hatching
   (angle = side, line weight = strength), ink on pale paper, one foil strip for time.
   Light only: people read it in daylight, on phones and at desks. */
:root {
  color-scheme: light;
  --hatch: 1;                 /* turns on engraved hatching in app.js */

  --paper: #e7ebe4;           /* security paper */
  --paper-2: #f1f3ee;         /* lifted panels */
  --ink: #1c2230;             /* intaglio ink: text, rules, controls */
  --muted: #4c5562;
  --rule: #b4bcb2;
  --foil: #3f8a84;            /* focus ring and the foil strip */

  /* data inks: first-named pole violet, other pole ochre, on both scales */
  /* four poles, one colour each, the same everywhere (map, charts, text): */
  --left: #b0352b;            /* red */
  --right: #22508f;           /* blue */
  --liberal: #0f7a62;         /* green */
  --conservative: #94600c;    /* amber */
  --thi: #1f6f78;             /* turnout above Switzerland: teal */
  --tlo: #7a6a8a;             /* turnout below Switzerland: grey-violet */
  --mid: #dce1d9;
  --none: #959c94;
  --loss: #5f6771;
  --lake: #b9cbd2;

  /* party inks (Elections only) */
  --p-left: #b8322a; --p-centre: #c27a06; --p-right: #22508f;
  --p-sp: #c4302a; --p-greens: #6f9d1f; --p-glp: #178e8e; --p-mitte: #c27a06; --p-fdp: #22508f; --p-svp: #0f5a33;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gap: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  font-variation-settings: "wdth" 100;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--foil); outline-offset: 2px; }
button { font-family: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper-2); padding: 8px 12px; z-index: 9; }
.skip:focus { left: 8px; }
.num, td.num { font-variant-numeric: tabular-nums; }

.t-left { color: var(--left); font-style: normal; font-weight: 700; }
.t-right { color: var(--right); font-style: normal; font-weight: 700; }
.t-liberal { color: var(--liberal); font-style: normal; font-weight: 700; }
.t-conservative { color: var(--conservative); font-style: normal; font-weight: 700; }

/* ---------------------------------------------------------------- masthead */
.mast { border-bottom: 1px solid var(--ink); }
.mast-in { max-width: 1440px; margin: 0 auto; padding: 14px var(--gap); display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.name { margin: 0; font-size: 22px; line-height: 1; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -.01em; }
.areas { display: flex; gap: 22px; margin-right: auto; }
.areas button, .views button {
  border: 0; background: none; color: var(--muted); padding: 6px 0; cursor: pointer;
  font: 700 17px var(--font); border-bottom: 3px solid transparent;
}
.areas button[aria-selected="true"], .views button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.areas button:hover, .views button:hover { color: var(--ink); }
.switch { font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------------- the plate */
main { max-width: 1440px; margin: 0 auto; padding: var(--gap); }
.plate {
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink); outline-offset: 3px;
  background: var(--paper-2);
  margin: 4px;
}
.micro {
  margin: 0; padding: 5px 10px 16px;
  background: url("band.svg") left bottom / 120px 12px repeat-x;
  font-size: 9px; letter-spacing: .05em; line-height: 1.4; color: var(--muted);
  white-space: nowrap; overflow: hidden; font-variation-settings: "wdth" 70;
}
.plate-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.map-wrap { grid-column: 1 / -1; grid-row: 1; position: relative; padding: 8px 10px; }
.denom, .rosette { grid-row: 2; padding: 18px; border-top: 1px solid var(--rule); }
.denom { grid-column: 1; }
.rosette { grid-column: 2; border-left: 1px solid var(--rule); }
/* wide screens: the map spans the whole plate and the denomination box floats on the paper
   in its top-left corner (app.js widens the map's left margin if it would hide a place);
   the legend runs as a band under the map */
@media (min-width: 1200px) {
  .plate-body { display: block; }
  .map-wrap { padding: 10px 16px 10px 140px; }
  .denom { position: absolute; top: 14px; left: 18px; width: 300px; border: 1px solid var(--ink); background: var(--paper-2); padding: 14px 16px; }
  .rosette { border-top: 1px solid var(--rule); border-left: 0; padding: 14px 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 8px 32px; align-items: center; }
  .rosette .map-title { margin: 0; }
}



/* search: the denomination box */
.search label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.search-row { display: flex; border: 1px solid var(--ink); background: var(--paper); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 10px 12px; font: 600 17px var(--font); }
.search input::placeholder { color: var(--muted); font-weight: 400; }
.search button { border: 0; background: var(--ink); color: var(--paper); font: 700 15px var(--font); padding: 0 18px; cursor: pointer; }
.search-msg { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.search-msg:empty { display: none; }

/* identity plate */
.idplate { margin-top: 14px; border-top: 1px solid var(--ink); padding-top: 12px; }
.seal { float: right; width: 62px; height: 62px; margin: 0 0 4px 10px; }
.seal svg { width: 100%; height: 100%; display: block; }
.seal path { fill: none; stroke: var(--ink); stroke-width: .7; opacity: .85; }
.seal circle { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.unit { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
/* strip under the map: the other scale, or every party's share, for the selected place */
.plate-more { border-top: 1px solid var(--rule); padding: 12px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.plate-more .ctl-label { width: 100%; margin: 0; }
.plate-more .pair { margin: 0; display: flex; gap: 28px; }
.plate-more .pair div { border-top: 0; padding-top: 0; }
.plate-more .pbar { margin: 0; width: 210px; grid-template-columns: 46px 56px 50px 44px; gap: 6px; }
.muni-name { margin: 0; font-size: 26px; line-height: 1.3; font-weight: 800; font-variation-settings: "wdth" 112; }
.muni-meta { margin: 4px 0 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctl-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-bottom: 4px; }
.big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big { clear: right; }
.big b { font-size: clamp(48px, 5vw, 70px); line-height: .95; font-weight: 800; font-variation-settings: "wdth" 125; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.big span { font-size: 15px; color: var(--muted); }
.big b.words { font-size: 26px; font-variation-settings: "wdth" 110; letter-spacing: 0; color: var(--muted); }
#muniCard .big + .ctl-label { margin-top: 14px; }
.muni-text { margin: 8px 0 0; font-size: 15px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pair div { border-top: 1px solid var(--rule); padding-top: 6px; }
.pair span { display: block; font-size: 12px; color: var(--muted); }
.pair b { font-size: 18px; line-height: 1.35; }
.pair.small b { font-size: 15px; }
.pair.one { grid-template-columns: 1fr; }
.pbar { display: grid; grid-template-columns: 54px 1fr 50px 46px; gap: 8px; align-items: center; font-size: 14px; margin: 5px 0; }
.pbar i { height: 8px; display: block; }
.pbar b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.pbar em { font-style: normal; font-size: 12px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pbar em.up { color: var(--ink); }

/* legend and map title (left column, lower part) */
.map-title { margin: 0 0 10px; font-size: 14px; color: var(--muted); position: relative; }
.map-title b { color: var(--ink); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; position: relative; }
.legend > span:nth-of-type(2) { text-align: right; }
.legend .bar { grid-column: 1 / -1; grid-row: 2; height: 14px; border: 1px solid var(--ink); }
.legend .ladder { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: stretch; border: 1px solid var(--ink); width: 100%; }
.legend .ladder .swatch { display: block; flex: 1 1 0; min-width: 0; height: 18px; border-right: 1px solid var(--paper-2); }
.legend .ladder .spine { display: grid; place-items: center; padding: 0 5px; font-size: 11px; font-weight: 700; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink); background: var(--paper-2); }
.legend .cats .swatch { width: 18px; height: 12px; vertical-align: -1px; margin-right: 3px; border: 1px solid rgba(0, 0, 0, .2); }
.legend .ends { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.legend .ends span:last-child { text-align: right; }
.legend .none { grid-column: 1 / -1; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.legend .none i {
  width: 16px; height: 11px; display: inline-block; border: 1px solid var(--none);
  background: repeating-linear-gradient(45deg, var(--none) 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, var(--none) 0 1px, transparent 1px 4px);
}
.legend .cats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.legend .cats i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: 0; }

/* map */
.map svg { width: 100%; height: auto; display: block; }
.map .munis path { stroke: var(--paper-2); stroke-width: .8; cursor: pointer; }
.map .munis path:hover { stroke: var(--ink); stroke-width: 2.5; }
.map.grouped .munis path:hover { stroke-width: .8; }
.map .lakes { fill: var(--lake); pointer-events: none; }
.map .cantons { fill: none; stroke: var(--ink); stroke-width: 1.6; opacity: .7; pointer-events: none; stroke-linejoin: round; }
.map .sel { fill: none; stroke: var(--ink); stroke-width: 5; pointer-events: none; }
.map .selgroup { pointer-events: none; }
.map .selback { fill: var(--ink); stroke: var(--ink); stroke-width: 8; stroke-linejoin: round; }
.map .selfront { stroke: none; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); padding: 6px 9px; font-size: 14px; line-height: 1.35; max-width: 240px; z-index: 3; }

/* ---------------------------------------------------------------- foil strip */
.foil { padding: 24px 18px 12px; background: url("band.svg") left top / 120px 12px repeat-x; border-top: 1px solid var(--ink); }
.period-head { display: flex; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.period h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.1; font-weight: 800; font-variation-settings: "wdth" 118; font-variant-numeric: tabular-nums; }
.period-note { margin: 0; color: var(--muted); font-size: 14px; }
.period-note .warn { color: var(--ink); font-weight: 700; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 10px 0 2px; background: transparent; cursor: pointer; }
/* the foil: teal family only; its sheen sits where the slider is and glides when it moves */
input[type="range"]::-webkit-slider-runnable-track {
  height: 12px; border: 1px solid var(--ink);
  background: linear-gradient(90deg, #9fcac5, #d9eeeb 45%, #6fa9a3 55%, #9fcac5) var(--foil-shift, 100%) 0 / 300% 100%;
  transition: background-position .45s cubic-bezier(.16, 1, .3, 1);
}
input[type="range"]::-moz-range-track { height: 12px; border: 1px solid var(--ink); background: linear-gradient(90deg, #9fcac5, #d9eeeb 45%, #6fa9a3 55%, #9fcac5) var(--foil-shift, 100%) 0 / 300% 100%; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 28px; margin-top: -9px; background: var(--ink); border: 2px solid var(--paper-2); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 28px; background: var(--ink); border: 2px solid var(--paper-2); border-radius: 0; }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { flex: 1; text-align: center; white-space: nowrap; }
.ticks span:first-child { text-align: left; }
.ticks span:last-child { text-align: right; }
.foil-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 10px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.zoom { border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 600 14px var(--font); padding: 6px 12px; cursor: pointer; }
.zoom:disabled { color: var(--muted); border-color: var(--rule); cursor: default; }

/* ---------------------------------------------------------------- settings dock */
.dock { margin: 4px 4px 22px; }
.views { display: flex; gap: 22px; border-bottom: 1px solid var(--ink); margin-bottom: 14px; }
.dock-rows { display: flex; flex-wrap: wrap; gap: 14px 26px; }
/* the groups only switch on and off; their controls flow in the same rows */
.ctl-group { display: contents; }
/* "Party or bloc" always starts its own row, so the rows above never move when it appears */
#ctlMetric { flex-basis: 100%; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--ink); background: var(--paper-2); }
.seg button {
  border: 0; border-right: 1px solid var(--ink); background: transparent; color: var(--ink);
  font: 600 14px var(--font); padding: 7px 12px; min-height: 36px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: rgba(28, 34, 48, .06); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.sw { width: 18px; height: 10px; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); }
.sw-left { background: linear-gradient(90deg, var(--left) 50%, var(--right) 50%); }
.sw-liberal { background: linear-gradient(90deg, var(--liberal) 50%, var(--conservative) 50%); }
.scales { margin-top: 16px; max-width: 78ch; }
.scales summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.scales summary::-webkit-details-marker { display: none; }
.scales summary::before { content: ""; width: 0; height: 0; border-left: 7px solid var(--ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .2s; }
.scales[open] summary::before { transform: rotate(90deg); }
.scales ul { margin: 8px 0; padding-left: 18px; font-size: 15px; }
.scales li { margin: 4px 0; }
.scales p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- register and ledger */
.register { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 0; margin: 26px 4px 0; border-top: 1px solid var(--ink); }
.ledger-side { padding: 16px 24px 24px 0; border-right: 1px solid var(--rule); }
.ledger-main { padding: 16px 0 16px 20px; min-width: 0; }
h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; font-variation-settings: "wdth" 110; line-height: 1.3; }
.ledger-main .hint { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.check { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.check[hidden] { display: none; }
.check input { accent-color: var(--ink); }
.movers h4 { margin: 14px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.movers ol { list-style: none; margin: 0; padding: 0; }
.movers li button {
  width: 100%; display: flex; justify-content: space-between; gap: 10px; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; color: var(--ink); font: 15px var(--font); padding: 6px 0; cursor: pointer; text-align: left;
}
.movers li button:hover { background: rgba(28, 34, 48, .05); }
.movers li button:disabled { cursor: default; }
.movers li button:disabled:hover { background: transparent; }
.movers li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.mark { display: inline-block; vertical-align: 0; margin-right: 4px; fill: currentColor; }
caption { text-align: left; font-weight: 700; font-size: 14px; padding: 12px 0 4px; }
.chip { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); }
thead th { font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--ink); }
tr.cur td { background: var(--paper-2); font-weight: 700; }

/* charts (drawn by app.js) */
.trend-chart svg { width: 100%; height: auto; display: block; }
.trend-chart .band { opacity: .08; }
.trend-chart .grid { stroke: var(--rule); stroke-width: 1; }
.trend-chart .zero { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.trend-chart .ax { font: 12px var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.trend-chart .lab { font: 700 13px var(--font); }
.trend-chart .line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.trend-chart .line.gap { stroke-dasharray: 2 4; stroke-width: 1.2; opacity: .6; }
.trend-chart circle { stroke: var(--paper); stroke-width: 1.5; }
.trend-chart .cur { stroke: var(--ink); stroke-width: 2.5; }
.trend-chart .trendline { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 10 5; opacity: .8; }
.trend-chart .chline { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.trend-chart .band-p { stroke: var(--paper); stroke-width: 1; }
.trend-chart .cursor { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 3; }
.trend-note { margin: 8px 0 0; font-size: 15px; }
.trend-note .tl { display: inline-block; width: 26px; border-top: 2.5px dashed var(--ink); vertical-align: middle; }
.sub-h { margin-top: 24px; }

.foot { max-width: 1440px; margin: 0 auto; padding: 18px var(--gap) 40px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); }
.foot p { margin: 4px 0; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 900px) {
  .plate-body { grid-template-columns: minmax(0, 1fr); }
  .map-wrap { padding: 6px; }
  .denom { grid-column: 1; grid-row: 2; }
  .rosette { grid-column: 1; grid-row: 3; border-left: 0; }
  .register { grid-template-columns: minmax(0, 1fr); }
  .ledger-side { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--rule); }
  .ledger-main { padding-left: 0; }
}
@media (max-width: 600px) {
  main { padding: 10px; }
  .mast-in { gap: 8px 18px; }
  .name { font-size: 19px; width: 100%; }
  .areas { gap: 18px; }
  .denom, .rosette { padding: 14px 12px 0; }
  .rosette { padding-bottom: 14px; }
  .foil { padding: 12px; }
  /* control rows become a two-column grid: nothing hides off the edge */
  .seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); gap: 1px; }
  .seg button { border-right: 0; background: var(--paper-2); justify-content: center; text-align: center; }
  .seg button[aria-pressed="true"] { background: var(--ink); }
  .seg button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dock-rows { gap: 12px; }
  .ctl { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* vote drill-down, flags, disclaimer */
.votes-card { margin-top: 28px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.linkish:hover { text-decoration-thickness: 2px; }
table.votes td.vt { white-space: normal; min-width: 260px; text-align: left; }
table.votes td { vertical-align: top; }
.vote-detail { border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 3px; background: var(--paper-2); padding: 16px 18px; margin: 14px 4px 20px; }
.vd-meta { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vd-title { margin: 4px 0; font-size: 22px; line-height: 1.25; font-weight: 800; font-variation-settings: "wdth" 110; }
.vd-result { margin: 0 0 12px; }
.vd-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 32px; }
.vd-cols h5 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.vd-cols p { margin: 0 0 10px; font-size: 15px; }
table.advice { width: auto; }
table.advice tr.used td { font-weight: 700; }
.vd-links { margin: 12px 0 0; font-size: 15px; }
.flag { float: right; width: 62px; height: 62px; object-fit: contain; margin: 0 0 4px 10px; border: 1px solid var(--ink); background: var(--paper); padding: 3px; }
.disclaimer { margin-top: 10px; font-size: 13px; }
@media (max-width: 700px) { .vd-cols { grid-template-columns: minmax(0, 1fr); } }

/* Party or bloc: two labelled groups; parties of the picked bloc are marked */
.metric-groups { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; }
.mg-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.seg button.member { box-shadow: inset 0 -4px 0 var(--ink); font-weight: 800; }
.seg button.member::after { content: attr(data-inbloc); font-size: 10px; font-weight: 600; margin-left: 2px; opacity: .75; }
.bloc-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* election trend chart: all lines, the picked one thick */
.trend-chart .pline { fill: none; stroke-width: 1.6; opacity: .75; }
.trend-chart .plab { font-size: 11px; font-weight: 600; }
.trend-chart .plab.sel { font-weight: 800; }
table.trend-table { margin-top: 10px; width: auto; min-width: 60%; }
table.trend-table td:last-child { text-align: left; color: var(--muted); }

/* the Swiss comparison line is dotted, the trend line long-dashed, and a key names both */
.trend-chart .chline { stroke-dasharray: 0.5 5; stroke-linecap: round; stroke-width: 2.4; }
.line-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.line-key span { display: inline-flex; align-items: center; gap: 8px; }
.line-key .k-trend { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 10 5; opacity: .8; }
.line-key .k-ch { stroke: var(--muted); stroke-width: 2.4; stroke-dasharray: 0.5 5; stroke-linecap: round; }
.trend-chart .line-key svg { width: 34px; height: 10px; flex: none; display: inline-block; }

/* language switcher */
.lang-switch { display: flex; gap: 0; border: 1px solid var(--ink); }
.lang-switch button { min-width: 38px; min-height: 32px; padding: 4px 8px; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--ink); font: 700 13px var(--font); letter-spacing: .04em; cursor: pointer; }
.lang-switch button:first-child { border-left: 0; }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper, #fff); }
.lang-switch button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* site name and contact */
.contact { margin: 6px 0 0; }

/* Polls tab */
:root { --pl1: #b07a00; --pl2: #1f3a5f; --pl3: #8a3f9c; --pl4: #2a7a55; --pl5: #b23a3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pl1: #e0b13c; --pl2: #8fb2e6; --pl3: #c98fe0; --pl4: #62c496; --pl5: #e88080; } }
body.polls-on main > :not(#pollsArea) { display: none; }
#pollsArea { max-width: 1440px; margin: 0 auto; padding: 18px var(--gap); display: grid; gap: 16px; }
.pollline { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.poll-key { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.poll-key .chip { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; }
.poll-key em { color: var(--muted); font-style: normal; }
.contact { margin: 4px 0; }
#pollsArea .seg { display: inline-flex; width: fit-content; max-width: 100%; }

/* polls chart: hover values */
#pollsChart { position: relative; }
.poll-hit { fill: transparent; cursor: crosshair; }
.poll-guide { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; pointer-events: none; }
#pollsChart circle { pointer-events: none; transition: r .1s; }
#pollsChart circle.on { r: 5.5; stroke: var(--paper); stroke-width: 2; }
.poll-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); padding: 8px 10px; font-size: 14px; line-height: 1.4; z-index: 3; display: grid; gap: 2px; min-width: 150px; max-width: 280px; }
.poll-tip .row { display: block; }
.poll-tip i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; outline: 1px solid var(--paper); }
.poll-event { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.poll-badge { fill: var(--ink); stroke: none; }
.poll-badge-n { fill: var(--card, var(--paper, #fff)); font: 700 11px sans-serif; pointer-events: none; }
.poll-events { margin: 10px 0 0; padding-left: 22px; font-size: 14px; display: grid; gap: 2px; }

/* ---------------------------------------------------------------- masthead, two rows (17 Oct 2026)
   row 1: the name and the languages; row 2: a lighter band with the main tabs on the left
   and the views of the open tab (Compare / Trend) as a small switch on the right */
.mast { border-bottom: 1px solid var(--ink); }
.mast-top { padding-top: 14px; padding-bottom: 10px; justify-content: space-between; }
.mast-top .name { font-size: 28px; }
.name-sub { display: inline-block; margin-left: 12px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-variation-settings: "wdth" 100; color: var(--muted); vertical-align: 3px; }
.name a { color: inherit; text-decoration: none; }
.mast-band { background: var(--paper-2); border-top: 1px solid var(--rule); }
.mast-band .mast-in { padding-top: 0; padding-bottom: 0; align-items: flex-end; gap: 6px 28px; }
.mast-band .areas { margin-right: 0; gap: 26px; }
.mast-band .areas button, .mast-band .areas a { padding: 10px 0 8px; font: 700 17px var(--font); color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: none; text-decoration: none; cursor: pointer; }
.mast-band .areas [aria-selected="true"], .mast-band .areas [aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.mast-band .areas button:hover, .mast-band .areas a:hover { color: var(--ink); }

@media (max-width: 600px) {
  .mast-top .name { font-size: 22px; width: auto; }
  .name-sub { display: block; margin: 4px 0 0; }
  .mast-band .areas { gap: 18px; width: 100%; }
  .mast-band .areas button, .mast-band .areas a { font-size: 16px; }
}

/* trend chart: click a dot to list the votes of that year */
.year-hit { fill: transparent; cursor: pointer; }
.year-hit:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 2; }
.year-dot { pointer-events: none; }
.year-dot.on { stroke: var(--ink); stroke-width: 3; }
.trend-year { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ink); }
.ty-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ty-head h4 { margin: 0 0 6px; font-size: 17px; }
.trend-year .vt-meta { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) {
  .mast-top { flex-wrap: nowrap; align-items: flex-start; }
  .lang-switch { flex-shrink: 0; }
  .lang-switch button, .lang-switch a, .lang-switch span { min-width: 32px; padding: 4px 6px; }
}

/* ---------------------------------------------------------------- the movers list sits in the plate, right of the map (owner decision, 17 Oct 2026) */
.plate-body > .ledger-side { grid-column: 1 / -1; grid-row: 3; padding: 16px 18px 18px; border-top: 1px solid var(--rule); border-right: 0; }
.register { grid-template-columns: minmax(0, 1fr); }
.ledger-main { padding-left: 0; }
@media (min-width: 1200px) {
  .plate-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
  .plate-body > .map-wrap { grid-column: 1; grid-row: 1; }
  .plate-body > .ledger-side { grid-column: 2; grid-row: 1; border-top: 0; border-left: 1px solid var(--rule); padding: 16px 18px; align-self: stretch; }
  .plate-body > .rosette { grid-column: 1 / -1; grid-row: 2; }
  .plate-body > .denom { grid-area: auto; }
}
@media (max-width: 900px) {
  .plate-body > .ledger-side { grid-row: 4; }
}

/* smaller floating place box on wide screens, so the map gets more room (17 Oct 2026) */
@media (min-width: 1200px) {
  .denom { width: 236px; padding: 10px 12px; }
  .denom .search label { font-size: 13px; margin-bottom: 4px; }
  .denom .search input { padding: 6px 8px; font-size: 15px; }
  .denom .search button { padding: 0 12px; font-size: 14px; }
  .denom .idplate { margin-top: 10px; padding-top: 8px; }
  .denom .muni-name { font-size: 20px; }
  .denom .muni-meta { font-size: 13px; }
  .denom .flag { width: 44px; height: 44px; padding: 2px; }
  .denom .big b { font-size: 44px; }
  .denom .big span, .denom .muni-text { font-size: 13px; }
}

/* turnout: switch on the map, bar in the place card */
.t-thi { color: var(--thi); font-style: normal; font-weight: 700; }
.t-tlo { color: var(--tlo); font-style: normal; font-weight: 700; }
.foil-tools .turn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.turnline { margin-top: 12px; }
.turnbar { height: 10px; background: repeating-linear-gradient(45deg, var(--paper-2) 0 3px, var(--rule) 3px 4px); border: 1px solid var(--ink); }
.turnbar i { display: block; height: 100%; background: var(--ink); }
.turntext { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.turntext b { color: var(--ink); }
.foil-tools .turn { margin-left: auto; }
#trendChart .line.other { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
#trendChart .lab.end { font-size: 12px; fill: var(--muted); font-weight: 600; }
#trendChart .lab.end.cur { fill: var(--ink); font-weight: 800; }

/* compare two places in the trend charts */
.cmp-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 4px; font-size: 14px; }
.cmp-form label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.cmp-form input { border: 1px solid var(--ink); background: var(--paper-2); color: var(--ink); padding: 5px 8px; font: 600 14px var(--font); width: 200px; max-width: 60vw; }
.cmp-form button[type="submit"] { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 700 13px var(--font); padding: 6px 12px; cursor: pointer; }
.cmp-form .cmp-now { flex-basis: 100%; margin: 0; }
.trend-chart .line.cmp { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 7 4; opacity: .8; }
.trend-chart .cmp-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.trend-chart .lab.end.cmp { fill: var(--ink); font-size: 12px; font-weight: 700; }
.pair.cmpcard { margin-top: 8px; }

/* data download (footer) */
.downloads { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.downloads h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--ink); }
.downloads p { margin: 4px 0; max-width: 80ch; }
.dl-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.dl-row button { border: 1px solid var(--ink); background: var(--paper-2); color: var(--ink); font: 700 14px var(--font); padding: 7px 12px; cursor: pointer; }
.dl-row button::before { content: "↓ "; }
.dl-row button:hover { background: var(--ink); color: var(--paper); }
.trend-chart .lab.end { paint-order: stroke; stroke: var(--paper-2); stroke-width: 4px; stroke-linejoin: round; }

/* town-country gap chart (Switzerland level) */
#gapChart .line.gap-other { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
#gapChart .gap-val { font-size: 11px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--paper-2); stroke-width: 3px; }
