.sm-atlas{--sm-ocean:#e5f1f4;--sm-coast:#9cb9bc;--sm-ground:#f7f8ed;--sm-grid:#7f9faa;--sm-card:#ffffff;--sm-ink:#172f47;--sm-muted:#465e6a}
.dark .sm-atlas{--sm-ocean:#172f42;--sm-coast:#62898d;--sm-ground:#2e4948;--sm-grid:#839eaa;--sm-card:#253649;--sm-ink:#f5f8fd;--sm-muted:#c1d0da}
.sm-pagehead,.sm-toolbar,.sm-attribution,.sm-legend{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.sm-pagehead,.sm-attribution{justify-content:space-between}.sm-pagehead{margin-bottom:18px}.sm-pagehead h1,.sm-pagehead p{margin:0}.sm-pagehead p{color:var(--mut)}
.sm-surface{border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--card)}.sm-toolbar{padding:16px}
.sm-atlas .late,.sm-popup .late{--sm-tone:#ae3e32;--sm-tint:#ffe7e2}.sm-atlas .ahead,.sm-popup .ahead{--sm-tone:#245caa;--sm-tint:#e0ebff}.sm-atlas .done,.sm-popup .done{--sm-tone:#187155;--sm-tint:#d8f1e7}.sm-atlas .on,.sm-popup .on{--sm-tone:#925500;--sm-tint:#fff0c2}.sm-atlas .unknown,.sm-popup .unknown{--sm-tone:#53616d;--sm-tint:#e9edf0}
.sm-map-scroll{overflow-x:auto;overscroll-behavior-x:contain;background:var(--sm-ocean)}
.sm-map-svg{display:block;width:100%;min-width:690px;max-height:590px;font-family:inherit}.sm-water{fill:var(--sm-ocean)}.sm-land{fill:var(--sm-ground);stroke:var(--sm-coast);stroke-width:1.7}.sm-grid path{stroke:var(--sm-grid);stroke-width:.7;opacity:.34;stroke-dasharray:3 4}.sm-grid text,.sm-north text{font-size:12px;fill:var(--sm-muted)}.sm-north{fill:var(--sm-muted);font-weight:700}.sm-site{cursor:pointer}.sm-site circle{fill:var(--sm-tone);stroke:white;stroke-width:2}.sm-symbol{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.sm-leader{fill:none;stroke:var(--sm-tone);stroke-width:1.6}.sm-site rect{fill:var(--sm-card);stroke:var(--sm-tone);stroke-width:1.2}.sm-site text{font-size:12px;fill:var(--sm-ink);font-weight:700}.sm-site .sm-caption{font-size:11px;fill:var(--sm-muted);font-weight:600}.sm-site:focus{outline:none}.sm-site:hover rect,.sm-site:focus rect{stroke-width:3}.sm-attribution{font-size:11px;padding:7px 14px;color:var(--mut);background:var(--card)}
.sm-popup dt,.sm-metrics span{color:var(--mut);font-size:12px}
.sm-status{display:inline-block;max-width:100%;background:var(--sm-tint);color:var(--sm-tone)!important;font-size:12px;font-weight:650;line-height:1.4;border-radius:999px;padding:3px 9px}
.sm-popup{padding:14px 0}.sm-popup dl{display:grid;grid-template-columns:max-content 1fr;gap:8px 16px;margin:18px 0}.sm-popup dd{margin:0;overflow-wrap:anywhere}.sm-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:16px 0}.sm-metrics div{padding:9px 12px;border:1px solid var(--line);border-radius:10px}.sm-metrics b,.sm-metrics span{display:block}.sm-external{color:inherit;font-weight:600}.sm-toolbar button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
@media(max-width:650px){.sm-toolbar{align-items:flex-start;gap:12px}.sm-legend{row-gap:8px}}
.sm-district{fill:var(--sm-ground);stroke:var(--sm-coast);stroke-width:.9;cursor:pointer;touch-action:manipulation}
.sm-district.sm-populated{fill:#d4e9e2}.dark .sm-district.sm-populated{fill:#36605e}
.sm-district:hover,.sm-district:focus-visible{fill:#f7d57b;stroke:#806224;stroke-width:2;outline:0}
.dark .sm-district:hover,.dark .sm-district:focus-visible{fill:#8c733b;stroke:#ffe196}
.sm-grid,.sm-leader,.sm-north{pointer-events:none}
.sm-popup button.sm-district-site{min-width:0;white-space:normal;overflow-wrap:anywhere;width:100%;text-align:start;background:var(--card);color:var(--ink);display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin-top:8px}
.sm-district-site small{grid-column:1/-1;color:var(--mut)}
.sm-count{display:inline-grid;align-items:center;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;min-width:min(240px,100%);border:1px solid var(--line);border-radius:14px;background:var(--card);color:var(--ink);margin:18px 0 12px;padding:12px 16px;box-shadow:var(--lift)}
.sm-atlas .sm-count h2{margin:0;font-size:14px;font-weight:650}.sm-count strong{font-size:24px;font-variant-numeric:tabular-nums;line-height:1.15}
.sm-count-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#fff0b9;color:#775515}.sm-count-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7}

/* Keep the register independent of the map's wider, scrollable canvas. */
.sm-list {
  container-type: inline-size;
  --sm-columns: minmax(0,2.3fr) minmax(0,.9fr) minmax(0,1fr) minmax(0,1.15fr) 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.sm-list ul { list-style: none; margin: 0; padding: 0; }
.sm-list li + li { border-top: 1px solid var(--line); }
.sm-list-head, .sm-atlas .sm-list button.sm-card {
  display: grid;
  grid-template-columns: var(--sm-columns);
  align-items: center;
  gap: 10px 16px;
  padding: 12px 18px;
}
.sm-list-head { color: var(--mut); background: var(--soft,var(--bg)); font-size: 12px; font-weight: 600; }
.sm-atlas .sm-list button.sm-card {
  width: 100%;
  min-width: 0;
  justify-content: start;
  color: var(--ink);
  background: var(--card);
  text-align: start;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sm-atlas .sm-list button.sm-card:hover, .sm-atlas .sm-list button.sm-card:focus-visible { background: var(--soft,var(--bg)); }
.sm-atlas .sm-list button.sm-card:focus-visible { outline: 2px solid var(--sm-muted); outline-offset: -3px; }
.sm-card > span, .sm-list-identity { min-width: 0; }
.sm-list-project { display: flex; align-items: center; gap: 12px; }
.sm-list-identity { display: grid; gap: 2px; }
.sm-list-identity small { color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.sm-list-identity strong { font-size: 14px; font-weight: 650; }
.sm-list-glyph {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft,var(--bg)); color: var(--sm-ink);
}
.sm-list-glyph svg, .sm-list-arrow { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sm-list-glyph svg { width: 18px; height: 18px; }
.sm-list-coords { color: var(--mut); font-size: 13px; font-variant-numeric: tabular-nums; }
.sm-list-district small, .sm-list-coords small { display: none; }
.sm-list-arrow { color: var(--mut); width: 16px; height: 16px; }
.sm-list-empty { padding: 18px; margin: 0; border: 1px dashed var(--line); border-radius: 12px; color: var(--mut); }
@container (max-width: 740px) {
  .sm-list-head { display: none; }
  .sm-atlas .sm-list button.sm-card {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 16px;
    grid-template-areas: "project project arrow" "district status status" "coords coords coords";
    align-items: start;
    gap: 6px 12px;
    padding: 14px 16px;
  }
  .sm-list-project { grid-area: project; }
  .sm-list-arrow { grid-area: arrow; align-self: center; }
  .sm-list-district { grid-area: district; }
  .sm-list-status { grid-area: status; justify-self: end; align-self: center; text-align: end; }
  .sm-list-coords { grid-area: coords; }
  .sm-list-district small, .sm-list-coords small {
    display: inline; margin-inline-end: .45em; color: var(--mut); font-size: 12px; font-weight: 500;
  }
}


.sm-atlas .sm-toolbar {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.sm-operation-field {
  display: grid;
  width: min(100%, 25rem);
  gap: 5px;
  font-size: 13px;
  font-weight: 650;
}
.sm-operation-field .select2-container { width: 100%; min-width: 0; max-width: 100%; }
.sm-toolbar .sm-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,8.75rem),1fr));
  align-items: stretch;
  gap: 6px;
}
.sm-legend .sm-key {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb,var(--sm-tint,var(--soft)) 55%,var(--card));
  color: var(--ink);
  text-align: start;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}
.sm-key-title { min-width: 0; font-weight: 600; }
.sm-key b {
  min-width: 1.5em;
  border-radius: 1em;
  background: var(--sm-tint,var(--bg));
  text-align: center;
  color: var(--sm-tone,var(--ink));
  font-variant-numeric: tabular-nums;
}
.sm-key-types { grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 16px; color: var(--sm-tone,var(--mut)); }
.sm-type-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.sm-legend .sm-key[aria-pressed=true] { box-shadow: inset 0 -3px var(--sm-tone,var(--ink)); background: var(--sm-tint,var(--soft)); }
.sm-legend .sm-key:hover { background: var(--sm-tint,var(--soft)); }
.sm-legend .sm-key:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.sm-status .sm-type-icon { margin-inline-end: 4px; width: 14px; height: 14px; }
@media (max-width: 600px) {
  .sm-operation-field { width: 100%; }
  .sm-toolbar .sm-legend { grid-template-columns: repeat(auto-fit,minmax(min(100%,7.5rem),1fr)); }
}

/* The light workspace uses a navy basemap with its own cartographic palette. */
@media screen {
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll {
    --sm-ocean: #0d1c36;
    --sm-ground: #213957;
    --sm-coast: #8ea8c2;
    --sm-grid: #6d8dad;
    --sm-card: #132642;
    --sm-ink: #f1f6ff;
    --sm-muted: #c6d7e9;
    color-scheme: dark;
  }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .sm-district.sm-populated {
    fill: #2a4b6b;
  }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .sm-district:is(:hover, :focus-visible) {
    fill: #775f32; stroke: #ffe191;
  }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .late { --sm-tone: #ffb7af; }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .ahead { --sm-tone: #a7d0ff; }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .on { --sm-tone: #ffdf83; }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .done { --sm-tone: #93e2bc; }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .unknown { --sm-tone: #c2cfdd; }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .sm-site :is(circle, .sm-symbol) {
    stroke: #102039;
  }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-map-scroll .sm-caption { fill: var(--sm-tone); }
  :where(body:not(.locked, .dark, .pg-transparent) .sm-atlas) .sm-attribution {
    background: #112340; color: #c6d7e9;
  }
}
