/* Community Dashboard
   ------------------------------------------------------------------
   Direction: a statistical abstract, set properly. Reference codes get a
   mono face because that is what they are; prose gets a reading serif;
   the interface gets a neutral grotesk. The signature is the percentile
   rail — ten notches, because deciles are literally ten.
   ------------------------------------------------------------------ */

:root {
  --ink:      #14181d;
  --paper:    #f7f6f2;
  --paper-2:  #eeece5;
  --petrol:   #0f4c5c;
  --petrol-d: #0a3844;
  --ochre:    #c77d30;   /* marks and bars only: 2.8:1 on paper, too faint for text */
  --ochre-ink:#94591a;   /* ochre for figures: 5.2:1 on paper, 4.8:1 on paper-2 */
  --focus:    #0f4c5c;
  --slate:    #5b676e;   /* neutral, biased toward petrol */
  --line:     #d9d5cb;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 76rem;
  --r: 3px;               /* barely-there radius; this is print-adjacent */
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:     #eceae4;
    --paper:   #10141a;
    --paper-2: #171d25;
    --petrol:  #6fb3c4;
    --petrol-d:#8ecad9;
    --ochre:   #e0a05a;
    --ochre-ink:#e0a05a;  /* 8.2:1 on the dark paper, so one ochre does both jobs */
    --focus:   #8ecad9;
    --slate:   #97a3ac;
    --line:    #2a333d;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* short pages (not found, an empty compare) keep the footer at the bottom */
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1 0 auto; }

a { color: var(--petrol); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--petrol-d); }

/* petrol, not ochre: an ochre ring was 2.8:1 on the paper-2 bands, under the
   3:1 a focus indicator needs */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 99; }

/* ---------------------------------------------------------- masthead */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.masthead-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .35rem 1rem; padding: .9rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 14px; height: 14px; flex: none;
  background:
    linear-gradient(var(--petrol) 0 0) 0 0 / 100% 40% no-repeat,
    linear-gradient(var(--ochre)  0 0) 0 100% / 100% 55% no-repeat;
}
.brand-thin { font-weight: 400; color: var(--slate); }
.masthead-nav { display: flex; gap: 1.25rem; font-size: .92rem; }
/* nowrap: without it these labels stack one word per line at 390px and shove
   the brand down the page */
.masthead-nav a { color: var(--slate); text-decoration: none; white-space: nowrap; padding-block: .4rem; }
.masthead-nav a:hover { color: var(--petrol); text-decoration: underline; }

/* ------------------------------------------------------------- hero */

.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.eyebrow {
  margin: 0 0 .9rem;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--slate);
}
.hero-title {
  margin: 0 0 .9rem;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.5vw, 4rem);
  font-weight: 500; line-height: 1.02; letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-sub {
  margin: 0 0 2rem; max-width: 34ch;
  font-family: var(--serif); font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--slate);
}

