:root {
  --ink: #111827;
  --muted: #667085;
  --line: #cfd6e3;
  --soft-line: #e6eaf0;
  --page: #f3f5f8;
  --panel: #ffffff;
  --nav: #111827;
  --nav-muted: #98a2b3;
  --danger: #b42318;
  --danger-strong: #7a271a;
  --danger-soft: #fee4e2;
  --amber: #b54708;
  --amber-soft: #fef0c7;
  --green: #067647;
  --green-soft: #dcfae6;
  --blue: #175cd3;
  --blue-soft: #d1e9ff;
  --teal: #0e9384;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 8px 20px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  color: #ffffff;
  background: var(--nav);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
  background: var(--danger);
}

.brand-block h1,
.brand-block p,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand-block h1 {
  font-size: 20px;
}

.brand-block p,
.endpoint-launcher p {
  color: var(--nav-muted);
  font-size: 13px;
}

.node-card {
  min-height: 48px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.status-dot.online {
  background: #12b76a;
}

.status-dot.internet {
  background: #12b76a;
  box-shadow:
    0 0 0 4px rgba(18, 183, 106, 0.16),
    0 0 14px rgba(18, 183, 106, 0.34);
}

.status-dot.intranet {
  background: #2e90fa;
  box-shadow:
    0 0 0 4px rgba(46, 144, 250, 0.16),
    0 0 14px rgba(46, 144, 250, 0.28);
}

.status-dot.offline {
  background: #f04438;
  box-shadow:
    0 0 0 4px rgba(240, 68, 56, 0.14),
    0 0 14px rgba(240, 68, 56, 0.24);
}

.node-status-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.node-status-text strong,
.node-status-text span {
  display: block;
  overflow-wrap: anywhere;
}

.node-status-text strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
}

