:root {
  color-scheme: light;
  --ink-950: #0b1d29;
  --ink-900: #102636;
  --ink-800: #17384b;
  --ink-700: #285064;
  --ink-600: #476a7c;
  --ink-500: #668493;
  --ink-300: #b9c8cf;
  --ink-200: #d4dfe3;
  --ink-100: #e9eff1;
  --ink-050: #f4f7f7;
  --paper: #ffffff;
  --canvas: #edf2f2;
  --teal: #0d766e;
  --teal-dark: #075a55;
  --teal-soft: #dff2ef;
  --red: #c8353e;
  --red-dark: #9d202b;
  --red-soft: #fae7e7;
  --amber: #c3760a;
  --amber-soft: #fff1d3;
  --green: #2c7a51;
  --green-soft: #def1e6;
  --blue: #31739b;
  --blue-soft: #e2f0f7;
  --shadow-sm: 0 1px 2px rgb(11 29 41 / 8%), 0 3px 12px rgb(11 29 41 / 6%);
  --shadow-md: 0 8px 28px rgb(11 29 41 / 16%), 0 2px 8px rgb(11 29 41 / 10%);
  --shadow-lg: 0 24px 60px rgb(11 29 41 / 26%), 0 6px 18px rgb(11 29 41 / 12%);
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --header-height: 88px;
  --sidebar-width: clamp(340px, 27vw, 410px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--canvas);
  color: var(--ink-950);
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.leaflet-interactive:focus-visible,
.leaflet-marker-icon:focus-visible,
#map:focus-visible {
  outline: 3px solid #54b7dd;
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-950);
  box-shadow: var(--shadow-md);
  font-weight: 750;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.masthead {
  position: relative;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(440px, 1.5fr) auto;
  align-items: center;
  height: var(--header-height);
  padding: 12px 20px;
  color: #f7fbfc;
  background:
    radial-gradient(circle at 34% -20%, rgb(45 118 136 / 34%), transparent 36%),
    linear-gradient(112deg, #0c202d 0%, #102d3c 52%, #0e2734 100%);
  border-bottom: 3px solid #cc3c45;
  box-shadow: 0 2px 15px rgb(11 29 41 / 24%);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.maple-mark {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px 10px 10px 3px;
  background: var(--red);
  color: #fff;
  font-size: 17px;
  transform: rotate(45deg);
}

.maple-mark::first-letter {
  transform: rotate(-45deg);
}

.eyebrow,
.section-kicker {
  margin: 0 0 2px;
  color: #8eb5c4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-block h1 {
  overflow: hidden;
  margin: 0;
  font-size: clamp(18px, 1.45vw, 25px);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 4px 8px;
  border: 1px solid rgb(178 215 206 / 25%);
  border-radius: 999px;
  background: rgb(255 255 255 / 7%);
  color: #bfe8dd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53d39a;
  box-shadow: 0 0 0 3px rgb(83 211 154 / 14%);
}

.live-state[data-state="loading"] .live-dot {
  background: #f2c45c;
  animation: live-pulse 1.2s ease-in-out infinite;
}

.live-state[data-state="degraded"] {
  color: #ffd792;
}

.live-state[data-state="degraded"] .live-dot {
  background: #e9a329;
}

.live-state[data-state="history"] {
  color: #ffd792;
}

.live-state[data-state="history"] .live-dot {
  background: #e2a43e;
  box-shadow: 0 0 0 3px rgb(226 164 62 / 14%);
}

.live-state[data-state="error"] {
  color: #ffbbc0;
}

.live-state[data-state="error"] .live-dot {
  background: #f0525c;
}

@keyframes live-pulse {
  50% { opacity: 0.42; transform: scale(0.8); }
}

.headline-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(95px, 1fr));
  min-width: 0;
  margin: 0 18px;
}

.headline-metric {
  min-width: 0;
  padding: 2px 18px;
  border-left: 1px solid rgb(191 219 228 / 15%);
}

.headline-metric:first-child {
  border-left: 0;
}

.headline-metric dt {
  overflow: hidden;
  margin-bottom: 1px;
  color: #91adba;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.headline-metric dd {
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-size: clamp(19px, 1.5vw, 27px);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-time dd {
  font-size: clamp(14px, 1.15vw, 19px);
  letter-spacing: -0.015em;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.view-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgb(217 235 240 / 20%);
  border-radius: 10px;
  background: rgb(3 16 24 / 28%);
}

.view-tab {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #a9c4ce;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.view-tab svg {
  width: 15px;
  height: 15px;
}

.view-tab:hover { color: #f7fbfc; background: rgb(255 255 255 / 8%); }

.view-tab[aria-selected="true"] {
  background: #f2f7f8;
  color: var(--ink-900);
  box-shadow: 0 1px 4px rgb(0 0 0 / 24%);
}

.button,
.icon-button,
.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 720;
  transition: background 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.button:active,
.icon-button:active,
.map-button:active {
  transform: translateY(1px);
}

.button {
  min-height: 39px;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  background: #f6fafb;
  color: var(--ink-900);
}

.button-primary:hover {
  background: #dfecef;
}

.button-secondary {
  border: 1px solid var(--ink-200);
  background: var(--paper);
  color: var(--ink-800);
}

.button-secondary:hover {
  background: var(--ink-050);
  border-color: var(--ink-300);
}

.masthead .button-secondary {
  border-color: rgb(217 235 240 / 24%);
  background: rgb(255 255 255 / 8%);
  color: #eaf5f7;
}

.masthead .button-secondary:hover {
  background: rgb(255 255 255 / 14%);
}

.icon-button {
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid rgb(217 235 240 / 24%);
  background: rgb(255 255 255 / 8%);
  color: #eaf5f7;
}

.icon-button:hover {
  background: rgb(255 255 255 / 14%);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.refreshing .refresh-icon {
  animation: spin 850ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: calc(100% - var(--header-height));
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  position: relative;
  z-index: 900;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  border-right: 1px solid var(--ink-200);
  box-shadow: 4px 0 18px rgb(11 29 41 / 8%);
  transition: opacity 120ms ease, visibility 120ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  opacity: 0;
  visibility: hidden;
}

.sidebar-scroll {
  width: var(--sidebar-width);
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--ink-300) transparent;
  scrollbar-width: thin;
}

.mobile-sidebar-close {
  display: none;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid var(--ink-100);
}

.search-section {
  padding-top: 18px;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.section-kicker {
  color: var(--ink-600);
}

.section-heading-row h2,
.dialog-header h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.text-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
  color: var(--ink-300);
  font-size: 11px;
}

.text-actions button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 750;
}

.text-actions button:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.search-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.search-form > svg {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--ink-500);
  pointer-events: none;
}

