/* =====================================================================
   STYLES
   1. Colours and fonts (change the look here)
   2. Page layout
   3. Each section, in page order (masthead, columns, map, left panel, right column)
   ===================================================================== */

/* ---------- 1. Colours and fonts ----------
   Two looks, dark (here) and light (below), with the same roles. Change a colour here and it changes everywhere. */
:root {
  color-scheme: dark;     /* dark scrollbars and form controls */
  --bg: #0f1516;          /* page background */
  --surface: #151d1f;     /* cards and panels */
  --surface-2: #1b2527;   /* open topics in the panel: a shade lighter than the card */
  --ink: #e4ecea;         /* main text */
  --muted: #8fa09f;       /* secondary text */
  --neutral: #c3c6c7;     /* grey switches (Zeitraum), apart from the petrol ones */
  --line: #2a3638;        /* borders and grid lines */
  --accent: #5cc3cf;      /* petrol: map colour, bars, buttons */
  --warm: #f08a5d;        /* negative correlations, "winner without a seat" */
  --ramp-0: #1c2729;      /* darkest map colour (lowest values) */
  --hi: #f2c14e;          /* selection highlight */
  --around: #24292b;      /* neighbouring countries on the map: neutral grey, clearly not data */
  --dim: #050809;         /* constituencies outside a selected Land are mixed towards this */
  /* party colours */
  --p-union: #d9d9d9; --p-afd: #4fb3f0; --p-spd: #ff5a63; --p-gruene: #6cc768;
  --p-linke: #e04fae; --p-bsw: #c46a9f; --p-fdp: #f5d03b;
  --shadow: rgb(0 0 0 / .45);   /* under cards that lie over the page */
  /* fonts */
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;   /* name and headings: soft old-style serif with character */
  --f-body: "Newsreader", "Iowan Old Style", Georgia, serif;     /* text: a serif made for reading on screens */
  --f-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;   /* numbers and small labels */
}

/* Light: the same roles on a light page, with the two main colours swapped: orange leads (map, name, buttons, "higher"),
   petrol takes orange's part ("lower", opposite), and the selection is indigo (yellow would vanish on orange).
   html[data-theme="light"] is set by the script in <head> (the browser's setting, or the visitor's choice in the
   ⓘ window: js/about.js). Texts that name these colours follow the look (js/texts.js → colours). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ef;          /* warm paper */
  --surface: #ffffff;
  --surface-2: #eef1f0;
  --ink: #1a2422;
  --muted: #5f6d6b;
  --neutral: #3f4a48;
  --line: #dde3e1;
  --accent: #c2531a;      /* dark orange: the map's highest values, the name, buttons, "higher" */
  --warm: #17808d;        /* petrol: "lower", opposite links */
  --ramp-0: #f5ebe2;      /* lightest map colour (lowest values); the highest: the dark orange */
  --hi: #4b3fc0;          /* indigo: the selection, Germany's line */
  --around: #e5e5e0;
  --dim: #f4f3ef;         /* outside a selected Land: mixed towards the page */
  --p-union: #3a3a3a; --p-afd: #1f8fd6; --p-spd: #e3000f; --p-gruene: #3f9a2e;
  --p-linke: #c0287f; --p-bsw: #8e3d6c; --p-fdp: #d9ad00;
  --grp-west: #3b7fbf; --grp-east: #b8509f; --grp-urban: #2f6db5; --grp-middle: #7c8786; --grp-rural: #5a9a32;   /* town: blue, not violet (the selection is indigo) */
  --shadow: rgb(20 30 30 / .18);
}

/* ---------- 2. Page layout ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden always hides, even on elements given their own display */
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); }
h1, h2, h3 { font-family: var(--f-display); font-variation-settings: "SOFT" 50; text-wrap: balance; margin: 0; }   /* SOFT: 0 sharp … 100 rounded */
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eyebrow { font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* shared controls */
.field { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 11px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

/* ---------- 3a. Masthead ---------- */
.mast { border-bottom: 1px solid var(--line); padding-block: 10px; }
.mast-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mast h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; font-variation-settings: "SOFT" 100, "WONK" 1; }   /* WONK: the leaning letters */
.mast h1 em { font-style: normal; color: var(--accent); }
.mast h1 .tld { font-size: .55em; font-weight: 400; color: var(--muted); letter-spacing: 0; }   /* ".io" */
.mast .home { color: inherit; text-decoration: none; }
.brand { display: flex; align-items: baseline; gap: 12px; }   /* name and tagline on one line */
.tagline { margin: 0; font: 400 12px/1 var(--f-mono); letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
/* small ⓘ: hovering it (or its heading) opens an explanation */
.ibadge { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 6px; vertical-align: 1px;
  border: 1px solid currentColor; border-radius: 50%; font: italic 600 9px/1 Georgia, serif; text-transform: none; letter-spacing: 0;
  opacity: .55; cursor: help; flex: none; }
:hover > .ibadge, .ibadge:hover, .ibadge:focus { opacity: 1; }
h2 .ibadge { vertical-align: 6px; font-size: 10px; width: 16px; height: 16px; }
.ahead2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.ahead2 h3 { margin: 0; }
.tabs2 button { padding: 2px 9px; font-size: 11px; }

/* ---------- 3b. Search box (top bar) ---------- */
.search { position: relative; margin-left: auto; min-width: 0; }
/* ⓘ at the bottom of the panel, left of the legend: sources, reference dates, language (opens on hover) */
.about { flex: none; }
.aboutbtn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1.5px solid var(--accent); border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font: italic 700 14px/1 Georgia, serif; cursor: pointer; }   /* stands out: the page's info */
.aboutbtn:hover, .aboutbtn[aria-expanded="true"] { background: var(--accent); color: var(--bg); }
/* fixed: placed by main.js above the button, so the panel's rounded card does not cut it off */
.aboutpop { position: fixed; z-index: 30; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--muted); border-radius: 8px; padding: 10px 14px 12px; font-size: 12px; line-height: 1.45;
  color: var(--muted); box-shadow: 0 10px 28px var(--shadow); }
