/* The Map (map.js, pages_map.py; design/MAP.md): the era strip (with era I's three moments under it), the 1947 /
   Today switch and the Regions switch above the map, the map on a sheet of paper with its zoom buttons in the top right corner, the panel beside it from
   1100 px (below it under that), and the shelf of places beyond it. Everything is built from the tokens in
   theme.css: paper, ink, kesri, brass, the places' colour, the river, one shadow family and the one motion curve, in
   day and night. The land, rivers, regions and lines are SVG and size their strokes by --u (map units per screen
   pixel at the present zoom, set by map.js), so a line is as thick on a phone as on a desktop, zoomed or not; the
   names and pins are HTML over it, in rem, placed by map.js with a translate. */

.map-page .page-main { max-width: 88rem; padding-block: 1.6rem 4rem; }
/* the land's paper tint, shared by the land and the halo that keeps a name readable where it crosses a line */
.map-page {
  --mp-land: color-mix(in srgb, var(--accent) 11%, var(--surface));
  /* zoomed out: the countries' quiet wash and the sea, both quieter than the Punjab's land */
  --mp-wash: color-mix(in srgb, var(--ink) 8%, var(--surface));
  --mp-sea: color-mix(in srgb, var(--river) 17%, var(--surface));
  /* today's cities' local names: no web font is loaded for these scripts, so each device's own (map.js leaves a name
     out, keeping the English, where no font on the device draws it) */
  --mp-arab: "Noto Naskh Arabic", "Geeza Pro", "SF Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --mp-deva: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, sans-serif;
}

/* ---------- heading ---------- */
.mp-head { display: grid; gap: .3rem 2.5rem; margin-bottom: 1.1rem; }
.mp-head h1 { margin: 0; }
.mp-head .lede { margin: 0; max-width: 54rem; font-size: 1.12rem; }
html:lang(pa) .mp-head .lede { font-size: 1.24rem; line-height: 1.7; }
@media (min-width: 1100px) { .mp-head { grid-template-columns: auto minmax(0, 1fr); align-items: end; } }

/* ---------- the era strip: All, then the eight eras as segments ---------- */
.mp-eras { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .4rem; margin: 0 0 1rem; }
@media (min-width: 1100px) { .mp-eras { grid-template-columns: minmax(6rem, .7fr) repeat(8, minmax(0, 1fr)); } }
.mp-era {
  display: flex; flex-direction: column; justify-content: center; gap: .15rem; min-height: var(--tap); padding: .5rem .7rem;
  text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.mp-era:hover { border-color: var(--accent); }
.mp-era[aria-pressed="true"] { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-1); }
.mp-era-span { font: 600 .9rem/1.3 var(--font-sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mp-era-name { font: 600 .95rem/1.3 var(--font-sans); overflow-wrap: break-word; }
:lang(pa) .mp-era-span { font: 600 1rem/1.45 var(--font-gurmukhi-sans); }
:lang(pa) .mp-era-name { font: 600 1.05rem/1.45 var(--font-gurmukhi-sans); }
/* a phone: the same choice as one menu */
.mp-era-pick { display: none; align-items: center; gap: .7rem; margin: 0 0 1rem; }
.mp-era-pick label { font: 600 1rem/1.3 var(--font-sans); }
:lang(pa) .mp-era-pick label { font: 600 1.1rem/1.4 var(--font-gurmukhi-sans); }
.mp-era-pick select { flex: 1; min-width: 0; min-height: var(--tap); padding: 0 .8rem; font: 400 1rem/1.3 var(--font-sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); }
:lang(pa) .mp-era-pick select { font: 400 1.08rem/1.4 var(--font-gurmukhi-sans); }
@media (max-width: 699px) {
  .mp-eras { display: none; }
  .mp-era-pick { display: flex; }
}
/* era I's three moments (the Mughal subahs, the misls, the Sikh Raj), one at a time: a small row under the strip */
.mp-then-pick { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.35rem 0 1rem; }
.mp-then-pick[hidden] { display: none; }
.mp-then-pick button {
  display: grid; justify-items: start; align-content: center; min-height: var(--tap); padding: .3rem .85rem; text-align: left;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.mp-then-pick button:hover { border-color: var(--accent); }
.mp-then-pick button[aria-pressed="true"] { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-1); }
.mp-tp-year { font: 700 .92rem/1.25 var(--font-sans); font-variant-numeric: tabular-nums; }
.mp-tp-name { font: 500 .84rem/1.3 var(--font-sans); color: var(--ink-2); }
:lang(pa) .mp-tp-name { font: 600 .98rem/1.45 var(--font-gurmukhi-sans); }
@media (max-width: 699px) { .mp-then-pick button { flex: 1 1 0; min-width: 0; } }

/* ---------- the map and the panel ---------- */
.mp-body { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1100px) { .mp-body { grid-template-columns: minmax(0, 1fr) minmax(19rem, 23rem); } }
.mp-figure { min-width: 0; margin: 0; }
.mp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 .7rem; }
.mp-borders { flex: none; display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); box-shadow: var(--shadow-1); }
.mp-borders button {
  min-width: 5rem; min-height: var(--tap); padding: 0 1.1rem; font: 600 1rem/1 var(--font-sans); color: var(--ink-2); border-radius: var(--r-pill);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
:lang(pa) .mp-borders button { font: 600 1.1rem/1 var(--font-gurmukhi-sans); }
.mp-borders button:hover { color: var(--ink); }
.mp-borders button[aria-pressed="true"] { color: #1a1512; background: var(--accent); }
/* the Regions switch: one pill, kesri when on, like the pressed half of the borders switch */
.mp-region-switch {
  flex: none; min-height: var(--tap); padding: 0 1.1rem; font: 600 1rem/1 var(--font-sans); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); box-shadow: var(--shadow-1);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
:lang(pa) .mp-region-switch { font: 600 1.1rem/1 var(--font-gurmukhi-sans); }
.mp-region-switch:hover { color: var(--ink); border-color: var(--accent); }
.mp-region-switch[aria-pressed="true"] { color: #1a1512; background: var(--accent); border-color: var(--accent); }
.mp-mode { flex: 1 1 16rem; margin: 0; font: 400 .98rem/1.45 var(--font-sans); color: var(--ink-2); }
:lang(pa) .mp-mode { font: 400 1.1rem/1.6 var(--font-gurmukhi-sans); }

/* the sheet: as large as the column allows while the whole map still fits the screen under the bar */
.mp-stage {
  --u: 1;
  touch-action: pan-x pan-y;   /* at the whole map a finger scrolls the page; map.js takes two-finger pinches */
  position: relative; aspect-ratio: 860 / 790; width: min(100%, calc((100svh - var(--bar) - 7rem) * 860 / 790)); min-width: min(100%, 18rem); margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-2);
}
.mp-stage.is-zoomed { touch-action: none; cursor: grab; }   /* zoomed in, every touch moves the map */
.mp-stage.is-dragging { cursor: grabbing; }
.mp-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: inherit; }
.mp-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
/* the regions: a soft brass wash with a dotted edge, under the rivers that bound them */
.mp-region { fill: color-mix(in srgb, var(--brass) 14%, transparent); stroke: color-mix(in srgb, var(--brass) 70%, transparent);
  stroke-width: calc(1.3px * var(--u)); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0 calc(4px * var(--u)); }
.mp-stage:not(.has-regions) .mp-regions { display: none; }
.mp-land { fill: var(--mp-land); stroke: var(--ink-3); stroke-width: calc(1.2px * var(--u)); stroke-linejoin: round;
  transition: fill var(--dur-2) var(--ease), fill-opacity var(--dur-2) var(--ease), stroke var(--dur-2) var(--ease), stroke-width var(--dur-2) var(--ease); }
/* the other outline stays as a dotted line to compare with (dotted, so it never reads as a river or a border) */
.mp-stage:not(.is-1947) .mp-set-1947 .mp-land, .mp-stage.is-1947 .mp-set-today .mp-land {
  fill-opacity: 0; stroke: var(--ink-2); stroke-width: calc(1.8px * var(--u)); stroke-linecap: round; stroke-dasharray: 0 calc(5px * var(--u)); }
/* the map's history (map-history.json): the period's Punjab lit, in the land's tint with a kesri edge, over today's
   lines, which go quiet (a hairline, no fill; the other outline hidden); where two outlines share the view the earlier
   is a dashed edge over the later one's land (1849 over 1901); PEPSU, of 1948, a brass wash over East Punjab. The
   1947 line is quieter over an era before it. Seats are small squares. */
.mp-then-shape { fill: var(--mp-land); stroke: var(--accent-ink); stroke-width: calc(1.8px * var(--u)); stroke-linejoin: round; }
.mp-then-layer.is-earlier .mp-then-shape { fill: none; stroke-width: calc(1.7px * var(--u)); stroke-dasharray: calc(7px * var(--u)) calc(4px * var(--u)); }
.mp-then-shape.is-later { fill: color-mix(in srgb, var(--brass) 20%, transparent); stroke: var(--brass); stroke-width: calc(1.4px * var(--u)); }
.mp-stage.has-then .mp-set .mp-land { fill-opacity: 0; stroke: var(--ink-3); stroke-opacity: .55; stroke-width: calc(1px * var(--u)); stroke-dasharray: none; }
.mp-stage.has-then:not(.is-1947) .mp-set-1947, .mp-stage.has-then.is-1947 .mp-set-today { display: none; }
.mp-stage.is-early:not(.is-1947) .mp-line-today, .mp-stage.is-early.is-1947 .mp-line-1947 { opacity: .4; }
.mp-stage.is-out .mp-then-shape:not(.is-later) { fill: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.mp-stage.is-out .mp-then-layer.is-earlier .mp-then-shape { fill: none; }
.mp-seat { fill: var(--accent-ink-strong); stroke: var(--surface); stroke-width: calc(1.2px * var(--u)); }
.mp-river-body { fill: var(--river); }
.mp-river-line { fill: none; stroke: var(--river); stroke-width: calc(1.2px * var(--u)); stroke-linecap: round; stroke-linejoin: round; }
.mp-indus { opacity: .75; }
.mp-dot { fill: var(--ink-2); }
.mp-dot.is-sacred { fill: var(--accent-ink); }
.mp-line { fill: none; stroke: var(--thread); stroke-width: calc(2.4px * var(--u)); stroke-dasharray: calc(8px * var(--u)) calc(5px * var(--u)); transition: opacity var(--dur-2) var(--ease); }
.mp-stage:not(.is-1947) .mp-line-1947, .mp-stage.is-1947 .mp-line-today { opacity: 0; }
/* zoomed out (map-countries.json): the countries a wash under the Punjab, the sea a little cooler, borders as
   hairlines, the de facto lines (Kashmir's lines of control, the disputed stretches) dashed; the Punjab's land and
   lines are drawn after them, so they stay on top, lit */
.mp-sea { fill: var(--mp-sea); }
.mp-nations { fill: var(--mp-wash); stroke: var(--mp-wash); stroke-width: calc(1px * var(--u)); stroke-linejoin: round; }
.mp-frontier { fill: none; stroke: var(--ink-3); stroke-opacity: .75; stroke-width: calc(1px * var(--u)); stroke-linejoin: round; stroke-linecap: round; }
.mp-frontier.is-de-facto { stroke-dasharray: calc(4px * var(--u)) calc(3px * var(--u)); }
.mp-stage.is-out:not(.is-1947) .mp-set-today .mp-land { fill: color-mix(in srgb, var(--accent) 20%, var(--surface)); stroke: var(--ink-2); }
/* zoomed in under Today (map-districts.json): today's districts as hairlines, the states' edges a little firmer, and
   the two Punjabs drawn as finely as their districts in place of the simplified outlines */
.mp-district { fill: none; stroke: var(--ink-3); stroke-opacity: .5; stroke-width: calc(.75px * var(--u)); stroke-linejoin: round; }
.mp-state { fill: none; stroke: var(--ink-3); stroke-opacity: .85; stroke-width: calc(1.1px * var(--u)); stroke-linejoin: round; }
.mp-land.mp-fine { fill-rule: evenodd; }
.mp-stage:not(.has-districts) .mp-districts, .mp-fine { display: none; }
.mp-stage.has-districts .mp-fine { display: inline; }
.mp-stage.has-districts :is(.mp-set-today .mp-land, .mp-line-today):not(.mp-fine) { display: none; }
/* today's cities (map-cities.json): a small dot, shown only beside its name; an old city's dot gives way to it */
.mp-town { display: none; fill: var(--ink-2); }
.mp-town.is-on { display: inline; }
.mp-dot.is-gone { display: none; }

/* names on the land: a halo in the land's tint keeps each readable where it crosses a river or a line; map.js
   measures each name once and places it (beside its point, clear of the pin on it, or above or below) */
.mp-labels, .mp-areas, .mp-pins { position: absolute; inset: 0; pointer-events: none; }
.mp-label {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font: 600 .86rem/1.2 var(--font-sans); color: var(--ink-2);
  text-shadow: 0 0 2px var(--mp-land), 0 0 3px var(--mp-land), 0 0 6px var(--mp-land);
}
.mp-label.is-off { display: none; }
.mp-label.is-over { z-index: 2; }   /* above the pins (neither layer is a stacking context) */
.mp-l-river { font: italic 500 1.02rem/1.2 var(--font-body); color: var(--river); }
.mp-l-sacred { font-weight: 700; color: var(--accent-ink-strong); }
.mp-l-country { font: 500 1.35rem/1.1 var(--font-display); letter-spacing: .01em; color: var(--ink-3); }
.mp-l-region { font: italic 400 1.02rem/1.2 var(--font-display); color: var(--ink-3); }
:lang(pa) .mp-label { font: 600 .98rem/1.4 var(--font-gurmukhi-sans); }
:lang(pa) .mp-l-sacred { font-weight: 700; }
:lang(pa) .mp-l-river { font: 600 1.08rem/1.4 var(--font-gurmukhi-sans); }
:lang(pa) .mp-l-country { font: 700 1.4rem/1.4 var(--font-gurmukhi); }
:lang(pa) .mp-l-region { font: 400 1.08rem/1.4 var(--font-gurmukhi); }
/* a region of the Punjab: spaced capitals in brass; a link where the region has a page */
.mp-l-area { font: 700 .8rem/1.2 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
:lang(pa) .mp-l-area { font: 700 1.04rem/1.4 var(--font-gurmukhi-sans); letter-spacing: .03em; text-transform: none; }
a.mp-l-area { pointer-events: auto; text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: .22em; border-radius: var(--r-xs); }
a.mp-l-area:hover { color: var(--accent-ink); text-decoration-style: solid; }
a.mp-l-area:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the outer layers' names: countries (zoomed out), today's districts (small spaced capitals) and today's cities (the
   English or, on the Punjabi page, the Gurmukhi name, then the local one, quieter) */
.mp-l-nation { font: 500 1.02rem/1.1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  text-shadow: 0 0 2px var(--mp-wash), 0 0 3px var(--mp-wash), 0 0 6px var(--mp-wash); }
:lang(pa) .mp-l-nation { font: 700 1.1rem/1.4 var(--font-gurmukhi); letter-spacing: 0; text-transform: none; }
.mp-l-district { font: 600 .62rem/1.2 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
:lang(pa) .mp-l-district { font: 500 .76rem/1.4 var(--font-gurmukhi-sans); letter-spacing: .06em; text-transform: none; }
.mp-l-town { font: 500 .78rem/1.25 var(--font-sans); color: var(--ink-2); }
:lang(pa) .mp-l-town { font: 600 .88rem/1.4 var(--font-gurmukhi-sans); }
.mp-t-name { font-family: inherit; }
.mp-t-local { font-weight: 400; color: var(--ink-3); }
.mp-t-local:lang(pnb), .mp-t-local:lang(ur) { font-family: var(--mp-arab); font-size: 1.06em; }
.mp-t-local:lang(hi) { font-family: var(--mp-deva); }
.mp-t-local:lang(pa) { font-family: var(--font-gurmukhi-sans); }
.mp-t-local:lang(en) { font: 500 .82em/1.2 var(--font-sans); }
/* on the Punjabi page, a name it has only in English keeps the English faces */
:lang(pa) .mp-label [lang="en"] { font-family: var(--font-sans); }
:lang(pa) .mp-l-nation [lang="en"] { font: 500 .92em/1.1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
:lang(pa) .mp-l-district [lang="en"] { font-size: .8em; letter-spacing: .14em; text-transform: uppercase; }
/* the period's names: its shapes' (spaced capitals in kesri; a year where two outlines share the view), the misls'
   where the plate prints them (italic), and its seats (a misl's with the misl, quieter) */
.mp-l-hist { font: 700 .78rem/1.2 var(--font-sans); letter-spacing: .15em; text-transform: uppercase; color: var(--accent-ink); }
.mp-l-hist.is-year { font-size: .9rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
:lang(pa) .mp-l-hist { font: 700 1rem/1.4 var(--font-gurmukhi-sans); letter-spacing: .03em; text-transform: none; }
.mp-l-misl { font: italic 600 .98rem/1.2 var(--font-display); color: var(--accent-ink-strong); }
:lang(pa) .mp-l-misl { font: 700 1.04rem/1.4 var(--font-gurmukhi); }
.mp-l-seat { font: 700 .84rem/1.2 var(--font-sans); color: var(--ink); }
:lang(pa) .mp-l-seat { font: 700 .96rem/1.4 var(--font-gurmukhi-sans); }
.mp-s-of { font-weight: 500; color: var(--ink-2); }
:lang(pa) .mp-l-misl [lang="en"] { font: italic 600 .94em/1.2 var(--font-display); }
/* a place's own name, at a zoom where it has room */
.mp-l-pin { font: 500 .8rem/1.2 var(--font-sans); color: var(--ink-2); }
.mp-l-pin.is-faded { font-weight: 400; color: var(--ink-3); }   /* nothing in the chosen era: quieter, still readable */
:lang(pa) .mp-l-pin { font: 600 .92rem/1.4 var(--font-gurmukhi-sans); }

/* the pins: a disc in the places' colour on a paper ring; a region is a ring, places close together a double ring;
   the button is at least 24 px across, whatever the disc */
.mp-pin {
  pointer-events: auto; position: absolute; left: 0; top: 0; translate: -50% -50%;
  display: grid; place-items: center; width: max(1.5rem, calc(var(--r) * 2 + .4rem)); aspect-ratio: 1; padding: 0; border-radius: 50%;
  transition: opacity var(--dur-2) var(--ease);
}
.mp-pin::before {
  content: ""; width: calc(var(--r) * 2); aspect-ratio: 1; border-radius: 50%; background: var(--k-places);
  box-shadow: 0 0 0 2px var(--surface), var(--shadow-1); transition: box-shadow var(--dur-1) var(--ease), scale var(--dur-1) var(--ease);
}
.mp-pin.is-region::before { background: var(--surface); box-shadow: inset 0 0 0 3px var(--k-places), 0 0 0 2px var(--surface), var(--shadow-1); }
.mp-pin.is-group::before { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--k-places), var(--shadow-1); }
.mp-pin:hover::before { scale: 1.15; }
.mp-pin.is-on { z-index: 1; }
.mp-pin.is-on::before { box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--accent), var(--shadow-1); }
.mp-pin.is-faded { opacity: .25; }
.mp-pin[hidden] { display: none; }
.mp-pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the zoom buttons, in the top right corner (empty land at the whole map): Whole map (while zoomed), − and + */
.mp-zoom { position: absolute; z-index: 4; top: .6rem; right: .6rem; display: flex; gap: .4rem; }
.mp-zoom button {
  display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); padding: 0; font: 600 1.3rem/1 var(--font-sans);
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), translate var(--dur-1) var(--ease);
}
.mp-zoom button:hover:not([aria-disabled="true"]) { border-color: var(--accent); color: var(--accent-ink); translate: 0 -1px; }
.mp-zoom button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mp-zoom button[aria-disabled="true"] { color: var(--ink-3); box-shadow: none; cursor: default; }
.mp-zoom button[hidden] { display: none; }
/* a control reached by Tab stops clear of the sticky top bar */
.mp-svg, .mp-zoom button, .mp-pin, a.mp-l-area { scroll-margin-top: calc(var(--bar) + .75rem); }
.mp-zoom .mp-fit { padding: 0 1rem; font: 600 .95rem/1 var(--font-sans); }
:lang(pa) .mp-zoom .mp-fit { font: 700 1.04rem/1 var(--font-gurmukhi-sans); }
.mp-tip {
  position: absolute; z-index: 3; translate: -50% -100%; display: grid; gap: .1rem; max-width: 16rem; margin: 0; padding: .4rem .75rem;
  font: 400 .92rem/1.35 var(--font-sans); text-align: center; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--shadow-2); pointer-events: none;
}
.mp-tip[hidden], .mp-cards[hidden] { display: none; }
.mp-tip.is-below { translate: -50% 0; }
.mp-tip strong { font-weight: 700; }
.mp-tip span { color: var(--ink-2); }
:lang(pa) .mp-tip { font: 400 1.02rem/1.5 var(--font-gurmukhi-sans); }

