.hbmap-shell {
  --bg: #031126;
  --bg2: #041a33;
  --line: #153a5f;
  --line-soft: #11314e;
  --text: #d8ecff;
  --muted: #7ea3c6;
  --cyan: #58b7ff;
  --green: #14c987;
  --amber: #f5b74a;
  --blue: #58a8ff;

  font-family: 'Geist', system-ui, sans-serif;
  color: var(--text);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #03142a, var(--bg));
  padding: 8px;
}

.hbmap-topbar {
  border: 1px solid var(--line-soft);
  background: #051a32;
  display: grid;
  grid-template-columns: 260px 1fr 250px;
  gap: 8px;
  align-items: center;
  padding: 10px;
}

.hbmap-brand {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .08em;
  color: #9dcaf1;
  text-transform: uppercase;
  white-space: nowrap;
}

.hbmap-logo {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  background: #0e4a81;
  color: #e7f4ff;
  font-weight: 700;
  margin-right: 8px;
  border: 1px solid #2f76ae;
}

.hbmap-search-wrap input,
.hbmap-filters select,
.hbmap-reset {
  width: 100%;
  height: 38px;
  border: 1px solid #2f6fa2;
  background: #06253f;
  color: #f3f9ff;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  padding: 0 10px;
}

.hbmap-search-wrap {
  position: relative;
}

.hbmap-search-wrap input {
  padding-right: 74px;
}

.hbmap-clear-search {
  position: absolute;
  top: 7px;
  right: 6px;
  height: 24px;
  border: 1px solid #2d6796;
  background: #08325a;
  color: #cae7ff;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 8px;
  cursor: pointer;
}

.hbmap-clear-search:hover {
  background: #0d4275;
}

.hbmap-search-wrap input::placeholder {
  color: #99bfdf;
}

.hbmap-search-wrap input {
  box-shadow: 0 0 0 1px rgba(84, 162, 226, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hbmap-search-wrap input:focus {
  outline: none;
  border-color: #59aef2;
  box-shadow: 0 0 0 2px rgba(89, 174, 242, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hbmap-live {
  justify-self: end;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #9cc6e8;
  text-transform: uppercase;
}

.hbmap-live .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin: 0 6px;
  background: #12c285;
  box-shadow: 0 0 10px rgba(18, 194, 133, .65);
}

.hbmap-main {
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 250px 1fr 380px;
  min-height: 700px;
}

.hbmap-statsline {
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  background: #051b34;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
}

.hbmap-statsline > div {
  border-right: 1px solid #184264;
  padding: 7px 9px;
}

.hbmap-statsline > div:last-child {
  border-right: 0;
}

.hbmap-statsline span {
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  color: #79a4c7;
}

.hbmap-statsline strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 700;
  color: #f2f8ff;
}

.hbmap-filters,
.hbmap-results {
  background: #06223f;
  border-right: 1px solid var(--line-soft);
  padding: 12px;
}

.hbmap-results {
  border-right: 0;
  border-left: 1px solid var(--line-soft);
}

.hbmap-panel-title {
  font-family: 'Geist Mono', ui-monospace, monospace;
  color: #69acd8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 10px 0 8px;
}

.hbmap-panel-title:first-child {
  margin-top: 2px;
}

.hbmap-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 12px;
}

.hbmap-check input {
  accent-color: #3ea7ff;
}

.hbmap-count-muted {
  margin-left: 4px;
  color: #5f86a9;
  font-size: 10px;
}

.hbmap-reset {
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  cursor: pointer;
}

.hbmap-range {
  margin-bottom: 12px;
  padding: 0 0 8px;
  border-bottom: 0;
  background: transparent;
}

.hbmap-range-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #6e9abf;
}

.hbmap-range-top strong {
  color: #e7f3ff;
  font-size: 11px;
  font-weight: 400;
}

.hbmap-range-dual {
  position: relative;
  height: 24px;
  --range-start: 0%;
  --range-end: 100%;
}

.hbmap-range-dual input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: auto;
}

.hbmap-range-dual::before,
.hbmap-range-dual::after {
  content: "";
  position: absolute;
  top: 11px;
  height: 2px;
  border-radius: 999px;
}

.hbmap-range-dual::before {
  left: 0;
  right: 0;
  background: rgba(127, 163, 193, 0.28);
}

.hbmap-range-dual::after {
  left: var(--range-start);
  width: calc(var(--range-end) - var(--range-start));
  background: linear-gradient(90deg, #2b78ff, #53b5ff);
  box-shadow: 0 0 12px rgba(83, 181, 255, 0.35);
}

.hbmap-range-dual input[type="range"]:first-child {
  z-index: 2;
}

.hbmap-range-dual input[type="range"]:last-child {
  z-index: 1;
}

.hbmap-range-dual input[type="range"]:disabled {
  opacity: 0.5;
}

.hbmap-range-dual input[type="range"]::-webkit-slider-runnable-track {
  height: 24px;
  background: transparent;
}

.hbmap-range-dual input[type="range"]::-moz-range-track {
  height: 2px;
  background: transparent;
}

.hbmap-range-dual input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border: 1px solid #8bc7ff;
  border-radius: 999px;
  background: #2f7dff;
  box-shadow: 0 0 0 2px rgba(5, 20, 37, 0.9);
}

.hbmap-range-dual input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid #8bc7ff;
  border-radius: 999px;
  background: #2f7dff;
  box-shadow: 0 0 0 2px rgba(5, 20, 37, 0.9);
}

.hbmap-map-wrap {
  position: relative;
  background: #03142a;
}

.hbmap-map {
  width: 100%;
  height: 100%;
  min-height: 700px;
}

