:root {
  --bg: #0a0e14; --panel: #121a25; --panel-2: #172230;
  --line: #1f2d3d; --line-2: #2b3d52; --txt: #e2ebf5; --dim: #7d92a8; --dim-2: #56697e;
  --brand: #3d9bff; --pos: #35d6a4; --neu: #6d829a; --neg: #ff5d5d; --warn: #ffa13d;
  --mono: 'JetBrains Mono', ui-monospace, monospace; --sans: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--txt); font-family: var(--sans); font-size: 14px; overflow: hidden; }

.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.2rem; background: linear-gradient(180deg, #0a0e14ee, #0a0e1400); }
.brand { display: flex; align-items: center; gap: .7rem; }
.ico { font-size: 1.5rem; }
h1 { font-size: 1rem; margin: 0; font-weight: 800; }
.topbar p { margin: 0; font-size: .7rem; color: var(--dim); }
.tools { display: flex; align-items: center; gap: .5rem; }
.btn { font-family: var(--sans); font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  background: var(--brand); color: #041423; border: none; padding: .5rem .9rem; border-radius: 8px; }
.btn.ghost { background: var(--panel); color: var(--dim); border: 1px solid var(--line-2); }
.btn.on { background: var(--warn); }
.back { color: var(--dim); text-decoration: none; font-size: .82rem; margin-left: .3rem; }
.back:hover { color: var(--brand); }

#map { position: absolute; inset: 0; }
.maplibregl-popup.ra-popup .maplibregl-popup-content { background: #0e1620; color: var(--txt); border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--sans); font-size: .82rem; }
.maplibregl-popup.ra-popup .maplibregl-popup-tip { border-top-color: #0e1620; }

.drawhint { position: absolute; top: 3.6rem; left: 50%; transform: translateX(-50%); z-index: 10;
  background: #0e1620ee; border: 1px solid var(--warn); color: var(--txt); font-size: .8rem;
  padding: .5rem .9rem; border-radius: 20px; }

.panel { position: absolute; top: 3.4rem; right: 1rem; bottom: 1rem; width: 340px; z-index: 9;
  background: #0b121bf2; border: 1px solid var(--line-2); border-radius: 14px; padding: 1.1rem;
  overflow-y: auto; backdrop-filter: blur(4px); }
.panel h2 { font-size: 1.05rem; margin: 0 0 .5rem; font-weight: 800; }
.panel h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 1.1rem 0 .5rem; }
.panel p { font-size: .84rem; color: var(--dim); line-height: 1.55; margin: .4rem 0; }
.panel .muted { color: var(--dim-2); font-size: .76rem; }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.p-sub { font-size: .72rem; color: var(--dim); }
.sent { margin: .7rem 0; }
.sent-bar { display: flex; height: 20px; border-radius: 6px; overflow: hidden; }
.sent-bar > div { display: flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 700; color: #04121e; }
.sent-leg { display: flex; justify-content: space-between; font-size: .66rem; color: var(--dim); margin-top: .2rem; }
.bar { display: grid; grid-template-columns: 95px 1fr auto; align-items: center; gap: .5rem; margin-bottom: .45rem; font-size: .8rem; }
.track { height: 9px; background: #ffffff12; border-radius: 5px; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 5px; }
.bar b { font-family: var(--mono); font-size: .72rem; color: var(--dim); }
.ras-in { display: flex; flex-wrap: wrap; gap: .4rem; }
.ra-chip { font-family: var(--sans); font-size: .76rem; cursor: pointer; color: var(--txt);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 20px; padding: .3rem .7rem; }
.ra-chip:hover { border-color: var(--brand); }
.ra-chip em { font-style: normal; color: var(--brand); font-family: var(--mono); margin-left: .3rem; }

.ig-area { margin-top: .4rem; }
.ig-sent { margin: .3rem 0 .7rem; }
.igp { display: block; text-decoration: none; color: var(--txt); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 9px; padding: .6rem .7rem; margin-bottom: .5rem; }
.igp:hover { border-color: #c98bff66; }
.igp-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.igp-u { font-weight: 700; font-size: .78rem; color: #c98bff; }
.stag { font-size: .56rem; font-weight: 800; color: #04121e; padding: .1rem .4rem; border-radius: 4px; text-transform: uppercase; }
.igp-cap { font-size: .76rem; color: var(--txt); margin: .3rem 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.igp-foot { display: flex; gap: .7rem; font-size: .68rem; color: var(--dim); flex-wrap: wrap; }
.igp-loc { margin-left: auto; color: var(--dim-2); }
.xnote { margin-top: 1rem; font-size: .7rem; color: var(--dim-2); border-top: 1px solid var(--line); padding-top: .7rem; }

.legend { position: absolute; bottom: 1rem; left: 1rem; z-index: 9; display: flex; align-items: center; gap: .5rem;
  background: #0b121bdd; border: 1px solid var(--line-2); border-radius: 20px; padding: .4rem .8rem; font-size: .7rem; color: var(--dim); }
.legend .grad { width: 110px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2f6fb2, #ffa13d, #ff5d5d); }

@media (max-width: 720px) { .panel { width: calc(100% - 2rem); top: auto; bottom: .5rem; height: 42vh; } .legend { display: none; } }
