:root {
  --bg: #101418;
  --panel: rgba(18, 23, 29, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e8eaed;
  --text-dim: #9aa0a6;
  --accent: #f5c518;
  --accent-dim: rgba(245, 197, 24, 0.15);
  --ok: #34d399;
  --err: #f87171;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

#globe {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: radial-gradient(ellipse at center, #12161c 0%, #05070a 100%);
}
#globe canvas { display: block; }
#globe-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 501;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11px;
  pointer-events: none;
}

.hidden { display: none !important; }

/* ---------------- barra superiore ---------------- */
#topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  /* sopra #controls (1000): altrimenti i menu a tendina della topbar
     (ricerca, voli speciali) finiscono sotto i controlli mappa che, a parità
     di z-index e venendo dopo nel DOM, intercettano i clic */
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

#brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
#brand b { color: var(--accent); font-weight: 700; }

#search-wrap { position: relative; flex: 1; max-width: 420px; }

#search {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--text-dim); }

#search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.search-item:hover { background: var(--accent-dim); }
.search-item .si-main { font-weight: 600; }
.search-item .si-sub { color: var(--text-dim); font-size: 12px; }

#stats { margin-left: auto; text-align: right; white-space: nowrap; }
#stat-count { font-size: 16px; font-weight: 700; color: var(--accent); }
.stat-sub { display: block; font-size: 11px; color: var(--text-dim); }

/* ---------------- voli speciali ---------------- */
#btn-special {
  padding: 6px 11px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  color: var(--err);
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
}
#btn-special:hover { background: rgba(248, 113, 113, 0.22); }
#btn-special.pulse { animation: pulse-red 1.2s infinite; }
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.45); }
  50% { box-shadow: 0 0 10px 3px rgba(248, 113, 113, 0.55); }
}

#special-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
.sp-item:hover { background: var(--accent-dim); }
.sp-item .si-main { font-weight: 600; }
.sp-item .si-sub { color: var(--text-dim); font-size: 11px; margin-left: auto; text-align: right; }
.sp-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.sp-tag.emg { background: rgba(248, 113, 113, 0.16); color: var(--err); }
.sp-tag.mil { background: rgba(52, 211, 153, 0.14); color: var(--ok); }

/* ---------------- controlli layer/filtri ---------------- */
#controls {
  position: absolute;
  top: 76px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  /* la colonna di pulsanti rotondi (sopra di me, replay, kiosk) sta allo
     stesso bordo destro ma con z-index più alto: senza questo spazio
     riservato copre l'ultima voce di ogni riga — succedeva già a
     "Solo militari" prima che si aggiungesse la ISS */
  padding-right: 46px;
}

.ctrl-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.ctrl-group button {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ctrl-group button:hover { color: var(--text); }
.ctrl-group button.active { background: var(--accent); color: #1a1a1a; font-weight: 600; }

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.toggle input { accent-color: var(--accent); cursor: pointer; }
.toggle:hover { color: var(--text); }

.ctrl-col {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 9px 11px;
  width: 216px;
}
.ctrl-col input[type="text"] {
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
}
.ctrl-col input[type="text"]:focus { border-color: var(--accent); }
.f-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
}
.f-row span { width: 60px; }
.f-row b { width: 32px; text-align: right; font-size: 10.5px; color: var(--text); font-weight: 600; }
.f-row input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; }

/* ---------------- legenda quota ---------------- */
#legend {
  position: absolute;
  bottom: 24px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 10.5px;
  color: var(--text-dim);
  box-shadow: var(--shadow);
}
#legend-bar {
  width: 120px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    hsl(30, 85%, 55%), hsl(60, 85%, 55%), hsl(120, 85%, 50%),
    hsl(190, 85%, 55%), hsl(230, 85%, 62%), hsl(280, 85%, 62%));
}

/* ---------------- timeline meteo ---------------- */
#weather-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
#wx-play {
  width: 32px;
  height: 26px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
#wx-play:hover { background: rgba(255, 255, 255, 0.14); }
#wx-slider { width: 190px; accent-color: var(--accent); cursor: pointer; }
#wx-time { font-size: 11.5px; color: var(--text-dim); min-width: 108px; }

