:root {
  color-scheme: dark;
  --bg: #020713;
  --panel: rgba(5, 18, 35, 0.72);
  --panel-strong: rgba(8, 27, 52, 0.86);
  --panel-soft: rgba(8, 30, 57, 0.5);
  --line: rgba(70, 212, 255, 0.42);
  --line-soft: rgba(83, 235, 255, 0.18);
  --cyan: #55e7ff;
  --blue: #54a9ff;
  --teal: #19d5c2;
  --emerald: #49f3a5;
  --amber: #ffbc42;
  --orange: #ff7a3d;
  --red: #ff4f5f;
  --text: #eef8ff;
  --muted: #99b7ca;
  --faint: #5d7a92;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
  --glow: 0 0 18px rgba(76, 226, 255, 0.38), 0 0 42px rgba(22, 160, 255, 0.16);
  --radius: 8px;
  --floating-panel-downshift: 38px;
  --device-popup-top: calc(104px + var(--floating-panel-downshift));
  --device-popup-left: calc(50% - 44px);
  --device-popup-width: min(340px, calc(100vw - 32px));
  --device-popup-height: calc(100vh - var(--device-popup-top) - 142px);
  --device-popup-max-height: calc(100vh - var(--device-popup-top) - 132px);
  --gauge-core-fill: rgba(5, 19, 38, 0.9);
  --gauge-core-ink: #eef8ff;
  --gauge-core-label: #99b7ca;
  --ui-zoom: 1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 50% 5%, #09203a 0, #020713 48%, #01030a 100%);
  color: var(--text);
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a.button-link {
  border: 1px solid rgba(86, 220, 255, 0.36);
  background: linear-gradient(180deg, rgba(15, 57, 92, 0.8), rgba(4, 20, 39, 0.72));
  color: var(--text);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button:hover,
a.button-link:hover {
  border-color: rgba(102, 246, 255, 0.9);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

a {
  color: #8defff;
  text-decoration: none;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(0, 11, 28, 0.28), rgba(0, 0, 0, 0.22)),
    #010611;
}

.app-shell[data-screen-fit="compact"] {
  --ui-zoom: 0.88;
}

.app-shell[data-screen-fit="standard"] {
  --ui-zoom: 1;
}

.app-shell[data-screen-fit="wide"] {
  --ui-zoom: 0.94;
}

.app-shell[data-screen-fit="presentation"] {
  --ui-zoom: 1.08;
}

@media (max-width: 1440px), (max-height: 820px) {
  .app-shell[data-screen-fit="auto"] {
    --ui-zoom: 0.92;
  }
}

@media (min-width: 1900px) and (min-height: 980px) {
  .app-shell[data-screen-fit="auto"] {
    --ui-zoom: 1;
  }
}

.topbar,
.icon-rail,
.left-panel,
.right-panel,
.bottom-nav,
.screen-setting-footer,
.view-control-deck,
.floating-panel,
.table-panel,
.side-drawer {
  zoom: var(--ui-zoom);
}

.app-shell.theme-light {
  --bg: #d9edf5;
  --panel: rgba(232, 247, 252, 0.76);
  --panel-strong: rgba(218, 241, 249, 0.9);
  --panel-soft: rgba(216, 240, 248, 0.66);
  --line: rgba(0, 130, 156, 0.42);
  --line-soft: rgba(0, 145, 170, 0.16);
  --text: #071827;
  --muted: #31556a;
  --faint: #5c7688;
  --gauge-core-fill: #f8feff;
  --gauge-core-ink: #061827;
  --gauge-core-label: #31586d;
  background: linear-gradient(180deg, #d7edf5, #eef9fb);
}

.app-shell.theme-light #threeScene {
  background: #d9edf5;
}

.app-shell.theme-light .scene-vignette {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 0 52%, rgba(122, 170, 190, 0.18) 100%),
    linear-gradient(90deg, rgba(220, 238, 246, 0.28), transparent 22%, transparent 78%, rgba(220, 238, 246, 0.3));
}

#threeScene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #010611;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(5, 24, 42, 0) 0 58%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 19%, transparent 80%, rgba(0, 0, 0, 0.28));
  z-index: 2;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  z-index: 3;
  background-image:
    linear-gradient(rgba(87, 212, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 212, 255, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 78%);
}

.topbar {
  position: absolute;
  z-index: 36;
  top: 14px;
  left: 96px;
  right: 18px;
  min-height: 56px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 18px;
  pointer-events: none;
}

.brand {
  text-align: left;
  text-shadow: 0 0 20px rgba(50, 200, 255, 0.3);
}

.title-frame {
  position: relative;
  width: fit-content;
  max-width: min(540px, 100%);
  justify-self: start;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  padding: 6px 15px 7px;
  border: 1px solid rgba(77, 223, 255, 0.46);
  border-radius: 0 0 11px 11px;
  background:
    linear-gradient(135deg, rgba(5, 20, 38, 0.9), rgba(4, 30, 52, 0.72)),
    rgba(3, 12, 26, 0.82);
  box-shadow: 0 10px 28px rgba(0, 10, 24, 0.36), inset 0 -1px 18px rgba(27, 231, 205, 0.11);
  pointer-events: auto;
}

.project-info-button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--cyan);
  background: rgba(5, 24, 44, 0.62);
}

.project-info-popover {
  position: absolute;
  z-index: 60;
  left: 0;
  top: calc(100% + 10px);
  width: min(420px, calc(100vw - 120px));
  padding: 14px;
  border: 1px solid rgba(87, 224, 255, 0.38);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(7, 28, 53, 0.96), rgba(2, 12, 27, 0.93)),
    rgba(3, 15, 28, 0.94);
  box-shadow: var(--shadow), var(--glow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.project-info-button:hover ~ .project-info-popover,
.project-info-button:focus-visible ~ .project-info-popover,
.title-frame.info-open .project-info-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.project-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.project-info-title {
  margin: 0;
  color: #e9faff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-info-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.project-info-grid div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(110, 231, 255, 0.12);
}

.project-info-grid span {
  color: var(--muted);
  font-size: 11px;
}

.project-info-grid strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.title-frame::before,
.title-frame::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 52px;
  height: 16px;
  border-top: 1px solid rgba(77, 223, 255, 0.62);
}

.title-frame::before {
  left: -36px;
  border-left: 1px solid rgba(77, 223, 255, 0.35);
  transform: skewX(38deg);
}

.title-frame::after {
  right: -36px;
  border-right: 1px solid rgba(77, 223, 255, 0.35);
  transform: skewX(-38deg);
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 205, 95, 0.36));
  animation: logoRotate 12s linear infinite;
}

@keyframes logoRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.brand-copy {
  min-width: 0;
  text-align: center;
}

.brand h1 {
  margin: 0;
  font-size: clamp(12.5px, 0.86vw, 14.6px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 780;
  text-wrap: balance;
  white-space: nowrap;
}

.brand p {
  margin: 3px 0 0;
  color: #b7cadb;
  font-size: clamp(7px, 0.47vw, 8.2px);
  white-space: nowrap;
}

.top-indicators {
  display: flex;
  align-items: stretch;
  gap: 10px;
  pointer-events: auto;
}

.indicator {
  min-width: 86px;
  padding: 9px 12px;
  border-left: 1px solid rgba(80, 205, 255, 0.28);
  background: linear-gradient(180deg, rgba(8, 22, 42, 0.5), rgba(3, 11, 24, 0.14));
}

.indicator small,
.metric small,
.mini-label,
.field-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.indicator strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.online-dot,
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 14px var(--emerald);
}

.notification {
  position: relative;
  width: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(4, 14, 30, 0.74);
}