.node-status-text span {
  color: var(--nav-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.node-status-text.internet span {
  color: #abefc6;
}

.node-status-text.intranet span {
  color: #b2ddff;
}

.node-status-text.offline span {
  color: #fecdca;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a,
.endpoint-link {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav a:hover,
.endpoint-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.endpoint-launcher {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.endpoint-link {
  display: block;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar,
.panel-header,
.incident-strip,
.device-row,
.response-row,
.timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 16px;
}

.topbar h2 {
  font-size: 24px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.incident-strip {
  min-height: 72px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.incident-strip.active {
  border-left-color: var(--danger);
}

.incident-strip h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.incident-strip p {
  margin: 0;
  color: var(--muted);
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.lower-grid {
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  margin-bottom: 16px;
}

.panel h3 {
  font-size: 18px;
}

.pill {
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.danger {
  border-color: #fecdca;
  color: var(--danger-strong);
  background: var(--danger-soft);
}

.pill.warning {
  border-color: #fedf89;
  color: var(--amber);
  background: var(--amber-soft);
}

.pill.online {
  border-color: #abefc6;
  color: var(--green);
  background: var(--green-soft);
}

.building-head-pills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.fire-behavior-pill.fire-behavior-spreading {
  border-color: #fda29b;
  color: #b42318;
  background: #fff1f0;
}

.fire-behavior-pill.fire-behavior-contained {
  border-color: #fedf89;
  color: #b54708;
  background: #fffbeb;
}

.fire-behavior-pill.fire-behavior-declining {
  border-color: #abefc6;
  color: #067647;
  background: #f6fef9;
}

.fire-behavior-pill.fire-behavior-unverified {
  border-color: #d0d5dd;
  color: #475467;
  background: #f8fafc;
}

.fire-behavior-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #344054;
  background: #f8fafc;
}

.fire-behavior-card span,
.fire-behavior-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.fire-behavior-card strong {
  color: var(--ink);
  font-size: 14px;
}

.fire-behavior-card em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.fire-behavior-card.fire-behavior-spreading {
  border-color: #fda29b;
  background: #fff1f0;
}

.fire-behavior-card.fire-behavior-contained {
  border-color: #fedf89;
  background: #fffbeb;
}

.fire-behavior-card.fire-behavior-declining {
  border-color: #abefc6;
  background: #f6fef9;
}

.fire-behavior-card.compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.primary {
  color: #ffffff;
  background: var(--blue);
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #ffffff;
}

.button.danger {
  color: #ffffff;
  background: var(--danger);
}

.button.safe {
  color: #ffffff;
  background: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.metric strong {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

.overview-panel,
.patient-access-panel {
  margin-bottom: 16px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-card {
  min-width: 0;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  align-content: start;
  gap: 5px;
}

.overview-card.ready {
  border-left-color: var(--green);
}

.overview-card.warning {
  border-left-color: var(--amber);
}

.overview-card.danger {
  border-left-color: var(--danger);
}

.overview-card span,
.patient-access-header,
.patient-access-row span,
.patient-access-privacy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.overview-card em,
.patient-access-row em,
.patient-access-privacy em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.device-access-link {
  min-height: 62px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #175cd3;
  background: #eff6ff;
  text-decoration: none;
  display: grid;
  gap: 4px;
}

.device-access-link span {
  color: #175cd3;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.device-access-link strong {
  color: var(--ink);
  font-size: 14px;
}

.patient-access-toolbar {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 0.4fr) minmax(160px, 0.4fr);
  gap: 10px;
  align-items: end;
}

.patient-access-policy {
  margin: -2px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.patient-access-policy span,
.patient-access-policy strong {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.patient-access-policy span {
  color: var(--muted);
  text-transform: uppercase;
}

.patient-access-verification-legend {
  margin: -4px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.patient-access-verification-legend .visitor-chip {
  width: auto;
  min-width: 230px;
  padding: 7px 10px;
}

.patient-access-verification-legend .visitor-chip.verified-card {
  border-color: #22c55e;
  background: #dcfce7;
  color: #064e3b;
}

.patient-access-verification-legend .visitor-chip.context-card {
  border-color: #f97316;
  background: #ffedd5;
  color: #7a2e0e;
}

.patient-access-verification-legend em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.patient-access-list {
  max-height: 680px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
}

.patient-access-header,
.patient-access-row {
  display: grid;
  min-width: 1040px;
  grid-template-columns:
    minmax(150px, 1.05fr)
    minmax(58px, 0.38fr)
    minmax(150px, 1fr)
    minmax(130px, 0.85fr)
    minmax(130px, 0.85fr)
    minmax(130px, 0.85fr)
    minmax(120px, 0.7fr)
    minmax(88px, 0.55fr);
  gap: 6px;
  align-items: center;
}

.patient-access-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #f8fafc;
}

.patient-access-row {
  min-height: 46px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
}

.patient-access-row:nth-child(even) {
  background: #f8fbff;
}

.patient-access-row:last-child {
  border-bottom: 0;
}

.patient-access-row.approved {
  box-shadow: inset 4px 0 0 rgba(18, 183, 106, 0.72);
}

.patient-access-row.present {
  box-shadow: inset 4px 0 0 rgba(23, 92, 211, 0.70);
}

.patient-access-row.pending,
.patient-access-row.expiring,
.patient-access-row.expired {
  box-shadow: inset 4px 0 0 rgba(181, 71, 8, 0.74);
}

.patient-access-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.patient-access-room strong {
  font-size: 14px;
}

.patient-access-visitors {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.patient-access-visitors > span:first-child {
  display: none;
}

.patient-access-row > div:not(.patient-access-visitors) > span {
  display: none;
}

.patient-access-visitors .visitor-chip {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
}

.patient-access-visitors .visitor-chip.compact {
  min-height: 25px;
  border-radius: 6px;
}

.patient-access-visitors .visitor-chip.compact b {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.15;
}

.patient-access-visitors .visitor-chip.compact em,
.patient-access-visitors .visitor-chip.compact small {
  display: none;
}

.patient-access-visitors .visitor-chip.verified-card {
  border-color: #22c55e;
  background: #dcfce7;
  color: #064e3b;
}

.patient-access-visitors .visitor-chip.context-card {
  border-color: #f97316;
  background: #ffedd5;
  color: #7a2e0e;
}

.patient-verified {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #dcfce7;
  color: #067647;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
}

.patient-review {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fef0c7;
  color: #b54708;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
}

.patient-access-privacy {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
}

.patient-access-privacy strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric.online strong {
  color: var(--green);
}

.metric.offline {
  border-color: #fecdca;
  background: #fff6f5;
}

.metric.offline strong {
  color: var(--danger);
}

.wayfinding-panel {
  margin-top: 16px;
}

.wayfinding-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.wayfinding-mode-card,
.wayfinding-card,
.adoption-card {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.wayfinding-mode-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.wayfinding-mode-card.active {
  border-color: #abefc6;
  background: #f6fef9;
  box-shadow: inset 4px 0 0 var(--green);
}

.wayfinding-mode-card.emergency.active {
  border-color: #fda29b;
  background: #fff6f5;
  box-shadow: inset 4px 0 0 var(--danger);
}

.wayfinding-mode-card span,
.wayfinding-card-head span,
.adoption-card strong,
.journey-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.wayfinding-mode-card strong {
  font-size: 20px;
}

.wayfinding-mode-card p,
.wayfinding-mode-card em,
.source-row span,
.journey-step em {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
}

.wayfinding-mode-card div {
  display: grid;
  gap: 2px;
}

.wayfinding-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.wayfinding-stat {
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
}

.wayfinding-stat strong {
  display: block;
  color: var(--blue);
  font-size: 22px;
}

.wayfinding-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wayfinding-graph {
  min-height: 76px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #b2ddff;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(209, 233, 255, 0.72), rgba(240, 249, 255, 0.30)),
    #ffffff;
  display: grid;
  grid-template-columns: auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto minmax(24px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.wayfinding-graph i {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.graph-node {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #b2ddff;
  border-radius: 8px;
  color: #1849a9;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.graph-node.entry {
  border-color: #abefc6;
  color: var(--green);
}

.graph-node.target {
  border-color: #fedf89;
  color: var(--amber);
}

.graph-node.return {
  border-color: #abefc6;
  color: var(--green);
}

.graph-node.danger {
  border-color: #fda29b;
  color: var(--danger);
  background: #fff6f5;
}

.wayfinding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  margin-bottom: 12px;
}

.wayfinding-card {
  padding: 14px;
  background: #ffffff;
}

.wayfinding-card-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wayfinding-card-head strong {
  color: var(--ink);
  font-size: 13px;
}

.source-stack,
.journey-stack,
.wayfinding-roadmap {
  display: grid;
  gap: 8px;
}

.source-row {
  position: relative;
  overflow: hidden;
  min-height: 68px;
  padding: 10px 70px 12px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.source-row strong,
.journey-step strong {
  display: block;
  margin-bottom: 3px;
}

.source-row em {
  position: absolute;
  right: 12px;
  top: 10px;
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.source-row.later em {
  color: var(--muted);
}

.source-row b {
  position: absolute;
  right: 12px;
  bottom: 11px;
  font-size: 13px;
}

.source-row i {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 4px;
  background: #e6eaf0;
}

.source-row i::before {
  content: "";
  display: block;
  width: var(--confidence);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.journey-step {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.journey-step span {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--blue);
}

.wayfinding-roadmap {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.patient-threat-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.wayfinding-card-head strong.approved {
  color: var(--green);
}

.wayfinding-card-head strong.pending {
  color: var(--amber);
}

.patient-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.patient-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.patient-link-grid article,
.patient-access-grid article,
.subject-move-note,
.visitor-update-preview,
.insight-summary,
.safest-path-card {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.patient-link-grid article,
.patient-access-grid article,
.subject-move-note {
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.patient-link-grid span,
.patient-access-grid span,
.subject-move-note span,
.visitor-update-preview span,
.insight-summary span,
.safest-path-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.patient-link-grid em,
.patient-access-grid strong,
.subject-move-note strong,
.visitor-update-preview p,
.visitor-update-preview em,
.safest-path-card em,
.insight-risk-list em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
}

.visitor-update-preview {
  margin-bottom: 10px;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.visitor-update-preview.held {
  border-color: #fedf89;
  background: #fffbeb;
}

.visitor-update-preview.sent {
  border-color: #abefc6;
  background: #f6fef9;
}

.visitor-update-preview.staff-checkpoint {
  border-color: #b2ddff;
  background: #eff8ff;
}

.visitor-update-preview strong {
  font-size: 17px;
}

.subject-move-note {
  margin-bottom: 10px;
}

.wayfinding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wayfinding-actions .button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}

.wayfinding-policy-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.insight-summary {
  padding: 12px;
  margin-bottom: 10px;
}

.insight-summary p {
  margin: 4px 0 0;
  color: #344054;
  line-height: 1.45;
}

.insight-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.insight-factors span {
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  color: #344054;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.insight-risk-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.insight-risk-list article {
  padding: 10px 12px;
  border: 1px dashed #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  display: grid;
  gap: 3px;
}

.insight-risk-list article.risk-monitor {
  border-color: #b2ddff;
  background: #eff8ff;
}

.insight-risk-list article strong {
  color: var(--amber);
  font-size: 12px;
  text-transform: uppercase;
}

.insight-risk-list article.risk-monitor strong {
  color: var(--blue);
}

.safest-path-card {
  padding: 12px;
  display: grid;
  gap: 5px;
}

.safest-path-card strong {
  line-height: 1.35;
}

.gps-tester-card {
  margin-bottom: 12px;
}

.visual-intelligence-panel {
  margin-top: 16px;
}

.visual-intel-policy {
  margin: -2px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.visual-intel-policy span,
.visual-intel-policy strong {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.visual-intel-policy span {
  color: var(--muted);
  text-transform: uppercase;
}

.visual-intel-brief {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #b2ddff;
  border-radius: 8px;
  background: #eff8ff;
  display: grid;
  gap: 4px;
}

.visual-intel-brief.active {
  border-color: #fedf89;
  background: #fffbeb;
}

.visual-intel-brief span,
.visual-camera-head span,
.visual-observation-detail span,
.visual-confidence span,
.visual-review-state span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.visual-intel-brief strong,
.visual-intel-brief em {
  color: var(--ink);
  font-style: normal;
  line-height: 1.35;
}

.visual-intel-brief em {
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.visual-camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 10px;
}

.visual-camera-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-left: 5px solid #b2ddff;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.visual-camera-card.clear {
  border-left-color: #22c55e;
}

.visual-camera-card.risk {
  border-left-color: #f97316;
}

.visual-camera-card.unknown {
  border-left-color: #94a3b8;
}

.visual-camera-card.applied {
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.visual-camera-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.visual-camera-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.visual-camera-head em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.visual-camera-head b {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
}

.visual-camera-head b.clear {
  color: #067647;
  background: #dcfce7;
}

.visual-camera-head b.risk {
  color: #9a3412;
  background: #ffedd5;
}

.visual-camera-head b.unknown {
  color: #344054;
  background: #f1f5f9;
}

.visual-confidence {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px 10px;
  align-items: center;
}

.visual-confidence strong {
  justify-self: end;
}

.visual-confidence i {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eaf0;
}

.visual-confidence i::before {
  content: "";
  display: block;
  width: var(--confidence);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e90fa, #22c55e);
}

.visual-observation-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.visual-observation-detail article,
.visual-review-state {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.visual-observation-detail strong,
.visual-review-state strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.visual-camera-card p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 800;
}

.visual-review-state.clear {
  border-color: #86efac;
  background: #f0fdf4;
}

.visual-review-state.risk {
  border-color: #fdba74;
  background: #fff7ed;
}

.visual-actions {
  margin-top: 0;
}

.gps-tester-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.gps-tester-grid article {
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  align-content: start;
  gap: 4px;
}

.gps-tester-grid article.auto-verify {
  border-color: #abefc6;
  background: #f6fef9;
}

.gps-tester-grid article.self-confirm {
  border-color: #b2ddff;
  background: #eff8ff;
}

.gps-tester-grid article.qr-required {
  border-color: #fedf89;
  background: #fffbeb;
}

.gps-tester-grid span,
.gps-error {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.gps-tester-grid strong {
  overflow-wrap: anywhere;
}

.gps-tester-grid em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
}

.wayfinding-card-head strong.auto-verify {
  color: var(--green);
}

.wayfinding-card-head strong.self-confirm {
  color: var(--blue);
}

.wayfinding-card-head strong.qr-required {
  color: var(--amber);
}

.gps-error {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  color: var(--danger);
  background: #fff6f5;
}

.adoption-card {
  padding: 12px;
  background: #ffffff;
}

.adoption-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.adoption-card span {
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  color: #344054;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

.device-list,
.response-list,
.timeline-list {
  display: grid;
  gap: 8px;
}

.device-roster {
  display: grid;
  gap: 12px;
}

.device-category-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.device-category-card.patient-rooms {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 34%);
}

.device-category-card.visitor {
  border-color: #d9d6fe;
  background: linear-gradient(180deg, #f4f3ff 0%, #ffffff 34%);
}

.device-category-head {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.device-category-head span,
.patient-room-main span,
.patient-room-visitors > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.device-category-head strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
}

.device-category-head em {
  max-width: 360px;
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.device-category-list,
.patient-room-list {
  display: grid;
  gap: 8px;
}

.device-row,
.response-row,
.timeline-row {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
}

.device-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
}

.device-row.online {
  border-left: 5px solid var(--green);
}

.device-row.offline {
  border-color: #fda29b;
  border-left: 5px solid var(--danger);
  background:
    linear-gradient(90deg, rgba(254, 228, 226, 0.70), rgba(255, 255, 255, 0.92) 32%),
    #ffffff;
}

.device-row.stale,
.response-row.stale {
  border-color: #fedf89;
  border-left: 5px solid var(--amber);
  background: #fffbeb;
}

.device-main {
  min-width: 0;
}

.device-type-pill {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #344054;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.device-row span.device-type-pill.visitor {
  border-color: #c4b5fd;
  color: #5b21b6;
  background: #ede9fe;
}

.device-row span.device-type-pill.team {
  border-color: #bfdbfe;
  color: #175cd3;
  background: #eff6ff;
}

.patient-room-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  grid-template-columns: minmax(170px, 0.6fr) minmax(250px, 0.95fr) minmax(280px, 1.2fr);
  gap: 12px;
}

.patient-room-main strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 22px;
}

.patient-room-main em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.patient-room-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.patient-room-summary span {
  min-height: 58px;
  padding: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  color: #475467;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.patient-room-summary strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.1;
  text-transform: none;
  overflow-wrap: anywhere;
}

.patient-room-visitors div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.visitor-chip {
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-transform: none;
}

.visitor-chip b,
.visitor-chip em {
  display: block;
}

.visitor-chip b {
  color: var(--ink);
  font-size: 13px;
}

.visitor-chip em,
.visitor-chip small,
.patient-room-visitors div > em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.visitor-chip small {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.visitor-chip.approved {
  border-color: #86efac;
  background: #f0fdf4;
}

.visitor-chip.online {
  border-color: #abefc6;
  background: #f6fef9;
}

.visitor-chip.offline {
  border-color: #fecdca;
  background: #fff6f5;
}

.visitor-chip.pending {
  border-color: #fedf89;
  background: #fffbeb;
}

.device-row strong,
.response-row strong,
.timeline-row strong {
  display: block;
  margin-bottom: 3px;
}

.device-row span,
.response-row span,
.timeline-row span {
  color: var(--muted);
  font-size: 12px;
}

.device-presence-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(16, 24, 40, 0.06);
}

.device-presence-dot.online {
  background: var(--green);
  box-shadow:
    0 0 0 4px rgba(18, 183, 106, 0.16),
    0 0 12px rgba(18, 183, 106, 0.32);
}

.device-presence-dot.offline {
  background: var(--danger);
  box-shadow:
    0 0 0 4px rgba(180, 35, 24, 0.14),
    0 0 12px rgba(180, 35, 24, 0.28);
}

.device-status-pill {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.device-status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.device-status-pill.online {
  border-color: #abefc6;
  color: #05603a;
  background: #dcfae6;
}

.device-status-pill.online i {
  background: var(--green);
}

.device-status-pill.offline {
  border-color: #fecdca;
  color: var(--danger-strong);
  background: #fee4e2;
}

.device-status-pill.offline i {
  background: var(--danger);
}

.device-row .device-delivery-pill {
  border-color: var(--soft-line);
  color: #344054;
  background: #f8fafc;
}

.device-row .pill.warning {
  border-color: #fedf89;
  color: var(--amber);
  background: var(--amber-soft);
}

.map-panel {
  margin-top: 16px;
}

.occupancy-panel {
  margin-top: 16px;
}

.occupancy-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.occupancy-stat {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 4px;
}

.occupancy-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.occupancy-stat strong {
  color: var(--ink);
  font-size: 24px;
}

.floor-layer-stack {
  display: grid;
  gap: 10px;
}

.building-stack-shell {
  margin-bottom: 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: #061525;
  overflow: hidden;
}

.building-stack-head,
.stack-legend,
.stack-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.building-stack-head {
  border-bottom: 1px solid var(--soft-line);
  background: #ffffff;
}

.building-stack-head h4 {
  margin: 0;
  font-size: 18px;
}

.stack-legend {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  background: #14569c;
}

.stack-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stack-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.legend-threat {
  background: var(--danger);
}

.legend-occupancy {
  background: var(--teal);
}

.legend-exit {
  background: var(--green);
}

.legend-connector {
  border: 1px solid rgba(216, 180, 254, 0.92);
  border-radius: 3px !important;
  background:
    linear-gradient(90deg, transparent 32%, rgba(243, 232, 255, 0.95) 46%, rgba(168, 85, 247, 0.95) 54%, transparent 68%),
    rgba(126, 34, 206, 0.34);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.45);
}

.legend-evac {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.58);
}

.legend-route-medium {
  background: rgba(250, 204, 21, 0.78);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.46);
}

.legend-route-danger {
  background: rgba(239, 68, 68, 0.72);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.46);
}

.legend-camera-clear {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.58);
}

.legend-camera-status {
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 3px !important;
  background:
    radial-gradient(circle at 35% 70%, #22c55e 0 18%, transparent 20%),
    radial-gradient(circle at 70% 70%, #ef4444 0 18%, transparent 20%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(148, 163, 184, 0.62));
  box-shadow:
    0 0 8px rgba(34, 197, 94, 0.28),
    0 0 8px rgba(239, 68, 68, 0.20);
}

.legend-quadrant {
  border: 1px solid rgba(209, 233, 255, 0.92);
  border-radius: 3px !important;
  background:
    linear-gradient(90deg, transparent 46%, rgba(209, 233, 255, 0.92) 46%, rgba(209, 233, 255, 0.92) 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(209, 233, 255, 0.92) 46%, rgba(209, 233, 255, 0.92) 54%, transparent 54%),
    rgba(56, 189, 248, 0.20);
}

.legend-spread {
  border-radius: 3px !important;
  background: var(--amber);
}

.stack-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: #14569c;
}

.stack-control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-view-controls {
  align-items: flex-start;
  padding-left: 0;
  border-left: 0;
}

.stack-view-controls span {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
}

.stack-control-label {
  min-width: 52px;
  padding-top: 10px;
}

.stack-orbit-rows {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.stack-orbit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.stack-orbit-row-label {
  width: 48px;
  flex: 0 0 48px;
  text-align: right;
  opacity: 0.86;
}

.stack-orbit-row.utility {
  padding-top: 2px;
}

.stack-control {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 7px 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.stack-control:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.stack-control.active {
  border-color: #ffffff;
  color: #073b6f;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(209, 233, 255, 0.28);
}

.stack-control.secondary {
  color: #dbeafe;
}

.stack-readout {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.building-stack-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  min-width: 0;
}

.xray-view-column {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.xray-route-callout-row {
  position: relative;
  min-width: 0;
  padding: 0 12px 2px;
  display: flex;
  align-items: flex-end;
}

.xray-route-callout-row.align-left {
  justify-content: flex-start;
}

.xray-route-callout-row.align-center {
  justify-content: center;
}

.xray-route-callout-row.align-right {
  justify-content: flex-end;
}

.xray-route-callout-row::after {
  content: "";
  position: absolute;
  left: var(--route-x);
  bottom: -8px;
  width: 1px;
  height: 10px;
  background: linear-gradient(180deg, rgba(187, 247, 208, 0.68), rgba(187, 247, 208, 0));
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.40);
  pointer-events: none;
}

.xray-route-callout-row .xray-route-badge {
  width: min(430px, 100%);
  padding: 9px 11px;
  border: 1px solid rgba(187, 247, 208, 0.54);
  border-radius: 8px;
  color: #dcfce7;
  background: rgba(2, 44, 34, 0.88);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.28);
  pointer-events: none;
}

.xray-route-callout-row .xray-route-badge span,
.xray-route-callout-row .xray-route-badge em {
  display: block;
  color: rgba(220, 252, 231, 0.78);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
}

.xray-route-callout-row .xray-route-badge strong {
  display: block;
  margin: 3px 0;
  color: #ffffff;
  font-size: 16px;
}

.stack-scene {
  position: relative;
  min-height: var(--scene-height, 560px);
  margin: 0;
  overflow: hidden;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background:
    radial-gradient(circle at 48% 54%, rgba(255, 255, 255, 0.13), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.10) 0, rgba(255, 255, 255, 0.10) 1px, transparent 1px, transparent 26px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 1px, transparent 1px, transparent 26px),
    #14569c;
  cursor: grab;
  perspective: 1100px;
  perspective-origin: 52% 46%;
  touch-action: none;
  user-select: none;
}

.stack-elevation {
  cursor: default;
  perspective: none;
  touch-action: auto;
  background:
    radial-gradient(circle at 50% 88%, rgba(56, 189, 248, 0.20), transparent 36%),
    radial-gradient(circle at 54% 44%, rgba(14, 116, 144, 0.18), transparent 30%),
    linear-gradient(180deg, #020617 0%, #061525 58%, #030712 100%);
}

.stack-scene.dragging {
  cursor: grabbing;
}

.stack-model {
  position: absolute;
  inset: 0;
  transform: rotateX(var(--stack-tilt, 16deg)) rotateY(var(--stack-rotate, -18deg)) rotateZ(-5deg);
  transform-origin: 50% 62%;
  transform-style: preserve-3d;
  transition: transform 160ms ease;
}

.stack-scene.dragging .stack-model {
  transition: none;
}

.stack-elevation .stack-model {
  transform: none;
  transform-origin: 50% 50%;
}

.xray-shell,
.xray-roofline,
.xray-window-grid,
.xray-volume {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.xray-shell {
  left: 9%;
  right: 9%;
  bottom: 30px;
  height: calc(var(--stack-height, 390px) + 38px);
  border: 2px solid rgba(125, 211, 252, 0.52);
  border-radius: 10px 10px 6px 6px;
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.025) 42%, rgba(56, 189, 248, 0.12)),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 48px rgba(56, 189, 248, 0.12),
    0 0 32px rgba(56, 189, 248, 0.20);
}

.xray-shell::before,
.xray-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(125, 211, 252, 0.34);
}

.xray-shell::before {
  left: 33%;
}

.xray-shell::after {
  right: 33%;
}

.xray-roofline {
  left: 12%;
  right: 12%;
  bottom: calc(var(--roof-bottom, 398px) + 20px);
  height: 34px;
  border: 2px solid rgba(125, 211, 252, 0.50);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), transparent);
}

.xray-window-grid {
  left: 11%;
  right: 11%;
  bottom: 44px;
  height: var(--stack-height, 390px);
  background:
    repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.16) 0, rgba(125, 211, 252, 0.16) 1px, transparent 1px, transparent 54px),
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.14) 0, rgba(125, 211, 252, 0.14) 1px, transparent 1px, transparent 62px);
  opacity: 0.65;
}

.stack-elevation .building-wire {
  left: 12%;
  width: 76%;
  height: 96px;
  transform: none;
  border-color: rgba(209, 233, 255, 0.40);
  background: rgba(209, 233, 255, 0.025);
}

.stack-elevation .building-base-wire {
  bottom: 42px;
}

.stack-elevation .building-roof-wire {
  left: 12%;
  bottom: var(--roof-bottom, 398px);
}

.stack-elevation .building-wall {
  border-color: rgba(209, 233, 255, 0.24);
  transform: none;
  background:
    repeating-linear-gradient(90deg, rgba(209, 233, 255, 0.12) 0, rgba(209, 233, 255, 0.12) 1px, transparent 1px, transparent 72px),
    rgba(209, 233, 255, 0.035);
}

.stack-elevation .building-front-wall {
  left: 12%;
  bottom: 42px;
  width: 76%;
  height: var(--stack-height, 390px);
  clip-path: none;
}

.stack-elevation .building-side-wall {
  right: 12%;
  bottom: 42px;
  width: 12%;
  height: var(--stack-height, 390px);
  clip-path: none;
  opacity: 0.72;
}

.stack-elevation .building-column {
  height: var(--stack-height, 390px);
  transform: none;
  width: 3px;
  background: rgba(209, 233, 255, 0.72);
  box-shadow: 0 0 12px rgba(209, 233, 255, 0.28);
}

.stack-elevation .column-a {
  left: 13%;
  bottom: 42px;
}

.stack-elevation .column-b {
  left: 38%;
  bottom: 42px;
}

.stack-elevation .column-c {
  right: 38%;
  bottom: 42px;
}

.stack-elevation .column-d {
  right: 13%;
  bottom: 42px;
}

.stack-elevation .building-core {
  height: var(--core-height, 344px);
  transform: none;
  border-color: rgba(209, 233, 255, 0.58);
  background:
    repeating-linear-gradient(0deg, rgba(209, 233, 255, 0.20) 0, rgba(209, 233, 255, 0.20) 1px, transparent 1px, transparent 42px),
    rgba(209, 233, 255, 0.055);
}

.stack-elevation .building-core b {
  transform: rotate(-90deg);
}

.stack-elevation .stair-core {
  left: 18%;
  bottom: 64px;
}

.stack-elevation .elevator-core {
  right: 20%;
  bottom: 64px;
}

.stack-elevation .stack-floor {
  left: calc(12% + var(--level-x));
  bottom: calc(42px + var(--level-offset));
  width: 76%;
  height: 96px;
  transform: none;
  z-index: 4;
}

.stack-elevation .stack-floor-plate {
  overflow: hidden;
  border-color: rgba(209, 233, 255, 0.42);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(209, 233, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 10px 24px rgba(4, 18, 38, 0.14);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.stack-elevation .stack-floor-plate::before {
  right: 0;
  bottom: 0;
  height: var(--slab-depth, 12px);
  transform: none;
  border-color: rgba(209, 233, 255, 0.26);
  background: rgba(209, 233, 255, 0.12);
}

.stack-elevation .stack-floor-plate::after {
  display: none;
}

.stack-elevation .stack-floor-label {
  display: grid !important;
  transform: none;
  left: 14px;
  top: 12px;
}

.stack-elevation .stack-floor-label strong {
  color: #ffffff;
  font-size: 15px;
  text-shadow: 0 0 10px rgba(4, 18, 38, 0.8);
}

.stack-elevation .stack-floor-label span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.stack-elevation .stack-floor:hover .stack-floor-plate,
.stack-elevation .stack-floor.selected .stack-floor-plate {
  border-color: #ffffff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11), rgba(209, 233, 255, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(209, 233, 255, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 0 4px rgba(209, 233, 255, 0.22),
    0 16px 30px rgba(4, 18, 38, 0.18);
}

.stack-elevation .stack-floor.source-floor .stack-floor-plate {
  border-color: rgba(255, 214, 210, 0.92);
  background:
    linear-gradient(90deg, rgba(255, 214, 210, 0.08), rgba(255, 214, 210, 0.18), rgba(255, 214, 210, 0.08)),
    rgba(255, 214, 210, 0.06);
}

.stack-load-meter {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 13px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  z-index: 5;
}

.stack-load-meter i {
  display: block;
  width: var(--floor-load, 18%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(14, 148, 136, 0.82), rgba(132, 202, 255, 0.92));
}

.stack-elevation .stack-occupancy-dot,
.stack-elevation .stack-exit,
.stack-elevation .stack-threat-marker {
  transform: none;
}

.stack-elevation .stack-occupancy-dot {
  width: 11px;
  height: 11px;
  margin: -5px 0 0 -5px;
  border: 1px solid rgba(45, 212, 191, 0.72);
  background: rgba(45, 212, 191, 0.58);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.34);
  opacity: 0.78;
}

.stack-elevation .stack-exit {
  width: 13px;
  height: 13px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(187, 247, 208, 0.88);
  background: rgba(22, 163, 74, 0.86);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.34);
}

.stack-elevation .stack-exit.preferred::after {
  left: 14px;
  top: 3px;
  width: 42px;
  height: 2px;
  background: rgba(34, 197, 94, 0.76);
  box-shadow: 10px 0 0 rgba(34, 197, 94, 0.56);
}

.stack-elevation .spread-column,
.stack-elevation .containment-ring {
  left: 50%;
  bottom: 54px;
  height: var(--spread-height, 374px);
  opacity: 0.72;
}

.stack-elevation.stack-view-side .building-wire,
.stack-elevation.stack-view-side .stack-floor,
.stack-elevation.stack-view-side .building-front-wall,
.stack-elevation.stack-view-side .building-roof-wire,
.stack-elevation.stack-view-side .xray-window-grid {
  left: 31%;
  width: 38%;
}

.stack-elevation.stack-view-side .xray-shell {
  left: 28%;
  right: 28%;
}

.stack-elevation.stack-view-side .xray-roofline {
  left: 31%;
  right: 31%;
}

.stack-elevation.stack-view-side .building-side-wall {
  right: 31%;
  width: 10%;
}

.stack-elevation.stack-view-side .stack-floor {
  left: calc(31% + var(--level-x));
  transform: skewX(-5deg);
}

.stack-elevation.stack-view-side .stack-floor-label,
.stack-elevation.stack-view-side .stack-occupancy-dot,
.stack-elevation.stack-view-side .stack-exit,
.stack-elevation.stack-view-side .stack-threat-marker {
  transform: skewX(5deg);
}

.stack-elevation.stack-view-side .column-a {
  left: 32%;
}

.stack-elevation.stack-view-side .column-b {
  left: 44%;
}

.stack-elevation.stack-view-side .column-c {
  right: 44%;
}

.stack-elevation.stack-view-side .column-d {
  right: 32%;
}

.stack-elevation.stack-view-side .stair-core {
  left: 34%;
}

.stack-elevation.stack-view-side .elevator-core {
  right: 34%;
}

.stack-elevation.stack-view-back .building-front-wall,
.stack-elevation.stack-view-back .stack-floor-plate {
  background:
    repeating-linear-gradient(90deg, rgba(209, 233, 255, 0.15) 0, rgba(209, 233, 255, 0.15) 1px, transparent 1px, transparent 58px),
    rgba(209, 233, 255, 0.045);
}

.stack-elevation .xray-volume {
  border: 1.5px solid rgba(125, 211, 252, 0.42);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.15), rgba(56, 189, 248, 0.04)),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 26px rgba(56, 189, 248, 0.10),
    0 0 18px rgba(56, 189, 248, 0.16);
  opacity: 0.78;
}

.stack-elevation .xray-volume::before,
.stack-elevation .xray-volume::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stack-elevation .xray-volume::before {
  background: repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.20) 0, rgba(125, 211, 252, 0.20) 1px, transparent 1px, transparent 28px);
}

.stack-elevation .xray-volume::after {
  background: repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.14) 0, rgba(125, 211, 252, 0.14) 1px, transparent 1px, transparent 42px);
}

.stack-elevation .volume-west {
  left: 16%;
  bottom: 102px;
  width: 26%;
  height: 206px;
}

.stack-elevation .volume-mid {
  left: 43%;
  bottom: 166px;
  width: 20%;
  height: 184px;
}

.stack-elevation .volume-tower-a {
  right: 18%;
  bottom: 188px;
  width: 10%;
  height: 266px;
}

.stack-elevation .volume-tower-b {
  right: 8%;
  bottom: 150px;
  width: 8%;
  height: 312px;
}

.stack-elevation .building-wire {
  border-color: rgba(125, 211, 252, 0.42);
  background: rgba(56, 189, 248, 0.025);
  filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.26));
}

.stack-elevation .building-roof-wire {
  border-color: rgba(125, 211, 252, 0.58);
  background: rgba(56, 189, 248, 0.08);
}

.stack-elevation .building-wall {
  border-color: rgba(125, 211, 252, 0.30);
  background:
    repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.18) 0, rgba(125, 211, 252, 0.18) 1px, transparent 1px, transparent 72px),
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.12) 0, rgba(125, 211, 252, 0.12) 1px, transparent 1px, transparent 48px),
    rgba(56, 189, 248, 0.035);
}