/* ---------------- stato ---------------- */
#status {
  position: absolute;
  bottom: 24px;
  left: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
  box-shadow: var(--shadow);
}
#status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s;
}
#status-dot.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
#status-dot.err { background: var(--err); box-shadow: 0 0 6px var(--err); }

/* ---------------- pannello dettagli ---------------- */
#panel, #airport-panel {
  position: absolute;
  top: 76px;
  left: 12px;
  bottom: 56px; /* lascia visibile l'indicatore di stato sotto */
  z-index: 1000;
  width: 320px;
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

#panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px 10px;
}
#p-callsign { margin: 0; font-size: 22px; letter-spacing: 0.5px; color: var(--accent); }
#p-operator { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

#panel-actions { display: flex; gap: 6px; }
#panel-actions button {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
#panel-actions button:hover { background: rgba(255, 255, 255, 0.14); }
#btn-follow.active { background: var(--accent); color: #1a1a1a; border-color: var(--accent); font-weight: 600; }

#p-photo-wrap { position: relative; margin: 0 12px; border-radius: 8px; overflow: hidden; min-height: 120px; background: rgba(255,255,255,0.04); }
#p-photo { display: block; width: 100%; height: auto; }
#p-photo-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 12px;
}
#p-photo-credit {
  position: absolute; right: 6px; bottom: 6px;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 5px;
  color: #fff; font-size: 10px;
  text-decoration: none;
}
#p-photo-credit:hover { text-decoration: underline; }

#p-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 12px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.route-airport { flex: 1; min-width: 0; }
.route-airport:last-child { text-align: right; }
.route-code { font-size: 19px; font-weight: 700; }
.route-name {
  font-size: 11px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.route-arrow { color: var(--accent); font-size: 15px; }

#p-progress { margin: 10px 12px 0; }
#p-progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
#p-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}
#p-progress-text { margin-top: 5px; font-size: 11px; color: var(--text-dim); }

#p-status {
  margin: 10px 12px 0;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}
#p-status.ok { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--ok); }
#p-status.warn { background: rgba(245, 197, 24, 0.1); border: 1px solid rgba(245, 197, 24, 0.35); color: var(--accent); }
#p-status.alert { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: var(--err); }

#p-schedule {
  margin: 10px 12px 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}
#p-schedule .sched-delay { font-weight: 700; color: var(--err); }
#p-schedule .sched-ok { font-weight: 700; color: var(--ok); }
#p-schedule .sched-dim { color: var(--text-dim); font-size: 11px; }

.search-item.global { border-top: 1px solid var(--panel-border); }
.search-item.global .si-main { color: var(--accent); }

/* ---------------- pannello aeroporto ---------------- */
#ap-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px 6px;
}
#ap-code { margin: 0; font-size: 20px; color: var(--accent); }
#ap-name { font-size: 12px; color: var(--text-dim); margin-top: 2px; max-width: 230px; }
#ap-close {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
}
#ap-close:hover { background: rgba(255, 255, 255, 0.14); }
.ap-section { padding: 4px 12px; }
.ap-section h3 {
  margin: 8px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}
.ap-list { display: flex; flex-direction: column; gap: 4px; }
.ap-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
.ap-item:hover { background: var(--accent-dim); }
.ap-item .si-main { font-weight: 600; }
.ap-item .si-sub { color: var(--text-dim); font-size: 11.5px; text-align: right; margin-left: auto; }

.ap-status {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.ap-status.ph-cruise { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }
.ap-status.ph-climb { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.ap-status.ph-descend { background: rgba(245, 197, 24, 0.16); color: var(--accent); }
.ap-status.ph-taxi { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; }
.ap-status.ph-ground { background: rgba(154, 160, 166, 0.16); color: var(--text-dim); }

#ap-sched h4 {
  margin: 8px 2px 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 600;
}
.sched-time {
  font-weight: 700;
  color: var(--accent);
  font-size: 12.5px;
  flex-shrink: 0;
  width: 42px;
}

/* icone aeree sul globo (al posto dei pallini) */
#globe-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;   /* il drag del globo resta libero */
  z-index: 2;
}
.globe-plane {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  pointer-events: auto;   /* ma le icone restano cliccabili */
  cursor: pointer;
}
.globe-plane svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 2px rgba(0,0,0,0.9)); }
.globe-plane:hover svg path { stroke: #fff; stroke-width: 1px; }
.ap-empty { font-size: 12px; color: var(--text-dim); padding: 2px 2px 6px; }
#ap-note { margin-top: auto; padding: 10px 14px 14px; font-size: 10.5px; color: var(--text-dim); }

#p-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}
.cell {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.cell label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-dim); }
.cell output { display: block; font-size: 14px; font-weight: 600; margin-top: 3px; }
.cell output small { font-weight: 400; color: var(--text-dim); font-size: 11px; }

