:root {
  --surface: #ffffff;
  --ink: #1d2430;
  --muted: #6b7380;
  --accent: #3b6cff;
  --orange: #e0812b;
  --line: #e6e8ec;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .25);
  --head: #0f1a2e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; font: 13px/1.4 Outfit, system-ui, sans-serif; color: var(--ink); }
#map { position: absolute; inset: 0; }

.topbar { position: absolute; z-index: 5; top: 10px; left: 10px; right: 320px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; display: flex; gap: 2px; align-items: center; }
.box .lbl { padding: 6px 4px 6px 8px; color: var(--muted); font-size: 12px; }
.box button { border: 0; background: transparent; border-radius: 5px; padding: 6px 10px; font: 500 12px Outfit, sans-serif; color: var(--ink); cursor: pointer; white-space: nowrap; }
.box button:hover { background: #f1f3f6; }
.box button.selected { background: var(--accent); color: #fff; }

.side { position: absolute; z-index: 5; top: 10px; right: 10px; bottom: 60px; width: 296px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: thin; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; }
.card.head { background: var(--head); color: #e8edf6; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand b { font-size: 15px; }
.sub { font-size: 12px; color: #9fb0c8; }
.meta { font-size: 11px; color: #9fb0c8; margin-top: 6px; }
.card-title { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.x { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 2px; }
.hint { color: var(--muted); }
.small { font-size: 11px; }
.center { text-align: center; }
.coords { font-size: 11px; color: var(--muted); }
.big { font-size: 13px; margin: 2px 0 4px; }
.big span { font-size: 22px; font-weight: 700; margin-right: 4px; }
.line { margin: 2px 0; }
h4 { margin: 12px 0 4px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.slider { display: block; margin-top: 10px; }
.slider input { width: 100%; accent-color: var(--accent); }
canvas { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 6px; align-items: center; }
.sw { display: inline-block; width: 14px; height: 0; border-top: 2px solid; }
.sw.blue { border-color: var(--accent); }
.sw.orange { border-color: var(--orange); border-top-style: dashed; margin-left: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.list { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.list th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 2px 0; }
.list td { padding: 2px 0; border-bottom: 1px solid var(--line); }
.list tr { cursor: pointer; }
.list tr:hover td { background: #f6f8fb; }
.list td.dim { color: var(--muted); }

.timebar { position: absolute; z-index: 5; bottom: 12px; left: 50%; transform: translateX(-50%); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 5px 8px; display: flex; gap: 8px; align-items: center; font-size: 12px; max-width: calc(100vw - 32px); }
.timebar button { border: 0; background: #eef1f5; border-radius: 5px; padding: 4px 9px; font: 500 12px Outfit, sans-serif; cursor: pointer; }
.timebar button.on { background: var(--accent); color: #fff; }
.timebar input { width: 180px; accent-color: var(--accent); }
.offset { min-width: 54px; color: var(--muted); }
.clock { white-space: nowrap; font-variant-numeric: tabular-nums; }
.attrib { position: absolute; z-index: 4; right: 10px; bottom: 12px; font-size: 10px; background: rgba(255,255,255,.85); padding: 3px 6px; border-radius: 4px; color: #333; }

.maplibregl-ctrl-bottom-right { display: none; }
.obs-marker { width: 22px; height: 22px; border-radius: 50%; background: #e23b2e; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }

@media (max-width: 760px) {
  .topbar { left: 16px; right: 16px; gap: 6px; }
  .box .lbl { display: none; }
  .box button { padding: 6px 8px; }
  .side { top: auto; bottom: 60px; left: 16px; right: 16px; width: auto; max-height: 42vh; }
  .card.head .sub, .card.head .meta { display: none; }
  .attrib, .maplibregl-ctrl-bottom-left, .offset { display: none; }
  .timebar { left: 16px; right: 16px; transform: none; gap: 6px; }
  .timebar input { flex: 1; min-width: 0; width: auto; }
  .clock { font-size: 11px; }
}

/* Single-instance guard (boot.js / app.js) */
.instance-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(11, 18, 32, .94); display: flex; align-items: center; justify-content: center; padding: 16px; }
.instance-card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 24px; max-width: 420px; text-align: center; }
.instance-card h2 { font-size: 18px; margin: 12px 0 8px; }
.instance-card p { color: var(--muted); margin: 0 0 16px; }
.instance-card button { border: 0; border-radius: 6px; background: var(--accent); color: #fff; padding: 9px 16px; font: 600 13px Outfit, sans-serif; cursor: pointer; }
.instance-card button:disabled { opacity: .6; cursor: default; }
