:root {
  --bg: #0b1220;
  --panel: rgba(13, 20, 38, .92);
  --panel-border: rgba(255, 255, 255, .08);
  --text: #e7ecf5;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent-2: #60a5fa;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; background: var(--bg); }

body { font-family: var(--font); color: var(--text); }

#map { position: absolute; inset: 0; background: #0d1526; }

.leaflet-container { background: #0d1526; font-family: var(--font); }

#panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: 300px; z-index: 1200;
  background: var(--panel); border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .25s ease;
}
#panel.open { transform: translateX(0); }
@media (max-width: 760px) { #panel { width: 86vw; } }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--panel-border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 30% 30%, #fde68a, var(--accent) 55%, #7c2d12);
  box-shadow: 0 0 14px rgba(245, 158, 11, .55);
}
.brand h1 { margin: 0; font-size: 17px; line-height: 1.1; }
.brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }

#panelClose {
  background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1;
}
#panelClose:hover { color: var(--text); }

#panel section { padding: 12px 16px; border-bottom: 1px solid var(--panel-border); }
#panel h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.05);
  color: var(--text); font: 500 12px var(--font); padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.chips button:hover { background: rgba(255,255,255,.1); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #1a1206; }

#layerList { display: flex; flex-direction: column; gap: 2px; }
.layer-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 6px; cursor: pointer;
  font-size: 13px;
}
.layer-row:hover { background: rgba(255,255,255,.05); }
.layer-row input { accent-color: var(--accent); }
.layer-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid rgba(255,255,255,.2); }
.layer-name { flex: 1; }
.layer-op { width: 74px; accent-color: var(--accent); }

#panel footer { margin-top: auto; padding: 12px 16px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
#panel footer a { color: #7cb0ff; text-decoration: none; }

#panelToggle {
  position: absolute; top: 12px; left: 12px; z-index: 1200;
  background: var(--panel); color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 8px; font-size: 18px; width: 40px; height: 40px; cursor: pointer;
  display: block;
}
#panel.open ~ #panelToggle { display: none; }
.leaflet-top.leaflet-left { margin-top: 56px; }

/* ---------- live banner ---------- */
#banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(calc(-50% + 48px)); z-index: 1210;
  max-width: 640px; width: max-content; max-width: calc(100vw - 48px);
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px;
  padding: 9px 12px; font-size: 12.5px; line-height: 1.45; color: var(--text);
  backdrop-filter: blur(10px); box-shadow: 0 6px 22px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 10px;
}
#banner b { color: #fde68a; }
#banner.hidden { display: none; }
.banner-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 0 rgba(245,158,11,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245,158,11,.55); }
  70% { box-shadow: 0 0 0 9px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
#bannerClose {
  background: none; border: 0; color: var(--muted); font-size: 18px;
  cursor: pointer; line-height: 1; padding: 0 2px;
}
#bannerClose:hover { color: var(--text); }
@media (max-width: 760px) { #panel.open ~ #banner { display: none; } }

.iss-icon { position: relative; }
.iss-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #e2e8f0; border: 2px solid #38bdf8;
  box-shadow: 0 0 0 4px rgba(56,189,248,.35), 0 0 12px rgba(56,189,248,.8);
  animation: issPulse 1.6s infinite;
}
@keyframes issPulse {
  0% { box-shadow: 0 0 0 0 rgba(56,189,248,.5), 0 0 12px rgba(56,189,248,.8); }
  70% { box-shadow: 0 0 0 10px rgba(56,189,248,0), 0 0 12px rgba(56,189,248,.8); }
  100% { box-shadow: 0 0 0 0 rgba(56,189,248,0), 0 0 12px rgba(56,189,248,.8); }
}

