/* UK Ministers — design tokens.
   Warm paper palette; light is the default, dark follows the system unless the toggle sets data-theme.
   Chart series + party colours are validated for colour-blind separation in each mode (dataviz validator);
   dark values are their own steps, not a flip. Party hues (blue/red/amber) never double as series colours. */
:root {
  color-scheme: light;
  --surface-0: #faf6ef;
  --surface-1: #fffcf7;
  --surface-2: #f2ece1;
  --surface-3: #e9e1d3;
  --border: #e6ddcd;
  --grid: #eee7da;
  --text-primary: #231e17;
  --text-secondary: #5f574b;
  --text-muted: #8c8374;
  --accent: #b5532b;
  --accent-soft: #f6e3d8;
  --series-a: #b5532b;
  --series-b: #2f7d77;
  --con: #2a78d6;
  --lab: #e34948;
  --ld: #eda100;
  --other: #9a9284;
  --band: rgba(90, 60, 20, 0.045);
  --warning: #b45309;
  --up: #2f7d77;
  --shadow: 0 1px 2px rgba(60, 40, 10, .04), 0 4px 16px rgba(60, 40, 10, .05);
  --shadow-hover: 0 2px 4px rgba(60, 40, 10, .06), 0 12px 32px rgba(60, 40, 10, .09);

  --radius: 16px;
  --radius-sm: 10px;
  --wide: 1200px;
  --prose: 700px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-0: #16130f; --surface-1: #1e1a15; --surface-2: #28231c; --surface-3: #332d24; --border: #38322a; --grid: #2d2821;
    --text-primary: #f5efe4; --text-secondary: #cbc3b3; --text-muted: #978e7e;
    --accent: #e8905f; --accent-soft: #3a2619; --series-a: #e8905f; --series-b: #5fb3ab;
    --con: #3987e5; --lab: #e66767; --ld: #c98500; --other: #80786b; --band: rgba(255, 230, 190, 0.05); --warning: #f59e0b; --up: #5fb3ab;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 8px 28px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #16130f; --surface-1: #1e1a15; --surface-2: #28231c; --surface-3: #332d24; --border: #38322a; --grid: #2d2821;
  --text-primary: #f5efe4; --text-secondary: #cbc3b3; --text-muted: #978e7e;
  --accent: #e8905f; --accent-soft: #3a2619; --series-a: #e8905f; --series-b: #5fb3ab;
  --con: #3987e5; --lab: #e66767; --ld: #c98500; --other: #80786b; --band: rgba(255, 230, 190, 0.05); --warning: #f59e0b; --up: #5fb3ab;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 8px 28px rgba(0, 0, 0, .45);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--surface-0);
  color: var(--text-primary);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.prose-wrap { max-width: var(--prose); margin: 0 auto; }

/* ---------- type ---------- */
h1, h2, h3 { text-wrap: balance; }
h1 { font: 500 clamp(2.25rem, 1.4rem + 3.6vw, 4rem)/1.04 var(--serif); letter-spacing: -0.025em; margin: 0 0 18px; }
h2 { font: 500 clamp(1.5rem, 1.2rem + 1.2vw, 2rem)/1.15 var(--serif); letter-spacing: -0.015em; margin: 0 0 10px; }
h3 { font: 600 1rem/1.35 var(--font); margin: 0 0 4px; }
p { text-wrap: pretty; }
.lede { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); line-height: 1.55; color: var(--text-secondary); max-width: 640px; margin: 0; }
.kicker { text-transform: uppercase; font-size: 12px; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- chrome ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface-0) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.top-inner { height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 650; letter-spacing: -0.01em; text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: var(--surface-1); }
.brand-mark svg { width: 22px; height: 22px; }
.nav { display: flex; gap: 2px; flex: 1; align-items: center; }
.nav a, .icon-btn { text-decoration: none; color: var(--text-secondary); padding: 7px 12px; border-radius: 999px; font-size: 15px; }
.nav a:hover, .icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.nav a[aria-current="page"] { color: var(--text-primary); background: var(--surface-2); font-weight: 500; }
.nav .spacer { flex: 1; }
.icon-btn { background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px; font: inherit; }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .sun { display: none; }
  :root:not([data-theme]) .theme-toggle .moon { display: block; }
}