.stack-elevation .building-column {
  background: rgba(125, 211, 252, 0.78);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.38);
}

.stack-elevation .building-core {
  border-color: rgba(125, 211, 252, 0.58);
  background:
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.18) 0, rgba(125, 211, 252, 0.18) 1px, transparent 1px, transparent 42px),
    rgba(56, 189, 248, 0.06);
  color: rgba(224, 242, 254, 0.86);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.12);
}

.stack-elevation .stack-floor-plate {
  border-color: rgba(125, 211, 252, 0.48);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 22px rgba(56, 189, 248, 0.08),
    0 0 18px rgba(56, 189, 248, 0.10);
}

.stack-elevation .stack-floor-plate::before {
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(56, 189, 248, 0.12);
}

.stack-elevation .stack-grid {
  background:
    repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.18) 0, rgba(125, 211, 252, 0.18) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.13) 0, rgba(125, 211, 252, 0.13) 1px, transparent 1px, transparent 34px);
}

.stack-elevation .stack-room-outline {
  border-color: rgba(125, 211, 252, 0.30);
  background: rgba(56, 189, 248, 0.035);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12);
}

.stack-elevation .stack-room-outline::before,
.stack-elevation .stack-room-outline::after {
  background: rgba(125, 211, 252, 0.24);
}

.stack-elevation .stack-room-outline.source-room {
  border-color: rgba(251, 146, 60, 0.96);
  background:
    radial-gradient(circle at 50% 56%, rgba(251, 146, 60, 0.36), rgba(251, 146, 60, 0.15) 54%, rgba(251, 146, 60, 0.06));
  box-shadow:
    0 0 24px rgba(251, 146, 60, 0.58),
    inset 0 0 18px rgba(251, 146, 60, 0.34);
}

.stack-elevation .stack-room-outline.source-room::before,
.stack-elevation .stack-room-outline.source-room::after {
  background: rgba(251, 146, 60, 0.66);
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.54);
}

.stack-elevation .stack-floor:hover .stack-floor-plate,
.stack-elevation .stack-floor.selected .stack-floor-plate {
  border-color: rgba(224, 242, 254, 0.96);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(56, 189, 248, 0.20), rgba(255, 255, 255, 0.05)),
    rgba(56, 189, 248, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 0 3px rgba(125, 211, 252, 0.20),
    0 0 26px rgba(56, 189, 248, 0.24);
}

.stack-elevation .stack-floor.source-floor .stack-floor-plate {
  border-color: rgba(251, 146, 60, 0.76);
  background:
    linear-gradient(90deg, rgba(251, 146, 60, 0.06), rgba(56, 189, 248, 0.12), rgba(251, 146, 60, 0.06)),
    rgba(255, 255, 255, 0.035);
}

.stack-elevation .stack-floor.source-floor.selected .stack-floor-plate {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 0 3px rgba(251, 146, 60, 0.22),
    0 0 30px rgba(251, 146, 60, 0.30),
    0 0 26px rgba(56, 189, 248, 0.18);
}

.stack-elevation .stack-threat-marker {
  border-color: rgba(251, 146, 60, 0.48);
  background: rgba(251, 146, 60, 0.20);
  box-shadow: 0 0 28px rgba(251, 146, 60, 0.58);
}

.stack-elevation .stack-threat-marker b {
  background: #fb923c;
  box-shadow:
    0 0 0 10px rgba(251, 146, 60, 0.18),
    0 0 22px rgba(251, 146, 60, 0.80);
}

.stack-elevation .stack-load-meter i {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.84), rgba(125, 211, 252, 0.94));
}

.stack-elevation .spread-column span {
  border-color: rgba(251, 191, 36, 0.34);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.12), rgba(251, 146, 60, 0.04));
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.14);
}

.building-stack-shell .legend-threat {
  background: #fb923c;
}

.building-stack-shell .stack-legend {
  color: #dff5ff;
  background: #061525;
}

.stack-elevation.stack-view-side .xray-volume {
  opacity: 0.72;
}

.stack-elevation.stack-view-side .volume-west {
  left: 33%;
  width: 14%;
}

.stack-elevation.stack-view-side .volume-mid {
  left: 48%;
  width: 10%;
}

.stack-elevation.stack-view-side .volume-tower-a {
  right: 34%;
  width: 6%;
}

.stack-elevation.stack-view-side .volume-tower-b {
  right: 28%;
  width: 5%;
}

.stack-elevation.stack-view-back .building-front-wall,
.stack-elevation.stack-view-back .stack-floor-plate {
  background:
    repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.18) 0, rgba(125, 211, 252, 0.18) 1px, transparent 1px, transparent 58px),
    rgba(56, 189, 248, 0.045);
}

.stack-elevation.stack-view-xray {
  min-height: var(--scene-height, 472px);
  height: var(--scene-height, 472px);
  border-color: rgba(56, 189, 248, 0.26);
  background:
    radial-gradient(ellipse at 24% 91%, rgba(125, 211, 252, 0.30), transparent 28%),
    radial-gradient(circle at 54% 36%, rgba(14, 116, 144, 0.18), transparent 34%),
    linear-gradient(180deg, #020617 0%, #030712 58%, #010409 100%);
  cursor: grab;
  perspective: 1180px;
  perspective-origin: 50% 43%;
  touch-action: none;
}

.stack-elevation.stack-view-xray.dragging {
  cursor: grabbing;
}

.stack-elevation.stack-view-xray::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.stack-elevation.stack-view-xray::before {
  left: 12%;
  right: 10%;
  bottom: 26px;
  height: 118px;
  background:
    linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.16), transparent),
    repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.10) 0, rgba(125, 211, 252, 0.10) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.07) 0, rgba(125, 211, 252, 0.07) 1px, transparent 1px, transparent 28px);
  transform: perspective(900px) rotateX(72deg);
  transform-origin: 50% 100%;
  opacity: 0.58;
  filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.20));
}

.stack-elevation.stack-view-xray .stack-model {
  transform: translate(0, 0) rotateX(var(--xray-tilt, 0deg)) rotateY(var(--xray-rotate, 0deg));
  transform-origin: 50% 56%;
  transform-style: preserve-3d;
}

.stack-elevation.stack-view-xray .building-envelope {
  transform: translateZ(12px);
  transform-style: preserve-3d;
}

.stack-elevation.stack-view-xray .xray-shell {
  left: 15%;
  right: 15%;
  bottom: 62px;
  height: calc(var(--roof-bottom, 428px) - 62px);
  border-width: 1px;
  border-style: dashed;
  border-color: rgba(125, 211, 252, 0.32);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.035), rgba(56, 189, 248, 0.006)),
    rgba(15, 23, 42, 0.10);
  box-shadow:
    inset 0 0 0 1px rgba(125, 211, 252, 0.06),
    inset 0 0 32px rgba(56, 189, 248, 0.05);
  opacity: 0.46;
  transform: translateZ(-170px);
}

.stack-elevation.stack-view-xray .xray-shell::before,
.stack-elevation.stack-view-xray .xray-shell::after {
  display: none;
}

.stack-elevation.stack-view-xray .xray-roofline {
  display: none;
}

.stack-elevation.stack-view-xray .xray-window-grid {
  display: none;
}

.stack-elevation.stack-view-xray .building-wire {
  left: 15%;
  width: 70%;
  height: 230px;
  border-color: rgba(125, 211, 252, 0.50);
  transform: translateZ(72px) rotateX(90deg);
  transform-origin: 50% 100%;
}

.stack-elevation.stack-view-xray .building-base-wire {
  bottom: 62px;
}

.stack-elevation.stack-view-xray .building-roof-wire {
  left: 18%;
  bottom: var(--roof-bottom, 428px);
  width: 64%;
}

.stack-elevation.stack-view-xray .building-wall {
  display: none;
}

.stack-elevation.stack-view-xray .building-front-wall {
  left: 15%;
  bottom: 62px;
  width: 70%;
  height: calc(var(--roof-bottom, 428px) - 62px);
}

.stack-elevation.stack-view-xray .building-side-wall {
  right: 15%;
  bottom: 62px;
  width: 12%;
  height: calc(var(--roof-bottom, 428px) - 62px);
  opacity: 0.46;
}

.stack-elevation.stack-view-xray .building-column {
  display: none;
}

.stack-elevation.stack-view-xray .column-a {
  left: 15%;
  bottom: 62px;
}

.stack-elevation.stack-view-xray .column-b {
  left: 38%;
  bottom: 62px;
}

.stack-elevation.stack-view-xray .column-c {
  right: 34%;
  bottom: 62px;
}

.stack-elevation.stack-view-xray .column-d {
  right: 15%;
  bottom: 62px;
}

.stack-elevation.stack-view-xray .building-core {
  display: none;
}

.stack-elevation.stack-view-xray .building-core b {
  display: none;
}

.stack-elevation.stack-view-xray .stair-core {
  left: 24%;
  bottom: 114px;
}

.stack-elevation.stack-view-xray .elevator-core {
  right: 25%;
  bottom: 130px;
}

.stack-elevation.stack-view-xray .xray-connector-layer {
  position: absolute;
  inset: 0;
  z-index: 42;
  pointer-events: none;
  transform-style: preserve-3d;
}

.stack-elevation.stack-view-xray .xray-vertical-connector {
  position: absolute;
  left: var(--connector-x);
  bottom: 66px;
  width: 0;
  height: calc(var(--roof-bottom, 428px) - 66px);
  border: 0;
  border-radius: 999px;
  opacity: 0.88;
  backface-visibility: visible;
  background: transparent;
  box-shadow: none;
  filter: none;
  transform:
    translateX(-50%)
    translateZ(var(--connector-z));
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 24;
}

.stack-elevation.stack-view-xray .xray-vertical-connector::before,
.stack-elevation.stack-view-xray .xray-vertical-connector::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--connector-width, 28px);
  height: 100%;
  border-radius: 999px;
  backface-visibility: visible;
  background:
    linear-gradient(90deg, transparent 0%, rgba(125, 211, 252, 0.12) 27%, rgba(224, 242, 254, 0.68) 50%, rgba(125, 211, 252, 0.12) 73%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(125, 211, 252, 0.14) 8%, rgba(125, 211, 252, 0.26) 50%, rgba(125, 211, 252, 0.14) 92%, transparent 100%);
  box-shadow:
    0 0 18px rgba(125, 211, 252, 0.28),
    0 0 42px rgba(56, 189, 248, 0.16);
  filter: blur(0.35px);
  mix-blend-mode: screen;
  opacity: 0.78;
  transform: translateX(-50%) rotateY(0deg);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
}

