:root {
  --bg: #e6edf6;
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-50: #eff6ff;
  --green: #16a34a;
  --green-50: #ecfdf3;
  --amber: #d97706;
  --amber-50: #fff7ed;
  --red: #dc2626;
  --red-50: #fef2f2;
  --gray-50: #f1f5f9;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.09), 0 1px 2px rgba(15, 23, 42, 0.06);
  --r: 14px;
  --gap: 12px;
  --detail-w: 330px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 13px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
small { font-size: 11px; }
.muted { color: var(--muted); }
svg { display: block; }

#viewport { position: fixed; inset: 0; }
#viewport canvas { display: block; outline: none; }
.labels { position: absolute; inset: 0; pointer-events: none; }
body.no-labels .labels { display: none; }

.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: var(--gap); left: var(--gap); right: var(--gap); height: 54px;
  display: flex; align-items: center; gap: 16px; padding: 0 10px 0 14px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -0.2px; white-space: nowrap; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 4px 10px rgba(37, 99, 235, .35); }

.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #f8fafc;
  padding: 0 40px 0 36px; font: inherit; color: var(--text); outline: none; transition: .15s;
}
.search input:focus { background: #fff; border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.search-ico { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 8px; font: 600 11px Inter; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: #fff; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.site-wrap, .bell-wrap { position: relative; }
.site-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.site-chip:hover { background: var(--gray-50); }
.site-code { background: var(--blue); color: #fff; font-weight: 700; font-size: 11px; padding: 5px 7px; border-radius: 7px; }
.site-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.site-text b { font-size: 12px; } .site-text small { color: var(--muted); }

.live { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; background: var(--green-50); color: var(--green); font-weight: 600; font-size: 12px; }
.live b { color: var(--text); font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #334155; }
.icon-btn:hover { background: var(--gray-50); }
.badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.user { display: flex; align-items: center; gap: 9px; padding-left: 10px; border-left: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 12px; background: linear-gradient(135deg, #f59e0b, #ea580c); }
.user-text { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.user-text small { color: var(--muted); }

.dropdown {
  position: absolute; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50; max-height: 60vh; overflow: auto;
}
.dropdown.open { display: block; }
.search-results { left: 0; right: 0; }
.site-menu { right: 0; width: 280px; }
.notif-menu { right: 0; width: 340px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.dd-item:hover, .dd-item.hl { background: var(--gray-50); }
.dd-item .ico { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.dd-item .txt { display: flex; flex-direction: column; min-width: 0; }
.dd-item .txt b { font-weight: 600; font-size: 12.5px; }
.dd-item .txt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-item .right { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.dd-head { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: flex; justify-content: space-between; }
.dd-head button { color: var(--blue); text-transform: none; letter-spacing: 0; font-weight: 600; }
.dd-empty { padding: 14px; color: var(--muted); text-align: center; }

/* ---------- KPIs ---------- */
.kpis { position: fixed; top: calc(var(--gap) + 66px); left: var(--gap); display: flex; gap: 10px; z-index: 10; }
.kpi { display: flex; gap: 11px; align-items: flex-start; padding: 11px 14px 11px 11px; min-width: 184px; }
.kpi small { color: var(--muted); }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi-ico.blue { background: var(--blue-50); color: var(--blue); }
.kpi-val { display: flex; align-items: baseline; gap: 7px; margin: 1px 0; }
.kpi-val b { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; }
.delta { font-size: 11px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

/* ---------- Map tools ---------- */
.map-tools {
  position: fixed; top: calc(var(--gap) + 66px); right: var(--gap); display: flex; flex-direction: column; padding: 4px; z-index: 10;
  transition: right .25s ease;
}
body.has-detail .map-tools { right: calc(var(--gap) * 2 + var(--detail-w)); }
.map-tools button { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #334155; }
.map-tools button:hover { background: var(--gray-50); }
.map-tools button.on { color: var(--blue); }
.map-tools button.active { background: var(--blue-50); color: var(--blue); }

/* ---------- Detail panel ---------- */
.detail {
  position: fixed; top: calc(var(--gap) + 66px); right: var(--gap); width: var(--detail-w); padding: 14px; z-index: 10;
  max-height: calc(100vh - 66px - var(--gap) * 2 - 230px); overflow: auto;
  transform: translateX(calc(100% + 30px)); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
body.has-detail .detail { transform: none; opacity: 1; }
.dh { display: flex; gap: 11px; align-items: flex-start; }
.dh-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: #fef3c7; color: #b45309; }
.dh-ico.blue { background: var(--blue-50); color: var(--blue); }
.dh-ico.green { background: var(--green-50); color: var(--green); }
.dh-ico.gray { background: var(--gray-50); color: #475569; }
.dh-txt { flex: 1; min-width: 0; }
.dh-txt small { color: var(--muted); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; font-size: 10.5px; }
.dh-txt h3 { margin: 1px 0 1px; font-size: 16px; letter-spacing: -0.2px; }
.dh-txt .sub { color: var(--muted); font-size: 11.5px; }
.dh-actions { display: flex; gap: 2px; }
.dh-actions button { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.dh-actions button:hover { background: var(--gray-50); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--gray-50); color: #475569; white-space: nowrap; }
.chip.blue { background: var(--blue-50); color: var(--blue); }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.amber { background: var(--amber-50); color: var(--amber); }
.chip.red { background: var(--red-50); color: var(--red); }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--line); }
dl.kv dt, dl.kv dd { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { text-align: right; font-weight: 600; }
.meter { margin: 4px 0 12px; }
.meter-top { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 6px; }
.meter-top b { font-weight: 600; }
.bar { height: 7px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--blue); transition: width .4s ease; }
.bar.green > span { background: var(--green); } .bar.amber > span { background: #f59e0b; } .bar.red > span { background: var(--red); }

/* ---------- Tracking ---------- */
.tracking { position: fixed; left: var(--gap); bottom: var(--gap); width: min(600px, calc(100vw - 420px)); padding: 13px 16px 14px; z-index: 10; }
.trk-head { display: flex; align-items: center; gap: 10px; }
.trk-head .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.trk-head b { font-size: 13.5px; }
.trk-head span.meta { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 13px; }
.step { display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.step::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: #e2e8f0; }
.step:first-child::before { display: none; }
.step.done::before, .step.active::before { background: var(--blue); }
.step .dot { position: relative; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid #cbd5e1; display: grid; place-items: center; color: #94a3b8; }
.step.done .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.step.active .dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 5px rgba(37, 99, 235, .14); }
.step .lbl { font-weight: 600; font-size: 12px; margin-top: 7px; }
.step .time { color: var(--muted); font-size: 11px; margin-top: 1px; }
.trk-empty { color: var(--muted); padding: 18px 0 6px; text-align: center; }

/* ---------- Fleet ---------- */
.fleet { position: fixed; right: var(--gap); bottom: var(--gap); width: 380px; padding: 8px; z-index: 10; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 12px; color: var(--muted); }
.tabs button span { font-weight: 600; color: #94a3b8; margin-left: 2px; }
.tabs button.active { background: var(--blue-50); color: var(--blue); }
.tabs button.active span { color: var(--blue); opacity: .7; }
.fleet-site { margin-left: auto; color: var(--muted); padding-right: 6px; white-space: nowrap; }
.rows { max-height: 178px; overflow: auto; padding-top: 4px; }
.row { display: grid; grid-template-columns: 26px 1fr auto 14px; gap: 9px; align-items: center; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.row:hover, .row.sel { background: var(--gray-50); }
.row .ri { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.row .rt { min-width: 0; line-height: 1.25; }
.row .rt b { font-weight: 600; font-size: 12px; }
.row .rt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: #cbd5e1; }
.mini-bat { display: inline-block; width: 26px; height: 8px; border-radius: 2px; background: #e2e8f0; vertical-align: middle; margin-left: 5px; overflow: hidden; }
.mini-bat span { display: block; height: 100%; background: var(--green); }

/* ---------- 3D labels ---------- */
.tag3d {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 9px; background: rgba(255, 255, 255, .95);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .14); font: 600 11.5px Inter, sans-serif; color: var(--text); white-space: nowrap;
}
.tag3d .code { background: var(--blue); color: #fff; padding: 2px 6px; border-radius: 6px; font-size: 10.5px; }
.tag3d.sel { transform: translateY(-6px); }
.tag3d.sel .code { background: #0f172a; }
.tag3d .st { color: var(--muted); font-weight: 500; }

/* ---------- Tooltip / toasts / loading ---------- */
.tooltip { position: fixed; pointer-events: none; z-index: 60; padding: 6px 9px; border-radius: 8px; background: rgba(15, 23, 42, .9); color: #fff; font-size: 11.5px; font-weight: 500; white-space: nowrap; opacity: 0; transform: translate(12px, 12px); transition: opacity .12s; }
.tooltip.show { opacity: 1; }
.toasts { position: fixed; top: calc(var(--gap) + 68px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 30; pointer-events: none; align-items: center; }
.toast { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); font-weight: 500; font-size: 12px; animation: toastIn .25s ease; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .3s; }
.toast .ti { color: var(--blue); } .toast.ok .ti { color: var(--green); } .toast.warn .ti { color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
.loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--bg); color: var(--muted); font-weight: 500; z-index: 100; transition: opacity .4s; }
.loading.hide { opacity: 0; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #cbd5e1; border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .user-text, .site-text small { display: none; }
  .kpi { min-width: 0; }
}
@media (max-width: 980px) {
  .kpis { flex-direction: column; }
  .tracking { width: calc(100vw - var(--gap) * 2); bottom: 250px; }
  .fleet { left: var(--gap); width: auto; }
  .brand { font-size: 0; gap: 0; }
  .live { display: none; }
}

/* ---------- Internal flow ---------- */
.flow { display: flex; align-items: stretch; gap: 2px; margin-top: 12px; }
.fstage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; border-radius: 10px; min-width: 0; }
.fstage:hover { background: var(--gray-50); }
.fstage .fdot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.fstage b { font-size: 16px; font-weight: 700; line-height: 1; margin-top: 2px; }
.fstage small { color: var(--muted); font-weight: 500; white-space: nowrap; }
.fstage.active { background: var(--blue-50); box-shadow: inset 0 0 0 1.5px #93c5fd; }
.fstage.active .fdot { background: var(--blue); color: #fff; }
.farrow { display: grid; place-items: center; color: #cbd5e1; }
.tag3d.zone .code { background: #0f172a; min-width: 18px; text-align: center; }
.dbtn { margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 600; }
.dbtn:hover { background: #1d4ed8; }
.dbtn.ghost { background: var(--gray-50); color: var(--text); }
.dbtn.ghost:hover { background: #e2e8f0; }

/* ---------- Editor modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(15, 23, 42, .28); padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; background: #fff; animation: toastIn .2s ease; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.modal-head .dh-txt h3 { margin: 0; }
.form-grid { display: grid; gap: 14px; }
.fgroup h4 { margin: 6px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.frow { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 600; color: #334155; }
.field .inp { position: relative; }
.field input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid #cbd5e1; padding: 0 30px 0 10px; font: inherit; font-weight: 600; outline: none; }
.field input:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.field .unit { position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--muted); }
.field small { color: var(--muted); font-size: 10.5px; }
.editor-summary { margin-top: 14px; padding: 12px; border-radius: 11px; background: var(--gray-50); font-size: 12px; line-height: 1.6; }
.editor-summary b { font-weight: 700; }
.editor-summary .warn { color: var(--amber); display: flex; gap: 6px; align-items: center; }
.modal-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.modal-foot .spacer { flex: 1; }
.btn { padding: 9px 14px; border-radius: 10px; font-weight: 600; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: var(--gray-50); }
.btn.ghost:hover { background: #e2e8f0; }

/* ---------- small package ---------- */
.timeline { margin-top: 10px; border-left: 2px solid #dbeafe; padding-left: 10px; display: grid; gap: 6px; }
.tl { font-size: 11.5px; line-height: 1.35; position: relative; }
.tl::before { content: ''; position: absolute; left: -15px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.tl span { color: var(--muted); font-weight: 600; margin-right: 6px; }
.units { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.units span { margin-right: 6px; }
.units button { padding: 5px 10px; border-radius: 8px; background: var(--gray-50); font-weight: 600; font-size: 11.5px; }
.units button.on { background: var(--blue); color: #fff; }
.field.wide { grid-column: 1 / -1; }
.field select { width: 100%; height: 36px; border-radius: 9px; border: 1px solid #cbd5e1; padding: 0 10px; font: inherit; font-weight: 600; background: #fff; }
.field input[type=text] { padding-right: 10px; font-weight: 500; }
.tag3d.door { padding: 2px 7px 2px 2px; font-size: 10.5px; }
.tag3d.door .code { background: #0f172a; }
.tag3d.row { padding: 2px; }
.tag3d.row .code { background: #475569; }
.fleet .tabs button { padding: 6px 8px; }

/* ---------- drag & drop layout editor ---------- */
.layout-bar, .layout-panel, .layout-msg { display: none; }
body.layout-edit .tracking, body.layout-edit .fleet, body.layout-edit .detail, body.layout-edit .kpis { display: none; }
body.layout-edit .map-tools { right: calc(var(--gap) * 2 + var(--detail-w)); }
body.layout-edit .layout-bar {
  display: flex; align-items: center; gap: 12px; position: fixed; top: calc(var(--gap) + 66px); left: var(--gap);
  padding: 10px 12px; z-index: 15; max-width: calc(100vw - var(--detail-w) - 90px);
}
.layout-bar .lb-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); color: #fff; flex: none; }
.layout-bar div { display: flex; flex-direction: column; line-height: 1.3; }
.layout-bar small { color: var(--muted); }
body.layout-edit .layout-panel {
  display: block; position: fixed; top: calc(var(--gap) + 66px); right: var(--gap); bottom: var(--gap); width: var(--detail-w);
  padding: 14px; overflow: auto; z-index: 15;
}
.le-head { display: flex; flex-direction: column; margin-bottom: 10px; }
.le-head b { font-size: 15px; }
.le-head small { color: var(--muted); }
.layout-panel h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.le-empty { padding: 12px; border-radius: 11px; background: var(--gray-50); color: #334155; line-height: 1.5; display: grid; gap: 6px; }
.le-empty small { color: var(--muted); }
.le-sel { padding: 12px; border-radius: 11px; background: var(--blue-50); }
.le-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.le-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; color: #334155; }
.le-grid label span { color: var(--muted); font-weight: 500; }
.le-grid label.wide { grid-column: 1 / -1; }
.le-grid input { width: 100%; min-width: 0; height: 32px; border-radius: 8px; border: 1px solid #cbd5e1; padding: 0 8px; font: inherit; font-weight: 600; background: #fff; }
.le-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.le-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 8px; background: #fff; font-weight: 600; font-size: 12px; border: 1px solid var(--line); }
.le-actions button:hover { background: var(--gray-50); }
.le-actions button.danger { color: var(--red); }
.le-add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.le-add button { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 9px; background: var(--gray-50); font-weight: 600; font-size: 11.5px; text-align: left; color: #334155; }
.le-add button:hover { background: var(--blue-50); color: var(--blue); }
.le-list { display: grid; gap: 6px; }
.le-list > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.le-list small { width: 100%; color: var(--muted); font-weight: 600; }
.le-list button { padding: 3px 7px; border-radius: 6px; background: var(--gray-50); font-size: 11px; font-weight: 600; }
.le-list button.on { background: var(--blue); color: #fff; }
.le-report { font-size: 11.5px; line-height: 1.6; padding: 10px; border-radius: 10px; background: var(--gray-50); }
.le-report .warn { color: var(--amber); display: flex; gap: 6px; align-items: center; }
.le-io { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.le-io button { padding: 7px 10px; border-radius: 9px; background: var(--gray-50); font-weight: 600; font-size: 11.5px; }
.le-io button:hover { background: #e2e8f0; }
body.layout-edit .layout-msg {
  display: block; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .2s;
  background: #0f172a; color: #fff; padding: 9px 14px; border-radius: 10px; font-weight: 500; z-index: 40; pointer-events: none;
}
body.layout-edit .layout-msg.show { opacity: 1; transform: translate(-50%, 0); }

.le-grid select { width: 100%; min-width: 0; height: 32px; border-radius: 8px; border: 1px solid #cbd5e1; padding: 0 6px; font: inherit; font-weight: 600; background: #fff; }
.tag3d.grid { padding: 3px; background: #fee2e2; }
.tag3d.grid .code { background: #ef4444; font-size: 13px; padding: 3px 8px; }
.fleet .tabs { overflow-x: auto; }

/* ---------- simulation speed ---------- */
.speed { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--gray-50); border: 1px solid var(--line); }
.speed button { padding: 4px 7px; border-radius: 7px; font-weight: 700; font-size: 11.5px; color: var(--muted); display: grid; place-items: center; min-width: 26px; }
.speed button:hover { color: var(--text); }
.speed button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.live.paused { background: var(--amber-50); color: var(--amber); }
.live.paused .pulse { background: var(--amber); animation: none; }
.live.fast { background: var(--blue-50); color: var(--blue); }
.live.fast .pulse { background: var(--blue); }
@media (max-width: 1100px) { .speed button[data-speed="2"] { display: none; } }