main { padding-bottom: 96px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); font-size: 14px; }
.site-footer .wrap { padding-top: 40px; padding-bottom: 48px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 10px; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 15px var(--font); padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--text-muted); }
.btn.primary { background: var(--text-primary); color: var(--surface-0); border-color: var(--text-primary); }
.btn.primary:hover { opacity: .9; }
.btn svg { width: 16px; height: 16px; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.search input {
  width: 100%; font: 16px var(--font); color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 999px; padding: 14px 18px 14px 46px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select.pill {
  appearance: none; -webkit-appearance: none; font: 14px var(--font); color: var(--text-primary); background: var(--surface-1)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c8374' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 34px 8px 14px; cursor: pointer; max-width: 260px;
  field-sizing: content; text-overflow: ellipsis;
}
select.pill.active { border-color: var(--accent); background-color: var(--accent-soft); }

/* ---------- home ---------- */
.hero { padding-block: clamp(48px, 9vw, 112px) clamp(32px, 5vw, 56px); }
.hero h1 { max-width: 14ch; margin-bottom: 28px; }
.hero-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--surface-1); display: grid; place-items: center; margin-bottom: 28px; box-shadow: var(--shadow); }
.hero-mark svg { width: 40px; height: 40px; }
.section-title { margin-bottom: 20px; }
.hero .lede { margin-bottom: 32px; }
.hero-search { display: flex; gap: 10px; flex-wrap: wrap; max-width: 620px; }
.hero-search .search { flex: 1 1 320px; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: clamp(40px, 6vw, 64px); }
.stat-strip > div { padding: 20px 20px 20px 0; }
.stat-strip > div + div { padding-left: 20px; border-left: 1px solid var(--border); }
.stat-strip .n { font: 500 clamp(1.8rem, 1.3rem + 2vw, 2.75rem)/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.stat-strip .l { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

.section { padding-top: clamp(56px, 8vw, 96px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--text-secondary); max-width: 560px; }

/* then vs now */
.compare { display: flex; flex-wrap: wrap; gap: 12px; }
.compare > * { flex: 1 1 190px; }
.compare-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.compare-tile .label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.compare-tile .vals { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.compare-tile .then { font: 500 1.4rem/1 var(--serif); color: var(--text-muted); }
.compare-tile .arrow { color: var(--text-muted); }
.compare-tile .now { font: 500 2.4rem/1 var(--serif); letter-spacing: -.02em; }
.compare-tile .bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 16px; overflow: hidden; }
.compare-tile .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.compare-tile .bar i.t { background: var(--text-muted); opacity: .35; }
.compare-tile .bar i.n { background: var(--accent); height: 6px; }
.compare-tile .yrs { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* insight cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.card-link {
  position: relative; display: flex; flex-direction: column; text-decoration: none; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 24px 16px; box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s; min-width: 0;
}
.card-link:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: color-mix(in srgb, var(--text-muted) 50%, var(--border)); }
.card-link .kicker { margin-bottom: 8px; }
.card-link h3 { font: 500 1.4rem/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 10px; }
.card-link .big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.card-link .big .n { font: 500 2.6rem/1 var(--serif); letter-spacing: -.02em; color: var(--accent); font-variant-numeric: lining-nums; }
.card-link .dek { color: var(--text-secondary); font-size: 15px; margin: 6px 0 16px; line-height: 1.45; max-width: 36ch; }
.card-link .chart { margin-top: auto; pointer-events: none; }
.card-link .go { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-top: 8px; }
.card-link:hover .go { color: var(--accent); }
.card-link .go svg { width: 14px; height: 14px; transition: transform .2s; }
.card-link:hover .go svg { transform: translateX(3px); }
.card-link.feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; padding: 32px; }
.card-link.feature h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); }
.card-link.feature .big .n { font-size: clamp(3rem, 2rem + 3vw, 4.5rem); }