.stack-elevation.stack-view-xray .xray-vertical-connector::after {
  opacity: 0.58;
  transform: translateX(-50%) rotateY(90deg);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.stair {
  --connector-width: 28px;
  opacity: 0.84;
  z-index: 3;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.stair::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.stair::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(14, 165, 233, 0.16) 28%, rgba(221, 214, 254, 0.62) 50%, rgba(14, 165, 233, 0.16) 72%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(14, 165, 233, 0.18) 8%, rgba(168, 85, 247, 0.18) 50%, rgba(14, 165, 233, 0.18) 92%, transparent 100%);
  box-shadow:
    0 0 18px rgba(125, 211, 252, 0.26),
    0 0 42px rgba(168, 85, 247, 0.14);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.elevator {
  --connector-width: 30px;
  opacity: 0.90;
  z-index: 4;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.elevator::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.elevator::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(168, 85, 247, 0.18) 28%, rgba(243, 232, 255, 0.74) 50%, rgba(168, 85, 247, 0.18) 72%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(168, 85, 247, 0.22) 8%, rgba(216, 180, 254, 0.30) 50%, rgba(168, 85, 247, 0.22) 92%, transparent 100%);
  box-shadow:
    0 0 22px rgba(168, 85, 247, 0.38),
    0 0 54px rgba(126, 34, 206, 0.22);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.unavailable {
  opacity: 0.72;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.elevator.unavailable {
  opacity: 0.76;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route {
  opacity: 0.98;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.elevator.route {
  --connector-width: 34px;
  opacity: 0.96;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.elevator.route::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.elevator.route::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(168, 85, 247, 0.22) 28%, rgba(243, 232, 255, 0.82) 48%, rgba(187, 247, 208, 0.38) 57%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(168, 85, 247, 0.26) 8%, rgba(216, 180, 254, 0.36) 50%, rgba(34, 197, 94, 0.18) 92%, transparent 100%);
  box-shadow:
    0 0 26px rgba(168, 85, 247, 0.42),
    0 0 60px rgba(126, 34, 206, 0.24),
    0 0 76px rgba(34, 197, 94, 0.14);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.stair.route {
  --connector-width: 34px;
  opacity: 0.98;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.stair.route::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.stair.route::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(14, 165, 233, 0.20) 28%, rgba(243, 232, 255, 0.76) 48%, rgba(187, 247, 208, 0.40) 57%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(14, 165, 233, 0.24) 8%, rgba(168, 85, 247, 0.28) 50%, rgba(34, 197, 94, 0.20) 92%, transparent 100%);
  box-shadow:
    0 0 24px rgba(168, 85, 247, 0.34),
    0 0 56px rgba(125, 211, 252, 0.30),
    0 0 72px rgba(34, 197, 94, 0.16);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-danger {
  --connector-width: 36px;
  opacity: 0.94;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-danger::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-danger::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.16) 28%, rgba(254, 202, 202, 0.66) 50%, rgba(239, 68, 68, 0.16) 72%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(239, 68, 68, 0.18) 8%, rgba(248, 113, 113, 0.34) 50%, rgba(239, 68, 68, 0.18) 92%, transparent 100%);
  box-shadow:
    0 0 24px rgba(239, 68, 68, 0.40),
    0 0 62px rgba(127, 29, 29, 0.30);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-medium {
  --connector-width: 34px;
  opacity: 0.94;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-medium::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-medium::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(250, 204, 21, 0.16) 28%, rgba(254, 240, 138, 0.70) 50%, rgba(250, 204, 21, 0.16) 72%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(250, 204, 21, 0.18) 8%, rgba(234, 179, 8, 0.34) 50%, rgba(250, 204, 21, 0.18) 92%, transparent 100%);
  box-shadow:
    0 0 22px rgba(250, 204, 21, 0.38),
    0 0 58px rgba(180, 83, 9, 0.24);
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-best {
  --connector-width: 38px;
  opacity: 0.99;
  z-index: 8;
}

.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-best::before,
.stack-elevation.stack-view-xray .xray-vertical-connector.route-risk-best::after {
  border: 1px solid rgba(187, 247, 208, 0.50);
  outline: 1px solid rgba(74, 222, 128, 0.34);
  outline-offset: 3px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(34, 197, 94, 0.20) 26%, rgba(220, 252, 231, 0.84) 49%, rgba(134, 239, 172, 0.44) 58%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(34, 197, 94, 0.24) 8%, rgba(22, 163, 74, 0.42) 50%, rgba(34, 197, 94, 0.24) 92%, transparent 100%);
  box-shadow:
    0 0 28px rgba(34, 197, 94, 0.54),
    0 0 72px rgba(22, 163, 74, 0.34),
    0 0 92px rgba(187, 247, 208, 0.16);
  animation: xrayBestRoutePulse 1.55s ease-in-out infinite;
}

.stack-elevation.stack-view-xray .xray-volume {
  display: none;
}

.stack-elevation.stack-view-xray .xray-volume::before {
  inset: auto -18px -18px 18px;
  height: 18px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-top: 0;
  background: rgba(56, 189, 248, 0.08);
  transform: skewX(-45deg);
  transform-origin: left top;
}

.stack-elevation.stack-view-xray .xray-volume::after {
  inset: -18px -18px 18px auto;
  width: 18px;
  border: 1px solid rgba(125, 211, 252, 0.30);
  border-left: 0;
  background: rgba(56, 189, 248, 0.06);
  transform: skewY(-45deg);
  transform-origin: left bottom;
}

.stack-elevation.stack-view-xray .volume-podium {
  left: 13%;
  bottom: 64px;
  width: 72%;
  height: 78px;
}

.stack-elevation.stack-view-xray .volume-west {
  left: 14%;
  bottom: 138px;
  width: 25%;
  height: 170px;
}

.stack-elevation.stack-view-xray .volume-mid {
  left: 38%;
  bottom: 192px;
  width: 24%;
  height: 216px;
}

.stack-elevation.stack-view-xray .volume-east {
  left: 62%;
  bottom: 138px;
  width: 21%;
  height: 178px;
}

.stack-elevation.stack-view-xray .volume-bridge {
  left: 29%;
  bottom: 264px;
  width: 47%;
  height: 66px;
  opacity: 0.70;
}

.stack-elevation.stack-view-xray .volume-tower-a {
  left: 55%;
  right: auto;
  bottom: 282px;
  width: 12%;
  height: 262px;
}

.stack-elevation.stack-view-xray .volume-tower-b {
  left: 69%;
  right: auto;
  bottom: 250px;
  width: 10%;
  height: 316px;
}

.stack-elevation.stack-view-xray .volume-tower-c {
  left: 46%;
  bottom: 330px;
  width: 9%;
  height: 176px;
}

.stack-elevation.stack-view-xray .stack-floor {
  left: calc(15% + var(--level-x));
  bottom: calc(66px + var(--level-offset));
  width: 70%;
  height: var(--floor-height, 230px);
  overflow: visible;
  transform: translateZ(72px) rotateX(90deg);
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
}

.stack-elevation.stack-view-xray .stack-floor::before {
  content: "";
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  border: 1px solid rgba(125, 211, 252, 0.30);
  border-top: 0;
  background: rgba(56, 189, 248, 0.075);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.16);
  opacity: 0.78;
  pointer-events: none;
  transform: translateZ(-5px);
  transform-style: preserve-3d;
}

.stack-elevation.stack-view-xray .stack-floor-plate {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-color: rgba(125, 211, 252, 0.52);
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.04), rgba(125, 211, 252, 0.10), rgba(56, 189, 248, 0.035)),
    rgba(255, 255, 255, 0.025);
  clip-path: inset(0 round 6px);
  transform-style: preserve-3d;
  z-index: 2;
}

.stack-elevation.stack-view-xray .stack-grid,
.stack-elevation.stack-view-xray .stack-room-outline:not(.source-room) {
  display: none;
}

.stack-elevation.stack-view-xray .stack-quadrants {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  pointer-events: none;
}

.stack-elevation.stack-view-xray .stack-quadrant-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(56, 189, 248, 0.035);
  box-shadow: inset 0 0 18px rgba(56, 189, 248, 0.045);
}

.stack-elevation.stack-view-xray .stack-quadrant-cell::after {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: 10px;
  color: rgba(224, 242, 254, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(2, 6, 23, 0.88);
  transform: none;
}

.stack-elevation.stack-view-xray .stack-quadrant-cell.source {
  border-color: rgba(251, 146, 60, 0.66);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(251, 146, 60, 0.20), rgba(251, 146, 60, 0.06) 60%, transparent 82%),
    rgba(251, 146, 60, 0.045);
  box-shadow:
    inset 0 0 28px rgba(251, 146, 60, 0.16),
    0 0 20px rgba(251, 146, 60, 0.16);
}

.stack-elevation.stack-view-xray .stack-quadrant-cell.source::after {
  color: #fed7aa;
}

.stack-elevation.stack-view-xray .stack-floor-plate::before {
  left: 0;
  right: -16px;
  bottom: calc(-1 * var(--slab-depth, 16px));
  height: var(--slab-depth, 16px);
  transform: skewX(42deg);
  transform-origin: left top;
  background: rgba(56, 189, 248, 0.10);
}

.stack-elevation.stack-view-xray .stack-floor-plate::before,
.stack-elevation.stack-view-xray .stack-floor-plate::after {
  display: none;
}

.stack-elevation.stack-view-xray .stack-floor.source-floor .stack-floor-plate {
  border-color: rgba(251, 146, 60, 0.84);
  background:
    linear-gradient(90deg, rgba(251, 146, 60, 0.08), rgba(56, 189, 248, 0.10), rgba(251, 146, 60, 0.06)),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 0 0 0 1px rgba(251, 146, 60, 0.18),
    0 0 26px rgba(251, 146, 60, 0.28),
    0 0 24px rgba(56, 189, 248, 0.16);
}

.stack-elevation.stack-view-xray .stack-room-outline.source-room {
  border-color: rgba(251, 146, 60, 0.96);
  background: rgba(251, 146, 60, 0.22);
  box-shadow:
    0 0 26px rgba(251, 146, 60, 0.62),
    inset 0 0 18px rgba(251, 146, 60, 0.34);
}

.stack-elevation.stack-view-xray .stack-risk-outline {
  border-color: rgba(251, 191, 36, 0.76);
  background: rgba(251, 191, 36, 0.07);
  box-shadow:
    inset 0 0 22px rgba(251, 191, 36, 0.10),
    0 0 18px rgba(251, 191, 36, 0.22);
}

.stack-elevation.stack-view-xray .stack-risk-outline.risk-monitor {
  border-color: rgba(125, 211, 252, 0.70);
  background: rgba(125, 211, 252, 0.055);
  box-shadow:
    inset 0 0 22px rgba(125, 211, 252, 0.08),
    0 0 16px rgba(125, 211, 252, 0.18);
}

.stack-elevation.stack-view-xray .stack-clear-outline {
  border-color: rgba(34, 197, 94, 0.82);
  background: rgba(34, 197, 94, 0.075);
  box-shadow:
    inset 0 0 18px rgba(34, 197, 94, 0.10),
    0 0 18px rgba(34, 197, 94, 0.24);
}

.stack-elevation.stack-view-xray .stack-clear-outline::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 22px;
  height: 12px;
  border-left: 3px solid #86efac;
  border-bottom: 3px solid #86efac;
  transform: rotate(-45deg);
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.55));
}

.stack-elevation.stack-view-xray .stack-camera-dome {
  --camera-rgb: 34, 197, 94;
  --camera-hot: #bbf7d0;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 42px;
  height: 34px;
  margin: -5px 0 0 -21px;
  pointer-events: none;
  transform: translateZ(-1px);
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  z-index: 16;
  filter:
    drop-shadow(0 0 10px rgba(var(--camera-rgb), 0.54))
    drop-shadow(0 0 20px rgba(var(--camera-rgb), 0.24));
}

.stack-elevation.stack-view-xray .stack-camera-dome.down {
  --camera-rgb: 239, 68, 68;
  --camera-hot: #fecaca;
}

.stack-elevation.stack-view-xray .camera-ceiling-mount,
.stack-elevation.stack-view-xray .camera-drop-body,
.stack-elevation.stack-view-xray .camera-scan-cone {
  position: absolute;
  left: 50%;
  pointer-events: none;
}

.stack-elevation.stack-view-xray .camera-ceiling-mount {
  top: 0;
  width: 32px;
  height: 7px;
  border-radius: 999px;
  border: 1.5px solid rgba(226, 232, 240, 0.82);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(148, 163, 184, 0.54)),
    radial-gradient(ellipse at 50% 50%, rgba(var(--camera-rgb), 0.18), transparent 68%);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.22),
    0 0 0 3px rgba(var(--camera-rgb), 0.08),
    0 0 14px rgba(var(--camera-rgb), 0.30);
  transform: translate(-50%, -50%);
}

.stack-elevation.stack-view-xray .stack-camera-dome::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 2px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.82), rgba(var(--camera-rgb), 0.28));
  box-shadow: 0 0 8px rgba(226, 232, 240, 0.30);
  transform: translateX(-50%) translateZ(-6px) rotateX(-90deg);
  transform-origin: 50% 0;
}

.stack-elevation.stack-view-xray .camera-drop-body {
  top: 7px;
  width: 32px;
  height: 24px;
  border: 1.6px solid rgba(226, 232, 240, 0.92);
  border-top-width: 3px;
  border-radius: 3px 3px 999px 999px;
  background:
    radial-gradient(circle at 50% 82%, rgba(2, 6, 23, 0.92) 0 18%, transparent 20%),
    radial-gradient(circle at 50% 72%, rgba(var(--camera-rgb), 0.62) 0 18%, transparent 21%),
    radial-gradient(ellipse at 50% 100%, rgba(15, 23, 42, 0.42), transparent 58%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(148, 163, 184, 0.72) 44%, rgba(71, 85, 105, 0.72));
  box-shadow:
    inset 0 -6px 12px rgba(2, 6, 23, 0.42),
    0 0 0 4px rgba(var(--camera-rgb), 0.08),
    0 0 16px rgba(var(--camera-rgb), 0.36);
  opacity: 0.98;
  transform: translateX(-50%) translateZ(-22px) rotateX(-90deg);
  transform-origin: 50% 0%;
  transform-style: preserve-3d;
  animation: xrayCameraGlow 1.9s ease-in-out infinite;
}

.stack-elevation.stack-view-xray .camera-drop-body::before,
.stack-elevation.stack-view-xray .camera-drop-body::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
}

.stack-elevation.stack-view-xray .camera-drop-body::before {
  top: 16px;
  width: 10px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  background: var(--camera-hot);
  box-shadow:
    0 0 0 4px rgba(var(--camera-rgb), 0.15),
    0 0 16px rgba(var(--camera-rgb), 0.72);
  transform: translateX(-50%);
}

.stack-elevation.stack-view-xray .camera-drop-body::after {
  top: 5px;
  width: 25px;
  height: 10px;
  border-radius: 999px 999px 6px 6px;
  background: radial-gradient(ellipse at 50% 100%, rgba(2, 6, 23, 0.52), transparent 62%);
  transform: translateX(-50%);
}

.stack-elevation.stack-view-xray .camera-scan-cone {
  top: 26px;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--camera-rgb), 0.36), rgba(var(--camera-rgb), 0.14) 44%, transparent 78%),
    radial-gradient(ellipse at 50% 86%, rgba(var(--camera-rgb), 0.24), transparent 70%);
  filter: blur(1px);
  box-shadow:
    0 0 18px rgba(var(--camera-rgb), 0.28),
    0 0 32px rgba(var(--camera-rgb), 0.16);
  transform: translateX(-50%) translateZ(-38px) rotateX(-90deg);
  transform-origin: 50% 0;
}

.stack-elevation.stack-view-xray .stack-roof-camera-plane {
  z-index: 4;
  pointer-events: none;
}

.stack-elevation.stack-view-xray .stack-roof-camera-plane .stack-camera-layer {
  z-index: 18;
}

@keyframes xrayCameraGlow {
  0%,
  100% {
    opacity: 0.72;
    filter: saturate(0.88);
  }

  50% {
    opacity: 1;
    filter: saturate(1.2);
  }
}

.stack-elevation.stack-view-xray.fire-behavior-spreading .stack-risk-outline {
  border-color: rgba(248, 113, 113, 0.82);
  background: rgba(239, 68, 68, 0.08);
  box-shadow:
    inset 0 0 26px rgba(239, 68, 68, 0.12),
    0 0 24px rgba(239, 68, 68, 0.26);
}

