/* Campus digital-twin prototype. Everything is scoped under .tw. */
.tw {
  --tw-line: rgba(255, 255, 255, 0.09);
  --tw-text: #f3f4f6;
  --tw-dim: #9ca3af;
  --tw-ok: #39d0ff;
  --tw-good: #4aef9a;
  --tw-bad: #ff5a45;
  --tw-warn: #ffd166;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  color: var(--tw-text);
}
.tw-stage {
  position: relative; overflow: hidden;
  /* a fixed height, not aspect-ratio + min-height: that pair widens the grid column past the panel */
  height: clamp(420px, calc((100vw - 360px) * 0.5625), 780px);
  border: 1px solid var(--tw-line); border-radius: 14px; background: #dde6ee;
}
.tw-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.tw-stage canvas:active { cursor: grabbing; }
.tw-leads, .tw-labels { position: absolute; inset: 0; pointer-events: none; }
.tw-leads { width: 100%; height: 100%; }
.tw-leads path { stroke: rgba(147, 197, 253, 0.7); stroke-width: 1.2; fill: none; }
.tw-leads circle { fill: #93c5fd; }
.tw-label {
  position: absolute; left: 0; top: 0; margin: -10px 0 0 -14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: #1f2937;
  padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); white-space: nowrap;
}
.tw-label.bwc { background: #ffb454; color: #2a1800; margin: -12px 0 0 -40px; }
.tw-label.bwc i {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e11d1d;
  margin-right: 5px; vertical-align: 1px; animation: tw-blink 1s steps(2, start) infinite;
}
@keyframes tw-blink { to { visibility: hidden; } }
.tw-rec {
  position: absolute; right: 7px; top: 5px; font: 700 10px/1.35 ui-monospace, Menlo, monospace; color: #fff;
  text-shadow: 0 1px 2px #000;
}
.tw-rec::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; margin-right: 4px; }
.tw-badge {
  position: absolute; left: 12px; top: 12px;
  font-size: 11.5px; color: var(--tw-dim);
  padding: 4px 10px; border: 1px solid var(--tw-line); border-radius: 20px; background: rgba(7, 12, 22, 0.75);
}

