*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#0f172a;-webkit-text-size-adjust:100%}
#map{position:fixed;inset:44px 0 22px 0}
#hdr{position:fixed;top:0;left:0;right:0;height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;background:#0b1f3a;color:#fff;z-index:10;gap:8px}
#hdr .sub{opacity:.75;font-weight:400}
#hdr .tag{font-size:12px;opacity:.85;white-space:nowrap}
.mock{background:#f59e0b;color:#111;border-radius:4px;padding:1px 6px;font-weight:600}
#ftr{position:fixed;left:0;right:0;bottom:0;height:22px;font-size:11px;line-height:22px;padding:0 10px;background:#f8fafc;border-top:1px solid #e2e8f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:10;color:#475569}
#ftr a{color:#1d4ed8}
.panel{position:fixed;background:#fff;border-radius:14px;box-shadow:0 8px 30px rgba(15,23,42,.18);z-index:20}
#chat{left:12px;top:56px;width:360px;max-height:calc(100% - 92px);display:flex;flex-direction:column}
.chat-h{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #eef2f7;font-weight:600}
.chat-h .hint{font-size:11px;font-weight:400;color:#64748b;flex:1}
.ic{border:0;background:#f1f5f9;border-radius:8px;width:28px;height:28px;cursor:pointer;font-size:14px}
#chatToggle{display:none}
.msgs{overflow-y:auto;padding:10px 12px;display:flex;flex-direction:column;gap:8px;min-height:60px;flex:1}
.msg{padding:8px 11px;border-radius:12px;font-size:14px;line-height:1.4;max-width:92%}
.msg.bot{background:#f1f5f9;align-self:flex-start}
.msg.me{background:#1d4ed8;color:#fff;align-self:flex-end}
.msg .src{display:block;font-size:11px;color:#64748b;margin-top:6px}
.msg .src a{color:#1d4ed8}
.msg ul{margin:4px 0 0 16px;padding:0}
.typing span{display:inline-block;width:6px;height:6px;margin:0 2px;border-radius:50%;background:#94a3b8;animation:b 1s infinite}
.typing span:nth-child(2){animation-delay:.15s}.typing span:nth-child(3){animation-delay:.3s}
@keyframes b{0%,80%,100%{opacity:.3}40%{opacity:1}}
.chips{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px;border-top:1px solid #eef2f7}
.chip{border:1px solid #c7d2fe;background:#eef2ff;color:#1e3a8a;border-radius:16px;padding:6px 10px;font-size:13px;cursor:pointer;text-align:left}
.chip.ghost{background:#fff;border-color:#e2e8f0;color:#475569}
.chip:active{transform:scale(.98)}
.ask{display:flex;gap:6px;padding:0 12px 12px}
.ask input{flex:1;border:1px solid #cbd5e1;border-radius:10px;padding:8px 10px;font-size:16px;min-width:0}
.ask button{border:0;background:#1d4ed8;color:#fff;border-radius:10px;padding:0 14px;font-size:16px;cursor:pointer}
.card{right:12px;top:56px;width:390px;max-height:calc(100% - 92px);overflow-y:auto;padding:14px 16px 16px}
.card.hidden{display:none}
.card .close{position:absolute;right:10px;top:10px}
.card h2{font-size:17px;margin:0 30px 4px 0}
.card .kick{font-size:12px;color:#64748b;margin-bottom:8px}
.pill{display:inline-block;font-size:11px;padding:2px 8px;border-radius:10px;margin:0 4px 4px 0;background:#f1f5f9;color:#334155}
.pill.west{background:#dbeafe;color:#1e40af}.pill.east{background:#ffedd5;color:#9a3412}.pill.red{background:#fee2e2;color:#991b1b}.pill.orange{background:#fef3c7;color:#92400e}
.card table{width:100%;border-collapse:collapse;font-size:13px;margin:6px 0 10px}
.card td{padding:5px 4px;border-bottom:1px solid #f1f5f9;vertical-align:top}
.card td:first-child{color:#64748b;width:38%}
.xs{border:1px solid #e2e8f0;border-radius:10px;padding:6px;background:#f8fafc}
.xs .cap{font-size:11px;color:#64748b;text-align:center;margin-top:2px}
.card .srcs{font-size:12px;color:#475569}
.card .srcs a{color:#1d4ed8}
.card .srcs li{margin-bottom:3px}
.legend{position:fixed;right:12px;bottom:34px;background:rgba(255,255,255,.95);border-radius:10px;padding:8px 10px;font-size:12px;box-shadow:0 2px 10px rgba(0,0,0,.12);z-index:5;line-height:1.7}
.sw{display:inline-block;width:22px;height:0;border-top:4px solid;vertical-align:middle;margin-right:6px}
.sw.west{border-color:#2563eb}.sw.east{border-color:#ea580c}.sw.hdd{border-top:3px dashed #334155}.sw.land{border-top:7px solid #475569}
.sw.zone{height:10px;border:1px dashed #0e7490;background:rgba(14,116,144,.15)}
.legt{display:none;margin:0 0 4px}
.lbtn{margin-top:4px;width:100%;border:1px solid #cbd5e1;background:#fff;border-radius:8px;padding:4px;cursor:pointer;font-size:12px}
.tip{position:fixed;pointer-events:none;background:#0f172a;color:#fff;font-size:12px;padding:5px 8px;border-radius:6px;z-index:30;display:none;white-space:nowrap}
.lbl{font-size:11px;font-weight:600;background:rgba(255,255,255,.92);border:1px solid #cbd5e1;border-radius:6px;padding:1px 6px;white-space:nowrap;color:#0f172a;pointer-events:none;transform:translateY(-16px)}
.lbl.hide{display:none}
.brk{width:26px;height:26px;border-radius:50%;background:#dc2626;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;box-shadow:0 0 0 4px rgba(220,38,38,.3);animation:pulse 1.2s infinite}
@keyframes pulse{50%{box-shadow:0 0 0 10px rgba(220,38,38,.05)}}
.trunklbl{font-size:12px;font-weight:700;background:#0b1f3a;color:#fff;border-radius:6px;padding:3px 8px;white-space:nowrap;cursor:pointer}
/* mobile */
@media (max-width:760px){
  #hdr .sub{display:none}
  #hdr .tag{font-size:11px}
  .legend{top:52px;bottom:auto;right:8px;font-size:11px;padding:6px 8px;line-height:1.5}
  .legend.min div{display:none}
  .legt{display:block}
  .legend.min{padding:4px}
  .legend.min .legt{margin:0}
  #chat{left:0;right:0;top:auto;bottom:22px;width:auto;border-radius:14px 14px 0 0;max-height:46%}
  #chatToggle{display:block}
  #chat.collapsed .msgs{display:none}
  .msgs{max-height:24vh}
  .trunklbl{white-space:normal;max-width:150px;font-size:11px}
  .chip{font-size:12.5px;padding:6px 9px}
  .card{left:0;right:0;top:auto;bottom:22px;width:auto;border-radius:14px 14px 0 0;max-height:62%;z-index:25}
}

.pill.off{background:#e2e8f0;color:#334155}.pill.ok{background:#dcfce7;color:#166534}
.lnote{font-size:11px;color:#64748b;font-style:italic}
.next{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;align-items:center}
.next>span{font-size:11px;color:#64748b;width:100%}
.nbtn{border:1px solid #1d4ed8;background:#fff;color:#1d4ed8;border-radius:14px;padding:5px 10px;font-size:12.5px;cursor:pointer}
.nbtn:active{background:#eff6ff}
.mockc{border:1px dashed #94a3b8;border-radius:10px;background:#fff;padding:8px;font-size:13px}
.mh{display:flex;justify-content:space-between;gap:6px;font-weight:600;font-size:12px;margin-bottom:6px;flex-wrap:wrap}
.mtag{background:#f59e0b;color:#111;border-radius:4px;padding:0 6px;font-size:10.5px;font-weight:700}
.rcs{background:#f8fafc;border-radius:10px;padding:8px}
.rs{font-size:11px;color:#0b1f3a;font-weight:700;margin-bottom:4px}
.rb{background:#e0e7ff;border-radius:12px 12px 12px 4px;padding:7px 9px;line-height:1.4}
.rq{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}.rq span{border:1px solid #1d4ed8;color:#1d4ed8;border-radius:12px;padding:2px 8px;font-size:11.5px}
.wo{width:100%;border-collapse:collapse;font-size:12.5px}.wo td{padding:3px 4px;border-bottom:1px solid #f1f5f9;vertical-align:top}.wo td:first-child{color:#64748b;width:40%}
.sensor{width:30px;height:30px;border-radius:50%;background:#f59e0b;color:#111;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:16px;box-shadow:0 0 0 4px rgba(245,158,11,.35);animation:pulseA 1.2s infinite}
@keyframes pulseA{50%{box-shadow:0 0 0 12px rgba(245,158,11,.05)}}
.vessel{display:flex;flex-direction:column;align-items:center;gap:2px;pointer-events:none}
.vessel b{font-size:20px;background:#fff;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(0,0,0,.3)}
.vessel span{font-size:10.5px;background:rgba(255,255,255,.95);border:1px solid #94a3b8;border-radius:6px;padding:1px 5px;width:150px;text-align:center;white-space:normal;line-height:1.25}
.lbl.red{color:#991b1b;border-color:#fca5a5;transform:none}
@media (max-width:760px){.legend .lnote{display:none}.legend:not(.min) .lnote{display:block}}

.chip .sh{display:none}
@media (max-width:760px){.chip .lg{display:none}.chip .sh{display:inline}}

.pit{width:26px;height:26px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 3px rgba(0,0,0,.15);background:#dc2626;position:relative}
.pit.red{background:#dc2626;animation:pulseR 1.1s infinite}.pit.orange{background:#f97316}.pit.yellow{background:#facc15}.pit.green{background:#16a34a}
@keyframes pulseR{0%{box-shadow:0 0 0 0 rgba(220,38,38,.6)}70%{box-shadow:0 0 0 16px rgba(220,38,38,0)}100%{box-shadow:0 0 0 0 rgba(220,38,38,0)}}
.pitlbl{font-size:11px;background:rgba(255,255,255,.95);border:1px solid #cbd5e1;border-radius:6px;padding:2px 6px;max-width:190px;line-height:1.3;pointer-events:none}
.crew{display:flex;flex-direction:column;align-items:center;gap:2px;pointer-events:none;transition:transform .8s}
.crew b{font-size:18px;background:#fff;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(0,0,0,.3)}
.crew span{font-size:10.5px;background:rgba(255,255,255,.95);border:1px solid #94a3b8;border-radius:6px;padding:1px 5px;width:140px;text-align:center;line-height:1.25}
a.nbtn{text-decoration:none;display:inline-block}
.stchip{display:inline-block;font-size:11px;font-weight:700;border-radius:10px;padding:1px 8px;background:#e2e8f0;color:#334155}
.stchip.sentc,.stchip.red{background:#fee2e2;color:#991b1b}.stchip.orange{background:#ffedd5;color:#9a3412}.stchip.yellow{background:#fef9c3;color:#854d0e}.stchip.green{background:#dcfce7;color:#166534}
.tl{margin-top:8px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:8px}
.tlh{font-size:12px;font-weight:700;margin-bottom:4px}
.tls{display:flex;align-items:center;gap:8px;font-size:12.5px;color:#94a3b8;padding:2px 0}
.tls i{width:10px;height:10px;border-radius:50%;border:2px solid #cbd5e1;flex:none}
.tls.on{color:#0f172a}.tls.on i{background:#16a34a;border-color:#16a34a}
.tls em{margin-left:auto;font-style:normal;font-size:11px;color:#64748b}
#phoneWrap{position:fixed;right:16px;top:54px;bottom:30px;width:340px;z-index:22;display:flex;flex-direction:column;align-items:center}
#phoneWrap.hidden{display:none}
.phone{flex:1;width:100%;max-height:690px;background:#111;border-radius:36px;padding:14px 10px;box-shadow:0 10px 40px rgba(0,0,0,.35);position:relative;display:flex}
.phone .notch{position:absolute;top:5px;left:50%;transform:translateX(-50%);width:90px;height:6px;border-radius:3px;background:#333}
.phone iframe{flex:1;border:0;border-radius:24px;background:#fff;width:100%}
.phcap{font-size:11px;color:#334155;background:rgba(255,255,255,.95);border-radius:8px;padding:3px 8px;margin-top:6px;display:flex;align-items:center;gap:6px}
.phcap .ic{width:22px;height:22px;font-size:11px}
body.phone-on .legend{display:none}
body.phone-on .card{right:370px}
@media (max-width:760px){.deskonly{display:none}#phoneWrap{display:none!important}}