#p-note { padding: 0 14px 14px; font-size: 10.5px; color: var(--text-dim); }

/* ---------------- icone aerei ---------------- */
.plane-wrap { background: none !important; border: none !important; }
.plane-holder { position: absolute; left: 0; top: 0; }
.plane-icon {
  position: absolute;
  left: 0; top: 0;
  width: var(--plane-size, 26px);
  height: var(--plane-size, 26px);
  margin-left: calc(var(--plane-size, 26px) / -2);
  margin-top: calc(var(--plane-size, 26px) / -2);
  cursor: pointer;
  transition: transform 0.9s linear;
}
.plane-icon.selected, .plane-icon:hover {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}
.plane-icon svg { width: 100%; height: 100%; display: block; }
.plane-icon.grounded { opacity: 0.65; width: calc(var(--plane-size, 26px) * 0.72); height: calc(var(--plane-size, 26px) * 0.72); margin-left: calc(var(--plane-size, 26px) * -0.36); margin-top: calc(var(--plane-size, 26px) * -0.36); }
.plane-icon.selected svg path { stroke: #ffffff; stroke-width: 1.6px; }
.plane-icon:hover svg path { stroke: #ffffff; stroke-width: 1px; }

/* anello pulsante per le emergenze */
.plane-holder.emergency::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: calc(var(--plane-size, 26px) * 1.7);
  height: calc(var(--plane-size, 26px) * 1.7);
  margin-left: calc(var(--plane-size, 26px) * -0.85);
  margin-top: calc(var(--plane-size, 26px) * -0.85);
  border: 2px solid rgba(248, 113, 113, 0.85);
  border-radius: 50%;
  pointer-events: none;
  animation: emg-ring 1.3s ease-out infinite;
}
@keyframes emg-ring {
  0% { transform: scale(0.55); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}
.plane-holder.emergency .plane-icon svg path { stroke: #ff3b3b; stroke-width: 1.4px; }

/* etichetta stile FR24: box con callsign, quota e velocità
   (fuori da .plane-icon così non ruota con l'aereo) */
.plane-label {
  position: absolute;
  left: calc(var(--plane-size, 26px) / 2 + 4px);
  top: -12px;
  padding: 3px 7px;
  background: rgba(13, 17, 22, 0.87);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 2px solid var(--accent);
  border-radius: 5px;
  font-size: 10px;
  font-family: var(--font);
  line-height: 1.3;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
}
.plane-label b {
  display: block;
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.3px;
}
.plane-label span { color: var(--text-dim); }

/* tooltip leaflet ristilizzato */
.leaflet-tooltip.plane-tip {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font);
  font-size: 11.5px;
  box-shadow: var(--shadow);
  padding: 6px 9px;
}
.leaflet-tooltip.plane-tip::before { display: none; }
.plane-tip b { color: var(--accent); }
.plane-tip .tip-sub { color: var(--text-dim); font-size: 10.5px; }

/* attribution leaflet in tema */
.leaflet-control-attribution {
  background: rgba(16, 20, 24, 0.75) !important;
  color: var(--text-dim) !important;
  font-size: 9.5px !important;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

.leaflet-control-zoom { margin-top: 140px !important; }
.leaflet-control-zoom a {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--panel-border) !important;
}
.leaflet-control-zoom a:hover { background: rgba(255, 255, 255, 0.1) !important; }

/* ---------------- bottone controlli (solo mobile) ---------------- */
#btn-controls {
  display: none;
  position: absolute;
  top: 76px;
  right: 12px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
body.controls-open #btn-controls { background: var(--accent); color: #1a1a1a; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px), (max-height: 520px) {
  #topbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 7px 10px;
  }
  #brand span { display: none; }        /* resta solo l'icona */
  #search-wrap { max-width: none; }
  #stats { display: none; }
  #btn-special { padding: 6px 8px; font-size: 11px; }

  /* controlli chiusi di default, si aprono col bottone ☰ */
  #btn-controls { display: flex; }
  /* left: 12px vincola la larghezza al viewport: senza, il pannello ancorato a
     destra sforava a sinistra sugli schermi stretti (visto su Galaxy S26 Ultra) */
  #controls { display: none; top: 126px; left: 12px; }
  body.controls-open #controls { display: flex; }
  /* e le righe di pulsanti vanno a capo invece di sforare */
  .ctrl-group { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .ctrl-col { width: min(240px, calc(100vw - 24px)); }

  /* pannelli come bottom-sheet */
  #panel, #airport-panel {
    width: calc(100vw - 24px);
    top: auto;
    max-height: 58vh;
    bottom: 12px;
  }

  /* barra meteo a tutta larghezza, slider elastico */
  #weather-bar {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 12px;
  }
  #wx-slider { width: auto; flex: 1; }
  #wx-time { min-width: 0; white-space: nowrap; }

  /* lo zoom si fa col pinch, l'indicatore di stato si sposta in alto */
  .leaflet-control-zoom { display: none; }
  #status { bottom: auto; top: 64px; left: 12px; }
  #legend { display: none; }
}

