/* Planner: effective Isotherm styles, ordered by component. */

/* Layout */
html { height: 100%; }
body { height: 100%; display: grid; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; overflow: hidden; grid-template-rows: auto minmax(0px, 1fr) auto; }
.layout { display: grid; min-height: 0px; grid-template-columns: 330px minmax(0px, 1fr); }
.stage { position: relative; display: grid; grid-template-rows: minmax(0px, 1fr) auto; min-width: 0px; min-height: 0px; overflow: hidden; }
.viewport { position: relative; min-height: 0px; overflow: hidden; background: color-mix(in srgb, var(--paper) 65%, var(--paper-2)); }
.map { position: absolute; inset: 0px; }


/* Panel */
.badge { font-weight: 500; font-size: var(--text-xs); letter-spacing: 0.3px; padding: 2px 6px; }
.panel { display: flex; flex-direction: column; min-height: 0px; overflow-y: auto; border-right: 1px solid var(--hair); background: var(--paper); padding: 28px; }
.panel-head { padding: 0px; }
.panel-head h1 { font-weight: 500; line-height: 1.13; letter-spacing: -1.5px; max-width: none; margin: 0px 0px 20px; font-size: 34px; }
.panel-head p { margin: 0px; color: var(--muted); max-width: 36em; }
.panel-head .badge { margin-left: 4px; }
.panel-deco { position: relative; margin: 0px; overflow: hidden; min-height: 16px; flex: 1 1 30px; opacity: 0.55; }
.method { margin: 0px; color: var(--muted); padding: 0px; font-size: var(--text-xs); }
.eyebrow { font-size: var(--text-xs); font-weight: 600; letter-spacing: 1.8px; text-transform: none; color: var(--muted); margin: 0px 0px 20px; }
.panel-head .eyebrow { font-size: var(--text-xs); font-weight: 600; letter-spacing: 1.8px; text-transform: none; color: var(--muted); margin: 0px 0px 20px; }
.panel-head .lede { line-height: 1.65; margin: 0px 0px 24px; font-size: 12px; }
.method p { margin: 9px 0px; font-size: var(--text-xs); line-height: 1.7; }
.method summary { cursor: pointer; text-underline-offset: 4px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; padding: 8px 0px; text-decoration: none; border-top: 1px solid var(--hair); }
.method summary::-webkit-details-marker { display: none; }
.method summary::after { content: "＋"; font-size: 16px; flex: none; }
.method details[open] > summary::after { content: "−"; }