/* the key and the note under the map; first, while an era draws its own outlines, a line for each: its swatch, its
   name, its caption and its sources */
.mp-note { margin-top: .8rem; font: 400 .92rem/1.5 var(--font-sans); color: var(--ink-2); }
:lang(pa) .mp-note { font: 400 1.04rem/1.65 var(--font-gurmukhi-sans); }
.mp-then-notes { display: grid; gap: .5rem; margin: 0 0 .9rem; }
.mp-then-notes[hidden] { display: none; }
.mp-note .mp-then-line { max-width: 62rem; margin: 0; font: 400 1rem/1.55 var(--font-sans); color: var(--ink); }
:lang(pa) .mp-note .mp-then-line { font: 400 1.1rem/1.7 var(--font-gurmukhi-sans); }
.mp-then-line strong { font-weight: 700; }
.mp-then-key { display: inline-block; width: 1.5rem; height: .85rem; margin-right: .55rem; vertical-align: -.08em; background: var(--mp-land); border: 2px solid var(--accent-ink); border-radius: 3px; }
.mp-then-key.is-earlier { background: none; border-style: dashed; }
.mp-then-src { font-size: .9em; color: var(--ink-2); }
.mp-then-src [lang="en"] { font-family: var(--font-sans); }
.mp-note p { max-width: 62rem; margin: .5rem 0 0; }
.mp-key { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; margin: 0; padding: 0; list-style: none; }
.mp-key li { display: inline-flex; align-items: center; gap: .5rem; }
.mp-key i { flex: none; display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--k-places); box-shadow: 0 0 0 2px var(--surface); }
.mp-key .mp-key-region { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--k-places); }
.mp-key .mp-key-group { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--k-places); }
.mp-key .mp-key-size { width: 1.15rem; height: 1.15rem; }
.mp-key .mp-key-river { width: 1.5rem; height: 3px; border-radius: 2px; background: var(--river); box-shadow: none; }
.mp-key .mp-key-line { width: 1.7rem; height: 0; border-radius: 0; background: none; box-shadow: none; border-top: 2.5px dashed var(--thread); }
.mp-key .mp-key-area { width: 1.5rem; height: .9rem; border-radius: 3px; background: color-mix(in srgb, var(--brass) 26%, var(--mp-land));
  box-shadow: none; border: 1.5px dotted var(--brass); }