.hbmap-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 640px;
  overflow: auto;
  padding-right: 6px;
}

.hbmap-item {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(7, 30, 52, 0.94), rgba(5, 24, 43, 0.94));
  padding: 10px;
  cursor: pointer;
  border-radius: 2px;
}

.hbmap-item-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: start;
}

.hbmap-item .thumb {
  width: 84px;
  height: 72px;
  border: 1px solid #1d4e75;
  background: #072843;
  overflow: hidden;
}

.hbmap-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hbmap-item .thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 18px;
  color: #8ec1e8;
  background: linear-gradient(180deg, #0a355b, #072640);
}

.hbmap-item:hover {
  border-color: #2f77ad;
  background: linear-gradient(180deg, rgba(9, 36, 63, 0.96), rgba(7, 30, 54, 0.96));
}

.hbmap-item .id {
  color: #5f9ecb;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.hbmap-item-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hbmap-item .name {
  margin-top: 3px;
  color: #f0f7ff;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
}

.hbmap-item .name-link,
.hbmap-tooltip-card .name-link {
  color: inherit;
  text-decoration: none;
}

.hbmap-item .name-link:hover,
.hbmap-tooltip-card .name-link:hover {
  text-decoration: underline;
}

.hbmap-item .meta,
.hbmap-item .stats {
  margin-top: 4px;
  color: #84a9ca;
  font-size: 11px;
  line-height: 1.4;
}

.hbmap-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(126, 163, 198, 0.14);
}

.hbmap-item-footer .status {
  flex: 0 0 auto;
}

.hbmap-item-footer .record-link {
  margin-top: 0;
}

.hbmap-item .status {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: .08em;
}

.hbmap-item .status.on-site { color: var(--green); }
.hbmap-item .status.planning { color: var(--amber); }
.hbmap-item .status.complete { color: var(--blue); }

.hbmap-ticker {
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  background: #041a31;
  min-height: 28px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #88b2d4;
  text-transform: uppercase;
}

.hbmap-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  white-space: nowrap;
  padding-left: 10px;
  will-change: transform;
  animation: hbmapTicker var(--ticker-duration, 36s) linear infinite;
}

.hbmap-ticker:hover .hbmap-ticker-track {
  animation-play-state: paused;
}

.hbmap-ticker-text {
  display: inline-block;
  white-space: nowrap;
}

@keyframes hbmapTicker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hbmap-empty {
  border: 1px solid #1d486b;
  background: #04172c;
  padding: 14px;
  color: #85aac8;
}

.leaflet-container {
  background: #dce7f1;
}

.leaflet-control-zoom a {
  background-color: #082540 !important;
  color: #d8ecff !important;
  border-bottom: 1px solid #20527a !important;
}

.leaflet-tooltip.hbmap-tooltip-wrap {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  pointer-events: auto;
}

.hbmap-tooltip-card {
  width: 250px;
  border: 1px solid #2f77ad;
  background: linear-gradient(180deg, #0b4f89 0%, #083f6f 100%);
  color: #ffffff;
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(2, 12, 24, 0.45);
  padding: 8px;
}

.hbmap-tooltip-card .hbmap-item-row {
  grid-template-columns: 1fr;
  gap: 0;
}

.hbmap-tooltip-card .body {
  min-width: 0;
  margin-top: 8px;
}

.hbmap-tooltip-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(230, 244, 255, 0.18);
}

.hbmap-tooltip-card .record-link {
  display: inline-block;
  margin-top: 8px;
  color: #ffffff;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: underline;
}

.hbmap-item .record-link {
  display: inline-block;
  margin-top: 6px;
  color: #8ec1e8;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
}

.hbmap-item .record-link:hover,
.hbmap-tooltip-card .record-link:hover {
  text-decoration: underline;
}

.hbmap-tooltip-card .thumb {
  width: 100%;
  height: 128px;
  margin: 0;
  border-color: rgba(230, 244, 255, 0.45);
  background: rgba(4, 22, 38, 0.35);
}

.hbmap-tooltip-card .id {
  font-size: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #e7f3ff;
}

.hbmap-tooltip-card .name {
  font-size: 14px;
  line-height: 1.15;
  margin-top: 2px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #ffffff;
}

.hbmap-tooltip-card .meta,
.hbmap-tooltip-card .stats {
  font-size: 11px;
  margin-top: 3px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #ffffff;
}

.hbmap-tooltip-card .status {
  font-size: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #ffffff;
}

.hbmap-tooltip-vertical .hbmap-item-row {
  display: block;
}

.hbmap-tooltip-vertical .thumb {
  width: 100%;
  height: 128px;
}

.hbmap-tooltip-vertical .body {
  margin-top: 8px;
}


.hbmap-tooltip-vertical .name {
  margin-top: 4px;
}

.hbmap-tooltip-vertical .stats,
.hbmap-tooltip-vertical .meta {
  margin-top: 4px;
}

.hbmap-tooltip-vertical .hbmap-item-top {
  justify-content: flex-start;
}

@media (max-width: 1280px) {
  .hbmap-statsline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hbmap-main {
    grid-template-columns: 240px 1fr;
  }

  .hbmap-results {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .hbmap-results-list {
    max-height: 340px;
  }
}

@media (max-width: 860px) {
  .hbmap-topbar {
    grid-template-columns: 1fr;
  }

  .hbmap-live {
    justify-self: start;
  }

  .hbmap-main {
    grid-template-columns: 1fr;
  }

  .hbmap-statsline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hbmap-filters,
  .hbmap-results {
    border-right: 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .hbmap-map,
  .hbmap-main {
    min-height: 520px;
  }

}
