* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Top navigation bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1rem;
  height: 48px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
  z-index: 10;
}

.topbar-brand {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f0f6fc;
  text-decoration: none;
}

.topbar-tabs {
  display: flex;
  gap: 0;
  height: 100%;
}

.topbar-tab {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  color: #8b949e;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.topbar-tab + .topbar-tab {
  border-left: 1px solid #30363d;
}

.topbar-tab:hover {
  color: #c9d1d9;
}

.topbar-tab.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

/* Map fills remaining space */
#map {
  flex: 1;
}

/* Floating toggles, top-left over the map */
.map-toggles {
  position: absolute;
  top: calc(48px + 1rem);
  left: 1rem;
  z-index: 5;
  display: flex;
  gap: 0.5rem;
}

.map-toggle {
  background: #161b22;
  color: #8b949e;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.map-toggle:hover {
  color: #c9d1d9;
  border-color: #484f58;
}

.map-toggle.active {
  color: #58a6ff;
  border-color: #1f6feb;
  background: #0d2036;
}

.map-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Site-radar level chooser inside the station panel */
.level-selector {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.level-hint {
  font-size: 0.65rem;
  color: #8b949e;
  margin-bottom: 0.5rem;
}

/* Deliberate site+model combine, model bar */
.model-combine {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #c9d1d9;
  cursor: pointer;
  white-space: nowrap;
}

.model-combine[hidden] {
  display: none;
}

/* Forecast-model banner: pinned top-center whenever the model layer is on,
   so simulated reflectivity is never on screen unlabeled. Amber = model. */
.model-badge {
  position: absolute;
  top: calc(48px + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: #161b22;
  color: #f0b429;
  border: 1px solid #f0b429;
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Forecast-model control bar, bottom-center */
.model-bar {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* The class sets display, which would otherwise beat the browser's default
   rule for the hidden attribute and leave the bar up outside model mode. */
.model-bar[hidden] {
  display: none;
}

.model-picker {
  display: flex;
  gap: 0.35rem;
}

.model-pick-btn {
  background: #0d1117;
  color: #8b949e;
  border: 1px solid #30363d;
  border-radius: 5px;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.model-pick-btn.active {
  color: #f0b429;
  border-color: #f0b429;
  background: #2b2107;
}

.model-pick-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.model-transport {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.model-step {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 5px;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.model-step:hover {
  border-color: #484f58;
}

.loop-live {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.model-transport input[type='range'] {
  width: 140px;
  accent-color: #f0b429;
}

.model-field-select {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 5px;
  padding: 0.3rem 0.4rem;
  font: inherit;
  font-size: 0.75rem;
  max-width: 11rem;
}

.model-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 9rem;
}

.model-legend-title {
  font-size: 0.65rem;
  color: #8b949e;
  white-space: nowrap;
}

.model-legend-bar {
  height: 8px;
  border-radius: 3px;
  border: 1px solid #30363d;
}

.model-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: #8b949e;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

.model-time {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.75rem;
  color: #c9d1d9;
  min-width: 15ch;
}

.model-time.error {
  color: #f85149;
  cursor: pointer;
}

@media (max-width: 560px) {
  .model-bar {
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 2rem);
  }
}

/* Station info panel */
.station-info {
  position: absolute;
  bottom: 2rem;
  left: 1rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  min-width: 260px;
  max-width: min(400px, calc(100vw - 2rem));
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Tab strip inside the station-info panel */
.tab-strip {
  display: flex;
  gap: 0;
  margin-top: 0.5rem;
  border-bottom: 1px solid #30363d;
}

.tab-strip-btn {
  background: none;
  border: none;
  color: #8b949e;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-strip-btn:hover {
  color: #c9d1d9;
}

.tab-strip-btn.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.tab-panel {
  padding-top: 0.5rem;
}

.tab-placeholder {
  font-size: 0.8rem;
  color: #8b949e;
  padding: 0.5rem 0;
}

/* Alerts tab, two-column filter grid */
.alerts-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Active warnings list, the Warnings tab */
.warnings-panel {
  padding-bottom: 0.6rem;
}

.warnings-empty {
  font-size: 0.78rem;
  color: #8b949e;
  padding: 0.15rem 0;
}

.warnings-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 11rem;
  overflow-y: auto;
}

.warning-row {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: #161b22;
  border: 1px solid #30363d;
  border-left: 3px solid #f85149;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
}

.warning-row:hover {
  border-color: #58a6ff;
  border-left-width: 3px;
}

.warning-row-event {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e6edf3;
}

.warning-row-meta {
  font-size: 0.7rem;
  color: #8b949e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* SPC outlook picker, above the alert filters in the Alerts tab */
.spc-outlook {
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid #21262d;
}

.spc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.spc-row + .spc-row {
  margin-top: 0.35rem;
}

.spc-row[hidden] {
  display: none;
}

.spc-btn {
  flex: 1 1 auto;
  padding: 0.25rem 0.4rem;
  font-size: 0.72rem;
  font-family: inherit;
  color: #c9d1d9;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  cursor: pointer;
}

.spc-btn:hover {
  border-color: #58a6ff;
}

.spc-btn.active {
  color: #0d1117;
  background: #58a6ff;
  border-color: #58a6ff;
}

.alerts-col-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6e7681;
  margin-bottom: 0.25rem;
}

.alerts-categories,
.alerts-subtypes {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.alerts-subtypes {
  border-left: 1px solid #30363d;
  padding-left: 0.75rem;
}

.alerts-subtypes.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.alerts-check-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #c9d1d9;
  cursor: pointer;
}

.alerts-check-row input[type="checkbox"] {
  accent-color: #58a6ff;
}

.station-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.station-close:hover {
  color: #f0f6fc;
}

.station-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f0f6fc;
  padding-right: 1.5rem;
}

.product-select {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.product-select:focus {
  border-color: #58a6ff;
}

.product-select option:disabled {
  color: #484f58;
}

/* Tilt selector */
.tilt-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.4rem;
}

.tilt-btn {
  padding: 2px 6px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 3px;
  color: #8b949e;
  font-size: 0.7rem;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.3;
}

.tilt-btn:hover {
  border-color: #58a6ff;
  color: #c9d1d9;
}

.tilt-btn.active {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}

/* Storm motion inputs */
.storm-motion {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #8b949e;
}

.storm-motion input {
  width: 48px;
  padding: 2px 4px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 3px;
  color: #c9d1d9;
  font-size: 0.75rem;
  font-family: inherit;
  text-align: center;
}

.storm-motion input:focus {
  border-color: #58a6ff;
  outline: none;
}

/* Panel toggles */
.panel-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-top: 0.4rem;
}

/* Risk tab: severe risk readout for the pin (or the address-bar location) */
.severe-readout {
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.25rem 0 0.5rem;
}

.severe-spc {
  font-weight: 600;
}

.severe-day {
  margin-top: 0.5rem;
  font-weight: 600;
  color: #f0f6fc;
}

.severe-hazard {
  color: #c9d1d9;
  padding-left: 0.75rem;
}

.severe-readout .severe-credit {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
}

/* Pin tab */
.pin-help {
  font-size: 0.75rem;
  color: #8b949e;
  margin-bottom: 0.5rem;
}

#pin-label {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 0.4rem;
}

#pin-label:focus {
  border-color: #58a6ff;
}

.pin-buttons {
  display: flex;
  gap: 0.35rem;
}

.pin-buttons button {
  padding: 0.35rem 0.65rem;
  background: #1f6feb;
  color: #fff;
  border: 1px solid #1f6feb;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}

.pin-buttons button:hover {
  background: #388bfd;
  border-color: #388bfd;
}

.pin-buttons button#pin-clear {
  background: transparent;
  color: #8b949e;
  border-color: #30363d;
}

.pin-buttons button#pin-clear:hover {
  color: #c9d1d9;
  border-color: #58a6ff;
}

.pin-coords {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #8b949e;
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}

.pin-coords:empty {
  display: none;
}

/* Colors tab */
.colors-row {
  display: block;
  margin-bottom: 0.5rem;
}

.colors-label {
  font-size: 0.72rem;
  color: #8b949e;
}

.colors-row .product-select {
  margin-top: 0.2rem;
}

.colors-preview {
  margin: 0.6rem 0 0.75rem;
}

.colors-preview-bar {
  height: 14px;
  border: 1px solid #30363d;
  border-radius: 3px;
}

.colors-preview-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: #8b949e;
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}