.notification .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.emergency-toggle {
  min-width: 150px;
  border-color: rgba(255, 92, 92, 0.52);
  color: #ffd7d4;
  background: linear-gradient(180deg, rgba(87, 13, 22, 0.86), rgba(34, 8, 13, 0.78));
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-toggle {
  min-width: 118px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.sound-toggle {
  min-width: 112px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  color: #d6f7ff;
  font-size: 12px;
  font-weight: 800;
}

.sound-toggle.muted {
  color: var(--muted);
  background: rgba(5, 16, 32, 0.42);
}

.view-reset {
  min-width: 104px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.language-switch {
  display: flex;
  overflow: hidden;
  width: 88px;
  height: 42px;
  border: 1px solid rgba(80, 205, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(5, 16, 32, 0.74);
}

.view-control-deck {
  position: fixed;
  z-index: 34;
  top: 84px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 220px));
  min-height: 42px;
  border: 1px solid rgba(80, 205, 255, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(5, 20, 38, 0.86), rgba(3, 14, 28, 0.76)),
    rgba(5, 16, 32, 0.74);
  box-shadow: 0 14px 34px rgba(0, 10, 24, 0.28), inset 0 0 18px rgba(45, 212, 255, 0.05);
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.view-control-deck.minimized {
  width: auto;
  min-height: 0;
  padding: 0;
  border-color: rgba(80, 205, 255, 0.34);
  background: rgba(3, 14, 28, 0.84);
}

.view-control-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.view-control-deck.minimized .view-control-body {
  display: none;
}

.view-control-toggle {
  flex: 0 0 auto;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-color: rgba(86, 223, 255, 0.28);
  background: rgba(1, 14, 29, 0.74);
  color: #d8f9ff;
  font-size: 9.4px;
  font-weight: 850;
  text-transform: uppercase;
}

.view-control-deck:not(.minimized) .view-control-toggle {
  width: 32px;
  padding: 0;
}

.view-control-deck:not(.minimized) .view-control-toggle span {
  display: none;
}

.scene-toggles {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(250px, 1.1fr) minmax(210px, 0.86fr);
  align-items: stretch;
  gap: 6px;
}

.scene-toggles.map-expanded {
  grid-template-columns: minmax(390px, 1.42fr) minmax(240px, 0.88fr) minmax(245px, 0.84fr);
}

.toggle-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid rgba(90, 218, 255, 0.14);
  border-radius: 8px;
  background: rgba(1, 13, 27, 0.32);
}

.map-group {
  justify-content: flex-start;
}

.map-group.map-active {
  border-color: rgba(51, 241, 210, 0.28);
  background:
    linear-gradient(90deg, rgba(16, 123, 139, 0.22), rgba(1, 13, 27, 0.34)),
    rgba(1, 13, 27, 0.38);
  box-shadow: inset 0 0 18px rgba(37, 225, 205, 0.08);
}

.toggle-group-title {
  display: none;
  flex: 0 0 auto;
  color: #75d8ff;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #c8e8f7;
  font-size: 8.8px;
  white-space: nowrap;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 25px;
  height: 14px;
  border: 1px solid rgba(98, 217, 255, 0.28);
  border-radius: 999px;
  background: rgba(72, 92, 109, 0.44);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.18);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8bac5;
  transition: transform 160ms ease, background 160ms ease;
}

.switch-control input:checked + .switch-track {
  border-color: rgba(51, 241, 210, 0.72);
  background: linear-gradient(90deg, rgba(18, 168, 184, 0.82), rgba(34, 232, 186, 0.82));
  box-shadow: 0 0 14px rgba(52, 230, 218, 0.22);
}

.switch-control input:checked + .switch-track .switch-thumb {
  transform: translateX(11px);
  background: #efffff;
}

.switch-control.disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.switch-control.dependent-layer {
  padding-left: 7px;
  border-left: 1px solid rgba(92, 226, 255, 0.2);
}

.map-opacity-panel {
  flex: 1 1 270px;
  min-width: 0;
  width: auto;
  padding: 0 6px;
  border-top: 0;
  border-left: 1px solid rgba(80, 205, 255, 0.16);
  border-right: 1px solid rgba(80, 205, 255, 0.14);
  background: rgba(1, 18, 32, 0.32);
  border-radius: 7px;
  display: grid;
  grid-template-columns: minmax(116px, 0.72fr) minmax(118px, 1fr);
  align-items: center;
  gap: 6px;
  color: #c8e8f7;
  font-size: 9px;
}

.map-opacity-panel.hidden {
  display: none;
}

.map-source-field,
.map-slider-field {
  display: grid;
  align-items: center;
  gap: 6px;
}

.map-source-field {
  grid-template-columns: auto minmax(90px, 1fr);
}

.map-slider-field {
  grid-template-columns: auto 1fr 34px;
}

.map-opacity-panel select,
.map-opacity-panel input {
  width: 100%;
  accent-color: var(--teal);
}

.map-opacity-panel select {
  min-height: 26px;
  border: 1px solid rgba(88, 218, 255, 0.26);
  border-radius: 6px;
  background: rgba(1, 12, 24, 0.72);
  color: #d7f7ff;
  font-size: 9.5px;
}

.map-opacity-panel strong {
  text-align: right;
  font-size: 9.5px;
}

.language-switch button {
  width: 50%;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}

.language-switch button.active {
  color: #031622;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  font-weight: 900;
}

.panel,
.floating-panel,
.table-panel,
.side-drawer {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(6, 24, 46, 0.84), rgba(2, 10, 24, 0.72)),
    rgba(3, 15, 28, 0.72);
  box-shadow: var(--shadow), inset 0 0 32px rgba(40, 209, 255, 0.06);
  backdrop-filter: blur(14px);
  overflow-x: hidden;
  scrollbar-color: rgba(104, 232, 255, 0.48) rgba(6, 18, 35, 0.5);
  scrollbar-width: thin;
}

.app-shell.theme-light .panel,
.app-shell.theme-light .floating-panel,
.app-shell.theme-light .table-panel,
.app-shell.theme-light .side-drawer,
.app-shell.theme-light .bottom-nav,
.app-shell.theme-light .icon-rail,
.app-shell.theme-light .title-frame {
  background:
    linear-gradient(145deg, rgba(232, 248, 252, 0.9), rgba(206, 233, 243, 0.78)),
    rgba(227, 245, 250, 0.82);
  color: var(--text);
  box-shadow: 0 18px 46px rgba(44, 100, 125, 0.16), inset 0 0 28px rgba(0, 145, 170, 0.07);
}

.app-shell.theme-light button,
.app-shell.theme-light a.button-link {
  background: linear-gradient(180deg, rgba(227, 248, 252, 0.92), rgba(190, 224, 238, 0.84));
  color: var(--text);
}

.app-shell.theme-light .indicator,
.app-shell.theme-light .view-control-deck,
.app-shell.theme-light .language-switch,
.app-shell.theme-light .summary-box,
.app-shell.theme-light .mini-card,
.app-shell.theme-light .ai-card,
.app-shell.theme-light .incident-card,
.app-shell.theme-light .cctv-card,
.app-shell.theme-light .metric,
.app-shell.theme-light .detail-grid {
  background: rgba(202, 232, 242, 0.78);
}

.app-shell.theme-light .mini-card h3,
.app-shell.theme-light .card-title,
.app-shell.theme-light .panel-title,
.app-shell.theme-light .cctv-meta,
.app-shell.theme-light .field-value,
.app-shell.theme-light .indicator strong,
.app-shell.theme-light .brand h1,
.app-shell.theme-light .switch-control,
.app-shell.theme-light .map-opacity-panel {
  color: #071827;
}

.app-shell.theme-light .map-opacity-panel select {
  background: rgba(237, 249, 253, 0.9);
  color: #071827;
}

.app-shell.theme-light .toggle-group {
  background: rgba(239, 250, 253, 0.52);
}

.app-shell.theme-light .toggle-group-title {
  color: #096a88;
}

.app-shell.theme-light .switch-track {
  background: rgba(127, 151, 164, 0.34);
}

.app-shell.theme-light .switch-text {
  color: #071827;
}

.app-shell.theme-light .mini-label,
.app-shell.theme-light .field-label,
.app-shell.theme-light .indicator small,
.app-shell.theme-light .donut span,
.app-shell.theme-light .ai-card p,
.app-shell.theme-light .incident-card p,
.app-shell.theme-light .brand p {
  color: #31556a;
}

.panel::-webkit-scrollbar,
.floating-panel::-webkit-scrollbar,
.table-panel::-webkit-scrollbar,
.side-drawer::-webkit-scrollbar {
  width: 8px;
}

.panel::-webkit-scrollbar-track,
.floating-panel::-webkit-scrollbar-track,
.table-panel::-webkit-scrollbar-track,
.side-drawer::-webkit-scrollbar-track {
  background: rgba(6, 18, 35, 0.55);
}

.panel::-webkit-scrollbar-thumb,
.floating-panel::-webkit-scrollbar-thumb,
.table-panel::-webkit-scrollbar-thumb,
.side-drawer::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(104, 232, 255, 0.48);
}

.panel::before,
.floating-panel::before,
.table-panel::before,
.side-drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(76, 225, 255, 0.14), transparent) top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(112, 239, 255, 0.08), transparent 34%);
}

.left-panel {
  position: absolute;
  z-index: 18;
  left: 95px;
  top: 150px;
  width: min(340px, calc(100vw - 148px));
  max-height: calc(100vh - 236px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
}

.right-panel {
  position: absolute;
  z-index: 18;
  right: 18px;
  top: 132px;
  width: min(370px, calc(100vw - 36px));
  max-height: calc(100vh - 228px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

.panel-header,
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(108, 220, 255, 0.14);
  padding-bottom: 12px;
}

.movable-floating .popup-header {
  cursor: move;
}

.popup-tools {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.panel-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel.minimized {
  width: min(260px, calc(100vw - 36px));
  max-height: none;
}

.panel-title,
.popup-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
}

.right-panel .panel-header {
  flex-wrap: nowrap;
}

.left-panel .panel-header {
  flex-wrap: nowrap;
}

.left-panel .panel-title,
.right-panel .panel-title,
.right-panel .mini-card h3 span,
.right-panel .card-title {
  min-width: 0;
  white-space: nowrap;
}

.left-panel .panel-title,
.right-panel .panel-title {
  flex: 0 0 auto;
}

.left-panel .panel-tools,
.right-panel .panel-tools {
  flex: 0 0 auto;
  margin-left: auto;
}

.right-panel .mini-card h3,
.right-panel .card-title {
  align-items: center;
  flex-wrap: nowrap;
}

.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 188, 66, 0.45);
  border-radius: 999px;
  color: #ffd889;
  background: rgba(89, 54, 5, 0.28);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-grid {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.asset-registry-gauge {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.asset-registry-gauge .status-help {
  position: static;
}

.asset-registry-gauge .status-help-popover {
  left: 10px;
  top: 28px;
  transform: translateY(-4px);
}

.asset-registry-gauge .status-help-popover::before {
  left: 68px;
}

.asset-registry-gauge .status-help:hover .status-help-popover,
.asset-registry-gauge .status-help:focus-within .status-help-popover {
  transform: translateY(0);
}

.donut {
  --p: 84;
  position: relative;
  width: 116px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(4, 18, 35, 0.94) 0 54%, transparent 55%),
    conic-gradient(var(--teal) 0 calc(var(--p) * 1%), var(--amber) 0 94%, var(--red) 0 100%);
  box-shadow: 0 0 25px rgba(29, 224, 204, 0.26);
}

.donut-inner {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: var(--gauge-core-ink);
  background: var(--gauge-core-fill);
}

.donut strong {
  font-size: 25px;
  line-height: 1;
}

.donut span {
  color: var(--gauge-core-label);
  font-size: 11px;
  text-align: center;
}

.status-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.status-item,
.summary-item,
.source-row,
.fact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.status-item strong,
.summary-item strong {
  font-size: 18px;
}

.status-item {
  min-width: 0;
  min-height: 45px;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(4, 20, 38, 0.58);
}

.status-item > span:last-child {
  display: grid;
  justify-items: end;
  min-width: 56px;
}

.status-item > span:first-child {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 12px;
}

.status-item small {
  margin-top: 2px;
}

.status-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
}

.status-dot.fault,
.status-dot.critical {
  background: var(--red);
  box-shadow: 0 0 14px var(--red);
}

.status-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 8;
}

