* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #111;
}

#app {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#sidebar {
  width: 360px;
  max-width: 42vw;
  height: 100%;
  background: #15181d;
  color: #fff;
  border-right: 1px solid #2c3036;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.header {
  padding: 18px;
  border-bottom: 1px solid #2c3036;
}

.header h1 {
  margin: 0;
  font-size: 22px;
}

.subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #9da5af;
}

.status {
  margin-top: 10px;
  font-size: 12px;
  color: #9da5af;
}

.summary {
  padding: 12px 18px;
  font-size: 14px;
  border-bottom: 1px solid #2c3036;
}

#station-count {
  font-weight: 700;
}

.search-wrap {
  padding: 12px;
  border-bottom: 1px solid #2c3036;
}

#search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #343941;
  border-radius: 8px;
  background: #20242a;
  color: #fff;
  outline: none;
}

#search:focus {
  border-color: #6d7785;
}

#station-list {
  flex: 1;
  overflow-y: auto;
}

.station {
  padding: 11px 14px;
  border-bottom: 1px solid #25292f;
  cursor: pointer;
}

.station:hover {
  background: #20242a;
}

.callsign {
  font-weight: 700;
  font-size: 14px;
}

.station-meta {
  margin-top: 3px;
  font-size: 12px;
  color: #929aa5;
}

#map {
  flex: 1;
  height: 100%;
}

.popup-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.popup-row {
  margin: 3px 0;
  font-size: 13px;
}

.popup-label {
  font-weight: 600;
}

@media (max-width: 700px) {

  #app {
    display: block;
  }

  #sidebar {
    position: absolute;
    width: 100%;
    max-width: none;
    height: 42%;
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: 1px solid #2c3036;
  }

  #map {
    width: 100%;
    height: 58%;
  }

}


.aprs-leaflet-icon {
  background: transparent !important;
  border: 0 !important;
}

.aprs-leaflet-icon i {
  display: block;
}


.aprs-symbol-scale {
  width: 48px;
  height: 48px;
  transform: scale(0.5);
  transform-origin: 0 0;
}

.aprs-symbol-scale i {
  display: inline-block !important;
}


.aprs-marker-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  overflow: visible;
}

.aprs-callsign {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  color: #111;
  background: rgba(255,255,255,0.82);
  border-radius: 3px;
  padding: 1px 3px;
  pointer-events: none;
}

.controls {
  padding: 14px;
  display: grid;
  gap: 14px;
}

.controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #9da5af;
}

.controls select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #343941;
  border-radius: 8px;
  background: #20242a;
  color: #fff;
}

.station-details {
  margin: 0 12px 12px;
  padding: 14px;
  border: 1px solid #2c3036;
  border-radius: 10px;
  background: #1b1f24;
  overflow-y: auto;
}

.station-details.hidden {
  display: none;
}

.station-details-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-row {
  margin: 7px 0;
  font-size: 12px;
  line-height: 1.35;
}

.detail-label {
  color: #929aa5;
  display: block;
  margin-bottom: 2px;
}

.detail-value {
  color: #fff;
  word-break: break-word;
}

.detail-raw {
  margin-top: 12px;
  padding: 8px;
  border-radius: 6px;
  background: #101317;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.3;
  word-break: break-all;
}

#sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

.station-details {
  flex-shrink: 0;
  max-height: none;
}

.aprs-symbol-scale {
  position: relative;
}

.aprs-overlay {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 48px;
  font-weight: 900;
  color: #000;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
  pointer-events: none;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-logos img {
  display: block;
  height: 38px;
  width: auto;
  object-fit: contain;
}

.brand-header h1 {
  margin: 0;
}

.brand-title {
  min-width: 0;
}

.brand-title h1 {
  margin: 0;
}

.home-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: #9ca3af;
  text-decoration: none;
}

.home-link:hover {
  color: #fff;
  text-decoration: underline;
}