/* postcode box — the single most important control on the site */
.pc { max-width: 32rem; }
.pc-inline { margin-top: 1.5rem; }
.pc-label {
  display: block; margin-bottom: .4rem;
  font-size: .82rem; font-weight: 500; color: var(--slate);
}
.pc-row { display: flex; gap: .5rem; }
.pc-input {
  flex: 1 1 auto; min-width: 0;
  padding: .8rem .9rem;
  font: inherit; font-family: var(--mono); font-size: 1rem;
  color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: var(--r);
}
.pc-input::placeholder { color: var(--slate); opacity: .8; font-family: var(--sans); }
.pc-go {
  flex: none; padding: .8rem 1.3rem;
  font: inherit; font-weight: 600; cursor: pointer;
  color: var(--paper); background: var(--petrol);
  border: 1.5px solid var(--petrol); border-radius: var(--r);
}
.pc-go:hover { background: var(--petrol-d); border-color: var(--petrol-d); }
.pc-help { margin: .55rem 0 0; font-size: .84rem; color: var(--slate); }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 5vw, 3.5rem);
  margin: 2.75rem 0 0; padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.hero-facts dt {
  font-size: .8rem; color: var(--slate); margin-bottom: .25rem;
}
.hero-facts dd { margin: 0; }
.fig {
  font-family: var(--mono); font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.fig-sub { font-size: .85rem; color: var(--slate); margin-top: .1rem; }
.fact-key .fig { color: var(--ochre-ink); }

/* Desktop: the national figures take the right-hand half of the hero, which was
   otherwise empty. Below 64rem they stay a row under the postcode box. */
@media (min-width: 64rem) {
  .hero-in {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    column-gap: clamp(3rem, 6vw, 6rem); align-items: center;
  }
  .hero-in > * { grid-column: 1; }
  .hero-facts {
    grid-column: 2; grid-row: 1 / span 4;
    flex-direction: column; gap: 1.75rem;
    margin: 0; padding: .5rem 0 .5rem clamp(1.5rem, 3vw, 2.5rem);
    border-top: 0; border-left: 1px solid var(--line);
  }
}

/* ------------------------------------------------------------ bands */

.band { padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 1px solid var(--line); }
.band-alt { background: var(--paper-2); }

.sec-title {
  margin: 0 0 .6rem;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -0.015em;
}
.sec-lede { margin: 0 0 2rem; max-width: 58ch; color: var(--slate); }

/* heading on the left, the list on the right; one column on phones */
.split { display: grid; gap: 1.25rem clamp(2rem, 6vw, 5rem); }
@media (min-width: 56rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
}
.uses { list-style: none; margin: 0; padding: 0; }
.uses li { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.uses li:first-child { padding-top: .25rem; border-top: 0; }
.uses h3 { margin: 0 0 .35rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.uses p { margin: 0 0 .5rem; color: var(--slate); max-width: 52ch; }
.uses a { font-weight: 500; }

/* ------------------------------------------------------- rank lists */

.ranks { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
/* the bar is the row's rule: a hairline under it as well read as two lines */
.rank-list li { padding: .6rem 0 .5rem; }
.rank-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  text-decoration: none; color: var(--ink);
}
.rank-list a:hover .rank-name { text-decoration: underline; }
.rank-name { font-weight: 500; }
.rank-val {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ochre-ink); font-weight: 500; flex: none;
}
.rank-bar {
  display: block; height: 3px; margin-top: .4rem;
  background: linear-gradient(to right, var(--ochre) var(--w), transparent var(--w));
}

/* -------------------------------------------------- profile header */

.profile-head { padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
/* Labelled, not arrowed: a constituency doesn't sit inside a council, and two
   bare "Stockport" links read as a mistake. */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-bottom: 1.1rem; font-size: .88rem; }
.crumbs a { color: var(--ink); text-decoration: none; padding-block: .2rem; }
.crumbs a:hover { color: var(--petrol); text-decoration: underline; }
.crumb-kind {
  margin-right: .3rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--slate);
}

.profile-title {
  margin: 0 0 .5rem;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.05; letter-spacing: -0.025em;
  text-wrap: balance;
}
.code-line { margin: 0 0 1.75rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; }
.code {
  font-family: var(--mono); font-size: .88rem;
  padding: .15rem .45rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper-2);
}
.code-note { font-size: .88rem; color: var(--slate); }

.headline {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 1.5rem 0 0; border-top: 1px solid var(--line);
}
.headline-key { display: flex; align-items: baseline; gap: 1rem; }
.headline-num {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1;
  letter-spacing: -0.03em; color: var(--ochre-ink); font-variant-numeric: tabular-nums;
}
.headline-lbl { font-size: .95rem; color: var(--slate); }
.cmp-link { font-weight: 500; text-decoration: none; }
.cmp-link:hover { text-decoration: underline; }

/* ------------------------------------- SIGNATURE: percentile rails */

.rails { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.rail-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: .5rem;
}
.rail-label { font-weight: 500; }
.rail-value {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 1.05rem; font-weight: 500;
}
.rail-track {
  position: relative; height: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 1px;
}
/* ten notches = ten deciles */
.rail-notches {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent 0, transparent calc(10% - 1px),
    var(--line) calc(10% - 1px), var(--line) 10%
  );
}
.rail-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--p);
  background: var(--petrol); opacity: .18;
}
.rail-pin {
  position: absolute; top: -4px; bottom: -4px; left: var(--p);
  width: 2px; background: var(--petrol);
  transform: translateX(-1px);
}
.rail-pin::after {
  content: ""; position: absolute; top: -3px; left: -3px;
  width: 8px; height: 8px; background: var(--petrol);
  border-radius: 50%;
}
.rail-note { margin: .5rem 0 0; font-size: .88rem; color: var(--slate); }
.rail-note strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ detail grid */

/* Five groups. Desktop: three across, then two wider ones, on a six-track grid,
   so no row has an empty slot and every card in a row is the same height. */