.group-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin: 40px 0 14px; display: flex; align-items: center; gap: 12px; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.cta { margin-top: clamp(56px, 8vw, 96px); background: var(--text-primary); color: var(--surface-0); border-radius: calc(var(--radius) + 8px); padding: clamp(28px, 5vw, 48px);
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: center; }
.cta h2 { margin: 0; }
.cta h2 { color: inherit; }
.cta p { color: color-mix(in srgb, var(--surface-0) 75%, transparent); margin: 0; }
.cta .search input { background: var(--surface-0); }
.cta .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cta .chips a { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--surface-0) 25%, transparent); text-decoration: none; color: inherit; }
.cta .chips a:hover { background: color-mix(in srgb, var(--surface-0) 12%, transparent); }

/* ---------- article ---------- */
.article-head { padding: clamp(32px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.article-head h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); max-width: 20ch; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-secondary); text-decoration: none; margin-bottom: 28px; }
.crumb:hover { color: var(--text-primary); }
.crumb svg { width: 14px; height: 14px; }
.keynums { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 8px 0 8px; }
.keynums > div { padding: 18px 18px 18px 0; }
.keynums > div + div { padding-left: 18px; border-left: 1px solid var(--border); }
.keynums .n { font: 500 2.25rem/1 var(--serif); letter-spacing: -.02em; color: var(--accent); font-variant-numeric: lining-nums; }
.keynums .l { font-size: 14px; color: var(--text-secondary); margin-top: 8px; line-height: 1.4; }

.prose { max-width: var(--prose); }
.prose p { font-size: 1.075rem; line-height: 1.7; color: var(--text-secondary); margin: 1.1em 0; }
.prose p strong { color: var(--text-primary); font-weight: 600; }
.prose h2 { margin-top: 56px; }

.figure { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); margin: 32px 0; box-shadow: var(--shadow); min-width: 0; }
.figure.bleed { margin-left: calc(-1 * clamp(0px, (100vw - var(--prose)) / 2 - var(--gutter), 120px)); margin-right: calc(-1 * clamp(0px, (100vw - var(--prose)) / 2 - var(--gutter), 120px)); }
.figure-title { font: 500 1.3rem/1.3 var(--serif); letter-spacing: -.005em; margin: 0 0 4px; }
.figure-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.figure-note { font-size: 13px; color: var(--text-muted); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--grid); }
.figs-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin: 32px 0; }
.figs-2 .figure { margin: 0; }

.more { margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--border); }
.more .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.more .card-link { padding: 18px; }
.more .card-link h3 { font-size: 1.15rem; margin: 0 0 6px; }