/* ---------------- icone navi (layer AIS di CraftWatch) ---------------- */
.ship-icon {
  position: absolute;
  left: 0; top: 0;
  width: calc(var(--plane-size, 26px) * 0.62);
  height: calc(var(--plane-size, 26px) * 0.62);
  margin-left: calc(var(--plane-size, 26px) * -0.31);
  margin-top: calc(var(--plane-size, 26px) * -0.31);
  cursor: pointer;
  transition: transform 0.9s linear;
}
.ship-icon svg { width: 100%; height: 100%; display: block; }
.ship-icon.moored { opacity: 0.55; }
.ship-icon.selected svg path, .ship-icon:hover svg path { stroke: #ffffff; stroke-width: 1.4px; }

#ship-panel {
  position: absolute;
  top: 76px;
  left: 12px;
  bottom: 56px;
  z-index: 1000;
  width: 320px;
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
#ship-panel.hidden { display: none; }
#s-name { margin: 0; font-size: 20px; color: var(--accent); }
#s-flag { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
#s-dest {
  margin: 4px 12px 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 12.5px;
}
#s-dest b { color: var(--accent); }

@media (max-width: 900px), (max-height: 520px) {
  #ship-panel { width: calc(100vw - 24px); top: auto; max-height: 58vh; bottom: 12px; }
}

/* controlli disabilitati quando il layer aerei è spento */
.ctrl-disabled { opacity: 0.35; pointer-events: none; }
#search:disabled { opacity: 0.5; cursor: not-allowed; }

/* posizioni AIS invecchiate (>15 min) e riga meteo del pannello nave */
.ship-icon.stale { opacity: 0.3; }
#s-weather {
  margin: 8px 12px 0;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
}
#s-weather.hidden { display: none; }

/* frecce del vento del layer mare */
.wind-arrow {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;
  opacity: 0.75;
}
.wind-arrow svg { width: 100%; height: 100%; display: block; }
.wind-arrow svg path { fill: #e8eaed; stroke: rgba(0,0,0,0.6); stroke-width: 0.6; }

/* navi sul globo: leggermente più piccole degli aerei */
.globe-ship { width: 12px; height: 12px; margin-left: -6px; margin-top: -6px; }

/* navi più leggibili sulle mappe chiare: bordo netto e meno trasparenza */
.ship-icon svg { filter: drop-shadow(0 0 1.5px rgba(255,255,255,0.7)); }
.ship-icon.moored { opacity: 0.78; }
.ship-icon.stale { opacity: 0.45; }

/* avviso zona navi in sintonizzazione / senza copertura */
#ship-warmup {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  max-width: min(560px, calc(100vw - 24px));
  padding: 9px 14px;
  background: var(--panel);
  border: 1px solid rgba(245, 197, 24, 0.45);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: var(--text);
  text-align: center;
  pointer-events: none;
}

