/* ============================================================
   TranESS — Global Operations Big Screen (HQ dashboard port)
   Design basis: tmp/dashboards/yuyun (1920x1080 data screen)
   Brand: Transsion #303288 family + semantic data colors
   ============================================================ */

:root {
  --dash-bg: #080a1e;
  --dash-panel-bg: rgba(48, 50, 136, 0.30);
  --dash-border: rgba(142, 151, 245, 0.34);
  --dash-primary: #303288;
  --dash-accent: #8e97f5;
  --dash-accent-strong: #b9a8ff;
  --dash-online: #8e97f5;
  --dash-offline: #e89b1c;
  --dash-fault: #e5484d;
  --dash-text: rgba(255, 255, 255, 0.92);
  --dash-muted: rgba(198, 210, 215, 0.85);
  --dash-num-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --promise-h: clamp(64px, 6.5vh, 92px);
  --inv-grad: linear-gradient(135deg, #8e97f5 0%, #6a72d8 45%, #4a4dac 100%);
  --aio-grad: linear-gradient(135deg, #d9a86a 0%, #c58a4a 45%, #a86e2c 100%);
}
@media (max-width: 1150px) {
  :root { --promise-h: clamp(96px, 12vh, 140px); }
}

/* ---------- Big-screen wrapper: fixed 1920x1080 canvas, scale-to-fit ---------- */
.bigscreen-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--promise-h));
  min-height: 500px;
  overflow: hidden;
  background: radial-gradient(100% 100% at 50% 17%, #0d0a1f 0%, #070512 100%);
}

