*{box-sizing:border-box}
:root{
  --bg:#0b1020;--panel:#11182d;--text:#eaeefb;--muted:#93a1c8;
  --primary:#4f7cff;--primary-2:#2d5ef7;--danger:#ff5577;--ok:#26c281;
  --card:#0f1630;--border:#1b2543;--accent:#9aa9ff;
}
html,body{height:100%;margin:0;font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:.6rem 1rem;border-bottom:1px solid var(--border);background:linear-gradient(180deg,#0e1530,#0a1024)}
.brand{display:flex;align-items:center;gap:.6rem}
.brand .dot{width:10px;height:10px;border-radius:50%;background:var(--primary);display:inline-block;box-shadow:0 0 8px var(--primary)}
.brand small{color:var(--muted)}
.actions{display:flex;gap:.5rem;flex-wrap:wrap}
.btn{appearance:none;border:1px solid var(--border);background:#0f1732;color:var(--text);padding:.45rem .7rem;border-radius:.7rem;cursor:pointer}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--primary);border-color:transparent}
.btn.primary:hover{background:var(--primary-2)}
.btn.danger{background:transparent;color:#ff88a1;border:1px solid #ff88a144}
main{display:grid;grid-template-columns:360px 1fr;height:calc(100% - 56px)}
aside.panel{padding:1rem;border-right:1px solid var(--border);background:var(--panel);overflow:auto}
details{background:var(--card);border:1px solid var(--border);border-radius:12px;margin-bottom:.8rem}
details>summary{cursor:pointer;list-style:none;padding:.6rem .8rem;border-bottom:1px solid var(--border);font-weight:600}
details[open]>summary{border-bottom:1px solid var(--border)}
details>div,.status,.pairs{padding:.7rem .8rem}
.field{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}
.field.inline{flex-direction:row;justify-content:space-between;align-items:center}
.field>input,.grid2>input,.chat-form>input,select{appearance:none;background:#0e1530;border:1px solid var(--border);color:var(--text);padding:.5rem .6rem;border-radius:.6rem}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.hint{font-size:.85rem;color:var(--muted);margin:.2rem 0 .5rem}
.status{display:grid;grid-template-columns:1fr 1fr;gap:.3rem 1rem;color:#d7defa}
.mapwrap{position:relative}
#map{height:calc(100vh - 56px);width:100%;transition:transform .15s ease}
.banner{position:absolute;top:12px;left:50%;transform:translateX(-50%);background:#ff335544;border:1px solid #ff3355aa;color:white;padding:.5rem .9rem;border-radius:.8rem;backdrop-filter:blur(6px);box-shadow:0 6px 24px #0006;font-weight:700}
.banner.hidden{display:none}
.pairs{display:flex;flex-direction:column;gap:.5rem}
.pair{display:flex;justify-content:space-between;align-items:center;background:#0d1430;border:1px solid var(--border);padding:.5rem .6rem;border-radius:.6rem}
.pair small{color:var(--muted)}
.badge{border-radius:999px;padding:.15rem .5rem;border:1px solid var(--border);font-size:.8rem}
.badge.ok{background:#1b2d4a;border-color:#214e6a}
.badge.warn{background:#4a1b28;border-color:#6a2141;color:#ff9ab0}
footer{padding:.5rem 1rem;border-top:1px solid var(--border);color:var(--muted);background:#0a1024}
.leaflet-control-zoom a{background:#141f3e;border:1px solid var(--border);color:var(--text)}
.leaflet-popup-content-wrapper{background:#0d1430;color:var(--text);border:1px solid var(--border)}
.leaflet-popup-tip{background:#0d1430}
.marker-self{filter:drop-shadow(0 2px 10px #0008)}
.chat{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem}
.chat-list{min-height:120px;max-height:220px;overflow:auto;border:1px solid var(--border);border-radius:.6rem;background:#0e1530;padding:.5rem}
.msg{display:flex;gap:.5rem;margin:.25rem 0}
.msg.me{justify-content:flex-end}
.msg-bubble{max-width:80%;padding:.4rem .6rem;border-radius:.7rem;border:1px solid var(--border);background:#0f1732}
.msg.me .msg-bubble{background:#21376b;border-color:#3659a6}
.chat-form{display:flex;gap:.4rem}
.measure-label{position:absolute;transform:translate(-50%,-.7rem);background:#0e1530;border:1px solid var(--border);padding:.1rem .35rem;border-radius:.4rem;color:#dfe7ff;font-size:.8rem;pointer-events:none}
.gf-badge{display:inline-block;margin-left:.5rem;font-size:.8rem;color:#aac6ff}