.colors-preview-unit {
  margin-top: 0.1rem;
  text-align: center;
  font-size: 0.68rem;
  color: #6e7681;
}

.colors-import {
  padding: 0.5rem;
  border: 1px dashed #30363d;
  border-radius: 4px;
}

.colors-import.dragging {
  border-color: #58a6ff;
  background: #0d1117;
}

.colors-help {
  font-size: 0.72rem;
  color: #8b949e;
  margin-bottom: 0.35rem;
}

.colors-file {
  width: 100%;
  font-size: 0.7rem;
  color: #8b949e;
  font-family: inherit;
}

.colors-error {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #f85149;
}

.colors-imported {
  margin-top: 0.5rem;
}

.colors-imported-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.2rem 0;
  font-size: 0.72rem;
  color: #c9d1d9;
}

.colors-imported-row button {
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 3px;
  color: #8b949e;
  font-size: 0.75rem;
  line-height: 1;
  padding: 1px 5px;
  cursor: pointer;
  font-family: inherit;
}

.colors-imported-row button:hover {
  border-color: #f85149;
  color: #f85149;
}

.colors-reset {
  margin-top: 0.6rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #8b949e;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}

.colors-reset:hover {
  border-color: #58a6ff;
  color: #c9d1d9;
}

.colors-note {
  margin-top: 0.6rem;
  font-size: 0.68rem;
  color: #6e7681;
  line-height: 1.4;
}

.toggle-label {
  font-size: 0.75rem;
  color: #8b949e;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

.toggle-label input[type="checkbox"] {
  accent-color: #58a6ff;
}

.opacity-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #8b949e;
  margin: 0.2rem 0 0.5rem;
}

.opacity-label input[type="range"] {
  flex: 1;
  accent-color: #58a6ff;
}

.station-status {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #8b949e;
  white-space: nowrap;
}

.station-status-error {
  color: #f85149;
}

/* Links inside the station-info panel (and other map overlays) */
.station-info a {
  color: #58a6ff;
  text-decoration: none;
}

.station-info a:hover {
  text-decoration: underline;
}

/* Credit line at the bottom of the station-info panel */
.station-credit {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid #21262d;
  font-size: 0.7rem;
  color: #6e7681;
  text-align: center;
}

/* Permanent not-an-alert-service line under the credit */
.disclaimer-line {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  line-height: 1.4;
  color: #6e7681;
  text-align: center;
}

/* One-time notice shown on first visit; OK is the only way past.
   Shared markup built by /disclaimer.js. */
.disclaimer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(1, 4, 9, 0.7);
}