.bigscreen-canvas {
  position: absolute;
  top: 65px;
  left: 0;
  right: 0;
  bottom: 0;
  container-type: size;
  opacity: 0;
  display: flex;
  flex-direction: column;
  color: var(--dash-text);
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(100.06% 100.06% at 50% 17.28%, #100b26 0%, #070512 100%);
}

.bigscreen-stage:fullscreen .bigscreen-canvas { top: 0; }

.bigscreen-canvas.ready { opacity: 1; transition: opacity 0.5s ease; }

/* ---------- Top bar ---------- */
.bs-topbar {
  width: 100%;
  height: 66px;
  margin: 0 auto 12px;
  padding: 8px 24px 0;
  text-align: center;
  position: relative;
  background:
    radial-gradient(120% 200% at 50% -40%, rgba(48, 50, 136, 0.62) 0%, rgba(48, 50, 136, 0.16) 62%, transparent 100%);
}
.bs-topbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 62%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 168, 255, 0.7), transparent);
}
.bs-title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 3px;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #ffffff 29.43%, #cfc4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(142, 151, 245, 0.55);
}
.bs-subtitle {
  font-size: 12px;
  letter-spacing: 4px;
  color: rgba(185, 168, 255, 0.65);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.bs-timebar {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  font-family: var(--dash-num-font);
  font-size: 14px;
  color: var(--dash-text);
}
.bs-timebar .update-label { color: rgba(158, 164, 169, 1); font-family: "Inter", sans-serif; }
.bs-timebar #bs-updated { font-size: 15px; }
.bs-timebar #bs-clock { font-size: 16px; }
.bs-timebar .bs-utc-chip {
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid rgba(185, 168, 255, 0.55);
  color: rgba(198, 210, 215, 1);
  font-size: 15px;
}
.bs-fullscreen-btn {
  width: 38px;
  height: 38px;
  margin-left: 12px;
  cursor: pointer;
  border: 1px solid rgba(185, 168, 255, 0.4);
  border-radius: 8px;
  background: rgba(63, 41, 138, 0.35) url("../img/dashboard/bg/zoom_in.png") no-repeat center;
  background-size: 22px;
  transition: background-color 0.25s, border-color 0.25s;
}
.bs-fullscreen-btn:hover { background-color: rgba(48, 50, 136, 0.7); border-color: rgba(185, 168, 255, 0.8); }

/* ---------- Middle layout ---------- */
.bs-middle {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  gap: 1.5cqh;
  padding: 0 1.5cqw 0.8cqh;
  background:
    url("../img/dashboard/bg/bg_left.png") left bottom no-repeat,
    url("../img/dashboard/bg/bg_right.png") right bottom no-repeat,
    url("../img/dashboard/bg/bg_bottom.png") bottom center no-repeat;
}
.bs-col { display: flex; flex-direction: column; }
.bs-col-l { width: 23.5%; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bs-col-m { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bs-col-r { width: 23.5%; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 1.5cqh; }

.bs-panel {
  background: var(--dash-panel-bg);
  border: 1px solid rgba(185, 168, 255, 0.16);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px -28px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  margin-bottom: 14px;
  overflow: hidden;
}

/* Three columns share the same top edge; right column fills available height */
.bs-col-l, .bs-col-m, .bs-col-r { padding-top: 0; }
.bs-col-r .bs-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.bs-col-r .bs-content { flex: 1; }
.bs-col-r .bs-kpi { flex: 7; }
.bs-col-r .bs-grid { flex: 3; }
.bs-col-r .bs-grid { min-height: auto; }

/* ---------- TitleBar (HQ port) ---------- */
.bs-titlebar {
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-left: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 88.26%, rgba(28, 34, 33, 0.5) 100%),
    radial-gradient(856% 202% at 110% -95%, rgba(142, 151, 245, 0.42) 0%, rgba(48, 50, 136, 0.14) 60%, transparent 100%);
  border-bottom: 1px solid rgba(185, 168, 255, 0.16);
}
.bs-titlebar .bs-tb-icon {
  width: 30px;
  height: 30px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.bs-tb-device { background-image: url("../img/dashboard/bg/icon_device.png"); }
.bs-tb-energy { background-image: url("../img/dashboard/bg/icon_energy.png"); }
.bs-tb-power { background-image: url("../img/dashboard/bg/icon_power.png"); }
.bs-tb-alarm { background-image: url("../img/dashboard/bg/icon_alarm.png"); }
.bs-tb-alarm-device { background-image: url("../img/dashboard/bg/icon_alarm_device.png"); }
.bs-tb-rank { background-image: url("../img/dashboard/bg/icon_country_device_rank.png"); }
.bs-tb-growth { background-image: url("../img/dashboard/bg/icon_country_site_growth.png"); }
.bs-titlebar .bs-tb-title {
  font-size: 20px;
  height: 30px;
  line-height: 30px;
  background: linear-gradient(180deg, #ffffff 29.43%, #cfc4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 12px rgba(142, 151, 245, 0.5);
  font-weight: 600;
}
.bs-titlebar .bs-tb-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  padding-right: 16px;
  font-size: 15px;
  color: rgba(216, 234, 242, 0.95);
}

/* ---------- Left column panels ---------- */
.bs-device {
  flex: 7;
  min-height: 0;
  background: radial-gradient(135.76% 40.66% at 50% 100%, rgba(48, 50, 136, 0.40) 0%, rgba(48, 50, 136, 0.26) 33.32%, rgba(42, 30, 80, 0.0001) 100%);
  display: flex;
  flex-direction: column;
}
.bs-device .bs-content { flex: 1; padding: 12px 15px; display: flex; flex-direction: column; justify-content: space-evenly; }

/* Circular rate ring (HQ circularType port) */
.bs-ring-wrap { display: flex; align-items: center; justify-content: center; }
.bs-ring-box {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../img/dashboard/bg/bg_rate_circular.png") no-repeat center;
  background-size: cover;
  margin-right: 12px;
}
.bs-ring-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: url("../img/dashboard/bg/bg_circular_line.png") no-repeat bottom center;
  background-size: 100% 58%;
}
.bs-ring-legend ul { position: relative; top: 0; padding: 0 0 2px; width: 100%; }
.bs-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bs-ring-inner {
  width: 110px;
  height: 110px;
  background: #0b0718;
  border-radius: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.bs-ring-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  background: #7b5ff2;
  border: 2px solid #d9d9d9;
  z-index: 10;
}
.bs-ring-num { font-family: var(--dash-num-font); font-size: 26px; font-weight: 700; color: #fff; }
.bs-ring-num small { font-family: "Inter", sans-serif; font-size: 15px; color: rgba(255, 255, 255, 0.5); }
.bs-ring-label { font-size: 13px; color: rgba(198, 210, 215, 1); margin-top: 6px; }
.bs-ring-legend { width: 230px; }
.bs-ring-legend ul { list-style: none; margin: 0; padding: 0; }
.bs-ring-legend li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 18px;
  font-size: 14px;
  color: rgba(216, 234, 242, 1);
}
.bs-ring-legend li b {
  font-family: var(--dash-num-font);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
  text-align: right;
}
.bs-online { color: #cfc4ff; }
.bs-offline { color: #a8b0c8; }
.bs-ring-legend .sw {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.bs-ring-legend .sw.online { background: var(--dash-online); box-shadow: 0 0 8px rgba(47, 191, 113, 0.6); }
.bs-ring-legend .sw.offline { background: var(--dash-offline); box-shadow: 0 0 8px rgba(245, 166, 35, 0.6); }

/* Offline distribution bars */
.bs-offline-dist { margin-top: 0; display: flex; flex-direction: column-reverse; }
.bs-offline-dist .legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 12px;
  color: rgba(216, 234, 242, 1);
}
.bs-legend-dot { display: inline-flex; align-items: center; justify-content: center; width: 10px; height: 10px; border: 1px solid rgba(212, 222, 236, 0.15); margin-right: 5px; }
.bs-offline-dist .legend span { display: inline-flex; align-items: center; }
.bs-offline-dist .legend span { justify-content: center; }
.bs-legend-dot i { width: 4px; height: 4px; background: var(--dash-online); display: block; }
.bs-legend-dot.amber i { background: #ffcc66; }
.bs-dist-bar {
  position: relative;
  height: 44px;
  margin-top: 8px;
}
.bs-dist-num {
  position: absolute;
  top: -24px;
  font-family: var(--dash-num-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bs-dist-num.inv { left: 0; color: #8e97f5; }
.bs-dist-num.aio { right: 0; color: #d3a06a; }
.bs-dist-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  /* Fallback; the blend point is set dynamically by dashboard.js from the real ratios */
  background: linear-gradient(90deg, #8e97f5 0%, #6a72d8 46%, #8a5a12 52%, #b45309 58%, #fbbf24 100%);
}
.bs-dist-seg {
  height: 100%;
  min-width: 0;
  background: transparent;
}

/* Energy overview (HQ 2x2 data cards + peak) */
.bs-energy { flex: 3; display: flex; flex-direction: column; }
.bs-energy .bs-content { flex: none; padding: 8px 12px 10px; display: flex; flex-direction: column; justify-content: space-between; }
.bs-energy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bs-en-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(185, 168, 255, 0.14);
  border-radius: 8px;
}
.bs-en-icon { width: 23px; height: 23px; background-size: contain; background-repeat: no-repeat; background-position: center; flex-shrink: 0; }
.bs-en-pv { background-image: url("../img/dashboard/bg/bg_Energy_pv.png"); }
.bs-en-lo { background-image: url("../img/dashboard/bg/bg_Energy_lo.png"); }
.bs-en-in { background-image: url("../img/dashboard/bg/bg_Energy_in.png"); }
.bs-en-out { background-image: url("../img/dashboard/bg/bg_Energy_out.png"); }
.bs-en-title { font-size: 12px; color: rgba(216, 234, 242, 1); }
.bs-en-value { font-family: var(--dash-num-font); font-weight: 700; font-size: 16px; color: #fff; }
.bs-en-value, .bs-peak .val, .bs-kpi-card .v { font-variant-numeric: tabular-nums; }
.bs-en-value small {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 3px;
  vertical-align: 1px;
}
.bs-en-card .right { min-width: 0; text-align: right; margin-left: auto; }
.bs-en-card .right .bs-en-title { white-space: normal; line-height: 1.25; }
.bs-peak {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 12px;
  background: url("../img/dashboard/bg/bg_bottom_des.png") no-repeat center;
  background-size: 100% 100%;
}
.bs-peak .lbl { font-size: 15px; color: rgba(216, 234, 242, 1); }
.bs-peak .val { font-family: var(--dash-num-font); font-size: 26px; font-weight: 700; color: #fff; }
.bs-peak .val small { font-size: 12px; color: rgba(255, 255, 255, 0.55); margin-left: 3px; vertical-align: 1px; }

/* Grid overview (buy / sell + plant icon) */
.bs-grid { display: flex; flex-direction: column; flex: 3; }
.bs-grid .bs-content { flex: none; padding: 14px 14px 12px; display: flex; flex-direction: column; justify-content: space-between; }
.bs-power-row { display: flex; align-items: stretch; gap: 10px; flex: 1; }
.bs-power-card {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  background: url("../img/dashboard/bg/bg_power1.png") no-repeat center;
  background-size: cover;
  border: 1px solid rgba(185, 168, 255, 0.22);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bs-power-card .t { font-size: 12px; color: rgba(216, 234, 242, 1); }
.bs-power-card .u { font-size: 10px; color: rgba(255, 255, 255, 0.45); }
.bs-power-card .v { font-family: var(--dash-num-font); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-power-card .v.bs-buy { color: #fff; }
.bs-power-card .v.bs-sell { color: #fff; }
.bs-power-card.card-sell { background-image: url("../img/dashboard/bg/bg_power2.png"); }
.bs-power-mid {
  width: 64px;
  height: 64px;
  flex: none;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(217, 157, 78, 0.4);
  background: radial-gradient(100% 100% at 50% 30%, rgba(217, 157, 78, 0.28), rgba(24, 17, 8, 0.6));
  box-shadow: 0 0 24px rgba(217, 157, 78, 0.3);
}
.bs-power-icon { width: 44px; height: auto; object-fit: contain; filter: drop-shadow(0 0 10px rgba(217, 157, 78, 0.45)); }

/* SVG icon base */
.bs-ico { display: block; filter: drop-shadow(0 0 6px rgba(185, 168, 255, 0.35)); }

/* Dark product stage for transparent cutouts */
.product-shot-dark {
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(142, 151, 245, 0.18) 0%, rgba(94, 59, 190, 0.10) 40%, rgba(12, 9, 30, 0.0) 72%),
    radial-gradient(120% 100% at 50% 50%, rgba(26, 20, 60, 0.85) 0%, rgba(10, 7, 26, 0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-shot-dark img { filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.45)); }

/* ---------- Middle column ---------- */
.bs-equip { display: flex; justify-content: space-between; gap: 12px; height: 78px; margin-bottom: 10px; flex: none; }
.bs-equip-card {
  flex: 1;
  height: 78px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: url("../img/dashboard/bg/bg_equipment_indicator.png") no-repeat center;
  background-size: cover;
}
.bs-equip-left { text-align: center; padding-right: 8px; }
.bs-equip-left .bs-equip-num { display: block; margin: 0 auto; }
.bs-equip-left .bs-equip-title { margin-top: 0; }
.bs-equip-num {
  font-family: var(--dash-num-font);
  font-size: 20px;
  font-weight: 700;
  line-height: 40px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: url("../img/dashboard/bg/bg_indicator_w.png") no-repeat center;
  background-size: 92px 42px;
  min-width: 92px;
  text-shadow: 0 0 10px rgba(142, 151, 245, 0.55);
}
.bs-equip-num.green { color: var(--dash-online); background-image: url("../img/dashboard/bg/bg_indicator_g.png"); }
.bs-equip-num.amber { color: var(--dash-offline); background-image: url("../img/dashboard/bg/bg_indicator_y.png"); }

/* One-at-a-time counter flash: 1.1s flash, triggered by JS at random 5-20s intervals */
.bs-equip-num.pulse { animation: bs-num-pulse 1.1s ease-in-out; }
@keyframes bs-num-pulse {
  0%, 100% { filter: brightness(1); text-shadow: 0 0 10px rgba(142, 151, 245, 0.45); }
  8% { filter: brightness(1.5); text-shadow: 0 0 16px rgba(185, 168, 255, 0.95), 0 0 32px rgba(142, 151, 245, 0.65); }
  20% { filter: brightness(1); text-shadow: 0 0 10px rgba(142, 151, 245, 0.45); }
}
.bs-equip-title { font-size: 12px; color: rgba(198, 210, 215, 1); margin-top: 4px; }
.bs-equip-right { display: flex; flex-direction: column; gap: 5px; flex: 1; padding-left: 6px; }
.bs-equip-row { display: flex; justify-content: space-between; font-size: 12px; color: rgba(198, 210, 215, 1); }
.bs-equip-row span { margin-right: 6px; white-space: nowrap; }
/* Cards 2 & 3: labels clear the vertical divider in the card background */
.bs-equip-card:nth-child(2) .bs-equip-row span,
.bs-equip-card:nth-child(3) .bs-equip-row span { padding-left: 18px; }
.bs-equip-row b { font-family: var(--dash-num-font); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

/* Map */
.bs-map-panel { flex: 2.5; display: flex; flex-direction: column; }
.bs-bar-panel { flex: 1.7; display: flex; flex-direction: column; }
.bs-map-panel, .bs-bar-panel { min-height: 0; }
.bs-map-panel .bs-titlebar, .bs-bar-panel .bs-titlebar { flex-shrink: 0; }
.bs-map-wrap { flex: 1; min-height: 0; position: relative; }
.bs-map-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 14px 2px;
  font-size: 14px;
  color: rgba(216, 234, 242, 1);
}
.bs-map-title .num { font-family: var(--dash-num-font); font-size: 20px; font-weight: 700; color: #fff; }
.bs-map-title .num small { font-size: 12px; color: rgba(198, 210, 215, 0.8); margin-left: 4px; }
#bs-map-chart { width: 100%; height: 100%; }

/* Bar chart */
.bs-bar-wrap { flex: 1; min-height: 0; }
#bs-bar-chart { width: 100%; height: 100%; }

/* ---------- Right column: public KPI + brand narrative ---------- */
.bs-kpi { display: flex; flex-direction: column; flex: 7; }
.bs-kpi .bs-content { flex: 1; padding: 18px 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.bs-kpi-grid { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; gap: 12px; align-content: stretch; }
.bs-kpi-card {
  padding: 22px 12px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(185, 168, 255, 0.16);
  border-radius: 8px;
  background-size: cover;
}
.bs-kpi-card .v {
  font-family: var(--dash-num-font);
  font-size: 40px;
  font-weight: 700;
  background: linear-gradient(180deg, #d9d2ff 0%, #8e97f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.bs-kpi-card .v .s { font-size: 10px; color: rgba(216, 234, 242, 0.85); margin-top: 2px; line-height: 1.3; }
.bs-kpi-card .l { font-size: 13px; margin-top: 6px; color: rgba(198, 210, 215, 1); }
.bs-kpi-card .s { font-size: 10px; color: rgba(255, 255, 255, 0.45); }

/* ---------- Fluid auto-scale (v24): content tracks canvas size ----------
   Canvas ≈1920x945 at 1920x1080: 1cqmin/1cqh ≈ 9.45px. Sizes scale with the
   canvas (cqh = heights, cqmin = density) so panels and content grow together:
   no bars, no clipping, no dead space at any resolution. */
@container (min-width: 1px) {
  .bs-topbar { height: clamp(52px, 7.4cqh, 100px); margin-bottom: clamp(8px, 1.2cqh, 16px); }
  .bs-title { font-size: clamp(18px, 2.7cqmin, 36px); }
  .bs-subtitle { font-size: clamp(10px, 1.2cqmin, 15px); }
  .bs-timebar { top: 38%; }
  .bs-timebar #bs-updated { font-size: clamp(12px, 1.5cqmin, 18px); }
  .bs-timebar #bs-clock { font-size: clamp(13px, 1.6cqmin, 19px); }
  .bs-timebar .bs-utc-chip { font-size: clamp(12px, 1.5cqmin, 18px); }
  .bs-fullscreen-btn { width: clamp(30px, 3.6cqmin, 44px); height: clamp(30px, 3.6cqmin, 44px); background-size: clamp(18px, 2cqmin, 26px); }

  .bs-col-l .bs-titlebar, .bs-col-r .bs-titlebar,
  .bs-col-m .bs-titlebar { height: clamp(30px, 4cqh, 50px); padding-left: 0.9cqmin; }
  .bs-col-l .bs-tb-icon, .bs-col-r .bs-tb-icon,
  .bs-col-m .bs-tb-icon { width: clamp(22px, 3cqmin, 34px); height: clamp(22px, 3cqmin, 34px); margin-right: 0.7cqmin; }
  .bs-col-l .bs-tb-title, .bs-col-r .bs-tb-title,
  .bs-col-m .bs-tb-title { font-size: clamp(14px, 1.9cqmin, 24px); height: auto; line-height: 1.35; }
  .bs-col-l .bs-tb-right, .bs-col-r .bs-tb-right,
  .bs-col-m .bs-tb-right { font-size: clamp(11px, 1.4cqmin, 17px); padding-right: 1.5cqmin; }

  .bs-col-l .bs-device .bs-content { padding: 1.5cqh 1.7cqmin; justify-content: center; gap: 1.4cqh; }
  .bs-col-l .bs-ring-box { width: clamp(120px, 18cqmin, 230px); height: clamp(120px, 18cqmin, 230px); margin-right: 0.7cqmin; }
  .bs-col-l .bs-ring { width: clamp(92px, 13.5cqmin, 172px); height: clamp(92px, 13.5cqmin, 172px); }
  .bs-col-l .bs-ring-inner { width: clamp(84px, 12.5cqmin, 160px); height: clamp(84px, 12.5cqmin, 160px); gap: 0.5cqmin; }
  .bs-col-l .bs-ring-num { font-size: clamp(20px, 2.8cqmin, 36px); }
  .bs-col-l .bs-ring-num small { font-size: clamp(11px, 1.5cqmin, 19px); }
  .bs-col-l .bs-ring-label { font-size: clamp(11px, 1.4cqmin, 17px); margin-top: 0.6cqh; }
  .bs-col-l .bs-ring-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
    background: url("../img/dashboard/bg/bg_circular_line.png") bottom center / 100% 58% no-repeat; }
  .bs-col-l .bs-ring-legend ul { width: 100%; }
  .bs-col-l .bs-ring-legend li { padding: 0.6cqh 1.1cqmin; font-size: clamp(11px, 1.5cqmin, 18px); }
  .bs-col-l .bs-ring-legend li span { font-size: clamp(9px, 1.25cqmin, 15px); }
  .bs-col-l .bs-ring-legend li b { min-width: 6cqmin; }
  .bs-col-l .bs-offline-dist .legend { font-size: clamp(11px, 1.4cqmin, 17px); display: grid; grid-template-columns: 1fr 1fr; }
  .bs-col-l .bs-offline-dist .legend span { justify-content: center; }
  .bs-col-l .bs-dist-bar { height: clamp(30px, 5cqh, 64px); margin-top: 0.6cqh; }
  .bs-col-l .bs-dist-num { font-size: clamp(13px, 1.7cqmin, 22px); top: -2.4cqh; }

  .bs-col-l .bs-energy .bs-content { padding: 1.1cqh 1.3cqmin; gap: 0.9cqh; }
  .bs-col-l .bs-energy-grid { gap: 0.9cqh 0.9cqmin; }
  .bs-col-l .bs-en-card { gap: 0.9cqmin; padding: 1.2cqh 1.4cqmin; align-items: flex-start; }
  .bs-col-l .bs-en-icon { width: clamp(18px, 2.5cqmin, 32px); height: clamp(18px, 2.5cqmin, 32px); margin-top: 0.2cqh; }
  .bs-col-l .bs-en-title { font-size: clamp(11px, 1.4cqmin, 17px); }
  .bs-col-l .bs-en-value { font-size: clamp(14px, 1.9cqmin, 24px); }
  .bs-col-l .bs-en-value small { font-size: clamp(9px, 1.2cqmin, 14px); margin-left: 0.9cqmin; }
  .bs-col-l .bs-peak { padding: 0.9cqh 1.2cqmin; }
  .bs-col-l .bs-peak .lbl { font-size: clamp(11px, 1.4cqmin, 17px); }
  .bs-col-l .bs-peak .val { font-size: clamp(15px, 2.3cqmin, 28px); }
  .bs-col-l .bs-peak .val small { font-size: clamp(9px, 1.3cqmin, 15px); }

  .bs-col-r .bs-kpi .bs-content { padding: 1.7cqh 1.7cqmin; gap: 1.4cqh; }
  .bs-col-r .bs-kpi-grid { gap: 1.1cqh 1.1cqmin; }
  .bs-col-r .bs-kpi-card { padding: 1.5cqh 1.3cqmin; min-width: 0; min-height: 0; overflow: hidden; }
  .bs-col-r .bs-kpi-card .v { font-size: clamp(22px, 1.9cqw, 52px); }
  .bs-col-r .bs-kpi-card .v .s { font-size: clamp(8px, 1.1cqmin, 13px); margin-top: 0.3cqh; }
  .bs-col-r .bs-kpi-card .l { font-size: clamp(11px, 1.5cqmin, 20px); margin-top: 0.6cqh; }
  .bs-col-r .bs-kpi-card .s { font-size: clamp(9px, 1.2cqmin, 14px); }

  .bs-col-r .bs-grid .bs-content { padding: 1.5cqh 1.5cqmin; }
  .bs-col-r .bs-power-row { gap: 1.1cqmin; }
  .bs-col-r .bs-power-card { padding: 1.8cqh 1.1cqmin; min-width: 0; }
  .bs-col-r .bs-power-card .t { font-size: clamp(11px, 1.4cqmin, 17px); white-space: normal; line-height: 1.2; }
  .bs-col-r .bs-power-card .u { font-size: clamp(8px, 1.1cqmin, 12px); }
  .bs-col-r .bs-power-card .v { font-size: clamp(15px, 1.4cqw, 36px); }
  .bs-col-r .bs-power-mid { width: clamp(52px, 8cqmin, 110px); height: clamp(52px, 8cqmin, 110px); }
  .bs-col-r .bs-power-icon { width: clamp(36px, 5.5cqmin, 74px); }
  .bs-col-r .bs-peak { padding: 0.9cqh 1.2cqmin; }
  .bs-col-r .bs-peak .lbl { font-size: clamp(11px, 1.4cqmin, 17px); }
  .bs-col-r .bs-peak .val { font-size: clamp(15px, 2.3cqmin, 28px); }
  .bs-col-r .bs-peak .val small { font-size: clamp(9px, 1.3cqmin, 15px); }

  .bs-col-m .bs-equip { height: clamp(52px, 7.4cqh, 110px); gap: 1.2cqh; margin-bottom: 0.9cqh; }
  .bs-col-m .bs-equip-card { height: 100%; padding: 0 0.9cqmin; min-width: 0; }
  .bs-col-m .bs-equip-left { padding-right: 0.8cqmin; }
  .bs-col-m .bs-equip-num { font-size: clamp(14px, 1.9cqmin, 26px); line-height: clamp(26px, 3.8cqh, 52px); min-width: clamp(64px, 9.3cqmin, 130px); background-size: clamp(64px, 9.3cqmin, 130px) clamp(28px, 4.2cqh, 58px); }
  .bs-col-m .bs-equip-title { font-size: clamp(10px, 1.3cqmin, 17px); margin-top: 0.3cqh; }
  .bs-col-m .bs-equip-right { gap: 0.5cqh; padding-left: 0.7cqmin; }
  .bs-col-m .bs-equip-row { font-size: clamp(10px, 1.3cqmin, 17px); }
  .bs-col-m .bs-map-title { font-size: clamp(11px, 1.5cqmin, 19px); }
  .bs-col-m .bs-map-title .num { font-size: clamp(14px, 2.1cqmin, 26px); }
}

/* ---------- Mobile fallback (no big-screen canvas) ---------- */
@media (max-width: 1024px) {
  .bigscreen-canvas { container-type: none; }
  .bs-equip { flex-wrap: wrap; height: auto; gap: 8px; }
  .bs-equip-card { height: 76px; min-width: calc(50% - 4px); }
  .bs-power-row { flex: none; gap: 6px; }
  .bs-power-mid { width: 56px; height: 56px; }
  .bs-power-icon { width: 38px; }
  .bs-power-card { padding: 16px 6px; }
  .bs-power-card .t { font-size: 11px; }
  .bs-power-card .v { font-size: 24px; }
}

@media (max-width: 480px) {
  .bs-equip { flex-direction: column; }
  .bs-equip-card { width: 100%; min-width: 0; height: 68px; }
}

@media (max-width: 1024px) {
  .bigscreen-stage {
    height: auto;
    min-height: 0;
    padding: 84px 16px 20px;
    overflow: visible;
  }
  .bigscreen-canvas {
    position: static;
    width: 100%;
    height: auto;
    transform: none;
    opacity: 1;
    background: transparent;
    gap: 12px;
    /* Mobile: drop container-query sizing so cqh/cqmin fall back to viewport
       units and the canvas takes its natural content height instead of 0. */
    container-type: normal;
    min-height: 0;
    overflow: visible;
  }
  .bs-topbar, .bs-middle, .bs-col, .bs-col-l, .bs-col-m, .bs-col-r {
    width: 100%;
    margin: 0;
    height: auto;
  }
  .bs-topbar {
    height: auto;
    padding: 16px 12px 8px;
    position: relative;
  }
  .bs-title { font-size: 22px; line-height: 28px; letter-spacing: 1px; }
  .bs-subtitle { font-size: 11px; letter-spacing: 2px; margin-top: 4px; }
  .bs-timebar {
    position: static;
    margin-top: 6px;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-size: 12px;
  }
  .bs-timebar #bs-updated, .bs-timebar #bs-clock { font-size: 12px; }
  /* Mobile: keep the ops title tight — 1 line of time, no decorative subtitle. */
  .bs-subtitle { display: none; }
  .bs-middle { flex-direction: column; background: none; padding: 0; }
  .bs-panel { margin-bottom: 12px; }
  .bs-device, .bs-energy, .bs-power, .bs-kpi { height: auto; }
  .bs-col-r .bs-panel { height: auto; }
  .bs-ring-wrap { flex-wrap: wrap; }
  .bs-ring-box { margin: 0 auto 8px; }
  .bs-ring-legend { width: 100%; max-width: 260px; margin: 0 auto; }
  .bs-ring-legend li { padding: 4px 8px; }
  .bs-offline-dist { margin-top: 14px; }
  .bs-dist-bar { margin-top: 14px; }
  .bs-en-card { padding: 8px 10px; }
  .bs-en-value { font-size: 15px; }
  .bs-dist-bar { height: 30px; }
  .bs-dist-seg .seg-num { font-size: 14px; }
  .bs-kpi-grid { grid-template-columns: 1fr 1fr; }
  .bs-map-wrap { height: 340px; flex: none; }
  #bs-map-chart { height: 100%; }
  .bs-bar-wrap { height: 240px; flex: none; }
  #bs-bar-chart { height: 100%; }
  .bs-fullscreen-btn { display: none; }
  /* Direction A (mobile): fold the ops big-screen down to a lean "map + global
     footprint" block. Hide the secondary panels a field-ops viewer would get
     no value from on a phone, so the value prop + CTA above stay primary. */
  .bs-col-l { display: none; }
  .bs-equip { display: none; }
  .bs-bar-panel { display: none; }
  .bs-grid { display: none; }
  /* Keep panel titles on one readable line on small screens; the right-side
     count label shrinks so long titles never clip. */
  .bs-titlebar .bs-tb-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .bs-titlebar .bs-tb-right {
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 8px;
  }
}
