:root {
  --bg: #0b1020;
  --panel: #121a30;
  --panel2: #0e1528;
  --line: #243150;
  --text: #e8eefc;
  --muted: #8ea0c4;
  --accent: #7fd1ff;
  --warn: #ffb347;
  --red: #ff3b3b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; }

/* top bar */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--panel2); border-bottom: 1px solid var(--line);
  z-index: 1200;
}
.brand { display: flex; align-items: center; gap: 12px; }
.swisscross {
  width: 30px; height: 30px; border-radius: 6px; background: var(--red); position: relative; flex: none;
}
.swisscross::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  background:
    linear-gradient(#fff,#fff) center/40% 70% no-repeat,
    linear-gradient(#fff,#fff) center/70% 40% no-repeat;
}
.brandtext strong { letter-spacing: 3px; font-size: 16px; }
.brandtext small { display: block; color: var(--muted); font-size: 11px; }

.clock { text-align: right; }
.utc { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; color: var(--accent); }
.warpline { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.warpline button {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px;
}
.warpline button:hover { border-color: var(--accent); }
.warplabel { font-family: ui-monospace, monospace; font-size: 12px; color: var(--warn); min-width: 56px; }
#warp { width: 120px; accent-color: var(--accent); }

/* main split */
#main { flex: 1; display: flex; min-height: 0; }
#map { flex: 1; background: #06080f; }

/* panel */
#panel {
  width: 340px; background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
#tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; background: transparent; color: var(--muted); border: 0; padding: 12px 4px;
  cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); background: var(--panel2); }

.tabpanel { display: none; padding: 14px; overflow-y: auto; }
.tabpanel.active { display: block; }
.lede { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 14px; }

.fld { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.fld select, .fld input[type=text], .fld input[list], .fld input[type=date] {
  display: block; width: 100%; margin-top: 4px; background: var(--panel2);
  color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; font-size: 13px;
}
.fld input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 6px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 12px; cursor: pointer; }
.chk input { accent-color: var(--accent); }
.count { font-size: 12px; color: var(--accent); margin: -6px 0 12px; }

button.primary {
  width: 100%; background: linear-gradient(180deg, #1d62ff, #134fd6); color: #fff;
  border: 0; border-radius: 8px; padding: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }

.list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.row {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.row:hover { border-color: var(--accent); }
.rname { font-size: 12.5px; }
.rmeta { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.muted { color: var(--muted); font-size: 12px; }
.err { color: var(--red); font-size: 12px; }

#panelfoot { margin-top: auto; padding: 8px 14px; border-top: 1px solid var(--line); }
#status { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }

/* floating sat info */
.satinfo {
  position: absolute; left: 12px; top: 64px; z-index: 1100; max-width: 320px;
  background: rgba(18,26,48,.92); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.5; backdrop-filter: blur(4px);
}
.satinfo .muted { font-size: 11px; }
.satinfo button { float: right; background: transparent; color: var(--muted); border: 0; cursor: pointer; font-size: 16px; }
.hidden { display: none; }

/* leaflet dark tweaks */
.leaflet-container { background: #06080f; }
.leaflet-control-layers, .leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-control-attribution { background: rgba(11,16,32,.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--accent) !important; }

@media (max-width: 760px) {
  #main { flex-direction: column; }
  #panel { width: 100%; height: 46%; border-left: 0; border-top: 1px solid var(--line); }
  .satinfo { top: auto; bottom: 50%; }
}