.status-help-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border: 1px solid rgba(99, 231, 255, 0.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: rgba(5, 24, 44, 0.62);
  line-height: 1;
  box-shadow: 0 0 16px rgba(55, 229, 255, 0.22);
}

.status-help-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.status-help-popover {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  width: 282px;
  max-width: min(282px, calc(100vw - 36px));
  padding: 11px 12px;
  border: 1px solid rgba(88, 225, 255, 0.32);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  color: #d9f6ff;
  white-space: normal;
  background:
    linear-gradient(145deg, rgba(6, 30, 52, 0.98), rgba(2, 12, 25, 0.96)),
    rgba(2, 12, 25, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 0 28px rgba(52, 218, 255, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 80;
}

.status-help-popover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(88, 225, 255, 0.32);
  border-top: 1px solid rgba(88, 225, 255, 0.32);
  background: rgba(6, 30, 52, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.status-help:hover .status-help-popover,
.status-help:focus-within .status-help-popover {
  opacity: 1;
  transform: translate(-50%, 0);
}

.status-help-popover > strong {
  color: #f5fdff;
  font-size: 12px;
  line-height: 1.25;
  text-transform: none;
}

.status-help-list,
.status-help-row,
.status-help-text {
  display: grid;
  gap: 7px;
  color: #bdddeb;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
}

.status-help-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 7px;
}

.status-help-list .status-dot {
  margin-top: 2px;
}

.status-help-copy {
  display: block;
}

.status-help-list strong {
  color: #ffffff;
  font-weight: 800;
}

.mini-card {
  position: relative;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(73, 203, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(2, 15, 30, 0.58);
}

.mini-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #d5ecff;
}

.mini-title-with-help {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.mini-title-with-help .status-help {
  position: static;
}

.mini-title-with-help .status-help-popover {
  left: 12px;
  right: 12px;
  top: auto;
  bottom: calc(100% + 8px);
  width: auto;
  max-width: none;
  transform: translateY(-4px);
}

.mini-title-with-help .status-help-popover::before {
  left: 112px;
  top: auto;
  bottom: -6px;
  transform: translateX(-50%) rotate(225deg);
}

.mini-title-with-help .status-help:hover .status-help-popover,
.mini-title-with-help .status-help:focus-within .status-help-popover {
  transform: translateY(0);
}

.sparkline,
.bars {
  width: 100%;
  height: 74px;
}

.bars {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: center;
}

.mini-gauge {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, var(--gauge-core-fill) 0 58%, transparent 59%),
    conic-gradient(var(--emerald) 0 83%, rgba(54, 88, 117, 0.45) 0 100%);
}

.mini-gauge strong {
  font-size: 19px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 72px;
  padding-bottom: 2px;
}

.bar-chart i {
  display: block;
  flex: 1;
  min-width: 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--cyan), var(--teal));
  box-shadow: 0 0 12px rgba(47, 231, 224, 0.36);
}

.app-shell.theme-light .data-badge {
  color: #7b5200;
  border-color: rgba(166, 118, 15, 0.38);
  background: rgba(255, 229, 153, 0.72);
}

.app-shell.theme-light .donut {
  background:
    radial-gradient(circle, rgba(235, 250, 253, 0.96) 0 54%, transparent 55%),
    conic-gradient(var(--teal) 0 calc(var(--p) * 1%), var(--amber) 0 94%, var(--red) 0 100%);
}

.app-shell.theme-light .donut-inner,
.app-shell.theme-light .mini-gauge {
  background:
    radial-gradient(circle, rgba(245, 253, 255, 0.96) 0 58%, transparent 59%),
    rgba(235, 250, 253, 0.94);
  color: #071827;
}

.app-shell.theme-light .status-item,
.app-shell.theme-light .summary-item,
.app-shell.theme-light .source-row,
.app-shell.theme-light .fact-row,
.app-shell.theme-light .check-item,
.app-shell.theme-light .copilot-response {
  background: rgba(238, 250, 253, 0.78);
  color: #071827;
}

.app-shell.theme-light .status-item strong,
.app-shell.theme-light .summary-item strong,
.app-shell.theme-light .mini-gauge strong,
.app-shell.theme-light .donut strong {
  color: #071827;
}

.app-shell.theme-light .sparkline g {
  stroke: rgba(38, 112, 139, 0.2);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.summary-box {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 9px 8px;
  border: 1px solid rgba(85, 217, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(4, 20, 38, 0.72);
}

.summary-box small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.summary-box strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.ai-card,
.incident-card,
.cctv-card,
.operation-card,
.report-card {
  position: relative;
  width: 100%;
  border: 1px solid rgba(85, 217, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(4, 18, 35, 0.68);
  padding: 12px;
}

.ai-card {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.ai-chip {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 232, 255, 0.34);
  border-radius: 18px;
  color: var(--cyan);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 0 20px rgba(65, 225, 255, 0.16), 0 0 20px rgba(65, 225, 255, 0.12);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(45, 116, 255, 0.24);
  color: #95d9ff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.pill.high,
.pill.critical {
  color: #ffd1ca;
  background: rgba(255, 80, 80, 0.24);
  border: 1px solid rgba(255, 96, 96, 0.34);
}

.pill.warning {
  color: #ffdea0;
  background: rgba(255, 188, 66, 0.19);
  border: 1px solid rgba(255, 188, 66, 0.28);
}

.pill.resolved {
  color: #bcffdc;
  background: rgba(57, 235, 144, 0.18);
}

.app-shell.theme-light .pill {
  color: #07496a;
  background: rgba(42, 142, 205, 0.14);
  border: 1px solid rgba(42, 142, 205, 0.22);
}

.app-shell.theme-light .pill.high,
.app-shell.theme-light .pill.critical {
  color: #9c1f1f;
  background: rgba(255, 111, 96, 0.18);
  border-color: rgba(194, 57, 45, 0.32);
}

.app-shell.theme-light .pill.warning {
  color: #7b5200;
  background: rgba(255, 196, 65, 0.26);
  border-color: rgba(166, 118, 15, 0.34);
}

.app-shell.theme-light .pill.resolved {
  color: #116b3a;
  background: rgba(57, 204, 121, 0.18);
  border-color: rgba(31, 143, 79, 0.25);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-card p,
.incident-card p {
  margin: 0 0 10px;
  color: #c9dceb;
  font-size: 13px;
  line-height: 1.45;
}

.inline-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.cctv-list {
  display: grid;
  gap: 10px;
}

.cctv-card {
  padding: 0;
  overflow: hidden;
}

.cctv-image {
  position: relative;
  min-height: 92px;
  background:
    linear-gradient(180deg, rgba(15, 95, 125, 0.28), rgba(0, 8, 15, 0.7)),
    radial-gradient(circle at 20% 10%, rgba(98, 230, 255, 0.16), transparent 42%);
  overflow: hidden;
}

.cctv-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0.9;
}

.cctv-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  color: #dcefff;
  font-size: 12px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffb3b9;
  font-weight: 800;
}

.app-shell.theme-light .live-dot {
  color: #a52332;
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

.icon-rail {
  position: absolute;
  z-index: 22;
  top: 150px;
  left: 12px;
  bottom: auto;
  width: 68px;
  max-height: calc(100vh - 250px);
  padding: 8px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(3px, 0.46vh, 6px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(81, 217, 255, 0.42);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(6, 27, 52, 0.78), rgba(3, 13, 26, 0.68));
  box-shadow: var(--shadow), inset 0 0 30px rgba(50, 214, 255, 0.07);
  backdrop-filter: blur(14px);
}

.rail-button {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c7ecff;
  background: radial-gradient(circle, rgba(45, 156, 255, 0.26), rgba(3, 17, 34, 0.86));
}

.rail-button.active {
  color: #ffffff;
  border-color: rgba(106, 240, 255, 0.92);
  box-shadow: var(--glow);
}

.rail-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.98);
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(85, 217, 255, 0.35);
  border-radius: 6px;
  background: rgba(3, 13, 27, 0.92);
  color: #d9f4ff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.rail-button:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.bottom-nav {
  position: absolute;
  z-index: 24;
  left: 18px;
  right: 18px;
  bottom: 42px;
  min-height: 98px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid rgba(61, 191, 255, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(4, 18, 35, 0.84), rgba(1, 8, 18, 0.92));
  box-shadow: var(--shadow), inset 0 0 36px rgba(49, 201, 255, 0.06);
  backdrop-filter: blur(16px);
}

.primary-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(144px, 1fr));
  gap: 14px;
}

.nav-button {
  position: relative;
  min-height: 66px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 14px;
  color: #c4d7e8;
  font-size: 15px;
  font-weight: 830;
  text-transform: uppercase;
}