.detail-grid { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dgroup:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .detail-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dgroup { grid-column: span 2; }
  .dgroup:nth-child(n+4) { grid-column: span 3; }
  /* with the job adverts or mosques card there are six: three and three */
  .detail-grid.six .dgroup { grid-column: span 2; }
  /* with both there are seven: four, then three, on a twelve-track grid */
  .detail-grid.seven { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .detail-grid.seven .dgroup { grid-column: span 3; }
  .detail-grid.seven .dgroup:nth-child(n+5) { grid-column: span 4; }
  /* with all three (adverts, young people, organisations) there are eight: four and four */
  .detail-grid.eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-grid.two .dgroup, .detail-grid.three .dgroup, .detail-grid.eight .dgroup { grid-column: auto; }
  .detail-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* a place's detail holds one to three cards (job adverts, young people,
   organisations): a card's width each, not the page's */
.detail-grid.one { display: block; max-width: 30rem; }
@media (min-width: 40rem) {
  .detail-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 61.25rem; }
}
.jobs-card-note { margin: .65rem 0 0; font-size: .82rem; line-height: 1.45; color: var(--slate); }
.src-credit { display: block; margin-top: .35rem; font-size: .82rem; color: var(--slate); }
.dgroup {
  padding: 1.25rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r);
}
.dgroup h3 {
  margin: 0 0 .85rem; padding-bottom: .5rem;
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--slate);
  border-bottom: 1px solid var(--line);
}
.dgroup dl { margin: 0; }
.dgroup dl > div {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: .35rem 0;
}
.dgroup dt { color: var(--slate); font-size: .92rem; }
.dgroup dd {
  margin: 0; font-family: var(--mono); font-weight: 500;
  font-variant-numeric: tabular-nums; flex: none;
}

.caveat { margin: .5rem 0 0; font-size: .88rem; color: var(--slate); max-width: 62ch; }

/* ----------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: .93rem; }
.grid th, .grid td {
  padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.grid thead th {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; color: var(--slate);
}
.grid .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.grid tbody tr:hover { background: var(--paper-2); }
.cmp-table th[scope="row"] { font-weight: 400; white-space: normal; }
/* Phones: all four columns fit, rather than hiding the second area behind a
   sideways scroll nobody knows is there. */
@media (max-width: 40rem) {
  .cmp-table { font-size: .82rem; }
  .cmp-table th, .cmp-table td { padding: .55rem .3rem; }
  .cmp-table thead th { white-space: normal; letter-spacing: .03em; }
}

/* ------------------------------------------------------ compare form */

.cmp-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem;
  margin-top: 1.5rem;
}
.cmp-field { flex: 1 1 14rem; }
.cmp-field label { display: block; margin-bottom: .35rem; font-size: .82rem; color: var(--slate); }
.cmp-field input {
  width: 100%; padding: .75rem .85rem;
  font: inherit; font-family: var(--mono);
  color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: var(--r);
}

/* ---------------------------------------------------------- results */

.results { list-style: none; margin: 0; padding: 0; }
.results li { border-bottom: 1px solid var(--line); }
.results a {
  display: grid; gap: .15rem; padding: .85rem 0;
  text-decoration: none; color: var(--ink);
}
.results a:hover .res-name { text-decoration: underline; }
.res-kind {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--slate);
}
.res-name { font-weight: 500; font-size: 1.05rem; }
.res-meta { font-size: .88rem; color: var(--slate); }

.empty { color: var(--slate); font-size: 1.05rem; }

/* ------------------------------------------------------------ prose */

.prose { max-width: 62ch; }
.prose p { font-family: var(--serif); font-size: 1.05rem; }
.prose .sec-title { margin-top: 2.25rem; }
.src-list { padding-left: 1.1rem; }
.src-list li { margin-bottom: .65rem; }

/* -------------------------------------------------------------- map */