.stack-elevation.stack-view-xray.fire-behavior-contained .stack-risk-outline,
.stack-elevation.stack-view-xray.fire-behavior-declining .stack-risk-outline {
  opacity: 0.68;
}

.stack-elevation.stack-view-xray .stack-threat-marker {
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  border-width: 2px;
  background: rgba(251, 146, 60, 0.16);
}

.stack-elevation.stack-view-xray .stack-threat-marker b {
  width: 22px;
  height: 22px;
}

.stack-elevation.stack-view-xray .stack-floor-label {
  display: none !important;
}

.stack-elevation.stack-view-xray .stack-occupancy-dot {
  width: 8px;
  height: 8px;
  opacity: 0.54;
}

.stack-elevation.stack-view-xray .stack-exit {
  width: 10px;
  height: 10px;
  opacity: 0.72;
}

.stack-elevation.stack-view-xray .stack-connector-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 13px;
  height: 13px;
  border: 1.8px solid rgba(125, 211, 252, 0.86);
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.24);
  transform: translate(-50%, -50%);
  z-index: 8;
}

.stack-elevation.stack-view-xray .stack-connector-marker::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-top: 2px solid rgba(224, 242, 254, 0.88);
  border-bottom: 2px solid rgba(224, 242, 254, 0.88);
}

.stack-elevation.stack-view-xray .stack-connector-marker.elevator {
  border-color: rgba(216, 180, 254, 0.90);
  background: rgba(126, 34, 206, 0.30);
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.12),
    0 0 15px rgba(168, 85, 247, 0.42);
}

.stack-elevation.stack-view-xray .stack-connector-marker.elevator::before {
  border: 0;
  left: 5px;
  right: 5px;
  top: 2px;
  bottom: 2px;
  background: rgba(243, 232, 255, 0.86);
  box-shadow: 0 0 8px rgba(216, 180, 254, 0.72);
}

.stack-elevation.stack-view-xray .stack-connector-marker.unavailable {
  opacity: 0.42;
}

.stack-elevation.stack-view-xray .stack-connector-marker.route {
  border-color: rgba(187, 247, 208, 0.96);
  background: rgba(34, 197, 94, 0.32);
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.14),
    0 0 16px rgba(34, 197, 94, 0.42);
}

.stack-elevation.stack-view-xray .stack-connector-marker.elevator.route {
  border-color: rgba(243, 232, 255, 0.98);
  background: rgba(168, 85, 247, 0.42);
  box-shadow:
    0 0 0 4px rgba(168, 85, 247, 0.16),
    0 0 20px rgba(168, 85, 247, 0.58);
}

.stack-elevation.stack-view-xray .stack-connector-marker.route-risk-danger {
  border-color: rgba(254, 202, 202, 0.96);
  background: rgba(239, 68, 68, 0.36);
  box-shadow:
    0 0 0 4px rgba(239, 68, 68, 0.13),
    0 0 18px rgba(239, 68, 68, 0.46);
}

.stack-elevation.stack-view-xray .stack-connector-marker.route-risk-medium {
  border-color: rgba(254, 240, 138, 0.98);
  background: rgba(250, 204, 21, 0.34);
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.13),
    0 0 18px rgba(250, 204, 21, 0.44);
}

.stack-elevation.stack-view-xray .stack-connector-marker.route-risk-best {
  border-color: rgba(187, 247, 208, 0.98);
  background: rgba(34, 197, 94, 0.38);
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, 0.16),
    0 0 20px rgba(34, 197, 94, 0.52);
  animation: xrayBestMarkerPulse 1.55s ease-in-out infinite;
}

@keyframes xrayBestRoutePulse {
  0%,
  44%,
  100% {
    outline-color: rgba(74, 222, 128, 0.24);
    outline-offset: 3px;
    box-shadow:
      0 0 28px rgba(34, 197, 94, 0.54),
      0 0 72px rgba(22, 163, 74, 0.34),
      0 0 92px rgba(187, 247, 208, 0.16);
  }

  12% {
    outline-color: rgba(187, 247, 208, 0.82);
    outline-offset: 8px;
    box-shadow:
      0 0 34px rgba(34, 197, 94, 0.74),
      0 0 88px rgba(22, 163, 74, 0.48),
      0 0 118px rgba(187, 247, 208, 0.28);
  }

  22% {
    outline-color: rgba(74, 222, 128, 0.34);
    outline-offset: 4px;
  }

  30% {
    outline-color: rgba(187, 247, 208, 0.68);
    outline-offset: 6px;
    box-shadow:
      0 0 32px rgba(34, 197, 94, 0.68),
      0 0 82px rgba(22, 163, 74, 0.42),
      0 0 108px rgba(187, 247, 208, 0.22);
  }
}

@keyframes xrayBestMarkerPulse {
  0%,
  44%,
  100% {
    box-shadow:
      0 0 0 4px rgba(34, 197, 94, 0.16),
      0 0 20px rgba(34, 197, 94, 0.52);
  }

  12% {
    box-shadow:
      0 0 0 8px rgba(187, 247, 208, 0.28),
      0 0 26px rgba(34, 197, 94, 0.72);
  }

  22% {
    box-shadow:
      0 0 0 5px rgba(34, 197, 94, 0.18),
      0 0 20px rgba(34, 197, 94, 0.52);
  }

  30% {
    box-shadow:
      0 0 0 7px rgba(187, 247, 208, 0.22),
      0 0 24px rgba(34, 197, 94, 0.66);
  }
}

.stack-elevation.stack-view-xray .spread-column,
.stack-elevation.stack-view-xray .containment-ring {
  transform: translateZ(92px);
}

.stack-elevation.stack-view-xray .spread-column {
  left: var(--spread-left, 48%);
  bottom: var(--spread-bottom, 64px);
  width: var(--spread-width, 8%);
  height: var(--spread-height, 260px);
  margin-left: 0;
  opacity: 0.66;
  z-index: 5;
}

.stack-elevation.stack-view-xray .spread-column span {
  inset: 0;
  border: 0;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 18% 70%, rgba(251, 146, 60, 0.22), rgba(251, 146, 60, 0.08) 42%, transparent 68%),
    linear-gradient(90deg, rgba(251, 191, 36, 0.04), rgba(251, 191, 36, 0.20), rgba(251, 146, 60, 0.09));
  box-shadow:
    0 0 18px rgba(251, 191, 36, 0.18),
    inset 0 0 22px rgba(251, 191, 36, 0.12);
  mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.stack-elevation.stack-view-xray .spread-column::before,
.stack-elevation.stack-view-xray .spread-column::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.stack-elevation.stack-view-xray .spread-column::before {
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.46), rgba(251, 146, 60, 0.18), transparent);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.28);
}

.stack-elevation.stack-view-xray .spread-column::after {
  right: 5%;
  bottom: 16px;
  width: 42px;
  height: 22px;
  margin-left: 0;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(251, 146, 60, 0.32), rgba(251, 146, 60, 0.08) 58%, transparent 72%);
  filter: blur(1px);
}

.xray-floor-tabs {
  display: none;
}

.stack-elevation.stack-view-xray .xray-floor-tabs {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 148px;
  display: block;
  pointer-events: none;
  z-index: 12;
}

.xray-floor-tab {
  position: absolute;
  left: 0;
  bottom: var(--tab-bottom);
  width: 132px;
  min-height: 48px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  padding: 8px 10px;
  color: #dff5ff;
  background: rgba(2, 6, 23, 0.72);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.10);
  cursor: pointer;
  display: grid;
  gap: 2px;
  pointer-events: auto;
  text-align: left;
}

.xray-floor-tab strong {
  color: #ffffff;
  font-size: 13px;
}

.xray-floor-tab span {
  color: rgba(224, 242, 254, 0.74);
  font-size: 11px;
  font-weight: 800;
}

.xray-floor-tab.selected {
  border-color: rgba(125, 211, 252, 0.78);
  background: rgba(8, 47, 73, 0.86);
  box-shadow:
    0 0 0 2px rgba(125, 211, 252, 0.14),
    0 0 18px rgba(56, 189, 248, 0.20);
}

.xray-floor-tab.source {
  border-color: rgba(251, 146, 60, 0.82);
  box-shadow:
    0 0 0 2px rgba(251, 146, 60, 0.12),
    0 0 20px rgba(251, 146, 60, 0.26);
}

.stack-detail-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-content: start;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.stack-detail-head,
.stack-detail-stats {
  grid-column: 1 / -1;
}

.stack-detail-head h4 {
  margin: 3px 0 7px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.stack-detail-head p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.stack-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 8px;
}

.stack-detail-stats div {
  min-height: 70px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.stack-detail-stats span,
.stack-detail-section > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.stack-detail-stats strong {
  font-size: 22px;
  line-height: 1.1;
}

.stack-detail-section {
  min-width: 0;
  min-height: 100%;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
}

.stack-detail-section strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.stack-detail-zones {
  display: grid;
  gap: 8px;
}

.stack-detail-risks {
  display: grid;
  gap: 8px;
}

.stack-detail-risks span {
  min-width: 0;
  padding: 10px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  display: grid;
  gap: 3px;
}

.stack-detail-risks b {
  color: var(--ink);
  font-size: 13px;
}

.stack-detail-risks i {
  color: var(--amber);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.stack-detail-risks em {
  color: #344054;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.stack-detail-zones span {
  display: grid;
  grid-template-columns: minmax(44px, 70px) minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  min-width: 0;
}

.stack-detail-zones b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stack-detail-zones i {
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
}

.stack-detail-zones em {
  color: var(--muted);
  font-style: normal;
}

.building-envelope {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  z-index: 1;
}

.building-wire {
  position: absolute;
  left: 34px;
  width: calc(100% - 142px);
  height: 138px;
  border: 2px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  transform: skewX(-18deg);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.28));
}

.building-base-wire {
  bottom: 34px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 26px 36px rgba(0, 0, 0, 0.18);
}

.building-roof-wire {
  left: 82px;
  bottom: var(--roof-bottom, 344px);
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.10);
}

.building-wall {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.20) 0, rgba(255, 255, 255, 0.20) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.18) 1px, transparent 1px, transparent 41px),
    rgba(255, 255, 255, 0.04);
}

.building-front-wall {
  left: 34px;
  bottom: 34px;
  width: calc(100% - 142px);
  height: var(--stack-height, 404px);
  transform: skewX(-18deg);
  transform-origin: left bottom;
  clip-path: polygon(0 46%, 100% 0, 100% 55%, 0 100%);
}

.building-side-wall {
  right: 54px;
  bottom: 34px;
  width: 128px;
  height: var(--stack-height, 404px);
  transform: skewX(-18deg);
  transform-origin: right bottom;
  clip-path: polygon(0 46%, 100% 2%, 100% 55%, 0 100%);
}

.building-column {
  position: absolute;
  width: 4px;
  height: var(--stack-height, 404px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
  transform: skewX(-18deg);
}

.column-a {
  left: 44px;
  bottom: 42px;
}

.column-b {
  left: 52%;
  bottom: 142px;
}

.column-c {
  right: 90px;
  bottom: 42px;
}

.column-d {
  right: 52px;
  bottom: 162px;
}

.building-core {
  position: absolute;
  width: 72px;
  height: var(--core-height, 328px);
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.20) 0, rgba(255, 255, 255, 0.20) 1px, transparent 1px, transparent 36px),
    rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  transform: skewX(-18deg);
  z-index: 3;
}

.building-core b {
  transform: skewX(18deg) rotate(-90deg);
  font-size: 11px;
  letter-spacing: 0;
}

.stair-core {
  left: 16%;
  bottom: 72px;
}

.elevator-core {
  right: 21%;
  bottom: 96px;
}

.stack-floor {
  position: absolute;
  left: calc(34px + var(--level-x));
  bottom: calc(34px + var(--level-offset));
  width: calc(100% - 142px);
  height: 138px;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transform: translateZ(var(--floor-z, 0px)) skewX(-18deg);
  transform-origin: left bottom;
  transform-style: preserve-3d;
  z-index: 4;
  will-change: transform;
}

.stack-floor-plate {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.20),
    0 18px 28px rgba(0, 0, 0, 0.18),
    0 0 18px rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(1px);
  isolation: isolate;
}

.stack-floor-plate::before,
.stack-floor-plate::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.stack-floor-plate::before {
  left: 0;
  right: -24px;
  bottom: calc(-1 * var(--slab-depth, 16px));
  height: var(--slab-depth, 16px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-top: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  transform: skewX(42deg);
  transform-origin: left top;
  z-index: 0;
}

.stack-floor-plate::after {
  top: 0;
  right: calc(-1 * var(--slab-depth, 16px));
  width: var(--slab-depth, 16px);
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  transform: skewY(40deg);
  transform-origin: left top;
  z-index: 0;
}

.stack-floor.selected .stack-floor-plate {
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(209, 233, 255, 0.30), 0 18px 28px rgba(0, 0, 0, 0.18);
}

.stack-floor.source-floor .stack-floor-plate {
  border-color: rgba(255, 214, 210, 0.92);
  background: rgba(255, 214, 210, 0.10);
}

.stack-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0, rgba(255, 255, 255, 0.22) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.18) 1px, transparent 1px, transparent 34px);
}

