/* Scoped map surface. Leaflet's pinned stylesheet must be loaded first. */
.solar-map { --sm-bg: #11191b; --sm-raised: #203034; --sm-line: #6b87834d; --sm-ink: #f2faf6; --sm-muted: #b2c7c2; width: 100%; min-width: 0; max-width: 100%; color: var(--sm-ink); font: 14px/1.5 system-ui, sans-serif; letter-spacing: 0; }
.solar-map *, .solar-map *::before, .solar-map *::after { box-sizing: border-box; letter-spacing: 0; }
.solar-map [hidden] { display: none !important; }
.solar-map h2 { font-size: 22px; line-height: 1.3; margin: 0; }
.solar-map h3 { font-size: 18px; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.solar-map h4 { font-size: 14px; margin: 0 0 12px; font-weight: 650; }
.solar-map p { margin: 0; }
.solar-map button, .solar-map select, .solar-map input { font: inherit; }
.solar-map button, .solar-map select { min-height: 44px; min-width: 44px; max-width: 100%; color: var(--sm-ink); border: 1px solid var(--sm-line); border-radius: 4px; background: var(--sm-bg); cursor: pointer; }
.solar-map button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; }
.solar-map button:hover:not(:disabled) { background: var(--sm-raised); border-color: #73dff5; }
.solar-map button:disabled, .solar-map input:disabled { cursor: default; opacity: .45; }
.solar-map button:focus-visible, .solar-map select:focus-visible, .solar-map input:focus-visible, .solar-map a:focus-visible, .solar-map .sm-pin:focus-visible { outline: 3px solid #73dff5; outline-offset: 3px; }
.solar-map .sm-action > svg, .solar-map .sm-icon-button > svg { width: 20px; height: 20px; flex: 0 0 20px; }
.solar-map .sm-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 10px 0 16px; }
.solar-map .sm-muted, .solar-map .sm-caveat { color: var(--sm-muted); overflow-wrap: anywhere; }
.solar-map .sm-caveat { font-size: 12px; line-height: 1.6; }
.solar-map .sm-snapshot { color: var(--sm-muted); font-size: 12px; }
.solar-map .sm-snapshot[data-state="stale"], .solar-map .sm-snapshot[data-state="unknown"] { color: #f5c66f; }
.solar-map .sm-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 312px; min-width: 0; border-block: 1px solid var(--sm-line); }
.solar-map .sm-stage { position: relative; min-width: 0; height: 620px; isolation: isolate; overflow: hidden; background: #202b2b; }
.solar-map .sm-canvas { width: 100%; height: 100%; min-width: 0; background: #b8c5c1; font: inherit; }
.solar-map .sm-dark .sm-canvas { background: #222c2d; }
/* Never filter the whole map: radio colors and overlay meaning must not change. */
.solar-map .sm-dark .sm-basemap { filter: invert(1) hue-rotate(175deg) saturate(.5) brightness(.85) contrast(.9); }
.solar-map .sm-map-tools { position: absolute; z-index: 800; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.solar-map .sm-icon-button { width: 44px; height: 44px; padding: 10px; flex: 0 0 44px; box-shadow: 0 2px 8px #0003; }
.solar-map .sm-layers { position: absolute; z-index: 801; top: 12px; right: 64px; width: 224px; max-width: calc(100% - 76px); padding: 8px; border: 1px solid var(--sm-line); border-radius: 4px; background: var(--sm-bg); box-shadow: 0 4px 16px #0005; }
.solar-map .sm-layers label { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; font-size: 13px; }
.solar-map .sm-layers input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: #f5c66f; }
.solar-map .sm-layer-badges { position: absolute; z-index: 700; left: 12px; right: 64px; top: 12px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; pointer-events: none; }
.solar-map .sm-layer-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; min-height: 30px; max-width: 100%; border: 1px solid #829b9859; border-radius: 4px; background: #142022eb; color: #f5dfae; font-size: 12px; }
.solar-map .sm-layer-badge svg { width: 16px; height: 16px; flex-basis: 16px; }
.solar-map .sm-model-badge { color: #f5c66f; pointer-events: auto; cursor: help; }
.solar-map .sm-model-ring { width: 16px; height: 16px; flex: 0 0 16px; border: 2px dashed #f5c66f; border-radius: 50%; }
.solar-map .sm-pin { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding-top: 6px; border: 0; background: transparent; }
.solar-map .sm-pin-content { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.solar-map .sm-pin-body { display: flex; align-items: center; justify-content: center; position: relative; width: 32px; height: 32px; border: 2px solid var(--sm-node); border-radius: 50%; background: #142022; color: var(--sm-node); box-shadow: 0 2px 6px #0009; }
.solar-map .sm-pin-body { flex: 0 0 32px; }
.solar-map .sm-pin-voltage { --sm-voltage-color: #adbdbb; display: grid; justify-items: center; width: 52px; padding: 2px 3px; border-radius: 3px; background: #10191bf2; color: var(--sm-voltage-color); box-shadow: 0 1px 3px #0008; }
.solar-map .sm-pin[data-voltage-band="green"] .sm-pin-voltage { --sm-voltage-color: #8ee66c; }
.solar-map .sm-pin[data-voltage-band="yellow"] .sm-pin-voltage { --sm-voltage-color: #ffd36b; }
.solar-map .sm-pin[data-voltage-band="red"] .sm-pin-voltage { --sm-voltage-color: #ff8686; }
.solar-map .sm-pin[data-voltage-band="check"] .sm-pin-voltage { --sm-voltage-color: #d1b2ff; }
.solar-map .sm-voltage-bar { display: block; width: 44px; height: 5px; overflow: hidden; border: 1px solid #b9d0c966; background: #293a3c; }
.solar-map .sm-voltage-bar > span { display: block; width: 100%; height: 100%; background: var(--sm-voltage-color); transform: scaleX(var(--sm-voltage-fill, 0)); transform-origin: left; }
.solar-map .sm-pin-value { font-size: 11px; font-weight: 650; line-height: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.solar-map .sm-pin[data-voltage-stale="true"] .sm-voltage-bar > span { opacity: .55; background: repeating-linear-gradient(90deg, var(--sm-voltage-color) 0 3px, transparent 3px 5px); }
.solar-map .sm-voltage-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 0; color: var(--sm-muted); font-size: 12px; }
.solar-map .sm-voltage-key span { display: inline-flex; align-items: center; gap: 6px; }
.solar-map .sm-voltage-key i { display: inline-block; width: 18px; height: 5px; background: var(--key-color); }
.solar-map .sm-pin-body svg { width: 18px; height: 18px; flex-basis: 18px; }
.solar-map .sm-pin.is-selected .sm-pin-body { outline: 2px solid #fff; outline-offset: 3px; }
.solar-map .sm-pin-status { position: absolute; width: 9px; height: 9px; border: 1px solid #142022; border-radius: 50%; right: -3px; bottom: -1px; background: #ced8d5; }
.solar-map .sm-pin[data-reading="fresh"] .sm-pin-status { background: #8be0bc; }
.solar-map .sm-pin[data-reading="delayed"] .sm-pin-status, .solar-map .sm-pin[data-reading="stale"] .sm-pin-status { border-radius: 0; background: #f5c66f; }
.solar-map .sm-pin[data-reading="missing"] .sm-pin-status, .solar-map .sm-pin[data-reading="offline"] .sm-pin-status { border-radius: 0; background: #ffaaa9; }
/* The positioning pane has no intrinsic width; auto plus anywhere shrinks to one character. */
.solar-map .sm-pin-tooltip { width: max-content; max-width: 240px; white-space: normal; overflow-wrap: break-word; word-break: normal; color: var(--sm-ink); background: var(--sm-bg); border: 1px solid #718680; box-shadow: 0 2px 8px #0004; }
.solar-map .sm-inspector { height: 620px; min-width: 0; padding: 16px; overflow-y: auto; scrollbar-gutter: stable; border-left: 1px solid var(--sm-line); background: var(--sm-bg); }
.solar-map .sm-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 18px; color: var(--sm-muted); }
.solar-map .sm-picker select { width: 100%; min-width: 0; padding: 8px; }
.solar-map .sm-back-map { display: none; }
.solar-map .sm-inspector, .solar-map .sm-canvas { scroll-margin-block-start: 16px; }
.solar-map .sm-radio-heading { display: flex; gap: 8px; align-items: baseline; }
.solar-map .sm-swatch { display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; border-radius: 2px; }
.solar-map .sm-reading { font-size: 12px; color: #f5c66f; padding-block: 8px 12px; }
.solar-map .sm-reading[data-reading="fresh"] { color: #8be0bc; }
.solar-map .sm-reading[data-reading="missing"], .solar-map .sm-reading[data-reading="offline"] { color: #ffaaa9; }
.solar-map .sm-voltage-label { font-size: 12px; color: var(--sm-muted); }
.solar-map .sm-voltage { font-size: 32px; line-height: 1.4; font-weight: 650; font-variant-numeric: tabular-nums; }
.solar-map .sm-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.solar-map .sm-metrics > div { min-width: 0; }
.solar-map dt { font-size: 12px; color: var(--sm-muted); }
.solar-map dd { margin: 3px 0 0; color: var(--sm-ink); font-size: 14px; overflow-wrap: anywhere; }
.solar-map .sm-details > .sm-action { width: 100%; color: #73dff5; margin: 0 0 4px; }
.solar-map .sm-sun-section, .solar-map .sm-weather-section, .solar-map .sm-location { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--sm-line); }
.solar-map .sm-bearing { display: flex; align-items: center; gap: 16px; }
.solar-map .sm-compass { position: relative; width: 64px; height: 64px; flex: 0 0 64px; border: 1px solid #698680; border-radius: 50%; }
.solar-map .sm-north { position: absolute; top: -8px; left: 25px; color: var(--sm-muted); background: var(--sm-bg); padding: 0 2px; font-size: 10px; }
.solar-map .sm-sun-arrow { position: absolute; inset: 16px; display: flex; align-items: center; justify-content: center; color: #f5c66f; }
.solar-map .sm-sun-arrow svg { width: 28px; height: 28px; flex-basis: 28px; }
.solar-map .sm-source-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; color: #73dff5; overflow-wrap: anywhere; text-underline-offset: 3px; }
.solar-map .sm-alerts { color: #f5c66f; font-size: 13px; margin: 16px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.solar-map .sm-empty { position: absolute; z-index: 650; top: 45%; left: 20px; right: 70px; text-align: center; color: var(--sm-ink); background: #142022e8; padding: 12px; pointer-events: none; }
.solar-map .sm-tile-notice { position: absolute; z-index: 650; left: 12px; right: 12px; bottom: 54px; padding: 8px; color: #f5c66f; background: #142022ed; font-size: 12px; pointer-events: none; }
.solar-map .leaflet-control-attribution { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0 4px; max-width: 100%; margin: 0; padding: 0 8px; background: #142022ed; color: var(--sm-muted); font-size: 10px; }
.solar-map .leaflet-control-attribution a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: #b9e8ef; text-decoration: underline; }
.solar-map .leaflet-bottom { max-width: 100%; }
.solar-map .sm-timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--sm-line); }
.solar-map .sm-modes { display: inline-flex; flex: 0 0 auto; gap: 0; }
.solar-map .sm-modes button { border-radius: 0; }
.solar-map .sm-modes button:first-child { border-radius: 4px 0 0 4px; }
.solar-map .sm-modes button:last-child { border-radius: 0 4px 4px 0; }
.solar-map .sm-modes button[aria-pressed="true"] { border-color: #a8ceae; color: #c8eccb; background: #243832; }
.solar-map .sm-solar-time { color: #f5dfae; font-size: 13px; }
.solar-map .sm-preview-controls { display: flex; flex: 1 1 260px; min-width: 0; gap: 12px; align-items: center; }
.solar-map .sm-preview-slider { flex: 1; min-width: 0; height: 44px; padding: 0; accent-color: #f5c66f; }
.solar-map .sm-timeline > .sm-caveat { flex: 1 1 100%; }
.solar-map .sm-unmapped { padding: 18px 0; }
.solar-map .sm-unmapped h3 { font-size: 15px; margin-bottom: 10px; }
.solar-map .sm-unmapped-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; }
.solar-map .sm-unmapped-list button { display: grid; grid-template-columns: 20px minmax(0, 1fr); justify-content: start; text-align: left; background: transparent; border: 0; border-left: 2px solid var(--sm-node); border-radius: 0; padding: 8px 12px; }
.solar-map .sm-unmapped-list small { grid-column: 2; color: var(--sm-muted); font-size: 12px; }
.solar-map .sm-unmapped-list button[aria-pressed="true"] { background: var(--sm-raised); }
.solar-map .sm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .solar-map .sm-workspace { grid-template-columns: minmax(0, 1fr); }
  .solar-map .sm-stage { height: 440px; }
  .solar-map .sm-inspector { height: auto; padding: 18px 12px; overflow: visible; border-left: 0; border-top: 1px solid var(--sm-line); }
  .solar-map .sm-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .solar-map .sm-details > * { grid-column: 1 / -1; min-width: 0; }
  .solar-map .sm-details > .sm-sun-section { grid-column: 1; }
  .solar-map .sm-details > .sm-weather-section { grid-column: 2; }
  .solar-map .sm-unmapped-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .solar-map .sm-back-map { display: inline-flex; margin-bottom: 16px; }
}
@media (max-width: 480px) {
  .solar-map .sm-stage { height: 380px; }
  .solar-map .sm-heading { align-items: flex-start; }
  .solar-map .sm-heading h2 { font-size: 20px; }
  .solar-map .sm-details { display: block; }
  .solar-map .sm-map-tools { right: 8px; top: 8px; }
  .solar-map .sm-layer-badges { left: 8px; top: 8px; }
  .solar-map .sm-layer-badge { font-size: 11px; padding: 4px 6px; }
  .solar-map .sm-unmapped-list { grid-template-columns: minmax(0, 1fr); }
  .solar-map .sm-tile-notice { bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .solar-map *, .solar-map *::before, .solar-map *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
