#population-review{position:fixed;inset:0;z-index:10000;background:var(--bg-primary);overflow:auto}
.population-review-content{max-width:1400px;margin:auto;padding:32px}
.population-review-header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:28px}
.population-review-header h1{font-size:30px;letter-spacing:-1px;margin:8px 0}
.population-review-eyebrow{font-size:11px;letter-spacing:2px;color:var(--accent-blue,#3b82f6);font-weight:700}
.pr-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.pr-scope{font-size:12px;line-height:1.7;margin:20px 0 28px}
.pr-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.pr-chart{padding:24px}
.pr-chart h3{font-size:17px;margin:0 0 8px}.pr-chart p{line-height:1.6;margin-bottom:22px}
.pr-bars{display:flex;flex-direction:column;gap:12px;max-height:420px;overflow:auto}
.pr-bar-row{display:grid;grid-template-columns:minmax(95px,1fr) minmax(60px,1.5fr) 95px;gap:12px;align-items:center;font-size:12px}
.pr-bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pr-bar-track{height:10px;background:var(--bg-primary);border-radius:8px;overflow:hidden}
.pr-bar-track span{display:block;height:100%;background:var(--pr-color);border-radius:8px}
.pr-bar-count{text-align:right;font-variant-numeric:tabular-nums}.pr-bar-count small{color:var(--text-muted);font-size:10px;margin-left:4px}
.pr-columns{height:210px;display:flex;gap:4px;align-items:stretch;padding-top:10px;padding-bottom:24px}
.pr-column{flex:1;min-width:0;position:relative;display:flex;align-items:flex-end}
.pr-column-bar{width:100%;background:var(--pr-color);border-radius:4px 4px 0 0;min-height:1px}
.pr-column-label{position:absolute;bottom:-22px;width:100%;text-align:center;font-size:9px;color:var(--text-muted)}
.pr-column:hover .pr-column-bar{filter:brightness(1.2)}
.pr-empty{padding:30px;text-align:center;color:var(--text-muted)}
.pr-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:800px){.population-review-content{padding:20px}.pr-grid{grid-template-columns:1fr}.pr-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.population-review-header{align-items:flex-start}.pr-chart{padding:18px}}
/* Equal card heights and fixed chart bodies keep paired cards and row baselines aligned. */
.pr-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:24px}
.pr-toolbar label{font-size:13px;font-weight:600}.pr-toolbar select{width:auto;min-width:210px}
.pr-section{margin-top:12px}.pr-section-heading{margin-bottom:16px}.pr-section-heading h2{font-size:21px;margin:0 0 3px;line-height:1.25}.pr-section-heading p{font-size:13px;margin:0;line-height:1.6}
.pr-grid{align-items:stretch;grid-auto-rows:auto}
.pr-chart{min-width:0;display:flex;flex-direction:column;margin:0}
.pr-chart-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px}
.pr-chart-heading h3{margin:0;line-height:1.3}
.pr-details-btn{border:1px solid var(--border-color,#dbe3ed);background:var(--bg-primary);color:var(--text-secondary,#52627a);padding:6px 10px;border-radius:7px;cursor:pointer;font:inherit;font-size:11px;white-space:nowrap}
.pr-details-btn:hover{color:var(--pr-color);border-color:var(--pr-color)}
.pr-chart .pr-chart-description{margin:8px 0 20px;min-height:44px;line-height:1.6}
.pr-bars{height:var(--pr-chart-height,240px);max-height:none;padding-right:5px;gap:0;flex:none}
.pr-bar-row{grid-template-columns:minmax(90px,1fr) minmax(50px,1.2fr) 82px 46px;gap:10px;min-height:30px;flex:none}
.pr-bar-count,.pr-bar-share{white-space:nowrap;font-variant-numeric:tabular-nums;text-align:right}
.pr-bar-share{font-size:10px;color:var(--text-muted)}
.pr-columns{height:var(--pr-chart-height,240px);box-sizing:border-box;flex:none;margin:0}
.pr-chart>.pr-empty{height:var(--pr-chart-height,240px);box-sizing:border-box;display:flex;align-items:center;justify-content:center}
.pr-details-shade{z-index:10010}
.pr-statistics-detail{z-index:10020}
.pr-statistics-detail .panel-body h3{font-size:14px;margin:22px 0 8px}
.pr-statistics-detail .panel-body h3:first-child{margin-top:0}
.pr-statistics-detail .panel-body p{font-size:13px;line-height:1.8;margin:0 0 12px}
@media(max-width:800px){.pr-grid{grid-auto-rows:auto}.pr-bar-row{grid-template-columns:minmax(80px,1fr) minmax(35px,1fr) 76px 42px;gap:6px}.pr-chart-description{min-height:0}}
.pr-composition,.pr-flags,.pr-line{height:var(--pr-chart-height,240px);box-sizing:border-box}
.pr-composition{display:flex;align-items:center;gap:22px}.pr-composition svg{width:42%;max-width:200px;flex-shrink:0}
.pr-ring-total{font-size:16px;font-weight:700;fill:var(--text-primary)}.pr-ring-caption{font-size:10px;fill:var(--text-muted)}
.pr-legend{flex:1;min-width:0}.pr-legend-row{display:grid;grid-template-columns:8px minmax(0,1fr) auto auto;align-items:center;gap:9px;margin:14px 0;font-size:12px}.pr-legend-row i{height:8px;border-radius:50%}.pr-legend-row b{font-weight:500;white-space:nowrap}.pr-legend-row small{color:var(--text-muted);white-space:nowrap}
.pr-flags{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.pr-flag{padding:14px;border:1px solid var(--border-primary);border-radius:10px;display:flex;flex-direction:column;justify-content:center;gap:8px}.pr-flag span{font-size:12px}.pr-flag strong{font-size:24px}.pr-flag small{font-size:11px;color:var(--text-muted)}
.pr-line{display:flex;align-items:center}.pr-line svg{width:100%;max-height:100%}.pr-line text{fill:var(--text-muted);font-size:10px}.pr-gridline{stroke:var(--border-primary);stroke-width:1}
.pr-binned{padding:28px 4px 42px;gap:12px}.pr-binned .pr-column-label{bottom:-36px;font-size:10px;white-space:normal;line-height:1.4}.pr-column-count{position:absolute;top:-20px;width:100%;text-align:center;font-size:10px;color:var(--text-muted);white-space:nowrap}.pr-column-bar{position:relative}.pr-column:focus-visible{outline:2px solid var(--pr-color);outline-offset:3px}
@media(max-width:500px){.pr-composition{gap:12px}.pr-legend-row{font-size:10px;gap:5px}.pr-binned{gap:7px}.pr-column-count,.pr-binned .pr-column-label{font-size:8px}}
/* Values react to hover; the dashboard cards stay still. */
#population-review .card,#population-review .card:hover,#population-review .kpi-card,#population-review .kpi-card:hover{transform:none;transition:none;box-shadow:var(--shadow-sm)}
#population-review .pr-chart:hover{border-color:var(--border-primary);border-top-color:var(--pr-color)}
.pr-tooltip{position:fixed;z-index:10030;pointer-events:none;background:var(--text-primary,var(--slate-900));color:var(--bg-card,#fff);border-radius:7px;padding:8px 12px;font-size:12px;line-height:1.5;box-shadow:var(--shadow-md);max-width:min(340px,calc(100vw - 16px))}
.pr-tooltip[hidden]{display:none}
[data-pr-value]{cursor:default}
.pr-line circle[data-pr-value]:hover{stroke:var(--pr-color);stroke-width:1.5}
.pr-composition path[data-pr-value]:hover{opacity:.8}
.pr-bar-row:hover .pr-bar-track span{filter:brightness(1.12)}
.pr-section>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;cursor:pointer;list-style:none}
.pr-section>summary::-webkit-details-marker{display:none}
.pr-section>summary:focus-visible{outline:2px solid var(--accent-blue,#3b82f6);outline-offset:5px;border-radius:4px}
.pr-category-toggle{width:9px;height:9px;border-right:2px solid var(--text-muted);border-bottom:2px solid var(--text-muted);transform:rotate(-45deg);margin-right:6px;flex-shrink:0}
.pr-section[open]>.pr-section-heading .pr-category-toggle{transform:rotate(45deg)}
.pr-section:not([open])>.pr-section-heading{margin-bottom:0}

/* One enclosure connects each category header to its charts. */
.pr-section{border:1px solid var(--border-primary);border-radius:14px;background:var(--bg-card);overflow:hidden}
.pr-section>.pr-grid{padding:20px;background:var(--bg-primary)}
.pr-section>summary{padding:9px 20px;margin:0;background:color-mix(in srgb,var(--accent-blue,#3b82f6) 3%,var(--bg-card));border:0;border-radius:0;transition:background .18s ease}
.pr-section>summary:hover{background:color-mix(in srgb,var(--accent-blue,#3b82f6) 6%,var(--bg-card))}
.pr-category-toggle{border-color:var(--accent-blue,#3b82f6);transition:transform .28s ease}
.pr-section.pr-collapsing>.pr-section-heading .pr-category-toggle{transform:rotate(-45deg)}
@media(prefers-reduced-motion:reduce){.pr-section>summary,.pr-category-toggle{transition:none}}

.pr-section[open]>summary{box-shadow:inset 0 -1px var(--border-primary)}
.pr-section>summary:focus-visible{outline-offset:-3px;border-radius:12px}
@media(max-width:800px){.pr-section>.pr-grid{padding:12px}}

.pr-matrix{height:var(--pr-chart-height,240px);display:grid;grid-template-columns:130px 1fr 1fr;grid-template-rows:34px 1fr 1fr;gap:10px;box-sizing:border-box;padding:8px 0}
.pr-matrix-label,.pr-matrix-corner{align-self:center;font-size:12px;color:var(--text-muted)}
.pr-matrix-corner{font-size:10px}.pr-matrix-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border-radius:8px;background:color-mix(in srgb,var(--pr-color) calc(var(--pr-cell-strength)*100%),var(--bg-card));border:1px solid var(--border-primary)}
.pr-matrix-cell strong{font-size:24px;font-variant-numeric:tabular-nums}.pr-matrix-cell small{color:var(--text-muted)}
.pr-settings{margin:0}.pr-settings>div{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid var(--border-primary);padding:9px 0;font-size:12px;line-height:1.5}.pr-settings dt{color:var(--text-muted)}.pr-settings dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
@media(max-width:500px){.pr-matrix{grid-template-columns:86px 1fr 1fr;gap:6px}.pr-matrix-label{font-size:10px}.pr-matrix-cell strong{font-size:20px}}

/* Separate customer rules into labelled blocks with readable lists. */
.pr-rule-sections{display:flex;flex-direction:column;gap:14px;margin:20px 0}
.pr-rule-section{padding:16px 18px;border:1px solid var(--border-primary);border-radius:10px;background:var(--bg-primary)}
.pr-statistics-detail .panel-body .pr-rule-section h3{margin:0 0 10px;font-size:14px;color:var(--text-primary)}
.pr-rule-section ul{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px}
.pr-rule-section li{font-size:13px;line-height:1.65;padding-left:3px}

.pr-chart .pr-scroll-cue{font-size:11px;min-height:0;margin:8px 0 0}
.pr-bars{scrollbar-width:thin;scrollbar-gutter:stable}
.pr-bars::-webkit-scrollbar{width:7px}
.pr-bars::-webkit-scrollbar-thumb{background:var(--text-muted);border-radius:4px}

/* Credit values need room for full GBP amounts beside their percentages. */
.pr-value-chart .pr-bar-row{grid-template-columns:minmax(0,1fr) minmax(24px,.8fr) 140px 42px;gap:6px}