.stack-room-wireframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.stack-risk-wireframe {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.stack-spread-wireframe {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.stack-camera-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.stack-elevation.stack-view-xray .stack-camera-layer {
  z-index: 18;
  overflow: visible;
  transform-style: preserve-3d;
}

.stack-room-outline {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  border: 1.8px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.stack-room-outline::before,
.stack-room-outline::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.42);
}

.stack-room-outline::before {
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
}

.stack-room-outline::after {
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
}

.stack-room-outline.source-room {
  border-color: #ffd6d2;
  background: rgba(255, 82, 82, 0.12);
  box-shadow: 0 0 16px rgba(255, 214, 210, 0.34);
}

.stack-risk-outline {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  border: 1.8px dashed rgba(251, 191, 36, 0.80);
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.055);
  box-shadow:
    inset 0 0 18px rgba(251, 191, 36, 0.08),
    0 0 18px rgba(251, 191, 36, 0.16);
}

.stack-risk-outline.risk-monitor {
  border-color: rgba(125, 211, 252, 0.70);
  background: rgba(125, 211, 252, 0.055);
  box-shadow:
    inset 0 0 18px rgba(125, 211, 252, 0.08),
    0 0 16px rgba(125, 211, 252, 0.16);
}

.stack-spread-path {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--path-length);
  height: 0;
  border-top: 3px dashed rgba(251, 191, 36, 0.86);
  transform: rotate(var(--path-angle));
  transform-origin: 0 50%;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.38));
}

.stack-spread-path::before,
.stack-spread-path::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.stack-spread-path::before {
  left: -5px;
  top: -7px;
  width: 13px;
  height: 13px;
  background: #fb923c;
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.58);
}

.stack-spread-path::after {
  right: -4px;
  top: -6px;
  width: 11px;
  height: 11px;
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.46);
}

.stack-spread-path.risk-monitor {
  border-top-color: rgba(125, 211, 252, 0.72);
  filter: drop-shadow(0 0 7px rgba(125, 211, 252, 0.30));
}

.stack-spread-path.risk-monitor::after {
  background: #7dd3fc;
  box-shadow: 0 0 10px rgba(125, 211, 252, 0.40);
}

.stack-elevation.stack-view-xray.fire-behavior-spreading .stack-spread-path {
  border-top-color: rgba(248, 113, 113, 0.90);
  filter: drop-shadow(0 0 11px rgba(239, 68, 68, 0.46));
}

.stack-elevation.stack-view-xray.fire-behavior-spreading .stack-spread-path::after {
  background: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.52);
}

.stack-elevation.stack-view-xray.fire-behavior-contained .stack-spread-path,
.stack-elevation.stack-view-xray.fire-behavior-declining .stack-spread-path {
  opacity: 0.58;
}

.stack-room-outline em {
  position: absolute;
  left: 8px;
  top: 7px;
  max-width: calc(100% - 14px);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.80);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-room-outline em,
.stack-floor-label,
.stack-route-cue,
.stack-occupancy-dot b {
  display: none !important;
}

.stack-floor-label,
.stack-room-outline em,
.stack-route-cue,
.stack-occupancy-dot,
.stack-exit,
.stack-threat-marker {
  transform: skewX(18deg);
}

.stack-floor-label {
  position: absolute;
  left: 16px;
  top: 14px;
  display: grid;
  gap: 2px;
  z-index: 5;
}

.stack-floor-label strong {
  color: #ffffff;
  font-size: 17px;
  text-shadow: 0 0 8px rgba(20, 86, 156, 0.90);
}

.stack-floor-label span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.stack-route-cue {
  position: absolute;
  right: 14px;
  bottom: 12px;
  max-width: min(360px, 52%);
  padding: 7px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #065f46;
  background: rgba(236, 253, 245, 0.88);
  font-size: 12px;
  font-weight: 900;
  z-index: 6;
}

.stack-occupancy-dot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: rgba(14, 148, 136, 0.92);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(16, 24, 40, 0.16);
  z-index: 5;
}

.stack-occupancy-dot b {
  font-size: 12px;
}

.stack-exit {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 3px solid #ffffff;
  border-radius: 4px;
  background: var(--green);
  box-shadow: 0 6px 12px rgba(16, 24, 40, 0.18);
  z-index: 5;
}

.stack-exit.preferred::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 4px;
  width: 68px;
  height: 3px;
  background: var(--green);
  box-shadow: 14px 0 0 var(--green);
}

.stack-threat-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border: 4px solid rgba(180, 35, 24, 0.34);
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.18);
  display: grid;
  place-items: center;
  z-index: 7;
}

.stack-threat-marker b {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 8px rgba(180, 35, 24, 0.20);
}

.spread-column,
.containment-ring {
  position: absolute;
  left: var(--source-x);
  bottom: 64px;
  width: 110px;
  height: var(--spread-height, 390px);
  margin-left: -55px;
  pointer-events: none;
  z-index: 6;
}

.spread-column span {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(255, 214, 102, 0.86);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, rgba(254, 240, 199, 0.30), rgba(254, 228, 226, 0.08));
}

.containment-ring span {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 150px;
  height: 150px;
  margin-left: -75px;
  border: 3px dashed rgba(180, 35, 24, 0.68);
  border-radius: 999px;
  background: rgba(254, 228, 226, 0.18);
}

.stack-note {
  justify-content: flex-start;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.floor-layer {
  width: 100%;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-left: 7px solid #98a2b3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.floor-layer.selected {
  border-color: #84caff;
  border-left-color: var(--blue);
  box-shadow: 0 0 0 3px #d1e9ff;
}

.floor-layer.risk-high {
  border-left-color: var(--danger);
}

.floor-layer.risk-elevated,
.floor-layer.risk-watch {
  border-left-color: var(--amber);
}

.floor-layer.risk-ready {
  border-left-color: var(--green);
}

.floor-layer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.floor-layer-main h4 {
  margin: 0;
  font-size: 18px;
}

.floor-layer-main strong {
  font-size: 30px;
  line-height: 1;
}

.floor-action {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.zone-loads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.zone-loads span {
  position: relative;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
}

.zone-loads i {
  position: absolute;
  inset: 0 auto 0 0;
  background: #d1e9ff;
}

.zone-loads b,
.zone-loads em {
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-loads em {
  color: var(--blue);
  font-weight: 900;
}

.map-shell {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.floor-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 320px;
}

.blueprint-floor-svg {
  background: #14569c;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.segmented button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.segmented button.active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.soft-rule {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--soft-line);
}

.spacer-sm {
  height: 14px;
}

.blueprint-bg {
  fill: #14569c;
}

.blueprint-grid-small {
  fill: none;
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 1;
}

.blueprint-grid-large {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
}

.blueprint-grid-fill {
  opacity: 0.85;
}

.blueprint-structure {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.30));
}

.blueprint-quadrants {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.20));
}

.blueprint-quadrant-fill {
  fill: rgba(56, 189, 248, 0.025);
  stroke: none;
}

.blueprint-quadrant-fill.source {
  fill: rgba(251, 146, 60, 0.13);
}

.blueprint-quadrant-line {
  fill: none;
  stroke: rgba(209, 233, 255, 0.56);
  stroke-width: 2.4;
  stroke-dasharray: 12 10;
}

.blueprint-quadrant-label {
  fill: rgba(224, 242, 254, 0.74);
  font-size: 15px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(20, 86, 156, 0.84);
  stroke-width: 4px;
}

.blueprint-quadrant-label.source {
  fill: #fed7aa;
  stroke: rgba(80, 32, 7, 0.72);
}

.blueprint-outer,
.blueprint-zone rect,
.blueprint-core rect {
  fill: rgba(255, 255, 255, 0.025);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 2.1;
}

.blueprint-outer.inner,
.blueprint-zone-inner {
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1.2;
  stroke-dasharray: 8 7;
}

.blueprint-zone.source rect:first-child {
  fill: rgba(254, 228, 226, 0.14);
  stroke: #ffd6d2;
  stroke-width: 3;
}

.blueprint-zone.risk rect:first-child {
  fill: rgba(251, 191, 36, 0.10);
  stroke: #fedf89;
  stroke-width: 2.8;
  stroke-dasharray: 12 8;
}

.blueprint-zone.risk-monitor rect:first-child {
  fill: rgba(125, 211, 252, 0.08);
  stroke: #7dd3fc;
}

.blueprint-zone.camera-clear rect:first-child {
  fill: rgba(34, 197, 94, 0.10);
  stroke: #86efac;
  stroke-width: 2.8;
  stroke-dasharray: 5 6;
}

.blueprint-zone.source.camera-clear rect:first-child {
  fill: rgba(254, 228, 226, 0.14);
  stroke: #ffd6d2;
  stroke-dasharray: none;
}

.blueprint-zone.source.risk rect:first-child {
  fill: rgba(254, 228, 226, 0.14);
  stroke: #ffd6d2;
  stroke-dasharray: none;
}

.camera-clear-check {
  fill: none;
  stroke: #86efac;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.55));
}

.blueprint-alert-hatch {
  fill: none;
  stroke: rgba(255, 214, 210, 0.70);
  stroke-width: 2;
  stroke-dasharray: 8 8;
}

.blueprint-partition,
.blueprint-core path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.66);
  stroke-width: 1.4;
}

.blueprint-partition.faint {
  stroke: rgba(255, 255, 255, 0.34);
  stroke-dasharray: 7 7;
}

.blueprint-door {
  fill: none;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 1.6;
}

.blueprint-window {
  fill: none;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 5;
  stroke-linecap: round;
}

.blueprint-wall-shadow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.20);
  stroke-width: 2;
}

.blueprint-icon-line {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.8;
}

.blueprint-small-label {
  fill: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
}

.map-label {
  fill: #ffffff;
  font-size: 17px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(20, 86, 156, 0.84);
  stroke-width: 4px;
}

.map-sub-label {
  fill: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  paint-order: stroke;
  stroke: rgba(20, 86, 156, 0.74);
  stroke-width: 3px;
}

.corridor-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 36;
  stroke-linecap: round;
}

.route-line {
  fill: none;
  stroke: #5dffb3;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 18 12;
  filter: drop-shadow(0 0 5px rgba(93, 255, 179, 0.60));
}

.route-label,
.blocked-route {
  fill: #d1ffe8;
  font-size: 15px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(20, 86, 156, 0.90);
  stroke-width: 4px;
}

.blocked-route {
  fill: #ffd6d2;
}

.map-point circle,
.map-point rect {
  stroke: #ffffff;
  stroke-width: 2.8;
}

.map-point.exit circle,
.map-point.exit rect,
.map-point.stairs circle,
.map-point.stairs rect,
.map-point.shelter circle,
.map-point.shelter rect {
  fill: rgba(18, 183, 106, 0.88);
}

.map-point.aed circle {
  fill: rgba(14, 148, 136, 0.92);
}

.map-point.extinguisher circle,
.map-point.extinguisher rect,
.map-point.extinguisher circle,
.map-point.hazard rect,
.map-point.hazard circle {
  fill: rgba(245, 158, 11, 0.92);
}

.map-point-label,
.device-label,
.you-label,
.incident-label {
  fill: #ffffff;
  font-size: 13px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(20, 86, 156, 0.92);
  stroke-width: 4px;
}

.device-marker circle {
  fill: #64b5ff;
  stroke: #ffffff;
  stroke-width: 3;
}

.occupancy-marker circle {
  fill: rgba(14, 148, 136, 0.94);
  stroke: #ffffff;
  stroke-width: 4;
}

.occupancy-count {
  fill: #ffffff;
  font-size: 17px;
  font-weight: 900;
  text-anchor: middle;
}

.occupancy-name {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(20, 86, 156, 0.92);
  stroke-width: 4px;
}

.you-marker circle {
  fill: #64b5ff;
  stroke: #ffffff;
  stroke-width: 5;
}

.incident-marker circle:first-child {
  fill: rgba(255, 82, 82, 0.18);
  stroke: #ffd6d2;
  stroke-width: 4;
}

.incident-marker circle:nth-child(2) {
  fill: #ff3b30;
}

.incident-label {
  fill: #ffd6d2;
  font-size: 15px;
}

.endpoint-body {
  background: #101828;
}

.endpoint-root {
  min-height: 100vh;
}

.endpoint-idle,
.endpoint-alert {
  min-height: 100vh;
  padding: 24px;
}