.map-head { padding: clamp(1.5rem, 4vw, 2.25rem) 0 1rem; }
.map-head-in {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem 2rem;
}
.map-head .profile-title { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.map-field { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--slate); }
.map-field select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: var(--r); padding: .5rem .6rem;
}
.map-view { display: inline-flex; gap: 1rem; margin: 0; padding: 0; border: 0; font-size: .9rem; }
.map-view label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; padding-block: .3rem; }
.map-find { display: flex; gap: .4rem; }
.map-find .pc-input { width: 16.5rem; padding: .55rem .7rem; }
.map-find .pc-go { padding: .55rem 1rem; }
.map-status { margin-top: 0; margin-bottom: .75rem; font-size: .92rem; color: var(--ink); }
/* What a search matched, when it isn't one clear place: quiet buttons in a row */
.map-choices { margin-top: -.25rem; margin-bottom: .9rem; font-size: .88rem; }
.map-choices p { margin: 0 0 .4rem; color: var(--slate); }
.map-choices ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.map-choices button {
  min-height: 2.25rem; padding: .3rem .7rem; font: inherit; color: var(--ink); text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px; cursor: pointer;
}
.map-choices button span { color: var(--slate); }
.map-choices button:hover { border-color: var(--petrol); }
.map-choices button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.map-choices button[aria-current="true"] { border-color: var(--petrol); box-shadow: inset 0 -2px 0 var(--petrol); }

/* The legend floats over the map on wide screens and sits under it on phones. */
.map-stage { position: relative; border-top: 1px solid var(--line); }
.map-wrap { position: relative; height: min(76vh, 860px); min-height: 420px; }
/* width/height, not just inset: Mapbox's own stylesheet loads after this one and
   resets the container to position: relative, which left it 0px tall and blank */
