.sjhm-app,
.sjhm-app * {
  box-sizing: border-box;
}

.sjhm-app {
  --sjhm-bg: #101413;
  --sjhm-panel: #17211d;
  --sjhm-panel-2: #0f1513;
  --sjhm-border: #33473f;
  --sjhm-text: #edf4ef;
  --sjhm-muted: #b7c5bd;
  --sjhm-red: #ef5350;
  --sjhm-cyan: #33b5e5;
  --sjhm-amber: #f6b73c;
  --sjhm-purple: #8f68ff;
  --sjhm-map-height: 66svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  margin: 0 auto 24px;
  overflow: hidden;
  border: 1px solid var(--sjhm-border);
  background: var(--sjhm-bg);
  color: var(--sjhm-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  isolation: isolate;
}

.sjhm-map-wrap {
  order: 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #1a2320;
  position: relative;
  z-index: 0;
}

.sjhm-map {
  width: 100%;
  max-width: 100%;
  height: var(--sjhm-map-height);
  min-height: 400px;
  overflow: hidden;
  background: #1a2320;
  position: relative;
}

.sjhm-map .leaflet-pane,
.sjhm-map .leaflet-tile-pane,
.sjhm-map .leaflet-overlay-pane,
.sjhm-map .leaflet-marker-pane,
.sjhm-map .leaflet-tooltip-pane,
.sjhm-map .leaflet-popup-pane,
.sjhm-map .leaflet-control-container {
  max-width: none;
}

.sjhm-map .leaflet-tile,
.sjhm-map .leaflet-marker-icon,
.sjhm-map .leaflet-marker-shadow {
  max-width: none !important;
}

.sjhm-panel {
  order: 2;
  padding: 14px;
  background: var(--sjhm-panel);
  border-top: 1px solid var(--sjhm-border);
}

.sjhm-heading h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
}

.sjhm-heading p {
  margin: 0 0 12px;
  color: var(--sjhm-muted);
  font-size: 13px;
  line-height: 1.5;
}

.sjhm-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.sjhm-stats div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--sjhm-border);
  border-radius: 6px;
  background: var(--sjhm-panel-2);
}

.sjhm-stats strong {
  display: block;
  color: var(--sjhm-red);
  font-size: 22px;
  line-height: 1;
}

.sjhm-stats span {
  display: block;
  margin-top: 4px;
  color: var(--sjhm-muted);
  font-size: 12px;
}

.sjhm-search-label {
  display: block;
  margin: 0 0 10px;
  color: #dce8e1;
  font-size: 12px;
  font-weight: 700;
}

.sjhm-search-label span {
  display: block;
  margin-bottom: 6px;
}

.sjhm-search {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #40534b;
  border-radius: 6px;
  background: var(--sjhm-panel-2);
  color: var(--sjhm-text);
  font: inherit;
  appearance: none;
}

.sjhm-search::placeholder {
  color: #82918a;
}

.sjhm-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.sjhm-filters button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 6px;
  border: 1px solid #40534b;
  border-radius: 6px;
  background: #202b27;
  color: var(--sjhm-text);
  cursor: pointer;
  font: 700 12px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  white-space: normal;
}

.sjhm-filters button.is-active {
  border-color: var(--sjhm-red);
  background: #3a2020;
  color: #fff;
}

.sjhm-result-count {
  margin: 4px 0 6px;
  color: var(--sjhm-muted);
  font-size: 12px;
}

.sjhm-list {
  max-height: 56svh;
  overflow: auto;
  border-top: 1px solid var(--sjhm-border);
  overscroll-behavior: contain;
}

.sjhm-spot {
  display: block;
  width: 100%;
  padding: 12px 2px;
  border: 0;
  border-bottom: 1px solid var(--sjhm-border);
  border-radius: 0;
  background: transparent;
  color: var(--sjhm-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  appearance: none;
}

.sjhm-spot:hover,
.sjhm-spot:focus,
.sjhm-spot:active {
  color: var(--sjhm-red);
}

.sjhm-spot-title {
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
}

.sjhm-meta {
  margin-top: 4px;
  color: var(--sjhm-muted);
  font-size: 12px;
  line-height: 1.4;
}

.sjhm-popup h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 16px;
  line-height: 1.3;
}

.sjhm-popup p {
  margin: 6px 0;
  color: #eee;
  line-height: 1.45;
}

.sjhm-popup a {
  color: var(--sjhm-red);
}

.sjhm-article-link,
.sjhm-list-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sjhm-list-link {
  margin-top: 7px;
  color: var(--sjhm-red);
  font-size: 12px;
}

.sjhm-app .leaflet-container {
  background: #1a2320;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sjhm-app .leaflet-popup-content-wrapper,
.sjhm-app .leaflet-popup-tip {
  background: #1b1b1b;
  color: #eee;
}

.sjhm-pin {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--sjhm-purple);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .45);
}

.sjhm-pin.is-geo {
  background: var(--sjhm-cyan);
}

.sjhm-pin.is-approx {
  background: var(--sjhm-amber);
}

.sjhm-pin.is-short {
  background: var(--sjhm-red);
}

@media (min-width: 460px) {
  .sjhm-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .sjhm-app {
    --sjhm-map-height: 680px;
  }

  .sjhm-panel {
    padding: 16px;
  }

  .sjhm-list {
    max-height: 520px;
  }
}