.endpoint-idle {
  display: grid;
  place-items: center;
  background: #eef2f6;
}

.endpoint-picker {
  width: min(680px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.endpoint-picker h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.endpoint-picker p {
  margin: 0 0 16px;
  color: var(--muted);
}

.endpoint-alert {
  color: #ffffff;
  background: #101828;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
}

.alert-header {
  min-height: 112px;
  padding: 22px;
  border-radius: 8px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.alert-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.alert-header p {
  margin: 8px 0 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
}

.alert-clock {
  min-width: 170px;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
}

.alert-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
}

.alert-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  overflow: hidden;
}

.alert-action {
  min-height: 176px;
  padding: 20px;
  border: 2px solid #fecdca;
  border-radius: 8px;
  background: #fff7f6;
}

.alert-action h2,
.alert-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.alert-action p {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.context-item {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}

.context-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.context-item strong {
  font-size: 16px;
}

.endpoint-map {
  height: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.response-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.response-bar button {
  min-height: 64px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffffff;
  background: var(--blue);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.response-bar button.help {
  background: var(--danger);
}

.response-bar button.safe {
  background: var(--green);
}

.response-bar button.warn {
  background: var(--amber);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  box-shadow: var(--shadow);
}

/* Modern operations UI refresh */
.admin-body {
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f6 42%, #f3f5f8 100%);
}

.app-shell {
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  background: #111827;
}

.brand-mark {
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.16);
}

.brand-block h1 {
  font-size: 21px;
}

.node-card {
  min-height: 58px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.node-card span:last-child {
  line-height: 1.35;
}

.nav-section-label {
  margin: 6px 0 2px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav a,
.endpoint-link {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.side-nav a.active {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  background: #b42318;
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.72);
}

.nav-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 5px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  opacity: 0.9;
}

.overview-icon::before,
.activate-icon::before,
.guidance-icon::before,
.occupancy-icon::before,
.map-icon::before,
.wayfinding-icon::before,
.visual-icon::before,
.device-icon::before,
.patient-icon::before,
.timeline-icon::before {
  content: "";
  position: absolute;
  background: currentColor;
}

.overview-icon::before {
  left: 3px;
  top: 3px;
  width: 4px;
  height: 4px;
  box-shadow:
    7px 0 0 currentColor,
    0 7px 0 currentColor,
    7px 7px 0 currentColor;
}

.activate-icon::before {
  left: 6px;
  top: 2px;
  width: 2px;
  height: 10px;
}

.guidance-icon::before {
  left: 3px;
  right: 3px;
  top: 4px;
  height: 2px;
  box-shadow:
    0 4px 0 currentColor,
    0 8px 0 currentColor;
}

.occupancy-icon::before {
  inset: 3px;
  border-radius: 999px;
}

.map-icon::before {
  left: 3px;
  right: 3px;
  top: 7px;
  height: 2px;
}

.wayfinding-icon::before {
  left: 3px;
  right: 3px;
  top: 7px;
  height: 2px;
  box-shadow:
    -3px -4px 0 -1px currentColor,
    3px 4px 0 -1px currentColor;
}

.visual-icon::before {
  left: 3px;
  top: 4px;
  width: 10px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.visual-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.device-icon::before {
  left: 5px;
  right: 5px;
  bottom: 2px;
  height: 2px;
}

.patient-icon::before {
  left: 6px;
  top: 3px;
  width: 2px;
  height: 10px;
  box-shadow:
    -4px 4px 0 -1px currentColor,
    4px 4px 0 -1px currentColor;
}

.timeline-icon::before {
  left: 3px;
  right: 3px;
  top: 4px;
  height: 2px;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.workspace {
  padding: 28px;
}

.command-rail {
  min-height: 50px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.breadcrumb-line {
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-rail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.rail-clock {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 1px;
}

.command-rail-status .rail-clock strong {
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 900;
  text-transform: none;
}

.command-rail-status .rail-clock span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.command-rail-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.command-rail-status strong {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}

.command-rail-status strong.critical {
  color: var(--danger-strong);
  background: var(--danger-soft);
}

.command-rail-status strong.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.topbar {
  min-height: 72px;
  padding: 4px 0 18px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.topbar h2 {
  font-size: 27px;
  line-height: 1.15;
}

.topbar-summary {
  min-height: 48px;
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  display: grid;
  align-content: center;
  gap: 2px;
}

.topbar-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-summary strong {
  color: var(--green);
  font-size: 16px;
}

.button {
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button.secondary {
  background: #ffffff;
}

.button.danger {
  background: #b42318;
}

.button.primary {
  background: #175cd3;
}

.incident-strip {
  margin-top: 18px;
  border-left-width: 0;
  box-shadow: var(--shadow);
}

.command-grid-primary {
  grid-template-columns: minmax(320px, 0.82fr) minmax(380px, 1.18fr);
}

.ops-view-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ops-view-grid .occupancy-panel,
.ops-view-grid .map-panel {
  margin-top: 0;
  height: auto;
}

.ops-view-grid .map-panel {
  position: static;
}

.ops-view-grid .map-shell {
  min-height: 640px;
  background: #14569c;
}

.incident-strip.ready,
.incident-strip.active {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.incident-strip.ready {
  border-color: #c7d7fe;
}

.incident-strip.active {
  border-color: #fda29b;
  background: #fffafa;
}

.incident-main {
  min-width: 0;
}

.incident-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.incident-main h3 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.15;
}

.incident-main p {
  color: var(--muted);
  font-size: 14px;
}

.incident-stats {
  min-width: 360px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.incident-stats span {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  align-content: center;
  gap: 4px;
}

.incident-stats strong {
  color: var(--ink);
  font-size: 24px;
}

.command-grid {
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
}

.panel {
  border-color: rgba(17, 24, 39, 0.10);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.panel h3 {
  font-size: 19px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

input,
select,
textarea {
  border-color: #ccd5e1;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #d1e9ff;
  border-color: var(--blue);
}

.metric-grid {
  gap: 10px;
}

.metric {
  min-height: 80px;
  border-color: rgba(17, 24, 39, 0.08);
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.metric strong {
  font-size: 26px;
}

.metric.acknowledged strong {
  color: var(--green);
}

.metric.reconfirm strong {
  color: var(--amber);
}

.metric.pending strong {
  color: var(--danger);
}

.device-row,
.response-row,
.timeline-row {
  min-height: 62px;
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.device-row strong,
.response-row strong,
.timeline-row strong {
  font-size: 14px;
}

.map-panel {
  padding: 0;
  overflow: hidden;
}

.map-panel .panel-header {
  margin: 0;
  padding: 18px;
}

.map-shell {
  border: 0;
  border-top: 1px solid var(--soft-line);
  border-radius: 0;
  background: #f8fafc;
}

.floor-svg {
  min-height: 420px;
}

.segmented button {
  background: #f8fafc;
}

.segmented button.active {
  background: #111827;
}

.floor-svg:not(.blueprint-floor-svg) rect:first-child {
  filter: drop-shadow(0 8px 16px rgba(16, 24, 40, 0.08));
}

.endpoint-body {
  background: #0b1220;
}

.endpoint-idle {
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
}

.endpoint-picker {
  border-color: rgba(17, 24, 39, 0.10);
  box-shadow: var(--shadow);
}

.endpoint-idle-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.endpoint-idle-head h1 {
  margin: 0;
}

.endpoint-alert {
  padding: 18px;
  gap: 14px;
  background: #0b1220;
}

.alert-header {
  min-height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.alert-mode {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #111827;
  background: rgba(255, 255, 255, 0.90);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.alert-header h1 {
  margin-top: 10px;
  font-size: 34px;
}

.alert-clock {
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(17, 24, 39, 0.24);
}

.alert-grid {
  grid-template-columns: minmax(390px, 0.86fr) minmax(520px, 1.14fr);
}

.alert-panel {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.alert-action {
  border-color: #fda29b;
  background: #fff7f6;
}

.alert-action p {
  font-size: 29px;
}

.alert-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.endpoint-map {
  min-height: 470px;
  background: #f8fafc;
}

.response-bar {
  position: sticky;
  bottom: 0;
  padding-top: 4px;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.response-bar button {
  min-height: 70px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.endpoint-alert {
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef2f6 0%, #f8fafc 100%);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.endpoint-command-header {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(90deg, var(--alert-accent, #b42318) 0 7px, #1f2937 7px 100%);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.endpoint-command-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-chip {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
}

.endpoint-command-header h1 {
  margin: 8px 0 4px;
  font-size: 30px;
  line-height: 1.12;
}

.endpoint-command-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
}

.endpoint-command-header .alert-clock {
  min-width: 142px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
}

.endpoint-command-header .alert-clock span,
.endpoint-command-header .alert-clock strong {
  display: block;
}

.endpoint-command-header .alert-clock span {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  text-transform: uppercase;
}

.priority-action {
  padding: 18px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-left: 7px solid var(--alert-accent, var(--danger));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.priority-action p {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.22;
  font-weight: 900;
}

.mobile-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-section-title h2 {
  margin: 0;
  font-size: 20px;
}

.endpoint-status-note {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--blue-soft);
  border-radius: 8px;
  background: #eff8ff;
  display: grid;
  gap: 4px;
}

.endpoint-status-note strong {
  color: #1849a9;
}

.endpoint-status-note span {
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.endpoint-status-note.visitor-location-note {
  border-color: #d6bbfb;
  background: #f4f3ff;
}

.endpoint-status-note.visitor-location-note.active {
  border-color: #abefc6;
  background: #f6fef9;
}

.endpoint-status-note.visitor-location-note strong {
  color: #5925dc;
}

.endpoint-status-note.visitor-location-note.active strong {
  color: #067647;
}

.endpoint-status-note.visitor-location-note .button {
  margin-top: 6px;
  justify-self: start;
}

.endpoint-alert .alert-panel {
  border-color: rgba(17, 24, 39, 0.10);
  box-shadow: var(--shadow-soft);
}

.endpoint-alert .context-item {
  background: #ffffff;
}

.endpoint-alert .endpoint-map {
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.04);
}

.response-bar {
  align-items: stretch;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 30px rgba(16, 24, 40, 0.12);
  grid-template-columns: minmax(150px, 0.7fr) repeat(5, minmax(120px, 1fr));
}

.response-label {
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 3px;
}

.response-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.response-label strong {
  font-size: 16px;
}

.response-bar button {
  box-shadow: none;
  display: grid;
  place-items: center;
}

.response-bar button span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .app-shell,
  .command-grid,
  .ops-view-grid,
  .overview-grid,
  .alert-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .response-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .response-label {
    grid-column: 1 / -1;
  }

  .occupancy-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wayfinding-mode-grid,
  .wayfinding-grid,
  .wayfinding-roadmap,
  .gps-tester-grid {
    grid-template-columns: 1fr;
  }

  .wayfinding-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-category-head {
    align-items: stretch;
    flex-direction: column;
  }

  .device-category-head em {
    max-width: none;
    text-align: left;
  }

  .device-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .device-type-pill,
  .device-status-pill,
  .device-delivery-pill {
    grid-column: 2;
    justify-self: start;
  }

  .patient-room-row {
    grid-template-columns: 1fr;
  }

  .patient-access-toolbar {
    grid-template-columns: 1fr;
  }

  .stack-view-controls {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .stack-readout {
    width: 100%;
  }

  .building-stack-body {
    grid-template-columns: 1fr;
  }

  .ops-view-grid .map-panel {
    position: static;
  }

  .ops-view-grid .map-shell {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .workspace,
  .endpoint-idle,
  .endpoint-alert {
    padding: 14px;
  }

  .topbar,
  .panel-header,
  .incident-strip,
  .command-rail,
  .endpoint-command-header,
  .alert-header {
    align-items: stretch;
    flex-direction: column;
  }

  .command-rail-status {
    justify-content: space-between;
  }

  .endpoint-command-title {
    align-items: flex-start;
  }

  .app-chip {
    width: 52px;
    height: 52px;
  }

  .form-grid,
  .metric-grid,
  .occupancy-summary,
  .wayfinding-stats,
  .patient-link-grid,
  .patient-access-grid,
  .patient-room-summary,
  .zone-loads,
  .context-grid,
  .response-bar {
    grid-template-columns: 1fr;
  }

  .wayfinding-graph {
    grid-template-columns: 1fr;
  }

  .wayfinding-graph i {
    width: 3px;
    min-height: 18px;
    height: 18px;
    justify-self: center;
  }

  .alert-header h1 {
    font-size: 24px;
  }

  .endpoint-command-header h1 {
    font-size: 24px;
  }

  .alert-action p {
    font-size: 21px;
  }

  .priority-action p {
    font-size: 22px;
  }

  .alert-clock {
    min-width: 0;
    text-align: left;
  }

  .response-bar {
    grid-template-columns: 1fr;
  }
}