.map { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-legend {
  position: absolute; left: 12px; bottom: 32px; z-index: 2; width: 15rem;
  padding: .75rem .9rem; font-size: .8rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
}
.map-legend-title { margin: 0 0 .45rem; font-weight: 600; color: var(--ink); }
.map-legend-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.map-legend-steps li, .map-legend-none {
  display: flex; align-items: center; gap: .5rem; margin: 0;
  font-family: var(--mono); font-size: .74rem; color: var(--slate);
}
.map-legend-none { margin-top: .25rem; }
.map-swatch { width: 1.6rem; height: .8rem; flex: none; border-radius: 2px; }
/* the same hatch the map uses for areas without the figure */
.map-swatch-none {
  border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, #8f9aa1 0 1.5px, transparent 1.5px 4px);
}
.map-level { margin: .55rem 0 0; color: var(--slate); line-height: 1.4; }

.map-tip {
  position: absolute; z-index: 3; pointer-events: none; max-width: 16rem;
  padding: .4rem .55rem; border-radius: var(--r);
  background: var(--ink); color: var(--paper); font-size: .8rem; line-height: 1.35;
  transform: translate(14px, 14px);
}
.map-alt { margin: 1rem auto 1.5rem; font-size: .85rem; color: var(--slate); }

/* The panel: one area's figures, a sheet of the page laid over the map's right
   edge (a sheet from the bottom on phones). It slides in on a click, for
   orientation, and goes away at once: closing needs no explaining. */
/* overflow: the closed panel waits just off the edge, and unclipped it pushed
   the whole page 400px sideways. Closed, it is also inert (map.js): not
   visibility, which the reduced-motion rule below turns into a 0.01ms
   transition, so the panel's heading still counted as hidden when map.js
   focused it and the focus was dropped. */
/* The panel's width follows the window (operator, 2026-11-27: "make side menu
   responsive width"): a third of it, never under 18rem or over 28rem, so a
   laptop window keeps most of its map. In vw, not %: the Mapbox controls move
   aside by the same amount, and in their transform a % would be their own width. */
.map-wrap { --panel-w: clamp(18rem, 32vw, 28rem); --sheet-h: 62%; overflow: hidden; }
/* The panel slides; the body inside it scrolls. Not the panel itself: as a
   scroller over the map, it left the top 72px of the map's canvas unpainted
   under Chrome's software WebGL (SwiftShader, which a blocklisted GPU or a
   virtual machine also gets). Bisected 2026-11-22. */
.map-panel {
  --shade: rgba(20, 24, 29, .45);
  position: absolute; z-index: 4; top: 0; right: 0; bottom: 0; width: var(--panel-w);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 36px -24px var(--shade);
  transform: translateX(100%);
}
.map-panel.is-open {
  transform: none;
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
/* The panel's left edge resizes it (operator, 2026-11-29: "I want to be able to
   scale it"): a strip over the border, its grip a short slate bar (5:1 on
   paper) that turns ink on hover, focus and while dragging. No motion: the
   width follows the pointer. Phones keep the bottom sheet, without it. */
.panel-grip {
  position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; width: 12px;
  cursor: col-resize; touch-action: none;
}
.panel-grip::before {
  content: ""; position: absolute; top: 50%; left: 4px;
  width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--slate);
}
.panel-grip:hover::before, .panel-grip:focus-visible::before,
.map-wrap.resizing .panel-grip::before { background: var(--ink); }
.panel-grip:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.map-wrap.resizing, .map-wrap.resizing * { cursor: col-resize; user-select: none; }
.map-wrap.resizing .mapboxgl-ctrl-top-right,
.map-wrap.resizing .mapboxgl-ctrl-bottom-right { transition: none; }
.panel-bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .75rem .5rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.panel-bar .eyebrow { margin: 0; }
.panel-close {
  display: inline-flex; align-items: center; gap: .45rem; flex: none;
  min-height: 2.75rem; padding: 0 .8rem;
  font: inherit; font-size: .88rem; color: var(--ink);
  background: none; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
}
.panel-close:hover { border-color: var(--ink); }
/* No overscroll-behavior: contain. At the end of the figures the wheel should
   carry on and scroll the page, or on a short screen the panel's last lines
   stay under the fold with no way down (the wheel over the map zooms it). */
.panel-in {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
}
.panel-title {
  margin: 0 0 .5rem; font-family: var(--serif); font-weight: 500;
  font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance;
}
/* focused only so a screen reader starts here; it isn't a control */
.panel-title:focus { outline: none; }
.panel-sub {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
  margin: 0 0 1rem; font-size: .88rem; color: var(--slate);
}
/* The panel's tabs (operator, 2026-11-29): Figures, Jobs, Courses,
   Organisations. Plain words; the chosen one in ink over a petrol rule. They
   stay in view while the panel scrolls, and scroll sideways if the panel is
   dragged narrower than their words. No motion: a tab just shows its part. */
/* top: minus .panel-in's top padding, which sticky measures from: at 0 they
   stuck 16px under the panel's bar, with the scrolling text showing above. */
.panel-tabs {
  position: sticky; top: -1rem; z-index: 1;
  display: flex; gap: .15rem; margin: 0 0 1rem;
  background: var(--paper); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.panel-tabs::-webkit-scrollbar { display: none; }
.panel-tabs [role="tab"] {
  flex: none; min-height: 2.75rem; padding: .5rem .65rem; margin-bottom: -1px;
  font: inherit; font-size: .88rem; color: var(--slate); white-space: nowrap; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent;
}
.panel-tabs [role="tab"]:hover { color: var(--ink); }
.panel-tabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--petrol); }
.panel-tabs [role="tab"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.panel-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.panel-tab > .detail-grid { margin-bottom: 1.25rem; }
.panel-headline {
  display: flex; align-items: baseline; gap: .8rem;
  margin: 0; padding: 1rem 0; border-block: 1px solid var(--line);
}
.map-panel .headline-num { font-size: 2.6rem; }
.panel-sec {
  margin: 1.6rem 0 .2rem; font-family: var(--mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--slate);
}
.panel-lede { margin: 0 0 1rem; font-size: .88rem; color: var(--slate); }
.map-panel .rails { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.map-panel .detail-grid { grid-template-columns: minmax(0, 1fr); gap: .75rem; max-width: none; }
.map-panel .dgroup { padding: .9rem 1rem; }
/* one column whatever the page grid says: :nth-child(n) outranks the six- and
   seven-card spans, which would otherwise open phantom columns in the panel */
.map-panel .detail-grid > .dgroup:nth-child(n) { grid-column: auto; }
.map-panel .caveat { margin-top: 1.25rem; }
.panel-links {
  display: flex; flex-wrap: wrap; gap: .6rem 1.25rem;
  margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line);
}
.panel-go { font-weight: 600; }
/* Jobs and courses near here, set as one ledger like the detail tables: the
   date in mono down the left, what and who to its right, hairlines between.
   A date may wrap ("Any time", "5 Jan 2027") rather than widen the column. */
.panel-near { margin-top: .25rem; }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ledger li {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); column-gap: .75rem;
  padding: .65rem 0; border-bottom: 1px solid var(--line);
}
.ledger-date {
  grid-row: 1 / span 2; padding-top: .15rem;
  font-family: var(--mono); font-size: .76rem; line-height: 1.35; font-variant-numeric: tabular-nums;
  color: var(--slate);
}
/* min-height: a one-line link was 22.9px tall, under WCAG 2.2's 24px target */
.ledger a { color: var(--ink); font-weight: 500; line-height: 1.35; text-decoration: none; min-height: 1.5rem; }
.ledger a:hover { color: var(--petrol); text-decoration: underline; }
/* off to the advert's or the course's own site */
.ledger a::after { content: "↗" / ""; margin-left: .25rem; font-size: .8em; color: var(--slate); }
.ledger-meta { font-size: .84rem; color: var(--slate); }
.ledger-foot { margin: .9rem 0 0; }
.ledger-show {
  font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer;
  min-height: 2.5rem; padding: 0 .8rem;
  background: none; border: 1px solid var(--line); border-radius: var(--r);
}
.ledger-show:hover { border-color: var(--ink); }