/* ---------------- mobile: pannelli compatti e spazio alla mappa ---------------- */
@media (max-width: 900px), (max-height: 520px) {
  /* i pannelli occupano al massimo metà schermo scarsa */
  #panel, #airport-panel, #ship-panel { max-height: 48vh; }

  /* foto compressa: informazione sì, monopolio dello schermo no */
  #p-photo-wrap { max-height: 100px; min-height: 0; }
  #p-photo { height: 100px; width: 100%; object-fit: cover; }

  /* celle più fitte */
  #p-grid { gap: 5px; padding: 8px 10px; }
  .cell { padding: 5px 8px; }
  .cell output { font-size: 13px; }

  /* le note a piè di pannello non servono su schermi piccoli */
  #p-note, #ap-note { display: none; }

  /* avviso navi: in alto, sotto lo stato, non sopra i pannelli */
  #ship-warmup { bottom: auto; top: 100px; font-size: 11.5px; }
}

/* ---------------- pannelli collassabili ---------------- */
.sheet-collapsed { max-height: 62px !important; overflow: hidden !important; }
#panel-header, #ap-header { cursor: pointer; user-select: none; }

#btn-search-toggle { display: none; }

@media (max-width: 900px), (max-height: 520px) {
  /* maniglia da bottom-sheet sulle intestazioni */
  #panel-header, #ap-header { position: relative; padding-top: 18px; }
  #panel-header::after, #ap-header::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
  }

  /* ricerca ridotta a icona: il campo si apre solo su richiesta */
  #search-wrap { display: none; }
  #btn-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
  }
  body.search-open #search-wrap {
    display: block;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-width: none;
    z-index: 1002;
  }
  body.search-open #search {
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  /* indicatore di stato ridotto a pallino: tap per i dettagli */
  #status { top: 60px; padding: 8px; border-radius: 50%; cursor: pointer; }
  #status #status-text { display: none; }
  body.status-open #status { border-radius: 8px; padding: 6px 12px; }
  body.status-open #status #status-text { display: inline; }

  #ship-warmup { top: 60px; left: 56px; right: 12px; transform: none; max-width: none; }
}

/* ---------------- "sopra di me" ---------------- */
#btn-nearme {
  position: absolute;
  top: 126px;
  right: 12px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
#btn-nearme:hover { background: rgba(255, 255, 255, 0.1); }

#nearme-panel {
  position: absolute;
  top: 176px;
  right: 12px;
  z-index: 1001;
  width: 280px;
  max-width: calc(100vw - 24px);
  max-height: 46vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
#nearme-panel.hidden { display: none; }
#nearme-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 6px;
}
#nearme-header h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); }
#nearme-close {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}
#nearme-list { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.nearme-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 2px 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
}
.nearme-item:hover { background: var(--accent-dim); }
.nm-dist { grid-row: span 2; align-self: center; font-weight: 700; color: var(--accent); font-size: 13px; }
.nm-main { font-weight: 600; }
.nm-sub { color: var(--text-dim); font-size: 11px; }

@media (max-width: 900px), (max-height: 520px) {
  #btn-nearme { top: 126px; }
  #nearme-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 42vh; }
}

/* ---------------- dati di volo (cabina) ---------------- */
#p-tech-toggle {
  margin: 10px 12px 0;
  padding: 7px 11px;
  width: calc(100% - 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
}
#p-tech-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
#p-tech-toggle.hidden, #p-tech.hidden, #p-wind-row.hidden { display: none; }

#p-wind-row {
  margin: 8px 12px 0;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
}
#p-wind-row.wind-good { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--ok); }
#p-wind-row.wind-bad { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.35); color: var(--err); }
#p-wind-row.wind-neutral { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--panel-border); color: var(--text); }
#p-wind-row .wind-sub { color: var(--text-dim); font-size: 11px; }

#p-tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px 0;
}
#p-tech-grid .cell output small { display: block; margin-top: 2px; }

/* ---------------- allarmi ---------------- */
#btn-alerts {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
#btn-alerts:hover { background: rgba(255, 255, 255, 0.12); }
#btn-alerts.on { background: var(--accent); border-color: var(--accent); }

#alerts-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  z-index: 1002;
}
#alerts-panel.hidden { display: none; }
#alerts-panel h4 {
  margin: 10px 0 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}
#alerts-panel h4:first-child { margin-top: 0; }
#alerts-panel .toggle { padding: 5px 2px; font-size: 12.5px; }