.nav-button.active {
  color: white;
  border-color: rgba(99, 238, 255, 0.84);
  background: linear-gradient(180deg, rgba(20, 107, 151, 0.72), rgba(5, 30, 58, 0.88));
  box-shadow: var(--glow);
}

.nav-button.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -10px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px var(--cyan);
}

.secondary-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid rgba(91, 192, 255, 0.26);
}

.screen-setting-footer {
  position: absolute;
  z-index: 30;
  right: 18px;
  bottom: 6px;
  pointer-events: auto;
}

.screen-fit-control {
  min-width: 218px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(86, 220, 255, 0.28);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto auto minmax(88px, 1fr);
  gap: 7px;
  align-items: center;
  color: #c8eeff;
  background:
    linear-gradient(180deg, rgba(13, 51, 82, 0.62), rgba(3, 18, 35, 0.78)),
    rgba(3, 16, 31, 0.7);
}

.screen-fit-control svg {
  grid-row: auto;
}

.screen-fit-control span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.screen-fit-control select {
  width: 100%;
  min-width: 0;
  height: 20px;
  border: 1px solid rgba(86, 220, 255, 0.26);
  border-radius: 6px;
  color: #eefaff;
  background: rgba(2, 12, 24, 0.78);
  font-size: 11px;
  font-weight: 800;
}

.secondary-button {
  width: 74px;
  min-height: 62px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  gap: 4px;
  color: #c6eaff;
  font-size: 10px;
  text-transform: uppercase;
}

.marker-layer,
.label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 16;
}

.marker-layer.markers-hidden {
  display: none;
}

.floating-root,
.overlay-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-root {
  z-index: 46;
}

.overlay-root {
  z-index: 42;
}

.marker {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 1px solid rgba(95, 236, 255, 0.72);
  background: radial-gradient(circle, rgba(23, 211, 191, 0.34), rgba(6, 26, 49, 0.88));
  color: #dffaff;
  box-shadow: 0 0 18px rgba(69, 234, 255, 0.42);
}

.marker.fan {
  border-color: rgba(80, 245, 198, 0.78);
}

.marker.pump,
.marker.drainage {
  border-color: rgba(91, 174, 255, 0.82);
}

.marker.fire,
.marker.alarm {
  border-color: rgba(255, 86, 88, 0.88);
  box-shadow: 0 0 22px rgba(255, 78, 93, 0.54);
}

.marker.exit {
  border-color: rgba(83, 241, 148, 0.86);
}

.marker.power {
  border-color: rgba(255, 208, 89, 0.9);
}

.marker.sensor,
.marker.smoke {
  border-color: rgba(119, 230, 255, 0.86);
}

.marker.water-level {
  border-color: rgba(80, 162, 255, 0.88);
}

.marker.lighting {
  border-color: rgba(255, 229, 118, 0.9);
}

.marker.traffic-sign {
  border-color: rgba(100, 214, 255, 0.88);
}

.marker.emergency-phone,
.marker.communication {
  border-color: rgba(180, 134, 255, 0.86);
}

.marker.structural {
  border-color: rgba(124, 255, 217, 0.86);
}

.marker::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid currentColor;
  border-radius: inherit;
  opacity: 0.15;
  animation: markerPulse 2.5s ease-in-out infinite;
}

@keyframes markerPulse {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.12;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.34;
  }
}

.scene-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 8px 10px;
  border: 1px solid rgba(95, 236, 255, 0.3);
  border-radius: 6px;
  background: rgba(3, 14, 28, 0.7);
  color: #d8f5ff;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 0 12px rgba(70, 223, 255, 0.4);
  backdrop-filter: blur(10px);
}

.scene-label.river {
  border: 0;
  background: transparent;
  color: #7edfff;
  letter-spacing: 8px;
  text-transform: uppercase;
  opacity: 0.9;
}

.scene-label.road-name {
  padding: 4px 7px;
  border-color: rgba(104, 239, 255, 0.22);
  background: rgba(2, 12, 24, 0.42);
  color: #c8f6ff;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.scene-label.building-name,
.scene-label.building-info {
  padding: 5px 8px;
  border-color: rgba(124, 255, 217, 0.24);
  background: rgba(2, 18, 26, 0.56);
  color: #d8fff5;
  font-size: 10px;
  letter-spacing: 0;
  white-space: nowrap;
}

.scene-label.building-info {
  border-color: rgba(255, 214, 116, 0.3);
  background: rgba(24, 18, 6, 0.55);
  color: #fff1c6;
  line-height: 1.32;
}

.platform-footer {
  position: absolute;
  z-index: 26;
  left: 18px;
  right: 258px;
  bottom: 6px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(210, 235, 246, 0.76);
  font-size: 11px;
  letter-spacing: 0;
  text-align: center;
  pointer-events: none;
}

.floating-panel {
  position: absolute;
  z-index: 30;
  width: min(340px, calc(100vw - 32px));
  pointer-events: auto;
  padding: 14px;
}

.floating-panel.equipment {
  top: var(--device-popup-top);
  left: var(--device-popup-left);
  width: var(--device-popup-width);
  max-height: var(--device-popup-max-height);
  overflow: auto;
  resize: both;
  min-width: 300px;
  min-height: 172px;
}

.floating-panel.ai {
  bottom: 132px;
  left: calc(50% + 44px);
  width: min(292px, calc(100vw - 32px));
  max-height: 246px;
  overflow: auto;
}

.floating-panel.cctv {
  top: var(--device-popup-top);
  left: var(--device-popup-left);
  width: var(--device-popup-width);
  max-height: var(--device-popup-max-height);
  overflow: auto;
  resize: both;
  min-width: 300px;
  min-height: 172px;
}

.floating-panel.minimized-floating {
  height: auto;
  min-height: 0;
  resize: none;
  overflow: visible;
}

.floating-panel.minimized-floating .popup-header {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.movable-floating.dragging {
  user-select: none;
  box-shadow: var(--shadow), var(--glow);
}

.floating-panel.section {
  top: calc(36% + var(--floating-panel-downshift));
  left: 42%;
}

.floating-panel.alarm {
  top: 150px;
  left: calc(50% - 20px);
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 220px);
  overflow: auto;
  resize: both;
  min-width: 310px;
  min-height: 170px;
}

.close-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5, 17, 33, 0.42);
}

.detail-main {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
}

.device-orb {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--emerald);
  border: 1px solid rgba(76, 241, 178, 0.46);
  background: radial-gradient(circle, rgba(39, 219, 170, 0.22), rgba(4, 18, 34, 0.8));
  box-shadow: 0 0 22px rgba(58, 242, 177, 0.23);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 10px 0;
  padding: 9px;
  border: 1px solid rgba(89, 216, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(2, 15, 30, 0.46);
}

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

.field-value {
  color: #e4f7ff;
  font-size: 12px;
}

.health-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
}

.health-line span {
  min-width: 48px;
  font-size: 12px;
}

.progress {
  position: relative;
  height: 5px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(79, 122, 151, 0.36);
}

.progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 80%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--emerald));
  box-shadow: 0 0 12px rgba(73, 243, 165, 0.38);
}

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

.popup-actions button,
.source-actions a {
  min-height: 38px;
  border-radius: 6px;
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
}

.risk-line {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
}

.risk-chart {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
  height: 58px;
  padding: 4px 0 0;
}

.risk-point {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.risk-point i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--level, var(--emerald));
  box-shadow: 0 0 12px var(--level, var(--emerald));
  transform: translateY(calc((100 - var(--height)) * 0.5px));
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
  padding-right: 2px;
}

.tab-button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  color: #aed1e4;
  font-size: 10.5px;
}

.tab-button.active {
  color: #071423;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  font-weight: 900;
}

.control-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 12px 0;
}

.metric {
  padding: 9px;
  border: 1px solid rgba(82, 218, 255, 0.17);
  border-radius: 6px;
  background: rgba(2, 16, 31, 0.58);
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: #eaf9ff;
  font-size: 17px;
}

.app-shell.theme-light .metric strong {
  color: #071827;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.check-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(82, 218, 255, 0.14);
  border-radius: 6px;
  background: rgba(2, 16, 31, 0.5);
  color: #d7edf8;
  font-size: 12px;
}

.check-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(73, 180, 255, 0.2);
  color: #aeeaff;
  font-weight: 800;
}

.compact-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

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

.alarm-summary-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.alarm-summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
}

.alarm-summary-row strong,
.alarm-summary-row small {
  display: block;
}

.alarm-summary-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.app-shell.theme-light .check-index {
  color: #075b78;
  background: rgba(0, 146, 190, 0.14);
}

.app-shell.emergency-active .check-item.active .check-index {
  background: var(--red);
  color: white;
  box-shadow: 0 0 18px rgba(255, 81, 92, 0.52);
}

.table-panel {
  position: absolute;
  z-index: 29;
  left: 470px;
  right: 380px;
  top: 150px;
  bottom: auto;
  min-height: 320px;
  padding: 16px;
  pointer-events: auto;
  resize: both;
  overflow: auto;
}

.table-panel.minimized-floating {
  min-height: 0;
  width: min(330px, calc(100vw - 32px));
  resize: none;
  overflow: visible;
}

.table-panel.minimized-floating .popup-header {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

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

.filters input,
.filters select,
.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(85, 217, 255, 0.22);
  border-radius: 6px;
  color: var(--text);
  background: rgba(3, 14, 28, 0.78);
  padding: 0 10px;
}