.mp-key .mp-key-then { width: 1.5rem; height: .9rem; border-radius: 3px; background: var(--mp-land); box-shadow: none; border: 2px solid var(--accent-ink); }
.mp-key .mp-key-seat { width: .6rem; height: .6rem; margin-inline: .45rem; border-radius: 1px; background: var(--accent-ink-strong); box-shadow: 0 0 0 1.5px var(--surface); }
.mp-key .mp-key-town { width: .45rem; height: .45rem; margin-inline: .2rem; background: var(--ink-2); box-shadow: none; }
.mp-key :is(.mp-key-district, .mp-key-border, .mp-key-defacto) { width: 1.5rem; height: 0; border-radius: 0; background: none; box-shadow: none; }
.mp-key .mp-key-district { border-top: 1px solid color-mix(in srgb, var(--ink-3) 60%, transparent); }
.mp-key .mp-key-border { border-top: 1.5px solid var(--ink-3); }
.mp-key .mp-key-defacto { border-top: 1.5px dashed var(--ink-3); }
.mp-key li[hidden], .mp-sources[hidden] { display: none; }
.mp-sources { font-size: .86rem; color: var(--ink-2); }
:lang(pa) .mp-sources { font-size: .98rem; }
.mp-note a { color: var(--accent-ink); text-underline-offset: .16em; }

