:root {
  --bg: #0b0f14;
  --panel: rgba(12, 18, 26, 0.86);
  --line: #1f2c3a;
  --text: #cfe0ee;
  --muted: #6f8699;
  --accent: #39d0a0;
  --warn: #e0a040;
  --bad: #e05050;
  --air-low: #f0b030;
  --air-mid: #40c8f0;
  --air-high: #e8f0ff;
  --ship-cargo: #50d080;
  --ship-tanker: #f06848;
  --ship-pass: #5890ff;
  --ship-other: #9aa8b4;
  --airport: #b890ff;
  --port: #3cc8c8;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
#map { position: absolute; inset: 0; }

.bar { position: absolute; top: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center;
  gap: 16px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px); z-index: 2; }
.brand { font: 600 13px var(--mono); letter-spacing: .12em; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.modes { display: flex; gap: 4px; margin-left: auto; }
.modes button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 12px; font: 13px var(--mono); cursor: pointer; }
.modes button.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.clock { font: 13px var(--mono); color: var(--muted); min-width: 110px; text-align: right; }
.clock span { color: var(--text); }

.panel { position: absolute; top: 60px; width: 240px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px; z-index: 2; backdrop-filter: blur(6px); }
.panel.left { left: 12px; }
.panel.right { right: 12px; width: 280px; }
.panel h2 { margin: 0 0 8px; font: 600 11px var(--mono); letter-spacing: .14em; color: var(--muted);
  text-transform: uppercase; }
.panel section + section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.big { display: flex; align-items: baseline; gap: 8px; font: 600 22px var(--mono); }
.big small { font: 12px system-ui, sans-serif; color: var(--muted); }
#sources { list-style: none; margin: 0; padding: 0; font: 12px var(--mono); }
#sources li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
#sources li b { font-weight: normal; }
#sources .ok { color: var(--accent); } #sources .old { color: var(--warn); } #sources .err { color: var(--bad); }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 1px 0; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.ring { background: transparent; border: 2px solid; border-radius: 50%; }
.layers label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; cursor: pointer; }
.layers input { accent-color: var(--accent); }
dd.wide { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
h3 { margin: 12px 0 6px; font: 600 11px var(--mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.info-scroll { max-height: calc(100vh - 140px); overflow-y: auto; }

.panel.left { max-height: calc(100vh - 60px - 190px); overflow-y: auto; }
.minimap { position: absolute; left: 12px; bottom: 12px; width: 260px; height: 160px; z-index: 2;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); cursor: crosshair;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.minimap .maplibregl-ctrl-attrib, .minimap .maplibregl-ctrl-logo { display: none !important; }

.title { font: 600 18px var(--mono); margin-bottom: 8px; word-break: break-word; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
dt { color: var(--muted); } dd { margin: 0; font-family: var(--mono); }
.close { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted);
  font-size: 22px; cursor: pointer; }

.deck-tooltip { font: 12px var(--mono) !important; background: var(--panel) !important;
  border: 1px solid var(--line); border-radius: 4px; }
.maplibregl-ctrl-attrib { background: rgba(12,18,26,.7) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

@media (max-width: 700px) {
  .brand { font-size: 11px; } .clock { display: none; }
  .panel.left { top: auto; bottom: 28px; left: 8px; right: 8px; width: auto; padding: 8px 12px; }
  .panel.left section:not(:first-child):not(.layers) { display: none; }
  .panel.left .layers { margin: 0; padding: 0; border: 0; display: flex; gap: 12px; }
  .panel.left section:first-child { display: flex; gap: 24px; }
  .panel.left h2 { display: none; }
  .panel.right { top: 56px; left: 8px; right: 8px; width: auto; }
  .panel.left { max-height: none; }
  .minimap { left: auto; right: 8px; bottom: auto; top: 56px; width: 140px; height: 90px; }
  #info:not([hidden]) ~ .minimap { display: none; }
}