.app-shell.theme-light .filters input,
.app-shell.theme-light .filters select,
.app-shell.theme-light .form-grid input,
.app-shell.theme-light .form-grid select {
  color: #071827;
  background: rgba(244, 253, 255, 0.92);
  border-color: rgba(0, 132, 164, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.app-shell.theme-light .filters input::placeholder {
  color: #547387;
}

.app-shell.theme-light .filters option,
.app-shell.theme-light .form-grid option {
  color: #071827;
  background: #f4fdff;
}

.alarm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.alarm-table th,
.alarm-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(102, 220, 255, 0.1);
  text-align: left;
}

.alarm-table th {
  color: #97bad0;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.app-shell.theme-light .alarm-table th {
  color: #31556a;
}

.app-shell.theme-light .alarm-table td {
  color: #071827;
}

.app-shell.theme-light .alarm-table tr:hover td {
  background: rgba(0, 145, 170, 0.1);
}

.alarm-table tr {
  cursor: pointer;
}

.alarm-table tr:hover td {
  background: rgba(77, 216, 255, 0.07);
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.side-drawer {
  position: absolute;
  z-index: 32;
  top: 96px;
  right: 18px;
  bottom: 126px;
  width: min(390px, calc(100vw - 36px));
  padding: 16px;
  pointer-events: auto;
}

.question-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.question-list button {
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  color: #d7edf8;
  font-size: 12px;
}

.app-shell.theme-light .question-list button,
.app-shell.theme-light .scenario-list button,
.app-shell.theme-light .popup-actions button,
.app-shell.theme-light .source-actions a,
.app-shell.theme-light .tab-button {
  color: #071827;
  background: linear-gradient(180deg, rgba(245, 253, 255, 0.94), rgba(207, 234, 244, 0.9));
}

.copilot-response {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(83, 220, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(2, 15, 29, 0.58);
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.scenario-list button {
  min-height: 42px;
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
}

.scenario-list button.active {
  background: linear-gradient(135deg, rgba(36, 170, 255, 0.42), rgba(47, 231, 176, 0.32));
}

.app-shell.theme-light .scenario-list button.active,
.app-shell.theme-light .tab-button.active {
  color: #041724;
  background: linear-gradient(135deg, #55e7ff, #49f3a5);
}

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

.form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.app-shell.theme-light .form-grid label {
  color: #31556a;
}

.source-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 290px);
  overflow: auto;
  padding-right: 4px;
}

.source-row {
  align-items: flex-start;
  padding: 10px;
  border: 1px solid rgba(83, 220, 255, 0.14);
  border-radius: 6px;
  background: rgba(2, 15, 29, 0.5);
}

.source-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.map-panel {
  position: absolute;
  z-index: 34;
  left: 50%;
  top: 50%;
  width: min(880px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 150px));
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.map-frame {
  width: 100%;
  height: calc(100% - 52px);
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  filter: saturate(0.9) contrast(1.05);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 31;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.confirm-modal {
  width: min(420px, calc(100vw - 34px));
  padding: 18px;
}

.confirm-modal p {
  color: #dcefff;
  line-height: 1.5;
}

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

.danger {
  border-color: rgba(255, 92, 92, 0.6);
  background: linear-gradient(180deg, rgba(111, 22, 24, 0.86), rgba(42, 7, 10, 0.82));
}

.toast {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 126px;
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px 14px;
  border: 1px solid rgba(85, 217, 255, 0.35);
  border-radius: 6px;
  background: rgba(3, 14, 28, 0.92);
  color: #dff7ff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-shell.emergency-active {
  --line: rgba(255, 119, 72, 0.5);
  --line-soft: rgba(255, 119, 72, 0.22);
  --cyan: #ff9a57;
  --teal: #ff683d;
}

.app-shell.emergency-active .scene-vignette {
  background:
    radial-gradient(circle at 50% 50%, rgba(65, 5, 5, 0) 0 42%, rgba(88, 8, 10, 0.38) 100%),
    linear-gradient(90deg, rgba(32, 0, 0, 0.55), transparent 19%, transparent 80%, rgba(42, 0, 0, 0.56));
}

.app-shell.emergency-active .marker.fire,
.app-shell.emergency-active .marker.smoke,
.app-shell.emergency-active .marker.alarm {
  animation: emergencyFlash 0.85s ease-in-out infinite;
}

@keyframes emergencyFlash {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.7);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .left-panel {
    width: 340px;
  }

  .right-panel {
    width: 370px;
  }

  .table-panel {
    left: 338px;
    right: 338px;
  }

  .nav-button {
    min-height: 58px;
    font-size: 13px;
  }
}

@media (max-width: 1500px) and (min-width: 981px) {
  .topbar {
    grid-template-columns: minmax(500px, 540px) minmax(0, auto);
    gap: 8px;
  }

  .title-frame {
    max-width: 540px;
  }

  .brand h1 {
    font-size: 13.6px;
  }

  .brand p {
    font-size: 7.25px;
  }

  .top-indicators {
    gap: 6px;
  }

  .indicator {
    min-width: auto;
    padding: 7px 8px;
  }

  .indicator small {
    font-size: 9.5px;
  }

  .indicator strong {
    font-size: 11.5px;
  }

  .notification {
    width: 40px;
  }

  .emergency-toggle {
    min-width: 152px;
    padding: 0 9px;
    font-size: 11px;
  }

  .view-reset,
  .theme-toggle,
  .sound-toggle {
    width: 42px;
    min-width: 42px;
    padding: 0;
    gap: 0;
  }

  .view-reset span,
  .theme-toggle span,
  .sound-toggle span {
    display: none;
  }

  .language-switch {
    width: 72px;
    height: 38px;
  }

  .view-control-deck {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(920px, calc(100vw - 180px));
  }

  .scene-toggles {
    grid-template-columns: minmax(135px, 0.68fr) minmax(224px, 1fr) minmax(186px, 0.78fr);
  }

  .scene-toggles.map-expanded {
    grid-template-columns: minmax(350px, 1.34fr) minmax(218px, 0.86fr) minmax(214px, 0.78fr);
  }

  .toggle-group {
    gap: 5px;
    padding: 4px 5px;
  }

  .toggle-group-title {
    font-size: 7.8px;
  }

  .switch-control {
    gap: 3px;
    font-size: 8.4px;
  }

  .switch-track {
    width: 24px;
    height: 14px;
  }

  .switch-thumb {
    width: 8px;
    height: 8px;
  }

  .switch-control input:checked + .switch-track .switch-thumb {
    transform: translateX(10px);
  }

  .map-opacity-panel {
    flex-basis: 242px;
    grid-template-columns: minmax(104px, 0.72fr) minmax(96px, 1fr);
    gap: 6px;
    font-size: 8.7px;
  }

  .map-slider-field {
    grid-template-columns: auto 1fr 32px;
  }

  .map-opacity-panel strong {
    font-size: 9.5px;
  }
}

@media (max-width: 1200px) and (min-width: 981px) {
  .view-control-deck {
    width: min(860px, calc(100vw - 120px));
  }

  .map-opacity-panel {
    flex-basis: 228px;
    grid-template-columns: minmax(98px, 0.72fr) minmax(90px, 1fr);
  }

  .toggle-group-title {
    display: none;
  }
}

@media (max-width: 1300px) and (min-width: 981px) {
  .toggle-group-title {
    display: none;
  }

  .scene-toggles {
    grid-template-columns: minmax(126px, 0.68fr) minmax(206px, 1fr) minmax(170px, 0.78fr);
  }

  .scene-toggles.map-expanded {
    grid-template-columns: minmax(320px, 1.34fr) minmax(198px, 0.82fr) minmax(204px, 0.74fr);
  }

  .switch-control {
    font-size: 8px;
  }

  .view-control-toggle {
    width: 30px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: 1120px;
    overflow: hidden;
  }

  .topbar {
    left: 12px;
    right: 12px;
    grid-template-columns: 1fr;
  }

  .title-frame {
    width: min(560px, 100%);
    grid-template-columns: 42px 1fr;
    min-height: 62px;
    padding: 7px 14px;
  }

  .title-frame::before,
  .title-frame::after {
    display: none;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .top-indicators {
    justify-content: center;
    flex-wrap: wrap;
  }

  .brand h1 {
    font-size: 16px;
  }

  .icon-rail {
    top: 168px;
    left: 10px;
    bottom: auto;
    height: 436px;
    width: 54px;
    padding: 8px 6px;
    gap: 4px;
  }

  .rail-button {
    width: 36px;
    height: 36px;
  }

  .left-panel {
    top: 622px;
    left: 12px;
    width: calc(50% - 18px);
  }

  .right-panel {
    top: 622px;
    right: 12px;
    width: calc(50% - 18px);
  }

  .bottom-nav {
    left: 12px;
    right: 12px;
    bottom: 42px;
    grid-template-columns: 1fr;
    min-height: 150px;
  }

  .screen-setting-footer {
    right: 12px;
    bottom: 6px;
  }

  .primary-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .secondary-nav {
    justify-content: center;
    border-left: 0;
    padding-left: 0;
  }

  .floating-panel.equipment,
  .floating-panel.ai,
  .floating-panel.cctv,
  .floating-panel.section,
  .floating-panel.alarm {
    left: auto;
    right: 12px;
  }

  .floating-panel.equipment,
  .floating-panel.cctv {
    top: 184px;
  }

  .floating-panel.ai {
    top: 406px;
    bottom: auto;
  }

  .table-panel {
    left: 84px;
    right: 12px;
    top: 178px;
    bottom: auto;
  }

  .filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .app-shell {
    height: 1380px;
  }

  .title-frame {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    gap: 8px;
    min-height: 66px;
    padding: 8px 10px;
  }

  .project-info-button {
    width: 24px;
    height: 24px;
  }

  .project-info-popover {
    width: min(342px, calc(100vw - 24px));
  }

  .project-info-grid div {
    grid-template-columns: 92px 1fr;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand h1 {
    font-size: 10.6px;
  }

  .brand p {
    font-size: 6.2px;
  }

  .top-indicators .indicator:nth-child(2),
  .top-indicators .indicator:nth-child(3) {
    display: none;
  }

  .view-control-deck {
    position: static;
    transform: none;
    margin: 8px auto 0;
    width: min(304px, calc(100vw - 26px));
    min-width: 0;
  }

  .view-control-body {
    display: grid;
  }

  .scene-toggles {
    grid-template-columns: 1fr;
  }

  .scene-toggles.map-expanded {
    grid-template-columns: 1fr;
  }

  .toggle-group {
    justify-content: center;
    flex-wrap: wrap;
  }

  .map-opacity-panel {
    grid-template-columns: 1fr;
  }

  .map-source-field,
  .map-slider-field {
    grid-template-columns: auto 1fr;
  }

  .map-slider-field strong {
    grid-column: 2;
  }

  .icon-rail {
    top: 338px;
  }

  .left-panel,
  .right-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .left-panel {
    top: 610px;
    left: 78px;
  }

  .right-panel {
    top: 918px;
  }

  .status-grid,
  .detail-main {
    grid-template-columns: 1fr;
  }

  .donut,
  .device-orb {
    margin: 0 auto;
  }

  .bottom-nav {
    min-height: 178px;
    bottom: 42px;
  }

  .primary-nav {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav-button {
    min-height: 48px;
    font-size: 11px;
    gap: 8px;
  }

  .secondary-button {
    width: 58px;
    min-height: 52px;
    font-size: 9px;
  }

  .platform-footer {
    left: 10px;
    right: 218px;
    font-size: 9px;
    line-height: 1.2;
    justify-content: flex-start;
    text-align: left;
  }

  .screen-setting-footer {
    right: 8px;
    bottom: 6px;
  }

  .screen-fit-control {
    min-width: 200px;
  }

  .summary-grid,
  .control-metrics,
  .form-grid,
  .scenario-list {
    grid-template-columns: 1fr;
  }

  .floating-panel {
    width: calc(100vw - 24px);
  }

  .floating-panel.equipment,
  .floating-panel.ai,
  .floating-panel.cctv,
  .floating-panel.section,
  .floating-panel.alarm {
    left: 12px;
    right: 12px;
  }

  .floating-panel.equipment,
  .floating-panel.cctv {
    top: 178px;
  }

  .floating-panel.ai {
    top: 430px;
  }

  .table-panel {
    left: 12px;
    right: 12px;
    top: 178px;
    bottom: auto;
    overflow: auto;
  }

  .alarm-table {
    min-width: 720px;
  }

  .filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html,
  body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 640px;
    overflow: hidden;
  }

  .scene-vignette {
    background:
      radial-gradient(circle at 50% 48%, rgba(5, 24, 42, 0) 0 56%, rgba(0, 0, 0, 0.22) 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.42));
  }

  .grid-overlay {
    opacity: 0.18;
  }

  .topbar {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 8px;
    right: 8px;
    min-height: 0;
    gap: 6px;
    align-items: start;
  }

  .title-frame {
    width: 100%;
    max-width: none;
    grid-template-columns: 30px minmax(0, 1fr) 24px;
    min-height: 50px;
    gap: 7px;
    padding: 6px 8px;
    border-radius: var(--radius);
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand h1 {
    font-size: 11px;
    line-height: 1.12;
    white-space: normal;
  }

  .brand p {
    display: none;
  }

  .project-info-button {
    width: 24px;
    height: 24px;
  }

  .project-info-popover {
    top: calc(100% + 6px);
    max-height: calc(100dvh - 132px);
    overflow: auto;
  }

  .top-indicators {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 36px;
    gap: 5px;
    justify-content: stretch;
    align-items: center;
  }

  .top-indicators .indicator {
    display: none;
  }

  .top-indicators .indicator:first-child {
    display: block;
    grid-column: 1 / 5;
    min-width: 0;
    width: auto;
    min-height: 36px;
    padding: 5px 9px;
    overflow: hidden;
    border-radius: 9px;
    border-left: 1px solid rgba(80, 205, 255, 0.28);
    border-right: 1px solid rgba(80, 205, 255, 0.14);
    background: linear-gradient(90deg, rgba(8, 22, 42, 0.74), rgba(3, 11, 24, 0.24));
  }

  .indicator small {
    font-size: 8px;
  }

  .indicator strong {
    width: 100%;
    overflow: hidden;
    font-size: 10.4px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notification,
  .emergency-toggle,
  .view-reset,
  .theme-toggle,
  .sound-toggle {
    appearance: none;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 0;
    gap: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    line-height: 0;
  }

  .notification {
    grid-column: 1;
  }

  .emergency-toggle {
    grid-column: 2;
  }

  .view-reset {
    grid-column: 3;
  }

  .theme-toggle {
    grid-column: 4;
  }

  .sound-toggle {
    grid-column: 5;
  }

  .top-indicators > button svg {
    display: block;
    width: 19px;
    height: 19px;
    margin: auto;
  }

  .notification .badge {
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    font-size: 10px;
  }

  .emergency-toggle span,
  .view-reset span,
  .theme-toggle span,
  .sound-toggle span {
    display: none;
  }

  .language-switch {
    grid-row: 1;
    grid-column: 5 / 7;
    justify-self: stretch;
    width: 100%;
    height: 36px;
  }

  .language-switch button {
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 11px;
    line-height: 1;
  }

  .view-control-deck {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 158px);
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    min-width: 0;
    min-height: 0;
    max-height: 136px;
    margin: 0;
    padding: 4px;
  }

  .view-control-deck.minimized {
    top: calc(env(safe-area-inset-top, 0px) + 114px);
    left: auto;
    right: auto;
    right: 8px;
    width: 70px;
    background: rgba(3, 14, 28, 0.86);
  }

  .view-control-deck.minimized .view-control-toggle {
    appearance: none;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 36px;
    padding: 0;
    line-height: 0;
  }

  .view-control-deck.minimized .view-control-toggle span {
    display: none;
  }

  .view-control-deck.minimized .view-control-toggle svg {
    display: block;
    width: 19px;
    height: 19px;
    margin: auto;
  }

  .view-control-deck:not(.minimized) .view-control-toggle {
    width: 30px;
    min-height: 30px;
  }

  .view-control-body {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .view-control-body::-webkit-scrollbar {
    display: none;
  }

  .scene-toggles,
  .scene-toggles.map-expanded {
    display: flex;
    grid-template-columns: none;
    width: max-content;
    min-width: max-content;
    gap: 5px;
  }

  .toggle-group {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 3px 5px;
  }

  .switch-control {
    font-size: 8px;
  }

  .map-opacity-panel {
    flex: 0 0 208px;
    padding: 4px 6px;
    grid-template-columns: 1fr;
    border-left: 1px solid rgba(80, 205, 255, 0.16);
  }

  .map-source-field,
  .map-slider-field {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .map-slider-field strong {
    grid-column: 2;
  }

  .icon-rail {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 124px);
    width: auto;
    height: 46px;
    max-height: none;
    padding: 5px;
    flex-direction: row;
    justify-content: space-between;
    gap: 2px;
    overflow-x: hidden;
    overflow-y: hidden;
    border-radius: 16px;
    scrollbar-width: none;
  }

  .icon-rail::-webkit-scrollbar {
    display: none;
  }

  .rail-button {
    appearance: none;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    display: grid;
    place-items: center;
    line-height: 0;
  }

  .rail-button svg {
    display: block;
    width: 17px;
    height: 17px;
    margin: auto;
  }

  .rail-button[data-tooltip]::after {
    display: none;
  }

  .left-panel,
  .right-panel {
    position: absolute;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 184px);
    width: auto;
    max-height: min(34vh, 262px);
    padding: 12px;
  }

  .app-shell[data-mode="home"] .left-panel {
    display: block;
  }

  .app-shell[data-mode="home"] .right-panel {
    display: none;
  }

  .app-shell:not([data-mode="home"]) .left-panel {
    display: none;
  }

  .app-shell:not([data-mode="home"]) .right-panel {
    display: block;
  }

  .panel-header,
  .popup-header {
    margin-bottom: 10px;
    padding-bottom: 9px;
    align-items: center;
  }

  .popup-tools,
  .panel-tools {
    align-items: center;
    gap: 7px;
  }

  .side-drawer .close-button,
  .floating-panel .close-button,
  .table-panel .close-button,
  .panel .close-button,
  .project-info-popover .close-button {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    place-content: center;
    line-height: 0;
    text-align: center;
  }

  .side-drawer .close-button svg,
  .floating-panel .close-button svg,
  .table-panel .close-button svg,
  .panel .close-button svg,
  .project-info-popover .close-button svg {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0;
    transform: none;
  }

  .panel-title,
  .popup-title {
    font-size: 13px;
  }

  .data-badge {
    padding: 3px 6px;
    font-size: 8px;
  }

  .status-grid {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 10px;
  }

  .donut {
    width: 96px;
  }

  .donut-inner {
    width: 64px;
    height: 64px;
  }

  .donut strong {
    font-size: 21px;
  }

  .donut span {
    font-size: 9px;
  }

  .status-list {
    gap: 7px;
  }

  .status-item {
    min-height: 38px;
    padding: 6px 8px;
  }

  .mini-card {
    padding: 10px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .cctv-image {
    min-height: 70px;
  }

  .bottom-nav {
    left: 8px;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    min-height: 102px;
    max-height: 112px;
    padding: 7px;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .primary-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .nav-button {
    min-height: 45px;
    padding: 3px 2px;
    display: grid;
    grid-template-rows: 19px minmax(14px, auto);
    place-items: center;
    align-content: center;
    gap: 3px;
    font-size: 8px;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }

  .nav-button svg {
    display: block;
    width: 18px;
    height: 18px;
    margin: auto;
  }

  .nav-button.active::after {
    left: 8px;
    right: 8px;
    bottom: -5px;
    height: 2px;
  }

  .secondary-nav {
    padding-left: 0;
    border-left: 0;
    gap: 5px;
    overflow-x: auto;
    justify-content: stretch;
    scrollbar-width: none;
  }

  .secondary-nav::-webkit-scrollbar {
    display: none;
  }

  .secondary-button {
    appearance: none;
    flex: 1 1 0;
    width: auto;
    min-width: 54px;
    min-height: 34px;
    padding: 3px;
    display: grid;
    grid-template-rows: 17px minmax(10px, auto);
    place-items: center;
    align-content: center;
    font-size: 7px;
    line-height: 1;
  }

  .secondary-button svg {
    display: block;
    width: 16px;
    height: 16px;
    margin: auto;
  }

  .platform-footer,
  .screen-setting-footer {
    display: none;
  }

  .floating-panel,
  .floating-panel.equipment,
  .floating-panel.ai,
  .floating-panel.cctv,
  .floating-panel.section,
  .floating-panel.alarm {
    left: 8px;
    right: 8px;
    top: calc(env(safe-area-inset-top, 0px) + 116px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 118px);
    width: auto;
    min-width: 0;
    max-height: calc(100dvh - 246px);
    resize: none;
  }

  .table-panel,
  .side-drawer {
    left: 8px;
    right: 8px;
    top: calc(env(safe-area-inset-top, 0px) + 116px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 118px);
    width: auto;
    min-height: 0;
    max-height: none;
    padding: 12px;
    resize: none;
  }

  .alarm-table {
    min-width: 680px;
  }
}

@media (max-width: 980px) and (max-height: 520px) and (orientation: landscape) {
  html,
  body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .topbar {
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    left: calc(env(safe-area-inset-left, 0px) + 8px);
    right: calc(env(safe-area-inset-right, 0px) + 8px);
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(370px, 1.2fr);
    grid-template-rows: auto;
    gap: 6px;
    align-items: start;
  }

  .title-frame {
    width: 100%;
    max-width: none;
    min-height: 48px;
    grid-template-columns: 30px minmax(0, 1fr) 24px;
    gap: 7px;
    padding: 6px 8px;
    border-radius: var(--radius);
  }

  .title-frame::before,
  .title-frame::after {
    display: none;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand h1 {
    font-size: 11px;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand p {
    margin-top: 2px;
    font-size: 5.8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .project-info-button {
    width: 24px;
    height: 24px;
  }

  .project-info-popover {
    width: min(360px, calc(100vw - 40px));
    max-height: calc(100dvh - 76px);
    overflow: auto;
  }

  .top-indicators {
    display: grid;
    grid-template-columns: minmax(118px, 1.4fr) repeat(5, minmax(36px, 0.42fr)) minmax(72px, 0.74fr);
    grid-auto-rows: 36px;
    gap: 5px;
    align-items: stretch;
  }

  .top-indicators .indicator {
    display: none;
  }

  .top-indicators .indicator:first-child {
    display: block;
    min-width: 0;
    width: auto;
    padding: 5px 8px;
    overflow: hidden;
    border-radius: 9px;
    border: 1px solid rgba(80, 205, 255, 0.18);
    background: linear-gradient(90deg, rgba(8, 22, 42, 0.78), rgba(3, 11, 24, 0.42));
  }

  .indicator small {
    font-size: 7.5px;
  }

  .indicator strong {
    width: 100%;
    overflow: hidden;
    font-size: 9.6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notification,
  .emergency-toggle,
  .view-reset,
  .theme-toggle,
  .sound-toggle {
    -webkit-appearance: none;
    appearance: none;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 0;
    gap: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    line-height: 0;
  }

  .emergency-toggle span,
  .view-reset span,
  .theme-toggle span,
  .sound-toggle span {
    display: none;
  }

  .top-indicators > button svg,
  .language-switch button {
    margin: auto;
  }

  .top-indicators > button svg {
    display: block;
    width: 18px;
    height: 18px;
  }

  .notification .badge {
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    font-size: 9px;
  }

  .language-switch {
    justify-self: stretch;
    width: 100%;
    height: 36px;
  }

  .language-switch button {
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 10px;
    line-height: 1;
  }

  .view-control-deck {
    top: calc(env(safe-area-inset-top, 0px) + 58px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(640px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 116px));
    min-width: 0;
    min-height: 0;
    max-height: 46px;
    margin: 0;
    padding: 4px;
  }

  .view-control-deck.minimized {
    width: auto;
    min-width: 116px;
    padding: 0;
  }

  .view-control-deck.minimized .view-control-toggle {
    min-height: 34px;
    padding: 0 10px;
  }

  .view-control-deck.minimized .view-control-toggle svg {
    display: block;
    width: 15px;
    height: 15px;
    margin: 0;
  }

  .view-control-body {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .view-control-body::-webkit-scrollbar {
    display: none;
  }

  .scene-toggles,
  .scene-toggles.map-expanded {
    display: flex;
    grid-template-columns: none;
    width: max-content;
    min-width: max-content;
    gap: 5px;
  }

  .toggle-group {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 3px 5px;
  }

  .switch-control {
    font-size: 8px;
  }

  .map-opacity-panel {
    flex: 0 0 204px;
    padding: 4px 6px;
    grid-template-columns: 1fr;
  }

  .map-source-field,
  .map-slider-field {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .map-slider-field strong {
    grid-column: 2;
  }

  .icon-rail {
    top: calc(env(safe-area-inset-top, 0px) + 76px);
    left: calc(env(safe-area-inset-left, 0px) + 8px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
    width: 42px;
    height: auto;
    max-height: none;
    padding: 5px;
    gap: 3px;
    border-radius: 15px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .icon-rail::-webkit-scrollbar {
    display: none;
  }

  .rail-button {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    padding: 0;
    display: grid;
    place-items: center;
    line-height: 0;
  }

  .rail-button svg {
    display: block;
    width: 17px;
    height: 17px;
    margin: auto;
  }

  .rail-button[data-tooltip]::after {
    display: none;
  }

  .left-panel,
  .right-panel {
    display: none !important;
  }

  .bottom-nav {
    left: calc(env(safe-area-inset-left, 0px) + 58px);
    right: calc(env(safe-area-inset-right, 0px) + 8px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
    min-height: 50px;
    max-height: 54px;
    padding: 5px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .primary-nav {
    grid-template-columns: repeat(4, minmax(66px, 1fr));
    gap: 5px;
  }

  .nav-button {
    min-height: 40px;
    padding: 2px 3px;
    display: grid;
    grid-template-rows: 17px minmax(11px, auto);
    place-items: center;
    align-content: center;
    gap: 2px;
    font-size: 6.6px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-button svg {
    display: block;
    width: 16px;
    height: 16px;
    margin: auto;
  }

  .nav-button.active::after {
    left: 8px;
    right: 8px;
    bottom: -4px;
    height: 2px;
  }

  .secondary-nav {
    padding-left: 0;
    border-left: 0;
    gap: 5px;
    justify-content: stretch;
  }

  .secondary-button {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    min-width: 44px;
    min-height: 40px;
    padding: 2px;
    display: grid;
    grid-template-rows: 16px minmax(9px, auto);
    place-items: center;
    align-content: center;
    gap: 1px;
    font-size: 6px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .secondary-button svg {
    display: block;
    width: 15px;
    height: 15px;
    margin: auto;
  }

  .platform-footer,
  .screen-setting-footer {
    display: none;
  }

  .panel-header,
  .popup-header {
    margin-bottom: 10px;
    padding-bottom: 9px;
    align-items: center;
  }

  .popup-tools,
  .panel-tools {
    align-items: center;
    gap: 7px;
  }

  .side-drawer .close-button,
  .floating-panel .close-button,
  .table-panel .close-button,
  .panel .close-button,
  .project-info-popover .close-button {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    place-content: center;
    line-height: 0;
    text-align: center;
  }

  .side-drawer .close-button svg,
  .floating-panel .close-button svg,
  .table-panel .close-button svg,
  .panel .close-button svg,
  .project-info-popover .close-button svg {
    display: block;
    width: 16px;
    height: 16px;
    margin: 0;
    transform: none;
  }

  .floating-panel,
  .floating-panel.equipment,
  .floating-panel.ai,
  .floating-panel.cctv,
  .floating-panel.section,
  .floating-panel.alarm {
    left: auto;
    right: calc(env(safe-area-inset-right, 0px) + 8px);
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
    width: min(360px, 43vw);
    min-width: 300px;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 146px);
    padding: 12px;
    resize: none;
    overflow: auto;
  }

  .side-drawer {
    left: calc(env(safe-area-inset-left, 0px) + 58px);
    right: auto;
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
    width: min(392px, 46vw);
    min-width: 300px;
    max-height: none;
    padding: 12px;
    resize: none;
    overflow: auto;
  }

  .table-panel {
    left: calc(env(safe-area-inset-left, 0px) + 58px);
    right: calc(env(safe-area-inset-right, 0px) + 8px);
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
    width: auto;
    min-width: 0;
    max-height: none;
    padding: 12px;
    resize: none;
    overflow: auto;
  }

  .alarm-table {
    min-width: 680px;
  }

  .summary-grid,
  .control-metrics,
  .form-grid,
  .scenario-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .project-info-header,
  .drawer-header,
  .popup-header {
    min-height: 36px;
  }
}

/* Final light-mode contrast layer. Keep this at the end so every module stays readable. */
.app-shell.theme-light {
  --light-ink: #061827;
  --light-muted-ink: #294e63;
  --light-panel-fill: rgba(236, 250, 253, 0.9);
  --light-card-fill: rgba(224, 244, 250, 0.84);
  --light-field-fill: rgba(248, 254, 255, 0.96);
  --light-gauge-fill: #f8feff;
  --light-gauge-label: #31586d;
  --light-border: rgba(0, 128, 156, 0.32);
}

.app-shell.theme-light .panel,
.app-shell.theme-light .floating-panel,
.app-shell.theme-light .table-panel,
.app-shell.theme-light .side-drawer,
.app-shell.theme-light .bottom-nav,
.app-shell.theme-light .icon-rail,
.app-shell.theme-light .title-frame,
.app-shell.theme-light .project-info-popover,
.app-shell.theme-light .view-control-deck,
.app-shell.theme-light .language-switch,
.app-shell.theme-light .screen-setting-footer,
.app-shell.theme-light .screen-fit-control {
  color: var(--light-ink) !important;
  border-color: var(--light-border) !important;
  background:
    linear-gradient(145deg, rgba(241, 253, 255, 0.94), rgba(210, 237, 247, 0.86)),
    var(--light-panel-fill) !important;
}

.app-shell.theme-light .summary-box,
.app-shell.theme-light .status-item,
.app-shell.theme-light .mini-card,
.app-shell.theme-light .metric,
.app-shell.theme-light .detail-grid,
.app-shell.theme-light .ai-card,
.app-shell.theme-light .incident-card,
.app-shell.theme-light .cctv-card,
.app-shell.theme-light .operation-card,
.app-shell.theme-light .report-card,
.app-shell.theme-light .source-row,
.app-shell.theme-light .fact-row,
.app-shell.theme-light .check-item,
.app-shell.theme-light .copilot-response {
  color: var(--light-ink) !important;
  border-color: var(--light-border) !important;
  background: var(--light-card-fill) !important;
}

.app-shell.theme-light .donut {
  color: var(--light-ink) !important;
  background:
    radial-gradient(circle, rgba(248, 254, 255, 0.98) 0 54%, transparent 55%),
    conic-gradient(var(--teal) 0 calc(var(--p) * 1%), var(--amber) 0 94%, var(--red) 0 100%) !important;
}

.app-shell.theme-light .donut-inner,
.app-shell.theme-light .mini-gauge {
  color: var(--light-ink) !important;
  background: var(--light-gauge-fill) !important;
  border: 1px solid rgba(0, 135, 165, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 22px rgba(0, 184, 210, 0.12) !important;
}

.app-shell.theme-light .panel-title,
.app-shell.theme-light .popup-title,
.app-shell.theme-light .project-info-title,
.app-shell.theme-light .card-title,
.app-shell.theme-light .mini-card h3,
.app-shell.theme-light .summary-box strong,
.app-shell.theme-light .status-item strong,
.app-shell.theme-light .metric strong,
.app-shell.theme-light .field-value,
.app-shell.theme-light .donut strong,
.app-shell.theme-light .mini-gauge strong,
.app-shell.theme-light .brand h1,
.app-shell.theme-light .alarm-table td,
.app-shell.theme-light .source-row strong,
.app-shell.theme-light .fact-row strong {
  color: var(--light-ink) !important;
}

.app-shell.theme-light .summary-box small,
.app-shell.theme-light .status-item small,
.app-shell.theme-light .metric small,
.app-shell.theme-light .field-label,
.app-shell.theme-light .mini-label,
.app-shell.theme-light .indicator small,
.app-shell.theme-light .donut span,
.app-shell.theme-light .ai-card p,
.app-shell.theme-light .incident-card p,
.app-shell.theme-light .source-row p,
.app-shell.theme-light .form-grid label,
.app-shell.theme-light .alarm-table th,
.app-shell.theme-light .brand p {
  color: var(--light-muted-ink) !important;
}

.app-shell.theme-light .screen-fit-control span {
  color: var(--light-muted-ink) !important;
}

.app-shell.theme-light .project-info-grid span {
  color: var(--light-muted-ink) !important;
}

.app-shell.theme-light .project-info-grid strong {
  color: var(--light-ink) !important;
}

.app-shell.theme-light .left-panel .donut-inner strong,
.app-shell.theme-light .left-panel .mini-gauge strong {
  color: var(--light-ink) !important;
  text-shadow: none !important;
}

.app-shell.theme-light .left-panel .donut-inner span {
  color: var(--light-gauge-label) !important;
  text-shadow: none !important;
}

.app-shell.theme-light input,
.app-shell.theme-light select,
.app-shell.theme-light textarea,
.app-shell.theme-light .filters input,
.app-shell.theme-light .filters select,
.app-shell.theme-light .form-grid input,
.app-shell.theme-light .form-grid select,
.app-shell.theme-light .map-opacity-panel select {
  color: var(--light-ink) !important;
  background: var(--light-field-fill) !important;
  border-color: var(--light-border) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42) !important;
}

.app-shell.theme-light input::placeholder {
  color: #527084 !important;
  opacity: 1;
}

.app-shell.theme-light option {
  color: var(--light-ink) !important;
  background: #f8feff !important;
}

.app-shell.theme-light button,
.app-shell.theme-light a.button-link,
.app-shell.theme-light .inline-action,
.app-shell.theme-light .tab-button,
.app-shell.theme-light .scenario-list button,
.app-shell.theme-light .question-list button,
.app-shell.theme-light .popup-actions button,
.app-shell.theme-light .source-actions a,
.app-shell.theme-light .filters button {
  color: var(--light-ink) !important;
  border-color: var(--light-border) !important;
  background: linear-gradient(180deg, rgba(248, 254, 255, 0.96), rgba(205, 235, 246, 0.9)) !important;
}

.app-shell.theme-light .status-help-button {
  color: #06465d !important;
  border-color: rgba(0, 128, 156, 0.36) !important;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92), transparent 52%),
    linear-gradient(180deg, rgba(230, 250, 255, 0.98), rgba(178, 227, 240, 0.94)) !important;
  box-shadow: 0 0 13px rgba(0, 151, 185, 0.16) !important;
}

.app-shell.theme-light .status-help-popover {
  color: var(--light-ink) !important;
  border-color: var(--light-border) !important;
  background:
    linear-gradient(145deg, rgba(249, 254, 255, 0.98), rgba(212, 238, 247, 0.98)),
    var(--light-field-fill) !important;
  box-shadow: 0 18px 44px rgba(41, 99, 124, 0.2), 0 0 22px rgba(0, 151, 185, 0.12) !important;
}

.app-shell.theme-light .status-help-popover::before {
  border-color: var(--light-border) !important;
  background: rgba(249, 254, 255, 0.98) !important;
}

.app-shell.theme-light .status-help-popover > strong,
.app-shell.theme-light .status-help-list strong {
  color: var(--light-ink) !important;
}

.app-shell.theme-light .status-help-list,
.app-shell.theme-light .status-help-row,
.app-shell.theme-light .status-help-text {
  color: var(--light-muted-ink) !important;
}

.app-shell.theme-light .nav-button.active,
.app-shell.theme-light .tab-button.active,
.app-shell.theme-light .scenario-list button.active,
.app-shell.theme-light .language-switch button.active {
  color: #031722 !important;
  background: linear-gradient(135deg, #55e7ff, #49f3a5) !important;
}

.app-shell.theme-light .data-badge,
.app-shell.theme-light .pill.warning {
  color: #704900 !important;
  background: rgba(255, 216, 107, 0.46) !important;
  border-color: rgba(166, 118, 15, 0.42) !important;
}

.app-shell.theme-light .pill,
.app-shell.theme-light .pill.low,
.app-shell.theme-light .pill.processing {
  color: #07496a !important;
  background: rgba(72, 164, 210, 0.18) !important;
  border-color: rgba(42, 142, 205, 0.3) !important;
}

.app-shell.theme-light .pill.high,
.app-shell.theme-light .pill.critical {
  color: #991f1f !important;
  background: rgba(255, 104, 94, 0.22) !important;
  border-color: rgba(194, 57, 45, 0.36) !important;
}

.app-shell.theme-light .pill.resolved {
  color: #0f6b38 !important;
  background: rgba(57, 204, 121, 0.22) !important;
  border-color: rgba(31, 143, 79, 0.32) !important;
}

.app-shell.theme-light .check-index {
  color: #075b78 !important;
  background: rgba(0, 146, 190, 0.16) !important;
}

.app-shell.theme-light .ai-chip {
  color: #075b78 !important;
  background: rgba(238, 250, 253, 0.84) !important;
}

.app-shell.theme-light .live-dot {
  color: #9d2430 !important;
}

.app-shell.theme-light .sparkline g {
  stroke: rgba(38, 112, 139, 0.22) !important;
}

.app-shell.theme-light .alarm-table th,
.app-shell.theme-light .alarm-table td {
  border-bottom-color: rgba(0, 128, 156, 0.16) !important;
}
