/* 运行概览 · 蓝白科技运行台 */
.overview-kpi.kpi-grid { margin-bottom: 14px; gap: 12px; }
.overview-kpi-card .kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.overview-kpi-card .kpi-value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.overview-kpi-card .kpi-value.danger { color: var(--danger); }

.overview-twin-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.48fr) minmax(0, 1.9fr) minmax(300px, 0.95fr);
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
  height: 540px;
  min-height: 540px;
  max-height: 540px;
}
.overview-twin-row > .panel {
  margin-bottom: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow);
}

.twin-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(37, 99, 235, 0.18);
}
.twin-chip--live {
  background: #d1fae5;
  color: #065f46;
  letter-spacing: 0.08em;
  border-color: rgba(6, 95, 70, 0.18);
}

.twin-tree {
  display: flex;
  flex-direction: column;
  padding: 0 0 12px;
  overflow: auto;
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 48%);
}
.twin-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px 12px 11px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f6ff 100%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: inset 3px 0 0 var(--accent);
  position: relative;
}
.twin-panel-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}
.twin-panel-mark--detail {
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
}
.twin-panel-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.twin-panel-copy .twin-chip { margin: 0; }
.twin-panel-copy h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.twin-panel-copy p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.twin-tree-head.twin-panel-head { margin-bottom: 8px; }
#twin-building-tree {
  padding: 0 10px;
}
.twin-eyebrow { display: none; }
.twin-scene-title h3 {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.twin-building { margin-bottom: 8px; }
.twin-building-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.twin-building-toggle[aria-expanded="true"],
.twin-building-toggle:hover {
  border-color: var(--border);
  background: var(--bg-hover);
}
.twin-building-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
}
.twin-floor-list {
  display: grid;
  gap: 2px;
  margin: 4px 0 2px;
  padding-left: 4px;
  border-left: 1px solid var(--border);
}
.twin-floor {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.twin-floor:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.twin-floor[aria-pressed="true"] {
  color: var(--on-accent, #eeefff);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.twin-floor[aria-pressed="true"] .twin-floor-number,
.twin-floor[aria-pressed="true"] .twin-floor-tag {
  color: rgba(238, 239, 255, 0.85);
}
.twin-floor-number {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.twin-floor-tag {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.twin-empty { padding: 12px 4px; font-size: 13px; color: var(--text-muted); }

.twin-scene {
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, #1e3a8a 0%, transparent 55%),
    linear-gradient(165deg, #0f172a 0%, #1e293b 48%, #0b1220 100%);
  height: 100%;
  min-height: 0;
  color: #e2e8f0;
}
.twin-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, transparent 18%, transparent 82%, rgba(15, 23, 42, 0.55) 100%);
  z-index: 1;
}
.twin-scene-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, auto) minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px 8px;
}
.twin-scene-header .twin-scene-title { justify-self: start; }
.twin-scene-header .twin-legend { justify-self: end; }
.twin-scene-crumb {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: min(480px, 100%);
  padding: 6px 12px;
  background: rgba(15, 36, 48, 0.72);
  border: 1px solid rgba(90, 143, 132, 0.65);
  border-radius: 8px;
}
.twin-scene-crumb[hidden] { display: none !important; }
.twin-scene-crumb button {
  border: 0;
  background: transparent;
  color: #8fe6cb;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.twin-scene-crumb button:hover:not(:disabled) {
  background: rgba(49, 92, 87, 0.85);
}
.twin-scene-crumb button.is-current,
.twin-scene-crumb button:disabled {
  color: #f2fffb;
  cursor: default;
  font-weight: 700;
}
.twin-scene-crumb .twin-crumb-sep {
  color: #7f9aa0;
  font-size: 11px;
  padding: 0 2px;
  user-select: none;
}
.twin-scene-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.twin-scene-title h3 { color: #f8fafc; margin-top: 0; }
.twin-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.72);
  font-family: var(--font-mono);
}
.twin-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.twin-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.twin-legend .lg-elec { background: #38bdf8; }
.twin-legend .lg-water { background: #60a5fa; }
.twin-legend .lg-alert { background: #fbbf24; }

.twin-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 12px 40px rgba(2, 6, 23, 0.35);
}
.twin-viewport-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 65% at 50% 45%, #000 20%, transparent 75%);
}
.twin-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
  font-size: 13px;
}
.twin-loader[hidden] { display: none !important; }
.twin-loader-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.25);
  border-top-color: #38bdf8;
  animation: twin-spin 0.8s linear infinite;
}
@keyframes twin-spin {
  to { transform: rotate(360deg); }
}
.twin-loader p {
  margin: 0;
  color: rgba(203, 213, 225, 0.85);
}
.twin-loader-track {
  width: min(220px, 56%);
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}
.twin-loader-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.18s ease-out;
}
.twin-loader-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
}
.twin-scene-title p {
  margin-top: 6px;
  color: rgba(148, 163, 184, 0.95);
  font-size: 12px;
}
.twin-section-heading {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.overview-scope {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  font-family: var(--font-mono);
}
.twin-canvas { position: absolute; inset: 0; }
.twin-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.twin-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: rgba(203, 213, 225, 0.85);
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
  z-index: 2;
}
.twin-status.failed { color: #fecaca; }
.twin-callouts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.twin-callout {
  position: absolute;
  transform: translate(-10%, -100%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
}
.twin-callout-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
  background: #38bdf8;
  flex-shrink: 0;
}
.twin-callout.blue .twin-callout-dot {
  background: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}
.twin-callout.warn .twin-callout-dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28);
}
.twin-callout-body {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(8px);
  display: grid;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
}
.twin-callout-body strong {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.twin-callout-body span {
  font-size: 13px;
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.twin-scene-footer {
  position: relative;
  z-index: 2;
  padding: 10px 16px 12px;
  color: rgba(148, 163, 184, 0.9);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.twin-detail {
  display: flex;
  flex-direction: column;
  padding: 0 0 12px;
  gap: 10px;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 40%);
}
.twin-detail-head.twin-panel-head {
  align-items: center;
  margin-bottom: 0;
  flex-shrink: 0;
}
.twin-detail-head .twin-panel-copy h3 {
  font-size: 16px;
}
.twin-detail-action {
  flex: 0 0 auto;
  align-self: center;
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--accent-2);
  background: #fff;
  font-weight: 600;
}
.twin-detail-action:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--accent);
}
.twin-detail-action:disabled {
  opacity: 0.45;
}
.twin-detail > .twin-room-hint,
.twin-detail > .twin-room-list,
.twin-detail > .twin-overview-card,
.twin-detail > .twin-alert-card {
  margin-left: 12px;
  margin-right: 12px;
}
.twin-room-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%);
  border: 1px solid rgba(37, 99, 235, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  position: relative;
}
.twin-room-hint::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.twin-room-hint strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  padding-left: 6px;
}
.twin-room-hint span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 6px;
}
.twin-room-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 118px;
  overflow: auto;
  flex-shrink: 0;
}
.twin-room-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.twin-room-item strong { font-size: 12px; color: #0f172a; }
.twin-room-item span { font-size: 11px; color: #64748b; }
.twin-room-item:hover { border-color: #93c5fd; background: #f8fbff; }
.twin-room-item.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}
.twin-html-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.twin-map-label {
  position: absolute;
  transform: translate(-50%, -120%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  cursor: pointer;
  white-space: nowrap;
}
.twin-map-label strong { font-size: 12px; font-weight: 650; }
.twin-map-label small { font-size: 10px; opacity: 0.78; }
.twin-map-label--floor { background: rgba(37, 99, 235, 0.88); border-color: transparent; }
.twin-plan-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.twin-plan-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.twin-plan-link:not(:disabled):hover { color: var(--accent-2); text-decoration: underline; }

.twin-overview-card,
.twin-alert-card {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
  min-height: 0;
  box-shadow: var(--shadow);
}
.twin-overview-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}
.twin-alert-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.twin-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.twin-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.twin-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.twin-meta-grid .full { grid-column: 1 / -1; }
.twin-meta-grid span {
  color: var(--text-muted);
  font-size: 11px;
}
.twin-meta-grid strong {
  color: var(--text);
  font-weight: 600;
}
.twin-meta-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
}
.twin-metric-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.twin-metric-card {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 8px;
  min-width: 0;
}
.twin-metric-card .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.twin-metric-card .value {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
.twin-metric-card .value.elec { color: #004ac6; }
.twin-metric-card .value.water { color: #0369a1; }
.twin-metric-card .value.meter { color: #2563eb; }
.twin-metric-card .value small {
  font-size: 11px;
  font-weight: 500;
  margin-left: 3px;
  color: var(--text-muted);
}
.twin-metric-card .delta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.twin-metric-card .delta.down { color: #065f46; }
.twin-metric-card .delta.up { color: #991b1b; }

.twin-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.twin-alert-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.twin-detail .alerts-compact {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.twin-alert-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: #f8fafc;
  border-left: 3px solid var(--accent);
}
.twin-alert-item.high { border-left-color: var(--danger); }
.twin-alert-item.medium { border-left-color: var(--warning); }
.twin-alert-item.low { border-left-color: var(--info); }
.twin-alert-item strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.twin-alert-item .hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}
.twin-alert-item time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.twin-alert-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 18px 8px;
  font-size: 12px;
}

.overview-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
}
.overview-bottom .panel {
  margin-bottom: 0;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow);
}
.overview-bottom .panel-head {
  align-items: flex-start;
}
.panel-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.overview-bottom .live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
}
.overview-bottom .live-dot i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}
.overview-bottom .realtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}
.overview-bottom .rt-card {
  padding: 11px 11px 10px;
}
.overview-bottom .rt-card__name,
.overview-bottom .rt-card .name {
  font-size: 12px;
  margin-bottom: 8px;
}
.overview-bottom .rt-card__value .num,
.overview-bottom .rt-card .power {
  font-size: 20px;
}
.overview-bottom .rt-card__value .unit,
.overview-bottom .rt-card .power small {
  font-size: 11px;
}
.overview-bottom .rt-card__kind {
  font-size: 10px;
}