#timebar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 1150;
  width: min(760px, calc(100vw - 48px));
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 12px 16px 8px; backdrop-filter: blur(10px);
  display: grid; grid-template-columns: auto auto 150px 1fr; grid-template-rows: auto auto;
  gap: 4px 14px; align-items: center;
}
#playBtn {
  grid-row: 1 / 3; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--accent); color: #1a1206; font-size: 16px; cursor: pointer;
}
#playBtn:hover { filter: brightness(1.1); }
#liveBtn {
  grid-row: 1 / 3; align-self: center;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.05);
  color: var(--text); font: 600 11px var(--font); letter-spacing: .08em;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-transform: uppercase;
}
#liveBtn:hover { background: rgba(255,255,255,.1); }
#liveBtn.on { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.time-readout { grid-column: 3; grid-row: 1; text-align: left; }
#timeReadout { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; display: block; }
#timeSub { font-size: 11px; color: var(--muted); }
#timeSlider { grid-column: 4; grid-row: 1; width: 100%; accent-color: var(--accent); }
#timeScale {
  grid-column: 4; grid-row: 2; display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  #timebar { grid-template-columns: auto 1fr; }
  .time-readout { grid-column: 2; }
  #timeSlider, #timeScale { grid-column: 2; }
  #liveBtn { grid-column: 1; grid-row: 2; }
}

#info {
  position: absolute; right: 16px; bottom: 104px; z-index: 1150; width: 330px; max-height: 62vh;
  overflow-y: auto; background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
#info.hidden { display: none; }
#infoClose {
  position: absolute; top: 8px; right: 10px; background: none; border: 0;
  color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1;
}
#infoClose:hover { color: var(--text); }
#infoBody { font-size: 12.5px; }
.info-loc { font-size: 13px; font-weight: 600; margin-bottom: 2px; padding-right: 20px; }
.info-coord { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.info-banner {
  border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-weight: 600; font-size: 13px;
}
.info-banner.total { background: rgba(245,158,11,.16); color: #fcd34d; border: 1px solid rgba(245,158,11,.35); }
.info-banner.partial { background: rgba(96,165,250,.14); color: #93c5fd; border: 1px solid rgba(96,165,250,.3); }
.info-banner.none { background: rgba(148,163,184,.12); color: var(--muted); border: 1px solid rgba(148,163,184,.25); }

table.contacts { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
table.contacts th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--panel-border); font-weight: 600;
}
table.contacts td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.04); font-variant-numeric: tabular-nums; }
table.contacts td:first-child { color: var(--muted); width: 74px; }
table.contacts .tot { color: #fcd34d; }
.info-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.info-actions button {
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.06); color: var(--text);
  font: 500 11.5px var(--font); padding: 5px 9px; border-radius: 7px; cursor: pointer;
}
.info-actions button:hover { background: rgba(255,255,255,.12); }
.info-note { font-size: 10.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

.leaflet-control-attribution { background: rgba(11,18,32,.7) !important; color: #94a3b8 !important; font-size: 10px; }
.leaflet-control-attribution a { color: #7cb0ff !important; }

#topMenu { position: fixed; top: 18px; right: 18px; z-index: 1500; }
#topMenuBtn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(15,25,45,.62); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 6px 22px rgba(0,0,0,.4); transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
#topMenuBtn:hover { transform: scale(1.06); background: rgba(30,45,78,.8); border-color: rgba(255,255,255,.3); }
#topMenuBtn .tdot { width: 5px; height: 5px; border-radius: 50%; background: var(--text); display: block; }
#topMenuDrop {
  position: absolute; top: 56px; right: 0; min-width: 210px; padding: 8px; border-radius: 16px;
  background: rgba(15,25,45,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 44px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease; pointer-events: none;
}
#topMenuDrop.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#topMenuDrop a {
  display: block; padding: 11px 13px; border-radius: 10px; color: var(--text); text-decoration: none;
  font: 500 14px/1.3 var(--font); transition: background .12s ease, color .12s ease;
}
#topMenuDrop a:hover { background: rgba(255,255,255,.09); color: #fff; }
#topMenuDrop a + a { margin-top: 2px; }
#topMenuDrop a::before { content: "•"; color: var(--accent); margin-right: 8px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }
