html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

#topbar {
  height: 50px;
  display: flex;
  flex-direction: row;
}

#legend {
  flex: 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  font-family: sans-serif;
  overflow-x: auto;
}

#status {
  background: #222;
  color: #fff;
  font-family: sans-serif;
  font-size: 12px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  gap: 8px;
}

#modeSelect {
  font-size: 12px;
}

#configBtn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}
#configBtn:hover { color: #fff; }

/* ── Callsign dialog ── */
#mycallDialog {
  border: none;
  border-radius: 12px;
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 0;
  font-family: sans-serif;
  font-size: 14px;
  width: 300px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: dialog-in 0.15s ease-out;
}
#mycallDialog::backdrop {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: #cdd6f4;
}
.dialog-close {
  background: none;
  border: none;
  color: #6c7086;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.dialog-close:hover { color: #cdd6f4; }
.dialog-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6c7086;
  padding: 14px 20px 5px;
}
#mycallInput {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px;
  box-sizing: border-box;
  font-size: 16px;
  font-family: monospace;
  letter-spacing: 0.05em;
  padding: 9px 12px;
  background: #181825;
  border: 1.5px solid #313244;
  color: #cdd6f4;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
#mycallInput:focus { border-color: #89b4fa; }
.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
}
.btn-secondary {
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 7px;
  border: 1.5px solid #313244;
  background: transparent;
  color: #a6adc8;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: #313244; color: #cdd6f4; }
.btn-primary {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 20px;
  cursor: pointer;
  border-radius: 7px;
  border: none;
  background: #89b4fa;
  color: #1e1e2e;
  transition: background 0.15s;
}
.btn-primary:hover { background: #b4d0fb; }

.legend-item {
  display: flex;
  align-items: center;
  margin-right: 15px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.legend-item.off {
  opacity: 0.25;
}

.legend-color {
  width: 20px;
  height: 20px;
  margin-right: 5px;
}

#map {
  flex: 1;
}

#limitControl {
  color: #aaa;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
#limitSlider {
  width: 80px;
  vertical-align: middle;
  accent-color: #89b4fa;
}

#statusDot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}
#statusDot.green  { background: #2ecc40; }
#statusDot.yellow { background: #ffdc00; animation: dot-pulse 1s ease-in-out infinite; }
#statusDot.red    { background: #ff4136; }
#statusDot.cyan   { background: #0ff; }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

.grid-label {
  font-size: 10px;
  color: #444;
  font-weight: bold;
  text-align: center;
}

.leaflet-twilight-overlay {
  pointer-events: none;
}

/* ── Activity dialog ── */
#activityDialog {
  position: fixed;
  top: 70px;
  right: 10px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: sans-serif;
  font-size: 12px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  min-width: 520px;
  max-width: 90vw;
  overflow: hidden;
}

#activityDialogTitleBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  background: #181825;
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid #313244;
}
#activityDialogTitleBar:active { cursor: grabbing; }

#activityDialogTitleText {
  font-size: 13px;
  font-weight: 600;
  color: #cdd6f4;
}

.act-title-btns {
  display: flex;
  gap: 4px;
}
.act-title-btns button {
  background: none;
  border: none;
  color: #6c7086;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.act-title-btns button:hover { color: #cdd6f4; }

#activityDialogBands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid #313244;
}

.act-band-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #a6adc8;
  font-size: 11px;
}
.act-band-label input { cursor: pointer; accent-color: #89b4fa; }
.act-band-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

#activityDialogHeatmap {
  padding: 10px 14px 12px;
  overflow-x: auto;
}

.act-table {
  border-collapse: collapse;
  table-layout: fixed;
}
.act-table thead th {
  color: #6c7086;
  font-size: 10px;
  font-weight: normal;
  text-align: center;
  width: 19px;
  padding: 0 0 4px;
}
.act-table thead th:first-child { width: 38px; }

.act-day {
  color: #6c7086;
  font-size: 11px;
  padding-right: 8px;
  white-space: nowrap;
  text-align: right;
}

.act-cell {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  margin: 1px;
  cursor: default;
  transition: opacity 0.1s;
}
.act-cell:hover { opacity: 0.8; outline: 1px solid rgba(255,255,255,0.4); }

.act-loading {
  color: #6c7086;
  padding: 20px 0;
  text-align: center;
}