/* ---------- charts ---------- */
.chart { width: 100%; min-height: 60px; }
.chart svg { overflow: visible; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.line-key { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.dot-key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 2px solid currentColor; }
details.data { margin-top: 12px; font-size: 13px; color: var(--text-muted); }
details.data summary { cursor: pointer; padding: 4px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.data summary::-webkit-details-marker { display: none; }
details.data summary::before { content: "▸"; transition: transform .15s; }
details.data[open] summary::before { transform: rotate(90deg); }
details.data table { margin-top: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--surface-2); }

/* ranked list (leaderboards) */
.ranked { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.ranked li { counter-increment: r; display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--grid); }
.ranked li:last-child { border-bottom: 0; }
.ranked li::before { content: counter(r); color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ranked .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.ranked .s { display: block; font-size: 13px; color: var(--text-muted); }
.ranked a { text-decoration: none; }
.ranked a:hover { text-decoration: underline; }

/* party chip: colour sits in the dot, text stays in text tokens */
.party { display: inline-flex; align-items: center; gap: 7px; }
.party::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--other); flex: none; }
.party[data-party="Conservative"]::before { background: var(--con); }
.party[data-party="Labour"]::before { background: var(--lab); }
.party[data-party="Liberal Democrat"]::before { background: var(--ld); }
.tag { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; }
.tag.warn { color: var(--warning); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- directory ---------- */
.dir-head { padding: clamp(28px, 5vw, 56px) 0 16px; }
.dir-head h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); }
.dir-tools { position: sticky; top: 60px; z-index: 10; background: color-mix(in srgb, var(--surface-0) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 12px 0; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.dir-tools .row { display: flex; gap: 8px; align-items: center; }
.dir-tools .search { flex: 1; }
.dir-tools .search input { padding-top: 11px; padding-bottom: 11px; box-shadow: none; }
.filter-row { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row select { flex: none; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; font-size: 14px; color: var(--text-muted); }
.result-bar button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

.mlist { display: grid; }
.mrow, .mhead { display: grid; grid-template-columns: minmax(200px, 2.2fr) 1.4fr 70px 70px 1.4fr 1.4fr 110px; gap: 16px; align-items: center; padding: 12px 14px; }
.mhead { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); padding-top: 6px; padding-bottom: 10px; }
.mhead button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.mhead button:hover { color: var(--text-primary); }
.mhead button[aria-sort]::after { content: "↓"; color: var(--text-primary); }
.mhead button[aria-sort="ascending"]::after { content: "↑"; }
.mhead .num, .mrow .num { text-align: right; font-variant-numeric: tabular-nums; }
.mrow { text-decoration: none; border-bottom: 1px solid var(--grid); border-radius: var(--radius-sm); font-size: 14.5px; }
.mrow:hover { background: var(--surface-1); box-shadow: var(--shadow); border-bottom-color: transparent; }
.mrow .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text-muted); overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mrow .name { font-weight: 600; line-height: 1.3; }
.mrow .sub { font-size: 13px; color: var(--text-muted); }
.mrow .clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.mrow .lbl { display: none; }
.empty { text-align: center; padding: 64px 0; color: var(--text-muted); }
.load-more { display: flex; justify-content: center; margin-top: 24px; }

/* ---------- minister profile ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 3vw, 36px); align-items: center; padding: clamp(24px, 5vw, 56px) 0 clamp(24px, 4vw, 40px); }
.portrait { width: clamp(96px, 16vw, 152px); aspect-ratio: 1; border-radius: 24px; object-fit: cover; object-position: top; background: var(--surface-2); box-shadow: var(--shadow); }
.profile-head:not(:has(.portrait)) { grid-template-columns: 1fr; }
.profile-head h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.75rem); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .tag { font-size: 13px; padding: 4px 12px; background: var(--surface-1); border: 1px solid var(--border); }
.chips .tag.accent { border-color: transparent; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.fact .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.fact .value { font: 500 1.35rem/1.25 var(--serif); margin-top: 8px; overflow-wrap: anywhere; }
.fact .sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.fact .meter { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 12px; position: relative; overflow: hidden; }
.fact .meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }

.compare-bar { display: grid; grid-template-columns: 110px 1fr 54px; gap: 10px; align-items: center; font-size: 13.5px; margin-top: 10px; }
.compare-bar .track { height: 10px; background: var(--surface-2); border-radius: 5px; position: relative; overflow: hidden; }
.compare-bar .track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--accent); }
.compare-bar.ref .track i { background: var(--text-muted); opacity: .6; }
.compare-bar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }


/* profile: sections, cards */
.section-nav { position: sticky; top: 60px; z-index: 9; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; margin-bottom: 8px;
  background: color-mix(in srgb, var(--surface-0) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { text-decoration: none; font-size: 14px; color: var(--text-secondary); padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.section-nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.pblock { padding-top: 40px; scroll-margin-top: 120px; }
.pblock > h2 { margin-bottom: 18px; }
.group-title { font: 600 13px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); margin: 28px 0 12px; display: flex; gap: 8px; align-items: baseline; }
.group-title .muted { font-weight: 500; letter-spacing: 0; text-transform: none; }
.note { font-size: 13px; color: var(--text-muted); margin: 14px 0 0; }
.ico { width: 13px; height: 13px; flex: none; }
.tag.cabinet { background: var(--accent-soft); color: var(--accent); gap: 5px; font-weight: 600; }
.tag.link { text-decoration: none; }
.tag.link:hover { border-color: var(--text-muted); }

.jcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.jcard { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; box-shadow: var(--shadow); }
.jtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jyears { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.jrole { font-weight: 600; line-height: 1.35; }
.jorg { color: var(--text-secondary); font-size: 14.5px; line-height: 1.4; }
.jtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.src { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--text-muted); flex: none; }
.src:hover { background: var(--surface-2); color: var(--accent); }
.src svg { width: 14px; height: 14px; }

/* one row per prime minister: PM on the left, their appointments on the right (no ragged grid rows) */
.eras { display: flex; flex-direction: column; gap: 12px; }
.era { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 4px 24px; }
.era-head { display: flex; gap: 12px; align-items: center; align-self: start; padding: 8px 0; }
.era-pm { font-weight: 600; }
.era .sub, .vlist .sub, .entries .sub { font-size: 13px; color: var(--text-muted); }
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { padding: 10px 0 10px 14px; border-left: 3px solid transparent; border-bottom: 1px solid var(--grid); }
.posts li:first-child { padding-top: 6px; }
.posts li:last-child { border-bottom: 0; padding-bottom: 4px; }
.posts li.cab { border-left-color: var(--accent); }
.pname { font-weight: 500; line-height: 1.35; }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow); }
.tile .n { font: 500 2rem/1 var(--serif); color: var(--accent); font-variant-numeric: lining-nums; }
.tile .l { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.4; }
.card-plain { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-top: 12px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-top: 2px; }
.grid2 .figure { margin: 12px 0 0; }
.vlist { list-style: none; padding: 0; margin: 0; }
.vlist li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: 14.5px; line-height: 1.4; }
.vlist li:last-child { border-bottom: 0; }
.vlist a { text-decoration: none; }
.vlist a:hover { text-decoration: underline; }
.vote { font-size: 11.5px; font-weight: 700; text-align: center; border-radius: 6px; padding: 3px 0; text-transform: uppercase; letter-spacing: .04em; }
.vote.aye { background: color-mix(in srgb, var(--series-b) 18%, transparent); color: var(--series-b); }
.vote.no { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* masonry: each card stacks directly under the one above it, so short cards leave no holes */
.igroups { columns: 300px; column-gap: 12px; }
.igroups > .igroup { break-inside: avoid; margin-bottom: 12px; }
.igroup { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.ihead { display: flex; justify-content: space-between; font-weight: 600; }
.itotal { font: 500 1.8rem/1.1 var(--serif); margin-top: 6px; }
.split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin-top: 12px; }
.split i { display: block; min-width: 3px; }
.split-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; }
.split-key span { display: inline-flex; align-items: center; gap: 5px; }
.split-key i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.payers { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13.5px; }
.payers li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--grid); }
.payers .v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.entries { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13.5px; color: var(--text-secondary); max-height: 320px; overflow-y: auto; }
.entries li { padding: 6px 0; border-top: 1px solid var(--grid); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .era { grid-template-columns: 1fr; }
  .era-head { padding: 0 0 12px; border-bottom: 1px solid var(--grid); margin-bottom: 4px; }
  .card-link.feature { grid-template-columns: 1fr; gap: 12px; padding: 24px; }
  .cta { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap > :first-child { grid-column: 1 / -1; }
  .mrow, .mhead { grid-template-columns: minmax(180px, 2fr) 1.3fr 60px 60px 1.3fr 100px; }
  .mrow > :nth-child(6), .mhead > :nth-child(6) { display: none; }
}
@media (max-width: 720px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .keynums > div { padding: 16px 0 !important; border-left: 0 !important; }
  .keynums > div + div { border-top: 1px solid var(--border); }
  .nav a { padding: 7px 10px; }
  .settings-label { display: none; }
  .top-inner { gap: 12px; }
  .mhead { display: none; }
  .mlist { gap: 10px; }
  .mrow { grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
  .mrow > :nth-child(6) { display: block; }
  .mrow .who { grid-column: 1 / -1; }
  .mrow .num { text-align: left; }
  .mrow .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
  .mrow > div { min-width: 0; }
  .figure.bleed { margin-left: 0; margin-right: 0; }
  .profile-head { grid-template-columns: 1fr; }
  .compare-tile .now { font-size: 2rem; }
  .fact { padding: 14px 16px; }
  .fact .value { font-size: 1.15rem; }
}
@media (max-width: 420px) {
  .brand-text { display: none; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

.brand-cc { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-secondary); margin-left: -4px; }