.disclaimer-modal {
  max-width: 28rem;
  padding: 1rem 1.25rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #c9d1d9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.disclaimer-modal h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #e6edf3;
}

.disclaimer-modal p {
  margin: 0 0 0.6rem;
}

.disclaimer-modal a {
  color: #58a6ff;
  text-decoration: none;
}

.disclaimer-modal a:hover {
  text-decoration: underline;
}

.disclaimer-modal button {
  padding: 0.35rem 1.2rem;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 0.85rem;
  cursor: pointer;
}

.disclaimer-modal button:hover {
  background: #30363d;
}

/* Alert detail modal */
.alert-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
}

.alert-modal.open {
  display: flex;
}

.alert-modal-content {
  position: relative;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.alert-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.alert-modal-close:hover {
  color: #f0f6fc;
}

.alert-modal-title {
  font-size: 1rem;
  font-weight: 700;
  padding-right: 2rem;
  margin-bottom: 0.5rem;
}

.alert-modal-meta {
  font-size: 0.8rem;
  color: #8b949e;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.alert-modal-meta a,
.alert-modal-body a {
  color: #58a6ff;
  text-decoration: none;
}

.alert-modal-meta a:hover,
.alert-modal-body a:hover {
  text-decoration: underline;
}

.alert-modal-body {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  margin: 0;
}

/* SPC watch hazard probabilities (Severe T-storm / Tornado watch detail) */
.alert-prob {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #30363d;
}

.alert-prob-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b949e;
  margin: 0.75rem 0 0.4rem;
}

.alert-prob-heading:first-child {
  margin-top: 0;
}

.alert-prob-threats {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #f0b429;
}

.alert-prob-threats li {
  margin-bottom: 0.2rem;
}

.alert-prob-table {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.alert-prob-row {
  display: grid;
  grid-template-columns: 11rem 1fr 2.6rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.alert-prob-label {
  color: #c9d1d9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-prob-bar {
  position: relative;
  height: 0.7rem;
  background: #30363d;
  border-radius: 4px;
  overflow: hidden;
}

.alert-prob-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  min-width: 2px;
}

.alert-prob-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #f0f6fc;
  font-weight: 600;
}

.alert-prob-attrs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.alert-prob-card {
  flex: 1;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  text-align: center;
}

.alert-prob-card-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b949e;
  margin-bottom: 0.2rem;
}