#al-add-row { display: flex; gap: 6px; }
#al-input {
  flex: 1;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font);
  outline: none;
}
#al-input:focus { border-color: var(--accent); }
#al-add {
  width: 34px;
  background: var(--accent);
  border: none;
  border-radius: 7px;
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#al-watchlist { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
.al-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
}
.al-item button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.al-item button:hover { color: var(--err); }
#al-note { margin-top: 9px; font-size: 10.5px; color: var(--text-dim); line-height: 1.4; }

/* avvisi a comparsa */
#toasts {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid rgba(245, 197, 24, 0.5);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: auto;
  cursor: pointer;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { font-size: 20px; }
.toast-body { display: flex; flex-direction: column; flex: 1; font-size: 12.5px; line-height: 1.35; }
.toast-body b { color: var(--accent); }
.toast-body span { color: var(--text-dim); }
.toast-x { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; }
.toast-x:hover { color: var(--text); }

@media (max-width: 900px), (max-height: 520px) {
  #toasts { bottom: 12px; left: 12px; right: 12px; transform: none; }
  .toast { min-width: 0; width: 100%; }
}

/* ---------------- replay delle scie ---------------- */
#btn-replay {
  position: absolute;
  top: 176px;
  right: 12px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
#btn-replay:hover { background: rgba(255, 255, 255, 0.1); }
#btn-replay.on { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }

/* col replay attivo il pannello "sopra di me" scende per non sovrapporsi */
body.replay-on #nearme-panel { top: 226px; }

#replay-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  font-size: 12px;
  color: var(--text-dim);
}
#replay-bar.hidden { display: none; }
#replay-bar button {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 9px;
  cursor: pointer;
}
#replay-bar button:hover { background: rgba(255, 255, 255, 0.15); }
#rp-slider { width: 240px; accent-color: var(--accent); cursor: pointer; }
#rp-time { font-weight: 700; color: var(--accent); font-size: 13px; min-width: 46px; }
#rp-live { min-width: 66px; }
#rp-info { color: var(--text-dim); font-size: 11px; max-width: 220px; }
#rp-window {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font);
  font-size: 11.5px;
  padding: 4px 6px;
  cursor: pointer;
}

@media (max-width: 900px), (max-height: 520px) {
  #btn-replay { top: 176px; }
  #replay-bar {
    left: 12px; right: 12px; bottom: 12px;
    transform: none;
    flex-wrap: wrap;
    max-width: none;
    gap: 7px;
  }
  #rp-slider { width: 100%; order: -1; }
  #rp-info { display: none; }
}

/* ---------------- modalità kiosk ---------------- */
#btn-kiosk {
  position: absolute;
  top: 226px;
  right: 12px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
#btn-kiosk:hover { background: rgba(255, 255, 255, 0.1); }
#btn-kiosk.on { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }

/* bottone e modale del patto */
#btn-patto {
  position: absolute;
  top: 276px;
  right: 12px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
#btn-patto:hover { background: rgba(255, 255, 255, 0.1); }
#patto-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}
#patto-overlay.hidden { display: none; }
#patto-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
#patto-card h2 { font-size: 16px; color: var(--text); margin: 14px 0 6px; }
#patto-card h2:first-child { margin-top: 0; }
#patto-card b { color: var(--text); }
#patto-card a { color: var(--accent); text-decoration: none; }
.patto-riga { display: flex; gap: 10px; margin: 8px 0; }
.patto-riga span { font-size: 17px; flex: none; width: 24px; text-align: center; }
#patto-fonti { font-size: 11px; line-height: 1.7; }
#patto-caffe {
  width: 100%; background: var(--accent); color: #1a1a1a; border: none; border-radius: 10px;
  padding: 11px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  margin: 4px 0;
}
#patto-caffe.hidden { display: none; }
#patto-chiudi {
  width: 100%; background: transparent; color: var(--text-dim);
  border: 1px solid var(--panel-border); border-radius: 10px;
  padding: 9px; font-size: 13px; cursor: pointer; font-family: inherit; margin-top: 8px;
}

/* mappa scura = tile OSM invertite via CSS (niente CARTO: non era libera) */
.tile-scure { filter: invert(1) hue-rotate(180deg) brightness(0.75) contrast(1.05) saturate(0.5); }