.aboutpop b { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink);
  font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.aboutpop p { margin: 8px 0 0; }
.aboutpop a { color: var(--accent); }
.aboutauto { margin: 0 0 4px !important; }   /* "follow this device again": only when a look is fixed */
/* top bar: language and light/dark (js/about.js); desktop left of the search box, phones right of it (section 5) */
.prefs { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.prefs + .search { margin-left: 0; }
.prefs .seg button { padding: 4px 8px; font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em; }
.themebtn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--muted); cursor: pointer; }
.themebtn:hover { color: var(--accent); border-color: var(--accent); }
.themebtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.search input { width: 260px; max-width: 100%; }
@media (min-width: 1200px) { .search input { width: var(--col-right); } }   /* same width as the right column below it */
.search ul { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); width: max(100%, 360px); max-width: 85vw; max-height: 420px; overflow: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); }
.search li button { width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 4px; cursor: pointer; display: block; }
.search li button:hover, .search li button:focus-visible, .search li button.active { background: var(--ramp-0); }   /* .active: picked with ↑ / ↓ */
.search li small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
/* clock in the box: a recently viewed list is there (click: open it) */
.qclock { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; padding: 4px; border: 0;
  border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.qclock:hover { color: var(--accent); }
.qclock svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.search li.empty { padding: 6px 8px; color: var(--muted); }
/* empty box: "Recently viewed" heading with a small "Clear" link */
.search li.head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 8px 4px;
  font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.search li.head .clear { width: auto; padding: 0; font: 12px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--muted);
  text-decoration: underline dotted; text-underline-offset: 3px; }
.search li.head .clear:hover { background: none; color: var(--accent); }
.search .seen { font-style: normal; color: var(--accent); }   /* "viewed recently" on a search result */

/* ---------- 3c. Three columns: panel · map · analytics ---------- */
:root { --col-left: 360px; --col-right: 380px; --rail: 44px; }   /* width of the left card (both pages) and of the right column (the search box in the top bar matches it); of its rail when pushed out */
/* --an-w: the right column's current width (0 when pushed out); registered so it can be animated */
@property --an-w { syntax: '<length>'; inherits: true; initial-value: 380px; }
.atlas { --an-w: var(--col-right); display: grid; grid-template-columns: var(--col-left) minmax(0, 1fr) var(--an-w); gap: 20px; align-items: start; padding-block: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  position: relative; transition: --an-w .3s ease; }
.atlas.an-closed { --an-w: var(--rail); }
.anwrap { min-width: 0; }
/* the handle in the gap left of the right column: › pushes it out, ‹ (with "Analyse") pulls it back */
.antoggle { display: none; }

