/* Population & Health Inequalities dashboard.
 *
 * Calculator #8. The monolith's `<style>` block in `website/population_health.html` at commit cb02cf0, class for class
 * (`ph-*` and `phx-*`), because the script that styles the page by class name is the source's. Additions are marked
 * "added": a class for every `style=""` attribute the source's markup carried (the policy admits none), the Lucide icon,
 * the coverage warnings (owner decision of 2026-10-19), the sources and attribution lines, and narrow-screen rules.
 */
  :root { --ph-border:#e6ebf1; --ph-ink:#0f172a; --ph-mut:#64748b; --ph-soft:#94a3b8;
          --ph-theme:#0d5bb8; --ph-navy:#0b2545; --ph-blue-soft:#eaf2fc; }
  .ph-wrap { max-width:none; margin:0; padding:0 0 48px; }   /* the shell's .content-inner (1560px, 24px padding) is the page width */
  .ph-title { font-size:28px; font-weight:800; color:var(--ph-ink); margin:0 0 10px; }
  .ph-lead { color:var(--ph-mut); font-size:15px; margin:0 0 16px; max-width:840px; }
  .ph-attr { background:#f6f8fc; border:1px solid var(--ph-border); border-left:3px solid var(--ph-theme); border-radius:8px; padding:13px 17px; font-size:13px; color:#4b5563; margin-bottom:18px; }
  .ph-card { background:#fff; border:1px solid var(--ph-border); border-radius:12px; padding:20px; margin-bottom:18px; box-shadow:0 1px 2px rgba(15,23,42,.04); }
  .ph-h { font-size:16px; font-weight:800; color:var(--ph-ink); margin:0 0 3px; }
  .ph-sub { font-size:13px; color:var(--ph-mut); margin:0 0 14px; }
  .ph-ctl-label { font-size:13px; font-weight:700; color:var(--ph-ink); }
  .ph-ctl-note { font-size:13px; color:var(--ph-mut); margin:12px 0 0; max-width:820px; }
  .ph-controls { display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
  .ph-modes { display:inline-flex; background:#eef2f7; border-radius:9px; padding:3px; }
  .ph-mode { border:none; background:none; padding:8px 18px; font-size:13px; font-weight:700; color:var(--ph-mut); border-radius:7px; cursor:pointer; }
  .ph-mode.active { background:#fff; color:var(--ph-ink); box-shadow:0 1px 2px rgba(15,23,42,.12); }
  .ph-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
  .ph-tab { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--ph-border); background:#fff; color:var(--ph-mut); padding:9px 15px; border-radius:9px; font-size:13px; font-weight:700; cursor:pointer; }
  .ph-tab.active { background:var(--ph-theme); color:#fff; border-color:var(--ph-theme); }
  .ph-panel { display:none; } .ph-panel.active { display:block; }
  .ph-context { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin:8px 0 16px; }
  .ph-context h2 { font-size:22px; font-weight:800; color:var(--ph-ink); margin:0; }
  .ph-context .meta { font-size:13px; color:var(--ph-mut); }
  .ph-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
  .ph-kpi { border:1px solid var(--ph-border); border-radius:10px; padding:14px 16px; }
  .ph-kpi .k-l { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--ph-mut); }
  .ph-kpi .k-v { font-size:26px; font-weight:800; color:var(--ph-ink); margin-top:4px; }
  .ph-kpi .k-d { font-size:12px; color:var(--ph-mut); margin-top:2px; }
  .ph-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; } @media(max-width:860px){.ph-grid2{grid-template-columns:1fr;}}
  .ph-gauge { height:14px; border-radius:8px; background:linear-gradient(90deg,#7f1d1d,#dc2626,#f59e0b,#84cc16,#16a34a); position:relative; margin:16px 0 26px; }
  .ph-gauge .pin { position:absolute; top:-7px; width:4px; height:28px; background:#0f172a; border-radius:2px; transform:translateX(-50%); }
  .ph-gauge .pin::after { content:attr(data-val); position:absolute; top:30px; left:50%; transform:translateX(-50%); font-size:11px; font-weight:800; white-space:nowrap; }
  table.ph-t { width:100%; border-collapse:collapse; font-size:13px; }
  table.ph-t th { text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; color:var(--ph-mut); padding:8px 10px; border-bottom:2px solid var(--ph-border); }
  table.ph-t td { padding:8px 10px; border-bottom:1px solid #f1f4f8; }
  .ph-bar { height:9px; border-radius:5px; background:#ede9fe; overflow:hidden; min-width:50px; }
  .ph-bar > span { display:block; height:100%; background:var(--ph-theme); }
  .num { text-align:right; font-variant-numeric:tabular-nums; }
  #ph-map { height:520px; border-radius:12px; border:1px solid var(--ph-border); }
  .ph-legend { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; font-size:11.5px; color:var(--ph-mut); align-items:center; }
  .ph-legend i { width:14px; height:14px; border-radius:3px; display:inline-block; }
  .ph-empty { text-align:center; color:var(--ph-soft); padding:60px 20px; font-size:15px; }
  .ph-msg { font-size:13px; color:#b91c1c; margin-top:10px; }

  /* national explore map: one full-width map with floating controls (search, layers) and a collapsible area-summary drawer.
     Haresign navy/blue. Every id the script uses is unchanged; the controls simply sit over the map. */
  .phx-card { position:relative; }
  .phx-shell { display:block; }
  /* isolation: the map's overlays (z-index up to 1200) stay inside the map, so the shared picker modal (1100) opens above them */
  .phx-mapwrap { position:relative; min-width:0; isolation:isolate; }
  #ph-explore-map { height:clamp(560px, 78vh, 900px); width:100%; }
  .phx-search, .phx-layers, .phx-drawer-toggle, .phx-side { position:absolute; z-index:1100; box-sizing:border-box; }
  .phx-search, .phx-layers, .phx-drawer-toggle, .phx-side { background:rgba(255,255,255,.97); border:1px solid var(--ph-border); border-radius:12px; box-shadow:0 6px 22px rgba(15,23,42,.18); color:var(--ph-ink); }
  /* search: top left */
  .phx-search { top:12px; left:12px; width:min(330px, calc(100% - 24px)); display:flex; align-items:center; gap:8px; padding:8px 12px; }
  .phx-search .ph-ico { width:16px; height:16px; color:var(--ph-mut); flex:none; }
  .phx-search input { border:none; outline:none; font-size:13.5px; flex:1; min-width:0; background:none; color:var(--ph-ink); font-family:inherit; }
  .phx-search:focus-within { box-shadow:0 0 0 3px rgba(13,91,184,.28), 0 6px 22px rgba(15,23,42,.18); }
  .phx-search { z-index:1200; }
  .phx-ac { position:absolute; top:46px; left:0; right:0; background:#fff; border-radius:10px; box-shadow:0 12px 30px rgba(15,23,42,.22); max-height:280px; overflow-y:auto; display:none; z-index:1200; }
  .phx-ac.show { display:block; }
  .phx-ac-item { padding:9px 13px; font-size:13px; cursor:pointer; border-bottom:1px solid #f1f4f8; color:var(--ph-ink); }
  .phx-ac-item:hover { background:var(--ph-blue-soft); }
  .phx-ac-item .c { font-size:11px; color:var(--ph-soft); }
  /* layers: a compact vertical panel under the search */
  .phx-layers { top:62px; left:12px; width:min(250px, calc(100% - 24px)); overflow:hidden; }
  .phx-panel-toggle { display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px; border:none; background:var(--ph-navy); color:#fff; padding:9px 13px; font:inherit; font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; cursor:pointer; }
  .phx-panel-toggle .phx-chev { width:14px; height:14px; transition:transform .15s; }
  .phx-panel-toggle[aria-expanded="false"] .phx-chev { transform:rotate(-90deg); }
  .phx-layers-body { padding:8px; max-height:min(62vh, 520px); overflow-y:auto; }
  .phx-layers-body[hidden] { display:none; }
  .phx-pills { display:flex; flex-direction:column; gap:3px; }
  .phx-pill { display:flex; align-items:center; gap:9px; width:100%; text-align:left; padding:7px 10px; border-radius:8px; cursor:pointer; font:inherit; font-size:12.5px; font-weight:600; color:var(--ph-ink); background:transparent; border:1px solid transparent; transition:background .12s; }
  .phx-pill:hover { background:var(--ph-blue-soft); }
  .phx-pill.active { background:var(--ph-navy); color:#fff; font-weight:800; }
  .phx-pill:focus-visible, .phx-panel-toggle:focus-visible, .phx-drawer-toggle:focus-visible, .phx-side-close:focus-visible { outline:3px solid #f59e0b; outline-offset:1px; }
  .phx-pill .dot { width:9px; height:9px; border-radius:50%; flex:none; }
  .phx-op { display:flex; align-items:center; gap:8px; padding:8px 10px 2px; color:var(--ph-mut); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
  .phx-op input[type=range] { flex:1; min-width:0; accent-color:var(--ph-theme); }
  .phx-legend { display:flex; gap:6px; align-items:center; padding:4px 10px 6px; font-size:11px; color:var(--ph-mut); text-transform:none; letter-spacing:0; }
  .phx-legend i { width:90px; height:9px; border-radius:3px; display:inline-block; }
  /* area summary: a drawer from the right, closed until a neighbourhood is chosen or the button is pressed */
  .phx-drawer-toggle { top:12px; right:12px; display:inline-flex; align-items:center; gap:7px; padding:8px 13px; font:inherit; font-size:12.5px; font-weight:700; color:var(--ph-navy); cursor:pointer; }
  .phx-drawer-toggle .ph-ico { width:15px; height:15px; }
  .phx-drawer-toggle[aria-expanded="true"] { background:var(--ph-navy); color:#fff; }
  .phx-side { top:58px; right:12px; bottom:46px; width:min(380px, calc(100% - 24px)); overflow-y:auto; }
  .phx-side[hidden] { display:none; }
  .phx-side-close { position:absolute; top:6px; right:6px; z-index:2; width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border:none; border-radius:50%; background:rgba(15,23,42,.55); color:#fff; cursor:pointer; padding:0; }
  .phx-side-close .ph-ico { width:14px; height:14px; }
  #phx-side-body { padding:0 0 18px; }

  /* dossier */
  .phx-dossier-h { padding:18px 20px 16px; color:#fff; position:relative; }
  .phx-dossier-h .kicker { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; opacity:.85; }
  .phx-dossier-h h3 { font-size:20px; font-weight:800; margin:3px 0 2px; color:#fff; line-height:1.15; }
  .phx-dossier-h .sub { font-size:12px; opacity:.9; }
  .phx-dossier-h .close { position:absolute; top:14px; right:16px; cursor:pointer; color:#fff; opacity:.8; font-size:18px; background:none; border:none; }
  .phx-verdict { margin:12px 0 0; font-size:13px; line-height:1.45; background:rgba(255,255,255,.16); border-radius:9px; padding:10px 13px; }
  #phx-side-body > .pad, .phx-vp { padding:16px 20px; }
  .phx-actions { display:flex; gap:8px; padding:14px 20px 4px; }
  .phx-btn { flex:1; border:1px solid var(--ph-border); background:#fff; border-radius:8px; padding:8px 10px; font-size:12px; font-weight:700; color:var(--ph-theme); cursor:pointer; }
  .phx-btn:hover { background:var(--ph-blue-soft); }
  .phx-insights { padding:0 20px; }
  .phx-ins { display:flex; gap:9px; align-items:flex-start; font-size:12.5px; padding:7px 11px; border-radius:8px; margin-bottom:6px; line-height:1.4; }
  .phx-ins.up { background:#fdecec; color:#7f1d1d; } .phx-ins.down { background:#e9f7ee; color:#14532d; } .phx-ins.flat { background:#eef2f7; color:#334155; }
  .phx-vp { font-size:13px; }
  .phx-vp h3 { font-size:16px; font-weight:800; color:var(--ph-navy); margin:0 0 2px; }
  .phx-vp .sub { font-size:12px; color:var(--ph-mut); }
  .phx-vp .big { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0; }
  .phx-vp .big .b { border:1px solid var(--ph-border); border-radius:9px; padding:10px; }
  .phx-vp .big .b .v { font-size:22px; font-weight:800; color:var(--ph-navy); } .phx-vp .big .b .l { font-size:11px; color:var(--ph-mut); }
  .phx-compare { background:var(--ph-blue-soft); border-bottom:1px solid var(--ph-border); padding:10px 14px; font-size:12px; }
  .phx-compare table { width:100%; border-collapse:collapse; } .phx-compare td, .phx-compare th { padding:3px 5px; text-align:right; font-size:11.5px; } .phx-compare th:first-child, .phx-compare td:first-child { text-align:left; }
  .phx-compare .rm { color:#b91c1c; cursor:pointer; font-weight:700; }
  .phx-sec { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; color:var(--ph-theme); margin:18px 0 7px; }
  .phx-body-pad { padding:4px 20px 0; }
  .phx-domains { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
  .phx-domains .d { border-radius:6px; padding:6px 4px; text-align:center; color:#fff; }
  .phx-domains .d .dl { font-size:9px; opacity:.9; } .phx-domains .d .dv { font-size:15px; font-weight:800; }
  .phx-stack { display:flex; height:18px; border-radius:5px; overflow:hidden; font-size:9px; }
  .phx-stack > span { display:flex; align-items:center; justify-content:center; color:#fff; }
  .phx-chips { display:flex; flex-wrap:wrap; gap:6px; }
  .phx-chip { background:var(--ph-blue-soft); border-radius:14px; padding:3px 10px; font-size:12px; color:#1e3a5f; }
  .phx-prac { display:flex; justify-content:space-between; font-size:13px; padding:4px 0; border-bottom:1px solid #f1f4f8; }
  .phx-hint { position:absolute; bottom:14px; left:50%; transform:translateX(-50%); z-index:1050; background:rgba(11,37,69,.92); color:#dce8f7; border-radius:8px; padding:7px 14px; font-size:12px; box-shadow:0 4px 14px rgba(15,23,42,.2); }
  .phx-banner { position:absolute; bottom:52px; left:50%; transform:translateX(-50%); z-index:1150; max-width:calc(100% - 24px); box-sizing:border-box; background:var(--ph-theme); color:#fff; border-radius:8px; padding:9px 16px; font-size:13px; font-weight:600; box-shadow:0 6px 22px rgba(13,91,184,.4); display:flex; align-items:center; gap:14px; max-width:90%; }
  .phx-banner .x { cursor:pointer; font-size:18px; opacity:.85; }
  .leaflet-tooltip.phx-tt { font-size:12px; }
  .leaflet-tooltip.phx-tt-rich { font-size:12px; padding:9px 11px; width:280px; max-width:280px; white-space:normal; }
  .phx-tt-rich table { border-collapse:collapse; margin-top:5px; width:100%; table-layout:fixed; }
  .phx-tt-rich td { padding:2px 0; vertical-align:top; line-height:1.3; overflow-wrap:break-word; }
  .phx-tt-rich td:first-child { padding-right:10px; }
  .phx-tt-rich td.n { text-align:right; font-weight:700; white-space:nowrap; width:62px; }
  /* analysis layer */
  .ph-ins { display:flex; gap:9px; align-items:flex-start; font-size:13px; line-height:1.4; padding:7px 0; border-bottom:1px solid var(--ph-border); }
  .ph-ins:last-child { border-bottom:0; } .ph-ins i { margin-top:2px; }
  .ph-ins.bad i { color:#b91c1c; } .ph-ins.good i { color:#16a34a; } .ph-ins.flat i { color:#64748b; }
  .ph-pct { margin:11px 0; } .ph-pct .lab { display:flex; justify-content:space-between; font-size:12px; font-weight:700; margin-bottom:4px; }
  .ph-pct .lab .v { color:var(--ph-theme); }
  .ph-pct .track { position:relative; height:9px; border-radius:6px; background:linear-gradient(90deg,#16a34a,#eab308,#b91c1c); }
  .ph-pct .pin { position:absolute; top:-3px; width:3px; height:15px; background:#0b2545; border-radius:2px; transform:translateX(-50%); }
  .ph-grad-pos { font-size:13px; margin-top:12px; padding:11px 13px; border-radius:9px; background:var(--ph-blue-soft); }
  .ph-grad-pos.bad { background:#fef2f2; } .ph-grad-pos.good { background:#f0fdf4; }
  /* INT cross-promo */
  .ph-int-cta { display:flex; align-items:center; gap:14px; background:linear-gradient(135deg,#0d5bb8,#0b2545); color:#fff; border-radius:12px; padding:16px 20px; margin-bottom:18px; }
  .ph-int-cta .ico { font-size:24px; opacity:.9; } .ph-int-cta .t { flex:1; }
  .ph-int-cta .t strong { font-size:15px; } .ph-int-cta .t span { display:block; font-size:13px; opacity:.9; margin-top:2px; }
  .ph-int-cta a { background:#fff; color:var(--ph-navy); font-weight:700; font-size:13px; border-radius:8px; padding:9px 16px; white-space:nowrap; text-decoration:none; }
  /* Inequality gradients — small multiples */
  .ph-ineq-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:14px; margin-top:6px; }
  .ph-ineq-cell { border:1px solid var(--ph-border); border-radius:10px; padding:12px 13px; }
  .ph-ineq-cell.fund { background:var(--ph-blue-soft); border-color:#bcd4f2; }
  .ph-ineq-cell .ttl { font-size:13px; font-weight:800; color:var(--ph-navy); }
  .ph-ineq-cell .src { font-size:10.5px; color:var(--ph-mut); font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
  .ph-ineq-cell .box { height:130px; margin:8px 0 6px; }
  .ph-ineq-cell .find { font-size:12px; color:#334155; }
  .ph-ineq-cell .find.bad { color:#b91c1c; } .ph-ineq-cell .find.good { color:#15803d; }
  /* Outcomes vs deprivation peers — table */
  .ph-out { width:100%; border-collapse:collapse; font-size:13px; }
  .ph-out th, .ph-out td { padding:8px 9px; border-bottom:1px solid var(--ph-border); text-align:right; }
  .ph-out th { font-size:11px; color:var(--ph-mut); text-transform:uppercase; letter-spacing:.03em; font-weight:700; }
  .ph-out td:first-child, .ph-out th:first-child { text-align:left; }
  .ph-out td.me { font-weight:800; }
  .ph-out .lbl small { display:block; font-weight:500; color:var(--ph-mut); font-size:11px; }
  .ph-out .flag { font-weight:800; } .ph-out .flag.good { color:#15803d; } .ph-out .flag.bad { color:#b91c1c; }

/* ---- added: classes for the source's inline style attributes ---- */
.ph-ico { width:1em; height:1em; vertical-align:-0.125em; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.ph-chart-box { position:relative; height:260px; }
.ph-start-hidden { display:none; }
.ph-empty-ico { width:34px; height:34px; color:#cbd5e1; }
.ph-empty p { margin-top:14px; }
.ph-card-flush { padding:0; overflow:hidden; }
.ph-box-130 { height:130px; } .ph-box-210 { height:210px; } .ph-box-230 { height:230px; } .ph-box-260 { height:260px; } .ph-box-300 { height:300px; }
.ph-h-sm { font-size:14px; margin-top:8px; }
.ph-rank-line { font-size:13px; font-weight:700; margin:14px 0 4px; }
.ph-note { margin-top:8px; }
.ph-tab .ph-ico { margin-right:2px; }
.phx-search .ph-ico { color:#9fb2c8; }
.ph-chip-row { display:inline-flex; align-items:center; }
.ph-chip-row[hidden] { display:none; }

/* ---- added: what the figures stand on, and the coverage warnings ---- */
.ph-sources { margin:0 0 6px; padding-left:18px; }
.ph-sources li { margin:2px 0; }
.ph-coverage { margin:0 0 16px; }
.ph-warn { display:flex; gap:10px; align-items:flex-start; background:#fff7ed; border:1px solid #fdba74; border-left:4px solid #ea580c;
  color:#7c2d12; border-radius:8px; padding:11px 14px; font-size:13px; line-height:1.45; margin-bottom:8px; }
.ph-warn .ph-ico { margin-top:2px; color:#ea580c; }
.ph-coverage-line { font-size:12.5px; color:var(--ph-mut); margin:0 0 8px; }
.ph-estimate { font-size:11px; font-weight:700; color:#7c3aed; text-transform:none; letter-spacing:0; }

/* ---- added: the map without a basemap, the attribution under every map ---- */
#ph-map, #ph-explore-map { background:#eef2f7; }
.ph-map-attr { font-size:11.5px; color:var(--ph-mut); margin:8px 0 0; }
.leaflet-container { font-family:inherit; }

/* ---- added: two defects in the source's stylesheet ---- */
/* `.phx-banner { display:flex }` overrides the `hidden` attribute, so the source showed an empty blue pill over the map. */
.phx-banner[hidden], .phx-compare[hidden] { display:none; }
.phx-hint { max-width:calc(100% - 24px); text-align:center; box-sizing:border-box; }

/* ---- added: narrow screens ---- */
.ph-wrap { overflow-x:clip; }
.ph-table-scroll { overflow-x:auto; position:relative; }
@media (max-width:920px) { #ph-explore-map { height:clamp(520px, 72vh, 760px); } }
@media (max-width:600px) { .ph-wrap { padding:0 0 40px; } #ph-map { height:380px; } .ph-context h2 { font-size:19px; }
  .phx-domains { grid-template-columns:repeat(3,1fr); } }
/* phones: controls stay inside the map and shrink; the drawer becomes a bottom sheet */
@media (max-width:700px) {
  .phx-search { top:8px; left:8px; width:calc(100% - 16px); }
  .phx-layers { top:54px; left:8px; width:min(230px, calc(100% - 16px)); }
  .phx-layers-body { max-height:44vh; }
  .phx-drawer-toggle { top:auto; bottom:32px; right:8px; }
  .phx-side { top:auto; left:8px; right:8px; bottom:72px; width:auto; max-height:56%; }
  .phx-hint { display:none; }
}
@media (min-width:1500px) { .phx-side { width:420px; } }