/* in kiosk sparisce tutto: resta il cielo (e il mare) */
body.kiosk #topbar,
body.kiosk #iss-panel,
body.kiosk #controls,
body.kiosk #btn-controls,
body.kiosk #btn-nearme,
body.kiosk #btn-replay,
body.kiosk #btn-kiosk,
body.kiosk #btn-patto,
body.kiosk #legend,
body.kiosk #status,
body.kiosk #panel,
body.kiosk #ship-panel,
body.kiosk #airport-panel,
body.kiosk #nearme-panel,
body.kiosk #weather-bar,
body.kiosk #ship-warmup,
body.kiosk .leaflet-control-zoom,
body.kiosk .leaflet-control-attribution { display: none !important; }
body.kiosk.kiosk-idle { cursor: none; }

#kiosk-hud {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 1200;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}
#kiosk-hud.hidden { display: none; }
#kh-clock {
  font-size: 62px;
  font-weight: 200;
  line-height: 1;
  letter-spacing: 1px;
  color: #fff;
}
#kh-stats {
  margin-top: 6px;
  font-size: 19px;
  color: var(--accent);
  letter-spacing: 0.5px;
}
#kh-brand {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

#kiosk-exit {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1201;
  width: 40px;
  height: 40px;
  background: rgba(18, 23, 29, 0.75);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.4s;
}
#kiosk-exit.hidden { display: none; }

@media (max-width: 900px), (max-height: 520px) {
  #btn-kiosk { top: 226px; }
  #btn-patto { top: 276px; }
  #kh-clock { font-size: 40px; }
  #kh-stats { font-size: 15px; }
}

/* ---------------------------------------------------------------- */
/* ISS: pannello, marcatore e passaggi                               */
/* ---------------------------------------------------------------- */
#iss-panel {
  position: absolute;
  bottom: 64px;                 /* sopra la legenda, che sta a 24px */
  right: 12px;
  z-index: 1001;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: 50vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
#iss-panel.hidden { display: none; }
#iss-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 6px;
}
#iss-header h3 {
  margin: 0; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--accent);
}
#iss-close {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}
#iss-stato { padding: 0 12px 8px; font-size: 12.5px; }
.iss-riga {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.iss-riga span { color: var(--text-dim); }
#iss-passaggi { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.iss-pass {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 2px 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  font-size: 12.5px;
}
/* un passaggio visibile a occhio nudo è l'unico per cui vale uscire */
.iss-pass-vis { background: var(--accent-dim); border: 1px solid rgba(245, 197, 24, 0.35); }
.iss-pass-ora { font-weight: 700; color: var(--accent); font-size: 13px; line-height: 1.25; }
.iss-pass-ora span { display: block; font-weight: 400; font-size: 10.5px; color: var(--text-dim); }
.iss-pass-main { font-weight: 600; }
.iss-pass-sub { color: var(--text-dim); font-size: 11px; }
.iss-nota { color: var(--text-dim); font-size: 11.5px; padding: 4px 2px; line-height: 1.4; }
.iss-btn {
  background: var(--accent-dim);
  border: 1px solid rgba(245, 197, 24, 0.35);
  border-radius: 7px; color: var(--text);
  padding: 7px 10px; cursor: pointer; font-size: 12.5px; width: 100%;
}
.iss-btn:hover { background: rgba(245, 197, 24, 0.25); }
.iss-avviso {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 11.5px; color: var(--text-dim);
  padding: 6px 2px 0; cursor: pointer; line-height: 1.35;
}

/* marcatore: un puntino con alone, per distinguerlo dagli aerei */
.iss-icon { background: none; border: none; }
.iss-dot {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
  filter: drop-shadow(0 0 6px rgba(122, 162, 255, 0.9));
}
.iss-dot::before {
  content: ''; position: absolute;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(122, 162, 255, 0.7);
  animation: iss-pulsa 2.4s ease-out infinite;
}
@keyframes iss-pulsa {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.globe-iss { font-size: 15px; filter: drop-shadow(0 0 5px rgba(122, 162, 255, 0.9)); }

@media (max-width: 900px), (max-height: 520px) {
  #iss-panel { width: calc(100vw - 24px); bottom: 12px; max-height: 52vh; }
}