.search-form input {
  min-width: 0;
  height: 41px;
  padding: 8px 10px 8px 38px;
  border: 1px solid var(--ink-300);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--paper);
}

.search-form input::placeholder {
  color: var(--ink-500);
}

.search-form button {
  padding: 0 13px;
  border: 1px solid var(--teal-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.search-form button:hover {
  background: var(--teal-dark);
}

.helper-text,
.list-summary,
.dialog-subtitle {
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 11px;
}

.data-notice {
  align-items: flex-start;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 11px 12px;
  border: 1px solid #e7c16e;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #714400;
}

.data-notice:not([hidden]) {
  display: flex;
}

.data-notice[data-level="error"] {
  border-color: #e8a4a9;
  background: var(--red-soft);
  color: #7e2028;
}

.data-notice svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.data-notice p {
  margin: 0;
  font-size: 11px;
  font-weight: 620;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-group + .filter-group {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--ink-100);
}

.filter-group > legend {
  width: 100%;
  margin-bottom: 9px;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap select,
.compact-select select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.select-wrap select {
  height: 39px;
  padding: 7px 36px 7px 11px;
}

.select-wrap svg {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  color: var(--ink-600);
  pointer-events: none;
}

.province-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.check-row {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 35px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-800);
}

.check-row:hover {
  border-color: var(--ink-200);
  background: var(--ink-050);
}

.check-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--teal);
}

.check-label {
  overflow: hidden;
  min-width: 0;
  flex: 1;
  font-size: 12px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-count {
  flex: 0 0 auto;
  min-width: 23px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: center;
}

.utility-groups {
  display: grid;
  gap: 7px;
}

.utility-province {
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
}

.utility-province summary {
  display: flex;
  min-height: 37px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--ink-050);
  color: var(--ink-800);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

.utility-province summary::-webkit-details-marker { display: none; }

.utility-province summary::before {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.utility-province[open] summary::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.utility-province summary .summary-count {
  margin-left: auto;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 680;
}

.utility-items {
  padding: 5px;
  border-top: 1px solid var(--ink-200);
}

.utility-items .check-row {
  min-height: 34px;
}

.utility-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  flex: 1;
}

.utility-name {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-freshness {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-dot,
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-300);
}

.source-dot[data-status="healthy"],
.status-dot[data-status="healthy"] { background: var(--green); }
.source-dot[data-status="stale"],
.status-dot[data-status="stale"] { background: var(--amber); }
.source-dot[data-status="historical"],
.status-dot[data-status="historical"] { background: #a87fcb; }
.source-dot[data-status="failed"],
.status-dot[data-status="failed"] { background: var(--red); }
.source-dot[data-status="disabled"],
.status-dot[data-status="disabled"] { background: var(--ink-400, #8198a3); }
.source-dot[data-status="not_ingestible"],
.status-dot[data-status="not_ingestible"],
.source-dot[data-status="research_required"],
.status-dot[data-status="research_required"] { background: #775b9c; }

.outage-list-section {
  padding-bottom: 28px;
}

.list-heading-row {
  align-items: center;
  margin-bottom: 4px;
}

.compact-select select {
  max-width: 146px;
  height: 33px;
  padding: 5px 27px 5px 8px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-600) 50%), linear-gradient(135deg, var(--ink-600) 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 650;
}

.list-summary {
  margin: 0 0 10px;
}

.outage-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 7px;
  list-style: none;
}

.outage-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: 0 1px 2px rgb(11 29 41 / 3%);
}

.outage-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--severity-colour, var(--ink-500));
  content: "";
}

.outage-card-button {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 11px 10px 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
}

.outage-card-button:hover {
  background: var(--ink-050);
}

.outage-utility {
  overflow: hidden;
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outage-customer-count {
  color: var(--ink-950);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 790;
  letter-spacing: -0.02em;
  line-height: 1;
}

.outage-customer-label {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

.outage-card-detail {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--ink-600);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outage-card-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 9px;
}

.outage-freshness {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.3;
}

.outage-freshness[data-status="stale"] { color: #8a5709; font-weight: 720; }
.outage-freshness[data-status="failed"] { color: var(--red-dark); font-weight: 720; }

.outage-card-footer .list-only-label {
  margin-left: auto;
  color: var(--ink-600);
  font-weight: 700;
}

.show-more {
  width: 100%;
  margin-top: 10px;
}

.empty-state {
  padding: 26px 16px;
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  color: var(--ink-600);
  font-size: 12px;
  text-align: center;
}

.map-workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #dbe6e8;
}

#map {
  width: 100%;
  height: 100%;
  background: #dbe6e8;
}