/* caption + controls along the bottom */
.tw-cap {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%);
  max-width: min(760px, calc(100% - 24px)); width: max-content;
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 14px; border-radius: 10px; background: rgba(7, 12, 22, 0.82); border: 1px solid var(--tw-line);
  font-size: 14.5px; line-height: 1.5; pointer-events: none;
}
.tw-cap b { color: var(--tw-ok); font-size: 12px; letter-spacing: 0.08em; white-space: nowrap; }
.tw-bar {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 24px; background: rgba(7, 12, 22, 0.82);
}
.tw-play {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--tw-line); background: rgba(30, 41, 59, 0.85); position: relative;
}
.tw-play::before, .tw-play::after {   /* pause bars */
  content: ''; position: absolute; top: 11px; width: 3px; height: 12px; background: var(--tw-text); border-radius: 1px;
}
.tw-play::before { left: 13px; } .tw-play::after { left: 18px; }
.tw-play.paused::before {              /* play triangle */
  left: 13px; top: 10px; width: 0; height: 0; background: none; border-radius: 0;
  border-left: 11px solid var(--tw-text); border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.tw-play.paused::after { display: none; }
.tw-chaps { flex: 1; display: flex; gap: 4px; min-width: 0; }
.tw-chaps button {
  position: relative; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  color: var(--tw-dim); font: inherit; font-size: 11.5px;
}
.tw-chaps i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; position: relative; }
.tw-chaps i::after {
  content: ''; position: absolute; inset: 0; background: var(--tw-ok);
  transform-origin: left; transform: scaleX(var(--p, 0));
}
.tw-chaps span { display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-chaps button.on span { color: var(--tw-text); }
.tw-mode { flex: none; font-size: 11.5px; color: var(--tw-dim); min-width: 11em; text-align: right; }

/* floating status card */
.tw-card {
  position: absolute; left: 0; top: 0; width: 272px; z-index: 2;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(10, 17, 31, 0.94); border: 1px solid rgba(147, 197, 253, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); font-size: 12.5px; line-height: 1.5;
}
.tw-card[hidden] { display: none; }
.tw-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.tw-card header b { font-size: 14px; }
.tw-pill { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.tw-pill.good { color: var(--tw-good); background: rgba(74, 239, 154, 0.12); }
.tw-pill.back { color: var(--tw-good); background: rgba(74, 239, 154, 0.25); }
.tw-pill.bad { color: var(--tw-bad); background: rgba(255, 90, 69, 0.15); }
.tw-pill.warn { color: var(--tw-warn); background: rgba(255, 209, 102, 0.13); }
.tw-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; margin-bottom: 8px; }
.tw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-thumb.down img { filter: grayscale(1) brightness(0.3); }
.tw-osd { position: absolute; left: 7px; top: 5px; font: 600 10px/1.35 ui-monospace, Menlo, monospace; color: #fff; text-shadow: 0 1px 2px #000; }
.tw-thumb strong {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--tw-bad); font-size: 15px; letter-spacing: 0.12em;
}
.tw-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.tw-card dt { color: var(--tw-dim); }
.tw-card dd { margin: 0; }
.tw-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 10px 0 6px; }
.tw-steps li {
  flex: 1; text-align: center; font-size: 11px; padding: 2px 0; border-radius: 5px;
  color: var(--tw-dim); background: rgba(255, 255, 255, 0.05);
}
.tw-steps li.done { color: var(--tw-good); background: rgba(74, 239, 154, 0.1); }
.tw-steps li.cur { color: #0b1220; background: var(--tw-warn); font-weight: 700; }
.tw-log { list-style: none; padding: 0; margin: 0; max-height: 132px; overflow: auto; }
.tw-log li { display: grid; grid-template-columns: 4.6em 1fr; gap: 6px; color: #d1d5db; }
.tw-log time { color: var(--tw-dim); font-variant-numeric: tabular-nums; }

/* side panel */
.tw-side {
  border: 1px solid var(--tw-line); border-radius: 14px; padding: 14px;
  background: rgba(30, 41, 59, 0.35); display: flex; flex-direction: column; min-height: 0;
}
.tw-clock { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.tw-clock span { color: var(--tw-dim); font-size: 12.5px; }
.tw-clock b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.tw-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tw-kpis div { padding: 8px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); text-align: center; }
.tw-kpis b { display: block; font-size: 21px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tw-kpis small { font-size: 12px; color: var(--tw-dim); font-weight: 500; }
.tw-kpis span { font-size: 11px; color: var(--tw-dim); }
.tw-kpis .good b { color: var(--tw-good); }
.tw-kpis .bad b { color: var(--tw-bad); }
.tw-side h4 { margin: 16px 0 6px; font-size: 12.5px; color: var(--tw-dim); font-weight: 600; }
.tw-events { display: flex; flex-direction: column; gap: 6px; }
.tw-ev {
  display: grid; grid-template-columns: 3.2em 1fr auto; gap: 2px 8px; align-items: baseline;
  text-align: left; font: inherit; font-size: 12.5px; color: var(--tw-text); cursor: pointer;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--tw-line); background: rgba(255, 255, 255, 0.03);
}
.tw-ev:hover { border-color: rgba(255, 255, 255, 0.2); }
.tw-ev.on { border-color: rgba(147, 197, 253, 0.6); }
.tw-ev time { color: var(--tw-dim); font-variant-numeric: tabular-nums; }
.tw-ev b { font-weight: 600; }
.tw-ev em { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 9px; }
.tw-ev.open { border-left: 3px solid var(--tw-bad); }
.tw-ev.open em { color: var(--tw-warn); background: rgba(255, 209, 102, 0.13); }
.tw-ev.done em { color: var(--tw-good); background: rgba(74, 239, 154, 0.1); }
.tw-help { margin: auto 0 0; padding-top: 14px; font-size: 11.5px; color: var(--tw-dim); line-height: 1.7; }

@media (max-width: 900px) {
  .tw { grid-template-columns: 1fr; }
  .tw-stage { height: 62vh; min-height: 380px; }
  .tw-card { width: 236px; font-size: 12px; }
  .tw-cap { font-size: 13px; bottom: 60px; }
  .tw-mode { display: none; }
}
/* phones: the card would cover most of the scene; keep it to the essentials */
@media (max-width: 600px) {
  .tw-card { width: 210px; padding: 10px 12px; }
  .tw-thumb { display: none; }
  .tw-log { max-height: 60px; }
}

/* night scenarios (scn-patrol.js) */
.tw-night .tw-stage { background: #0b1424; }
.tw-label.sos { background: var(--tw-bad); color: #fff; margin: -12px 0 0 -40px; }
.tw-label.sos i, .tw-label.room i {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #fff;
  margin-right: 5px; vertical-align: 1px; animation: tw-blink 1s steps(2, start) infinite;
}
.tw-label.who { background: rgba(30, 41, 59, 0.88); color: #e5e7eb; }
.tw-label.room { background: var(--tw-bad); color: #fff; }
.tw-thumb.off { display: grid; place-items: center; background: #0d1422; border: 1px dashed rgba(255, 255, 255, 0.16); }
.tw-thumb.off span { color: var(--tw-dim); font-size: 12px; line-height: 1.6; text-align: center; }
.tw-live {
  position: absolute; right: 7px; top: 6px; padding: 0 6px; border-radius: 4px; background: #ef4444;
  font: 700 10px/1.5 ui-monospace, Menlo, monospace; color: #fff; letter-spacing: 0.06em;
}
.tw-up { margin-bottom: 8px; }
.tw-up i { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tw-up b { display: block; height: 100%; background: var(--tw-good); }
.tw-up span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--tw-dim); }
.tw-none { margin: 0; padding: 10px; font-size: 12.5px; color: var(--tw-dim); border: 1px dashed var(--tw-line); border-radius: 9px; }

/* language switch in each page header (/twin* ⇄ /twin*-en) */
.head { position: relative; }
.head .lang { position: absolute; top: 0; right: 0; display: flex; gap: 4px; }
.head .lang a {
  font-size: 12.5px; font-weight: 600; color: #9ca3af; text-decoration: none;
  padding: 5px 11px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px;
}
.head .lang a[aria-current] { color: #f3f4f6; border-color: rgba(147, 197, 253, 0.6); }
.head .lang:hover { color: #f3f4f6; border-color: rgba(255, 255, 255, 0.25); }

/* narration toggle (English pages): same three states as the flow animations' button */
.tw-voice {
  flex: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 5px 11px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.85); color: #9ca3af; font: inherit; font-size: 11.5px; font-weight: 600;
}
.tw-voice[hidden] { display: none; }
.tw-voice.on { color: #93c5fd; border-color: rgba(96, 165, 250, 0.55); }
.tw-voice.ask { color: #f3f4f6; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18); }
@media (max-width: 600px) { .tw-voice span { display: none; } }

/* waiting placeholder inside a card thumbnail (e.g. a video request awaiting consent) */
.tw-thumb.tw-wait { background: #0b1220; }
.tw-thumb.tw-wait strong { color: #93c5fd; font-size: 13px; letter-spacing: 0.04em; }

/* multi-site scenario (scn-multisite.js): screen name tags and the CliO 4-up view */
.tw-label.scr { background: rgba(15, 23, 42, 0.88); color: #93c5fd; margin: -12px 0 0 -18px; }
.tw-thumb.tw-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: #0b1220; }
.tw-grid span { position: relative; overflow: hidden; display: block; }
.tw-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-grid em { position: absolute; left: 4px; top: 2px; font: 700 9.5px/1.3 ui-monospace, Menlo, monospace; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
.tw-grid span.off { display: grid; place-items: center; background: #1a0d10; color: var(--tw-bad); font: 700 10px/1.3 ui-monospace, Menlo, monospace; }

/* yard scenario (scn-yard.js): SOP checklist, playback timeline, event report */
.tw-sop { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; counter-reset: sop; }
.tw-sop li { counter-increment: sop; font-size: 12px; color: var(--tw-dim); padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.tw-sop li::before { content: counter(sop); display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 7px; border-radius: 50%; border: 1px solid currentColor; font-size: 10px; font-weight: 700; }
.tw-sop li.cur { color: var(--tw-warn); background: rgba(255, 209, 102, 0.1); }
.tw-sop li.done { color: var(--tw-good); }
.tw-sop li.done::before { content: '✓'; background: rgba(74, 239, 154, 0.15); }
.tw-tl { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); }
.tw-tl b { position: absolute; top: 0; bottom: 0; background: #ef4444; border-radius: 3px; }
.tw-tl i { position: absolute; top: -4px; width: 2px; height: 14px; background: #fff; box-shadow: 0 0 3px #000; }
.tw-report { margin-bottom: 8px; font-size: 11.5px; }
.tw-report p { margin: 6px 0 4px; color: var(--tw-dim); font-size: 11px; }
.tw-report div { display: grid; grid-template-columns: 5.5em 1fr 2em; align-items: center; gap: 6px; margin: 3px 0; }
.tw-report div i { display: block; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tw-report div b { display: block; height: 100%; background: #6ea8ff; }
.tw-report em, .tw-report li em { font-style: normal; text-align: right; color: #e5e7eb; font-weight: 700; }
.tw-report ol { margin: 0; padding-left: 18px; }
.tw-report li { display: flex; justify-content: space-between; margin: 2px 0; }

/* step mode (engine.js): the tour waits before each action for the viewer to press */
.tw-step {
  position: absolute; left: 50%; bottom: 124px; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; white-space: nowrap;
  padding: 9px 18px 9px 14px; border-radius: 24px; border: 1px solid rgba(147, 197, 253, 0.85);
  background: #1d4ed8; color: #fff; font: inherit; font-size: 14.5px; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.45); animation: tw-step-glow 1.8s ease-in-out infinite;
}
.tw-step[hidden] { display: none; }
.tw-step i { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.tw-step:hover { background: #2563eb; }
.tw-step:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.tw-step.sim { background: rgba(15, 23, 42, 0.92); border-style: dashed; border-color: #ffd166; color: #ffe8a3; }
.tw-step.view, .tw-step.replay { background: rgba(15, 23, 42, 0.92); border-color: rgba(255, 255, 255, 0.45); }
@keyframes tw-step-glow { 50% { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.45), 0 0 0 6px rgba(96, 165, 250, 0.22); } }
@media (prefers-reduced-motion: reduce) { .tw-step { animation: none; } }
@media (max-width: 600px) { .tw-step { bottom: 112px; font-size: 13px; padding: 8px 14px 8px 12px; } }
.tw-auto {
  flex: none; cursor: pointer; padding: 5px 11px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.85); color: #9ca3af; font: inherit; font-size: 11.5px; font-weight: 600;
}
.tw-auto[hidden] { display: none; }
.tw-auto.step { color: #93c5fd; border-color: rgba(96, 165, 250, 0.55); }
.tw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* product screen panel (engine.js renderScreen) and the XMap look drawn in it (scn-yard.js) */
.tw-screen {
  position: absolute; right: 12px; top: 12px; z-index: 2; width: min(48%, 520px); aspect-ratio: 16 / 10;
  border-radius: 10px; overflow: hidden; border: 3px solid #0b0f17;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 10px 28px rgba(15, 23, 42, 0.5);
}
.tw-screen[hidden] { display: none; }
.tw-screen.compact { width: min(34%, 380px); }
.tw-sleads path { stroke: #e11d48; stroke-width: 1.8; stroke-dasharray: 6 4; }
.tw-sleads circle { fill: #e11d48; stroke: #fff; stroke-width: 1.5; }
@media (max-width: 600px) { .tw-screen { width: 62%; } }
.xm { width: 520px; height: 325px; transform: scale(var(--k, 1)); transform-origin: 0 0; display: flex; flex-direction: column; background: #111827; color: #e5e7eb; font-size: 10px; line-height: 1.35; }
.xm-top { flex: none; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; background: #1f2937; border-bottom: 1px solid #374151; }
.xm-top > i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: #e11d48; color: #fff; font: 800 10px/1 sans-serif; font-style: normal; }
.xm-top > b { font-size: 11px; letter-spacing: 0.02em; }
.xm-top > small { color: #9ca3af; font-size: 8px; }
.xm-top nav { display: flex; gap: 2px; margin-left: auto; }
.xm-top nav span { padding: 2px 7px; border-radius: 4px; color: #9ca3af; }
.xm-top nav span.on { background: #2563eb; color: #fff; }
.xm-top > em { font-style: normal; font-size: 8.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid #f59e0b; color: #fbbf24; }
.xm-body { flex: 1; display: flex; min-height: 0; }
.xm-layers { flex: none; width: 23%; display: flex; flex-direction: column; gap: 3px; padding: 6px; background: #161e2c; border-right: 1px solid #374151; }
.xm-layers b { font-size: 9px; color: #9ca3af; margin-bottom: 2px; }
.xm-layers span { padding: 2px 5px; border-radius: 4px; background: #1f2937; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xm-layers span.on { background: rgba(37, 99, 235, 0.35); color: #fff; box-shadow: inset 2px 0 #3b82f6; }
.xm-main { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #ece7df; }
.xm-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.xm-world { transform-box: view-box; transform-origin: 0 0; }
.xm-world.zoomed { transform: translate(-6.98px, 9.65px) scale(2.2); }
.xm-world.zoom-in { animation: xm-zoom 1.3s ease-in-out forwards; }
@keyframes xm-zoom { from { transform: none; } to { transform: translate(-6.98px, 9.65px) scale(2.2); } }
.xm-map .land { fill: #ece7df; }
.xm-map .road { fill: #fff; stroke: #f2c94c; stroke-width: 0.06; }
.xm-map .yd { fill: #d9d6cf; stroke: #9aa3ad; stroke-width: 0.07; }
.xm-map .yd.on { fill: #dbe6f7; stroke: #2563eb; stroke-width: 0.12; }
.xm-map text { font: 600 0.62px sans-serif; fill: #374151; text-anchor: middle; }
.xm-map .bld { fill: #b9bec6; stroke: #8b939e; stroke-width: 0.05; }
.xm-map .cont { fill: #c7b9a5; stroke: #a8977f; stroke-width: 0.04; }
.xm-map .cam { fill: #2563eb; stroke: #fff; stroke-width: 0.08; }
.xm-map .rp { fill: #22c55e; stroke: #fff; stroke-width: 0.07; }
.xm-map .rp.alarm { fill: #ef4444; animation: xm-blink 0.8s steps(2, start) infinite; }
@keyframes xm-blink { to { fill: #fca5a5; } }
.xm-alert { position: absolute; right: 6px; top: 6px; width: 54%; border-radius: 6px; overflow: hidden; background: #1f2937; border: 1px solid #4b5563; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.xm-alert header { display: flex; align-items: center; gap: 4px; padding: 3px 6px; background: #b91c1c; }
.xm-alert header b { font-size: 9.5px; }
.xm-alert header i { font-style: normal; font-size: 8px; padding: 0 4px; border-radius: 3px; background: #7f1d1d; }
.xm-alert header em { font-style: normal; font-size: 8px; margin-left: auto; padding: 0 4px; border-radius: 3px; background: #dc2626; }
.xm-alert h5 { margin: 4px 6px 0; font-size: 10.5px; }
.xm-alert small { display: block; margin: 0 6px; color: #9ca3af; font-size: 8px; }
.xm-alert p { margin: 2px 6px; font-size: 9px; color: #fca5a5; }
.xm-lab { display: block; margin: 2px 6px 1px; font-size: 8px; color: #9ca3af; }
.xm-alert ol { list-style: none; margin: 0 6px; padding: 0; }
.xm-alert li { position: relative; padding-left: 13px; font-size: 9px; color: #d1d5db; }
.xm-alert li::before { content: ''; position: absolute; left: 0; top: 2px; width: 8px; height: 8px; border: 1px solid #9ca3af; border-radius: 2px; }
.xm-alert li.cur { color: #fbbf24; }
.xm-alert li.cur::before { border-color: #fbbf24; }
.xm-alert li.done { color: #86efac; }
.xm-alert li.done::before { content: '✓'; border-color: #22c55e; background: #166534; color: #fff; font-size: 7px; line-height: 8px; text-align: center; }
.xm-alert footer { display: flex; justify-content: flex-end; gap: 4px; padding: 4px 6px; }
.xm-alert footer span { padding: 1px 7px; border-radius: 4px; border: 1px solid #4b5563; font-size: 8.5px; }
.xm-alert footer span.go { background: #059669; border-color: #059669; }
.xm-live { position: absolute; left: 6px; bottom: 6px; width: 46%; border-radius: 5px; overflow: hidden; background: #000; border: 1px solid #4b5563; }
.xm-live header { display: flex; justify-content: space-between; padding: 2px 5px; background: #1f2937; font-size: 8.5px; }
.xm-live header i { font-style: normal; color: #fff; background: #ef4444; padding: 0 4px; border-radius: 3px; }
.xm-live img, .xm-wall img, .xm-play img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.xm-toast { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 3px 9px; border-radius: 5px; background: #065f46; color: #d1fae5; font-size: 9px; white-space: nowrap; }
.xm-wall { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: #000; }
.xm-wall span { position: relative; overflow: hidden; }
.xm-wall img { height: 100%; }
.xm-wall em { position: absolute; left: 3px; top: 2px; font-style: normal; font-size: 8px; color: #fff; text-shadow: 0 1px 2px #000; }
.xm-play { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0b1220; padding: 5px; gap: 4px; }
.xm-play .v { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 4px; }
.xm-play .v img { height: 100%; }
.xm-play .v em { position: absolute; left: 4px; top: 3px; font-style: normal; font-size: 8.5px; color: #fff; text-shadow: 0 1px 2px #000; }
.xm-play .tl { position: relative; height: 7px; border-radius: 3px; background: #374151; }
.xm-play .tl b { position: absolute; top: 0; bottom: 0; background: #dc2626; border-radius: 3px; }
.xm-play .tl i { position: absolute; top: -3px; width: 2px; height: 13px; background: #fff; }
.xm-play .ex { display: flex; align-items: center; gap: 5px; font-size: 9px; }
.xm-play .ex span { padding: 1px 7px; border-radius: 4px; background: #2563eb; }
.xm-play .ex i { flex: 1; height: 5px; border-radius: 3px; background: #374151; overflow: hidden; }
.xm-play .ex i b { display: block; height: 100%; background: #22c55e; }
.xm-report { position: absolute; inset: 0; background: #111827; padding: 4px 10px; }
.xm-report .tw-report { font-size: 9.5px; margin: 0; }
.xm-report .tw-report div { grid-template-columns: 6em 1fr 2em; }
.xm-report footer { display: flex; gap: 4px; justify-content: flex-end; }
.xm-report footer span { padding: 1px 8px; border-radius: 4px; border: 1px solid #4b5563; font-size: 8.5px; }

/* multisite screens (scn-multisite.js): CliO after its brochure, Nexus after the operation guide */
.cl, .nx { width: 520px; height: 325px; transform: scale(var(--k, 1)); transform-origin: 0 0; display: flex; flex-direction: column; font-size: 10px; line-height: 1.35; color: #e5e7eb; }
.cl { background: #141414; }
.cl-top, .nx-top { flex: none; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; }
.cl-top { background: #1c1c1c; border-bottom: 1px solid #2e2e2e; }
.cl-top > i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: #d71920; color: #fff; font: 800 10px/1 sans-serif; font-style: normal; }
.cl-top > b, .nx-top > b { font-size: 11px; }
.cl-top nav { display: flex; gap: 2px; margin-left: 10px; }
.cl-top nav span { padding: 2px 7px; border-radius: 4px; color: #9ca3af; }
.cl-top nav span.on { background: #d71920; color: #fff; }
.cl-top > em, .nx-top > em { margin-left: auto; font-style: normal; font-size: 8.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid #6b7280; color: #d1d5db; }
.cl-body, .nx-body { flex: 1; display: flex; min-height: 0; }
.cl-body aside { flex: none; width: 27%; display: flex; flex-direction: column; gap: 3px; padding: 6px; background: #191919; border-right: 1px solid #2e2e2e; }
.cl-body aside span { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 4px; background: #222; white-space: nowrap; overflow: hidden; }
.cl-body aside span.on { box-shadow: inset 2px 0 #d71920; background: #2a1d1d; }
.cl-body aside i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.cl-body aside i.bad { background: #ef4444; }
.cl-body aside em { margin-left: auto; font-style: normal; color: #9ca3af; font-size: 9px; }
.cl-main { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #0b0b0b; }
.cl-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.cl-grid span, .cl-one { position: relative; overflow: hidden; }
.cl-grid img, .cl-one img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cl-grid em, .cl-one em { position: absolute; left: 4px; top: 2px; font-style: normal; font-size: 8.5px; color: #fff; text-shadow: 0 1px 2px #000; }
.cl-grid span.off { display: grid; place-items: center; background: #2a0d0f; color: #f87171; font-weight: 700; }
.cl-inc { position: absolute; inset: 0; display: flex; }
.cl-inc ul { flex: none; width: 38%; list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: #141414; }
.cl-inc li { padding: 4px 6px; border-radius: 4px; background: #1f2a1f; border-left: 3px solid #22c55e; }
.cl-inc li.h { background: none; border: 0; padding: 1px 2px; color: #9ca3af; font-size: 9px; }
.cl-inc li.bad { background: #3a1214; border-left-color: #ef4444; }
.cl-inc li.ok { background: #14301f; border-left-color: #22c55e; }
.cl-inc li b { display: block; font-size: 9.5px; }
.cl-inc li small { color: #9ca3af; font-size: 8px; }
.cl-inc .cl-grid { position: relative; flex: 1; }
.cl-inc .cl-one { flex: 1; }
.nx { background: #0b0f14; }
.nx-top { background: #0f141b; border-bottom: 1px solid #1f2937; }
.nx-top > i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: #2563eb; color: #fff; font: 800 10px/1 sans-serif; font-style: normal; }
.nx-top > small { color: #9ca3af; font-size: 8px; }
.nx-body aside { flex: none; width: 22%; display: flex; flex-direction: column; gap: 2px; padding: 6px 5px; background: #0f141b; border-right: 1px solid #1f2937; }
.nx-body aside span { padding: 3px 6px; border-radius: 4px; color: #9ca3af; white-space: nowrap; }
.nx-body aside span.on { background: #1e293b; color: #fff; }
.nx-main { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #111820; }
.nx-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.nx-map .gnd { fill: #111820; }
.nx-map .blk { fill: #1a222d; }
.nx-map .park { fill: #15241c; }
.nx-map .rd { fill: #2b3542; }
.nx-map .bld { fill: #253041; stroke: #334155; stroke-width: 0.06; }
.nx-map .trail { fill: none; stroke: #f59e0b; stroke-width: 0.22; stroke-dasharray: 0.35 0.25; }
.nx-map .spot circle:first-child { fill: rgba(239, 68, 68, 0.22); stroke: #ef4444; stroke-width: 0.08; }
.nx-map .spot circle:last-child { fill: #ef4444; }
.nx-map .dv circle { stroke: #fff; stroke-width: 0.1; }
.nx-map .dv.act circle { fill: #f59e0b; }
.nx-map .dv.ok circle { fill: #22c55e; }
.nx-map .dv.idle circle { fill: #64748b; }
.nx-map .dv text { font: 700 0.75px sans-serif; fill: #e5e7eb; text-anchor: middle; }
.nx-tk { position: absolute; right: 6px; top: 6px; width: 46%; padding: 5px 7px; border-radius: 6px; background: rgba(15, 23, 42, 0.95); border: 1px solid #334155; }
.nx-tk header { display: flex; justify-content: space-between; align-items: center; }
.nx-tk header i { font-style: normal; font-size: 8.5px; padding: 0 5px; border-radius: 3px; background: #92400e; color: #fde68a; }
.nx-tk header i.ok { background: #166534; color: #bbf7d0; }
.nx-tk small { display: block; color: #9ca3af; font-size: 8px; margin: 1px 0 3px; }
.nx-tk ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nx-tk li { flex: 1; text-align: center; font-size: 8px; padding: 1px 0; border-radius: 3px; background: #1f2937; color: #9ca3af; }
.nx-tk li.cur { background: #92400e; color: #fde68a; }
.nx-tk li.done { background: #14532d; color: #bbf7d0; }
.nx-dlg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 74%; border-radius: 7px; overflow: hidden; background: #0f172a; border: 1px solid #334155; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.nx-dlg header { padding: 4px 8px; background: #1e293b; font-weight: 700; font-size: 10px; }
.nx-dlg dl { display: grid; grid-template-columns: 3.4em 1fr; gap: 3px 6px; margin: 6px 8px; font-size: 9px; }
.nx-dlg dt { color: #9ca3af; }
.nx-dlg dd { margin: 0; }
.nx-dlg footer { display: flex; justify-content: flex-end; padding: 0 8px 6px; }
.nx-dlg footer span { padding: 2px 9px; border-radius: 4px; background: #2563eb; font-size: 9px; }
.nx-ask { position: absolute; left: 6px; bottom: 6px; padding: 5px 8px; border-radius: 6px; background: #0f172a; border: 1px solid #f59e0b; display: flex; flex-direction: column; gap: 1px; }
.nx-ask b { font-size: 9.5px; }
.nx-ask span { font-size: 9px; color: #fbbf24; }
.nx-live { position: absolute; left: 6px; top: 6px; bottom: 6px; width: 50%; display: flex; flex-direction: column; gap: 3px; }
.nx-live .v { position: relative; flex: 1; overflow: hidden; border-radius: 5px; border: 2px solid #f59e0b; }
.nx-live img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nx-live em { position: absolute; left: 4px; top: 2px; font-style: normal; font-size: 8.5px; color: #fff; text-shadow: 0 1px 2px #000; }
.nx-live i { position: absolute; right: 4px; top: 3px; font-style: normal; font-size: 8px; padding: 0 4px; border-radius: 3px; background: #ef4444; color: #fff; }
.nx-live p { margin: 0; font-size: 8.5px; color: #fbbf24; }
.nx-pt { position: absolute; inset: 6px; padding: 6px 8px; border-radius: 6px; background: #0f172a; border: 1px solid #334155; }
.nx-pt header { font-weight: 700; margin-bottom: 4px; }
.nx-pt ol { margin: 0; padding-left: 16px; }
.nx-pt li { display: flex; justify-content: space-between; padding: 2px 0; color: #9ca3af; border-bottom: 1px solid #1e293b; }
.nx-pt li.done { color: #bbf7d0; }
.nx-pt li em { font-style: normal; }
.nx-pt footer { margin-top: 5px; color: #9ca3af; font-size: 9px; }

/* LILIN site (data-brand="lilin"): the cloud platform is Merlin, drawn neutral (no UI reference) */
.cl.neutral .cl-top > i, .cl.neutral .cl-top nav span.on { background: #475569; }
.cl.neutral .cl-body aside span.on { box-shadow: inset 2px 0 #94a3b8; background: #1f2937; }

/* scenario tabs (build/tools/twin-nav.mjs): name + the products each scenario uses */
.head .scn { margin: 10px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .head .scn { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .head .scn { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scn-c {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 7px 10px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); color: #9ca3af; text-decoration: none;
}
a.scn-c:hover { border-color: rgba(255, 255, 255, 0.3); color: #d1d5db; }
.scn-c.on { border-color: rgba(147, 197, 253, 0.7); background: rgba(59, 130, 246, 0.12); }
.scn-c b { font-size: 12.5px; font-weight: 600; color: #d1d5db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scn-c.on b { color: #fff; }
.scn-c em { font-style: normal; display: flex; flex-wrap: wrap; gap: 2px 9px; font-size: 10.5px; line-height: 1.5; }
.scn-c em span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.scn-c em i, .tw-prod i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.scn-c em .ext { color: #6b7280; }
.scn-c em .ext i, .tw-prod.ext i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }

/* products in this solution (engine.js): strip above the stage; hover rings the product's devices */
.tw-prods { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.tw-prods-lab { color: var(--tw-dim); font-weight: 600; margin-right: 2px; }
.tw-prods-hint { color: #6b7280; font-size: 11px; margin-left: auto; }
.tw-prod { display: inline-flex; align-items: stretch; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); overflow: hidden; }
.tw-prod.ext { border-style: dashed; border-color: rgba(156, 163, 175, 0.45); background: none; }
.tw-prod button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 0; background: none; color: var(--tw-text); font: inherit; cursor: pointer; }
.tw-prod button:disabled { cursor: default; }
.tw-prod button b { font-weight: 700; }
.tw-prod button small { color: var(--tw-dim); font-size: 11px; }
.tw-prod button.on, .tw-prod button:not(:disabled):hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.tw-prod a { display: grid; place-items: center; padding: 0 9px; border-left: 1px solid color-mix(in srgb, var(--c) 35%, transparent); color: var(--tw-dim); text-decoration: none; font-size: 12px; }
.tw-prod a:hover { color: #fff; }
@media (max-width: 900px) { .tw-prods-hint { display: none; } }
.tw-stage canvas { transition: filter 0.25s; }
.tw-stage.tw-hl canvas { filter: brightness(0.45) saturate(0.6); }
.tw-ring {
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 2.5px solid var(--c); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35), 0 0 16px var(--c); pointer-events: none;
  animation: tw-ring 1.4s ease-in-out infinite;
}
@keyframes tw-ring { 50% { transform-origin: center; scale: 1.25; } }
@media (prefers-reduced-motion: reduce) { .tw-ring { animation: none; } }
/* while a product is ringed, the card and the screen panel step back so the rings show through */
.tw-card, .tw-screen, .tw-leads { transition: opacity 0.25s; }
.tw-stage.tw-hl .tw-card, .tw-stage.tw-hl .tw-screen, .tw-stage.tw-hl .tw-leads { opacity: 0.12; }

/* home icon before the page title (twin*.html) */
.head h1 { display: flex; align-items: center; gap: 10px; }
.head h1 .home {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.14); color: #9ca3af; text-decoration: none;
}
.head h1 .home:hover { color: #f3f4f6; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.05); }
