/* Helisep Commercial UI — Industrial Authority 2.0 */
:root {
  --ink: #0F2042;
  --ink-2: #243858;
  --muted: #617086;
  --paper: #F1F5F9;
  --surface: #FFFFFF;
  --surface-strong: #FFFFFF;
  --line: #D6DEE8;
  --line-strong: #AEBAC8;
  --brand: #2A8FF2;
  --brand-dark: #0F2042;
  --brand-soft: #E9F4FF;
  --science: #2A8FF2;
  --science-soft: #E9F4FF;
  --infrastructure: #FF7A00;
  --infrastructure-soft: #FFF0E2;
  --target: #C29B68;
  --target-soft: #F6EEDF;
  --platinum: #F1F5F9;
  --amber: #FF7A00;
  --cyan: #2A8FF2;
  --navy: #0F2042;
  --buff: #C29B68;
  --success: #26734D;
  --success-soft: #E7F3EC;
  --danger: #A43E4B;
  --danger-soft: #FBEAEC;
  --shadow-sm: 0 2px 8px rgba(15,32,66,.10);
  --shadow-lg: 0 18px 50px rgba(15,32,66,.22);
  --topbar: 68px;
  --sidebar: 370px;
}

body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  background: var(--platinum);
  color: var(--navy);
}

/* Brand header */
.topbar {
  grid-template-columns: minmax(300px, 390px) minmax(300px, 700px) auto;
  min-height: var(--topbar);
  padding: 8px 16px;
  gap: 18px;
  background: #fff;
  border-bottom: 3px solid var(--navy);
  box-shadow: 0 3px 0 rgba(42,143,242,.18);
  backdrop-filter: none;
}
.brand-block { gap: 14px; }
.brand-lockup {
  display: inline-flex;
  align-items: center;
  width: 144px;
  height: 46px;
  flex: 0 0 144px;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
}
.brand-lockup img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.brand-copy { padding-left: 14px; border-left: 1px solid var(--line); }
.brand-copy h1 { font-size: 15px; font-weight: 800; letter-spacing: .015em; text-transform: uppercase; }
.brand-copy p { margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }

.search-input {
  height: 42px;
  border-radius: 4px;
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: none;
  font-size: 12px;
}
.search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(42,143,242,.14); }
.search-results { border-radius: 4px; border-top: 3px solid var(--cyan); }
.search-item { border-radius: 2px; }
.search-item:hover, .search-item:focus { background: var(--brand-soft); }
.search-shortcut { border-radius: 3px; background: var(--platinum); }

.top-action {
  min-height: 36px;
  border-radius: 3px;
  color: var(--navy);
  font-size: 10px;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.top-action:hover { background: var(--platinum); }
.top-action-icon { border-radius: 3px; border-color: var(--line-strong); }
.admin-action { background: var(--navy); color: white; }
.admin-action:hover { background: #172E57; color: white; }
.admin-action strong { background: var(--amber); color: var(--navy); }
.status-dot { background: var(--cyan); box-shadow: 0 0 0 3px rgba(42,143,242,.15); }

/* Sidebar hierarchy */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line-strong);
  box-shadow: 6px 0 18px rgba(15,32,66,.07);
}
.sidebar-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .12em; }
.sidebar-head h2 { font-size: 18px; font-weight: 800; }
.view-picker { gap: 0; padding: 0; border-bottom: 1px solid var(--line); }
.view-card {
  grid-template-columns: 38px minmax(0,1fr);
  gap: 10px;
  min-height: 62px;
  padding: 10px 18px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.view-card + .view-card { border-top: 1px solid #E6EBF1; }
.view-card:hover { transform: none; background: #F8FAFC; box-shadow: none; }
.view-card.active,
.view-card[data-view="science"].active,
.view-card[data-view="infrastructure"].active {
  border-color: var(--cyan);
  background: var(--brand-soft);
  box-shadow: none;
}
.view-card[data-view="infrastructure"].active { border-color: var(--amber); background: var(--infrastructure-soft); }
.view-card[data-view="science"].active { border-color: var(--cyan); background: var(--science-soft); }
.view-icon { width: 30px; height: 30px; border-radius: 2px; font-size: 17px; }
.view-icon-opportunities { color: #fff; background: var(--navy); }
.view-icon-science { color: #fff; background: var(--cyan); }
.view-icon-infrastructure { color: #fff; background: var(--amber); }
.view-card strong { font-size: 12px; letter-spacing: .015em; }
.view-card small { font-size: 10px; }
.friendly-summary {
  margin: 12px 14px 10px;
  padding: 10px 12px;
  border-radius: 2px;
  border-left: 3px solid var(--cyan);
  background: var(--platinum);
}
.quick-actions { padding-bottom: 12px; }
.btn {
  min-height: 36px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.btn:hover { transform: none; }
.btn-primary { background: var(--navy); }
.btn-primary:hover { background: #172E57; }
.btn-secondary { border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--cyan); color: var(--navy); }
.icon-button { border-radius: 3px; }
.featured-starts {
  margin: 0 14px 12px;
  padding: 12px;
  border-radius: 3px;
  border-color: var(--line-strong);
  border-top: 3px solid var(--buff);
  background: #fff;
  box-shadow: none;
}
.featured-list { gap: 5px; }
.featured-list button { border-radius: 2px; border-color: var(--line); }
.featured-list button:hover, .featured-list button:focus-visible { transform: none; border-color: var(--cyan); box-shadow: none; background: var(--brand-soft); }
.control-group summary { min-height: 46px; letter-spacing: .015em; }
.control-body { padding-bottom: 14px; }
select, .review-toolbar input, .review-note { border-radius: 3px; }
.layer-toggle { border-radius: 2px; }
.layer-toggle:hover { background: var(--platinum); }
.highlights article { border-radius: 2px; }
.highlight-tag { border-radius: 2px; background: var(--buff); color: var(--navy); }
.sidebar-footer { background: #fff; }

/* Clear map stage */
#map { background: #E7EDF3; }
.leaflet-tile-pane { filter: saturate(.62) contrast(.92) brightness(1.05); }
.leaflet-control-zoom a,
.leaflet-control-layers-toggle,
.leaflet-bar a { background-color: #fff !important; color: var(--navy) !important; }
.leaflet-control-layers, .leaflet-bar { border-radius: 3px !important; box-shadow: 0 2px 10px rgba(15,32,66,.16) !important; }
.leaflet-bar a:first-child { border-radius: 3px 3px 0 0 !important; }
.leaflet-bar a:last-child { border-radius: 0 0 3px 3px !important; }
.leaflet-bottom.leaflet-right { right: 12px; bottom: 22px; }
.leaflet-control-attribution { color: #5B6C82 !important; background: rgba(255,255,255,.88) !important; }

.map-floating-bar {
  top: 14px;
  right: 14px;
  left: auto;
  gap: 6px;
  z-index: 1050;
}
.map-fab, .map-context {
  min-height: 38px;
  border-radius: 3px;
  border-color: var(--line-strong);
  background: rgba(255,255,255,.96);
  box-shadow: 0 2px 8px rgba(15,32,66,.12);
  backdrop-filter: none;
}
.map-context { min-width: 230px; padding: 7px 11px; border-top: 3px solid var(--cyan); }
.map-context strong { color: var(--navy); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.map-context span { font-size: 9px; }
.map-fab { padding: 0 10px; }
.legend-button-mark { width: 14px; height: 10px; border-top: 3px solid var(--navy); border-bottom: 3px solid var(--amber); box-shadow: inset 0 -2px 0 var(--cyan); }

.map-counts {
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  justify-content: center;
  max-width: calc(100% - 420px);
}
.map-counts span {
  border-radius: 2px;
  border-color: var(--line-strong);
  background: rgba(255,255,255,.94);
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8.5px;
}

.loading { background: rgba(241,245,249,.83); }
.spinner { border-color: #CBD6E2; border-top-color: var(--amber); }

/* Dynamic legend */
.dynamic-legend {
  position: absolute;
  left: 16px;
  bottom: 20px;
  z-index: 1040;
  width: 292px;
  max-height: min(55vh, 520px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--navy);
  border-radius: 4px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 30px rgba(15,32,66,.18);
}
.dynamic-legend.hidden { display: none; }
.dynamic-legend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--line);
}
.dynamic-legend-head h2 { margin: 3px 0 0; font-size: 15px; letter-spacing: .01em; }
.legend-close { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.dynamic-legend-body { min-height: 0; overflow: auto; padding: 8px 12px 10px; }
.dynamic-legend-section + .dynamic-legend-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dynamic-legend-section h3 { margin: 0 0 7px; color: var(--navy); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.dynamic-legend-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 26px; }
.dynamic-legend-row strong { font-size: 10px; font-weight: 700; }
.dynamic-legend-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 8.5px; line-height: 1.25; }
.dynamic-legend-row b { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; font-weight: 500; }
.legend-symbol { position: relative; display: grid; place-items: center; width: 26px; height: 22px; }
.legend-symbol::before { content: ""; display: block; width: var(--symbol-size, 10px); height: var(--symbol-size, 10px); background: var(--symbol-color, var(--cyan)); border: 2px solid var(--symbol-stroke, #fff); box-shadow: 0 0 0 1px rgba(15,32,66,.25); }
.legend-symbol.circle::before { border-radius: 50%; }
.legend-symbol.square::before { border-radius: 1px; }
.legend-symbol.diamond::before { transform: rotate(45deg); border-radius: 1px; }
.legend-symbol.ring::before { border-radius: 50%; background: #fff; border: 3px solid var(--symbol-color); box-shadow: 0 0 0 1px rgba(15,32,66,.25); }
.legend-line::before { width: 24px; height: 0; border: 0; border-top: 4px solid var(--symbol-color); box-shadow: none; }
.legend-area::before { width: 24px; height: 14px; border: 2px solid var(--symbol-color); background: color-mix(in srgb, var(--symbol-color) 12%, white); box-shadow: none; }
.legend-cluster::before { width: 20px; height: 20px; border-radius: 50%; background: var(--navy); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--navy); }
.legend-cluster::after { content: "12"; position: absolute; color: #fff; font-size: 7px; font-weight: 800; }
.dynamic-legend-foot { padding: 7px 12px; border-top: 1px solid var(--line); background: var(--platinum); color: var(--muted); font-size: 8.5px; line-height: 1.35; }
.return-selection {
  position: absolute;
  right: 14px;
  top: 64px;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--amber);
  border-radius: 3px;
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.return-selection[hidden] { display: none; }

/* Commercial map markers: generous hit target, precise visual dot */
.helisep-marker-shell {
  display: grid;
  place-items: center;
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  cursor: pointer;
  pointer-events: auto;
}
.helisep-marker-shell:focus-visible { outline: 3px solid rgba(255,122,0,.45); outline-offset: 2px; }
.helisep-dot {
  width: var(--dot-size, 10px);
  height: var(--dot-size, 10px);
  display: block;
  background: var(--dot-color, var(--cyan));
  border: 2px solid var(--dot-stroke, #fff);
  box-shadow: 0 0 0 1px rgba(15,32,66,.28), 0 2px 5px rgba(15,32,66,.24);
  transition: transform .12s ease, box-shadow .12s ease;
}
.helisep-marker-shell:hover .helisep-dot,
.helisep-marker-shell.marker-selected .helisep-dot {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px rgba(255,122,0,.78), 0 3px 9px rgba(15,32,66,.28);
}
.helisep-marker-shell .shape-circle { border-radius: 50%; }
.helisep-marker-shell .shape-square { border-radius: 1px; }
.helisep-marker-shell .shape-diamond { transform: rotate(45deg); border-radius: 1px; }
.helisep-marker-shell:hover .shape-diamond,
.helisep-marker-shell.marker-selected .shape-diamond { transform: rotate(45deg) scale(1.35); }
.helisep-marker-shell .shape-ring { border-radius: 50%; background: #fff; border: 3px solid var(--dot-color); }
.helisep-marker-shell .shape-triangle { width: 0; height: 0; background: transparent; border-left: calc(var(--dot-size) / 2) solid transparent; border-right: calc(var(--dot-size) / 2) solid transparent; border-bottom: var(--dot-size) solid var(--dot-color); border-top: 0; box-shadow: none; }

.atlas-cluster div, .isotope-cluster div, .well-cluster div, .target-cluster div {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(15,32,66,.28), 0 4px 10px rgba(15,32,66,.25);
}
.atlas-cluster div { width: 42px; height: 42px; background: var(--navy); }
.isotope-cluster div { width: 42px; height: 42px; background: var(--cyan); }
.well-cluster div { width: 42px; height: 42px; background: #35678F; }
.target-cluster div { width: 42px; height: 42px; background: var(--buff); color: var(--navy); }
.atlas-cluster span, .isotope-cluster span, .well-cluster span, .target-cluster span { font-size: 10px; font-weight: 800; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: transparent !important; }
.marker-cluster div { margin: 0 !important; }

/* Popovers are always available, drawers retain full detail. */
.leaflet-popup-content-wrapper {
  border-radius: 4px !important;
  border-top: 4px solid var(--cyan);
  box-shadow: 0 12px 34px rgba(15,32,66,.25) !important;
}
.leaflet-popup-content { margin: 12px 14px !important; min-width: 220px; }
.leaflet-popup-tip { box-shadow: none !important; }
.helisep-popup-title { margin: 0; color: var(--navy); font-size: 13px; line-height: 1.25; }
.helisep-popup-meta { margin-top: 4px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.helisep-popup-value { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--navy); font-size: 10px; font-weight: 800; }
.helisep-popup-note { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.helisep-popup-action { margin-top: 8px; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.helis-tooltip { border-radius: 3px !important; border-left: 3px solid var(--cyan) !important; }
.tooltip-value { color: var(--navy); }

/* Selected detail drawer */
.drawer {
  top: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: 4px;
  border-top: 5px solid var(--navy);
}
.drawer-head, .modal-head { background: #fff; }
.drawer-title h2, .modal-head h2 { color: var(--navy); }
.plain-language-banner { border-radius: 3px; border-left: 4px solid var(--cyan); background: var(--brand-soft); }
.plain-language-banner.infrastructure { border-left-color: var(--amber); background: var(--infrastructure-soft); }
.profile-grid { gap: 6px; }
.kv { border-radius: 2px; background: var(--platinum); border-left: 2px solid #D4DDE8; }
.k { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.badge { border-radius: 2px; }
.source-link { border-radius: 2px; color: var(--navy); }
.source-link:hover { border-color: var(--cyan); }
.caveat, .internal-note, .plain-note { border-radius: 2px; }
.modal-panel, .welcome-card { border-radius: 4px; }
.welcome-card { border-top: 5px solid var(--cyan); background: rgba(255,255,255,.98); }
.welcome-card h2 { color: var(--navy); }

/* Official vector hover and selected states */
.leaflet-interactive { transition: stroke-width .12s ease, fill-opacity .12s ease, opacity .12s ease; }
.leaflet-interactive:hover { stroke-width: 4px; }

@media (max-width: 1180px) {
  :root { --sidebar: 350px; }
  .topbar { grid-template-columns: minmax(260px, 320px) minmax(240px, 1fr) auto; }
  .brand-lockup { width: 126px; flex-basis: 126px; }
  .brand-copy { padding-left: 10px; }
}

@media (max-width: 840px) {
  :root { --topbar: 62px; --sidebar: min(94vw, 390px); }
  .topbar { border-bottom-width: 2px; }
  .brand-lockup { width: 112px; height: 40px; flex-basis: 112px; }
  .brand-copy { display: none; }
  .map-floating-bar { left: 10px; right: 10px; top: 10px; }
  .map-context { display: none; }
  .dynamic-legend { left: 10px; right: 10px; bottom: 66px; width: auto; max-height: 42vh; }
  .map-counts { left: 10px; right: 10px; bottom: 22px; transform: none; max-width: none; overflow-x: auto; justify-content: flex-start; flex-wrap: nowrap; }
  .return-selection { right: 10px; top: 58px; }
  .leaflet-bottom.leaflet-right { bottom: 72px; }
  .drawer { border-radius: 4px; }
}

@media (max-width: 520px) {
  .dynamic-legend-head { padding: 9px 10px 7px; }
  .dynamic-legend-body { padding: 7px 10px; }
  .map-fab { min-width: 40px; }
}

/* Brand-aligned static swatches and empty legend state */
.swatch-atlas { background: var(--cyan) !important; }
.swatch-science { background: var(--cyan) !important; }
.swatch-target { background: var(--amber) !important; }
.swatch-well { background: var(--navy) !important; }
.swatch-official { background: var(--buff) !important; }
.dynamic-legend-empty { padding: 8px 0 4px; }
.dynamic-legend-empty strong { font-size: 10px; }
.dynamic-legend-empty p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
