.center-stage {
  padding: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(45, 133, 255, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(10, 21, 38, 0.98), rgba(6, 14, 25, 0.99));
}

/* ============== ???? Tab ============== */
.map-view-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
}
.map-view-tab {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(101, 152, 223, 0.22);
  background: rgba(9, 20, 35, 0.62);
  color: #b9cde9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.map-view-tab:hover {
  border-color: rgba(73, 166, 255, 0.55);
  color: #ecf5ff;
}
.map-view-tab.active {
  background: linear-gradient(135deg, rgba(73, 166, 255, 0.32), rgba(40, 215, 255, 0.22));
  border-color: rgba(73, 166, 255, 0.7);
  color: #ecf5ff;
  box-shadow: 0 6px 18px rgba(73, 166, 255, 0.18);
}

.map-view { display: none; }
.map-view.active { display: block; }

/* ============== 3D ???? ============== */
.scene-3d {
  background: linear-gradient(180deg, rgba(7, 16, 28, 0.96), rgba(4, 10, 20, 0.98));
  border-radius: 12px;
  padding: 14px;
  min-height: 600px;
  position: relative;
}
.scene3d-title {
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #ecf5ff;
  letter-spacing: 0.5px;
  z-index: 5;
}
/* ???????????? + ????????? */
.scene3d-legend {
  position: sticky;
  top: 32px;        /* ??? .scene3d-title ?? */
  z-index: 6;
  margin: 0 16px 8px;
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 11px;
  color: #d6e4ff;
  background: rgba(8, 18, 34, 0.78);
  border: 1px solid rgba(101, 152, 223, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(6px);
}
.scene3d-legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 14px;
}
.scene3d-legend .lg-swatch {
  display: inline-block;
  width: 16px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.scene3d-legend .lg-rescue-line {
  background: linear-gradient(90deg, #ff5b5b, #ff2424);
  height: 4px;
  border-radius: 999px;
  border-color: rgba(255, 80, 80, 0.6);
}
.scene3d-legend .lg-evac-line {
  background: linear-gradient(90deg, #2bd66e, #19a953);
  height: 4px;
  border-radius: 999px;
  border-color: rgba(43, 214, 110, 0.5);
}
.scene3d-legend .lg-rescuer {
  width: 10px; height: 10px; border-radius: 50%;
  background: #4ad6ff;
  border-color: rgba(74, 214, 255, 0.5);
}
.scene3d-legend .lg-victim {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ffce3a;
  border-color: rgba(255, 206, 58, 0.6);
}
.scene3d-legend .lg-fire {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff6a3a;
  border-color: rgba(255, 106, 58, 0.6);
}
.scene3d-legend .lg-stair {
  background: #b3e1ff;
  border-color: #4a8fcf;
}
.scene3d-legend .lg-exit {
  background: #b6f3c4;
  border-color: #2da558;
}
.scene3d-legend .lg-danger {
  background: rgba(255, 110, 110, 0.35);
  border-color: rgba(255, 110, 110, 0.7);
}

/* ?????????????????????????
   ???????? .dashboard ?????????????????????
   ??????????????????????? */
.result-compact-head,
.result-compact-row {
  grid-template-columns: 50px minmax(72px, 1fr) 40px !important;
  gap: 6px !important;
}
.result-coord {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* ??"??????"??????????????????????? */
.dashboard .left-stack {
  min-width: 280px;
}

/* === ???? = ?? SVG??????????????? = ?? SVG ???? ===
   ???? SVG ????????? CSS 3D ??? */
.scene3d-stage {
  width: 100%;
  height: 280px;                 /* ?????????3 ???? */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(73, 166, 255, 0.10), transparent 55%);
  border-radius: 8px;
}
.scene3d-world {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scene3d-world > svg.floor-plan-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* === ?????? scene3d-stage / scene3d-world ???? 3 ???????
   ???? 280px ????????????????????????? === */
.scene3d-stage:has(.route-scene-card) {
  height: auto;
  display: block;
  overflow: visible;
  background: none;
  border-radius: 0;
  padding: 0;
}
.scene3d-world:has(.route-scene-card) {
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
  justify-content: flex-start;
}

/* ????????????????? tab ?????????? .map-view ?? */
.map-view.active.scene-3d {
  display: flex;
  flex-direction: column;
  gap: 18px;          /* ? 3 ??????? */
  padding-top: 8px;
  max-height: 1300px; /* 280�3 + gap�2 + ???? ? 1000px????? */
  overflow-y: auto;
  overflow-x: hidden;
}
.map-view.active.scene-3d .route-scene-card {
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(101, 152, 223, 0.4);
  border-left: 3px solid rgba(73, 166, 255, 0.8); /* ??????????????? */
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}
/* ?????? 3D ?????????????? */
.route-scene-card .scene3d-stage {
  overflow: hidden;
}
/* ???????????????????????? */
.scene3d-stage.building-stage {
  overflow: visible;
}
.route-scene-card {
  background: linear-gradient(180deg, rgba(11, 25, 44, 0.72), rgba(6, 14, 28, 0.85));
  border: 1px solid rgba(101, 152, 223, 0.18);
  border-radius: 10px;
  padding: 6px 10px 4px;
}
.route-scene-title {
  font-size: 12px;
  font-weight: 700;
  color: #ecf5ff;
  padding: 6px 8px 8px;
  letter-spacing: 0.4px;
  border-bottom: 1px dashed rgba(101, 152, 223, 0.22);
  margin-bottom: 4px;
}
.floor-plane {
  position: absolute;
  left: 0;
  top: 0;
  width: 720px;
  height: 360px;
  transform-style: preserve-3d;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 222, 185, 0.78), rgba(232, 196, 158, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 0 2px rgba(20, 30, 50, 0.4),
    0 18px 30px -10px rgba(0, 0, 0, 0.55);
}
.floor-plane[data-floor="1"] { transform: translateZ(0); }
.floor-plane[data-floor="2"] { transform: translateZ(220px); }
.floor-plane[data-floor="3"] { transform: translateZ(440px); }
.floor-plane[data-floor="single"] { transform: translateZ(0); }

/* ===== ?? 3D ??????? A?? SVG ???? ===== */
.scene3d-stage.building-stage {
  height: 820px;
  cursor: default;
  overflow: hidden;
}
.scene3d-stage.building-stage .scene3d-world {
  width: 100%;
  height: 100%;
}
.scene3d-world.building {
  /* ?? A??? CSS 3D ???? SVG ???????? */
  position: relative;
  width: 100%;
  height: 100%;
  transform: none;
}
.scene3d-world.building > svg.building-iso-svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* ????????????????????? */
.scene3d-world.building .floor-plane {
  background: linear-gradient(180deg, rgba(255,222,185,0.55), rgba(232,196,158,0.5));
  box-shadow: 0 0 0 2px rgba(20,30,50,0.35), 0 6px 14px -6px rgba(0,0,0,0.5);
}
.scene3d-world.building .floor-plane svg .f3d-room { fill-opacity: 0.78; }
.scene3d-world.building .floor-plane svg .f3d-corridor { fill-opacity: 0.45; }
.scene3d-world.building .floor-wall { opacity: 0.45; }

/* ????? 1F ??? 3F ????????rotateX ??? Z ???? */
.building-shaft {
  position: absolute;
  transform-origin: 0 0;
  background: linear-gradient(180deg, rgba(73,166,255,0.18), rgba(73,166,255,0.05));
  border: 1px dashed rgba(155, 220, 255, 0.55);
  pointer-events: none;
}
.scene3d-world.building .building-shaft {
  /* ???=Z???? rotateX(90) ??? */
  height: 432px;  /* = FLOOR_GAP*(TOTAL_FLOORS-1)+SLAB_THICK + ??, ? JS ? totalH ???? */
  transform-origin: 0 0;
}

/* ?? 3D ???????????????????????? */
.building-route-line {
  position: absolute;
  transform-origin: 0 0;
  border-radius: 2px;
  pointer-events: none;
}
.building-route-line.rescue {
  background: linear-gradient(180deg, #ff7a7a, #ff2424);
  box-shadow: 0 0 8px rgba(255, 60, 60, 0.85);
}
.building-route-line.evac {
  background: linear-gradient(180deg, #52e58c, #19a953);
  box-shadow: 0 0 8px rgba(40, 220, 110, 0.75);
}
/* ??????????????????? */
.building-route-cap {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-5px, -5px);
  pointer-events: none;
}
.building-route-cap.rescue {
  background: #ff5b5b;
  box-shadow: 0 0 8px rgba(255, 90, 90, 0.9), 0 0 0 2px rgba(255, 230, 230, 0.6);
}
.building-route-cap.evac {
  background: #2bd66e;
  box-shadow: 0 0 8px rgba(40, 220, 110, 0.85), 0 0 0 2px rgba(220, 255, 232, 0.6);
}

/* ?????????????????????????????? */
.floor-plane svg .f3d-room { fill-opacity: 1; }
.floor-plane svg .f3d-corridor { fill-opacity: 0.55; }

/* ?????????? ?? ????????????"??"?
   ?????? .floor-wall ?? drop-shadow?box-shadow ????? 3D rotateX/Y ??????
   ??????????????????"????"? */
.floor-wall {
  position: absolute;
  transform-origin: 0 0;
  box-sizing: border-box;
  border: 1px solid rgba(40, 25, 12, 0.7);
  background: linear-gradient(180deg,
    rgba(210, 170, 130, 1) 0%,
    rgba(150, 110, 75, 1) 55%,
    rgba(95, 65, 40, 1) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 215, 0.4),
    inset 0 -2px 0 rgba(35, 20, 8, 0.55);
}
.floor-wall.side {
  background: linear-gradient(90deg,
    rgba(175, 135, 95, 1) 0%,
    rgba(110, 78, 50, 1) 100%);
  border-color: rgba(35, 20, 8, 0.75);
}
/* ??????????/?????????????????????? */
.floor-wall.back {
  background: linear-gradient(180deg,
    rgba(140, 105, 70, 1) 0%,
    rgba(90, 62, 38, 1) 60%,
    rgba(55, 35, 18, 1) 100%);
}
.floor-wall.side.back {
  background: linear-gradient(90deg,
    rgba(115, 85, 55, 1) 0%,
    rgba(65, 42, 22, 1) 100%);
}
/* ???????????????????????? ? ???????? */
.floor-wall.top {
  background: linear-gradient(135deg,
    rgba(255, 240, 210, 1) 0%,
    rgba(225, 188, 140, 1) 60%,
    rgba(195, 155, 110, 1) 100%);
  border: 1px solid rgba(80, 50, 25, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 230, 0.65),
    0 2px 4px rgba(40, 25, 10, 0.35);
}
/* ????????????? */
.scene3d-world.building .floor-wall.top { opacity: 0.55; }

/* 3D ????? + ?? */
.stair-step {
  position: absolute;
  transform-origin: 0 0;
  border: 1px solid rgba(50, 35, 20, 0.4);
  box-sizing: border-box;
}
.stair-tread {
  background: linear-gradient(180deg, rgba(215, 180, 140, 0.96), rgba(180, 140, 100, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.55), inset 0 -1px 0 rgba(50, 30, 15, 0.3);
}
.stair-riser {
  background: linear-gradient(180deg, rgba(150, 110, 75, 0.95), rgba(110, 78, 50, 0.95));
}
.stair-cap {
  position: absolute;
  width: 28px;
  height: 28px;
  transform-origin: 0 0;
  background: rgba(73, 166, 255, 0.6);
  border: 2px solid #b8e0ff;
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(73, 166, 255, 0.8);
}
.stair-cap::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.floor-plane svg {
  width: 100%;
  height: 100%;
  display: block;
}
.floor-plane .floor-tag {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #2a3a55;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 12px;
  border-radius: 999px;
  transform: none;
  transform-origin: left top;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ?? */
.f3d-room {
  fill: #fbe9cf;
  stroke: #6b4a2a;
  stroke-width: 1.6;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.08));
}
.f3d-room.danger { fill: #ffd1d1; stroke: #b13a3a; }
.f3d-corridor {
  /* ?????????????????????"??/??"????
     ????????????????????????????????????? */
  fill: #fbe9cf;
  stroke: rgba(70, 50, 30, 0.4);
  stroke-width: 0.8;
}
.f3d-room-label {
  font-size: 16px;
  font-weight: 800;
  fill: #3d2814;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* ??? ??
   ???vector-effect: non-scaling-stroke ? stroke-width ?? <g matrix> ? SCALE_Y=0.5
   ??????????????????????????????? */
.f3d-path-glow,
.f3d-path-main {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.f3d-path-glow { opacity: 0.55; }
.f3d-path-main { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45)); }
.f3d-rescue .f3d-path-glow { stroke: rgba(227, 73, 73, 0.7); stroke-width: 18; }
.f3d-rescue .f3d-path-main { stroke: #ff4040; stroke-width: 8; }
.f3d-evac   .f3d-path-glow { stroke: rgba(40, 220, 110, 0.7); stroke-width: 18; }
.f3d-evac   .f3d-path-main { stroke: #14d96f; stroke-width: 8; }

/* ??? */
.f3d-marker { stroke: #fff; stroke-width: 1.4; }
.f3d-marker.fire   { fill: #ff5722; }
.f3d-marker.exit   { fill: #2bc46f; }
.f3d-marker.stair  { fill: #49a6ff; }
.f3d-marker.victim { fill: #ffce3a; }
.f3d-marker.rescuer { fill: #4ad6ff; }

.f3d-tag {
  font-size: 12px;
  font-weight: 800;
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.7);
  stroke-width: 3;
  pointer-events: none;
  letter-spacing: 0.4px;
}
.f3d-tag.fire { fill: #ffe14a; font-size: 13px; }
.f3d-tag.exit { fill: #b8ffd0; }
.f3d-tag.stair { fill: #9ddcff; font-size: 11px; }

.scene3d-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #90a8ca;
  font-size: 13px;
}

/* ============== 传感器监测 KPI 卡片（单列竖排） ============== */
.sensor-kpi-grid {
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}

.sensor-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  color: #8fa6c8;
  font-size: 12px;
  border: 1px dashed rgba(133, 173, 234, 0.22);
  border-radius: 12px;
  background: rgba(8, 18, 33, 0.35);
}

.sensor-metric {
  min-height: 0 !important;
  padding: 10px 12px 10px 14px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "head val"
    "meta meta" !important;
  column-gap: 10px !important;
  row-gap: 6px !important;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px !important;
  border: 1px solid rgba(118, 170, 244, 0.16) !important;
  background:
    linear-gradient(135deg, rgba(var(--theme-color-rgb), 0.10), transparent 42%),
    linear-gradient(180deg, rgba(22, 42, 72, 0.98), rgba(12, 26, 46, 0.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(3, 10, 24, 0.28) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.sensor-metric::before {
  display: block !important;
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #2ed28a;
  box-shadow: 0 0 10px rgba(46, 210, 138, 0.35);
}

.sensor-metric.medium::before {
  background: #ffc14e;
  box-shadow: 0 0 10px rgba(255, 193, 78, 0.4);
}

.sensor-metric.high::before {
  background: #ff6b6b;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.45);
}

.sensor-metric.high {
  border-color: rgba(255, 120, 120, 0.32) !important;
  background:
    linear-gradient(135deg, rgba(255, 96, 96, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(36, 28, 42, 0.98), rgba(18, 22, 38, 0.98)) !important;
}

.sensor-metric.medium {
  border-color: rgba(255, 196, 78, 0.28) !important;
}

.sensor-metric:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--theme-color-rgb), 0.42) !important;
}

.sensor-metric-header {
  grid-area: head;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  grid-template-columns: none !important;
  padding-left: 4px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.sensor-metric-title {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  font-size: 13px !important;
  font-weight: 700;
  color: #e7f1ff !important;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.sensor-metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #dff7ff;
  background: rgba(var(--theme-color-rgb), 0.22);
  border: 1px solid rgba(var(--theme-color-rgb), 0.35);
  box-shadow: 0 0 12px rgba(var(--theme-color-rgb), 0.18);
  flex-shrink: 0;
}

.sensor-metric.high .sensor-metric-icon {
  background: rgba(255, 96, 96, 0.22);
  border-color: rgba(255, 134, 134, 0.4);
  color: #ffd9d9;
}

.sensor-metric.medium .sensor-metric-icon {
  background: rgba(255, 196, 78, 0.2);
  border-color: rgba(255, 211, 104, 0.38);
  color: #ffe6a8;
}

.sensor-metric-header .sensor-badge {
  font-size: 10px !important;
  height: 22px !important;
  min-width: 0 !important;
  padding: 0 8px !important;
  margin-left: 0 !important;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.sensor-metric-value {
  grid-area: val;
  display: block !important;
  margin: 0 !important;
  font-size: 22px !important;
  line-height: 1.05 !important;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff !important;
  white-space: nowrap;
  text-align: right;
  text-shadow: 0 8px 22px rgba(25, 125, 255, 0.16);
  position: relative;
  z-index: 1;
}

.sensor-metric.high .sensor-metric-value {
  text-shadow: 0 8px 22px rgba(255, 80, 80, 0.22);
}

.sensor-metric-value .unit {
  font-size: 0.42em !important;
  margin-left: 4px;
  font-weight: 700;
  color: #9eb6d6;
  vertical-align: 0.35em;
}

.sensor-metric-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.sensor-metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.sensor-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(8, 18, 33, 0.55);
  border: 1px solid rgba(133, 173, 234, 0.14);
  color: #d7e6ff;
  font-size: 11px;
  line-height: 1.2;
}

.sensor-chip em {
  font-style: normal;
  color: #8fa6c8;
  font-weight: 600;
  max-width: 4.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sensor-chip b {
  font-weight: 800;
  color: #f4f9ff;
}

.sensor-chip i {
  font-style: normal;
  font-size: 10px;
  color: #7f98bb;
}

.sensor-chip.high {
  background: rgba(255, 96, 96, 0.12);
  border-color: rgba(255, 134, 134, 0.28);
}

.sensor-chip.high b { color: #ffc4c4; }

.sensor-chip.medium {
  background: rgba(255, 196, 78, 0.1);
  border-color: rgba(255, 211, 104, 0.26);
}

.sensor-chip.medium b { color: #ffe1a0; }

.sensor-metric-footer {
  display: flex !important;
  flex-direction: row !important;
  gap: 6px !important;
  flex-wrap: wrap;
  margin-top: 0;
  margin-left: auto;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.sensor-footer-row {
  flex: 0 0 auto;
  padding: 3px 9px 3px 8px !important;
  background: rgba(8, 18, 33, 0.55);
  border-radius: 999px !important;
  border: 1px solid rgba(133, 173, 234, 0.16);
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: visible !important;
  position: relative;
}

.sensor-footer-row::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fc1ff;
  box-shadow: 0 0 6px rgba(111, 193, 255, 0.55);
  flex-shrink: 0;
}

.sensor-footer-row.danger::before { background: #ff6b6b; box-shadow: 0 0 6px rgba(255, 107, 107, 0.6); }
.sensor-footer-row.warn::before   { background: #ffc14e; box-shadow: 0 0 6px rgba(255, 193, 78, 0.6); }
.sensor-footer-row.ok::before     { background: #2ed28a; box-shadow: 0 0 6px rgba(46, 210, 138, 0.6); }

.sensor-footer-label {
  font-size: 10px !important;
  letter-spacing: 0.3px;
  color: #8fa6c8;
  flex-shrink: 0;
  font-weight: 600;
}

.sensor-footer-value {
  font-size: 11px !important;
  font-weight: 700;
  color: #ecf5ff;
  white-space: nowrap;
}

.sensor-mini-trend {
  font-size: 11px !important;
  white-space: nowrap;
}

.stage-heading {
  align-items: flex-start;
  margin-bottom: 6px;
}

.map-header-meta {
  color: #9bb2d2;
  font-size: 11px;
}

.compact-overlay-legend {
  margin-bottom: 10px;
}

.map-legend {
  gap: 8px 10px;
}

.map-legend span {
  min-height: 26px;
  padding: 0 10px;
  background: rgba(9, 20, 35, 0.62);
  border: 1px solid rgba(101, 152, 223, 0.12);
}

.risk-scale {
  margin-top: 6px;
  margin-bottom: 0;
}

.risk-bar {
  width: 160px;
}

.map-toolbar-minimal {
  margin-bottom: 12px;
}

.map-chip {
  min-height: 30px;
  background: rgba(12, 27, 47, 0.9);
  border: 1px solid rgba(95, 154, 232, 0.14);
}

.map-chip.active {
  border-color: rgba(80, 175, 255, 0.28);
  background: rgba(26, 63, 106, 0.84);
}

.map-stage {
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(9, 21, 37, 0.98), rgba(7, 16, 29, 0.98)),
    linear-gradient(180deg, rgba(18, 55, 96, 0.08), rgba(18, 55, 96, 0.02));
  border: 1px solid rgba(91, 144, 214, 0.14);
  box-shadow: inset 0 0 0 1px rgba(84, 127, 189, 0.08), 0 18px 40px rgba(0, 0, 0, 0.24);
}

.map-canvas {
  padding: 2px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(29, 78, 132, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(6, 16, 29, 0.98), rgba(5, 13, 24, 0.98));
}

.risk-map {
  gap: 4px;
  min-height: 640px;
  background: rgba(20, 30, 50, 0.6);
  padding: 6px;
  border-radius: 10px;
  outline: 1px dashed rgba(120, 180, 255, 0.4);  /* ??????????? */
}

.cell {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.028);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.018);
  background: rgba(80, 110, 160, 0.35);  /* ???????????? cell ????? safe/warning/danger/extreme/blocked ???? */
}

.cell.safe {
  background: linear-gradient(180deg, #0b3b42, #0a3137);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(50, 190, 157, 0.08);
}

.cell.warning {
  background: linear-gradient(180deg, #5f5631, #554d2d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(232, 188, 73, 0.08);
}

.cell.danger {
  background: linear-gradient(180deg, #80543a, #6f4933);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(255, 143, 67, 0.08);
}

.cell.extreme {
  background: linear-gradient(180deg, #8f463f, #7b3a3d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(255, 98, 98, 0.1);
}

.cell.blocked {
  background: linear-gradient(180deg, #5f6a7d, #4d596d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(172, 187, 205, 0.08);
}

.cell.exit {
  outline: 2px solid rgba(84, 255, 150, 0.56);
  box-shadow: 0 0 24px rgba(67, 226, 118, 0.22), inset 0 0 18px rgba(67, 226, 118, 0.14);
}

.route-line.rescue-glow,
.route-line.rescue-glow.route-index-0,
.route-line.rescue-glow.route-index-1 {
  stroke: rgba(255, 94, 106, 0.24);
  stroke-width: 14;
  filter: drop-shadow(0 0 6px rgba(255, 94, 106, 0.28));
}

.route-line.rescue-main,
.route-line.rescue-main.route-index-0,
.route-line.rescue-main.route-index-1 {
  stroke: rgba(255, 102, 114, 0.94);
  stroke-width: 6;
  filter: drop-shadow(0 0 6px rgba(255, 91, 101, 0.22));
}

.route-line.evac-glow,
.route-line.evac-glow.evac-index-0,
.route-line.evac-glow.evac-index-1 {
  stroke: rgba(58, 228, 126, 0.2);
  stroke-width: 12;
  filter: drop-shadow(0 0 6px rgba(58, 228, 126, 0.22));
}

.route-line.evac-main,
.route-line.evac-main.evac-index-0,
.route-line.evac-main.evac-index-1 {
  stroke: rgba(64, 232, 132, 0.92);
  stroke-width: 5;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 6px rgba(64, 232, 132, 0.2));
}

.route-point {
  width: 22px;
  height: 22px;
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.04);
}

.route-point.rescuer {
  box-shadow: 0 0 0 8px rgba(63, 181, 255, 0.14), 0 0 14px rgba(63, 181, 255, 0.16);
}

.route-point.victim {
  box-shadow: 0 0 0 8px rgba(243, 212, 79, 0.14), 0 0 14px rgba(243, 212, 79, 0.16);
}

.route-point.fire {
  box-shadow: 0 0 0 8px rgba(255, 151, 47, 0.14), 0 0 16px rgba(255, 151, 47, 0.18);
}

.route-point.smoke {
  background: #ff9a34;
  box-shadow: 0 0 0 7px rgba(255, 154, 52, 0.1), 0 0 12px rgba(255, 154, 52, 0.14);
}

.route-point.obstacle {
  background: #aeb7c8;
  box-shadow: 0 0 0 7px rgba(174, 183, 200, 0.08), 0 0 10px rgba(174, 183, 200, 0.1);
}

.route-point.compact {
  width: 16px;
  height: 16px;
}

.annotation-label {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(125, 160, 210, 0.2);
  background: rgba(10, 21, 38, 0.86);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  font-size: 10px;
  line-height: 1.1;
}

.annotation-label.compact-label {
  padding: 3px 7px;
  font-size: 10px;
  opacity: 0.9;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.annotation-label.highlight {
  background: rgba(12, 24, 42, 0.92);
}

.annotation-label.rescuer {
  border-color: rgba(101, 197, 255, 0.42);
  color: #e8f6ff;
}

.annotation-label.victim {
  border-color: rgba(255, 218, 94, 0.42);
  color: #fff7d6;
}

.annotation-label.smoke {
  border-color: rgba(255, 160, 75, 0.36);
  color: #ffe7d2;
  background: rgba(49, 29, 16, 0.86);
}

.annotation-label.obstacle {
  border-color: rgba(196, 206, 223, 0.34);
  color: #edf3ff;
  background: rgba(26, 32, 43, 0.86);
}

.annotation-label.exit-marker {
  padding: 4px 8px;
  border-color: rgba(109, 255, 170, 0.42);
  background: linear-gradient(180deg, rgba(12, 74, 58, 0.94), rgba(8, 49, 38, 0.92));
  color: #e8fff2;
  box-shadow: 0 8px 18px rgba(34, 184, 104, 0.18);
  z-index: 18;
}

.route-point.fire {
  width: 28px;
  height: 28px;
  box-shadow: 0 0 0 10px rgba(255, 151, 47, 0.18), 0 0 22px rgba(255, 151, 47, 0.26);
}

.route-point.fire::after {
  inset: -6px;
  border-width: 3px;
  border-color: rgba(255, 176, 70, 0.58);
}

.annotation-label.fire,
.annotation-label.highlight.fire,
.annotation-label.highlight {
  border-color: rgba(255, 173, 76, 0.44);
  background: linear-gradient(180deg, rgba(58, 31, 10, 0.95), rgba(28, 18, 12, 0.92));
  color: #fff3d6;
  box-shadow: 0 8px 18px rgba(255, 128, 32, 0.2);
}

.route-arrow {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.route-arrow.rescue,
.route-arrow.rescue.route-index-0,
.route-arrow.rescue.route-index-1 {
  background: rgba(255, 103, 114, 0.94);
  border: 1px solid rgba(255, 176, 181, 0.44);
}

.route-arrow.evac,
.route-arrow.evac.evac-index-0,
.route-arrow.evac.evac-index-1 {
  background: rgba(49, 214, 115, 0.9);
  border: 1px solid rgba(139, 255, 178, 0.38);
}

/* ============================================================
   ?? A?? SVG ??????
   - .floor-plan-svg?????
   - .building-iso-svg??????
   - .f3d-plate / .f3d-wall / .f3d-floor-tag?????
   - .iso-ext-wall.* / .iso-cross-line / .iso-cross-dot????
   ============================================================ */

/* ?? SVG ?????????????? */
svg.floor-plan-svg {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  background: transparent;
}

/* ??????? + ??????? */
.f3d-plate {
  fill: #f4d6ad;
  stroke: rgba(60, 35, 15, 0.55);
  stroke-width: 1.5;
}

/* ???? */
.f3d-floor-tag {
  font-size: 18px;
  font-weight: 800;
  fill: #2a3a55;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 4;
  stroke-linejoin: round;
  pointer-events: none;
}

/* ?? SVG ?? */
svg.building-iso-svg {
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.55));
  background: transparent;
}

/* ?????????????????????????"??????"????? */
svg.building-iso-svg .iso-floor .f3d-plate { fill: #f4d6ad; }

/* ???????? = ?? + ??? + ????3 ? polygon ??????????
   3 ??? 3 ????????????????????????????? */
.iso-wall {
  stroke: #2a1a0c;
  stroke-width: 0.8;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.iso-wall.top   { fill: #d8b58a; }   /* ??????????? */
.iso-wall.front { fill: #8a5a3a; }   /* ?????????? */
.iso-wall.right { fill: #6b4530; }   /* ?????????? */

/* ???????? / ??? */
.iso-cross-line {
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px currentColor);
}
.iso-cross-line.rescue { stroke: #ff3a3a; color: rgba(255, 60, 60, 0.85); }
.iso-cross-line.evac   { stroke: #20c46a; color: rgba(40, 220, 110, 0.85); }
.iso-cross-dot.rescue  { fill: #ff5b5b; stroke: #fff; stroke-width: 1.5; }
.iso-cross-dot.evac    { fill: #2bd66e; stroke: #fff; stroke-width: 1.5; }

/* ============== ??????? / ?????????? ============== */
.multisource-card { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 2px; }
.multisource-card .ms-row { display: flex; flex-wrap: wrap; gap: 6px; }
.multisource-card .ms-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; line-height: 1.5;
  background: rgba(9, 20, 35, 0.62); border: 1px solid rgba(101, 152, 223, 0.22); color: #b9cde9;
}
.multisource-card .ms-chip strong { color: #fff; font-size: 13px; font-weight: 600; }
.multisource-card .ms-chip.ms-ok { border-color: rgba(76, 200, 137, 0.55); color: #b8f1cc; background: rgba(28, 60, 42, 0.42); }
.multisource-card .ms-chip.ms-idle { border-color: rgba(220, 170, 90, 0.45); color: #f1d9a8; background: rgba(54, 42, 22, 0.45); }
.multisource-card .ms-chip.ms-task { border-color: rgba(120, 170, 245, 0.40); color: #d4e5ff; background: rgba(22, 40, 70, 0.55); }


/* ============== ??�?? / ????????? ============== */
.mark-toolbar { margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: rgba(9, 20, 35, 0.55); border: 1px solid rgba(101, 152, 223, 0.18); }
.mark-toolbar.mark-active { border-color: rgba(255, 196, 90, 0.55); box-shadow: 0 0 0 1px rgba(255, 196, 90, 0.25) inset; }
.mark-toolbar .mark-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.mark-toolbar .mark-btn { padding: 4px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid rgba(101, 152, 223, 0.32); background: rgba(22, 40, 70, 0.55); color: #d4e5ff; cursor: pointer; }
.mark-toolbar .mark-btn:hover { background: rgba(40, 70, 120, 0.7); }
.mark-toolbar .mark-btn.active { background: rgba(255, 196, 90, 0.25); border-color: rgba(255, 196, 90, 0.7); color: #ffe0a8; }
.mark-toolbar .mark-btn.mark-clear { border-color: rgba(220, 110, 110, 0.45); color: #ffc8c8; }
.mark-toolbar .mark-btn.mark-submit { border-color: rgba(76, 200, 137, 0.55); color: #b8f1cc; background: rgba(28, 60, 42, 0.45); }
.mark-toolbar .mark-btn.mark-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.mark-toolbar .mark-status { font-size: 12px; color: #b9cde9; margin-left: auto; }
.mark-toolbar .mark-mode { font-size: 12px; color: #b9cde9; display: inline-flex; align-items: center; gap: 4px; }
.mark-toolbar .mark-hint { font-size: 11px; color: #7990ad; }
.mark-toolbar .mark-hint code { background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 4px; color: #d4e5ff; }

/* ????????????????????? */
#riskMap .cell.mark-pick { outline: 2px solid #ffc45a; outline-offset: -2px; cursor: pointer; }
#riskMap .cell.mark-pick-stair { box-shadow: inset 0 0 0 2px rgba(120, 200, 255, 0.9); }
#riskMap .cell.mark-pick-exit  { box-shadow: inset 0 0 0 2px rgba(180, 255, 160, 0.9); }