/* The map's pin filters (job adverts, courses) and their keys. The ochre is for
   marks only (--ochre), the same colour as the dot in the brand: a filled dot
   for a job advert, a ring for a course, so the two can share the map. */
.map-pins { display: inline-flex; align-items: center; gap: .6rem; margin: 0; padding: 0; border: 0; font-size: .9rem; }
.map-check { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; padding-block: .3rem; }
.map-pins select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: var(--r); padding: .45rem .55rem;
}
.map-pins select:disabled { opacity: .55; }
.map-pin {
  width: .8rem; height: .8rem; flex: none; border-radius: 50%;
  background: var(--ochre); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--line);
}
.map-pin-ring { background: var(--paper); box-shadow: inset 0 0 0 2.5px var(--ochre); }
/* a mosque: a paper dot in an ink ring, so it reads beside both ochre marks and
   on both ends of the shading */
.map-pin-ink { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
/* a ledger with no date column (a pin's mosques) */
.ledger-plain li { grid-template-columns: minmax(0, 1fr); }
.map-legend-pins { margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.panel-wait { margin: 0; color: var(--slate); font-size: .92rem; }

/* Mapbox's zoom buttons and credits move aside with the panel, so they stay in view. */
.map-wrap.panel-open .mapboxgl-ctrl-top-right,
.map-wrap.panel-open .mapboxgl-ctrl-bottom-right {
  transform: translateX(calc(-1 * var(--panel-w)));
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.map-wrap.no-slide .map-panel,
.map-wrap.no-slide .mapboxgl-ctrl-top-right,
.map-wrap.no-slide .mapboxgl-ctrl-bottom-right { transition: none; }

@media (max-width: 40rem) {
  .map-controls, .map-find { width: 100%; }
  .map-find .pc-input { flex: 1; width: auto; }
  .map-wrap { height: 66vh; min-height: 360px; }
  .map-legend {
    position: static; width: auto; border: 0; border-top: 1px solid var(--line);
    border-radius: 0; padding: .9rem max(.75rem, calc((100% - var(--wrap)) / 2));
  }
  /* a sheet from the bottom, leaving the chosen area in view above it */
  .map-panel {
    top: auto; left: 0; width: auto; height: var(--sheet-h);
    border-left: 0; border-top: 1px solid var(--line); border-radius: 10px 10px 0 0;
    box-shadow: 0 -18px 36px -24px var(--shade);
    transform: translateY(100%);
  }
  .panel-bar { padding-left: 1rem; }
  .panel-in { padding: .9rem 1rem 1.25rem; }
  .panel-tabs { top: -.9rem; }
  .panel-grip { display: none; }
  .map-wrap.panel-open .mapboxgl-ctrl-top-right { transform: none; }
  .map-wrap.panel-open .mapboxgl-ctrl-bottom-right,
  .map-wrap.panel-open .mapboxgl-ctrl-bottom-left { transform: none; bottom: var(--sheet-h); }
}

@media (prefers-color-scheme: dark) {
  .map-swatch-none { background: repeating-linear-gradient(135deg, #76828b 0 1.5px, transparent 1.5px 4px); }
  .map-panel { --shade: rgba(0, 0, 0, .7); }
}

/* ----------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--line); padding: 2rem 0; margin-top: 1rem; }
.foot-in {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: baseline; justify-content: space-between;
}
.foot-note { margin: 0; max-width: 52ch; font-size: .88rem; color: var(--slate); }
.foot-nav { display: flex; gap: 1.25rem; font-size: .88rem; }

/* Narrow phones: the masthead is the widest fixed row on the page, and with
   nowrap links it was pushing the body into a horizontal scroll. Shrink it to
   fit rather than letting the page scroll sideways. */
@media (max-width: 26rem) {
  .wrap { width: min(100% - 1.5rem, var(--wrap)); }
  .brand { font-size: 1rem; gap: .4rem; }
  /* three links since the map: on a phone the nav drops onto its own line under
     the brand (flex-wrap above) rather than scrolling sideways */
  .masthead-nav { gap: .7rem; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
