/* ==========================================================================
   Smart Elevator 365 — Lift Monitoring Centre demo
   Fixed 1920x1080 stage, scaled to fit any screen / projector.
   ========================================================================== */

/* Barlow (SIL OFL 1.1, see assets/fonts/OFL.txt) — used where Bahnschrift / Segoe UI are not installed */
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/barlow-semi-condensed-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/barlow-semi-condensed-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/barlow-semi-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/barlow-semi-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/barlow-600.woff2') format('woff2'); }

:root {
  --bg0: #020814;
  --bg1: #061226;
  --bg2: #0a1b36;
  --panel: rgba(8, 22, 46, 0.80);
  --panel-solid: #0a1a35;
  --panel-hi: rgba(20, 48, 92, 0.55);
  --border: rgba(64, 145, 255, 0.24);
  --border-hi: rgba(64, 190, 255, 0.55);
  --line: rgba(120, 170, 255, 0.10);
  --text: #e8f1ff;
  --text-dim: #93acd0;
  --text-mute: #5f7aa0;
  --cyan: #2fd4ff;
  --blue: #3d8bff;
  --green: #22d982;
  --brand-green: #3ccf4e;
  --amber: #ffb224;
  --red: #ff4b5c;
  --violet: #a98bff;
  --pink: #ff6bd5;
  --num: 'Bahnschrift SemiCondensed', 'Bahnschrift', 'Barlow Semi Condensed', 'Segoe UI', Arial, sans-serif;
  --ui: 'Segoe UI', 'Barlow', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #01050d; }
body { font-family: var(--ui); color: var(--text); -webkit-font-smoothing: antialiased; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  overflow: hidden; overflow: clip;
  background:
    radial-gradient(1200px 700px at 50% 45%, rgba(18, 60, 130, 0.35), transparent 70%),
    radial-gradient(900px 500px at 85% 100%, rgba(0, 140, 200, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}
#stage::before { /* faint tech grid */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(80, 140, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 140, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ topbar */
#topbar {
  position: absolute; left: 0; right: 0; top: 0; height: 62px; z-index: 20;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: linear-gradient(180deg, rgba(6, 20, 44, 0.95), rgba(4, 14, 32, 0.85));
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
#topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: 0.55;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand svg { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgba(47, 212, 255, 0.55)); }
.brand .word { font-family: var(--num); font-size: 27px; font-weight: 700; letter-spacing: 0.2px; }
.brand .word b { color: var(--brand-green); font-weight: 700; }
.brand .word i { font-style: normal; color: #fff; }
.tb-sep { width: 1px; height: 34px; background: var(--border); }
.tb-title { display: flex; flex-direction: column; line-height: 1.15; }
.tb-title .t1 { font-family: var(--num); font-weight: 700; font-size: 17px; letter-spacing: 1.4px; color: #7cc4ff; text-transform: uppercase; }
.tb-title .t2 { font-size: 12px; color: var(--text-mute); letter-spacing: 0.4px; }
.crumbs { display: flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 13px; color: var(--text-dim); }
.crumbs .c { padding: 5px 10px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; transition: all .2s; }
.crumbs .c:hover { border-color: var(--border); color: var(--text); }
.crumbs .c.on { color: var(--cyan); border-color: rgba(47, 212, 255, 0.35); background: rgba(47, 212, 255, 0.08); }
.crumbs .arrow { color: var(--text-mute); }
.tb-spacer { flex: 1; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.seg button { padding: 6px 14px; font-size: 12.5px; color: var(--text-dim); }
.seg button.on { background: linear-gradient(180deg, #1e6fe0, #1553b5); color: #fff; }
.live { display: flex; align-items: center; gap: 7px; font-family: var(--num); font-size: 14px; font-weight: 700; color: var(--green); letter-spacing: 1px; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s infinite; }
.clock { text-align: right; line-height: 1.2; font-family: var(--num); }
.clock .d { font-size: 12px; color: var(--text-dim); }
.clock .t { font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.eita-chip { background: rgba(255, 255, 255, 0.96); border-radius: 6px; padding: 4px 12px; display: flex; align-items: center; height: 40px; }
.eita-chip img { height: 29px; display: block; }

@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* -------------------------------------------------------------------- views */
.view {
  position: absolute; left: 0; right: 0; top: 62px; bottom: 0;
  padding: 14px 16px 14px;
  opacity: 0; pointer-events: none; transform: scale(1.03);
  transition: opacity .55s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.view.on { opacity: 1; pointer-events: auto; transform: none; }
.view.leaving { opacity: 0; transform: scale(0.97); }

.kpis { display: grid; gap: 12px; height: 88px; margin-bottom: 12px; }
.kpis.k6 { grid-template-columns: repeat(6, 1fr); }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }

.kpi {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(14, 36, 72, 0.85), rgba(7, 20, 42, 0.85));
  border: 1px solid var(--border); border-radius: 7px; overflow: hidden;
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--cyan)); box-shadow: 0 0 12px var(--accent, var(--cyan)); }
.kpi .ic { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(47, 212, 255, 0.22), rgba(47, 212, 255, 0.04));
  border: 1px solid rgba(47, 212, 255, 0.35); color: var(--accent, var(--cyan)); }
.kpi .ic svg { width: 24px; height: 24px; }
.kpi .body { flex: 1; min-width: 0; }
.kpi .lbl { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.kpi .val { font-family: var(--num); font-size: 33px; font-weight: 600; line-height: 1.05; white-space: nowrap; letter-spacing: 0.3px; }
.kpi .val small { font-size: 16px; color: var(--text-dim); font-weight: 500; margin-left: 3px; }
.kpi .sub { font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.kpi .sub .up { color: var(--green); } .kpi .sub .dn { color: var(--red); }
.kpi .spark { width: 64px; height: 34px; flex: none; }
.kpi.status { background: linear-gradient(180deg, rgba(14, 90, 56, 0.55), rgba(6, 40, 30, 0.6)); border-color: rgba(34, 217, 130, 0.45); }
.kpi.status.warn { background: linear-gradient(180deg, rgba(110, 72, 10, 0.55), rgba(50, 32, 6, 0.6)); border-color: rgba(255, 178, 36, 0.5); }
.kpi.status.crit { background: linear-gradient(180deg, rgba(120, 18, 30, 0.6), rgba(60, 8, 14, 0.6)); border-color: rgba(255, 75, 92, 0.6); animation: critglow 1.2s infinite; }
@keyframes critglow { 50% { box-shadow: 0 0 22px rgba(255, 75, 92, 0.55) inset; } }
.kpi .st-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #032; flex: none; box-shadow: 0 0 14px var(--green); }
.kpi.warn .st-ic { background: var(--amber); box-shadow: 0 0 14px var(--amber); }
.kpi.crit .st-ic { background: var(--red); box-shadow: 0 0 14px var(--red); color: #fff; }
.kpi .st-txt { font-family: var(--num); font-size: 25px; font-weight: 700; letter-spacing: 1px; color: var(--green); }
.kpi.warn .st-txt { color: var(--amber); } .kpi.crit .st-txt { color: #ff8a95; }

.grid3 { display: grid; gap: 12px; height: calc(100% - 100px); }
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 7px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(120, 180, 255, 0.06);
}
.panel::before, .panel::after { content: ''; position: absolute; width: 12px; height: 12px; pointer-events: none; }
.panel::before { left: -1px; top: -1px; border-left: 2px solid var(--cyan); border-top: 2px solid var(--cyan); border-top-left-radius: 7px; opacity: 0.8; }
.panel::after { right: -1px; bottom: -1px; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); border-bottom-right-radius: 7px; opacity: 0.5; }
.panel-h { display: flex; align-items: center; gap: 9px; padding: 11px 14px 8px; flex: none; }
.panel-h .ttl { font-family: var(--num); font-size: 16.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.panel-h .ttl small { display: block; font-family: var(--ui); font-size: 11px; font-weight: 400; color: var(--text-mute); letter-spacing: 0.3px; text-transform: none; }
.panel-h .ico { width: 20px; height: 20px; color: var(--cyan); flex: none; }
.panel-h .r { margin-left: auto; font-size: 12px; color: var(--text-mute); display: flex; gap: 6px; align-items: center; }
.panel-b { padding: 0 14px 12px; flex: 1; min-height: 0; position: relative; }
.pill-sel { border: 1px solid var(--border); border-radius: 4px; padding: 3px 8px; font-size: 11.5px; color: var(--text-dim); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; }
.b-ok { background: rgba(34, 217, 130, 0.16); color: #4ff0a2; border: 1px solid rgba(34, 217, 130, 0.45); }
.b-watch { background: rgba(255, 178, 36, 0.16); color: #ffc65a; border: 1px solid rgba(255, 178, 36, 0.5); }
.b-crit { background: rgba(255, 75, 92, 0.18); color: #ff8592; border: 1px solid rgba(255, 75, 92, 0.6); }
.b-maint { background: rgba(169, 139, 255, 0.16); color: #c3b0ff; border: 1px solid rgba(169, 139, 255, 0.5); }
.b-off { background: rgba(120, 140, 170, 0.14); color: #9fb0c8; border: 1px solid rgba(120, 140, 170, 0.4); }
.b-info { background: rgba(47, 212, 255, 0.14); color: #7fe3ff; border: 1px solid rgba(47, 212, 255, 0.45); }
.badge.solid.b-ok { background: #17b56c; color: #fff; border-color: #17b56c; }
.badge.solid.b-watch { background: #e39a12; color: #1c1200; border-color: #e39a12; }
.badge.solid.b-crit { background: #e23447; color: #fff; border-color: #e23447; }
.dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* bars */
.bar { height: 6px; background: rgba(120, 160, 220, 0.14); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #17b56c, #3cf0a0); transition: width .8s ease; }
.bar.watch > i { background: linear-gradient(90deg, #d98a0b, #ffc65a); }
.bar.crit > i { background: linear-gradient(90deg, #c4202f, #ff6a78); }
.bar.cyan > i { background: linear-gradient(90deg, #1667d9, #2fd4ff); }

/* =============================================================== FLEET VIEW */
#view-fleet .grid3 { grid-template-columns: 432px 1fr 430px; }
.site-list { display: flex; flex-direction: column; gap: 7px; overflow: hidden; height: 100%; }
.site {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 7px 11px 7px 13px; cursor: pointer; flex: none;
  border: 1px solid rgba(64, 145, 255, 0.16); border-radius: 6px; background: rgba(12, 32, 64, 0.55);
  position: relative; transition: all .2s;
}
.site::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--sc, var(--green)); box-shadow: 0 0 8px var(--sc, var(--green)); }
.site:hover, .site.hl { border-color: var(--border-hi); background: rgba(22, 56, 108, 0.65); transform: translateX(3px); }
.site .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site .loc { font-size: 10.5px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site > .badge { align-self: center; }
.site .mets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 3px; }
.site .m .k { font-size: 10px; color: var(--text-mute); white-space: nowrap; }
.site .m .v { font-family: var(--num); font-size: 16px; font-weight: 600; line-height: 1.1; }
.site .m .v small { font-size: 11px; color: var(--text-dim); margin-left: 1px; }

.map-wrap { position: relative; padding: 0; }
.map-wrap > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-legend { position: absolute; top: 12px; right: 14px; display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); z-index: 3; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-head { position: absolute; left: 14px; top: 10px; z-index: 3; display: flex; gap: 9px; align-items: flex-start; }
.map-head .ttl { font-family: var(--num); font-weight: 700; font-size: 18px; letter-spacing: 0.6px; }
.map-head .ttl small { display: block; font-family: var(--ui); font-weight: 400; font-size: 11px; color: var(--text-mute); letter-spacing: 0; }
.overlay-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.map-label {
  position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer;
  padding: 4px 8px 5px; white-space: nowrap;
  background: rgba(4, 14, 32, 0.86); border: 1px solid var(--lc, rgba(34, 217, 130, 0.65)); border-radius: 4px; border-left-width: 3px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.5), 0 0 10px color-mix(in srgb, var(--lc, #22d982) 30%, transparent);
  transition: transform .15s, box-shadow .2s;
}
.map-label:hover { transform: translate(-50%, -100%) scale(1.06); z-index: 5; }
.map-label .nm { font-size: 12px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.map-label .nm .badge { margin-left: auto; font-size: 9.5px; padding: 0 6px; }
.map-label .ln { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; margin-top: 1px; }
.map-label .ln b { font-family: var(--num); font-size: 12.5px; color: var(--text); font-weight: 600; }
.map-label.hl { box-shadow: 0 0 22px color-mix(in srgb, var(--lc, #22d982) 70%, transparent); z-index: 6; }
.map-label .stem { position: absolute; left: 50%; top: 100%; width: 1px; background: linear-gradient(var(--lc, #22d982), transparent); }
.map-label.crit { animation: labelcrit 1s infinite; }
@keyframes labelcrit { 50% { box-shadow: 0 0 26px rgba(255, 75, 92, 0.9); } }

.donut-row { display: flex; align-items: center; gap: 16px; }
.donut-legend { flex: 1; display: grid; gap: 6px; }
.donut-legend .r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.donut-legend .r b { margin-left: auto; font-family: var(--num); font-size: 17px; color: var(--text); font-weight: 600; }

.ai-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ai-item:last-child { border-bottom: 0; }
.ai-item .ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(169, 139, 255, 0.14); color: var(--violet); border: 1px solid rgba(169, 139, 255, 0.35); }
.ai-item .ic svg { width: 19px; height: 19px; }
.ai-item .t { font-size: 13px; font-weight: 600; }
.ai-item .s { font-size: 11.5px; color: var(--text-dim); grid-column: 2 / 3; }
.ai-item .rul { text-align: right; grid-row: 1 / 3; grid-column: 3; }
.ai-item .rul .v { font-family: var(--num); font-size: 21px; font-weight: 700; color: var(--amber); line-height: 1; }
.ai-item .rul .k { font-size: 10px; color: var(--text-mute); }

.alarm { display: grid; grid-template-columns: 22px 1fr auto; gap: 1px 9px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: start; }
.alarm:last-child { border-bottom: 0; }
.alarm .sv { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.alarm .sv.crit { background: var(--red); color: #fff; box-shadow: 0 0 10px var(--red); }
.alarm .sv.watch { background: var(--amber); color: #201400; }
.alarm .sv.info { background: var(--blue); color: #fff; }
.alarm .t { font-size: 12.5px; font-weight: 600; }
.alarm .s { font-size: 11px; color: var(--text-dim); grid-column: 2 / 3; }
.alarm .tm { font-size: 10.5px; color: var(--text-mute); text-align: right; white-space: nowrap; }
.alarm.new { animation: flashin 1.4s ease; }
@keyframes flashin { 0% { background: rgba(255, 75, 92, 0.35); } 100% { background: transparent; } }

/* ============================================================ BUILDING VIEW */
#view-building .grid3 { grid-template-columns: 400px 1fr 520px; }
.b-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.b-hero .bi { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(47, 212, 255, 0.25), rgba(61, 139, 255, 0.08)); border: 1px solid var(--border-hi); color: var(--cyan); }
.b-hero .bi svg { width: 30px; height: 30px; }
.b-hero .nm { font-family: var(--num); font-size: 22px; font-weight: 700; }
.b-hero .ad { font-size: 11.5px; color: var(--text-mute); }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.spec .c { background: rgba(14, 36, 72, 0.6); border: 1px solid rgba(64, 145, 255, 0.15); border-radius: 5px; padding: 6px 9px; }
.spec .k { font-size: 10.5px; color: var(--text-mute); }
.spec .v { font-family: var(--num); font-size: 18px; font-weight: 600; }
.spec .v small { font-size: 11px; color: var(--text-dim); }
.mini-h { font-family: var(--num); font-size: 13.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: #8cc8ff; margin: 6px 0 6px; display: flex; align-items: center; gap: 8px; }
.mini-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

.twin-wrap { padding: 0; }
.twin-wrap > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.twin-tools { position: absolute; left: 14px; bottom: 12px; z-index: 3; display: flex; gap: 8px; }
.tbtn { padding: 6px 12px; font-size: 12px; border: 1px solid var(--border); border-radius: 5px; background: rgba(6, 20, 44, 0.8); color: var(--text-dim); }
.tbtn:hover, .tbtn.on { border-color: var(--border-hi); color: var(--cyan); }
.car-tag {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  font-family: var(--num); font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
  background: rgba(4, 16, 36, 0.85); border: 1px solid var(--tc, var(--cyan)); color: var(--text);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tc, #2fd4ff) 45%, transparent);
}
.car-tag .ar { color: var(--tc, var(--cyan)); }
.shaft-tag { position: absolute; transform: translate(-50%, -100%); font-family: var(--num); font-size: 13px; font-weight: 700; color: #8cc8ff; text-shadow: 0 0 8px rgba(47, 212, 255, 0.8); }
.floor-tag { position: absolute; transform: translate(-100%, -50%); font-family: var(--num); font-size: 10.5px; color: rgba(140, 190, 255, 0.55); }

.lift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lcard {
  position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 9px 10px; cursor: pointer;
  border: 1px solid rgba(64, 145, 255, 0.2); border-radius: 6px; background: rgba(10, 28, 58, 0.7); transition: all .2s;
}
.lcard:hover { border-color: var(--border-hi); background: rgba(20, 50, 100, 0.7); }
.lcard.warn { border-color: rgba(255, 178, 36, 0.55); }
.lcard.crit { border-color: rgba(255, 75, 92, 0.75); animation: critglow 1.2s infinite; }
.lcard .disp {
  background: #01060f; border: 1px solid rgba(64, 145, 255, 0.25); border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9);
}
.lcard .disp .fl { font-family: var(--num); font-size: 36px; font-weight: 700; color: #ff9b2f; text-shadow: 0 0 12px rgba(255, 140, 30, 0.85); line-height: 1; }
.lcard .disp .dir { height: 16px; color: #ff9b2f; filter: drop-shadow(0 0 5px rgba(255, 140, 30, 0.9)); }
.lcard .disp .dir svg { width: 16px; height: 16px; }
.lcard .disp .dir.up svg { animation: arrowUp 1s infinite; } .lcard .disp .dir.dn svg { animation: arrowDn 1s infinite; }
@keyframes arrowUp { 0% { transform: translateY(4px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-4px); opacity: 0; } }
@keyframes arrowDn { 0% { transform: translateY(-4px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(4px); opacity: 0; } }
.lcard .top { display: flex; align-items: center; gap: 6px; }
.lcard .top .id { font-family: var(--num); font-weight: 700; font-size: 16px; }
.lcard .top .badge { margin-left: auto; font-size: 10px; }
.lcard .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 5px; }
.lcard .row .k { font-size: 9.5px; color: var(--text-mute); white-space: nowrap; }
.lcard .row .v { font-family: var(--num); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.lcard .bar { margin-top: 6px; height: 4px; }
.lcard .mode { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; display: flex; gap: 6px; align-items: center; }

.chart-box { position: relative; height: 120px; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ================================================================ LIFT VIEW */
#view-lift .grid3 { grid-template-columns: 410px 1fr 470px; }
.tabs { display: flex; gap: 2px; margin-left: 20px; }
.tabs button { padding: 5px 11px; font-size: 12px; color: var(--text-dim); border-radius: 4px; white-space: nowrap; }
.tabs button.on { background: linear-gradient(180deg, #1e6fe0, #1553b5); color: #fff; }
.tele { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tele .c { background: rgba(12, 32, 64, 0.6); border: 1px solid rgba(64, 145, 255, 0.16); border-radius: 6px; padding: 7px 10px; position: relative; overflow: hidden; }
.tele .c .k { font-size: 11px; color: var(--text-mute); display: flex; align-items: center; gap: 5px; }
.tele .c .k svg { width: 13px; height: 13px; color: var(--cyan); }
.tele .c .v { font-family: var(--num); font-size: 24px; font-weight: 600; line-height: 1.15; }
.tele .c .v small { font-size: 12px; color: var(--text-dim); margin-left: 2px; }
.tele .c.wide { grid-column: 1 / -1; }
.tele .c .bar { margin-top: 4px; height: 4px; }
.tele .c.alert { border-color: rgba(255, 178, 36, 0.6); background: rgba(80, 52, 6, 0.45); }
.tele .c.alert .v { color: #ffc65a; }

.big-floor { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 9px; border: 1px solid var(--border); border-radius: 7px; background: linear-gradient(90deg, rgba(1, 6, 15, 0.95), rgba(8, 22, 46, 0.6)); }
.big-floor .fl { font-family: var(--num); font-size: 62px; font-weight: 700; color: #ff9b2f; text-shadow: 0 0 18px rgba(255, 140, 30, 0.9); line-height: 0.9; min-width: 86px; text-align: center; }
.big-floor .dir svg { width: 34px; height: 34px; color: #ff9b2f; filter: drop-shadow(0 0 8px rgba(255, 140, 30, 0.9)); }
.big-floor .dir.up svg { animation: arrowUp 1s infinite; } .big-floor .dir.dn svg { animation: arrowDn 1s infinite; }
.big-floor .meta { margin-left: auto; text-align: right; }
.big-floor .meta .k { font-size: 11px; color: var(--text-mute); }
.big-floor .meta .v { font-family: var(--num); font-size: 18px; font-weight: 600; }

.gauge-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.gauge { text-align: center; }
.gauge svg { width: 100%; height: 92px; display: block; }
.gauge .k { font-size: 10.5px; color: var(--text-mute); margin-top: -4px; }

.comp { display: grid; grid-template-columns: 30px 1fr 64px; gap: 3px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.comp:last-child { border-bottom: 0; }
.comp .ic { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: rgba(47, 212, 255, 0.1); color: var(--cyan); grid-row: 1 / 3; border: 1px solid rgba(47, 212, 255, 0.25); }
.comp .ic svg { width: 17px; height: 17px; }
.comp .n { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; }
.comp .n span { font-family: var(--num); font-weight: 600; font-size: 14px; }
.comp .bar { grid-column: 2; }
.comp .rul { grid-row: 1 / 3; grid-column: 3; text-align: right; }
.comp .rul .v { font-family: var(--num); font-size: 17px; font-weight: 700; line-height: 1; }
.comp .rul .k { font-size: 9.5px; color: var(--text-mute); }
.comp.watch .ic { background: rgba(255, 178, 36, 0.14); color: var(--amber); border-color: rgba(255, 178, 36, 0.4); }
.comp.crit .ic { background: rgba(255, 75, 92, 0.16); color: var(--red); border-color: rgba(255, 75, 92, 0.5); }

.ai-card { border: 1px solid rgba(169, 139, 255, 0.45); border-radius: 7px; padding: 9px 11px; background: linear-gradient(135deg, rgba(80, 50, 170, 0.28), rgba(20, 20, 60, 0.3)); margin-top: 8px; position: relative; overflow: hidden; }
.ai-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(200, 180, 255, 0.10) 50%, transparent 70%); animation: sheen 3.5s infinite; }
@keyframes sheen { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.ai-card .h { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #c9b8ff; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.ai-card .h svg { width: 16px; height: 16px; }
.ai-card .msg { font-size: 12.5px; margin-top: 5px; line-height: 1.45; color: #e3dcff; }
.ai-card .msg b { color: #fff; }
.ai-card .acts { display: flex; gap: 7px; margin-top: 8px; position: relative; z-index: 2; }
.ai-card .acts button { font-size: 11.5px; padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(169, 139, 255, 0.6); color: #e3dcff; }
.ai-card .acts button.pri { background: #6d4ae0; border-color: #6d4ae0; color: #fff; }

.hotspot {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  display: flex; align-items: center; gap: 0;
}
.hotspot .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--hc, var(--cyan)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hc, #2fd4ff) 25%, transparent), 0 0 14px var(--hc, var(--cyan)); flex: none; }
.hotspot .dot::after { content: ''; position: absolute; left: 0; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 1px solid var(--hc, var(--cyan)); animation: ring 2s infinite; }
@keyframes ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }
.hotspot .ln { width: 34px; height: 1px; background: var(--hc, var(--cyan)); opacity: 0.8; }
.hotspot .box { background: rgba(4, 16, 36, 0.9); border: 1px solid var(--hc, var(--cyan)); border-radius: 5px; padding: 4px 8px; white-space: nowrap; box-shadow: 0 0 12px color-mix(in srgb, var(--hc, #2fd4ff) 35%, transparent); }
.hotspot .box .k { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.hotspot .box .v { font-family: var(--num); font-size: 15px; font-weight: 600; }
.hotspot.left { flex-direction: row-reverse; }

.fault-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: center; }
.fault-row .code { font-family: var(--num); font-weight: 700; font-size: 13px; color: var(--amber); background: rgba(255, 178, 36, 0.1); border: 1px solid rgba(255, 178, 36, 0.35); border-radius: 4px; text-align: center; padding: 1px 0; }
.fault-row .code.crit { color: #ff8592; background: rgba(255, 75, 92, 0.1); border-color: rgba(255, 75, 92, 0.45); }
.fault-row .d { color: var(--text-dim); }
.fault-row .d b { color: var(--text); font-weight: 600; display: block; }
.fault-row .tm { color: var(--text-mute); font-size: 11px; text-align: right; }

/* ================================================================== OVERLAYS */
#alert-banner {
  position: absolute; left: 50%; top: 74px; transform: translate(-50%, -24px); z-index: 40; opacity: 0; visibility: hidden; pointer-events: none;
  min-width: 860px; padding: 12px 18px; display: flex; align-items: center; gap: 16px;
  background: linear-gradient(90deg, rgba(150, 14, 30, 0.96), rgba(210, 30, 50, 0.96), rgba(150, 14, 30, 0.96));
  border: 1px solid #ff8592; border-radius: 8px; box-shadow: 0 0 50px rgba(255, 40, 60, 0.6);
  transition: transform .5s cubic-bezier(.2, .9, .3, 1.2), opacity .35s, visibility .35s;
}
#alert-banner.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
#alert-banner .ic { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #d61f35; display: grid; place-items: center; animation: blink 0.8s infinite; flex: none; }
#alert-banner .ic svg { width: 28px; height: 28px; }
#alert-banner .t { font-family: var(--num); font-size: 22px; font-weight: 700; letter-spacing: 1px; }
#alert-banner .s { font-size: 13.5px; color: #ffe1e4; }
#alert-banner .go { margin-left: auto; padding: 8px 16px; background: #fff; color: #b3172a; font-weight: 700; border-radius: 5px; font-size: 13px; }
#stage.alerting::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 30; box-shadow: inset 0 0 160px rgba(255, 30, 50, 0.55); animation: blink 1.2s infinite; }

#toasts { position: absolute; right: 18px; top: 76px; z-index: 35; display: flex; flex-direction: column; gap: 9px; width: 360px; }
.toast {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 12px; border-radius: 7px;
  background: rgba(8, 24, 50, 0.96); border: 1px solid var(--border-hi); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn .45s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.out { animation: toastOut .4s forwards; }
.toast .ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: rgba(47, 212, 255, 0.15); color: var(--cyan); }
.toast .ic svg { width: 20px; height: 20px; }
.toast.crit { border-color: rgba(255, 75, 92, 0.8); } .toast.crit .ic { background: rgba(255, 75, 92, 0.2); color: var(--red); }
.toast.ok { border-color: rgba(34, 217, 130, 0.7); } .toast.ok .ic { background: rgba(34, 217, 130, 0.18); color: var(--green); }
.toast.ai { border-color: rgba(169, 139, 255, 0.8); } .toast.ai .ic { background: rgba(169, 139, 255, 0.2); color: var(--violet); }
.toast .t { font-size: 13px; font-weight: 700; }
.toast .s { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.35; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* phone mock (notification channels) */
#phone {
  position: absolute; right: 30px; bottom: 26px; z-index: 36; width: 300px; height: 560px;
  border-radius: 38px; background: #0b0f14; border: 3px solid #2a3442; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 0 9px #0d131b;
  transform: translateY(120%); transition: transform .6s cubic-bezier(.2, .9, .3, 1.1); overflow: hidden;
}
#phone.on { transform: none; }
#phone .notch { position: absolute; left: 50%; top: 8px; width: 92px; height: 22px; border-radius: 12px; background: #000; transform: translateX(-50%); z-index: 3; }
#phone .scr { position: absolute; inset: 0; padding: 40px 12px 14px; background: linear-gradient(180deg, #0f1c2a, #0a1520); display: flex; flex-direction: column; }
#phone .app-h { display: flex; align-items: center; gap: 9px; padding: 6px 4px 10px; border-bottom: 1px solid #1d2a38; }
#phone .app-h .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1e6fe0, #2fd4ff); display: grid; place-items: center; }
#phone .app-h .av svg { width: 20px; height: 20px; color: #fff; }
#phone .app-h .n { font-size: 13.5px; font-weight: 700; } #phone .app-h .st { font-size: 10.5px; color: #6fd19a; }
#phone .msgs { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; justify-content: flex-end; }
#phone .msg { background: #1b2b3c; border-radius: 10px 10px 10px 3px; padding: 8px 10px; font-size: 11.5px; line-height: 1.4; max-width: 92%; animation: toastIn .4s; color: #dfe9f5; }
#phone .msg b { color: #fff; } #phone .msg .tm { font-size: 9.5px; color: #7f93aa; text-align: right; margin-top: 3px; }
#phone .msg.alert { border-left: 3px solid var(--red); }
#phone .msg.ok { border-left: 3px solid var(--green); }
#phone .chan { display: flex; gap: 6px; justify-content: center; padding-top: 8px; }
#phone .chan span { font-size: 9.5px; padding: 3px 7px; border-radius: 9px; background: #16283a; color: #8fb3d9; }
#phone .chan span.on { background: #1e6fe0; color: #fff; }

/* demo control panel */
#demo-btn { position: absolute; left: 16px; bottom: 14px; z-index: 45; width: 34px; height: 34px; border-radius: 50%; opacity: 0.25; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-dim); transition: opacity .2s; }
#demo-btn:hover { opacity: 1; }
#demo-btn svg { width: 18px; height: 18px; }
#demo-panel {
  position: absolute; left: 16px; bottom: 56px; z-index: 45; width: 330px; padding: 12px; border-radius: 9px;
  background: rgba(6, 18, 40, 0.97); border: 1px solid var(--border-hi); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: none;
}
#demo-panel.on { display: block; }
#demo-panel h4 { font-family: var(--num); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: #8cc8ff; margin-bottom: 8px; }
#demo-panel button.sc { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
#demo-panel button.sc:hover { border-color: var(--border-hi); background: rgba(47, 212, 255, 0.07); }
#demo-panel button.sc kbd { margin-left: auto; font-family: var(--num); font-size: 11px; color: var(--text-mute); border: 1px solid var(--border); border-radius: 3px; padding: 0 5px; }
#demo-panel .row { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* transitions: scanning sweep when switching views */
#sweep { position: absolute; inset: 62px 0 0 0; z-index: 25; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent, rgba(47, 212, 255, 0.12) 48%, rgba(47, 212, 255, 0.5) 50%, transparent 52%); background-size: 100% 300%; }
#sweep.go { animation: sweep .9s ease; }
@keyframes sweep { 0% { opacity: 1; background-position: 0 100%; } 100% { opacity: 1; background-position: 0 0%; } }

.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.c-green { color: var(--green); } .c-amber { color: var(--amber); } .c-red { color: var(--red); } .c-cyan { color: var(--cyan); } .c-violet { color: var(--violet); }

/* ============================================================ layout helpers */
.col-stack { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.col-stack > .panel { flex: none; }
.col-stack > .panel.grow { flex: 1; min-height: 0; }
.modtag { display: none; font-size: 10px; font-family: var(--ui); font-weight: 600; letter-spacing: 0.3px; text-transform: none; color: #c9b8ff; border: 1px solid rgba(169, 139, 255, 0.5); background: rgba(109, 74, 224, 0.18); padding: 1px 7px; border-radius: 9px; }
#stage.show-mod .modtag { display: inline-block; }
.kpi.critk { border-color: rgba(255, 75, 92, 0.7); animation: critglow 1.2s infinite; }

/* group view (all lifts as live tiles) */
.gv { position: absolute; left: 0; right: 0; top: 52px; bottom: 34px; padding: 6px 14px; display: none; flex-wrap: wrap; align-content: flex-start; gap: 10px; overflow: hidden; z-index: 4; }
.gv.on { display: flex; }
.gv-site { background: rgba(10, 28, 58, 0.72); border: 1px solid rgba(64, 145, 255, 0.2); border-radius: 7px; padding: 7px 9px 9px; }
.gv-h { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-bottom: 6px; cursor: pointer; white-space: nowrap; }
.gv-h b { font-weight: 600; } .gv-h .muted { font-size: 11px; }
.gv-tiles { display: flex; gap: 6px; }
.gv-tile { width: 52px; height: 64px; border-radius: 6px; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(6, 18, 38, 0.95), rgba(10, 30, 60, 0.9)); border: 1px solid rgba(34, 217, 130, 0.45); transition: transform .15s, border-color .3s; }
.gv-tile:hover { transform: translateY(-2px); border-color: #fff; }
.gv-tile .id { position: absolute; top: 3px; left: 5px; font-size: 9.5px; color: var(--text-mute); font-weight: 600; }
.gv-tile .fl { font-family: var(--num); font-size: 24px; font-weight: 700; color: #ff9b2f; text-shadow: 0 0 10px rgba(255, 140, 30, 0.8); margin-top: 6px; }
.gv-tile .ar { height: 12px; color: #ff9b2f; } .gv-tile .ar svg { width: 12px; height: 12px; }
.gv-tile.mv .ar svg { animation: arrowUp 1s infinite; }
.gv-tile .ic { position: absolute; top: 3px; right: 4px; width: 12px; height: 12px; color: var(--green); } .gv-tile .ic svg { width: 12px; height: 12px; }
.gv-tile.s-watch { border-color: rgba(255, 178, 36, 0.7); }
.gv-tile.s-crit { border-color: #ff4b5c; background: linear-gradient(180deg, rgba(90, 10, 20, 0.95), rgba(60, 8, 16, 0.9)); animation: critglow 1s infinite; }
.gv-tile.s-crit .ic { color: var(--red); }
.gv-tile.s-maint, .gv-tile.s-off { border-color: rgba(169, 139, 255, 0.6); } .gv-tile.s-maint .ic, .gv-tile.s-off .ic { color: var(--violet); }
.gv-tile.s-off .fl { color: #6b7890; text-shadow: none; }
.gv-foot { position: absolute; left: 12px; bottom: 9px; z-index: 4; display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); background: rgba(3, 11, 28, 0.75); padding: 4px 10px; border-radius: 5px; border: 1px solid var(--line); }
.gv-foot span { display: flex; align-items: center; gap: 6px; }

/* lift view extras */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.counters .k { font-size: 10.5px; color: var(--text-mute); } .counters .v { font-size: 18px; font-weight: 600; }
.chips { display: flex; gap: 4px; margin-left: 16px; margin-top: 2px; }
.chips button { font-family: var(--num); font-size: 12.5px; font-weight: 700; padding: 3px 9px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-dim); background: rgba(6, 20, 44, 0.7); }
.chips button.on { color: #fff; border-color: var(--cyan); background: rgba(47, 212, 255, 0.18); box-shadow: 0 0 10px rgba(47, 212, 255, 0.35); }
.minimap { position: absolute; right: 16px; top: 64px; bottom: 54px; width: 34px; z-index: 3; }
.minimap .track { position: absolute; left: 15px; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: linear-gradient(180deg, rgba(47, 212, 255, 0.5), rgba(47, 212, 255, 0.1)); }
.minimap .mk { position: absolute; left: 50%; transform: translate(-50%, 50%); font-family: var(--num); font-size: 11px; font-weight: 700; display: grid; place-items: center; border-radius: 4px; }
.minimap .mk.car { width: 30px; height: 20px; background: #ff9b2f; color: #1a0d00; box-shadow: 0 0 12px rgba(255, 155, 47, 0.8); z-index: 2; }
.minimap .mk.cw { width: 14px; height: 14px; background: #6d5bd0; border: 1px solid #a98bff; }
.snap { position: absolute; right: 60px; top: 64px; z-index: 4; width: 230px; display: none; border: 1px solid #ff4b5c; border-radius: 6px; overflow: hidden; background: #000; box-shadow: 0 0 24px rgba(255, 75, 92, 0.5); }
.snap.on { display: block; animation: toastIn .4s; }
.snap .cap { font-size: 11px; padding: 5px 8px; background: rgba(120, 10, 20, 0.9); display: flex; justify-content: space-between; }
.snap canvas { display: block; width: 230px; height: 150px; }
.ai-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; margin-bottom: 6px; }
.ringbox .k { font-size: 11px; color: var(--text-dim); margin-top: -2px; }
.bandbar { position: relative; margin: 2px 0 10px; }
.bandbar .bands { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; height: 7px; }
.bandbar .bands i { border-radius: 2px; opacity: 0.85; }
.bandbar .lbls { display: grid; grid-template-columns: repeat(5, 1fr); font-size: 9.5px; color: var(--text-mute); text-align: center; margin-top: 4px; }
.bandbar .mk { position: absolute; top: -6px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid #fff; transition: left .6s; filter: drop-shadow(0 0 4px #fff); }
.wo { border: 1px solid rgba(64, 145, 255, 0.2); border-radius: 6px; padding: 8px 10px; margin-bottom: 7px; background: rgba(10, 28, 58, 0.6); }
.wo-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8cc8ff; font-weight: 700; }
.wo-t { font-size: 12.5px; margin: 4px 0 6px; }
.pipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.pipe span { font-size: 9.5px; text-align: center; padding: 2px 0; border-radius: 3px; background: rgba(120, 160, 220, 0.12); color: var(--text-mute); }
.pipe span.on { background: rgba(47, 212, 255, 0.22); color: #bff0ff; }
.wo-s { font-size: 11px; color: var(--text-dim); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.wo-s svg { width: 14px; height: 14px; }
.wo.new { border-color: rgba(169, 139, 255, 0.8); animation: flashin 1.5s; }

.site-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 11px 5px 13px; font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.4px; }
.site-list { height: calc(100% - 20px); }
.hub-label { position: absolute; transform: translate(-50%, -100%); font-size: 10px; color: #9fe8ff; text-align: center; white-space: nowrap; pointer-events: none;
  background: rgba(3, 14, 32, 0.8); border: 1px solid rgba(47, 212, 255, 0.5); border-radius: 12px; padding: 3px 10px; box-shadow: 0 0 14px rgba(47, 212, 255, 0.35); }
.hub-label b { display: block; font-family: var(--num); font-size: 11.5px; letter-spacing: 1px; color: #dff8ff; }

.lift-grid { height: 100%; grid-auto-rows: minmax(0, 1fr); }
.lcard { align-items: stretch; }
.lcard .top .kind { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lcard .top .badge { flex: none; }
.lcard .row .v { font-size: 13.5px; }
.lcard .row .k { font-size: 9px; }
.lcard .disp .fl { font-size: 40px; }
.lcard .mode { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.car-tag.mini { font-size: 9.5px; padding: 0 4px; opacity: 0.7; box-shadow: none; }

/* AI assistant */
#ai-btn { display: flex; align-items: center; gap: 7px; padding: 6px 14px 6px 10px; border-radius: 18px; font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, #5b3fd6, #7d5cff); box-shadow: 0 0 16px rgba(125, 92, 255, 0.55); border: 1px solid rgba(200, 180, 255, 0.6); margin-right: 4px; }
#ai-btn svg { width: 17px; height: 17px; }
#ai-btn:hover { filter: brightness(1.15); }
#ai-panel { position: absolute; right: 16px; top: 74px; width: 450px; height: 640px; z-index: 38; display: flex; flex-direction: column;
  background: rgba(10, 14, 40, 0.97); border: 1px solid rgba(169, 139, 255, 0.6); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(125, 92, 255, 0.25);
  transform: translateX(110%); transition: transform .45s cubic-bezier(.2, .9, .3, 1.1); }
#ai-panel.on { transform: none; }
#stage.ai-open #toasts { right: 482px; }
.ai-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(169, 139, 255, 0.25); }
.ai-h > svg { width: 26px; height: 26px; color: #c3b0ff; filter: drop-shadow(0 0 6px #7d5cff); }
.ai-h b { font-family: var(--num); font-size: 17px; letter-spacing: 0.5px; display: block; }
.ai-h small { font-size: 11px; color: #9d93c8; }
.ai-h .x { margin-left: auto; color: var(--text-dim); font-size: 16px; padding: 4px 8px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-m { font-size: 13px; line-height: 1.5; padding: 9px 12px; border-radius: 10px; max-width: 92%; }
.ai-m.ai { background: rgba(60, 45, 140, 0.45); border: 1px solid rgba(169, 139, 255, 0.35); border-top-left-radius: 3px; align-self: flex-start; color: #e9e4ff; }
.ai-m.ai b { color: #fff; } .ai-m.ai .dim { color: #b0a8d8; font-size: 12px; }
.ai-m.me { background: #1e6fe0; align-self: flex-end; border-top-right-radius: 3px; }
.ai-m .typing { letter-spacing: 3px; color: #a98bff; animation: blink 1s infinite; }
.ai-m .caret { color: #a98bff; animation: blink .7s infinite; }
.ai-sug { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-top: 1px solid rgba(169, 139, 255, 0.18); }
.ai-sug button { font-size: 11.5px; padding: 4px 10px; border-radius: 12px; border: 1px solid rgba(169, 139, 255, 0.5); color: #d9d0ff; background: rgba(90, 60, 200, 0.15); }
.ai-sug button:hover { background: rgba(125, 92, 255, 0.35); }
.ai-in { display: flex; gap: 8px; padding: 10px 14px 14px; }
.ai-in input { flex: 1; background: rgba(4, 8, 24, 0.9); border: 1px solid rgba(169, 139, 255, 0.45); border-radius: 8px; padding: 9px 12px; color: #fff; font: inherit; font-size: 13px; outline: none; user-select: text; }
.ai-in input:focus { border-color: #a98bff; box-shadow: 0 0 10px rgba(125, 92, 255, 0.4); }
.ai-in button { width: 40px; border-radius: 8px; background: #6d4ae0; display: grid; place-items: center; }
.ai-in button svg { width: 16px; height: 16px; }

/* ================================================================ roles */
.role { position: relative; }
.role-btn { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 18px; font-size: 12.5px; color: var(--text-dim); background: rgba(6, 20, 44, 0.7); white-space: nowrap; }
.role-btn svg { width: 16px; height: 16px; color: var(--cyan); }
.role-btn i { font-style: normal; font-size: 10px; color: var(--text-mute); }
.role-btn:hover { border-color: var(--border-hi); color: var(--text); }
.role.bm .role-btn { border-color: rgba(34, 217, 130, 0.65); color: #c4f7dd; background: rgba(10, 60, 40, 0.6); box-shadow: 0 0 12px rgba(34, 217, 130, 0.25); }
.role.bm .role-btn svg { color: var(--green); }
.role-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 330px; display: none; flex-direction: column; gap: 4px; padding: 6px; z-index: 60;
  background: rgba(6, 18, 40, 0.98); border: 1px solid var(--border-hi); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
.role.open .role-menu { display: flex; }
.role-menu button { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 6px; border: 1px solid transparent; }
.role-menu button:hover { background: rgba(47, 212, 255, 0.08); }
.role-menu button.on { border-color: var(--border-hi); background: rgba(47, 212, 255, 0.1); }
.role-menu svg { width: 22px; height: 22px; color: var(--cyan); flex: none; }
.role-menu b { display: block; font-size: 13px; }
.role-menu small { font-size: 11px; color: var(--text-mute); }

/* audience filtering: breakdown alerts never reach the building manager */
#stage.role-bm .toast[data-aud="mt"] { display: none; }
#stage:not(.role-bm) .toast[data-aud="bm"] { display: none; }
#stage.role-bm #phone { display: none; }
#stage.role-bm #view-building .modtag { display: none; }
.lcard.unavail { border-color: rgba(127, 142, 166, 0.5); background: rgba(22, 30, 46, 0.75); }
.lcard.unavail .disp .fl { color: #6b7890; text-shadow: none; }

/* building-manager lift card */
#li-modal { position: absolute; inset: 0; z-index: 42; display: none; }
#li-modal.on { display: block; }
#li-modal .li-back { position: absolute; inset: 62px 0 0 0; background: rgba(1, 6, 16, 0.55); }
#li-modal .li-card { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); width: 600px; padding: 16px 18px 14px; border-radius: 10px;
  background: rgba(8, 22, 46, 0.98); border: 1px solid var(--border-hi); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 30px rgba(47, 212, 255, 0.15); animation: popIn .25s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } }
.li-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.li-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(47, 212, 255, 0.25), rgba(61, 139, 255, 0.08)); border: 1px solid var(--border-hi); color: var(--cyan); flex: none; }
.li-ic svg { width: 26px; height: 26px; }
.li-hd { flex: 1; min-width: 0; }
.li-t { font-family: var(--num); font-size: 22px; font-weight: 700; }
.li-s { font-size: 12px; color: var(--text-mute); }
.li-h .badge { font-size: 12px; padding: 3px 11px; }
.li-x { color: var(--text-dim); font-size: 16px; padding: 4px 8px; }
.li-live { display: flex; gap: 14px; align-items: stretch; margin-bottom: 10px; }
.li-disp { width: 110px; flex: none; background: #01060f; border: 1px solid rgba(64, 145, 255, 0.25); border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9); }
.li-disp .fl { font-family: var(--num); font-size: 48px; font-weight: 700; color: #ff9b2f; text-shadow: 0 0 14px rgba(255, 140, 30, 0.85); line-height: 1; }
.li-disp .dir { height: 20px; color: #ff9b2f; } .li-disp .dir svg { width: 20px; height: 20px; }
.li-disp .dir.up svg { animation: arrowUp 1s infinite; } .li-disp .dir.dn svg { animation: arrowDn 1s infinite; }
.li-now { flex: 1; background: rgba(12, 32, 64, 0.6); border: 1px solid rgba(64, 145, 255, 0.16); border-radius: 7px; padding: 10px 12px; }
.li-now .k { font-size: 11px; color: var(--text-mute); }
.li-now .v { font-family: var(--num); font-size: 19px; font-weight: 600; }
.li-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.li-fb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); padding: 8px 0 4px; border-top: 1px solid var(--line); }
.li-fb span { margin-right: auto; }
.li-fb button { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); font-size: 12.5px; color: var(--text); background: rgba(6, 20, 44, 0.8); }
.li-fb button:hover { border-color: var(--border-hi); background: rgba(47, 212, 255, 0.1); }
.li-note { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-mute); margin-top: 6px; }
.li-note svg { width: 14px; height: 14px; color: var(--green); flex: none; }

#stage.role-bm #crumbs { display: none; } /* title already names the building */
#ai-btn, .clock, .clock .d { white-space: nowrap; }

/* map label lift chips (shown while hovering a site) */
.map-label .lifts, .map-label .hint { display: none; }
.map-label.open { z-index: 8; }
.map-label.open .lifts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; max-width: 230px; }
.map-label.open .hint { display: block; font-size: 9.5px; color: var(--text-mute); margin-top: 3px; }
.map-label .lc { font-family: var(--num); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; border: 1px solid rgba(34, 217, 130, 0.6); color: #7ff0b8; background: rgba(10, 50, 34, 0.7); }
.map-label .lc:hover { border-color: #fff; color: #fff; transform: translateY(-1px); }
.map-label .lc.s-watch { border-color: rgba(255, 178, 36, 0.7); color: #ffd27a; background: rgba(70, 46, 6, 0.7); }
.map-label .lc.s-crit { border-color: #ff4b5c; color: #ff9aa4; background: rgba(90, 10, 20, 0.8); }
.map-label .lc.s-maint, .map-label .lc.s-off { border-color: rgba(169, 139, 255, 0.6); color: #cbbcff; background: rgba(40, 26, 80, 0.7); }

.crumbs .c { white-space: nowrap; }

/* ========================================================== portrait phones
   520px-wide stacked layout (scaled to the phone width), scrolls vertically */
html.portrait, html.portrait body { height: auto; overflow-x: hidden; overflow-y: auto; }
#stage.portrait { width: 520px; height: auto; }
#stage.portrait::before { background-size: 26px 26px; }
#stage.portrait #topbar { position: relative; height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px 12px; }
#stage.portrait .brand svg { width: 30px; height: 30px; }
#stage.portrait .brand .word { font-size: 21px; }
#stage.portrait .tb-sep, #stage.portrait .tb-spacer { display: none; }
#stage.portrait .eita-chip { order: 1; margin-left: auto; height: 32px; padding: 3px 9px; }
#stage.portrait .eita-chip img { height: 22px; }
#stage.portrait .tb-title { order: 2; flex: 1 1 100%; }
#stage.portrait .tb-title .t1 { font-size: 15px; letter-spacing: 1px; }
#stage.portrait .crumbs { order: 3; flex: 1 1 100%; margin-left: 0; flex-wrap: wrap; }
#stage.portrait .role { order: 4; }
#stage.portrait #ai-btn { order: 5; }
#stage.portrait .live { order: 6; margin-left: auto; }
#stage.portrait .clock { order: 7; }
#stage.portrait .seg { order: 8; flex: 1 1 100%; }
#stage.portrait .seg button { flex: 1; }
#stage.portrait .role-menu { right: auto; left: 0; }

#stage.portrait .view { position: relative; inset: auto; display: none; opacity: 1; transform: none; transition: none; padding: 10px; pointer-events: auto; }
#stage.portrait .view.on { display: block; }
#stage.portrait .kpis.k6, #stage.portrait .kpis.k5 { grid-template-columns: 1fr 1fr; height: auto; gap: 8px; margin-bottom: 10px; }
#stage.portrait .kpi { min-height: 78px; padding: 8px 10px; gap: 9px; }
#stage.portrait .kpi .ic { width: 36px; height: 36px; }
#stage.portrait .kpi .ic svg { width: 20px; height: 20px; }
#stage.portrait .kpi .spark-w { display: none; }
#stage.portrait .kpi .val { font-size: 27px; }
#stage.portrait .kpi .lbl, #stage.portrait .kpi .sub { white-space: normal; }
#stage.portrait .kpi .sub { font-size: 10.5px; line-height: 1.25; }
#stage.portrait .grid3 { display: flex; flex-direction: column; height: auto; gap: 10px; }
#stage.portrait .grid3 > .panel, #stage.portrait .col-stack > .panel { flex: none; }
#stage.portrait .col-stack { gap: 10px; }
#stage.portrait .map-head { flex-wrap: wrap; right: 14px; row-gap: 6px; }
#stage.portrait .map-head .tabs { margin-left: 0 !important; }
#stage.portrait .map-legend { top: auto; bottom: 46px; left: 12px; right: 12px; flex-wrap: wrap; gap: 4px 12px; }
#stage.portrait .panel-h { flex-wrap: wrap; row-gap: 6px; }
#stage.portrait .tabs { margin-left: 0; }

/* fleet: map first, then sites, health, AI, events */
#stage.portrait #view-fleet .map-wrap { order: -1; height: 660px; }
#stage.portrait #view-fleet .map-wrap.grp { height: auto; min-height: 660px; }
#stage.portrait #view-fleet .gv { position: relative; top: 0; bottom: auto; padding: 92px 10px 50px; overflow: visible; }
#stage.portrait #view-fleet .grid3 > .panel:not(.map-wrap) { height: 820px; }
#stage.portrait #view-fleet .col-stack > .panel.grow { height: 460px; }
#stage.portrait .map-label.open .lifts { max-width: 200px; }
#stage.portrait .map-label .lc { font-size: 13px; padding: 4px 8px; }

/* building: twin first, then lift cards, notices, profile */
#stage.portrait #view-building .twin-wrap { order: -1; height: 680px; }
#stage.portrait #view-building .grid3 > .panel:first-child { height: 780px; }
#stage.portrait #view-building .col-stack > .panel.grow { height: auto; }
#stage.portrait #view-building .col-stack > .panel:last-child { height: 320px !important; }
#stage.portrait .lift-grid { height: auto; grid-auto-rows: 98px; }
#stage.portrait .lcard { grid-template-columns: 58px 1fr; gap: 8px; padding: 8px; }
#stage.portrait .lcard .disp .fl { font-size: 30px; }
#stage.portrait .lcard .top .kind { display: none; }
#stage.portrait .lcard .row .v { font-size: 12.5px; }

/* lift: twin + motion first, then telemetry, diagnostics */
#stage.portrait #view-lift .col-stack { order: -1; }
#stage.portrait #view-lift .col-stack > .panel.twin-wrap { height: 620px; }
#stage.portrait #view-lift .col-stack > .panel:last-child { height: 240px !important; }
#stage.portrait #view-lift .grid3 > .panel { height: 960px; }
#stage.portrait #view-lift .chips { margin-left: 0; flex-wrap: wrap; }
#stage.portrait .minimap { top: 110px; }
#stage.portrait .snap { top: 110px; right: 54px; width: 200px; }
#stage.portrait .snap canvas { width: 200px; height: 130px; }

/* overlays sit at the top of the scrolled page */
#stage.portrait #phone, #stage.portrait #sweep { display: none; }
#stage.portrait #toasts { left: 10px; right: 10px; width: auto; top: 10px; }
#stage.portrait #alert-banner { min-width: 0; width: 500px; top: 10px; flex-wrap: wrap; }
#stage.portrait #alert-banner .t { font-size: 18px; }
#stage.portrait #ai-panel { right: 10px; top: 10px; width: 500px; height: 700px; }
#stage.portrait #li-modal .li-card { width: 496px; top: 140px; transform: translateX(-50%); }
#stage.portrait .li-grid { grid-template-columns: 1fr 1fr; }
#stage.portrait .li-fb { flex-wrap: wrap; }

/* map label: explicit button to open the building (handy on touch screens) */
.map-label .ob { display: none; }
.map-label.open .ob { display: block; width: 100%; margin-top: 5px; padding: 4px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; color: #cfe9ff; border: 1px solid rgba(64, 190, 255, 0.5); background: rgba(20, 60, 120, 0.5); text-align: left; }
.map-label.open .ob:hover { border-color: #fff; color: #fff; }