.alert-prob-card-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f0f6fc;
}

@media (max-width: 480px) {
  .alert-prob-row {
    grid-template-columns: 8rem 1fr 2.4rem;
    font-size: 0.72rem;
  }
}

/* Data readout (floating near cursor) */
.data-readout {
  position: absolute;
  background: rgba(22, 27, 34, 0.92);
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: #f0f6fc;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}

/* MapLibre overrides for dark theme */
.maplibregl-ctrl-attrib {
  background: rgba(22, 27, 34, 0.8) !important;
  color: #8b949e !important;
  font-size: 0.7rem !important;
}

.maplibregl-ctrl-attrib a {
  color: #58a6ff !important;
}

.maplibregl-popup-content {
  background: #161b22;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.maplibregl-popup-tip {
  border-top-color: #161b22;
}

.popup-sub {
  font-size: 0.7rem;
  color: #8b949e;
}

/* Mobile nav: synced copy of the hamburger block in /style.css (the two
   stylesheets already duplicate tab styling; keep them in sync by hand).
   Below 960px the topbar tabs collapse into the dropdown, which also
   removes the only element wider than a phone viewport - the cause of the
   blank strip beside the map when panning. */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
}

.nav-burger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: #c9d1d9;
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 12rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  z-index: 30;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.nav-menu.open {
  display: block;
}

.nav-menu-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  color: #c9d1d9;
  text-decoration: none;
}

.nav-menu-link + .nav-menu-link {
  border-top: 1px solid #21262d;
}

.nav-menu-link:hover {
  background: #21262d;
}

.nav-menu-link.active {
  color: #58a6ff;
}

/* Badge inside the dropdown (the inline topbar tabs carry no badge, so
   this class only appears in the menu here). */
.tab-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b949e;
  border: 1px solid #30363d;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  line-height: 1.4;
}

.nav-menu-link.active .tab-badge {
  color: #58a6ff;
  border-color: #1f6feb;
}

@media (max-width: 960px) {
  .topbar {
    position: relative;
  }
  .topbar-tabs {
    display: none;
  }
  .nav-burger {
    display: flex;
    margin-left: auto;
  }
  .nav-menu {
    top: calc(100% + 4px);
    left: auto;
    right: 0.5rem;
  }
}