/* Ranking and outlook */
.rank-key { grid-template-columns: 30px minmax(0px, 1fr) 132px 40px; column-gap: 12px; align-items: center; font-size: var(--text-xs); letter-spacing: 1px; text-transform: none; color: var(--muted); display: flex; justify-content: space-between; border: 0px; padding: 16px 8px 8px; }
.ranking button { display: grid; align-items: center; width: 100%; background: none; text-align: left; cursor: pointer; gap: 8px; border: 0px; position: relative; min-height: 44px; grid-template-columns: 22px minmax(0px, 1fr) 78px; padding: 16px 8px; }
.rank-key > :first-child { grid-column: 1 / 3; }
.rank-key > :last-child { text-align: right; }
.ranking { list-style: none; margin: 0px; padding: 0px; }
.ranking li { border-bottom: 1px solid var(--hair); }
.ranking button:hover { background: var(--paper-2); }
.ranking li.is-hover button { background: var(--paper-2); }
.ranking li.is-selected button { border-left-color: var(--ink); background: var(--paper-2); }
.rank-n { letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 400; color: var(--muted); }
.rank-name b { display: block; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 550; line-height: 1.4; }
.rank-name span { display: block; color: var(--muted); font-size: var(--text-xs); margin-top: 8px; }
.rank-score { justify-self: end; text-align: right; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 400; grid-column: 3; letter-spacing: 0px; }
.outlook-switch { display: flex; gap: 0px; border: 1px solid var(--hair); margin: 0px 0px 12px; }
.outlook-switch[hidden] { display: none; }
#snapshot-date { display: block; margin-bottom: 12px; font-size: 13px; line-height: 20px; color: var(--muted); }
.ranking-switch { display: flex; gap: 0px; margin: 0px 28px 10px; border: 1px solid var(--hair); }
.outlook-switch button { flex: 1 1 0%; border-top: 0px; border-bottom: 0px; border-left: 0px; border-image: none; border-right: 1px solid var(--hair); background: var(--paper); cursor: pointer; font-size: 14px; padding: 10px; }
.ranking-switch button { flex: 1 1 0%; border-top: 0px; border-bottom: 0px; border-left: 0px; border-image: none; border-right: 1px solid var(--hair); background: var(--paper); padding: 8px 4px; cursor: pointer; }
.outlook-switch button:last-child { border-right: 0px; }
.ranking-switch button:last-child { border-right: 0px; }
.outlook-switch button[aria-pressed="true"] { background: var(--inverse); color: var(--on-inverse); }
.ranking-switch button[aria-pressed="true"] { background: var(--inverse); color: var(--on-inverse); }
.outlook-empty { padding: 24px 28px; color: var(--muted); }
.rank-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.rank-heading h2 { font-size: 14px; font-weight: 600; margin: 0px; }
.rank-heading > span { font-size: var(--text-xs); letter-spacing: 1px; text-transform: none; color: var(--muted); }
.alert-summary { display: flex; align-items: flex-start; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 16px 0px; gap: var(--space-4); }
.alert-summary .band-chip { min-width: 70px; flex: 0 0 auto; }
.alert-summary p { margin: 0px; font-size: 13px; line-height: 1.4; }
.capacity { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 16px 0px; gap: var(--space-4); }
.capacity input { width: 54px; padding: 6px 4px; border: 1px solid var(--hair); border-radius: 0px; background: var(--card); color: var(--ink); font: inherit; text-align: center; }
.download-assigned { padding: 8px 0px; border: 0px; background: none; color: var(--cool); text-align: left; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; cursor: pointer; }
.download-assigned:disabled { color: var(--muted); cursor: default; }
.ranking li.is-unassigned { opacity: 1; }
.ranking li.is-assigned .rank-name span { color: var(--ink); }
.rank-reasons { grid-column: 2 / -1; display: block; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* Map overlay grid */
.scale { position: absolute; color: var(--muted); text-align: right; bottom: 23px; right: 32px; font-size: var(--text-xs); }
.scale b { display: block; height: 5px; margin: 0px 0px 4px auto; border: 1px solid var(--muted); border-top: 0; }
.status { position: absolute; inset: 0px; display: flex; place-content: center; color: var(--muted); background: var(--paper-2); transition: opacity 0.5s; align-items: center; }
.status.is-done { opacity: 0; pointer-events: none; }
.status.is-error { color: var(--ink); padding: 40px; text-align: center; flex-direction: column; gap: var(--space-4); z-index: var(--z-status); opacity: 1; pointer-events: auto; }
.map-heading { position: relative; pointer-events: none; background: var(--paper); border: 1px solid var(--hair); z-index: var(--z-furniture); padding: 12px 16px; max-width: 330px; grid-area: head; place-self: start; }
.map-heading .eyebrow { margin: 0px 0px 5px; font-size: 13px; }
.map-heading h2 { font-weight: 450; line-height: 1.15; margin: 0px; max-width: 320px; font-size: clamp(28px, 1.55vw, 34px); letter-spacing: -0.8px; }
.map-heading > p:last-child { color: var(--muted); margin: 5px 0px 0px; font-size: 13px; }
.map-caption { bottom: 61px; right: 32px; text-align: right; pointer-events: none; position: static; text-shadow: none; }
.map-caption strong { display: block; font-weight: 400; letter-spacing: -2px; font-size: 36px; line-height: 1.1; }
.map-caption span { display: block; font-size: var(--text-xs); letter-spacing: 1.4px; text-transform: none; margin: 3px 0px 10px; }
.map-caption small { font-size: var(--text-xs); color: var(--muted); }
.map-summary { position: absolute; z-index: var(--z-furniture); pointer-events: none; right: 24px; bottom: 24px; padding: 0px; border: 0px; background: none; }
.map-summary .scale { position: static; margin: 0px; padding: 0px; border: 0px; }
.status.is-error p { max-width: 34em; line-height: 1.5; }
.status.is-error button { padding: 10px 18px; background: var(--ink); color: var(--paper); border: 0px; font: inherit; cursor: pointer; }
.cursor-tag { position: absolute; top: 0px; left: 0px; z-index: var(--z-controls); pointer-events: none; background: var(--paper); border: 1px solid var(--hair); padding: 4px 7px; font-size: 12px; line-height: 18px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-ui > * { min-width: 0px; }
.map-ui > :is(.controls, .legend) { pointer-events: auto; }

.map canvas:focus-visible { outline: 2px solid var(--cool); outline-offset: -3px; }

.map-ui { position: absolute; inset: 24px; display: grid; pointer-events: none; }
/* Controls */
.controls { position: relative; display: flex; align-items: stretch; justify-content: flex-end; flex-wrap: wrap; gap: 0px; background: var(--paper); border: 1px solid var(--hair); white-space: nowrap; overflow: visible; z-index: var(--z-controls); width: max-content; max-width: 100%; grid-area: tools; place-self: start end; }
.seg { display: flex; background: var(--paper); border: 1px solid var(--hair); }
.seg button { border: 0px; background: none; cursor: pointer; padding: 12px 17px; font-size: 12px; font-weight: 400; }
.seg button + button { border-color: var(--hair); border-left: 1px solid var(--hair); }
.seg button[aria-pressed="true"] { background: var(--inverse); color: var(--on-inverse); }
.seg button:not([aria-pressed="true"]):hover { background: var(--paper-2); }
.check { display: flex; align-items: center; gap: 8px; border: 1px solid var(--hair); cursor: pointer; font-size: var(--text-xs); font-weight: 400; min-height: 35px; background: var(--paper); padding: 8px 12px; }
.check input { appearance: none; margin: 0px; background: var(--card); display: grid; place-content: center; width: 11px; height: 11px; border: 1px solid var(--cool); }
.check input:checked { background: var(--cool); }
.check input:checked::after { content: ""; border: solid var(--card); border-width: 0px 0px 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); width: 5px; height: 3px; }
.plain { border: 1px solid var(--hair); cursor: pointer; font-size: var(--text-xs); font-weight: 400; min-height: 35px; background: var(--paper); padding: 8px 12px; }
.plain:hover { background: var(--paper-2); }
.controls > * { flex-shrink: 0; border: 0px; }
.controls > * + * { border-left: 1px solid var(--hair); }
.controls .seg button { padding: 9px 11px; }
.controls .check { padding: 7px 10px; }
.controls .plain { padding: 7px 10px; }
.layers-menu { position: relative; min-width: 112px; }
.layers-menu summary { list-style: none; padding: 8px 12px; cursor: pointer; font-size: 13px; height: 100%; display: flex; align-items: center; }
.layers-menu summary::-webkit-details-marker { display: none; }
.layers-menu summary::after { content: "⌄"; margin-left: 12px; }
.layers-list { position: absolute; top: 100%; right: -1px; width: 202px; padding: 4px; background: var(--paper); border: 1px solid var(--hair); box-shadow: rgba(34, 48, 60, 0.125) 0px 8px 16px; z-index: var(--z-menu); }
.layers-list button { display: block; width: 100%; border: 0px; background: none; padding: 9px 10px; text-align: left; font-size: 13px; cursor: pointer; }
.layers-list button:hover { background: var(--paper-2); }
.layers-list button[aria-pressed="true"] { background: var(--paper-2); }
.layers-list button[aria-pressed="true"]::before { content: "✓ "; }
.map-view-switch { position: static; }
.map-view-switch button { padding: 7px 10px; font-size: 12px; }

/* Legend */
.legend-explain { max-width: 32em; font-size: 12px; }
.station-key span:nth-child(1) { color: var(--cool); }
.station-key span:nth-child(2) { color: var(--amber-ink); }
.station-key span:nth-child(3) { color: var(--accent-text); }
/* The legend may shrink within its map track; expanded details scroll inside it. */
.legend { min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; position: relative; border: 1px solid var(--hair); background: var(--paper); z-index: var(--z-furniture); width: 350px; padding: 12px 14px; pointer-events: auto; grid-area: legend; align-self: end; max-width: 100%; }
.legend h2 { margin: 0px 0px 8px; letter-spacing: -0.005em; display: flex; gap: 8px; align-items: center; font-size: var(--text-xs); font-weight: 550; flex-wrap: wrap; }
.legend .sub { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 12px 0px 0px; }
.ramp { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; }
.ramp span { display: block; color: var(--ink); font-variant-numeric: tabular-nums; font-size: var(--text-xs); }
.ramp span::before { content: ""; display: block; background: var(--c); height: 6px; margin-bottom: 6px; }
.keys { display: flex; flex-wrap: wrap; margin: 12px 0px 0px; padding: 10px 0px 0px; border-top: 1px solid var(--hair); color: var(--ink); font-size: var(--text-xs); gap: 7px 12px; }
.keys span { display: inline-flex; align-items: center; gap: 6px; }
.keys svg { display: block; width: 10px; height: 10px; }
.keys .nodata { width: 7px; height: 7px; background: var(--nodata); }
.legend .method-note { margin: 12px 0px 0px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.centre-key { margin: 4px; background: var(--ice); border: 2px solid var(--ice-deep); border-radius: 50%; width: 7px; height: 7px; box-shadow: rgba(41, 114, 140, 0.396) 0px 0px 7px 4px; }
.public-key { width: 9px; height: 9px; margin: 5px; background: var(--cool-soft); border: 1px solid var(--cool); transform: rotate(45deg); }
.cooling-note { margin: 6px 0px 0px; font-size: 13px; font-weight: 400; color: var(--muted); }
.legend-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0px; border: 0px; background: none; text-align: left; cursor: pointer; font-size: 14px; font-weight: 550; }
.legend-toggle > span:last-child { font-size: 18px; font-weight: 400; }
.legend .ramp { margin-top: 8px; }
.legend .ramp span { font-size: 13px; white-space: nowrap; }
.legend .ramp span::before { height: 6px; margin-bottom: 4px; }
.legend:has([aria-expanded="true"]) { width: 370px; max-width: 100%; }
.legend .keys { font-size: 13px; line-height: 1.5; gap: 8px 12px; }
.legend .cooling-note { font-size: 13px; line-height: 1.5; }
.legend .keys svg { width: 18px; height: 14px; }
.legend .coverage-note { margin: 7px 0px 0px; font-size: 12px; color: var(--muted); }
.legend .reading-key { border: 0px; padding: 0px; margin-top: 6px; font-size: 12px; }
.bivariate-key { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.bivariate-grid { display: grid; grid-template-columns: repeat(3, 32px); gap: 2px; }
.bivariate-grid button { width: 32px; height: 32px; padding: 0px; background: var(--c); border: 0px; font-size: var(--text-xs); color: var(--ink); cursor: pointer; }
.bivariate-grid button:nth-child(-n+3) { color: white; }
.bivariate-grid button:nth-child(2) { color: var(--accent-ink); }
.bivariate-grid button:nth-child(6) { color: white; }
.bivariate-grid button.is-active { outline: 2px solid var(--ink); outline-offset: 2px; z-index: var(--z-furniture); }
.senior-axis { writing-mode: vertical-rl; transform: rotate(180deg); font-size: var(--text-xs); }
.heat-axis { display: block; font-size: var(--text-xs); margin-top: 5px; }
.bivariate-key p { font-size: 12px; line-height: 1.5; color: var(--muted); }

.bivariate-grid button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; z-index: var(--z-furniture); }

@media (min-width: 1600px) {
  body { font-size: clamp(14px, 0.74vw, 16px); }
  .badge { font-size: clamp(13px, 0.66vw, 15px); }
  .layout { grid-template-columns: clamp(370px, 19.5vw, 420px) minmax(0px, 1fr); }
  .panel { padding: 26px 30px 20px; }
  .panel-head h1 { margin: 0px 0px 12px; font-size: clamp(33px, 1.75vw, 38px); }
  .rank-key { font-size: clamp(13px, 0.66vw, 15px); }
  .ranking button { min-height: 45px; }
  .rank-n { font-size: clamp(13px, 0.66vw, 15px); }
  .rank-name b { font-size: clamp(15px, 0.78vw, 17px); }
  .rank-name span { font-size: clamp(13px, 0.66vw, 15px); }
  .rank-score { font-size: clamp(22px, 1.15vw, 26px); }
  .method { font-size: clamp(13px, 0.66vw, 15px); }
  .seg button { font-size: clamp(13px, 0.69vw, 15px); }
  .check { font-size: clamp(13px, 0.69vw, 15px); }
  .check input { width: 14px; height: 14px; }
  .plain { font-size: clamp(13px, 0.69vw, 15px); }
  .map-view-switch button { font-size: 12px; }
  .scale { font-size: clamp(13px, 0.66vw, 15px); }
  .eyebrow { font-size: clamp(13px, 0.66vw, 15px); }
  .panel-head .eyebrow { margin: 0px 0px 18px; font-size: clamp(13px, 0.66vw, 15px); }
  .panel-head .lede { margin: 0px 0px 12px; font-size: clamp(14px, 0.74vw, 16px); }
  .rank-heading > span { font-size: clamp(13px, 0.66vw, 15px); }
  .method p { font-size: clamp(13px, 0.66vw, 15px); }
  .map-heading h2 { max-width: 520px; }
  .cooling-note { font-size: clamp(13px, 0.66vw, 15px); }
}

/* Preserve the established wide-screen rail; the swallowed enlargement is not enabled. */
@media (min-width: 2400px) {
  .panel-head h1 { margin: 0px 0px 16px; }
  .ranking button { min-height: clamp(49px, 2.55vw, 58px); }
  .panel-head .lede { margin: 0px 0px 22px; }
}

@media (max-width: 1100px) {
  .rank-key { grid-template-columns: 26px minmax(0px, 1fr) 108px 34px; }
  .seg button { padding: 10px; }
  .legend { width: min(350px, 100%); }
  .map-heading h2 { max-width: 240px; }
  .map-caption { display: none; }
  .legend:has([aria-expanded="true"]) { width: min(370px, 100%); }
  .layers-list { right: auto; left: -1px; max-width: calc(-32px + 100vw); }
}

@media (max-width: 820px) {
  body { overflow: auto; height: auto; grid-template-rows: auto auto auto; }
  .layout { grid-template-columns: 1fr; }
  .panel { border-right: 0px; border-top: 1px solid var(--hair); overflow: visible; padding: 30px 24px; }
  .panel-head h1 { font-size: 35px; }
  .ranking button { min-height: 48px; }
  .panel-deco { flex: 0 0 auto; height: 35px; }
  .stage { order: -1; height: auto; display: flex; flex-direction: column; }
  .viewport { min-height: 420px; height: 760px; }
  .controls { justify-content: flex-start; justify-self: start; }
  .seg button { padding: 10px 12px; }
  .legend { width: 290px; }
  .legend .sub { display: block; }
  .scale { display: none; }
  .panel-head .lede { font-size: 14px; margin: 0px 0px 37px; }
  .map-heading h2 { max-width: 320px; }
  .map-summary { display: none; }
  .alert-summary p { font-size: 14px; }
}


@media (prefers-reduced-motion: reduce) { .status { transition: none; } }

/* Printed checklists omit map furniture. */
@media print {
  body { display: block; overflow: visible; background: white; }
  .layout, .stage, .viewport, .map-ui { display: block; position: static; overflow: visible; }
  .checklist li span, .checklist-empty { color: #333; }
}

#detail-heading { position: relative; }
/* Explicit views share a viewport; the overview keeps its map dimensions and camera. */
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body > hg-header { flex: 0 0 auto; }
#planner-pages { flex: 1; min-height: 0; overflow: hidden; position: relative; }
#overview-page { position: absolute; inset: 0; display: flex; flex-direction: column; }
#overview-page[aria-hidden="true"] { visibility: hidden; pointer-events: none; }

.layout { flex: 1; min-height: 0; grid-template-columns: clamp(344px, 25vw, 440px) minmax(0,1fr); }
.stage { grid-template-rows: minmax(0,1fr); }
.map-ui { grid-template: "head tools" auto "space space" minmax(0,1fr) "legend legend" minmax(0,auto) / minmax(0,1fr) auto; gap: 24px; }
.map-ui > :is(.controls,.legend) { pointer-events: auto; }
.map-heading h2 { font-size: 32px; }
.map-heading .eyebrow { margin-bottom: 8px; }
.panel { padding: 24px; }
.panel-head h1 { font-size: 32px; margin-bottom: 16px; }
.panel-head .eyebrow { margin-bottom: 16px; }
.panel-head .lede { font-size: 13px; margin-bottom: 24px; }
.ranking button { padding: 16px 0; }
.rank-name b { white-space: normal; }
.legend { width: 320px; padding: 12px 16px; }
.legend-toggle { font-size: 13px; }
.cursor-tag { width: 288px; height: 64px; max-width: calc(100% - 8px); box-sizing: border-box; display: flex; align-items: center; padding: 8px 12px; font-size: 12px; line-height: 20px; white-space: normal; overflow: hidden; pointer-events: none; }
.cursor-tag[hidden] { display: none; }
.pin-group-picker { position: absolute; z-index: 20; background: var(--paper); border: 1px solid var(--hair); padding: 8px; width: 248px; max-height: 280px; overflow: auto; }
.pin-group-picker button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 8px; cursor: pointer; }
.pin-group-picker button:hover { background: var(--paper-2); }
/* The dark chip is a map control, separate from the lower-left legend. */
.brief-chip { position: absolute; right: 24px; bottom: 28px; z-index: 12; max-width: calc(100% - 48px); padding: 14px 20px; border: 1px solid var(--ink); background: var(--inverse); color: var(--on-inverse); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
.viewport:has(.brief-chip:not([hidden])) .map-summary { bottom: 90px; }
.brief-chip:hover { background: var(--muted); }
.brief-chip:focus-visible { outline: 3px solid var(--cool); outline-offset: 4px; }
.brief-chip[hidden] { display: none; }
@media (max-width: 1100px) { .map-ui { grid-template: "tools" auto "head" auto "space" minmax(0,1fr) "legend" minmax(0,auto) / minmax(0,1fr); } }
@media (max-width: 820px) {
  #planner-pages { overflow-y: auto; }
  #overview-page { position: relative; height: auto; min-height: 100%; }
  #overview-page[aria-hidden="true"] { position: absolute; height: 0; min-height: 0; overflow: hidden; }
  .brief-chip { bottom: 16px; right: 16px; max-width: calc(100% - 32px); }
  .viewport:has(.brief-chip:not([hidden])) .map-ui { bottom: 78px; }
  .layout { display: flex; flex-direction: column; flex: 0 0 auto; }
  .stage { order: 0; height: 560px; flex: 0 0 560px; }
  .viewport { height: 100%; min-height: 0; }
  .panel { order: 1; overflow: visible; padding: 24px; }
  .panel-head h1 { font-size: 32px; }
  .panel-head .lede { margin-bottom: 24px; }
  .map-ui { inset: 16px; grid-template: "tools" auto "head" auto "space" minmax(0,1fr) "legend" minmax(0,auto) / minmax(0,1fr); gap: 16px; }
  .map-heading h2 { font-size: 28px; }
  .map-heading .eyebrow { display: none; }
  .controls { flex-wrap: wrap; width: auto; }
  .controls .plain { border-left: 0; }
  .legend { width: 288px; }
  .map-summary { display: none; }

}

@media print {
  body, #planner-pages { display: block; height: auto; overflow: visible; }
  #overview-page, hg-footer, .detail-nav, .neighbourhood-map, .checklist-actions { display: none; }
  #area-detail { position: static; display: block; padding: 0; }
  body > hg-header { display: none; }
  .checklist { overflow: visible; }
  .detail-grid { display: block; }
  .checklist li { break-inside: avoid; }
}

/* Neighbourhood brief: a summary above a linked visit list and map.
   Only the ordered checklist scrolls; supporting facts remain in view. */
#area-detail { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 16px; padding: 16px clamp(24px,2vw,48px); background: var(--paper); }
#area-detail[hidden] { display: none; }
#detail-heading { flex: 0 0 auto; }
.detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--hair); }
.detail-nav > span { font-size: 12px; color: var(--muted); }
.detail-nav > div { display: flex; gap: 8px; }
.detail-nav button, .checklist-actions button { border: 1px solid var(--hair); background: transparent; padding: 8px 12px; font: inherit; font-size: 12px; line-height: 16px; cursor: pointer; }
.detail-nav button:disabled { opacity: .45; cursor: default; }
.detail-nav button:hover:not(:disabled), .checklist-actions button:hover { background: var(--paper-2); }
.area-title { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 16px; }
.area-title > div:first-child { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 24px; }
.area-title .eyebrow { grid-column: 1 / -1; font-size: 12px; margin: 0 0 8px; }
#area-name { font-size: clamp(28px,2.2vw,48px); font-weight: 550; line-height: 1.1; letter-spacing: -.035em; margin: 0; overflow-wrap: anywhere; }