.leaflet-container {
  color: var(--ink-900);
  font: inherit;
}

.leaflet-control-zoom {
  overflow: hidden;
  margin-top: 76px !important;
  margin-left: 14px !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
  color: var(--ink-800) !important;
}

.leaflet-control-attribution {
  max-width: 65vw;
  background: rgb(255 255 255 / 86%) !important;
  color: var(--ink-600) !important;
  font-size: 9px !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--paper);
  color: var(--ink-900);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content-wrapper {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.leaflet-popup-content {
  width: min(310px, 74vw) !important;
  margin: 0 !important;
}

.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  z-index: 2;
  width: 27px !important;
  height: 27px !important;
  border-radius: 50%;
  background: rgb(255 255 255 / 90%) !important;
  color: var(--ink-800) !important;
  font-size: 21px !important;
  line-height: 25px !important;
}

.outage-popup-header {
  padding: 16px 43px 13px 16px;
  border-bottom: 1px solid var(--ink-100);
  background: linear-gradient(135deg, var(--ink-050), #fff);
}

.outage-popup-header .popup-province {
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.outage-popup-header h3 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.popup-impact {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
}

.popup-impact strong {
  color: var(--severity-colour, var(--ink-950));
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.popup-impact span {
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 700;
}

.popup-stale {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #714400;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.popup-stale[data-source-status="failed"] {
  background: var(--red-soft);
  color: var(--red-dark);
}

.popup-history {
  display: inline-block;
  margin-top: 8px;
  margin-right: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #efe5f6;
  color: #674782;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.popup-details {
  display: grid;
  margin: 0;
  padding: 11px 16px 13px;
  gap: 0;
}

.popup-details > div {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-100);
}

.popup-details > div:last-child { border-bottom: 0; }
.popup-details dt { color: var(--ink-500); font-size: 9px; font-weight: 700; }
.popup-details dd { margin: 0; color: var(--ink-800); font-size: 10px; font-weight: 650; text-align: right; }

.popup-official-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-top: 1px solid var(--ink-100);
  background: var(--ink-050);
  color: var(--teal-dark) !important;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.popup-official-link:hover { text-decoration: underline; }
.popup-official-link svg { width: 14px; height: 14px; }

.outage-marker-wrap {
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
}

.outage-marker {
  display: grid;
  width: var(--marker-size);
  height: var(--marker-size);
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 9%;
  background: var(--severity-colour);
  box-shadow: 0 2px 6px rgb(11 29 41 / 37%), 0 0 0 1px rgb(11 29 41 / 18%);
  color: #fff;
  font-size: var(--marker-font);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1;
  text-shadow: 0 1px 1px rgb(0 0 0 / 26%);
  transform: rotate(-45deg);
}

.outage-marker > span {
  transform: rotate(45deg);
}

.outage-marker-wrap.is-polygon-proxy .outage-marker {
  border-radius: 4px;
  transform: rotate(45deg);
}

.outage-marker-wrap.is-polygon-proxy .outage-marker > span {
  transform: rotate(-45deg);
}

.severity-1 { --severity-colour: #2e8298; --marker-size: 22px; --marker-font: 8px; }
.severity-2 { --severity-colour: #3568a0; --marker-size: 26px; --marker-font: 8px; }
.severity-3 { --severity-colour: #c17b0c; --marker-size: 30px; --marker-font: 8px; }
.severity-4 { --severity-colour: #d44a32; --marker-size: 35px; --marker-font: 9px; }
.severity-5 { --severity-colour: #a6172c; --marker-size: 42px; --marker-font: 9px; }
.severity-unknown { --severity-colour: #677985; --marker-size: 24px; --marker-font: 10px; }

.outage-path {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marker-cluster {
  display: grid !important;
  place-items: center;
  border: 0;
  background: transparent !important;
}

.marker-cluster > div {
  display: grid;
  box-sizing: border-box;
  width: var(--cluster-size, 56px);
  height: var(--cluster-size, 56px);
  margin: 0 !important;
  overflow: hidden;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 92%);
  border-radius: 50%;
  background: linear-gradient(145deg, #173e51, #102a39) !important;
  box-shadow: 0 4px 14px rgb(11 29 41 / 36%), 0 0 0 5px rgb(16 42 57 / 16%);
  color: #fff;
  line-height: 1;
}

.marker-cluster .cluster-label {
  display: grid;
  width: calc(var(--cluster-size, 56px) - 12px);
  min-width: 0;
  place-items: center;
  gap: 2px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.marker-cluster .cluster-events {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 1px;
  line-height: 1;
  white-space: nowrap;
}

.marker-cluster .cluster-count {
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.marker-cluster .cluster-unit {
  display: block;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.marker-cluster .cluster-customers {
  color: #b9d7df;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.map-toolbar {
  position: absolute;
  z-index: 700;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 7px;
}

.map-button {
  min-height: 42px;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgb(185 200 207 / 88%);
  background: rgb(255 255 255 / 95%);
  box-shadow: var(--shadow-md);
  color: var(--ink-800);
  font-size: 11px;
  backdrop-filter: blur(7px);
}

.map-button:hover { background: var(--paper); }
.map-button svg { width: 17px; height: 17px; }

#mobileFilters { display: none; }

.filter-count {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
}

.map-legend {
  position: absolute;
  z-index: 700;
  right: 14px;
  bottom: 70px;
  width: 178px;
  overflow: hidden;
  border: 1px solid rgb(185 200 207 / 88%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 95%);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.legend-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legend-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 130ms ease;
}

.legend-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
.legend-toggle[aria-expanded="false"] + .legend-body { display: none; }

.legend-body {
  padding: 0 12px 11px;
  border-top: 1px solid var(--ink-100);
}

.legend-body ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 9px 0 5px;
  gap: 7px 8px;
  list-style: none;
}

.legend-body li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 650;
}

.legend-symbol {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--severity-colour);
  box-shadow: 0 1px 3px rgb(11 29 41 / 27%);
  color: #fff;
  font-size: 7px;
  font-weight: 850;
}

.legend-body p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 8px;
}

.map-data-chip {
  position: absolute;
  z-index: 700;
  top: 15px;
  right: 14px;
  padding: 6px 9px;
  border: 1px solid rgb(185 200 207 / 82%);
  border-radius: 999px;
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
  color: var(--ink-700);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  backdrop-filter: blur(7px);
}

.history-panel {
  position: absolute;
  z-index: 720;
  right: 14px;
  bottom: 45px;
  left: 14px;
  padding: 11px 13px;
  overflow: hidden;
  border: 1px solid rgb(190 217 225 / 24%);
  border-radius: 26px;
  background: rgb(9 25 36 / 95%);
  box-shadow: var(--shadow-lg);
  color: #f6fbfc;
  backdrop-filter: blur(12px);
  transition: border-color 140ms ease, background 140ms ease;
}

.history-panel[data-mode="history"],
.history-panel[data-mode="playing"] {
  border-color: rgb(242 190 88 / 68%);
  background: rgb(12 31 42 / 96%);
}

.history-panel[data-mode="empty"] {
  border-color: rgb(190 217 225 / 18%);
}

.history-controls {
  display: grid;
  grid-template-columns: auto auto auto minmax(220px, 1fr) minmax(126px, auto) minmax(130px, 185px);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.history-live-button,
.history-icon-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(202 224 230 / 28%);
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #e9f4f6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-live-button {
  gap: 6px;
  padding: 0 12px;
}

.history-icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-color: rgb(111 170 255 / 70%);
  background: #3679cf;
  color: #fff;
}

.history-live-button:hover:not(:disabled),
.history-icon-button:hover:not(:disabled) {
  border-color: rgb(202 224 230 / 48%);
  background: rgb(255 255 255 / 14%);
}

.history-icon-button:hover:not(:disabled) {
  border-color: #91bdff;
  background: #4389e2;
}

.history-live-button[aria-pressed="true"] {
  border-color: rgb(83 211 154 / 52%);
  background: rgb(48 135 93 / 25%);
  color: #dff9ed;
}

.history-live-button:disabled,
.history-icon-button:disabled,
.history-speed select:disabled,
.history-scrubber:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.history-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53d39a;
  box-shadow: 0 0 0 3px rgb(83 211 154 / 13%);
}

.history-icon-button svg {
  width: 16px;
  height: 16px;
}

.history-panel[data-mode="playing"] .history-icon-button {
  border-color: #91bdff;
  background: #2868bc;
  color: #fff;
}

.history-scrubber-wrap {
  --history-progress: 1;
  position: relative;
  min-width: 0;
  height: 62px;
  isolation: isolate;
}

.history-chart {
  position: absolute;
  z-index: 0;
  inset: 3px 0 15px;
  overflow: hidden;
  border-bottom: 1px solid rgb(154 188 205 / 16%);
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(5% - 1px),
    rgb(151 185 202 / 10%) 5%
  );
  pointer-events: none;
}

.history-trend {
  display: block;
  width: 100%;
  height: 100%;
}

.history-trend-area {
  fill: rgb(78 140 211 / 26%);
}

.history-trend-line {
  fill: none;
  stroke: #72a9e6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.history-selection-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--history-progress) * 100%);
  width: 2px;
  border-radius: 999px;
  background: #f5b72f;
  box-shadow: 0 0 0 1px rgb(10 25 35 / 35%);
  transform: translateX(-1px);
}

.history-scrubber {
  position: absolute;
  z-index: 2;
  inset: 0 0 14px;
  appearance: none;
  width: 100%;
  height: auto;
  margin: 0;
  background: transparent;
  accent-color: #f5b72f;
}

.history-scrubber:not(:disabled) {
  cursor: ew-resize;
}

.history-scrubber::-webkit-slider-runnable-track {
  height: 2px;
  border: 0;
  background: transparent;
}

.history-scrubber::-webkit-slider-thumb {
  width: 13px;
  height: 30px;
  margin-top: -14px;
  appearance: none;
  border: 2px solid #ffd86d;
  border-radius: 999px;
  background: #eaaa1f;
  box-shadow: 0 1px 4px rgb(0 0 0 / 45%);
}

.history-scrubber::-moz-range-track {
  height: 2px;
  border: 0;
  background: transparent;
}

.history-scrubber::-moz-range-thumb {
  width: 10px;
  height: 27px;
  border: 2px solid #ffd86d;
  border-radius: 999px;
  background: #eaaa1f;
  box-shadow: 0 1px 4px rgb(0 0 0 / 45%);
}

.history-range-labels {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(var(--history-tick-count, 2), minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  color: #8faab6;
  font-size: 7px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.15;
}

.history-range-labels time {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-range-labels time:first-child { text-align: left; }
.history-range-labels time:last-child { text-align: right; }

.history-readout {
  min-width: 0;
  padding-left: 3px;
  border-left: 1px solid rgb(183 211 221 / 16%);
}

.history-timestamp {
  display: grid;
  color: #e8f4f6;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
}

.history-timestamp strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-timestamp span {
  overflow: hidden;
  margin-top: 3px;
  color: #9db6c0;
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-event-count {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #f2bb42;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-availability {
  overflow: hidden;
  margin: 2px 0 0;
  color: #7898a6;
  font-size: 7px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-speed {
  display: block;
}

.history-speed select,
.history-provider select {
  height: 40px;
  padding: 0 9px;
  border: 1px solid rgb(202 224 230 / 28%);
  border-radius: 10px;
  background: #102939;
  color: #f3fafb;
  font-size: 10px;
  font-weight: 760;
}

.history-speed select { width: 55px; }

.history-provider {
  display: block;
  min-width: 0;
}

.history-provider select {
  width: 100%;
  text-overflow: ellipsis;
}

.history-speed select:focus-visible,
.history-provider select:focus-visible,
.history-live-button:focus-visible,
.history-icon-button:focus-visible,
.history-scrubber:focus-visible {
  outline: 2px solid #8cc1ff;
  outline-offset: 2px;
}

.map-disclaimer {
  position: absolute;
  z-index: 700;
  bottom: 11px;
  left: 50%;
  width: min(670px, calc(100% - 390px));
  margin: 0;
  padding: 6px 10px;
  border-radius: 5px;
  background: rgb(15 38 52 / 85%);
  box-shadow: var(--shadow-sm);
  color: #ecf5f6;
  font-size: 8px;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}

.search-result-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 7px;
  background: var(--teal);
  box-shadow: 0 3px 9px rgb(11 29 41 / 38%);
  transform: rotate(-45deg);
}

.search-result-marker::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.restoration-view {
  height: calc(100% - var(--header-height));
  overflow: hidden;
  background:
    radial-gradient(circle at 90% -15%, rgb(72 145 164 / 15%), transparent 34%),
    var(--canvas);
}

.restoration-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--ink-300) transparent;
  scrollbar-width: thin;
}

.restoration-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(410px, 0.9fr);
  align-items: end;
  gap: 34px;
  padding: 30px clamp(24px, 4vw, 64px) 26px;
  border-bottom: 1px solid var(--ink-200);
  background: rgb(255 255 255 / 74%);
}

.restoration-title-block h2 {
  margin: 2px 0 7px;
  color: var(--ink-950);
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 790;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.restoration-title-block > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--ink-600);
  font-size: 13px;
}

.restoration-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.restoration-summary > div {
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid var(--ink-100);
}

.restoration-summary > div:first-child { border-left: 0; }

.restoration-summary dt {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.restoration-summary dd {
  margin: 3px 0 0;
  color: var(--ink-900);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 790;
  letter-spacing: -0.035em;
}

.restoration-content {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 64px) 48px;
}

.restoration-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.restoration-control-group {
  display: flex;
  flex: 1 1 720px;
  min-width: 0;
  align-items: end;
  gap: 12px;
}

.restoration-control-group label {
  display: grid;
  min-width: 190px;
  gap: 5px;
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.restoration-control-group label:first-child { width: min(360px, 38vw); }

.restoration-control-group select {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 10px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
}

.restoration-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.restoration-download { text-decoration: none; }

.restoration-performance {
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.restoration-performance-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.restoration-performance-header h3 {
  margin: 1px 0 0;
  color: var(--ink-950);
  font-size: 20px;
  letter-spacing: -0.025em;
}

.restoration-performance-header > p {
  max-width: 520px;
  margin: 0;
  color: var(--ink-600);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.restoration-performance-state {
  display: grid;
  min-height: 118px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  background: var(--ink-050);
  color: var(--ink-600);
  font-size: 12px;
  text-align: center;
}

.restoration-performance-state[data-state="loading"]::before {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 3px solid var(--ink-200);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
  content: "";
}

.restoration-performance-state[data-state="error"] {
  border-color: #e5a4a8;
  background: var(--red-soft);
  color: var(--red-dark);
}

.restoration-performance-content {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(430px, 1.22fr);
  gap: 14px;
}

.restoration-score-card,
.restoration-outcome-figure {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: #fbfdfd;
}

.restoration-score-heading-row,
.restoration-outcome-figure figcaption {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.restoration-score-heading-row h4 {
  margin: 0;
  color: var(--ink-950);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 810;
  letter-spacing: -0.045em;
  line-height: 1;
}

.restoration-score-heading-row h4 span:last-child {
  color: var(--ink-500);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.restoration-score-heading-row > p {
  max-width: 150px;
  margin: 2px 0 0;
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 720;
  text-align: right;
}

.restoration-score-gauge {
  position: relative;
  height: 17px;
  margin-top: 17px;
  overflow: hidden;
  border: 1px solid var(--ink-300);
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgb(31 54 66 / 20%) calc(25% - 1px) 25%),
    var(--ink-100);
}

.restoration-score-gauge > span {
  display: block;
  width: 0;
  height: 100%;
  border-right: 2px solid var(--ink-950);
  background:
    repeating-linear-gradient(135deg, rgb(255 255 255 / 0%) 0 6px, rgb(255 255 255 / 32%) 6px 9px),
    var(--teal);
  transition: width 220ms ease;
}

.restoration-score-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 7px;
  font-variant-numeric: tabular-nums;
}

.restoration-score-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 13px 0 0;
  border-top: 1px solid var(--ink-100);
}

.restoration-score-details > div {
  min-width: 0;
  padding: 11px 9px 0;
  border-left: 1px solid var(--ink-100);
}

.restoration-score-details > div:first-child { padding-left: 0; border-left: 0; }

.restoration-score-details dt {
  color: var(--ink-500);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restoration-score-details dd {
  margin: 3px 0 0;
  color: var(--ink-800);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  line-height: 1.2;
}

.restoration-outcome-figure figcaption strong {
  display: block;
  color: var(--ink-900);
  font-size: 13px;
}

.restoration-outcome-figure figcaption span {
  display: block;
  max-width: 330px;
  color: var(--ink-500);
  font-size: 9px;
  text-align: right;
}

.restoration-outcome-chart {
  position: relative;
  display: flex;
  height: 34px;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--ink-300);
  border-radius: 7px;
  background: var(--ink-100);
}

.restoration-outcome-chart > span {
  width: 0;
  min-width: 0;
  border-right: 2px solid var(--paper);
  transition: width 220ms ease;
}

.restoration-outcome-chart > span:last-child { border-right: 0; }

.restoration-outcome-chart[data-empty="true"]::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  content: "No outcomes in this selection";
  font-size: 9px;
  font-weight: 700;
}

.restoration-outcome-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.restoration-outcome-legend li {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  align-items: center;
  gap: 3px 6px;
  min-width: 0;
  color: var(--ink-600);
  font-size: 8px;
  line-height: 1.15;
}

.restoration-outcome-legend strong {
  grid-column: 2;
  color: var(--ink-900);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.outcome-swatch {
  grid-row: 1 / span 2;
  width: 13px;
  height: 24px;
  border: 1px solid var(--ink-400);
  border-radius: 3px;
}

.restoration-outcome-chart [data-outcome="early"],
.restoration-outcome-legend [data-outcome="early"] .outcome-swatch {
  background: #2b8194;
}

.restoration-outcome-chart [data-outcome="window"],
.restoration-outcome-legend [data-outcome="window"] .outcome-swatch {
  background:
    repeating-linear-gradient(135deg, transparent 0 5px, rgb(26 54 66 / 42%) 5px 7px),
    #9fcbd5;
}

.restoration-outcome-chart [data-outcome="late"],
.restoration-outcome-legend [data-outcome="late"] .outcome-swatch {
  background:
    repeating-linear-gradient(45deg, transparent 0 4px, rgb(89 23 30 / 38%) 4px 6px),
    repeating-linear-gradient(135deg, #f0aa9f 0 4px, #c86559 4px 6px);
}

.restoration-outcome-chart [data-outcome="overdue"],
.restoration-outcome-legend [data-outcome="overdue"] .outcome-swatch {
  background-color: #b53242;
  background-image: radial-gradient(circle, #fff 1px, transparent 1.5px);
  background-size: 7px 7px;
}

.restoration-outcome-chart [data-outcome="not-due"],
.restoration-outcome-legend [data-outcome="not-due"] .outcome-swatch {
  background:
    repeating-linear-gradient(0deg, #f0ca71 0 3px, #fff2c9 3px 6px);
}

.restoration-score-method {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
  color: var(--ink-600);
  font-size: 10px;
}

.restoration-score-method summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink-800);
  font-weight: 780;
}

.restoration-score-method p {
  max-width: 1040px;
  margin: 8px 0 0;
  line-height: 1.5;
}

.restoration-results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.restoration-results-heading h3 {
  margin: 0;
  color: var(--ink-950);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.restoration-results-heading > p {
  margin: 0;
  color: var(--ink-600);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.restoration-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 58%);
  color: var(--ink-600);
  font-size: 13px;
  text-align: center;
}

.restoration-state[data-state="loading"]::before {
  width: 22px;
  height: 22px;
  margin-right: 9px;
  border: 3px solid var(--ink-200);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
  content: "";
}

.restoration-state[data-state="error"] {
  border-color: #e5a4a8;
  background: var(--red-soft);
  color: var(--red-dark);
}

.restoration-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.restoration-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.restoration-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--ink-200);
  background: #f5f8f8;
  color: var(--ink-600);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
}

.restoration-table th:first-child { width: 225px; }
.restoration-table th:nth-child(2) { width: 92px; }
.restoration-table th:nth-child(7) { width: 110px; }
.restoration-table th:nth-child(8) { width: 130px; }

.restoration-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}

.restoration-table tr:last-child td { border-bottom: 0; }
.restoration-table tbody tr:hover { background: #f8fafa; }

.restoration-utility {
  display: block;
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 770;
}

.restoration-outage-id,
.restoration-cell-note {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 8px;
  line-height: 1.25;
}

.restoration-location {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-600);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restoration-status-badge,
.restoration-revised-tag,
.restoration-variance {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 820;
  white-space: nowrap;
}

.restoration-status-badge { padding: 4px 7px; text-transform: uppercase; }
.restoration-status-badge[data-status="active"] { background: var(--amber-soft); color: #8d5506; }
.restoration-status-badge[data-status="past"] { background: var(--green-soft); color: var(--green); }

.restoration-revised-tag {
  margin-top: 5px;
  padding: 2px 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.restoration-revised-tag[data-estimate-state="withdrawn"] {
  background: var(--amber-soft);
  color: #8d5506;
}

.restoration-variance {
  max-width: 118px;
  padding: 4px 7px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}
.restoration-variance[data-variance="early"] { background: var(--green-soft); color: var(--green); }
.restoration-variance[data-variance="late"] { background: var(--red-soft); color: var(--red-dark); }
.restoration-variance[data-variance="on-time"] { background: var(--ink-100); color: var(--ink-700); }
.restoration-variance[data-variance="active"] { background: var(--amber-soft); color: #8d5506; }
.restoration-variance[data-variance="window"] { background: var(--blue-soft); color: var(--blue); }
.restoration-variance[data-variance="unknown"] { background: var(--ink-100); color: var(--ink-600); }

.restoration-load-more {
  margin: 16px auto 0;
}

.restoration-method {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--blue-soft);
  color: var(--ink-700);
}

.restoration-method h3 {
  margin: 0 0 4px;
  color: var(--ink-900);
  font-size: 11px;
}

.restoration-method p { margin: 0; font-size: 10px; }

body[data-view="restoration"] #sidebarToggle,
body[data-view="restoration"] #coverageOpen,
body[data-view="restoration"] #refreshButton { display: none; }

.coverage-dialog {
  width: min(1040px, calc(100vw - 44px));
  max-height: min(760px, calc(100vh - 44px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  color: var(--ink-950);
}

.coverage-dialog::backdrop {
  background: rgb(5 17 24 / 58%);
  backdrop-filter: blur(3px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--ink-200);
  background: var(--ink-050);
}

.dialog-subtitle { margin-top: 4px; }

.dark-icon-button {
  flex: 0 0 auto;
  border-color: var(--ink-200);
  background: var(--paper);
  color: var(--ink-800);
}

.dark-icon-button:hover { background: var(--ink-100); }

.coverage-table-wrap {
  max-height: calc(min(760px, 100vh - 44px) - 93px);
  overflow: auto;
}

.coverage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.coverage-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 10px 13px;
  border-bottom: 1px solid var(--ink-300);
  background: var(--paper);
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
}

.coverage-table td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
  vertical-align: middle;
}

.coverage-table tbody tr:hover { background: var(--ink-050); }
.coverage-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.coverage-utility { color: var(--ink-900); font-weight: 740; }

.coverage-status-cell { min-width: 160px; }

.coverage-source-error {
  display: block;
  max-width: 260px;
  margin-top: 4px;
  color: var(--ink-600);
  font-size: 8px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.status-label[data-status="healthy"] { color: var(--green); }
.status-label[data-status="stale"] { color: #98600b; }
.status-label[data-status="failed"] { color: var(--red-dark); }

.toast {
  position: fixed;
  z-index: 10000;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink-950);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
}

.toast[data-type="error"] { background: #7d1f28; }

.noscript-message {
  position: fixed;
  z-index: 20000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--paper);
  color: var(--ink-900);
  font-size: 18px;
  text-align: center;
}

@media (max-width: 1320px) {
  :root { --header-height: 82px; }
  .masthead { grid-template-columns: minmax(235px, 0.82fr) minmax(440px, 1.6fr) auto; padding-inline: 14px; }
  .maple-mark { width: 31px; height: 31px; }
  .live-state { display: none; }
  .headline-metrics { margin-inline: 7px; }
  .headline-metric { padding-inline: 12px; }
  .masthead .button span { display: none; }
  .masthead .button { width: 39px; padding-inline: 0; }
  .history-panel { right: 14px; }
  .map-legend { bottom: 151px; }
  .restoration-hero { grid-template-columns: minmax(300px, 1fr) minmax(360px, 0.9fr); gap: 22px; }
  .restoration-summary > div { padding-inline: 12px; }
  .restoration-outcome-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  :root { --header-height: 112px; --sidebar-width: min(88vw, 390px); }
  .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 48px 42px;
    padding: 7px 10px 8px;
  }
  .brand-block h1 { font-size: 19px; }
  .brand-block .eyebrow { display: none; }
  .headline-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    border-top: 1px solid rgb(191 219 228 / 12%);
  }
  .headline-metric { padding: 6px 9px 0; }
  .headline-metric:first-child { padding-left: 1px; }
  .headline-metric dt { font-size: 8px; }
  .headline-metric dd { font-size: 17px; }
  .metric-time dd { font-size: 12px; line-height: 1.55; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .view-tab { padding-inline: 8px; }
  #sidebarToggle { display: none; }
  .app-shell { display: block; }
  .sidebar {
    position: absolute;
    z-index: 1500;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    height: auto;
    transform: translateX(-104%);
    transition: transform 180ms ease, visibility 180ms ease;
  }
  .mobile-sidebar-close {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink-700);
    box-shadow: var(--shadow-sm);
  }
  .mobile-sidebar-close:hover { background: var(--ink-050); }
  .mobile-sidebar-close svg { width: 17px; height: 17px; }
  body.mobile-sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-collapsed .sidebar { opacity: 1; visibility: visible; }
  body.mobile-sidebar-open::after {
    position: fixed;
    z-index: 1400;
    inset: var(--header-height) 0 0;
    background: rgb(5 17 24 / 38%);
    content: "";
  }
  .map-workspace { width: 100%; height: 100%; }
  #mobileFilters { display: inline-flex; }
  .map-disclaimer {
    width: min(520px, calc(100% - 34px));
    max-height: 25px;
    padding: 2px 8px;
    overflow: hidden;
    bottom: 14px;
  }
  .map-legend { bottom: 190px; }
  .history-panel { right: 10px; bottom: 39px; left: 10px; border-radius: 20px; }
  .history-controls {
    grid-template-columns: auto auto auto minmax(120px, 1fr) minmax(130px, 170px);
  }
  .history-live-button { grid-column: 1; grid-row: 1; }
  .history-icon-button { grid-column: 2; grid-row: 1; }
  .history-speed { grid-column: 3; grid-row: 1; }
  .history-readout { grid-column: 4; grid-row: 1; }
  .history-provider { grid-column: 5; grid-row: 1; }
  .history-scrubber-wrap { grid-column: 1 / -1; grid-row: 2; }
  .restoration-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 18px;
    padding: 22px 18px 18px;
  }
  .restoration-title-block > p:last-child { max-width: none; }
  .restoration-content { padding: 18px 12px 36px; }
  .restoration-toolbar { align-items: stretch; }
  .restoration-control-group { flex: 1 1 auto; }
  .restoration-control-group label:first-child { width: auto; flex: 1 1 auto; }
  .restoration-actions { width: 100%; justify-content: flex-end; }
  .restoration-performance { padding: 16px; }
  .restoration-performance-content { grid-template-columns: 1fr; }
  .restoration-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .restoration-table,
  .restoration-table tbody { display: block; width: 100%; min-width: 0; }
  .restoration-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .restoration-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .restoration-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
  }
  .restoration-table td {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    border-top: 1px solid var(--ink-100);
  }
  .restoration-table td::before {
    color: var(--ink-500);
    content: attr(data-label);
    font-size: 7px;
    font-weight: 820;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .restoration-table td:first-child {
    grid-column: 1 / -1;
    border-top: 0;
    background: #f7f9f9;
  }
  .restoration-table td:nth-child(2) { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  :root { --header-height: 105px; }
  .masthead { grid-template-rows: 43px 43px; }
  .maple-mark { width: 27px; height: 27px; border-radius: 8px 8px 8px 2px; font-size: 13px; }
  .brand-block { gap: 8px; }
  .brand-block h1 { font-size: 17px; }
  .view-tab { width: 36px; min-height: 34px; padding: 0; }
  .view-tab span { display: none; }
  .view-tab svg { width: 16px; height: 16px; }
  .headline-metric { padding-inline: 6px; }
  .headline-metric:nth-child(3) { border-left: 1px solid rgb(191 219 228 / 15%); }
  .headline-metric dt { font-size: 7px; letter-spacing: 0.04em; }
  .headline-metric dd { font-size: 15px; }
  .metric-time dd { font-size: 10px; }
  .sidebar-section { padding: 17px 16px; }
  .province-grid { gap: 4px; }
  .map-data-chip { top: 66px; right: 10px; }
  .map-toolbar { top: 10px; left: 10px; }
  .leaflet-control-zoom { margin-top: 61px !important; margin-left: 10px !important; }
  .map-legend { right: 10px; bottom: 246px; width: 158px; }
  .map-disclaimer { bottom: 14px; }
  .history-panel { right: 8px; bottom: 40px; left: 8px; padding: 9px; border-radius: 17px; }
  .history-controls { grid-template-columns: auto auto auto minmax(0, 1fr); gap: 6px; }
  .history-live-button,
  .history-icon-button { height: 40px; }
  .history-live-button { padding-inline: 8px; }
  .history-icon-button { width: 40px; }
  .history-speed select { width: 49px; padding-inline: 5px; }
  .history-readout { grid-column: 4; grid-row: 1; }
  .history-timestamp strong { font-size: 15px; }
  .history-availability { display: none; }
  .history-scrubber-wrap { grid-column: 1 / -1; grid-row: 2; }
  .history-provider { grid-column: 1 / -1; grid-row: 3; }
  .history-provider select { height: 38px; }
  .history-range-labels time:nth-child(n + 4):not(:last-child) { display: none; }
  .restoration-hero { padding: 17px 13px 15px; }
  .restoration-title-block h2 { font-size: 23px; }
  .restoration-title-block > p:last-child { font-size: 11px; }
  .restoration-summary > div { padding: 10px 8px; }
  .restoration-summary dt { font-size: 7px; }
  .restoration-summary dd { font-size: 20px; }
  .restoration-content { padding: 14px 8px 30px; }
  .restoration-toolbar { display: grid; padding: 10px; }
  .restoration-control-group { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .restoration-control-group label,
  .restoration-control-group label:first-child { width: 100%; min-width: 0; }
  .restoration-toolbar .button { width: 100%; }
  .restoration-actions { display: grid; grid-template-columns: 1fr; }
  .restoration-performance { padding: 12px; }
  .restoration-performance-header { display: grid; gap: 5px; }
  .restoration-performance-header > p { max-width: none; text-align: left; }
  .restoration-score-heading-row { display: grid; gap: 7px; }
  .restoration-score-heading-row > p { max-width: none; text-align: left; }
  .restoration-score-details { grid-template-columns: 1fr; }
  .restoration-score-details > div,
  .restoration-score-details > div:first-child { padding: 9px 0; border-left: 0; border-bottom: 1px solid var(--ink-100); }
  .restoration-score-details > div:last-child { border-bottom: 0; }
  .restoration-outcome-figure figcaption { display: grid; gap: 3px; }
  .restoration-outcome-figure figcaption span { max-width: none; text-align: left; }
  .restoration-outcome-legend { grid-template-columns: 1fr; }
  .restoration-results-heading { align-items: start; }
  .restoration-results-heading > p { max-width: 45%; font-size: 9px; }
  .restoration-table tbody { grid-template-columns: 1fr; }
  .restoration-method { margin-top: 18px; }
  .coverage-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: var(--radius-md); }
  .dialog-header { padding: 15px; }
  .coverage-table-wrap { max-height: calc(100vh - 103px); }
  .coverage-table th:nth-child(2),
  .coverage-table td:nth-child(2),
  .coverage-table th:nth-child(5),
  .coverage-table td:nth-child(5) { display: none; }
  .coverage-table th,
  .coverage-table td { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .outage-marker,
  .legend-symbol,
  .source-dot,
  .status-dot,
  .live-dot { forced-color-adjust: none; }
  .outage-card::before { width: 7px; }
}