/* the panel: a sheet beside the map that stays in view while the page scrolls, or below the map */
.mp-panel { scroll-margin-top: calc(var(--bar) + 1rem); padding: 1.1rem 1.25rem 1.3rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-2); }
@media (min-width: 1100px) {
  .mp-panel { position: sticky; top: calc(var(--bar) + 1rem); max-height: calc(100svh - var(--bar) - 2rem); overflow-y: auto; overscroll-behavior: contain; }
}
.mp-panel h2 { margin: 0 0 .5rem; font: 500 1.45rem/1.2 var(--font-display); letter-spacing: -.01em; overflow-wrap: break-word; }
html:lang(pa) .mp-panel h2 { font: 700 1.55rem/1.45 var(--font-gurmukhi); letter-spacing: 0; }
.mp-panel h2:focus:not(:focus-visible) { outline: none; }
.mp-how, .mp-count, .mp-none, .mp-era-note { margin: 0 0 .7rem; font: 400 1rem/1.55 var(--font-sans); color: var(--ink-2); }
:lang(pa) :is(.mp-how, .mp-count, .mp-none, .mp-era-note) { font: 400 1.12rem/1.7 var(--font-gurmukhi-sans); }
.mp-p-top { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin: -.4rem -.55rem .1rem 0; }
.mp-back { margin-right: auto; min-height: var(--tap); padding: 0 .4rem; font: 600 .98rem/1.3 var(--font-sans); text-align: left; color: var(--accent-ink); border-radius: var(--r-s); }
:lang(pa) .mp-back { font: 600 1.08rem/1.45 var(--font-gurmukhi-sans); }
.mp-back:hover { text-decoration: underline; text-underline-offset: .16em; }
.mp-x { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); font: 400 1.5rem/1 var(--font-sans); color: var(--ink-2); border-radius: 50%; }
.mp-x:hover { color: var(--ink); background: var(--accent-soft); }
.mp-kind { margin: -.2rem 0 .6rem; font: 600 .95rem/1.4 var(--font-sans); color: var(--ink-2); }
:lang(pa) .mp-kind { font: 600 1.06rem/1.5 var(--font-gurmukhi-sans); }
.mp-open-row { margin: .5rem 0 1.1rem; }
.mp-here { display: flex; align-items: center; gap: .55rem; margin: 0 0 .5rem; font: 600 1.08rem/1.3 var(--font-sans); }
:lang(pa) .mp-here { font: 700 1.18rem/1.5 var(--font-gurmukhi-sans); }
.mp-here-n { padding: .05rem .55rem; font: 600 .9rem/1.4 var(--font-sans); color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-pill); font-variant-numeric: tabular-nums; }
.mp-all { min-height: 2.25rem; padding: .2rem .8rem; }
.mp-events { display: grid; margin: 0; padding: 0; list-style: none; }
.mp-events li + li { border-top: 1px solid var(--line); }
.mp-ev { display: grid; gap: .1rem; padding: .55rem .35rem; color: var(--ink); text-decoration: none; border-radius: var(--r-s); transition: background var(--dur-1) var(--ease); }
.mp-ev:hover { background: var(--accent-soft); }
.mp-ev-date { font: 600 .9rem/1.35 var(--font-sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mp-ev-title { font: 400 1.06rem/1.4 var(--font-body); color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); text-underline-offset: .16em; }
:lang(pa) .mp-ev-date { font: 600 1rem/1.5 var(--font-gurmukhi-sans); }
:lang(pa) .mp-ev-title { font: 400 1.16rem/1.6 var(--font-gurmukhi); }
.mp-choose { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.mp-pick, .mp-card {
  display: flex; justify-content: space-between; align-items: baseline; gap: .3rem .8rem; width: 100%; min-height: var(--tap); padding: .5rem .85rem;
  text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.mp-pick:hover, .mp-card:hover { border-color: var(--accent); }
.mp-pick-name, .mp-card-name { min-width: 0; font: 600 1rem/1.35 var(--font-sans); overflow-wrap: anywhere; }
.mp-pick-n, .mp-card-n { flex: none; font: 400 .92rem/1.35 var(--font-sans); color: var(--ink-2); }
:lang(pa) :is(.mp-pick-name, .mp-card-name) { font: 600 1.1rem/1.5 var(--font-gurmukhi-sans); }
:lang(pa) :is(.mp-pick-n, .mp-card-n) { font: 400 1rem/1.5 var(--font-gurmukhi-sans); }
/* a place with nothing in the chosen era: a dashed edge and lighter type, still readable and still a button */
.mp-pick.is-faded, .mp-card.is-faded { border-style: dashed; background: none; box-shadow: none; }
.mp-pick.is-faded .mp-pick-name, .mp-card.is-faded .mp-card-name { font-weight: 400; color: var(--ink-2); }

/* ---------- the shelf: places beyond the map, and whole countries ---------- */
.mp-shelf { margin-top: 2.2rem; }
.mp-shelf h2 { margin: 0 0 .3rem; }
.mp-shelf h3 { margin: 1.5rem 0 .6rem; font: 600 1.12rem/1.3 var(--font-sans); }
html:lang(pa) .mp-shelf h3 { font: 700 1.24rem/1.5 var(--font-gurmukhi-sans); }
.mp-shelf-lede { margin: 0 0 .9rem; color: var(--ink-2); }
.mp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.mp-card { flex-direction: column; justify-content: center; align-items: flex-start; height: 100%; gap: .1rem; border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.mp-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-1); }
/* the Map's section piece (theme.css .art-head) beside the heading, which keeps its two columns on a wide screen */
.mp-head .art-head-text { display: grid; gap: .3rem 2.5rem; }
@media (min-width: 1100px) { .mp-head .art-head-text { grid-template-columns: auto minmax(0, 1fr); align-items: end; } }
.mp-head .art-head-pic { width: 7.5rem; }
.mp-head > .art-head { grid-column: 1 / -1; }