.kpi-card .kpi-spark { display: none; }

@media (max-width: 1200px) {
  .overview-twin-row {
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.4fr);
    height: 560px;
    min-height: 560px;
    max-height: 560px;
  }
  .twin-detail { grid-column: 1 / -1; height: 280px; max-height: 280px; }
}
@media (max-width: 900px) {
  .overview-twin-row {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .overview-twin-row > .panel { height: auto; max-height: none; }
  .twin-scene { height: 420px; max-height: 420px; }
  .twin-canvas-wrap { min-height: 0; }
  .twin-detail { height: 360px; max-height: 360px; }
  .overview-bottom { grid-template-columns: 1fr; }
}

/* —— future-yard 风格场景 HUD（红框控件） —— */
.twin-hud-tabs,
.twin-hud-caption,
.twin-hud-traffic,
.twin-hud-toolbar,
.twin-hud-scale,
.twin-hud-layers,
.twin-hud-pipe-legend,
.twin-hud-compass,
.twin-hud-help,
.twin-hud-legend {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}
.twin-hud-tabs,
.twin-hud-traffic,
.twin-hud-toolbar,
.twin-hud-layers {
  pointer-events: auto;
}
.twin-hud-tabs {
  left: 14px;
  top: 12px;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #152734ed;
  border: 1px solid #3c5661;
  border-radius: 5px;
}
.twin-hud-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #9ab2be;
  font-size: 10px;
  cursor: pointer;
}
.twin-hud-tabs button.is-active {
  background: #315850;
  color: #9ce4d0;
}
.twin-hud-caption {
  top: 56px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a7c6c9;
  font-size: 11px;
}
.twin-hud-floors {
  position: absolute;
  top: 78px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(360px, calc(100% - 70px));
  padding: 6px 10px;
  background: #142a36ed;
  border: 1px solid #46635f;
  border-radius: 6px;
  pointer-events: auto;
  z-index: 6;
}
.twin-hud-floors[hidden] { display: none !important; }
.twin-hud-floors .twin-floor-chip {
  border: 1px solid #43615f;
  background: #203f45;
  color: #c4e4dc;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.twin-hud-floors .twin-floor-chip:hover {
  background: #315c57;
}
.twin-hud-floors .twin-floor-chip.is-active {
  background: #32594f;
  color: #96e4cd;
  border-color: #4d7f74;
}
.twin-canvas-wrap.has-floor-bar .twin-hud-traffic {
  top: 118px;
}
.twin-canvas-wrap:not(.has-floor-bar) .twin-hud-traffic {
  top: 78px;
}
.twin-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #59d0b5;
  box-shadow: 0 0 8px #59d0b53b;
  flex-shrink: 0;
}
.twin-live-dot.is-paused {
  background: #c6ab7d;
  box-shadow: none;
}
.twin-hud-traffic {
  top: 112px;
  left: 14px;
  padding: 10px 12px;
  background: #142a36ed;
  border: 1px solid #46635f;
  border-radius: 6px;
  box-shadow: 0 5px 20px #07182033;
  max-width: min(340px, calc(100% - 70px));
}
.twin-hud-traffic-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #c4e4dc;
}
.twin-hud-traffic-title small {
  font-size: 10px;
  color: #91aaa9;
  margin-left: 4px;
}
.twin-hud-traffic-actions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.twin-hud-traffic-actions select,
.twin-hud-traffic-actions button {
  height: 29px;
  border: 1px solid #43615f;
  border-radius: 4px;
  background: #203f45;
  color: #c4e4dc;
  font-size: 10px;
  padding: 3px 7px;
  cursor: pointer;
}
.twin-hud-traffic-actions select:first-child {
  flex: 1;
  min-width: 0;
}
.twin-hud-traffic-actions button:hover {
  background: #315c57;
}
.twin-hud-toolbar {
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: #172937e8;
  border: 1px solid #3b5360;
  border-radius: 5px;
  gap: 2px;
}
.twin-hud-toolbar button {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #acc1c9;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.twin-hud-toolbar button.is-active,
.twin-hud-toolbar button:hover {
  background: #32544e;
  color: #8fe6cb;
}
.twin-hud-toolbar-sep {
  height: 1px;
  background: #3c515e;
  margin: 3px 4px;
}
.twin-hud-scale {
  bottom: 52px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #abc1c7;
  font-size: 10px;
}
.twin-hud-scale i {
  display: block;
  width: 45px;
  height: 5px;
  border: 1px solid #9db5ba;
  border-top: 0;
}
.twin-hud-layers {
  bottom: 12px;
  left: 14px;
  display: flex;
  background: #192f3ddd;
  border: 1px solid #3c525f;
  border-radius: 4px;
  padding: 3px;
  gap: 2px;
}
.twin-hud-layers button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #aac0c8;
  font-size: 10px;
  cursor: pointer;
}
.twin-hud-layers button.is-active {
  background: #32594f;
  color: #96e4cd;
}
.twin-hud-layers button[hidden] { display: none !important; }
.twin-hud-pipe-legend {
  top: 78px;
  left: 14px;
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #b2c7ce;
  background: #142a36cc;
  border: 1px solid #46635f;
  border-radius: 4px;
  padding: 6px 10px;
}
.twin-hud-pipe-legend[hidden] { display: none !important; }
.twin-hud-pipe-legend .pipe-water { color: #54afdd; }
.twin-hud-pipe-legend .pipe-power { color: #e0ac6a; }
.twin-hud-pipe-legend .pipe-hvac { color: #c982cb; }
.twin-hud-compass {
  bottom: 78px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #a5c2c8;
}
.twin-hud-compass span { font-size: 12px; }
.twin-hud-compass i {
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 26px solid #b6d0d0;
  transform: rotate(25deg);
}
.twin-hud-compass small { font-size: 10px; }
.twin-hud-help {
  bottom: 14px;
  right: 140px;
  font-size: 10px;
  color: #8ca9b4;
  white-space: nowrap;
}
.twin-hud-help span { padding: 0 4px; }
.twin-hud-legend {
  bottom: 12px;
  right: 14px;
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: #a4bbc4;
  background: #1d334099;
  padding: 7px 9px;
  border-radius: 3px;
}
.twin-hud-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.twin-hud-legend i {
  width: 6px;
  height: 6px;
  border-radius: 1px;
}
.twin-hud-legend .lg-ok { background: #8ab5bb; }
.twin-hud-legend .lg-warn { background: #d9a074; }
.twin-hud-legend .lg-cur { background: #61c7ad; }
.twin-canvas-wrap.is-floor-detail .twin-hud-traffic { display: none; }
.twin-canvas-wrap.is-building-mode #twin-toggle-explode { display: inline-flex !important; }
.twin-canvas-wrap.is-pipes-on .twin-hud-traffic { display: none; }

@media (max-width: 900px) {
  .twin-hud-tabs button { font-size: 9px; padding: 6px; }
  .twin-hud-traffic { max-width: calc(100% - 56px); }
  .twin-hud-help { display: none; }
  .twin-hud-legend { bottom: 48px; }
}