/* Wide screens: exactly one window high; the panel and the analytics column scroll on their own. */
@media (min-width: 1200px) {
  body { height: 100vh; height: 100dvh; min-height: 640px; display: flex; flex-direction: column; }
  .atlas { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .panel, .mapcol { display: flex; flex-direction: column; min-height: 0; }
  .analytics, #profile { overflow-y: auto; min-height: 0; }
  .anwrap { display: flex; min-height: 0; overflow: hidden; }   /* clips the column while it slides out */
  /* the column: a card like the panel on the left, with its heading (ANALYSE ›) on top */
  .analytics { display: flex; flex-direction: column; width: var(--col-right); flex: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px 14px; }
  .an-closed .analytics { visibility: hidden; transition: visibility 0s .3s; }   /* after sliding out: not focusable */
  .anbar { display: flex; justify-content: space-between; align-items: center; margin: 0 -16px 12px; padding: 0 10px 8px 16px; border-bottom: 1px solid var(--line); }
  .anclose, .antoggle .chev { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
    background: var(--surface-2); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
  .anclose::before { content: '›'; }
  .anclose:hover { color: var(--accent); border-color: var(--accent); }
  /* pushed out: a rail at the right edge, as tall as the panel: ‹ ANALYSE (and a dot when something stands out) */
  .antoggle { display: none; }
  .an-closed .antoggle { display: flex; flex-direction: column; align-items: center; gap: 14px; position: absolute; z-index: 6;
    top: 16px; bottom: 16px; right: max(16px, env(safe-area-inset-right, 0px)); width: var(--rail); padding: 10px 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); cursor: pointer;
    animation: railin .2s .15s both; }   /* appears once the column has mostly slid out */
  @keyframes railin { from { opacity: 0; } }
  .antoggle .chev::before { content: '‹'; }
  .antoggle .antxt { writing-mode: vertical-rl; font: 500 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
  .antoggle:hover { border-color: var(--accent); background: var(--surface-2); }
  .antoggle:hover .chev { color: var(--accent); border-color: var(--accent); }
  .antoggle:hover .antxt { color: var(--accent); }
  .antoggle .fd { width: 8px; height: 8px; }
  /* .peek: for a moment after a new selection, or while hovered, a teaser card beside the rail */
  .antoggle .teaser { display: none; }
  .an-closed .antoggle.peek .teaser { display: block; position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    width: 200px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px;
    box-shadow: 0 6px 20px var(--shadow); text-align: left; animation: peek .2s ease-out; }
  @keyframes peek { from { opacity: 0; transform: translate(8px, -50%); } }
  .antoggle .teaser { font-size: 12px; line-height: 1.35; color: var(--muted); }
  .antoggle .teaser b { display: block; color: var(--ink); font-weight: 600; }
  .antoggle .teaser em { font-style: normal; color: var(--accent); }
  .analytics > * { flex: none; }
  .profile { flex: 1; min-height: 0; }
  #profile { flex: 1; }
  .mapbox { flex: 1; min-height: 0; }
  .atlas #map { height: 100%; }   /* .atlas: beats the general #map rule further down */
}
/* Medium screens: panel and map side by side, analytics below in columns; the page scrolls. */
@media (max-width: 1199px) {
  :root { --col-left: 340px; }
  .atlas { grid-template-columns: var(--col-left) minmax(0, 1fr); }
  .anbar { display: none; }   /* the column's heading with › only where it can be pushed out */
  .anwrap { grid-column: 1 / -1; }
  .analytics { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 32px; align-items: start; }
  #map { max-height: 85vh; }
}
/* Phones: one column, map first. */
@media (max-width: 760px) {
  .atlas { grid-template-columns: minmax(0, 1fr); }
  .mapcol { order: -1; }
}

/* ---------- 3d. Map and legend ---------- */
.metric-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 24px; }
.years { flex: none; margin-top: 4px; }
.metric-head h2 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; letter-spacing: -.02em; }
.metric-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 52ch; }
/* Germany's value, below the description */
.mde { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); max-width: 52ch; }
.mde b { font: 600 18px/1.2 var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.mde b small { font: 400 12px var(--f-body); color: var(--muted); }
.mapbox { position: relative; overflow: hidden; border-radius: 8px; }
#map { width: 100%; height: auto; display: block; overflow: visible; }   /* visible: neighbours fill the whole box, not just the viewBox */
#map .around { fill: var(--around); stroke: var(--bg); stroke-width: .6; stroke-linejoin: round; pointer-events: none; }
#map .shape { stroke: var(--bg); stroke-width: .35; cursor: pointer; }
#map .shape:hover { stroke: var(--ink); stroke-width: 1; }
/* Land borders get a background-coloured halo and a heavy line, so they stand out from the constituencies */
#map .borders-halo { fill: none; stroke: var(--bg); stroke-width: 4.5; stroke-linejoin: round; pointer-events: none; }
#map .borders { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; pointer-events: none; }
#map .outline { fill: none; stroke: var(--ink); stroke-width: 1.4; pointer-events: none; }

#map .selected { fill: none; stroke: var(--hi); stroke-width: 2.6; pointer-events: none; }
#map .hoverland { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-dasharray: 5 3; pointer-events: none; }   /* Land under the mouse */
.tip { position: absolute; pointer-events: none; width: max-content; max-width: 270px; z-index: 5; display: grid; gap: 3px;
  background: var(--surface); border: 1px solid var(--muted); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.35;
  box-shadow: 0 10px 28px var(--shadow); }
.tip > b { font-size: 14px; font-weight: 600; }
.tip .tl { color: var(--muted); font-size: 11px; }
.tip .big { font: 600 24px/1.15 var(--f-mono); font-variant-numeric: tabular-nums; margin-top: 2px; }
.tip .big small { font: 12px var(--f-body); color: var(--muted); }
.tip .vs { font-family: var(--f-mono); font-weight: 600; }
.tip .vs.up { color: var(--accent); }
.tip .vs.down { color: var(--warm); }
.pbottom { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 10px 16px; }
/* phones and touch screens (js/about.js): the window opens in the page, below the button, across the card */
.about.inpage { display: contents; }
.about.inpage .aboutpop { position: static; order: 3; flex: 1 1 100%; width: auto; max-height: none; overflow: visible; box-shadow: none; margin-top: 2px; }
.legend { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 0; cursor: help; }   /* in the left panel */
.legend .bins { flex: 1; display: flex; height: 10px; border-radius: 2px; overflow: hidden; }
.legend .end { flex: none; font-size: 11px; line-height: 1; color: var(--muted); }   /* "low" and "high" at the ends */
.legend .bins i { flex: 1; }
.legend:hover .bins, .legend:focus .bins { outline: 1px solid var(--muted); outline-offset: 2px; }
.ptip .scale { display: grid; gap: 3px; margin-top: 6px; }
.ptip .scale div { display: flex; align-items: center; gap: 8px; }
.ptip .scale i { width: 26px; height: 12px; border-radius: 2px; flex: none; }


/* ---------- 3e. Left panel (profile) ---------- */
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
#profile { padding: 7px 16px 12px; }   /* top: the name sits level with the indicator name next to the map */
.landlink { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.landlink:hover { color: var(--accent); }
.profile h3 { font-size: 22px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; margin-top: 4px; }
.profile h3 + .eyebrow { margin-top: 4px; }
.found { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--hi); background: var(--bg); font-size: 13px; }
/* tabs: one shows at a time; they stay at the top while the rows below scroll */
.ptabs { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  margin: 12px -16px 0; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ptabs button { border: 1px solid var(--line); border-radius: 6px; background: none; padding: 5px 4px; font-size: 13px; color: var(--muted);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptabs button:hover { color: var(--ink); border-color: var(--muted); }
.ptabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.ptabs button[data-current] { color: var(--accent); }                              /* the tab of the indicator on the map */
.ptabs button[data-current][aria-selected="true"] { border-color: var(--accent); }
/* where the selection stands out: a dot on the tab and before the value (blue: far higher, orange: far lower) */
.fd { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.fd.hi { background: var(--accent); }
.fd.lo { background: var(--warm); }
.ptabs button { position: relative; }
.ptabs button .fd { position: absolute; top: 4px; right: 4px; }
.prow .pv .fd { margin-right: 6px; vertical-align: 2px; }
.ptip .far { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }   /* on top of the card */
.ptip .far.hi { color: var(--accent); }
.ptip .far.lo { color: var(--warm); }
/* topics inside a tab: a small heading over their rows */
.psub { margin-top: 14px; }
.psub > h4 { margin: 0 0 4px; }
/* the first topic: a little air below the tab bar (map panel: inside .ptab; connections list: right after the tabs) */
.ptabs + .ptab > .psub:first-child, .ptabs + .psub { margin-top: 22px; }
.prow { display: grid; grid-template-columns: minmax(0, 1.4fr) 64px minmax(60px, 1fr); gap: 10px; align-items: center; width: 100%;
  padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 13px; cursor: pointer; }
.prow:hover .pl { text-decoration: underline; }
.prow[aria-current="true"] .pl, .prow[aria-current="true"] .pv { font-weight: 600; color: var(--accent); }
.prow .pl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line per row: short labels (config.js → short) */
.prow .pv { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* drill-down: the history of one indicator, under its row */
/* the indicator on the map over time (right column, js/trend.js) */
.tname { margin: -2px 0 6px; font-size: 13px; color: var(--muted); }
.trend { font-size: 12px; position: relative; }
.trend p { margin: 6px 0 0; }
.trend .up { color: var(--accent); }
.trend .down { color: var(--warm); }
.minichart { width: 100%; height: auto; display: block; }
.minichart .grid { stroke: var(--line); }
.minichart .ax { fill: var(--muted); font: 9px var(--f-mono); }
.minichart .ln path:not(.mk) { fill: none; stroke-width: 1.3; }   /* line pieces; markers keep the line's colour as fill */
.minichart .ln.d-sel path:not(.mk) { stroke-width: 2.6; }        /* the selection stands out */
.minichart .ln path.est { stroke-dasharray: 4 3; }
.minichart .d-sel { stroke: var(--accent); fill: var(--accent); }
.minichart .d-own { stroke: var(--muted); fill: var(--muted); }
.minichart .d-de { stroke: var(--hi); fill: var(--hi); }
.minichart .mk { stroke-width: 1.2; }
.minichart .mk.est { fill: var(--surface); stroke-width: 1.5; }
.minichart .lab text { font: 600 10px var(--f-body); stroke: none; }
.minichart .lab .conn { stroke-width: .8; opacity: .7; }
.minichart .lab.zero text { fill: var(--hi); }
.minichart line.zero { stroke: var(--hi); stroke-width: 1.3; stroke-dasharray: 2 3; }
/* hovering a line: it stays, the others fade */
.minichart[data-focus] .ln, .minichart[data-focus] .lab { opacity: .2; transition: opacity .12s; }
.minichart[data-focus="0"] .l0, .minichart[data-focus="1"] .l1, .minichart[data-focus="2"] .l2 { opacity: 1; }
.gapseg { margin: 0 0 4px; }
.gapseg button { padding: 1px 8px; font-size: 11px; }
.minichart .hit { fill: none; stroke: transparent; stroke-width: 12; stroke-linecap: round; cursor: pointer; pointer-events: stroke; }   /* wide hover zone along each line */
.minichart .hit:hover { stroke: color-mix(in srgb, var(--ink) 8%, transparent); }
.ptip .srow3 { display: grid; grid-template-columns: 70px 1fr 70px; gap: 8px; }
.ptip .srow4 { display: grid; grid-template-columns: 44px 1fr 72px 78px; gap: 8px; white-space: nowrap; }   /* year · value · change · rank */
.ptip .srow4 > :not(:first-child) { text-align: right; }
.ptip .srow4 .period { grid-column: 1 / 3; text-align: left; }   /* "2014–2021" over year and value */
.ptip .srow4.head { color: var(--muted); font-size: 11px; }
.ptip .srow4.total { border-top: 1px solid var(--line); padding-top: 3px; margin-top: 2px; color: var(--muted); }
.ptip .srow3 > :nth-child(2), .ptip .srow3 > :nth-child(3) { text-align: right; }
.ptip .srow3.total { border-top: 1px solid var(--line); padding-top: 3px; margin-top: 2px; color: var(--muted); }
.ptip .up, .ptip b.up { color: var(--accent); }
.ptip .down, .ptip b.down { color: var(--warm); }
.ptip b.d-sel { color: var(--accent); }
.ptip b.d-de { color: var(--hi); }
.ptip .d-sel { color: var(--accent); }
.ptip .d-own { color: var(--ink); opacity: .7; }
.ptip .d-de { color: var(--hi); }
/* "Zeitraum" below the change lists: same size and type as the tabs above (.tabs2), but grey, because it
   qualifies the list rather than switching to another one */
.spanrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 2px;
  font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.spanrow .seg button { padding: 2px 9px; font: 400 11px/1.5 var(--f-body); letter-spacing: 0; text-transform: none; }
.spanrow .seg button[aria-pressed="true"] { background: var(--neutral); color: var(--bg); }
/* hover window explaining an indicator (js/profile.js) */
.ptip { position: fixed; z-index: 30; width: 280px; max-width: calc(100vw - 16px);   /* reachable: its text can be selected (js/hover.js) */
  background: var(--surface); border: 1px solid var(--muted); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.4;
  box-shadow: 0 10px 28px var(--shadow); }
.ptip b { font-weight: 600; }
.ptip p { margin: 4px 0 0; }
.ptip p.desc { color: var(--muted); }   /* what an indicator measures */
.ptip .meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.ptip .rk { color: var(--muted); font: 12px var(--f-body); }   /* rank behind a value */
.ptip .stats { margin-top: 8px; display: grid; gap: 3px; font-size: 12px; }
.ptip .srow { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.ptip .srow span:first-child { color: var(--muted); }
.ptip:has(.stats) { width: 340px; }
/* lowest / highest in the outlier card: prominent, click to select */
.ptip .ref { margin-top: 2px; color: var(--muted); }   /* Germany's value */
/* lowest and highest: two small lines at the bottom, the name a link */
.xlist { display: grid; gap: 2px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.xline { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; width: 100%; padding: 1px 0;
  border: 0; background: none; text-align: left; font-size: 12px; cursor: pointer; }
.xline .xl { color: var(--muted); }
.xline .xv { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.xline .xn { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }
.xline:hover .xn { text-decoration-style: solid; }
.strip { width: 100%; height: 18px; display: block; }
.strip .tick { stroke: var(--muted); stroke-opacity: .35; }
.strip .de { stroke: var(--hi); stroke-width: 2; }       /* Germany: yellow */
.strip .me { stroke: var(--accent); stroke-width: 3; }  /* the selected constituency or Land: blue */
.election .sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pill.warn { border-color: var(--warm); color: var(--warm); }
.votebar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.votebar i { display: block; height: 100%; }
.votebar i[data-m] { cursor: pointer; }
.votebar i[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.keys { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 12px; }
/* parties: click to colour the map by that party */
.keys button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; border-radius: 999px; background: none;
  padding: 2px 8px; cursor: pointer; font-size: 12px; }
.keys button:hover { border-color: var(--line); }
.keys button[aria-current="true"] { border-color: var(--accent); font-weight: 600; }
.vlink { border: 0; background: none; padding: 0; cursor: pointer; font-size: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.vlink:hover, .vlink[aria-current="true"] { color: var(--accent); }
.keys i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.keys em { font-style: normal; font-family: var(--f-mono); color: var(--muted); }
.chg { font: 10px var(--f-mono); margin-left: 3px; }   /* change since 2021 */
.chg.up { color: var(--accent); }
.chg.down { color: var(--warm); }

/* ---------- 3f. Right column (analytics) ---------- */
.ablock { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.anbar + .ablock { border-top: 0; margin-top: 0; padding-top: 4px; }

.ablock h3 { font: 500 12px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.ablock > .note:first-of-type { margin: 0 0 8px; }
.sumnote { color: var(--accent); text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 600; }


/* cards on the map, stacked at the bottom left beside Germany (js/lands.js → mapCard): rankings above the Länder */
.mapcards { position: absolute; left: 12px; bottom: 12px; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.mapcard { width: 224px; padding: 8px 10px 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 8px; }
.mapcard.over { box-shadow: 0 10px 28px var(--shadow); background: var(--surface); }   /* opened by hand over the map */
.mapcard.folded { width: auto; padding: 0; }
.mapcard.folded .cardbody { display: none; }
.lhead { display: flex; align-items: center; gap: 2px; width: 100%; border: 0; background: none; padding: 0 0 6px; cursor: pointer; color: var(--muted); white-space: nowrap;
  font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.mapcard.folded .lhead { padding: 6px 10px; }
.lhead:hover { color: var(--accent); }
.lhead .lchev { margin-left: auto; padding: 0 2px 0 10px; }
.lhead .lchev:hover { color: var(--ink); }   /* "−" folds the card */
.lhead .lchev::before { content: '−'; font-size: 14px; }
.mapcard.folded .lhead .lchev::before { content: '+'; }
.lands { display: grid; gap: 1px; }
.lrow { display: grid; grid-template-columns: 100px minmax(0, 1fr) 56px; gap: 6px; align-items: center; font-size: 11px; line-height: 1.35; padding: 1px 2px; border-radius: 3px;
  border: 0; background: none; width: 100%; text-align: left; cursor: pointer; }
.lrow[aria-current="true"] .nm { font-weight: 600; color: var(--accent); }
.lrow:hover .nm { text-decoration: underline; }
.lrow.hl { background: var(--ramp-0); }   /* its Land is under the mouse on the map */
.lrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lb { height: 10px; background: var(--ramp-0); border-radius: 2px; position: relative; }
.lrow .lb i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.lrow .v { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* quick select under the Länder bars */

/* highest / lowest constituencies */
.rank { display: grid; gap: 8px; }
.rank ol { list-style: none; margin: 2px 0 0; padding: 0; }
.rank li button { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 6px; width: 100%; border: 0; background: none; padding: 2px 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; font-size: 11px; line-height: 1.35; }
.rank li button:hover .n { text-decoration: underline; }
.rank li button[aria-current="true"] .n { font-weight: 600; color: var(--accent); }
.rank .num.up { color: var(--accent); }
.rank .num.down { color: var(--warm); }
#rankTabs { margin-bottom: 6px; }
.rank .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .r { color: var(--muted); font: 11px var(--f-mono); }

/* outliers: indicators where the selection stands out */
.outliers { display: grid; gap: 1px; }
.outliers .note { margin: 0 0 6px; }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) 64px 56px 38px; gap: 8px; align-items: center; width: 100%; border: 0; border-radius: 4px;
  background: none; padding: 3px 6px; text-align: left; cursor: pointer; font-size: 12px; }
.orow.wide { grid-template-columns: minmax(0, 1fr) 84px 48px 38px; }   /* changes like "≈+233,3 %" need more room */
.orow .num { white-space: nowrap; }
.orow:hover .n { text-decoration: underline; }
.orow[aria-current="true"] { background: var(--ramp-0); }
/* the finding the teaser showed: lit up for a moment when the column opens from it */
.orow.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 35% { background: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: inset 2px 0 0 var(--accent); } 100% { background: transparent; box-shadow: none; } }
.orow[aria-current="true"] .n { font-weight: 600; color: var(--accent); }
.orow .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow.wide .n { display: flex; align-items: baseline; gap: 6px; min-width: 0; }   /* change tab: name (cut if needed) and its period */
.orow.wide .n .t { overflow: hidden; text-overflow: ellipsis; }
.orow .n .yr { flex: none; font: 10px var(--f-mono); color: var(--muted); }   /* period of a change: 2014–22 */
.orow .num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.orow .ob { position: relative; height: 8px; background: var(--ramp-0); border-radius: 2px; }
.orow[aria-current="true"] .ob { background: var(--surface); }
.orow .ob::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }   /* the average */
.orow .ob i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.orow .or { text-align: right; font: 11px var(--f-mono); color: var(--muted); }


/* "Goes with": the closest links of the indicator on the map, each a link to the connections page */
.related { display: grid; gap: 1px; }
.rrow { display: grid; grid-template-columns: 8px minmax(0, 1fr) 70px 44px; gap: 8px; align-items: center; padding: 5px 4px; border-radius: 4px;
  color: inherit; text-decoration: none; font-size: 13px; }
.rrow .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow:hover { background: var(--ramp-0); }
.rrow:hover .n { text-decoration: underline; }
.rmore { margin-top: 6px; padding: 0 4px; color: var(--accent); font-size: 12px; text-decoration: none; }
.rmore:hover { text-decoration: underline; }

/* ---------- 4. The connections page (zusammenhaenge.html, js/explore.js) ---------- */
/* the two pages, in the top bar of both */
.pages { display: flex; gap: 4px; }
.pages a { padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.pages a:hover { color: var(--ink); background: var(--surface); }
.pages a[aria-current="page"] { color: var(--accent); background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
/* groups in the chart: West/East, and town/middle/country (thirds by population density) */
:root { --grp-west: #8fc1e3; --grp-east: #e3a0d6; --grp-urban: #c3a6f0; --grp-middle: #93a3a2; --grp-rural: #a3d183; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.xatlas { display: grid; grid-template-columns: var(--col-left) minmax(0, 1fr) var(--col-right); gap: 20px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.xside { display: flex; flex-direction: column; }
.xpick { padding: 0 16px 12px; }
.xtabs { margin-top: 0 !important; border-top-left-radius: 8px; border-top-right-radius: 8px; }   /* the tabs at the very top of the card */
.fd.none { visibility: hidden; }   /* keeps rows aligned where there is no dot */
.xrow { display: grid; grid-template-columns: minmax(0, 1fr) 8px minmax(0, .9fr); gap: 8px; align-items: center; width: 100%; padding: 6px 0;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 13px; cursor: pointer; }
.xrow .pl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xrow .xp { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xrow:hover .pl { text-decoration: underline; }
.xrow[aria-current="true"] .pl { color: var(--accent); font-weight: 600; }
.xkey { flex: 1; margin: 0; font-size: 11px; line-height: 1.35; color: var(--muted); }
.xmain { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* the pair: two pickers, swap, colour */
.xhead { display: grid; gap: 8px; }
.xcolour { display: grid; gap: 6px; }   /* below the chart: the colour switch, then the key */
.xpair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.xpair select { min-width: 0; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; font-family: var(--f-body); }
.xpair select:first-child { color: var(--accent); font-weight: 600; }   /* the indicator, as in the list */
.xswap { flex: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 15px; }
.xswap:hover { color: var(--accent); border-color: var(--accent); }
/* colour: the switch, and below it the key */
.xbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.xbar .seg button { padding: 4px 10px; font-size: 12px; }
.xlegend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.xlegend span, .xlk { display: inline-flex; align-items: center; gap: 5px; }
.xlegend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.xlegend.lands { gap: 2px 10px; font-size: 11px; }
.xlk { border: 0; background: none; padding: 1px 0; color: inherit; cursor: pointer; }
.xlk:hover { color: var(--ink); }
.xdot.dim { fill-opacity: .08; }   /* by Land: the other Länder while one is hovered in the key */
/* the chart */
.xchart { position: relative; min-height: 300px; flex: 1; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
#xplot { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#xplot .grid line { stroke: var(--line); }
#xplot .axis text { fill: var(--muted); font: 10px var(--f-mono); }
#xplot .axis path, #xplot .axis line { stroke: var(--line); }
#xplot .axislabel { fill: var(--muted); font-size: 12px; }
.xdot { fill: var(--muted); fill-opacity: .55; stroke: var(--surface); stroke-width: .6; cursor: pointer; }
.xdot:hover { fill-opacity: 1; stroke: var(--ink); stroke-width: 1.2; }
.xdot.faded { fill-opacity: .08; }
.xdot.picked { fill-opacity: .95; stroke: var(--hi); stroke-width: 1.2; }   /* the selected Länder (search, map) */
.xtrend.back, .xstep.back { opacity: .3; }
.xtrend.t-sel { stroke: var(--hi); stroke-width: 3; } .xstep.t-sel { fill: var(--hi); }
.xksel i { background: var(--hi); }
.xksel { color: var(--hi); font-weight: 600; }
.xdot.g-west { fill: var(--grp-west); } .xdot.g-east { fill: var(--grp-east); }
.xdot.g-urban { fill: var(--grp-urban); } .xdot.g-middle { fill: var(--grp-middle); } .xdot.g-rural { fill: var(--grp-rural); }
.xtrend { fill: none; stroke-width: 2.5; stroke: var(--accent); pointer-events: none; }
.xstep { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; pointer-events: none; }
.t-west { stroke: var(--grp-west); } .xstep.t-west { fill: var(--grp-west); }
.t-east { stroke: var(--grp-east); } .xstep.t-east { fill: var(--grp-east); }
.t-urban { stroke: var(--grp-urban); } .xstep.t-urban { fill: var(--grp-urban); }
.t-middle { stroke: var(--grp-middle); } .xstep.t-middle { fill: var(--grp-middle); }
.t-rural { stroke: var(--grp-rural); } .xstep.t-rural { fill: var(--grp-rural); }
.xme { fill: var(--hi); stroke: var(--bg); stroke-width: 1.5; pointer-events: none; }
.xmelabel { fill: var(--hi); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; }
/* under the indicator picked in the list: its strongest links, and those worth a look */
.xdrill { margin: 2px 0 10px; padding: 6px 0 4px 10px; border-left: 2px solid var(--accent); }
.xdrill .eyebrow { margin: 8px 0 2px; }
.xdrill .eyebrow:first-child { margin-top: 0; }
.xprow { display: grid; grid-template-columns: 8px minmax(0, 1fr) 56px 40px; gap: 8px; align-items: center; width: 100%; padding: 3px 4px 3px 0;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 12px; cursor: pointer; }
.xprow .n { display: grid; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xprow .n small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.xprow:hover .n { text-decoration: underline; }
.xprow[aria-current="true"] { background: var(--ramp-0); }
.xprow[aria-current="true"] .n { font-weight: 600; }
.rbar { height: 6px; border-radius: 3px; background: var(--ramp-0); position: relative; }
.rbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.rbar i.up { background: var(--accent); } .rbar i.down { background: var(--warm); }
.rv { text-align: right; font: 12px var(--f-mono); }
.rv.up { color: var(--accent); } .rv.down { color: var(--warm); }
b.rv { font-weight: 500; }
/* what the data shows */
.xfind { padding: 12px 16px 16px; font-size: 13px; line-height: 1.5; }
.xfind p { margin: 6px 0 0; }
.xfhead { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.xlead { font: 500 17px/1.35 var(--f-display); margin: 0 0 4px !important; }
.xf { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.xf h4 { display: flex; align-items: center; gap: 6px; margin: 0; }
.xf.key { margin-inline: -16px; padding: 10px 16px 12px; background: var(--surface-2); border-top-color: var(--muted); }   /* what the story is about */
.xshow { margin-top: 8px; padding: 4px 10px; border: 1px solid var(--accent); border-radius: 6px; background: none; color: var(--accent); font-size: 12px; cursor: pointer; }
.xshow:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.xname { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.xname:hover { color: var(--accent); }
.xtomap { display: inline-block; margin-top: 6px; color: var(--accent); font-size: 12px; }
/* wide screens: one window high; the list and the findings scroll on their own */
@media (min-width: 1200px) {
  .xatlas { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .xside, .xmain, .xfind { min-height: 0; }
  .xpick { flex: 1; overflow-y: auto; }
  .xfind { overflow-y: auto; }
}
@media (max-width: 1199px) {
  .xatlas { grid-template-columns: var(--col-left) minmax(0, 1fr); }
  .xfind { grid-column: 2; }
  .xchart { flex: none; height: 440px; }
}
@media (max-width: 760px) {
  .xatlas { grid-template-columns: minmax(0, 1fr); }
  .xfind { grid-column: auto; }
  /* phones: the page order: the list to pick from (tabs on top), the pair, then what it shows */
  .xchart { height: 360px; }
}

/* ---------- 5. Phones (up to 760 px wide): every phone-only change in one place; nothing here reaches wider screens ---------- */
@media (max-width: 760px) {
  /* top bar: the search box across the full width, on its own line */
  .mast .search { flex: 1 1 100%; margin-left: 0; }
  .search input { width: 100%; }
  /* … and the whole top bar (name, search, Map · Connections) stays at the top while the page scrolls */
  .mast { position: sticky; top: 0; z-index: 15; background: var(--bg); padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  .search ul { width: 100%; max-width: none; max-height: 60vh; }   /* its results: as wide as the box, room for the keyboard */
  .ptabs { top: var(--mast-h, 0px); }   /* the panel's tabs stop just below the top bar (its height: js/search.js) */
  /* connections page: once an indicator is picked, the list folds up to its six tabs (js/explore.js → fold) */
  .xside.folded .xpick > :not(.ptabs), .xside.folded .pbottom { display: none; }
  .xside.folded .xpick { padding-bottom: 0; }
  .xside.folded .ptabs { border-bottom: 0; }
  .profile { overflow: visible; }   /* (clipping would make the tabs stick relative to the card instead of the screen) */
  /* first line: the name on the left, Map · Connections on the right (instead of the tagline); then the search box */
  .mast .tagline { display: none; }
  .mast .pages { order: 0; margin-left: auto; gap: 2px; }
  .mast-row { column-gap: 10px; }
  .mast h1 { font-size: 26px; }
  .pages a { padding: 5px 7px; letter-spacing: .04em; }
  .mast .search { order: 1; flex: 1 1 calc(100% - 118px); min-width: 0; }   /* second line, with the two controls */
  .mast .prefs { order: 2; margin-left: 0; }   /* right of the search box */
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