.area-assignment { margin: 0; font-size: 13px; }
.area-assignment span { color: var(--muted); margin: 0 8px; }
.area-alert { text-align: right; flex: 0 0 auto; }
.area-alert .band-chip { font-size: 13px; padding: 8px 16px; }
.area-alert p { font-size: 12px; margin: 8px 0 0; color: var(--muted); }
.detail-grid { display: grid; flex: 1; min-height: 0; grid-template-columns: minmax(0,3fr) minmax(0,2fr); grid-template-rows: auto auto minmax(0,1fr) auto; gap: 16px 24px; }
.detail-grid > * { min-width: 0; min-height: 0; }
.detail-grid h2 { font-size: 16px; font-weight: 550; letter-spacing: -.015em; line-height: 24px; margin: 0 0 8px; }
#area-detail .data-note { font-size: 12px; line-height: 16px; color: var(--muted); margin: 0; }
.detail-story { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr); gap: 24px; border-top: 1px solid var(--hair); padding-top: 8px; }
.heat-facts { display: grid; gap: 8px; margin: 0; }
.heat-facts > div { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 0 16px; align-items: baseline; }
.heat-facts dt { font-size: 12px; line-height: 16px; color: var(--muted); }
.heat-facts dd { font-size: 14px; line-height: 20px; margin: 0; }
.heat-facts .data-note { grid-column: 2; }
.air-temperature dd span { display: inline-block; margin-right: 8px; }
.people-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 16px; margin: 0; }
.people-facts dt { font-size: 12px; line-height: 16px; color: var(--muted); }
.people-facts dd { font-size: 24px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 0; }
.people-facts small { font-size: 12px; font-weight: 400; }
.why-section { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--hair); padding-top: 8px; }
.why-section h2 { flex: 0 0 112px; margin: 0; }
.detail-reasons { flex: 1; display: grid; align-items: center; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.detail-reasons p { font-size: 12px; line-height: 16px; margin: 0; padding-left: 16px; border-left: 1px solid var(--hair); }
.checklist-section { grid-column: 1; grid-row: 3; border-top: 1px solid var(--ink); padding-top: 8px; display: flex; flex-direction: column; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading .eyebrow { font-size: 12px; margin: 0; color: var(--muted); }
.section-heading h2 { margin: 0; }
.section-heading h2 span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.checklist-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.checklist-actions button { padding: 8px; }
.checklist-actions button[data-export="copy"] { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }
#detail-checklist > .data-note { margin-top: 8px; }
#area-detail .checklist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; list-style: none; padding: 0; margin: 8px 0 0; }
#area-detail .checklist li { border-top: 1px solid var(--hair); }
.checklist-block { display: grid; grid-template-columns: 24px minmax(0,1.1fr) minmax(0,1fr) minmax(0,.8fr); gap: 16px; width: 100%; padding: 16px 8px; background: transparent; border: 0; text-align: left; font: inherit; font-size: 13px; line-height: 20px; cursor: pointer; }
.checklist-block > span { min-width: 0; overflow-wrap: anywhere; }
.checklist-block b { font-weight: 550; }
.checklist-block span span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 4px; }
.checklist-block:hover, .checklist-block[aria-pressed="true"] { background: var(--paper-2); }
.checklist-block[aria-pressed="true"] { box-shadow: inset 3px 0 var(--ink); }
.stop-number { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
#export-status { font-size: 12px; line-height: 16px; margin: 8px 0 0; }
#export-status:empty { display: none; }
.neighbourhood-map { grid-column: 2; grid-row: 3 / 5; display: flex; flex-direction: column; margin: 0; border-top: 1px solid var(--hair); padding-top: 8px; }
#mini-map { flex: 1; min-height: 120px; position: relative; overflow: hidden; background: var(--paper-2); border: 1px solid var(--hair); }
#mini-map canvas { outline-offset: -4px; }
.neighbourhood-map figcaption { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; line-height: 16px; color: var(--muted); padding-top: 8px; }
.mini-ramp { width: 64px; height: 6px; background: linear-gradient(to right,var(--ramp-0),var(--ramp-1),var(--ramp-2),var(--ramp-3),var(--ramp-4)); }
#mini-selection { font-size: 12px; line-height: 16px; min-height: 32px; color: var(--muted); margin: 8px 0 0; }
.cooling-section { grid-column: 1; grid-row: 4; border-top: 1px solid var(--hair); padding-top: 8px; }
.cooling-heading { display: flex; align-items: baseline; gap: 16px; }
.cooling-heading h2 { margin: 0; }
.cooling-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; list-style: none; margin: 8px 0; padding: 0; }
.cooling-list li { display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 0 8px; }
.cooling-kind { color: var(--cool); font-size: 12px; line-height: 20px; }
.cooling-list b { font-size: 13px; line-height: 20px; font-weight: 550; }
.cooling-list div span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.cooling-list strong { grid-column: 2; font-size: 18px; line-height: 24px; font-weight: 500; }
.cooling-list small { font-size: 12px; font-weight: 400; color: var(--muted); }
.cooling-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.workflow-link { color: var(--cool); font-size: 12px; line-height: 16px; }
.brief-notes { position: relative; font-size: 12px; line-height: 16px; color: var(--muted); }
.brief-notes > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.brief-notes > summary::-webkit-details-marker { display: none; }
.brief-notes > summary::after { content: "＋"; margin-left: auto; flex: none; }
.brief-notes[open] > summary::after { content: "−"; }
.brief-notes > p { position: absolute; bottom: 24px; left: 0; z-index: 15; background: var(--paper); border: 1px solid var(--hair); padding: 16px; width: min(360px,75vw); margin: 0; color: var(--ink); box-shadow: 0 4px 16px #22303c12; }
.detail-source { flex: 0 0 auto; border-top: 1px solid var(--hair); padding-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted); margin: 0; }
@media (min-width: 1600px) and (min-height: 950px) {
  #area-detail { gap: 24px; padding-top: 24px; padding-bottom: 24px; }
  .detail-grid { gap: 24px 32px; }
  .detail-story { gap: 32px; padding-top: 16px; }
  .heat-facts { gap: 16px; }
  .heat-facts dd { font-size: 16px; line-height: 24px; }
  .people-facts { gap: 16px 24px; }
  .people-facts dd { font-size: 32px; line-height: 36px; }
  .detail-grid h2 { font-size: 20px; }
  .why-section h2 { flex-basis: 144px; }
  .detail-reasons p { font-size: 14px; line-height: 20px; }
  .checklist-block { font-size: 15px; line-height: 24px; padding: 24px 8px; }
  .checklist-block span span { font-size: 13px; line-height: 20px; }
  .cooling-list { margin: 16px 0; }
  .cooling-list b { font-size: 15px; line-height: 24px; }
}
@media (min-width: 821px) and (max-height: 780px) {
  #area-detail { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .area-title { padding-top: 8px; }
  .area-title .eyebrow { margin-bottom: 4px; }
  .detail-grid { row-gap: 8px; }
  .heat-facts { gap: 4px; }
  .checklist-block { padding-top: 8px; padding-bottom: 8px; }
}
@media (min-width: 821px) and (max-width: 1150px) {
  .area-title > div:first-child { grid-template-columns: 1fr; gap: 8px; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .detail-story { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .heat-facts > div { grid-template-columns: 88px minmax(0,1fr); gap: 0 8px; }
  .detail-reasons { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stop-cooling { grid-column: 2 / -1; }
  .checklist-block { grid-template-columns: 24px minmax(0,1fr) minmax(0,1fr); }
}
@media (max-width: 820px) {
  #area-detail { position: relative; padding: 16px 24px 24px; gap: 24px; }
  .detail-nav { gap: 8px; flex-wrap: wrap; }
  .detail-nav > span { order: 2; width: 100%; }
  .detail-nav button { padding: 8px; }
  .area-title { flex-direction: column; align-items: start; gap: 16px; }
  .area-title > div:first-child { display: block; }
  .area-title .eyebrow { margin-bottom: 8px; }
  #area-name { font-size: 36px; }
  .area-assignment { margin-top: 8px; }
  .area-alert { display: flex; align-items: center; gap: 16px; text-align: left; }
  .area-alert p { margin: 0; }
  .detail-grid { display: flex; flex-direction: column; gap: 24px; }
  .why-section { display: block; }
  .why-section h2 { margin-bottom: 8px; }
  .detail-reasons { grid-template-columns: 1fr; gap: 8px; }
  .detail-reasons p { font-size: 13px; line-height: 20px; padding-left: 0; border: 0; }
  .section-heading { flex-direction: column; align-items: start; gap: 8px; }
  .checklist-actions { gap: 8px; }
  #area-detail .checklist { flex: none; max-height: 480px; }
  .checklist-block { grid-template-columns: 24px minmax(0,1fr); gap: 8px 16px; padding: 16px 8px; }
  .stop-people, .stop-cooling { grid-column: 2; }
  .neighbourhood-map { flex: none; }
  #mini-map { flex: none; height: 288px; }
  #mini-selection { min-height: 0; }
  .detail-story { display: flex; flex-direction: column; gap: 24px; }
  .heat-facts { gap: 16px; }
  .heat-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .heat-facts .data-note { grid-column: 1; }
  .people-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .cooling-heading { display: block; }
  .cooling-list { grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
  .cooling-list li { grid-template-columns: 40px minmax(0,1fr) auto; }
  .cooling-list strong { grid-column: 3; grid-row: 1; }
  .cooling-list small { display: block; }
  .cooling-footer { align-items: start; flex-direction: column; gap: 16px; }
}
@media print {
  #area-detail { position: static; display: block; padding: 0; }
  .detail-grid, .detail-story { display: block; }
  .detail-grid > *, .detail-story > * { margin-bottom: 24px; }
  .detail-nav, .neighbourhood-map, .checklist-actions { display: none; }
  #area-detail .checklist { max-height: none; overflow: visible; }
  .brief-notes > p { position: static; box-shadow: none; }
}
/* Desktop working area: the full-height checklist sits beside the locator map
   and cooling destinations. The DOM retains the phone reading order. */
@media (min-width: 821px) {
  .detail-story { grid-template-columns: minmax(0,3fr) minmax(0,2fr); }
  .heat-facts { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
  .heat-facts > div { display: flex; flex-direction: column; align-items: start; gap: 4px; }
  .heat-facts > div + div { padding-left: 16px; border-left: 1px solid var(--hair); }
  .heat-facts dd { font-size: 14px; line-height: 20px; }
  .air-temperature dd span { display: block; margin: 0; }
  .checklist-section { grid-row: 3 / 5; }
  .neighbourhood-map { grid-row: 3; }
  .neighbourhood-map h2 { margin-bottom: 8px; }
  /* The row reserves the map's 160px floor plus its heading and legend. */
  .detail-grid { grid-template-rows: auto auto minmax(225px,1fr) auto; }
  #mini-map { min-height: 160px; }
  .neighbourhood-map { position: relative; }
  #mini-selection { position: absolute; bottom: 32px; left: 8px; right: 8px; z-index: 2; padding: 4px 8px; background: var(--paper); pointer-events: none; }
  #mini-selection:empty { display: none; }
  #mini-selection { min-height: 16px; margin-top: 4px; }
  .cooling-section { grid-column: 2; grid-row: 4; }
  .cooling-heading { flex-wrap: wrap; gap: 0 8px; }
  .cooling-list { grid-template-columns: 1fr; gap: 4px; margin: 8px 0; }
  .cooling-list li { grid-template-columns: 40px minmax(0,1fr) auto; gap: 8px; }
  .cooling-list strong { grid-column: 3; grid-row: 1; font-size: 16px; line-height: 20px; }
  .cooling-list div span { display: none; }
  .cooling-footer { flex-wrap: wrap; gap: 4px 16px; }
  .cooling-footer .brief-notes { order: 2; }
  .cooling-footer .brief-notes > p { left: auto; right: 0; }
}

.heat-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.heat-notes { display: none; }
#area-detail .workflow-link { margin-top: 0; }
@media (min-width: 821px) and (max-height: 780px) {
  .heat-notes { display: block; }
  .heat-notes > p { top: 24px; bottom: auto; left: auto; right: 0; }
  .heat-facts .data-note { display: none; }
  .detail-grid h2 { margin-bottom: 4px; }
  .people-facts dd { font-size: 22px; line-height: 24px; }
  .people-facts { gap: 0 16px; }
  .cooling-list li { line-height: 20px; }
  .cooling-list { margin: 4px 0 8px; }
  .cooling-heading h2 { margin-bottom: 0; }
}
@media (min-width: 821px) {
  #detail-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 32px; }
  .area-title { grid-column: 1; grid-row: 1; padding-top: 0; }
  .area-title > div:first-child { display: block; }
  .area-assignment { margin-top: 8px; }
  .detail-nav { grid-column: 2; grid-row: 1; max-width: 320px; flex-wrap: wrap; gap: 8px 16px; padding: 0; border: 0; }
  .detail-nav > span { order: 2; width: 100%; text-align: right; }
}
@media (min-width: 821px) and (max-height: 780px) {
  .cooling-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .cooling-list li { grid-template-columns: auto minmax(0,1fr); gap: 0 4px; }
  .cooling-list strong { grid-column: 2; grid-row: 2; }
  .area-title > div:first-child { display: grid; grid-template-columns: auto auto; gap: 0 16px; }
  .area-assignment { margin-top: 0; }
  .area-alert { align-self: start; }
}
@media (min-width: 821px) { .why-section h2 { margin-bottom: 0; } }
@media (min-width: 821px) and (max-width: 1150px) and (min-height: 781px) and (max-height: 950px) {
  #area-detail { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .detail-grid { row-gap: 8px; }
  .heat-notes { display: block; }
  .heat-notes > p { top: 24px; bottom: auto; left: auto; right: 0; }
  .heat-facts .data-note { display: none; }
  .people-facts dd { font-size: 22px; line-height: 24px; }
}

/* Inset rings stay visible inside clipped map and scrolling-list boundaries. */
:is(.map canvas, #mini-map canvas, .ranking button, .checklist-block):focus-visible { outline-offset:-4px; box-shadow:inset 0 0 0 2px var(--focus-halo) !important; }
@media(max-width:820px) {
  .bivariate-grid button { width:40px; height:40px; }
  .bivariate-grid { grid-template-columns:repeat(3,40px); }
}

/* Keep the shared demo note with methodology in the scrollable ranking rail. */
.method .hg-footer { padding:0; }
.method .hg-about summary { border:0; padding:10px 0; }
.method .hg-about-body p { font-size:var(--text-xs); }

