:root {
  color-scheme: dark;
  --font-brand: "Font 1750840138", Arial, sans-serif;
  --panel: rgba(0, 0, 0, 0.6);
  --panel-solid: #050505;
  --ink: #f4f4f4;
  --muted: #a9afb8;
  --line: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.58);
  --accent: #e40046;
  --accent-strong: #ff376f;
  --amber: #f6b94d;
  --red: #ff5c6c;
  --blue: #67a9ff;
  --green: #67d384;
  --surface: #141414;
  --soft: rgba(255, 255, 255, 0.07);
  --radius: 8px;
  --control-h: 38px;
  font-family: var(--font-brand);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: #0f161d;
}

/* Leaflet's CDN CSS can fail independently from the JS. Keep the layout-critical
   rules local so satellite tiles never fall back to document flow. */
.leaflet-container {
  position: relative;
  overflow: hidden;
  outline: 0;
  background: #182024;
  font-family: inherit;
}

#map:focus-visible,
#cesiumMap:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-map-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-tooltip {
  position: absolute;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  color: #ffffff;
  background: rgba(15, 28, 34, 0.88);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.leaflet-tooltip-top::before {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.32);
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(15, 28, 34, 0.88);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.entity-tooltip {
  max-width: min(260px, calc(100vw - 32px));
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .app6-multipoint-label and .entity-summary-* base styles now ship with
   packages/xrf-tactical-render/styles/tactical-render.css */

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-entity-pane {
  z-index: 560;
}

.leaflet-draw-pane {
  z-index: 580;
}

.motion-vector-head {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.38));
}

.motion-vector-head::before {
  position: absolute;
  inset: 2px 6px;
  background: var(--vector-color, var(--accent));
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
  content: "";
}

.motion-vector-head::after {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 3px;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  content: "";
  transform: translateX(-50%);
}

.leaflet-entity-pane canvas,
.leaflet-draw-pane canvas,
.leaflet-entity-pane svg,
.leaflet-draw-pane svg {
  mix-blend-mode: normal;
  filter: none;
}

html[data-render-effects="legacy"] .leaflet-entity-pane canvas,
html[data-render-effects="legacy"] .leaflet-draw-pane canvas,
html[data-render-effects="legacy"] .leaflet-entity-pane svg,
html[data-render-effects="legacy"] .leaflet-draw-pane svg {
  mix-blend-mode: screen;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  border: 0;
  filter: inherit;
}

.leaflet-tile-container {
  pointer-events: none;
}

.leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-control-container .leaflet-top {
  top: 0;
}

.leaflet-control-container .leaflet-right {
  right: 0;
}

.leaflet-control-container .leaflet-bottom {
  bottom: 0;
}

.leaflet-control-container .leaflet-left {
  left: 0;
}

.leaflet-control {
  position: relative;
  z-index: 1000;
  clear: both;
  pointer-events: auto;
}

.leaflet-left .leaflet-control {
  float: left;
  margin-left: 10px;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-right .leaflet-control {
  float: right;
  margin-right: 10px;
}

.leaflet-bar {
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.leaflet-bar a {
  display: block;
  width: 28px;
  height: 28px;
  border-bottom: 1px solid #c7d0d8;
  color: #23303a;
  background: #ffffff;
  text-align: center;
  text-decoration: none;
  line-height: 28px;
}

.leaflet-bar a:first-child {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.leaflet-bar a:last-child {
  border-bottom: 0;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
}

.leaflet-control-attribution {
  padding: 0 5px;
  color: #334350;
  background: rgba(255, 255, 255, 0.74);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.viewer-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #eaf2f7;
  background:
    radial-gradient(circle at 18% 18%, rgba(42, 133, 124, 0.38), transparent 44%),
    radial-gradient(circle at 82% 78%, rgba(33, 89, 139, 0.26), transparent 46%),
    #0d151b;
}

.auth-gate[hidden] {
  display: none;
}

.auth-gate-card {
  width: min(100%, 480px);
  padding: 34px;
  border: 1px solid rgba(198, 224, 229, 0.25);
  border-radius: 16px;
  background: rgba(18, 32, 40, 0.88);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.auth-gate-eyebrow {
  display: block;
  margin-bottom: 10px;
  color: #82d6ca;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-gate-card h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.auth-gate-card > p {
  margin: 14px 0 0;
  color: #c2d0d8;
  font-size: 15px;
  line-height: 1.55;
}

.auth-gate-card .auth-gate-status {
  min-height: 24px;
  padding: 10px 12px;
  border: 1px solid rgba(197, 221, 225, 0.16);
  border-radius: 8px;
  color: #e9f1f4;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 650;
}

.auth-gate-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.auth-gate-actor-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(234, 242, 247, 0.72);
  text-align: left;
}

/* Bug real reportado en vivo 2026-08-26: [hidden] y .auth-gate-actor-label
   tienen la MISMA especificidad (0,1,0) - la regla de arriba, por venir
   despues en la cascada, ganaba siempre a [hidden], asi que el selector de
   actor de desarrollo se veia SIEMPRE (vacio, sin JS que lo rellenase) en
   vez de solo cuando de verdad hay actores que listar. */
.auth-gate-actor-label[hidden] {
  display: none;
}

.auth-gate-actor-select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(210, 229, 233, 0.32);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #eaf2f7;
  font: inherit;
}

.auth-gate-button,
.auth-gate-retry {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-weight: 800;
}

.auth-gate-button {
  color: #ffffff;
  background: #16857c;
  box-shadow: 0 10px 28px rgba(22, 133, 124, 0.25);
}

.auth-gate-button:hover {
  background: #1a9a8e;
}

.auth-gate-retry {
  color: #eaf2f7;
  border-color: rgba(210, 229, 233, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.auth-gate-help {
  font-size: 12px !important;
}

.app-session-control {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 6px 7px 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #1b2d36;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 0 12px 34px rgba(5, 12, 20, 0.2);
  backdrop-filter: blur(16px);
}

.app-session-control[hidden] {
  display: none;
}

.app-session-control span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-session-logout {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(180, 51, 60, 0.25);
  border-radius: 999px;
  color: #9f2831;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.app-session-logout:hover {
  color: #ffffff;
  background: var(--red);
}

.map-stage,
.map,
.cesium-map,
.map-fallback {
  position: absolute;
  inset: 0;
}

.map {
  z-index: 0;
  background: #182024;
}

.cesium-map {
  z-index: 0;
  display: none;
  overflow: hidden;
  background: #10171c;
}

.cesium-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  pointer-events: none;
}

.map-stage[data-topography="cesium3d"] .map {
  visibility: hidden;
}

.map-stage[data-topography="cesium3d"] .cesium-map {
  display: block;
}

.map-stage[data-topography="cesium3d"] .cesium-overlay-layer {
  display: block;
}

.cesium-map .cesium-widget,
.cesium-map .cesium-widget canvas {
  width: 100%;
  height: 100%;
}

.cesium-map .cesium-credit-logoContainer,
.cesium-map .cesium-credit-textContainer {
  transform: scale(0.82);
  transform-origin: bottom right;
}

.map-context-radial {
  position: absolute;
  z-index: 2250;
  width: 252px;
  height: 252px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-context-radial[hidden] {
  display: none !important;
}

.map-context-radial-ring {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-context-action,
.map-context-center {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.map-context-action {
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
}

.map-context-action-label {
  position: absolute;
  display: grid;
  gap: 3px;
  place-items: center;
  pointer-events: none;
}

.map-context-action-label strong,
.map-context-action-label small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-context-action-label small {
  color: currentColor;
  font-size: 9px;
  font-weight: 650;
  opacity: 0.76;
}

.map-context-action-label svg {
  width: 21px;
  height: 21px;
}

.map-context-action.is-measure { clip-path: polygon(50% 50%, 0 0, 100% 0); }
.map-context-action.is-create { clip-path: polygon(50% 50%, 100% 0, 100% 100%); }
.map-context-action.is-duplicate { clip-path: polygon(50% 50%, 100% 100%, 0 100%); }
.map-context-action.is-find { clip-path: polygon(50% 50%, 0 100%, 0 0); }

.map-context-action.is-measure .map-context-action-label { top: 14px; left: 86px; width: 80px; }
.map-context-action.is-create .map-context-action-label { top: 92px; right: 8px; width: 102px; }
.map-context-action.is-duplicate .map-context-action-label { bottom: 10px; left: 46px; width: 160px; }
.map-context-action.is-find .map-context-action-label { top: 92px; left: 8px; width: 102px; }

.map-context-radial-ring.has-viewshed .is-measure { clip-path: polygon(50% 50%, 13.67% 0, 86.33% 0); }
.map-context-radial-ring.has-viewshed .is-viewshed { clip-path: polygon(50% 50%, 86.33% 0, 100% 0, 100% 66.25%); }
.map-context-radial-ring.has-viewshed .is-create { clip-path: polygon(50% 50%, 100% 66.25%, 100% 100%, 50% 100%); }
.map-context-radial-ring.has-viewshed .is-duplicate { clip-path: polygon(50% 50%, 50% 100%, 0 100%, 0 66.25%); }
.map-context-radial-ring.has-viewshed .is-find { clip-path: polygon(50% 50%, 0 66.25%, 0 0, 13.67% 0); }
.map-context-radial-ring.has-viewshed .is-viewshed .map-context-action-label { top: 69px; right: 4px; width: 78px; }
.map-context-radial-ring.has-viewshed .is-viewshed strong { white-space: normal; line-height: 1.15; }
.map-context-radial-ring.has-viewshed .is-create .map-context-action-label { top: 174px; right: 26px; width: 92px; }
.map-context-radial-ring.has-viewshed .is-duplicate .map-context-action-label { bottom: auto; top: 169px; left: 24px; width: 100px; }
.map-context-radial-ring.has-viewshed .is-find .map-context-action-label { top: 76px; left: 4px; width: 85px; }

.map-context-action:hover,
.map-context-action:focus-visible,
.map-context-center:hover,
.map-context-center:focus-visible {
  color: #000;
  background: #fff;
  outline: none;
}

.map-context-action:disabled,
.map-context-action:disabled:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.42);
  background: rgba(0, 0, 0, 0.58);
  box-shadow: none;
  cursor: not-allowed;
}

.map-context-center {
  top: 99px;
  left: 99px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.geometry-vertex-radial {
  position: absolute;
  z-index: 2300;
  width: 188px;
  height: 188px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.geometry-vertex-radial[hidden] {
  display: none !important;
}

.geometry-vertex-radial-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4, 15, 20, 0.94) 0 29%, transparent 30%);
}

.geometry-vertex-radial-action,
.geometry-vertex-radial-close {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  color: #fff;
  background: rgba(3, 15, 20, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.geometry-vertex-radial-action {
  width: 72px;
  height: 72px;
  gap: 1px;
  border-radius: 50%;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.geometry-vertex-radial-action > span {
  font-size: 23px;
  line-height: 1;
}

.geometry-vertex-radial-action > strong {
  font-size: 10px;
}

.geometry-vertex-radial-action.is-branch {
  top: 2px;
  left: 2px;
}

.geometry-vertex-radial-action.is-reverse {
  right: 2px;
  bottom: 2px;
}

.geometry-vertex-radial-close {
  top: 67px;
  left: 67px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.geometry-vertex-radial-action:hover,
.geometry-vertex-radial-action:focus-visible,
.geometry-vertex-radial-close:hover,
.geometry-vertex-radial-close:focus-visible {
  color: #041014;
  background: #00e2d1;
  border-color: #00e2d1;
  outline: none;
}

.geometry-vertex-radial-action:disabled {
  color: rgba(255, 255, 255, 0.36);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(3, 15, 20, 0.62);
  box-shadow: none;
  cursor: not-allowed;
}

.map-context-search {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 7px;
  width: min(340px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.88);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.map-context-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 6px;
}

.map-context-search.has-approach {
  width: min(388px, calc(100vw - 24px));
}

.map-context-search.has-approach > div {
  grid-template-columns: minmax(0, 1fr) repeat(3, 42px);
}

.map-context-search input,
.map-context-search button {
  min-height: 42px;
  border: 1px solid #414141;
  border-radius: 10px;
  color: #fff;
  background: #111;
  font: inherit;
}

.map-context-search input { min-width: 0; padding: 0 11px; }
.map-context-search button { display: grid; place-items: center; }
.map-context-search button[data-map-context-search-action="approach"] {
  border-color: #00d9ce;
  color: #001d1b;
  background: #00d9ce;
}
.map-context-search p { margin: 0; color: #b8c0c7; font-size: 11px; }

.map-measure-label,
.coverage-2d-label {
  width: max-content !important;
  height: auto !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.map-measure-label span,
.coverage-2d-label span {
  display: block;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transform: translate(8px, -50%);
}

.map-measure-results {
  position: absolute;
  z-index: 2250;
  bottom: 58px;
  left: 50%;
  width: min(600px, calc(100% - 40px));
  padding: 12px 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  color: #f8fafc;
  background: rgba(7, 12, 18, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  pointer-events: none;
}

.map-measure-results[hidden] {
  display: none !important;
}

.map-view-status {
  position: absolute;
  z-index: 2240;
  bottom: 14px;
  left: 50%;
  display: flex;
  align-items: center;
  max-width: min(920px, calc(100% - 40px));
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  color: #f8fafc;
  background: rgba(5, 9, 14, 0.84);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
  pointer-events: none;
  font: 700 11px/1.25 "Segoe UI", system-ui, sans-serif;
}

.map-view-status[hidden],
.map-view-status-value[hidden] {
  display: none !important;
}

.map-coordinate-format-toggle {
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(101, 232, 157, 0.48);
  border-radius: 6px;
  color: #8cf0b4;
  background: rgba(61, 220, 132, 0.1);
  cursor: pointer;
  pointer-events: auto;
  font: 850 10px/1 "Segoe UI", system-ui, sans-serif;
}

.map-coordinate-format-toggle:hover,
.map-coordinate-format-toggle:focus-visible {
  border-color: #8cf0b4;
  color: #fff;
  background: rgba(61, 220, 132, 0.24);
  outline: none;
}

.map-view-status-value {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-view-status-zoom {
  flex: 0 0 auto;
}

@media (max-width: 1060px) and (min-width: 761px) {
  .map-view-status {
    bottom: 70px;
  }

  .map-measure-results {
    bottom: 112px;
  }
}

@media (max-width: 760px) {
  .map-view-status {
    right: 10px;
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px));
    left: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    max-width: none;
    transform: none;
  }

  #mapViewTarget {
    grid-column: 1 / -1;
    padding-top: 4px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 0;
  }

  .map-measure-results {
    bottom: max(126px, calc(env(safe-area-inset-bottom) + 126px));
  }
}

.map-measure-results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
  font: 800 12px/1.3 "Segoe UI", system-ui, sans-serif;
}

.map-measure-results-header strong {
  font-size: 13px;
}

.map-measure-results-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.map-measure-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  pointer-events: auto;
}

.map-measure-view-button:hover:not(:disabled),
.map-measure-view-button:focus-visible {
  border-color: rgba(101, 232, 157, 0.78);
  background: rgba(61, 220, 132, 0.2);
  outline: none;
}

.map-measure-view-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.map-measure-view-button svg {
  width: 16px;
  height: 16px;
}

.map-measure-results-header span {
  color: #cbd5e1;
  text-align: right;
}

.map-measure-results-header .is-visible { color: #65e89d; }
.map-measure-results-header .is-blocked { color: #ff8585; }
.map-measure-results-header .is-unavailable { color: #f6c96b; }

.map-measure-results > p {
  margin: 10px 0 4px;
  color: #cbd5e1;
  font: 600 12px/1.4 "Segoe UI", system-ui, sans-serif;
}

.map-measure-results > .map-measure-view-error {
  margin-top: 0;
  color: #ffb0b0;
}

.map-measure-profile {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.map-measure-profile-grid {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.map-measure-profile-surface {
  fill: rgba(203, 213, 225, 0.34);
  stroke: #e2e8f0;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.map-measure-profile-sight {
  fill: none;
  stroke: #f8fafc;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.map-measure-profile-sight.is-visible { stroke: #3ddc84; }
.map-measure-profile-sight.is-blocked { stroke: #ff5c5c; }
.map-measure-profile-sight.is-unavailable { stroke: #f6c96b; }

.map-measure-profile-block {
  stroke: #ff5c5c;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.map-measure-profile-block-point {
  fill: #ff5c5c;
  stroke: #fff;
  stroke-width: 1.5;
}

.map-measure-profile-axis {
  fill: #aeb9c5;
  font: 700 10px/1 "Segoe UI", system-ui, sans-serif;
}

.map-measure-profile-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #cbd5e1;
  font: 700 10px/1.2 "Segoe UI", system-ui, sans-serif;
}

.map-measure-profile-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-measure-profile-legend i {
  display: inline-block;
  width: 16px;
  border-top: 2px solid #e2e8f0;
}

.map-measure-profile-legend .is-sight { border-color: #3ddc84; }

.map-measure-profile-loading {
  height: 150px;
  border-radius: 7px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.13) 45%, rgba(255, 255, 255, 0.04) 60%);
  background-size: 200% 100%;
  animation: map-measure-profile-loading 1.2s linear infinite;
}

@keyframes map-measure-profile-loading {
  to { background-position-x: -200%; }
}

.map-measure-close-button {
  position: absolute;
  z-index: 2251;
  top: 78px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  color: #fff;
  background: rgba(8, 8, 8, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  font: 800 12px/1 "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
  cursor: pointer;
}

.map-measure-close-button:hover,
.map-measure-close-button:focus-visible {
  border-color: #fff;
  background: #000;
}

.map-measure-close-button svg {
  width: 16px;
  height: 16px;
}

.map-measure-close-button[hidden] {
  display: none !important;
}

.topography-control {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 38px;
  gap: 4px;
  width: min(402px, max(334px, calc(100vw - 778px)));
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.88);
  box-shadow: 0 12px 34px rgba(5, 12, 20, 0.2);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}


.cesium-summary-overlay {
  position: absolute;
  display: grid;
  gap: 5px;
  width: 230px;
  max-width: min(230px, calc(100vw - 36px));
  padding: 8px;
  border: 2px solid rgba(9, 18, 26, 0.82);
  border-radius: 8px;
  color: #101820;
  background: rgba(250, 252, 255, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.15;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 22px));
}

.cesium-summary-overlay.selected {
  border-color: rgba(22, 117, 111, 0.95);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.78),
    0 18px 40px rgba(0, 0, 0, 0.36);
}

.cesium-summary-overlay::after {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(9, 18, 26, 0.82);
  border-bottom: 2px solid rgba(9, 18, 26, 0.82);
  background: rgba(250, 252, 255, 0.96);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.cesium-summary-overlay strong,
.cesium-summary-overlay em,
.cesium-summary-overlay span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cesium-summary-overlay strong {
  font-size: 12px;
  font-weight: 950;
}

.cesium-summary-overlay em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.cesium-summary-overlay .entity-summary-lines {
  display: grid;
  gap: 4px;
}

.cesium-summary-overlay .entity-summary-row {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) auto;
  border-color: rgba(9, 18, 26, 0.12);
  background: rgba(240, 244, 248, 0.86);
}

.topography-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.topography-control button svg {
  width: 16px;
  height: 16px;
}

.topography-control button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topography-control button.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.topography-control .topography-compass {
  padding: 0;
  border-left: 1px solid rgba(44, 62, 80, 0.16);
  border-radius: 0 6px 6px 0;
}

.topography-control .topography-compass:not(:disabled):hover,
.topography-control .topography-compass:not(:disabled):focus-visible {
  color: var(--accent-strong);
  background: rgba(22, 117, 111, 0.1);
}

.topography-control .topography-compass:disabled {
  cursor: default;
  opacity: 0.34;
}

/* 3D bloqueado tras perder el contexto WebGL: se rehabilita solo al recargar la pagina. */
.topography-control button[data-topography-mode]:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.map-geocoder {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  align-items: center;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.map-geocoder:focus-within {
  border-color: rgba(20, 184, 166, 0.78);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.map-geocoder-icon {
  width: 15px;
  height: 15px;
  margin-left: 8px;
  color: var(--muted);
  pointer-events: none;
}

.map-geocoder.loading .map-geocoder-icon {
  animation: map-geocoder-pulse 0.9s ease-in-out infinite alternate;
}

.map-geocoder input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.map-geocoder input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.map-geocoder input::-webkit-search-cancel-button {
  display: none;
}

.topography-control .map-geocoder-clear {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  border-radius: 5px;
}

.topography-control .map-geocoder-clear:hover,
.topography-control .map-geocoder-clear:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.topography-control .map-geocoder-clear[hidden],
.map-geocoder-results[hidden] {
  display: none;
}

.map-geocoder-results {
  position: absolute;
  z-index: 8;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 110px));
  padding: 5px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(8, 11, 14, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px);
}

.topography-control .map-geocoder-result {
  display: grid;
  justify-items: start;
  gap: 3px;
  height: auto;
  min-height: 48px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.topography-control .map-geocoder-result:hover,
.topography-control .map-geocoder-result:focus-visible,
.topography-control .map-geocoder-result.active {
  color: #fff;
  background: rgba(20, 184, 166, 0.2);
}

.map-geocoder-result strong,
.map-geocoder-result span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-geocoder-result strong {
  font-size: 12px;
}

.map-geocoder-result span,
.map-geocoder-message,
.map-geocoder-attribution {
  color: var(--muted);
  font-size: 10px;
}

.map-geocoder-message {
  padding: 10px;
  margin: 0;
}

.map-geocoder-message.error {
  color: #ff9ca5;
}

.map-geocoder-attribution {
  padding: 6px 9px 4px;
  text-decoration: none;
}

.map-geocoder-attribution:hover {
  color: #fff;
  text-decoration: underline;
}

@keyframes map-geocoder-pulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.topography-status {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 68px;
  max-width: min(420px, max(292px, calc(100vw - 820px)));
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: #17202a;
  background: rgba(248, 250, 252, 0.92);
  box-shadow: 0 10px 28px rgba(5, 12, 20, 0.2);
  font-size: 12px;
  font-weight: 750;
  transform: translateX(-50%);
}

.topography-status.warning {
  border-color: rgba(187, 123, 24, 0.38);
  color: #6f470b;
  background: rgba(255, 248, 232, 0.94);
}

.topography-status.error {
  border-color: rgba(180, 51, 60, 0.42);
  color: #7b2027;
  background: rgba(255, 242, 244, 0.94);
}

/* Aviso de 3D bloqueado: dura toda la sesion, asi que se coloca fuera del control topografico
   en cada punto de corte y por debajo de el en el apilado (el desplegable del geocodificador
   lo cubre al abrirse). El operador puede plegarlo con "Ocultar". */
.topography-status.cesium-context-lost {
  z-index: 2;
}

.topography-status.cesium-context-lost:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topography-status-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.topography-status-action {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(123, 32, 39, 0.4);
  border-radius: 6px;
  color: #ffffff;
  background: #9f2a34;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.topography-status-action:hover,
.topography-status-action:focus-visible {
  background: #7b2027;
}

.topography-status-action.secondary {
  color: #7b2027;
  background: transparent;
}

.topography-status-action.secondary:hover,
.topography-status-action.secondary:focus-visible {
  color: #ffffff;
  background: #7b2027;
}

/* Posiciones medidas con elementFromPoint (ADR 0036): el control ocupa dos filas (~83 px)
   por debajo de 1320 px, se ancla abajo entre 761 y 1060 px y arriba (con el control de
   sesion a la derecha) por debajo de 760 px. */
@media (max-width: 1320px) {
  .topography-status.cesium-context-lost {
    top: 110px;
  }
}

@media (max-width: 1060px) {
  .topography-status.cesium-context-lost {
    top: auto;
    bottom: 110px;
  }
}

@media (max-width: 760px) {
  .topography-status.cesium-context-lost {
    top: calc(max(10px, env(safe-area-inset-top)) + 98px);
    bottom: auto;
  }
}

/* En movil el control de sesion baja a la franja siguiente: el aviso queda por debajo de el. */
@media (max-width: 700px) {
  .topography-status.cesium-context-lost {
    top: calc(max(10px, env(safe-area-inset-top)) + 106px);
  }
}

.map-fallback {
  z-index: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #dbe4ea;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(16, 47, 42, 0.92), rgba(28, 34, 43, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(255, 255, 255, 0.05) 29px),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 255, 255, 0.05) 29px);
}

.map-fallback.visible {
  display: grid;
}

.left-rail,
.right-rail {
  position: absolute;
  z-index: 4;
  top: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100vw - 36px));
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}


.rail-toggle {
  position: absolute;
  top: 10px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(8, 18, 28, 0.16);
}

.left-rail-toggle {
  right: 10px;
}

.right-rail-toggle {
  left: 10px;
}

.rail-toggle svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.rail-icon-expand {
  display: none;
}

.rail-toggle + * {
  margin-top: 20px;
}

body.rail-left-collapsed .left-rail {
  overflow: visible;
  pointer-events: none;
  transform: translateX(calc(-100% - 18px));
}

body.rail-right-collapsed .right-rail {
  overflow: visible;
  pointer-events: none;
  transform: translateX(calc(100% + 18px));
}

body.rail-left-collapsed .left-rail > :not(.rail-toggle),
body.rail-right-collapsed .right-rail > :not(.rail-toggle) {
  opacity: 0;
  pointer-events: none;
}

body.rail-left-collapsed .left-rail-toggle,
body.rail-right-collapsed .right-rail-toggle {
  pointer-events: auto;
  box-shadow: 0 14px 32px rgba(8, 18, 28, 0.24);
}

body.rail-left-collapsed .left-rail-toggle {
  right: -54px;
}

body.rail-right-collapsed .right-rail-toggle {
  left: -54px;
}

body.rail-left-collapsed .left-rail-toggle .rail-icon-collapse,
body.rail-right-collapsed .right-rail-toggle .rail-icon-collapse {
  display: none;
}

body.rail-left-collapsed .left-rail-toggle .rail-icon-expand,
body.rail-right-collapsed .right-rail-toggle .rail-icon-expand {
  display: block;
}

.left-rail {
  left: 18px;
  width: min(408px, calc(100vw - 36px));
}

.right-rail {
  right: 18px;
}

body[data-mode="management"] .right-rail,
body[data-mode="communications"] .right-rail {
  display: none;
}

.management-screen {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  bottom: 18px;
  left: min(444px, calc(100vw - 390px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.management-screen[hidden] {
  display: none !important;
}

.management-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  padding: 14px;
  overflow: hidden;
}

.management-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.management-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.management-header p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.management-header-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, auto));
  gap: 8px;
}

.management-stat,
.management-info {
  display: grid;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.management-stat strong,
.management-info strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-stat span,
.management-info span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.management-tab-group {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.management-tab-group-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.management-tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.management-tab-group-iam .management-tab-list {
  grid-template-columns: minmax(0, 1fr);
}


.management-tab {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.management-tab svg {
  width: 16px;
  height: 16px;
}

.management-tab span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.management-tab[data-management-tab="data-sources"] span {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.25;
}

.management-tab.active {
  color: #ffffff;
  border-color: transparent;
  background: var(--accent);
}

.management-panel {
  min-height: 0;
  overflow: auto;
}

.management-panel[hidden] {
  display: none !important;
}

.management-grid {
  display: grid;
  gap: 12px;
}

.management-grid.two-cols {
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
}

.management-module {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.map-source-module {
  grid-column: 1 / -1;
}

.deployment-basemap-module {
  grid-column: 1 / -1;
}

.deployment-basemap-active,
.deployment-basemap-progress-grid > section {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.deployment-basemap-active {
  margin-bottom: 12px;
}

.deployment-basemap-active > span,
.deployment-basemap-progress-grid small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.deployment-basemap-warning {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 205, 99, 0.42);
  border-radius: 9px;
  color: #f5d78e;
  background: rgba(157, 111, 13, 0.16);
  line-height: 1.45;
}

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

.deployment-basemap-progress-grid progress {
  width: 100%;
  accent-color: var(--accent);
}

.deployment-basemap-error {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 110, 110, 0.38);
  border-radius: 9px;
  color: #ffb0b0;
  background: rgba(172, 44, 44, 0.18);
}

.deployment-basemap-error[hidden] {
  display: none;
}

.interop-admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr);
  align-items: start;
  gap: 18px;
  margin-top: 12px;
}

#managementDataSourcesPanel .management-module { background: #11171e; }
#managementDataSourcesPanel [hidden] { display: none !important; }
#managementDataSourcesPanel :is(p, small, .tiny-note, .field > span) { font-size: 14px; line-height: 1.5; color: #cbd4df; }
#managementDataSourcesPanel :is(h3, h4) { margin: 0; color: #f4f7fb; font-size: 17px; }
#managementDataSourcesPanel .action-button { min-height: 42px; padding: 10px 14px; font-size: 14px; }
#managementDataSourcesPanel .field > span { text-transform: none; }
#managementDataSourcesPanel .toggle-line span { font-size: 14px; line-height: 1.5; color: #e0e7ef; }
.interop-admin-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.interop-admin-guide p { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #19232e; }
.interop-admin-guide strong { display: block; color: #fff; margin-bottom: 5px; }

.interop-admin-form,
.interop-connections,
.interop-schema-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #151d27;
}

.interop-admin-form,
.interop-schema-form,
.interop-connections,
.interop-emitter-form,
.interop-schema-group {
  display: grid;
  gap: 10px;
  align-content: start;
}

.interop-schema-form {
  margin-top: 2px;
}

.interop-schema-group {
  margin: 0;
}

.interop-schema-group > legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.interop-schema-field small {
  color: var(--muted);
  line-height: 1.35;
}

.interop-schema-field.is-advanced,
.interop-schema-group.is-advanced {
  border-left-color: rgba(42, 116, 219, 0.6);
}

.interop-field-warning {
  color: #ffda91 !important;
}

.interop-enabled-field {
  align-self: end;
  min-height: var(--control-h);
}

.interop-feedback {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #d6e2ef;
  background: #1c2836;
  font-size: 14px;
  line-height: 1.5;
}
.interop-feedback[hidden] { display: none; }

.interop-feedback[data-kind="success"] {
  border-color: rgba(22, 117, 111, 0.45);
  color: #91efb6;
}

.interop-feedback[data-kind="error"] {
  border-color: rgba(194, 54, 54, 0.42);
  color: #ffadb6;
}

.interop-feedback[data-kind="warning"] {
  border-color: rgba(173, 115, 15, 0.42);
  color: #ffda91;
}

.interop-connection-item {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101720;
}
.interop-origin-summary { display: grid; gap: 5px; position: relative; padding-right: 24px; cursor: pointer; }
.interop-origin-summary::-webkit-details-marker { display: none; }
.interop-origin-summary::after { content: "+"; position: absolute; right: 0; top: 0; color: #e0e7ef; font-size: 24px; }
.interop-connection-item[open] > .interop-origin-summary::after { content: "−"; }
.interop-origin-summary > strong { font-size: 18px; color: #fff; overflow-wrap: anywhere; }
.interop-origin-content { display: grid; gap: 10px; align-content: start; padding-top: 16px; }
.interop-origin-summary:focus-visible { outline: 2px solid #91b9ef; outline-offset: 5px; border-radius: 4px; }
.interop-connection-item .interop-origin-overview { color: #e0e7ef; }
.interop-connections > .management-list { align-content: start; }

.interop-connection-item span {
  color: #cbd4df;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.interop-runtime-state.is-ok {
  color: #91efb6;
}

.interop-runtime-state.is-degraded {
  color: #ffda91;
}

.interop-runtime-state.is-failed {
  color: #ffadb6;
}

.interop-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.interop-remove-origin { display: grid; justify-items: start; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.interop-remove-origin p { margin: 0; }
.interop-remove-origin .danger { color: #ffadb6; border-color: #d27e8a; }
.interop-emitter-filter, .interop-emitter-outbound, .interop-filter-fields { display: grid; gap: 14px; }
.interop-emitter-outbound { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #172431; }
.interop-emitter-outbound[hidden] { display: none; }
.interop-filter-fields fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.interop-filter-fields legend { color: #e0e7ef; font-size: 14px; line-height: 1.5; padding: 0 5px; }
.interop-filter-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.filter-expression-choice { display: flex; align-items: center; gap: 10px; padding: 8px; cursor: pointer; color: #e0e7ef; font-size: 14px; }
.filter-expression-choice input { width: 18px; height: 18px; flex-shrink: 0; accent-color: #70c897; }
.interop-filter-summary { margin: 0; padding: 10px; border-radius: 6px; background: #1b2838; overflow-wrap: anywhere; }
.interop-filter-group > summary { padding: 10px; color: #e0e7ef; font-size: 14px; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; }
.interop-filter-group[open] > fieldset { margin-top: 10px; }
.interop-lifecycle-step { display: grid; align-content: start; gap: 10px; padding: 14px; border-radius: 8px; background: #1b2838; }
.interop-lifecycle-step p, .interop-emitter-note { margin: 0; }
.interop-lifecycle-step [role="switch"], .interop-emitter-item [role="switch"] { justify-self: start; }
#managementDataSourcesPanel [role="switch"][aria-checked="true"] { background: #213b32; border-color: #70c897; color: #e0ffec; }
#managementDataSourcesPanel [role="switch"][aria-checked="false"] { background: #303947; border-color: #bac8db; color: #f5f8ff; }
.interop-connection-item .interop-desired-state { color: #f3f7fd; font-weight: 700; }
.interop-emitter-heading { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; }
.interop-config-detail { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #151f2c; }
.interop-config-fields { display: grid; gap: 12px; margin: 14px 0 0; }
.interop-config-fields > div { display: grid; gap: 4px; }
.interop-config-fields dt { font-size: 14px; line-height: 1.5; color: #cbd4df; }
.interop-config-fields dd { margin: 0; font-size: 15px; line-height: 1.5; color: #f5f8ff; overflow-wrap: anywhere; }
.interop-emitter-activity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.interop-emitter-activity > div { padding: 10px; border: 1px solid #405269; border-radius: 6px; background: #14202e; }
.interop-emitter-activity dt { font-size: 15px; line-height: 1.5; color: #dce4ef; }
.interop-emitter-activity dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; color: #f5f8ff; }
.interop-emitter-statistics { display: grid; gap: 12px; }
.interop-activity-note { margin: 0; color: #dce4ef; font-size: 15px; line-height: 1.5; }
.interop-emitter-activity-detail > summary { padding: 10px 0; color: #f5f8ff; font-size: 15px; font-weight: 600; cursor: pointer; }
.interop-emitter-breakdown { display: grid; gap: 0; margin: 0 0 12px; }
.interop-emitter-breakdown > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 8px 0; border-top: 1px solid #405269; }
.interop-emitter-breakdown dt { color: #dce4ef; font-size: 15px; line-height: 1.5; }
.interop-emitter-breakdown dd { margin: 0; color: #f5f8ff; font-size: 16px; font-weight: 700; }
.interop-emitter-activity-detail .interop-activity-note + .interop-activity-note { margin-top: 12px; }
.interop-confirm-dialog { width: min(540px, calc(100vw - 48px)); padding: 24px; border: 1px solid #91a5be; border-radius: 12px; background: #151d27; color: #f4f7fb; }
.interop-confirm-dialog::backdrop { background: rgb(0 0 0 / 65%); }
.interop-confirm-dialog h3 { font-size: 20px; margin: 0 0 16px; }
.interop-confirm-dialog p { font-size: 16px; line-height: 1.6; color: #e0e7ef; }
.interop-confirm-dialog .action-button { font-size: 14px; min-height: 42px; }
.interop-confirm-dialog .danger { color: #ffc3ca; border-color: #e48e9b; }

.interop-emitter-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.interop-emitter-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: #1b2838;
}

.interop-emitter-item small {
  color: var(--muted);
}

.interop-emitter-item .action-button {
  grid-column: 1;
}

.interop-emitter-form {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.interop-emitter-form[hidden] {
  display: none;
}

.interop-emitter-form h3 {
  margin: 0;
}

@media (max-width: 720px) {
  .deployment-basemap-progress-grid,
  .interop-admin-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1200px) {
  .interop-admin-layout, .interop-admin-guide { grid-template-columns: 1fr; }
  .interop-connections { grid-row: 1; }
}

.map-source-fields {
  display: grid;
  gap: 0.7rem;
}

.map-source-row {
  grid-template-columns: minmax(9rem, 0.75fr) minmax(18rem, 2fr) minmax(7rem, 0.55fr);
}

.map-source-url-field {
  min-width: 0;
}

.map-source-url-field input {
  width: 100%;
}

.management-panel > .management-module + .management-module,
.management-grid + .management-module {
  margin-top: 12px;
}

.iam-overview-module p:first-of-type {
  margin-top: 0;
}

.management-summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}


.iam-catalog-grid {
  margin-top: 12px;
}

.iam-row {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.iam-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42, 116, 219, 0.14);
}

.iam-permission-list {
  margin-top: 10px;
}

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

.iam-section-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

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

.iam-relationship-grid > section {
  min-width: 0;
}

.iam-relation-list {
  max-height: 220px;
  overflow: auto;
}

.iam-relation-row strong,
.iam-relation-row span {
  overflow-wrap: anywhere;
}

.iam-authority-note {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(197, 138, 21, 0.35);
  border-radius: 8px;
  background: rgba(197, 138, 21, 0.08);
}

.iam-authority-note code {
  font-size: 0.92em;
}
.iam-batch-toolbar,
.iam-onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.iam-onboarding-actions [hidden],
.iam-advanced[hidden],
.iam-pending-actor[hidden] {
  display: none !important;
}

.iam-batch-toolbar > span {
  color: var(--muted);
  font-size: 12px;
}

.iam-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.iam-user-selector {
  display: grid;
  place-items: center;
  min-width: 42px;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.iam-user-selector input {
  width: 17px;
  height: 17px;
}

.iam-user-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.iam-user-open > span:last-child {
  min-width: 0;
}

.iam-user-open strong,
.iam-user-open span,
.iam-onboarding-result strong,
.iam-onboarding-result small {
  display: block;
  overflow-wrap: anywhere;
}

.iam-onboarding-state[data-tone="ok"] { color: var(--success, #54d6b2); }
.iam-onboarding-state[data-tone="warning"] { color: var(--warning, #f0bd58); }
.iam-onboarding-state[data-tone="error"] { color: var(--danger, #ff617e); }

.iam-pending-actor {
  display: block;
  margin: 8px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.iam-onboarding-results {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.iam-access-step,
.iam-entity-link {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
}

.iam-advanced { margin-top: 14px; }
.iam-advanced > summary { cursor: pointer; padding: 10px 0; color: var(--ink); font-weight: 600; }
.iam-advanced code { overflow-wrap: anywhere; }
.iam-onboarding-subjects .field { margin-top: 12px; }

.iam-onboarding-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.iam-onboarding-result small { color: var(--muted); }
.iam-onboarding-result[data-tone="ok"] small { color: var(--success, #54d6b2); }
.iam-onboarding-result[data-tone="warning"] small { color: var(--warning, #f0bd58); }
.iam-onboarding-result[data-tone="error"] small { color: var(--danger, #ff617e); }
.iam-onboarding-result code { overflow-wrap: anywhere; }

.iam-onboarding-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
}

.iam-onboarding-warning {
  padding: 10px 12px;
  border: 1px solid rgba(197, 138, 21, 0.5);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(197, 138, 21, 0.14);
}

.iam-onboarding-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.iam-onboarding-profile > div,
.iam-onboarding-subjects article {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.iam-onboarding-profile dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.iam-onboarding-profile dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.iam-onboarding-subjects {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.iam-onboarding-subjects span,
.iam-onboarding-subjects code {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .iam-onboarding-profile {
    grid-template-columns: 1fr;
  }

  .iam-batch-toolbar,
  .iam-onboarding-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.full-width-button {
  width: 100%;
  margin-top: 10px;
}

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

.timeline-module {
  margin-top: 12px;
}

.timeline-manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.timeline-browse-panel {
  min-width: 0;
}

.timeline-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 10px;
}

.timeline-search-row .field {
  margin-bottom: 0;
}

.timeline-list {
  max-height: 260px;
  overflow: auto;
}

.timeline-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
}

.timeline-row.active {
  border-color: rgba(22, 117, 111, 0.58);
  background: rgba(22, 117, 111, 0.12);
}

.timeline-row svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.timeline-row strong,
.timeline-row span span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-row strong {
  font-size: 13px;
}

.timeline-row span span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.timeline-create-panel {
  min-width: 0;
}

.sala-module {
  margin-top: 12px;
}

.room-manager-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.management-room-status {
  min-height: 30px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 750;
}

.room-manager-list {
  max-height: 300px;
  overflow: auto;
}

.management-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.management-room-row.active {
  border-color: rgba(22, 117, 111, 0.58);
  background: rgba(22, 117, 111, 0.12);
}

.management-room-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.management-room-main svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.management-room-main strong,
.management-room-main span span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-room-main strong {
  font-size: 13px;
}

.management-room-main span span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.management-room-actions {
  display: grid;
  grid-template-columns: repeat(5, var(--control-h));
  gap: 6px;
}

.icon-button.danger {
  color: #9d2f3b;
}

.room-editor-panel {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.compact-heading {
  margin-bottom: 8px;
}

.room-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
}

.room-type-field {
  grid-row: span 2;
}

.room-type-field select {
  min-height: 128px;
  padding: 7px;
}

.room-editor-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
  padding: 0;
}

.toggle-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: var(--control-h);
  margin-top: 2px;
  color: #334353;
  font-size: 12px;
  font-weight: 750;
}

.toggle-line input,
.selectable-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.file-field input {
  padding-top: 7px;
}

.compact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}

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

.management-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* Mismo motivo que `.comms-active-call[hidden]` mas abajo: sin este override
   un `.management-list` con `hidden` puesto por JS (unico caso hoy:
   managementCommsRosterList) se queda pintado por el `display: grid` de
   arriba, que gana al `[hidden]` de UA por ser una regla de autor. */
.management-list[hidden] {
  display: none !important;
}

.management-row,
.job-row,
.audit-row,
.management-plan {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 10, 10, 0.82);
}

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

.management-row.selectable-row {
  grid-template-columns: auto auto minmax(0, 1fr);
}

.management-row strong,
.management-row span span,
.job-row strong,
.job-row span span,
.management-plan strong,
.management-plan span,
.audit-row strong,
.audit-row span,
.audit-row p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.management-row strong,
.job-row strong,
.audit-row strong {
  display: block;
  font-size: 13px;
}

.management-row span span,
.job-row span span,
.audit-row span span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.management-plan {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.management-plan.active {
  border-color: rgba(22, 117, 111, 0.55);
  background: rgba(22, 117, 111, 0.1);
}

.management-plan-head {
  display: grid;
  gap: 3px;
}

.management-plan-head strong {
  font-size: 14px;
}

.management-plan-head span,
.management-plan-summary {
  color: var(--muted);
  font-size: 11px;
}

.management-assignment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.management-assignment {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(92, 109, 126, 0.18);
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.72);
}

.management-assignment.missing {
  border-color: rgba(180, 51, 60, 0.2);
  background: rgba(180, 51, 60, 0.07);
}

.management-assignment strong {
  font-size: 11px;
}

.management-assignment span {
  color: var(--muted);
  font-size: 10px;
}

.audit-row {
  display: grid;
  gap: 6px;
  padding: 9px;
}

.audit-row p {
  margin: 0;
  color: #334353;
  font-size: 12px;
  line-height: 1.35;
}

.audit-row.warning {
  border-color: rgba(187, 123, 24, 0.34);
  background: rgba(187, 123, 24, 0.08);
}

.audit-row.ok {
  border-color: rgba(22, 117, 111, 0.24);
}

.management-probe-output {
  max-height: 420px;
}

.brand-block {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  min-height: 46px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(44, 125, 63, 0.14);
}

.status-dot.syncing {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(187, 123, 24, 0.15);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(180, 51, 60, 0.14);
}

/* communications-screen tiene header + contenido (2 filas), no
   header + tabs-nav + contenido (3 filas) como management-screen - sin este
   override el contenido caia en la fila `auto` del medio en vez de la
   `minmax(0, 1fr)` final, quedando sin altura acotada y por tanto sin scroll. */
.communications-screen .management-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

/* Bug real reportado en vivo 2026-08-26: .management-row/.action-button son
   tarjetas CASI OPACAS BLANCAS (rgba(255,255,255,0.78-0.82)) con texto
   --ink (#f4f4f4, tambien claro) - funcionan en el resto del visor porque
   ahi compiten con el mapa/otros fondos variados, pero aqui se apilan
   sobre el propio fondo oscuro con blur de .management-screen y quedan
   como tarjetas blancas lavadas, casi ilegibles, chocando con el resto
   del tema oscuro de esta pantalla. Oscurecidas solo aqui - no se toca
   el resto del visor (Admin usa el mismo .management-row con el look
   claro de siempre, deliberado).
   */
.communications-screen .management-row,
.communications-screen .action-button {
  color: var(--ink);
  background: rgba(10, 12, 16, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

.communications-screen .action-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

/* .action-button.primary/.danger-button (mas abajo en el archivo, misma
   especificidad de dos clases) ya ganan por orden de cascada sobre la
   regla de arriba - "Llamar"/"Colgar" siguen su color de acento normal,
   nunca hace falta re-declararlo aqui. */

/* Mismo bug que arriba pero un nivel mas afuera en el DOM, encontrado en
   vivo 2026-08-27 tras entrar de verdad a una llamada: .management-module
   (las 4 tarjetas "Sala general"/"Individuos"/"Operaciones"/"Llamada") y
   .comms-active-call (el panel de video activo) SON la misma clase de
   tarjeta blanca lavada (rgba(255,255,255,0.74-0.82)) - nunca se tocaron
   antes porque el primer arreglo solo cubrio filas/botones, no los
   contenedores. Sin esto el panel "Llamada" se queda claro mientras el
   resto de la pantalla ya es oscuro, y "Salir" (.action-button.danger-button,
   texto rosa palido) queda casi ilegible sobre ese fondo claro que nunca
   debio estar ahi.
   */
.communications-screen .management-module,
.communications-screen .comms-active-call {
  background: rgba(10, 12, 16, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

.communications-screen .management-grid {
  min-height: 0;
  overflow: auto;
}

.comms-lists-column {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: auto;
}

.comms-actor-row-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.comms-actor-row-content button,
.comms-actor-row-content input[type="checkbox"] {
  margin-left: auto;
}

/* Casilla de seleccion para "Llamar" (managementCommsCallSelectedButton) -
   antes un boton por-fila que llamaba al instante; ahora un 1:1 es solo el
   caso de marcar 1 sola casilla, ver startManagementCommsAdhocCall. Mismo
   tamaño/acento que el resto de checkboxes de la app (.toggle-line,
   .filter-option-row, .entity-camera-relay-toggle). */
.comms-actor-row-content input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.comms-active-call {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.82);
}

/* Sin este override, la regla `display: grid` de arriba (misma especificidad
   que la regla de usuario-agente `[hidden] { display: none }`, y declarada
   DESPUES) ganaba y dejaba el panel visible con contenido obsoleto (video,
   roster, Colgar deshabilitado) despues de colgar - detectado en vivo tras
   probar Salir en la sala general: el atributo `hidden` se ponia a `true`
   correctamente pero el panel seguia pintado en pantalla. */
.comms-active-call[hidden] {
  display: none !important;
}

/* Aviso de llamada entrante: flotante y global (fuera de #communicationsScreen)
   para que se vea entres donde entres - una llamada no puede depender de que
   ya estuvieras en el modo Comunicaciones. */
.comms-incoming-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: comms-toast-in 0.25s ease-out;
}

.comms-incoming-toast[hidden] {
  display: none !important;
}

.comms-incoming-toast-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  animation: comms-toast-ring 1.4s ease-in-out infinite;
}

.comms-incoming-toast-body {
  min-width: 0;
  flex: 1;
}

.comms-incoming-toast-title {
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 13px;
}

.comms-incoming-toast-body p:last-child {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comms-incoming-toast-actions {
  display: grid;
  gap: 6px;
  flex-shrink: 0;
}

.comms-incoming-toast-actions .action-button {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

@keyframes comms-toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes comms-toast-ring {
  0%, 20%, 100% {
    transform: rotate(0deg);
  }
  5%, 15% {
    transform: rotate(-15deg);
  }
  10% {
    transform: rotate(15deg);
  }
}

.comms-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

/* Grid PROPIO para las camaras de la Operation, separado del de
   participantes de LiveKit (managementCommsVideoGrid) - ver
   openOperationCameraTiles en management-communications.js. */
.comms-camera-section {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Mismo motivo que .comms-active-call[hidden] arriba - una regla de autor
   con display:grid le gana siempre al [hidden] del navegador, sin
   importar especificidad. */
.comms-camera-section[hidden] {
  display: none !important;
}

.comms-camera-section-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comms-video-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #10141a;
}

.comms-video-tile video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.comms-video-tile-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Composicion visual, no participante real de la sala - ver
   openOperationCameraTiles en management-communications.js. Mismo tile que
   un participante LiveKit, solo con un borde de acento para distinguir de
   un vistazo "esto es una camara, no una persona en la llamada". */
.comms-camera-tile {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.brand-block h1,
.panel-heading h2,
.entity-summary h2,
.mode-context h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand-block p,
.entity-summary p,
.tiny-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.mobile-mode-dock {
  display: none;
}

.mode-button,
.action-button,
.icon-button,
.filter-chip,
.room-item {
  min-height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.mode-button {
  display: grid;
  place-items: center;
  grid-template-rows: 18px auto;
  gap: 3px;
  padding: 7px 4px;
  font-size: 11px;
}

.mode-button span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-button svg,
.icon-button svg,
.action-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.1;
}

.mode-button.active {
  color: #ffffff;
  border-color: transparent;
  background: var(--accent);
}

.panel-block,
.entity-card {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.panel-block {
  padding: 12px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-heading h2 {
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
  color: #30404f;
}

.panel-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.entity-locator-open-button,
.entity-multi-select-button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(48, 64, 79, 0.28);
  border-radius: 999px;
  color: #30404f;
  background: rgba(255, 255, 255, 0.58);
}

.entity-locator-open-button:hover,
.entity-locator-open-button:focus-visible,
.entity-multi-select-button:hover,
.entity-multi-select-button:focus-visible,
.entity-multi-select-button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #ffffff;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin-bottom: 10px;
}

.field span {
  color: #47596a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.field input,
.field select {
  height: var(--control-h);
}

.field textarea {
  min-height: calc(var(--control-h) * 2.5);
  padding-top: 9px;
  resize: vertical;
  font: inherit;
  line-height: 1.4;
}

.field #searchInput {
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 10px;
  overflow: hidden;
  resize: none;
  line-height: var(--control-h);
  white-space: nowrap;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(22, 117, 111, 0.65);
  box-shadow: 0 0 0 3px rgba(22, 117, 111, 0.13);
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.dispatch-medevac-fields {
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
}

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

.field input[readonly] {
  color: #435565;
  background: #eef3f5;
}

.create-media-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  margin: 4px 0 10px;
  border: 1px solid rgba(22, 117, 111, 0.2);
  border-radius: var(--radius);
  background: rgba(22, 117, 111, 0.06);
}

.create-media-panel .action-button {
  justify-self: stretch;
}

.media-draft-list {
  display: grid;
  gap: 7px;
}

.media-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
}

.media-draft-item > span:first-child {
  min-width: 0;
  overflow: hidden;
}

.media-draft-item strong,
.media-draft-item span span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-draft-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.media-draft-actions .icon-button {
  flex: 0 0 auto;
}

.geo-layer-opacity-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) 3.5ch;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.geo-layer-opacity-control input {
  width: 100%;
  min-width: 0;
  accent-color: var(--brand);
}

.geo-layer-opacity-control output {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.media-draft-item span span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.collapsible-filter-block {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.collapsible-filter-block summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  color: #30404f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  list-style: none;
  text-transform: uppercase;
}

.collapsible-filter-block summary b {
  min-width: 0;
  padding: 2px 7px;
  border: 1px solid rgba(46, 59, 72, 0.12);
  border-radius: 999px;
  color: #344657;
  background: rgba(30, 30, 30, 0.92);
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
  white-space: nowrap;
}

.collapsible-filter-block summary::-webkit-details-marker {
  display: none;
}

.collapsible-filter-block summary::after {
  content: ">";
  color: var(--muted);
  font-size: 14px;
  transition: transform 140ms ease;
}

.collapsible-filter-block[open] summary {
  border-bottom: 1px solid rgba(46, 59, 72, 0.08);
}

.collapsible-filter-block[open] summary::after {
  transform: rotate(90deg);
}

.collapsible-filter-block .filter-grid,
.filter-control-list {
  padding: 10px;
}

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

.filter-control-list {
  margin-bottom: 0;
}

.domain-filter-layer-body {
  padding: 10px;
}

.domain-filter-layer-body .inline-fields {
  margin-bottom: 8px;
}

.domain-filter-layer-body .filter-control-list {
  padding: 0;
}

.geometry-filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


.freshness-filter-controls {
  grid-template-columns: 1fr;
  padding: 0;
}

.filter-chip,
.filter-option-row {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chip.active {
  border-color: rgba(22, 117, 111, 0.55);
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(22, 117, 111, 0.14);
}

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

.damage-filter-chip {
  gap: 6px;
  justify-content: flex-start;
}

.damage-filter-chip .damage-swatch {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  background: var(--damage-color, #56616d);
  box-shadow: 0 0 0 1px rgba(25, 34, 43, 0.22);
}

.damage-filter-chip:not(.active) .damage-swatch {
  opacity: 0.34;
  filter: grayscale(0.8);
}

.origin-filter-grid {
  grid-template-columns: 1fr;
}

.origin-filter-chip {
  justify-content: flex-start;
}

.filter-option-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 8px;
  color: #334353;
  font-size: 12px;
  font-weight: 850;
}

.filter-option-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.filter-option-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-control-field {
  margin-bottom: 0;
}

.filter-control-field span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-views-panel {
  padding: 0;
}

.saved-views-panel summary {
  min-height: 42px;
}

.saved-views-panel .saved-views-content {
  padding: 0 12px 12px;
}

.saved-view-actions {
  padding: 0;
  margin-bottom: 10px;
}

.saved-view-list {
  display: grid;
  gap: 7px;
}

.saved-view-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--control-h);
  gap: 8px;
  align-items: center;
}

.saved-view-main {
  display: grid;
  min-width: 0;
  min-height: var(--control-h);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.84);
}

.saved-view-main:hover {
  border-color: rgba(22, 117, 111, 0.45);
  background: rgba(22, 117, 111, 0.08);
}

.saved-view-main strong,
.saved-view-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-view-main strong {
  font-size: 12px;
}

.saved-view-main span {
  color: var(--muted);
  font-size: 11px;
}

.freshness-filter {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.compact-toggle {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.freshness-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: center;
  gap: 8px;
}

.freshness-range input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.freshness-range input[type="range"]:disabled {
  opacity: 0.45;
}

.freshness-range span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(22, 117, 111, 0.1);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.cesium-performance-filter {
  display: none;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(46, 103, 177, 0.24);
  border-radius: var(--radius);
  background: rgba(46, 103, 177, 0.08);
}

body[data-topography="cesium3d"] .cesium-performance-filter {
  display: grid;
}

.panel-micro-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.panel-micro-heading strong,
.panel-micro-heading span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-micro-heading strong {
  font-size: 12px;
  font-weight: 900;
}

.panel-micro-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.room-list,
.entity-list {
  display: grid;
  gap: 7px;
}

.room-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  text-align: left;
}

.room-item.active {
  border-color: rgba(46, 103, 177, 0.45);
  background: rgba(46, 103, 177, 0.12);
}

.room-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.room-item strong,
.entity-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-item span,
.entity-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #294151;
  background: rgba(15, 93, 88, 0.1);
  font-size: 11px;
  font-weight: 700;
}

.live-follow-pill.active {
  color: #0f4b38;
  background: rgba(39, 174, 96, 0.18);
}

.live-follow-pill.pending {
  color: #6f4b00;
  background: rgba(218, 165, 32, 0.2);
}

.live-follow-pill.error {
  color: #7d2b2b;
  background: rgba(198, 63, 63, 0.16);
}

.live-follow-pill.snapshot {
  color: #576674;
  background: rgba(87, 102, 116, 0.12);
}

.entity-card {
  overflow: hidden;
}

.entity-live-stream-host {
  position: relative;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #10171c;
}

.entity-live-stream-host:not([hidden]) {
  display: block;
  margin-bottom: 10px;
}

.entity-live-stream-host.has-live-video {
  min-height: 180px;
}

.entity-live-stream-host .live-video-embed {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 260px;
  border: 0;
  object-fit: contain;
  background: #05090c;
}

.entity-live-stream-host .live-video-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
}

.entity-live-stream-host .live-video-placeholder {
  min-height: 180px;
}

.entity-live-stream-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}

.entity-live-stream-controls[hidden] {
  display: none;
}

/* Dos controles al 50%; uno solo (quitar o selector) ocupa todo el ancho. */
.entity-live-stream-controls > .entity-camera-status:not([hidden]):not(.is-message):not(.is-error),
.entity-live-stream-controls > .entity-remove-camera-button:not([hidden]) {
  flex: 1 1 0;
  min-width: 0;
}

.entity-live-stream-controls > .entity-camera-status.is-message,
.entity-live-stream-controls > .entity-camera-status.is-error {
  flex: 1 1 100%;
}

.entity-live-stream-controls .entity-remove-camera-button {
  width: auto;
  justify-content: center;
}

.entity-live-stream-controls .entity-camera-status {
  margin: 0;
}

.entity-live-stream-controls .entity-camera-url-menu,
.entity-live-stream-controls .entity-camera-url-menu-button {
  width: 100%;
  height: 100%;
  min-height: 36px;
}

.entity-visual {
  display: grid;
  place-items: center;
  min-height: 138px;
  padding: 18px;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(18, 87, 80, 0.72), rgba(51, 72, 82, 0.68)),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(45deg, #27383d, #12191e);
}

.entity-visual.has-media {
  position: relative;
  min-height: 168px;
  padding: 0;
  overflow: hidden;
  background: #10171c;
}

.entity-visual.has-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 46%, rgba(8, 14, 18, 0.36));
  content: "";
  pointer-events: none;
}

.entity-visual.has-media img,
.entity-visual.has-media video {
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: cover;
}

.entity-visual.has-live-video {
  display: block;
  min-height: 210px;
}

.entity-visual.has-live-video::after {
  display: none;
}

.live-video-embed {
  display: block;
  width: 100%;
  min-height: 210px;
  border: 0;
  background: #05090c;
}

.live-video-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  overflow: hidden;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(176, 31, 39, 0.88);
}

/* Overlay de telemetria KLV (STANAG 4609: posicion del sensor, rumbo,
   velocidad) sobre el video en directo - solo aparece cuando hay datos KLV
   reales llegando por el WebSocket dedicado (ver camera-klv-client.js),
   nunca para una fuente sin esa pista. */
.live-video-klv-overlay,
.context-live-video-klv-overlay {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  max-width: calc(100% - 16px);
  padding: 6px 9px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(5, 15, 12, 0.72);
  backdrop-filter: blur(2px);
}

/* [hidden] normalmente pinta display:none via la hoja de estilos del user
   agent, pero esa regla es de MENOR prioridad de origen que cualquier regla
   de autor "normal" (la nuestra de arriba, con `display: grid`) - sin este
   override explicito, el atributo `hidden` puesto por JS no ocultaba nada en
   la practica: el overlay (vacio, sin filas) ya se veia como una caja semi-
   transparente ANTES de que llegara el primer dato KLV real. Encontrado en
   vivo inspeccionando el DOM (el elemento existia con `display: grid`
   aplicado pese a `hidden`).*/
.live-video-klv-overlay[hidden],
.context-live-video-klv-overlay[hidden] {
  display: none;
}

.live-video-klv-overlay dt,
.context-live-video-klv-overlay dt {
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-video-klv-overlay dd,
.context-live-video-klv-overlay dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Estado sin video dentro de entity-visual (has-live-video) - antes era solo
   una pastilla roja diminuta en la esquina, indistinguible de "esto esta
   roto"; ahora ocupa el centro de la caja con un texto claro y, mientras se
   esta conectando, un spinner. */
.live-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 210px;
  padding: 18px;
  text-align: center;
}

.live-video-placeholder-text {
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12.5px;
  font-weight: 600;
}

.live-video-placeholder--error .live-video-placeholder-text {
  color: #f2a3a0;
}

.live-video-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: live-video-spin 0.85s linear infinite;
}

@keyframes live-video-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-video-spinner {
    animation: none;
  }
}

.live-video-detach-button,
.context-live-video-detach {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 32, 40, 0.82);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.live-video-detach-button:hover,
.context-live-video-detach:hover {
  background: rgba(15, 32, 40, 0.96);
}

#managementMediaGatewayStatus[data-tone="success"] {
  color: var(--accent-strong);
}

#managementMediaGatewayStatus[data-tone="error"] {
  color: #a83a3a;
}

#selectedMediaStatus:empty {
  display: none;
}

#selectedMediaStatus[data-tone="ready"],
#selectedMediaStatus[data-tone="pending"] {
  color: var(--accent-strong);
}

#selectedMediaStatus[data-tone="error"] {
  color: #a83a3a;
}

.entity-visual-fallback {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  color: #ffffff;
  text-align: center;
}

.entity-visual-fallback svg {
  width: 28px;
  height: 28px;
}

.entity-visual strong {
  font-size: 28px;
  line-height: 1;
}

.entity-summary {
  padding: 12px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.entity-summary h2 {
  font-size: 20px;
  line-height: 1.14;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-width: 0;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.74);
}

.metric span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.entity-camera-form {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.entity-camera-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
}

.entity-camera-form-home[hidden],
.entity-camera-form-home:empty {
  display: none;
}

.entity-ficha-camera-form-slot {
  display: grid;
  min-width: 0;
}

.entity-ficha-camera-form-slot:empty {
  display: none;
}

.entity-ficha-camera-form-slot > .entity-camera-form {
  padding: 0;
}

.entity-camera-form[hidden] {
  display: none;
}

.entity-camera-form > .entity-camera-mode-toggle,
.entity-camera-form > .entity-camera-label-input,
.entity-camera-form > .entity-camera-external-url-input,
.entity-camera-form > .entity-camera-credentials,
.entity-camera-form > .entity-add-camera-button {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.entity-camera-form > .entity-add-camera-button {
  display: flex;
  justify-content: center;
}

.entity-camera-form > .entity-camera-label-input[hidden],
.entity-camera-form > .entity-camera-external-url-input[hidden],
.entity-camera-form > .entity-camera-mode-toggle[hidden],
.entity-camera-form > .entity-camera-credentials[hidden],
.entity-camera-form > .entity-add-camera-button[hidden] {
  display: none;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 0 10px;
  font-weight: 750;
}

.action-button.primary {
  color: #ffffff;
  border-color: transparent;
  background: var(--accent);
}

.action-button.danger-button {
  color: #ffd0d6;
  border-color: rgba(255, 92, 108, 0.45);
  background: rgba(255, 92, 108, 0.14);
}

.action-button.danger-button:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(255, 92, 108, 0.7);
  background: rgba(255, 92, 108, 0.22);
}

.selected-entity-lifecycle {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(143, 39, 51, 0.22);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(183, 49, 63, 0.04);
}

.selected-entity-lifecycle .tiny-note {
  margin: 0;
}

.selected-entity-lifecycle .action-button {
  width: 100%;
}

.entity-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 54px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.entity-row:focus-visible {
  outline: 3px solid rgba(22, 117, 111, 0.22);
  outline-offset: 2px;
}

.entity-row.active {
  border-color: rgba(22, 117, 111, 0.55);
  background: rgba(22, 117, 111, 0.1);
}

.entity-row.multi-selected {
  border-color: rgba(0, 188, 174, 0.72);
  box-shadow: inset 3px 0 0 var(--accent);
  background: rgba(22, 117, 111, 0.07);
}

.entity-glyph.group {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
}

.context-group-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.context-group-entities {
  display: grid;
  gap: 5px;
  max-height: 210px;
  overflow: auto;
}

.context-group-entities > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(128, 151, 166, 0.3);
  border-radius: 8px;
}

.context-group-entities small {
  color: var(--muted);
}

.context-group-overflow {
  color: var(--muted);
  font-size: 11px;
  justify-content: center !important;
}

.entity-multi-select-button[data-selection-count]:not([data-selection-count="0"]):not([data-selection-count="1"])::after {
  content: attr(data-selection-count);
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.entity-multi-select-button {
  position: relative;
}

.entity-glyph {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.entity-glyph.friendly {
  background: var(--blue);
}

.entity-glyph.hostile {
  background: var(--red);
}

.entity-glyph.neutral {
  background: var(--amber);
}

.entity-glyph.unknown {
  background: #56616d;
}

.entity-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.icon-button.compact {
  width: 30px;
  height: 30px;
}

.mini-json {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #26333f;
  background: #f3f6f8;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.context-grid {
  display: grid;
  gap: 8px;
}

.compact-data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.logistics-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.scalar-dashboard .fuel-gauge::after {
  background: rgba(36, 50, 61, 0.82);
}

.scalar-card {
  grid-template-columns: 92px minmax(0, 1fr);
}

.scalar-readout,
.scalar-bar-readout,
.scalar-compass {
  width: 82px;
  height: 64px;
}

.scalar-readout,
.scalar-bar-readout {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(92, 109, 126, 0.2);
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.86);
}

.scalar-readout strong,
.scalar-bar-readout strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scalar-readout span,
.scalar-bar-readout span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.scalar-bar-readout i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(92, 109, 126, 0.16);
}

.scalar-bar-readout i::before {
  display: block;
  width: calc(var(--level, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--gauge-color, var(--accent));
  content: "";
}

.scalar-compass {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(92, 109, 126, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(248, 250, 252, 0.98) 0 48%, transparent 49%),
    conic-gradient(from 0deg, rgba(92, 109, 126, 0.18) 0 90deg, rgba(92, 109, 126, 0.08) 90deg 180deg, rgba(92, 109, 126, 0.18) 180deg 270deg, rgba(92, 109, 126, 0.08) 270deg 360deg);
}

.scalar-compass .compass-n {
  position: absolute;
  top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.scalar-compass .compass-needle {
  position: absolute;
  width: 3px;
  height: 27px;
  border-radius: 999px;
  background: var(--gauge-color, var(--accent));
  transform: rotate(var(--angle, 0deg)) translateY(-10px);
  transform-origin: 50% 24px;
}

.scalar-compass .compass-needle::after {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--gauge-color, var(--accent));
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.scalar-compass strong {
  position: relative;
  z-index: 1;
  padding: 2px 4px;
  border-radius: 5px;
  color: var(--ink);
  background: rgba(248, 250, 252, 0.86);
  font-size: 12px;
  font-weight: 900;
}

.scalar-dial span {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-gauge-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
}

.fuel-gauge {
  position: relative;
  display: grid;
  place-items: end center;
  width: 78px;
  height: 46px;
  overflow: hidden;
  color: #24323d;
  font-size: 13px;
  font-weight: 850;
}

.fuel-gauge::before {
  position: absolute;
  inset: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #f8fafc 0 50%, transparent 51%),
    conic-gradient(
      from 270deg,
      var(--gauge-color) 0 calc(var(--level) * 1.8deg),
      rgba(92, 109, 126, 0.2) calc(var(--level) * 1.8deg) 180deg,
      transparent 180deg 360deg
    );
  content: "";
}

.fuel-gauge::after {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 32px;
  height: 3px;
  border-radius: 999px;
  background: #24323d;
  content: "";
  transform: translateX(-100%) rotate(calc((var(--level) * 1.8deg) - 90deg));
  transform-origin: right center;
}

.fuel-gauge span {
  position: relative;
  z-index: 1;
  padding-bottom: 2px;
}

.logistics-gauge-copy {
  min-width: 0;
}

.logistics-gauge-copy strong,
.logistics-gauge-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-gauge-copy strong {
  font-size: 13px;
}

.logistics-gauge-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.logistics-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid rgba(92, 109, 126, 0.18);
}

.logistics-metric {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(92, 109, 126, 0.18);
  border-radius: 7px;
  background: rgba(12, 12, 12, 0.75);
}

.logistics-metric strong,
.logistics-metric span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-metric strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.logistics-metric span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.media-gallery {
  display: grid;
  gap: 8px;
}

.media-gallery.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-card {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.media-card.compact {
  grid-template-columns: 1fr;
}

.media-preview {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 104px;
  overflow: hidden;
  border-radius: 6px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(22, 117, 111, 0.78), rgba(36, 48, 58, 0.86));
}

.media-card.compact .media-preview {
  min-height: 88px;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  min-height: 104px;
  object-fit: cover;
}

.media-card.compact .media-preview img,
.media-card.compact .media-preview video {
  min-height: 88px;
}

.media-preview.audio {
  gap: 8px;
  padding: 10px;
}

.media-preview.audio audio {
  width: 100%;
  max-width: 220px;
}

.media-preview.model3d {
  align-items: center;
  background: linear-gradient(145deg, rgba(19, 104, 99, 0.2), rgba(17, 43, 61, 0.92));
  color: #d6fffb;
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  gap: 0.45rem;
  justify-content: center;
  text-decoration: none;
}

.media-preview.geo-layer {
  border: 1px solid rgba(59, 202, 190, 0.34);
  background: linear-gradient(145deg, rgba(10, 116, 106, 0.82), rgba(12, 38, 55, 0.96));
}

.geo-content-toggle {
  min-height: 30px;
  margin-top: 4px;
}

.media-preview.model3d svg {
  height: 2rem;
  width: 2rem;
}

.media-preview svg {
  width: 28px;
  height: 28px;
}

.media-card-body {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.media-card-body strong,
.media-card-body span,
.media-card-body p,
.media-card-body a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card-body strong {
  font-size: 13px;
}

.media-card-body span,
.media-card-body p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.media-card-body p {
  margin: 0;
}

.media-card-body a {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.dispatch-target {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.dispatch-target > span {
  min-width: 0;
}

.dispatch-target strong,
.dispatch-target > span > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-target > span > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.dispatch-operation-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(22, 117, 111, 0.22);
  border-radius: var(--radius);
  background: rgba(22, 117, 111, 0.07);
}

/* Alert coordination: facts first, controls scoped to one order, technical detail on demand. */
/* Give coordination a reading/writing workspace without changing other modes. */
@media (min-width: 761px) {
  body[data-mode="command"] .right-rail,
  body[data-mode="explore"] .right-rail:has([data-alert-workflow]) {
    width: clamp(460px, 36vw, 640px);
  }
}

@media (min-width: 761px) and (max-width: 1060px) {
  body[data-mode="command"] .right-rail,
  body[data-mode="explore"] .right-rail:has([data-alert-workflow]) {
    width: min(480px, calc(50vw - 26px));
  }
}

.alert-workflow {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #496c70;
  border-radius: 12px;
  color: #f3f6f7;
  background: #142126;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.alert-workflow *, .alert-workflow .field { min-width: 0; box-sizing: border-box; }
.alert-workflow h2, .alert-workflow h3, .alert-workflow h4, .alert-workflow p { margin: 0; }
.alert-workflow h2 { font-size: 18px; line-height: 1.2; }
.alert-workflow h3, .alert-workflow h4 { font-size: 14px; }
.alert-workflow-header, .alert-order-header, .alert-section-heading {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.alert-eyebrow { display: block; color: #8ed8ce; font-size: 10px; letter-spacing: .12em; margin-bottom: 5px; }
.alert-context { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid #3a4a50; }
.alert-context span, .alert-workflow .alert-help, .alert-feedback { color: #b8c7ce; font-size: 12px; }
.alert-feedback:empty { display: none; }
.alert-orders, .alert-section-body { display: grid; gap: 10px; }
.alert-order { display: grid; gap: 12px; padding: 12px; border: 1px solid #45575d; border-radius: 9px; background: #1b2a30; }
.alert-status { border: 1px solid #76929d; border-radius: 20px; padding: 3px 9px; font-size: 12px; font-weight: 700; background: #293d46; }
.alert-status[data-status="executed"] { color: #a5efcf; border-color: #4e9b79; background: #173f32; }
.alert-status[data-status="failed"] { color: #ffc5b9; border-color: #bd7d6d; background: #4b2923; }
.alert-status[data-status="in_progress"] { color: #c7e6ff; border-color: #759fbb; background: #203b50; }
.alert-progress { display: grid; gap: 8px; padding: 10px; border-radius: 7px; background: #101d23; }
.alert-progress progress { width: 100%; height: 7px; accent-color: #70d4c3; border: 0; border-radius: 8px; overflow: hidden; }
.alert-progress progress::-webkit-progress-bar { background: #40525b; }
.alert-progress progress::-webkit-progress-value { background: #70d4c3; }
.alert-link { padding-left: 8px; border-left: 3px solid #72cbb5; font-size: 12px; color: #c1e9db; }
.alert-link.is-pending { border-color: #e3bd78; color: #ffe1a9; }
.alert-notice { border: 1px solid #658581; border-radius: 7px; padding: 10px; background: #263c3d; }
.alert-notice.is-warning { border-color: #b18c4b; background: #413523; color: #ffe3b3; }
.alert-notice p { margin-top: 6px; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.alert-workflow .action-button { min-height: 40px; height: auto; white-space: normal; padding: 8px 12px; line-height: 1.3; }
.alert-workflow .action-button:disabled { opacity: .5; cursor: not-allowed; }
.alert-workflow :is(button, summary, input, select, textarea):focus-visible { outline: 2px solid #8ee9da; outline-offset: 3px; }
.alert-workflow details { min-width: 0; border-top: 1px solid #415158; }
.alert-workflow summary { cursor: pointer; min-height: 40px; padding: 10px 0; color: #dae5e9; font-weight: 600; }
.alert-section-body { padding: 4px 0 10px; }
.alert-review, .alert-action-form { display: grid; gap: 10px; padding: 10px; background: #122027; border: 1px solid #617c85; border-radius: 8px; }
.alert-instruction { white-space: pre-wrap; }
.alert-receipt { display: grid; gap: 7px; padding: 10px 0; border-bottom: 1px solid #415158; }
.alert-workflow .field { width: 100%; gap: 6px; }
.alert-workflow .field > span { text-transform: none; font-size: 12px; letter-spacing: 0; }
.alert-workflow :is(input, select, textarea) { width: 100%; max-width: 100%; font-size: 13px; }
.alert-empty { color: #c6d3d9; padding: 8px 0; }

.compact-heading {
  min-height: auto;
}

.operation-grid,
.context-operation-list {
  display: grid;
  gap: 7px;
}

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

.operation-button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #23303a;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
}

.operation-button:hover {
  border-color: rgba(22, 117, 111, 0.42);
  background: rgba(255, 255, 255, 0.96);
}

.operation-button svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.operation-button span,
.operation-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-button span span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.entity-context-menu {
  position: fixed;
  z-index: 2200;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 18px));
  max-height: min(680px, calc(100vh - 18px));
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(40, 57, 72, 0.24);
  border-radius: var(--radius);
  background: rgba(12, 5, 3, 0.8);
  box-shadow: var(--shadow);
}

.entity-context-menu[hidden] {
  display: none !important;
}

.context-menu-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.context-menu-header > span {
  min-width: 0;
}

.context-menu-header strong,
.context-menu-header span span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-menu-header span span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.context-menu-actions.has-stream {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.context-menu-actions button,
.context-data-button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #23303a;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
}

.context-menu-actions button:hover,
.context-data-button:hover {
  border-color: rgba(22, 117, 111, 0.42);
  background: #ffffff;
}

.context-menu-section {
  display: grid;
  gap: 7px;
}

.context-menu-label {
  color: #47596a;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.context-data-button.empty {
  opacity: 0.62;
}

.context-data-button.live {
  border-color: rgba(22, 117, 111, 0.46);
  background: rgba(20, 20, 20, 0.92);
}

.context-data-button.live span span {
  color: #087a6e;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.context-live-video {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(22, 117, 111, 0.34);
  border-radius: var(--radius);
  background: #10171c;
}

.context-live-video-embed {
  display: block;
  width: 100%;
  min-height: 196px;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #10171c;
}

.context-live-video-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(196, 36, 51, 0.9);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* Misma receta que .field input (styles.css:1786) - altura y tipografia
   iguales al resto de inputs de la app, para que esto no se vea como un
   componente aparte. */
/* Mismo lenguaje visual que .topography-control - pildora con 2 opciones,
   la activa en solido. Fondos alineados al tema oscuro (antes usaba
   rgba blanco 0.6 + --ink claro = pestaña inactiva invisible). */
.entity-camera-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.entity-camera-mode-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  height: auto;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  color: #d7dbe2;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  cursor: pointer;
}

.entity-camera-mode-toggle button:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.entity-camera-mode-toggle button.active {
  color: #ffffff;
  background: #000000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

/* Mismo motivo que .entity-camera-relay-toggle[hidden] mas abajo - display:grid
   es una regla de autor, gana siempre al [hidden] de agente de usuario. */
.entity-camera-mode-toggle[hidden] {
  display: none;
}

.entity-camera-label-input,
.entity-camera-external-url-input,
.entity-camera-credentials input {
  width: 100%;
  height: var(--control-h);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.entity-camera-label-input::placeholder,
.entity-camera-external-url-input::placeholder,
.entity-camera-credentials input::placeholder {
  color: #8b929c;
}

.entity-camera-label-input:focus,
.entity-camera-external-url-input:focus,
.entity-camera-credentials input:focus {
  border-color: rgba(228, 0, 70, 0.55);
  box-shadow: 0 0 0 3px rgba(228, 0, 70, 0.16);
}

.entity-camera-credentials {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
}

/* Mismo tratamiento que .collapsible-filter-block summary (styles.css:1931) */
.entity-camera-credentials summary {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c9cdd4;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.entity-camera-credentials summary::-webkit-details-marker {
  display: none;
}

.entity-camera-credentials summary::after {
  content: ">";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
  transition: transform 140ms ease;
}

.entity-camera-credentials[open] summary::after {
  transform: rotate(90deg);
}

.entity-camera-credentials .tiny-note {
  margin: 6px 0;
}

.entity-camera-credentials input {
  margin-top: 6px;
}

/* El checkbox de KLV vive ahora dentro de "Opciones avanzadas" (pedido real
   2026-08-20, antes su propio bloque suelto) - mismo espaciado que sus
   hermanos de arriba dentro del <details>. */
.entity-camera-credentials .entity-camera-relay-toggle {
  margin-top: 6px;
}

/* Mismo tratamiento que .toggle-line / .filter-option-row (styles.css:1269,
   2059) - misma tipografia y checkbox que cualquier otro toggle de la app. */
.entity-camera-relay-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: var(--control-h);
  padding: 2px 0;
  color: #d7dbe2;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  cursor: pointer;
}

/* display:flex es una regla de autor, y el [hidden] del navegador es de
   agente de usuario - el autor gana SIEMPRE (independiente de especificidad),
   asi que sin este override el checkbox se queda visible aunque JS le ponga
   hidden=true. Bug preexistente desde que se creo esta clase (4f7470d), no
   solo del panel lateral - afecta igual al popup del mapa. */
.entity-camera-relay-toggle[hidden] {
  display: none;
}

.entity-camera-relay-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* entityCameraForm agrupa el alta en columna a ancho completo (regresion UI
   2026-08-27: hijos sueltos de .entity-card quedaban a media anchura). */
.entity-card > .entity-camera-status {
  margin: 8px 12px 12px;
}

.entity-camera-status {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.entity-camera-status[hidden] {
  display: none;
}

.entity-camera-status.is-message,
.entity-camera-status.is-error {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.entity-camera-status.is-error {
  color: #ff8f9c;
}

.entity-camera-url-menu {
  position: relative;
  display: flex;
  min-width: 0;
  width: 100%;
}

.entity-camera-url-menu-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: #f4f4f4;
  background: #0a0c10;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.entity-camera-url-menu-button:hover {
  background: #12161c;
}

.entity-camera-url-menu-button svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.entity-camera-url-menu.is-open .entity-camera-url-menu-button {
  border-color: rgba(255, 255, 255, 0.42);
  background: #12161c;
}

.entity-camera-url-menu.is-copied .entity-camera-url-menu-button {
  border-color: rgba(103, 211, 132, 0.65);
  color: #67d384;
}

.entity-camera-url-menu.is-copy-error .entity-camera-url-menu-button {
  border-color: rgba(255, 143, 156, 0.65);
  color: #ff8f9c;
}

.entity-camera-url-menu[data-live="true"] .entity-camera-url-menu-button {
  border-color: rgba(103, 211, 132, 0.45);
}

.entity-camera-url-menu-list {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: #101418;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.entity-camera-url-menu-list[hidden] {
  display: none;
}

.entity-camera-url-menu-item {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  color: #f4f4f4;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.entity-camera-url-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.floating-video-layer,
.floating-window-layer {
  position: fixed;
  z-index: 2390;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-window {
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 280px;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 14px;
  background: #10171c;
  box-shadow: 0 18px 52px rgba(3, 12, 18, 0.42);
  transform-origin: center;
  pointer-events: auto;
}

.floating-window.is-minimized {
  min-height: 0;
  height: auto !important;
}

.floating-window-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 8px 7px 11px;
  color: #ffffff;
  background: linear-gradient(90deg, rgba(14, 70, 68, 0.98), rgba(18, 38, 48, 0.98));
  cursor: move;
  touch-action: none;
  user-select: none;
}

.floating-window-identity {
  display: grid;
  min-width: 0;
}

.floating-window-identity strong,
.floating-window-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-window-identity strong {
  font-size: 12px;
}

.floating-window-identity small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
}

.floating-window-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.floating-window-control {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.floating-window-control:hover,
.floating-window-control:focus-visible {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.2);
}

.floating-window-owner-navigation {
  color: #d8ffff;
  border-color: rgba(96, 226, 219, 0.58);
  background: rgba(0, 111, 108, 0.34);
}

.floating-window-owner-navigation svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.floating-window-owner-navigation.is-ready-to-approach {
  color: #061a1a;
  border-color: #68fff4;
  background: #3de6db;
  box-shadow: 0 0 0 2px rgba(61, 230, 219, 0.2);
}

.floating-window-owner-navigation.is-navigation-error {
  color: #ffd7d7;
  border-color: rgba(255, 116, 116, 0.7);
  background: rgba(128, 24, 34, 0.45);
}

.floating-window-content {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.floating-window-entity-locator .floating-window-content {
  background: #0a1014;
}

.entity-locator {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  color: #f4f7f8;
  background: #0a1014;
}

.entity-locator-toolbar {
  display: grid;
  gap: 7px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.entity-locator-search-row,
.entity-locator-basic-filters {
  display: grid;
  align-items: center;
  gap: 7px;
}

.entity-locator-search-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.entity-locator-basic-filters {
  grid-template-columns: minmax(100px, 0.8fr) minmax(145px, 1.2fr);
}

.entity-locator-search,
.entity-locator-scope,
.entity-locator-type,
.entity-locator-advanced select {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #ffffff;
  background: #151d22;
  font: inherit;
}

.entity-locator-search {
  width: 100%;
  padding: 0 10px;
}

.entity-locator-search::placeholder {
  color: rgba(255, 255, 255, 0.47);
}

.entity-locator-scope,
.entity-locator-type,
.entity-locator-advanced select {
  width: 100%;
  padding: 0 8px;
}

.entity-locator-scope option,
.entity-locator-type option,
.entity-locator-advanced option {
  color: #ffffff;
  background: #151d22;
}

.entity-locator-count {
  min-width: 68px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.entity-locator-advanced {
  min-width: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d151a;
}

.entity-locator-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 5px 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.entity-locator-advanced > summary::-webkit-details-marker {
  display: none;
}

.entity-locator-advanced > summary::after {
  content: ">";
  margin-left: auto;
  padding-left: 8px;
  transform: rotate(90deg);
}

.entity-locator-advanced[open] > summary::after {
  transform: rotate(-90deg);
}

.entity-locator-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(285px, 46vh);
  padding: 4px 12px 12px;
  overflow-y: auto;
}

.entity-locator-advanced-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 750;
}

.entity-locator-reset {
  grid-column: 1 / -1;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.entity-locator-reset:hover,
.entity-locator-reset:focus-visible {
  border-color: #00e2d1;
  color: #00e2d1;
  background: rgba(0, 226, 209, 0.1);
}

.entity-locator-status {
  min-height: 28px;
  padding: 7px 12px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(12, 23, 29, 0.95);
  font-size: 10px;
}

.entity-locator-status[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .entity-locator-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .entity-locator-reset {
    grid-column: auto;
  }
}

.entity-locator-status.is-error {
  color: #ffc4ca;
}

.entity-locator-list {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.entity-locator-footer {
  padding: 9px 12px 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d151a;
}

.entity-locator-expire-all {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 105, 120, 0.7);
  border-radius: 9px;
  color: #ffd9dd;
  background: rgba(139, 24, 42, 0.32);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.entity-locator-expire-all:hover,
.entity-locator-expire-all:focus-visible {
  border-color: #ff8f9b;
  color: #ffffff;
  background: rgba(169, 32, 52, 0.52);
}

.entity-locator-expire-all:disabled {
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.04);
  cursor: default;
}

.entity-locator-row-layer {
  position: absolute;
  inset: 0 0 auto;
}

.entity-locator-spacer {
  width: 1px;
  pointer-events: none;
}

.entity-locator-row {
  position: absolute;
  inset: 0 8px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 6px;
  height: 64px;
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #12191e;
}

.entity-locator-row.active {
  border-color: rgba(0, 226, 209, 0.82);
  background: rgba(0, 94, 88, 0.34);
}

.entity-locator-select {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 100%;
  padding: 6px 4px 6px 9px;
  border: 0;
  color: #ffffff;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.entity-locator-select:hover,
.entity-locator-select:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

.entity-locator-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.entity-locator-copy strong,
.entity-locator-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-locator-copy strong {
  font-size: 12px;
}

.entity-locator-copy span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
}

.entity-locator-aim {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.entity-locator-aim:hover,
.entity-locator-aim:focus-visible {
  border-color: #00e2d1;
  color: #00e2d1;
  background: rgba(0, 226, 209, 0.12);
}

.entity-locator-aim.is-ready-to-approach {
  border-color: rgba(0, 226, 209, 0.88);
  color: #001c1a;
  background: #00e2d1;
  box-shadow: 0 0 0 2px rgba(0, 226, 209, 0.16);
}

.entity-locator-aim.is-ready-to-approach:hover,
.entity-locator-aim.is-ready-to-approach:focus-visible {
  color: #001411;
  background: #69fff3;
}

.floating-window-dispatch-confirmation .floating-window-content {
  overflow: auto;
  background: #0a1014;
}

.dispatch-confirmation {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  min-height: 100%;
  padding: 18px;
  color: #f4f7f8;
  background:
    radial-gradient(circle at 100% 0, rgba(0, 226, 209, 0.13), transparent 42%),
    #0a1014;
}

.dispatch-confirmation-introduction {
  display: grid;
  gap: 8px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.dispatch-confirmation-eyebrow {
  color: #00e2d1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.dispatch-confirmation-introduction h3,
.dispatch-confirmation-introduction p,
.dispatch-confirmation-demo-note {
  margin: 0;
}

.dispatch-confirmation-introduction h3 {
  color: #ffffff;
  font-size: clamp(17px, 2.4vw, 23px);
  line-height: 1.2;
}

.dispatch-confirmation-introduction p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.dispatch-confirmation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.dispatch-confirmation-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
}

.dispatch-confirmation-summary dt {
  color: rgba(255, 255, 255, 0.54);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dispatch-confirmation-summary dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 12px;
  font-weight: 780;
}

.dispatch-confirmation-summary .dispatch-confirmation-wide {
  grid-column: 1 / -1;
}

.dispatch-confirmation-summary .dispatch-confirmation-identifier dd {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.dispatch-confirmation-demo-note {
  padding: 9px 11px;
  border-left: 3px solid #e8b62f;
  color: #f7e7b5;
  background: rgba(232, 182, 47, 0.11);
  font-size: 10px;
  line-height: 1.45;
}

.dispatch-confirmation-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 9px;
  margin-top: auto;
}

.dispatch-confirmation-actions .action-button {
  min-height: 46px;
}

.dispatch-confirmation-confirm.is-critical {
  border-color: rgba(255, 91, 91, 0.76);
  background: #a91e2d;
}

.dispatch-confirmation-confirm.is-critical:hover,
.dispatch-confirmation-confirm.is-critical:focus-visible {
  background: #c12638;
}

@media (max-width: 520px) {
  .dispatch-confirmation-summary,
  .dispatch-confirmation-actions {
    grid-template-columns: 1fr;
  }

  .dispatch-confirmation-summary .dispatch-confirmation-wide {
    grid-column: auto;
  }
}

.floating-window.is-minimized .floating-window-content,
.floating-window.is-minimized .floating-window-resize-handle {
  display: none;
}

.floating-video-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #05090c;
}

.floating-live-video {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #05090c;
}

video.floating-video-frame {
  object-fit: contain;
}

.floating-live-video-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(176, 31, 39, 0.88);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.floating-window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, transparent 48%, rgba(255, 255, 255, 0.82) 50%, transparent 55%, transparent 66%, rgba(255, 255, 255, 0.82) 68%, transparent 73%);
  cursor: nwse-resize;
  touch-action: none;
}

.floating-window[data-rotation="90"] .floating-window-resize-handle {
  top: 0;
  right: 0;
  bottom: auto;
}

.floating-window[data-rotation="180"] .floating-window-resize-handle {
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
}

.floating-window[data-rotation="270"] .floating-window-resize-handle {
  right: auto;
  bottom: 0;
  left: 0;
}

.media-preview-button {
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.media-preview-button:focus-visible {
  outline: 3px solid rgba(45, 212, 191, 0.9);
  outline-offset: 2px;
}

.media-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.media-viewer-actions .action-button {
  min-height: 36px;
  margin: 0;
}

.floating-media-viewer {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  color: #ffffff;
  background: #080d11;
}

.floating-media-image-viewer {
  grid-template-rows: auto minmax(0, 1fr);
}

.floating-media-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: #10171c;
}

.floating-media-toolbar-button {
  min-width: 40px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 750;
  cursor: pointer;
}

.floating-media-toolbar-button:disabled {
  opacity: 0.4;
}

.floating-media-zoom-value {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 700;
}

.floating-media-image-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  background: repeating-conic-gradient(#11191f 0 25%, #0c1318 0 50%) 50% / 22px 22px;
}

.floating-media-image {
  display: block;
  max-width: none;
  align-self: start;
  justify-self: start;
}

.floating-media-image.is-fit {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  object-fit: contain;
}

.floating-media-pdf-viewer {
  grid-template-rows: minmax(0, 1fr);
}

.pdf-canvas-viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.pdf-canvas-toolbar {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.pdf-canvas-toolbar-button {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}

.pdf-canvas-page-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.pdf-canvas-page-control input {
  width: 58px;
  min-height: 34px;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  text-align: center;
}

.pdf-canvas-page-control input:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.9);
  outline-offset: 1px;
}

.pdf-canvas-page-total {
  min-width: 38px;
  color: rgba(255, 255, 255, 0.68);
}

.pdf-canvas-zoom-value {
  flex: 0 0 auto;
}

.pdf-canvas-stage {
  position: relative;
  display: grid;
  place-items: start center;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  background: #252a2e;
}

.pdf-canvas-page {
  display: block;
  max-width: none;
  border: 0;
  background: #ffffff;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.38);
}

.pdf-canvas-status,
.pdf-canvas-bootstrap-status {
  align-self: center;
  justify-self: center;
  margin: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(8, 13, 17, 0.86);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.pdf-canvas-status.is-error,
.pdf-canvas-bootstrap-status.is-error {
  color: #ffd4d8;
  background: rgba(111, 21, 33, 0.88);
}

@media (pointer: coarse) {
  .floating-window-header {
    min-height: 56px;
  }

  .floating-window-control,
  .floating-media-toolbar-button {
    min-width: 44px;
    min-height: 44px;
  }

  .pdf-canvas-page-control input {
    min-height: 44px;
  }

  .floating-window-resize-handle {
    width: 42px;
    height: 42px;
  }
}

.context-data-button svg,
.context-menu-actions svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.context-data-button span,
.context-data-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-data-button span span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.entity-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  font-size: 14px;
  font-weight: 850;
}

.entity-marker-stack {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: visible;
}

.entity-marker-stack.app6-stack {
  width: var(--app6-marker-stack-size, 46px);
  height: var(--app6-marker-stack-size, 46px);
}

.leaflet-marker-icon.coverage-intersection-hit .entity-marker-stack::before {
  position: absolute;
  inset: -7px;
  z-index: 0;
  border: 3px solid #ffe066;
  border-radius: 999px;
  content: "";
  pointer-events: none;
}

.leaflet-interactive.coverage-intersection-hit {
  stroke: #ffe066;
  stroke-width: 4;
}

/* Flecha de rumbo en directo (STANAG 4609, KLV heading) - solo la entidad
   con la camara activa AHORA MISMO la recibe (ver subscribeMarkerToHeading
   en map-entity-markers.js); el resto de marcadores la llevan en el DOM
   pero siempre oculta. Oculta via .visible, no via `hidden` - la misma
   trampa de cascada CSS que .live-video-klv-overlay[hidden] de mas arriba:
   una regla de autor "normal" que fija `display` gana sobre [hidden] del
   user agent independientemente de especificidad. */
.entity-marker-heading-arrow {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  transform-origin: 50% 50%;
  transition: transform 0.2s linear;
}

.entity-marker-heading-arrow.visible {
  display: block;
}

.entity-marker-heading-arrow::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 22px solid #ffcc33;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.95));
}

.app6-entity-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--app6-marker-size, 42px);
  height: var(--app6-marker-size, 42px);
  border-radius: 4px;
  filter: none;
}

html[data-render-effects="legacy"] .app6-entity-marker {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.32));
}

.app6-marker-img {
  display: block;
  width: var(--app6-marker-size, 42px);
  height: auto;
  max-height: var(--app6-marker-size, 42px);
}

.app6-entity-marker.selected {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.app6-entity-marker.estimated {
  opacity: 0.72;
}

.app6-entity-marker.editable {
  cursor: grab;
}

@media (max-width: 700px) {
  .auth-gate {
    padding: 16px;
  }

  .auth-gate-card {
    padding: 26px 22px;
  }

  .app-session-control {
    top: 64px;
    right: 10px;
    max-width: calc(100vw - 20px);
  }
}
.entity-cluster-marker {
  display: grid;
  place-items: center;
  width: var(--cluster-size, 42px);
  height: var(--cluster-size, 42px);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(22, 117, 111, 0.9);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.entity-cluster-marker.hostile {
  background: rgba(180, 51, 60, 0.92);
}

.entity-cluster-marker.neutral {
  background: rgba(187, 123, 24, 0.92);
}

.entity-cluster-marker.unknown {
  background: rgba(86, 97, 109, 0.92);
}

.smooth-entity-marker {
  transition: transform var(--entity-move-ms, 180ms) linear;
  will-change: transform;
}

.leaflet-drag-target.smooth-entity-marker {
  transition: none;
}

.entity-marker.hostile {
  background: var(--red);
}

.entity-marker.neutral {
  background: var(--amber);
}

.entity-marker.unknown {
  background: #56616d;
}

.entity-marker.damage {
  background: var(--damage-color, #c8323d);
}

.entity-marker.selected {
  outline: 4px solid rgba(255, 255, 255, 0.36);
}

.entity-marker.estimated {
  opacity: 0.7;
  border-style: dashed;
}

.entity-marker.editable {
  cursor: grab;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.26),
    0 0 0 4px rgba(20, 184, 166, 0.24);
}

.leaflet-drag-target .entity-marker.editable {
  cursor: grabbing;
}

.entity-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.entity-dialog::backdrop {
  background: rgba(8, 14, 18, 0.52);
}

.dialog-content {
  padding: 14px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  margin: 8px 0 0;
}

@media (max-width: 1060px) {
  .map-source-row {
    grid-template-columns: 1fr;
  }

  .topography-control {
    top: auto;
    bottom: 18px;
    width: min(402px, calc(100vw - 36px));
  }

  .topography-status {
    top: auto;
    bottom: 66px;
    max-width: min(420px, calc(100vw - 36px));
  }

  .left-rail {
    width: min(408px, calc(50vw - 26px));
  }

  .right-rail {
    width: min(340px, calc(50vw - 26px));
  }

  .management-screen {
    left: min(444px, calc(50vw + 8px));
  }

  .management-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .timeline-manager-grid {
    grid-template-columns: 1fr;
  }

  .room-manager-grid {
    grid-template-columns: 1fr;
  }

  .room-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-editor-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-header {
    grid-template-columns: 1fr;
  }

  .management-header-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .viewer-shell {
    min-height: 100vh;
    height: auto;
    display: grid;
    grid-template-rows: minmax(360px, 54vh) auto auto;
  }

  .map-stage {
    position: relative;
    min-height: 360px;
  }

  .topography-control {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 40px;
    bottom: 12px;
    width: calc(100% - 24px);
    min-width: 0;
  }

  .topography-control button {
    padding: 0 6px;
  }

  .topography-status {
    bottom: 58px;
    max-width: calc(100% - 24px);
  }

  .left-rail,
  .right-rail {
    position: relative;
    inset: auto;
    width: auto;
    margin: 12px;
    max-height: none;
  }

  .right-rail {
    margin-top: 0;
  }

  body[data-mode="management"] .right-rail,
  body[data-mode="communications"] .right-rail {
    display: flex;
  }

  .management-screen {
    position: relative;
    inset: auto;
    width: auto;
    min-height: 720px;
    margin: 0 12px 12px;
  }

  .management-shell {
    height: auto;
    min-height: 720px;
  }

  .management-tabs {
    grid-template-columns: 1fr;
  }

  .management-header-stats,
  .management-status-grid,
  .management-assignment-list,
  .iam-form-grid,
  .iam-relationship-grid,
  .room-editor-grid,
  .room-editor-actions,
  .triple-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --control-h: 44px;
  }

  html,
  body {
    height: 100%;
    overscroll-behavior: none;
  }

  body {
    overflow: hidden;
    touch-action: manipulation;
  }

  .viewer-shell {
    display: block;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
  }

  .map-stage,
  .map,
  .cesium-map,
  .map-fallback {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .topography-control {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    bottom: auto;
    left: 10px;
    width: calc(100vw - 20px);
    min-width: 0;
    max-width: calc(100vw - 20px);
    transform: none;
  }

  .topography-control button {
    min-height: 40px;
    padding: 0 6px;
    font-size: 11px;
  }

  .topography-status {
    top: calc(max(10px, env(safe-area-inset-top)) + 52px);
    right: 10px;
    bottom: auto;
    left: 10px;
    max-width: none;
    transform: none;
  }

  .mobile-mode-dock {
    position: fixed;
    z-index: 1200;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: calc(100vw - 20px);
    min-width: 0;
    max-width: calc(100vw - 20px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    background: rgba(248, 250, 252, 0.94);
    box-shadow: 0 14px 36px rgba(5, 12, 20, 0.28);
    backdrop-filter: blur(18px);
  }

  .mobile-mode-dock .mode-button {
    min-width: 0;
    min-height: 48px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.78);
  }

  .mobile-mode-dock .mode-button span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .left-rail,
  .right-rail,
  .management-screen {
    position: fixed;
    right: 8px;
    left: 8px;
    width: calc(100vw - 16px);
    min-width: 0;
    max-width: calc(100vw - 16px);
    margin: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .left-rail,
  .right-rail {
    gap: 10px;
    padding: 10px;
    border-color: rgba(255, 255, 255, 0.52);
  }

  .left-rail {
    top: calc(max(10px, env(safe-area-inset-top)) + 60px);
    bottom: auto;
    max-height: min(32vh, 260px);
    max-height: min(32dvh, 260px);
  }

  .right-rail {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-height: min(44vh, 380px);
    max-height: min(44dvh, 380px);
  }

  .left-rail .mode-switch {
    display: none;
  }

  .brand-block {
    min-height: 34px;
    margin-top:20px
  }

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

  .panel-block {
    padding: 10px;
  }

  .entity-visual {
    min-height: 96px;
    padding: 14px;
  }

  .entity-visual.has-media,
  .entity-visual.has-media img,
  .entity-visual.has-media video {
    min-height: 128px;
  }

  .entity-visual.has-live-video,
  .live-video-embed {
    min-height: 180px;
  }

  .entity-summary h2 {
    font-size: 18px;
  }

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

  .action-row {
    padding: 10px;
  }

  .entity-list,
  .room-list,
  .management-list {
    gap: 8px;
  }

  .entity-row,
  .room-item,
  .action-button,
  .filter-chip,
  .management-tab {
    min-height: 44px;
  }

  .inline-fields,
  .filter-grid:not(.damage-filter-grid),
  .filter-control-list,
  .dialog-actions,
  .context-menu-actions {
    grid-template-columns: 1fr;
  }

  body[data-mode="command"] .left-rail {
    display: none;
  }

  body[data-mode="command"] .right-rail,
  body[data-mode="create"] .right-rail {
    max-height: min(58vh, 500px);
    max-height: min(58dvh, 500px);
  }

  body[data-mode="management"] .left-rail,
  body[data-mode="management"] .right-rail,
  body[data-mode="communications"] .left-rail,
  body[data-mode="communications"] .right-rail {
    display: none;
  }

  .management-screen {
    top: max(8px, env(safe-area-inset-top));
    bottom: calc(76px + env(safe-area-inset-bottom));
    min-height: 0;
    border-radius: var(--radius);
  }

  .management-shell {
    height: 100%;
    min-height: 0;
    padding: 10px;
  }

  .management-header {
    gap: 10px;
  }

  .management-header h2 {
    font-size: 20px;
  }

  .management-tabs {
    grid-template-columns: 1fr;
    padding-bottom: 2px;
  }

  .management-tab {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .management-module {
    padding: 10px;
  }

  .management-panel {
    padding-bottom: 4px;
  }

  .entity-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .entity-context-menu {
    right: 8px;
    left: 8px !important;
    width: auto;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
  }
}

.geo-layer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.geo-layer-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.geo-layer-status[data-status="loading"] {
  color: #8a5b00;
  background: #fff4cf;
}

.geo-layer-status[data-status="visible"] {
  color: #0c6b45;
  background: #dff7eb;
}

.geo-layer-status[data-status="access-denied"],
.geo-layer-status[data-status="error"],
.geo-layer-error {
  color: #a12d2d;
}
/* Entity creation assistant */
.entity-dialog.entity-editor-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
}

.entity-editor-wizard {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: min(760px, calc(100vh - 48px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  padding: 18px;
}

.entity-wizard-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 14px;
}

.entity-wizard-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}

.entity-wizard-nav button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
}

.entity-wizard-nav button.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid));
  color: var(--ink);
}

.entity-wizard-nav button.complete span,
.entity-wizard-nav button.active span {
  color: #061413;
  background: var(--accent);
}

.entity-wizard-step {
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 12px;
}

.entity-wizard-step[hidden] {
  display: none;
}

.entity-symbol-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.entity-symbol-selection {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.entity-symbol-selection img {
  width: 58px;
  height: 42px;
  object-fit: contain;
}

.entity-symbol-selection > span:not(.entity-symbol-selection-empty) {
  display: grid;
  gap: 3px;
  flex: 1;
}

.entity-symbol-selection small,
.entity-symbol-selection-empty {
  color: var(--muted);
}

.entity-symbol-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
  align-content: start;
  max-height: 470px;
  overflow: auto;
  padding: 4px;
}

.entity-symbol-card {
  display: grid;
  grid-template-rows: 64px auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}

.entity-symbol-card:hover,
.entity-symbol-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--panel-solid));
  transform: translateY(-1px);
}

.entity-symbol-card img {
  width: 86px;
  height: 60px;
  object-fit: contain;
}

.entity-symbol-card span {
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
}

.entity-symbol-empty {
  grid-column: 1 / -1;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.entity-wizard-review {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.entity-review-visual {
  display: grid;
  place-items: center;
  min-height: 120px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-solid));
}

.entity-review-visual img {
  width: 130px;
  height: 100px;
  object-fit: contain;
}

.entity-review-visual svg {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.entity-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.entity-review-grid div {
  min-width: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.entity-review-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.entity-review-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.entity-wizard-actions {
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .entity-editor-wizard {
    min-height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .entity-wizard-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .entity-wizard-nav button {
    display: grid;
    justify-items: center;
    padding: 6px 2px;
    font-size: 0.65rem;
  }

  .entity-symbol-toolbar,
  .entity-review-grid {
    grid-template-columns: 1fr;
  }

  .entity-symbol-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entity-wizard-review {
    grid-template-columns: 1fr;
  }

  .entity-wizard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Integrated entity creation tool: the right rail becomes a single drawing workflow. */
body[data-mode="create"] .right-rail {
  width: min(440px, calc(100vw - 36px));
  border-color: #000000;
}

body[data-mode="create"] .right-rail > .entity-card,
body[data-mode="create"] .right-rail > .panel-block:not(.mode-context) {
  display: none;
}

body[data-mode="create"] .mode-context {
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.creation-tool {
  display: grid;
  gap: 10px;
}

.selected-entity-workspace {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.selected-entity-workspace-heading {
  align-items: end;
  padding: 0 2px;
}

.selected-entity-workspace-heading h2 {
  max-width: 290px;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-entity-section > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.selected-entity-editor-body {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.creation-tool-heading {
  align-items: end;
  padding: 4px 2px 0;
}

.creation-tool-heading h2 {
  margin: 2px 0 0;
}

.creation-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(255, 255, 255, 0.72);
}

.creation-section > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.creation-section > summary::-webkit-details-marker {
  display: none;
}

.creation-tool > .creation-section > summary::after {
  content: "\203A";
  margin-left: auto;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.creation-tool > .creation-section[open] > summary::after {
  transform: rotate(90deg);
}

.creation-section > summary > span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
}

.creation-section-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.creation-search-row,
.creation-fields-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(120px, 0.8fr);
  gap: 8px;
}

.creation-symbol-results {
  max-height: 390px;
  padding: 4px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(30, 30, 30, 0.92);
}

.creation-symbol-accordions,
.creation-symbol-accordion-body,
.creation-symbol-groups {
  display: grid;
  gap: 5px;
}

.creation-symbol-accordion {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(40, 72, 86, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.creation-symbol-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 850;
}

.creation-symbol-accordion > summary::-webkit-details-marker {
  display: none;
}

.creation-symbol-accordion > summary::before {
  content: "›";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1rem;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.creation-symbol-accordion[open] > summary::before {
  transform: rotate(90deg);
}

.creation-symbol-accordion > summary > span {
  min-width: 0;
  flex: 1;
}

.creation-symbol-accordion > summary > small {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(20, 133, 204, 0.09);
  text-align: center;
}

.creation-symbol-accordion.category > summary {
  color: #fff;
  background: #35515e;
}

.creation-symbol-accordion.category > summary::before,
.creation-symbol-accordion.category > summary > small {
  color: #fff;
}

.creation-symbol-accordion.category > summary > small {
  background: rgba(255, 255, 255, 0.16);
}

.creation-symbol-accordion-body {
  padding: 5px;
}

.creation-symbol-accordion.subcategory > summary {
  background: rgba(20, 133, 204, 0.07);
}

.creation-symbol-groups {
  padding: 0 5px 6px;
}

.creation-symbol-group {
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(40, 72, 86, 0.12);
}

.creation-symbol-group:first-child {
  border-top: 0;
}

.creation-symbol-group-heading,
.creation-symbol-search-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.creation-symbol-search-summary {
  justify-content: flex-start;
}

.creation-symbol-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.creation-symbol-card {
  display: grid;
  grid-template-rows: 52px auto;
  gap: 4px;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.creation-symbol-card:hover,
.creation-symbol-card.selected {
  border-color: var(--accent);
  background: rgba(60, 187, 228, 0.18);
}

.creation-symbol-card img {
  width: 100%;
  height: 52px;
  object-fit: contain;
}

.creation-symbol-card span,
.creation-symbol-card small {
  min-width: 0;
  overflow: hidden;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creation-symbol-card span {
  font-size: 0.68rem;
}

.creation-symbol-card small {
  color: var(--muted);
  font-size: 0.58rem;
}

.creation-selection {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(20, 133, 204, 0.34);
  border-radius: 10px;
  background: rgba(60, 187, 228, 0.1);
}

.creation-selection img {
  width: 58px;
  height: 48px;
  object-fit: contain;
}

.creation-selection div,
.creation-selection strong,
.creation-selection small {
  min-width: 0;
}

.creation-selection strong,
.creation-selection small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creation-selection small,
.creation-empty {
  color: var(--muted);
}

.creation-empty {
  margin: 0;
  padding: 12px;
  font-size: 0.82rem;
}

.creation-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 700;
}

.creation-check input {
  width: 17px;
  height: 17px;
}

.creation-status {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(20, 133, 204, 0.08);
  font-size: 0.82rem;
  line-height: 1.35;
}

.creation-status.busy {
  border-left-color: var(--warning);
}

.creation-draw-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creation-draw-actions .creation-start {
  grid-column: 1 / -1;
}

.creation-edit-selected {
  width: 100%;
}

.leaflet-container.xrf-geometry-drawing,
.leaflet-container.xrf-geometry-drawing * {
  cursor: crosshair !important;
}

.leaflet-container.xrf-freehand-drawing {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 720px) {
  .creation-symbol-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .creation-search-row,
  .creation-fields-grid {
    grid-template-columns: 1fr;
  }
}

/* Per-layer presentation editor and vector feature inspection */
.geo-layer-settings-dialog {
  width: min(720px, calc(100vw - 28px));
  max-width: 720px;
}

.geo-layer-settings-form {
  display: grid;
  gap: 14px;
  max-height: min(82vh, 780px);
  overflow: auto;
  padding: 18px;
}

.geo-layer-settings-form .panel-heading h2 {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geo-layer-settings-summary,
.geo-layer-settings-inline-actions,
.geo-layer-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.geo-layer-settings-summary span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.geo-layer-settings-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 117, 111, 0.045);
}

.geo-layer-settings-section h3 {
  margin: 0;
  font-size: 13px;
}

.geo-layer-field-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 5px 10px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.geo-layer-field-option {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  font-size: 12px;
}

.geo-layer-field-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geo-layer-settings-technical {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.geo-layer-settings-technical summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.geo-layer-settings-technical dl,
.geo-feature-popup dl {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 5px 10px;
  margin: 10px 0 0;
  font-size: 12px;
}

.geo-layer-settings-technical dt,
.geo-feature-popup dt {
  color: var(--muted);
  font-weight: 700;
}

.geo-layer-settings-technical dd,
.geo-feature-popup dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.geo-layer-actions {
  display: grid;
  gap: 5px;
}

.geo-layer-primary-actions .geo-content-toggle {
  margin-top: 0;
}

.geo-feature-popup-shell .leaflet-popup-content {
  width: min(480px, calc(100vw - 72px)) !important;
}

.geo-feature-popup dl {
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
}

.geo-feature-popup dd {
  line-height: 1.35;
  word-break: normal;
  white-space: normal;
}

.geo-feature-tooltip {
  max-width: 320px;
}

.geo-feature-tooltip strong,
.geo-feature-tooltip span {
  display: block;
}

.geo-feature-tooltip span {
  margin-top: 3px;
  font-size: 11px;
}

.geo-feature-popup > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .geo-layer-settings-dialog {
    width: calc(100vw - 12px);
  }

  .geo-layer-settings-form {
    max-height: 92vh;
    padding: 12px;
  }

  .geo-layer-field-list {
    grid-template-columns: 1fr;
  }
}

/* Canonical Layer 3 entity characterization */
.selected-entity-characterization-launcher {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(22, 117, 111, 0.09), rgba(255, 255, 255, 0.75));
}

.selected-entity-characterization-launcher strong,
.selected-entity-characterization-launcher .tiny-note {
  display: block;
  margin-top: 4px;
}

.entity-characterization-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-width: 1120px;
}

.entity-characterization-form {
  display: grid;
  gap: 12px;
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: 20px;
}

.entity-characterization-heading h2 {
  max-width: 820px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-characterization-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-characterization-summary span {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-characterization-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 117, 111, 0.045);
  overflow: clip;
}

.entity-characterization-section > summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.entity-characterization-section > summary::-webkit-details-marker { display: none; }
.entity-characterization-section > summary::after { content: "›"; margin-left: auto; transform: rotate(90deg); transition: transform 0.15s ease; }
.entity-characterization-section:not([open]) > summary::after { transform: rotate(0deg); }
.entity-characterization-section > summary small { color: var(--muted); font-size: 11px; font-weight: 600; }

.entity-characterization-section-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.characterization-grid {
  display: grid;
  gap: 10px;
}

.characterization-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.characterization-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.characterization-grid.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.characterization-subsection {
  display: grid;
  gap: 9px;
  padding-top: 4px;
}

.characterization-subsection + .characterization-subsection {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.characterization-subsection h3 { margin: 0; font-size: 13px; }

.characterization-quantity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.45fr);
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.characterization-quantity legend {
  grid-column: 1 / -1;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.characterization-quantity input,
.characterization-quantity select {
  min-width: 0;
  width: 100%;
}

.characterization-repeat-row {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.characterization-repeat-row legend { padding: 0 7px; font-size: 12px; font-weight: 800; }
.characterization-remove-row { position: absolute; top: 6px; right: 6px; }
.characterization-map-edit { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.characterization-map-edit p { flex: 1 1 260px; margin: 0; }

.entity-characterization-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.entity-characterization-status[data-tone="error"] { color: var(--danger); }
.entity-characterization-status[data-tone="ready"] { color: var(--success, #16756f); }
.entity-characterization-advanced textarea { min-height: 320px; font-family: var(--mono); font-size: 12px; }

@media (max-width: 820px) {
  .entity-characterization-dialog { width: calc(100vw - 12px); }
  .entity-characterization-form { max-height: 94vh; padding: 12px; }
  .characterization-grid.two-columns,
  .characterization-grid.three-columns,
  .characterization-grid.four-columns { grid-template-columns: 1fr; }
}

.model3d-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.model3d-scale-control,
.model3d-scale-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--muted, #607087);
  font-size: 0.78rem;
  font-weight: 700;
}

.model3d-scale-control input,
.model3d-scale-inline input {
  width: 7.5rem;
  min-width: 0;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 0.55rem;
  padding: 0.38rem 0.5rem;
  background: #fff;
  color: inherit;
}

.model3d-scale-inline input {
  width: 5.25rem;
}
/* ---------------------------------------------------------------------------
   Chat operativo (ADR-0023). Ventana flotante sobre el mapa: el chat necesita
   alto y una caja de escritura persistente, y el rail derecho no da para eso.
   Los niveles de clasificacion se distinguen por color Y por etiqueta, nunca
   por color solo.
   --------------------------------------------------------------------------- */

.chat-launcher {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 640;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.chat-launcher[hidden] {
  display: none;
}

.chat-launcher:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.chat-launcher-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.chat-layer {
  position: fixed;
  inset: 0;
  z-index: 660;
  display: none;
  pointer-events: none;
}

.chat-layer.is-open {
  display: block;
}

.chat-window {
  position: absolute;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-width: 360px;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.chat-window.is-open {
  display: flex;
}

.chat-window-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: grab;
  touch-action: none;
}

.chat-window-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-window-identity strong {
  font-size: 13px;
}

.chat-stream-status {
  color: var(--muted);
  font-size: 11px;
}

.chat-window-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
}

.chat-transport-select {
  max-width: 190px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: inherit;
  font-size: 11px;
}

/* Aviso del canal de emision: permanente mientras ese transporte este activo,
   no un toast que se va, porque lo que advierte no deja de ser cierto. */
.chat-transport-warning {
  flex: 0 0 auto;
  margin: 8px 12px 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--soft);
  color: inherit;
  font-size: 11.5px;
  line-height: 1.35;
}

/* Capacidad ausente, no fallo transitorio: se distingue del aviso del canal. */
.chat-live-unavailable {
  flex: 0 0 auto;
  margin: 8px 12px 0;
  padding: 6px 9px;
  border: 1px solid var(--warn, var(--line));
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--soft);
  color: inherit;
  font-size: 11.5px;
  line-height: 1.35;
}

.chat-attachment-download {
  border: 1px solid var(--line);
  background: var(--soft);
  color: inherit;
  cursor: pointer;
}

.chat-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-icon-button:hover {
  border-color: var(--line);
  color: var(--ink);
}

.chat-icon-button.chat-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.chat-icon-button i {
  width: 15px;
  height: 15px;
}

.chat-window-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.chat-sidebar {
  display: flex;
  flex: 0 0 178px;
  flex-direction: column;
  min-height: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
  gap: 6px;
}

.chat-sidebar-title {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chat-channel-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  gap: 3px;
}

.chat-channel-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-channel-item:hover {
  background: var(--soft);
}

.chat-channel-item.is-active {
  border-color: var(--accent);
  background: rgba(228, 0, 70, 0.12);
}

.chat-channel-item.is-archived .chat-channel-name {
  color: var(--muted);
  text-decoration: line-through;
}

.chat-channel-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-kind {
  grid-column: 1;
  color: var(--muted);
  font-size: 10.5px;
}

.chat-unread-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
}

.chat-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-channel-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-channel-title {
  font-size: 13px;
}

.chat-channel-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.chat-archived-flag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
}

.chat-classification {
  padding: 1px 5px;
  border: 1px solid currentcolor;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.chat-classification[data-level="UNCLASSIFIED"] {
  color: var(--green);
}

.chat-classification[data-level="RESTRICTED"] {
  color: var(--blue);
}

.chat-classification[data-level="CONFIDENTIAL"] {
  color: var(--amber);
}

.chat-classification[data-level="SECRET"],
.chat-classification[data-level="TOP_SECRET"] {
  color: var(--red);
}

.chat-message-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 12px;
  gap: 8px;
}

.chat-empty {
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.chat-load-more {
  align-self: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  gap: 4px;
}

.chat-message.is-own {
  align-self: flex-end;
  border-color: rgba(228, 0, 70, 0.45);
}

.chat-message.is-redacted .chat-message-body {
  color: var(--muted);
  font-style: italic;
}

.chat-message-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
}

.chat-message-author {
  overflow: hidden;
  max-width: 180px;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message-time {
  color: var(--muted);
}

.chat-message-reply {
  color: var(--muted);
  font-size: 10.5px;
}

.chat-message-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.floating-media-text-viewer {
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem;
  background: #f6f4ee;
  color: #171b1d;
}

.floating-media-text-content,
.floating-media-markdown-content {
  max-width: 76ch;
  margin: 0 auto;
  color: inherit;
  font: 500 0.96rem/1.58 var(--font-body, system-ui, sans-serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.floating-media-text-content {
  font-family: var(--font-mono, ui-monospace, monospace);
}

.floating-media-markdown-content h1,
.floating-media-markdown-content h2,
.floating-media-markdown-content h3 {
  margin: 0.8em 0 0.35em;
  color: #082f36;
  line-height: 1.2;
}

.floating-media-markdown-content p,
.floating-media-markdown-content ul,
.floating-media-markdown-content blockquote,
.floating-media-markdown-content pre {
  margin: 0 0 0.85rem;
}

.floating-media-markdown-content blockquote {
  padding: 0.55rem 0.8rem;
  border-left: 4px solid #087f8c;
  background: rgba(8, 127, 140, 0.08);
}

.floating-media-markdown-content code {
  padding: 0.08rem 0.28rem;
  border-radius: 0.25rem;
  background: rgba(5, 28, 33, 0.1);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.floating-media-markdown-content pre {
  overflow: auto;
  padding: 0.75rem;
  border-radius: 0.4rem;
  background: #132126;
  color: #f3f8f8;
}

.floating-media-markdown-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.floating-media-markdown-content a {
  color: #006c78;
  font-weight: 800;
}

.chat-message-attachments,
.chat-attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chat-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  font-size: 10.5px;
}

.chat-attachment-drop {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.chat-message-actions {
  display: flex;
  gap: 10px;
}

.chat-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  text-decoration: underline;
  cursor: pointer;
}

.chat-link-button:hover {
  color: var(--ink);
}

.chat-link-button.chat-danger:hover {
  color: var(--red);
}

.chat-receipts {
  display: flex;
  flex-direction: column;
  padding: 5px 7px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10.5px;
  gap: 2px;
}

.chat-toast {
  flex: 0 0 auto;
  margin: 8px 12px 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  font-size: 11.5px;
}

.chat-toast[data-tone="error"] {
  border-color: var(--red);
  color: var(--red);
}

/* `display: flex` gana al `display: none` que el navegador aplica por defecto a
   `[hidden]`, asi que los bloques plegables del chat necesitan la regla
   explicita. Sin esto, los formularios de canal aparecian abiertos al arrancar. */
.chat-window [hidden] {
  display: none;
}

.chat-inline-form {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: 6px;
}

.chat-inline-form-title {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chat-inline-input {
  flex: 1 1 110px;
  min-width: 0;
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-solid);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.chat-inline-check {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
}

.chat-inline-submit {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.chat-composer {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  gap: 6px;
}

.chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-composer-input {
  flex: 1 1 auto;
  min-height: 38px;
  max-height: 120px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-solid);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}

.chat-composer-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.chat-level-select {
  height: 30px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-solid);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.chat-send-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.chat-send-button i {
  width: 15px;
  height: 15px;
}

.chat-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(135deg, transparent 50%, var(--line) 50%);
  cursor: nwse-resize;
  touch-action: none;
}
.timeline-row-shell {
  display: grid;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.timeline-row-shell .timeline-row {
  border: 0;
  background: transparent;
}

.timeline-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 5px;
}

.timeline-row-actions .action-button {
  min-height: 32px;
  padding: 5px 9px;
}

.timeline-lifecycle-frozen {
  color: #075985;
  background: #e0f2fe;
}

.timeline-lifecycle-archived {
  color: #6b7280;
  background: #f3f4f6;
}

body.aar-open {
  overflow: hidden;
}

.aar-workspace {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: grid;
  place-items: center;
  padding: 18px;
}

.aar-workspace[hidden] {
  display: none;
}

.aar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 25, 31, 0.64);
  backdrop-filter: blur(3px);
}

.aar-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  width: min(1500px, calc(100vw - 36px));
  height: min(920px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(77, 104, 116, 0.28);
  border-radius: 18px;
  background: #f7fafb;
  box-shadow: 0 28px 80px rgba(5, 22, 28, 0.35);
}

.aar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.aar-header h2 {
  margin: 3px 0 5px;
  font-size: 22px;
}

.aar-header p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.aar-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aar-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.aar-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr) 90px auto auto;
  gap: 9px;
  align-items: end;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(235, 243, 245, 0.92);
}

.aar-filters details {
  position: relative;
  align-self: stretch;
  min-width: 0;
}

.aar-filters summary {
  min-height: 42px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.aar-kind-grid {
  position: absolute;
  z-index: 3;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  width: min(520px, 75vw);
  max-height: 330px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.aar-kind-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  padding: 7px;
  border-radius: 7px;
}

.aar-kind-option:hover {
  background: var(--soft);
}

.aar-kind-option input {
  grid-row: 1 / span 2;
  align-self: center;
}

.aar-kind-option small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.aar-payload-toggle {
  min-height: 42px;
  white-space: nowrap;
}

.aar-error {
  margin: 10px 18px 0;
  padding: 10px 12px;
  border: 1px solid #dc8c8c;
  border-radius: var(--radius);
  color: #7f1d1d;
  background: #fff1f2;
}

.aar-error.warning {
  border-color: #e3b341;
  color: #713f12;
  background: #fffbeb;
}

.aar-error.integrity {
  border-width: 2px;
  border-color: #991b1b;
}

.aar-error p {
  margin: 4px 0 8px;
}

.aar-coverage {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

.aar-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--soft);
}

.aar-metric small {
  color: var(--muted);
}

.aar-warning {
  margin: 8px 0 0;
  color: #92400e;
  font-weight: 700;
}

.aar-coverage-ok {
  margin: 8px 0 0;
  color: #166534;
}

.aar-omissions {
  margin-top: 8px;
  color: #92400e;
}

.aar-omissions ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 5px 0 0;
  padding-left: 18px;
}

.aar-body {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, 0.92fr);
  min-height: 0;
}

.aar-feed,
.aar-detail {
  min-height: 0;
  overflow: auto;
}

.aar-feed {
  padding: 12px 14px 18px;
  border-right: 1px solid var(--line);
}

.aar-feed ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aar-event {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid #64748b;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.aar-event:hover,
.aar-event.selected {
  border-color: var(--accent);
  background: #eef8f7;
}

.aar-category-timeline { border-left-color: #6366f1; }
.aar-category-situation { border-left-color: #0284c7; }
.aar-category-planning { border-left-color: #7c3aed; }
.aar-category-decision { border-left-color: #d97706; }
.aar-category-exercise { border-left-color: #db2777; }
.aar-category-conduct { border-left-color: #059669; }
.aar-category-future { border-left-color: #64748b; }

.aar-event-time,
.aar-sequence {
  color: var(--muted);
  font-size: 11px;
}

.aar-event-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.aar-event-main > span,
.aar-event-main small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aar-load-more {
  width: 100%;
  margin-top: 10px;
}

.aar-detail {
  padding: 16px 18px 24px;
  background: #fff;
}

.aar-detail > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.aar-detail h3 {
  flex: 1 1 260px;
  margin: 0;
  overflow-wrap: anywhere;
}

.aar-category-label {
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.aar-detail section {
  margin-top: 16px;
}

.aar-detail h4 {
  margin: 0 0 7px;
}

.aar-detail-list {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
}

.aar-detail-list > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.36fr) minmax(0, 1fr);
  gap: 10px;
}

.aar-detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.aar-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.aar-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 7px;
  border-radius: 7px;
  background: var(--soft);
}

.aar-reference code {
  overflow: hidden;
  text-overflow: ellipsis;
}

.aar-json {
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  color: #d8f3ed;
  background: #102b32;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.aar-placeholder {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .aar-workspace {
    padding: 8px;
  }

  .aar-shell {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

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

  .aar-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .aar-feed,
  .aar-detail {
    overflow: visible;
  }

  .aar-feed {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .aar-event {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .aar-event .classification-badge,
  .aar-sequence {
    justify-self: start;
  }
}

/* XRF dark interface theme */
body {
  color: var(--ink);
  background: #050505;
  font-family: var(--font-brand);
}

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

.left-rail,
.right-rail,
.management-screen,
.topography-control,
.mobile-mode-dock {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: var(--shadow);
}

.topography-control {
  grid-template-columns: 64px repeat(3, minmax(50px, 1fr)) 38px minmax(190px, 260px);
  width: min(740px, calc(100vw - 778px));
}

.topography-brand {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 34px;
  padding: 0 7px 0 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.topography-brand img {
  display: block;
  width: 56px;
  max-width: 100%;
  height: 20px;
  object-fit: contain;
}

.topography-control .topography-compass {
  border-left-color: rgba(255, 255, 255, 0.16);
}

.topography-control .topography-compass:not(:disabled):hover,
.topography-control .topography-compass:not(:disabled):focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

@media (max-width: 1320px) {
  .topography-control {
    grid-template-columns: 64px repeat(3, minmax(0, 1fr)) 38px;
    width: min(472px, calc(100vw - 36px));
  }

  .map-geocoder {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1060px) {
  .map-geocoder-results {
    top: auto;
    bottom: calc(100% + 9px);
  }
}

.rail-toggle,
.mode-button,
.action-button,
.icon-button,
.filter-chip,
.room-item,
.management-tab,
.timeline-row,
.operation-button,
.context-data-button {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.rail-toggle:hover,
.mode-button:hover,
.action-button:hover,
.icon-button:hover,
.filter-chip:hover,
.room-item:hover,
.management-tab:hover,
.timeline-row:hover,
.operation-button:hover,
.context-data-button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.mode-button.active,
.management-tab.active,
.topography-control button.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--accent);
}

.management-tab-group,
.management-module,
.panel-block,
.entity-card,
.timeline-row-shell,
.status-card,
.management-stat,
.audit-row,
.job-row,
.filter-control,
.entity-summary-section,
.semantic-section,
.creation-symbol-panel,
.creation-symbol-accordion,
.geo-layer-card {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.065);
}

.management-tab-group {
  background: rgba(255, 255, 255, 0.045);
}

.panel-heading h2,
.field span,
.management-tab-group-label,
.panel-micro-heading span {
  color: #c9cdd4;
}

.field input,
.field select,
.field textarea,
input:not([type='checkbox']):not([type='radio']):not([type='range']),
select,
textarea {
  border-color: var(--line);
  color: var(--ink);
  background-color: var(--surface);
}

select option {
  color: var(--ink);
  background: #141414;
}

input::placeholder,
textarea::placeholder {
  color: #777d86;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: rgba(228, 0, 70, 0.72);
  box-shadow: 0 0 0 3px rgba(228, 0, 70, 0.2);
}

.entity-dialog .dialog-content,
.geo-layer-settings-dialog,
.entity-characterization-dialog,
.aar-shell {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.95);
}

.entity-dialog::backdrop,
.geo-layer-settings-dialog::backdrop,
.entity-characterization-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip,
.cesium-summary-overlay,
.cesium-summary-overlay::after {
  color: var(--ink);
  background: rgba(8, 8, 8, 0.95);
}

.cesium-summary-overlay .entity-summary-row {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.aar-header,
.aar-coverage,
.aar-detail,
.aar-filters,
.aar-filters summary,
.aar-kind-grid,
.aar-event {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.95);
}

.aar-event:hover,
.aar-event.selected {
  background: rgba(228, 0, 70, 0.12);
}

.aar-error {
  color: #ffb4bd;
  background: rgba(144, 18, 34, 0.28);
}

.aar-error.warning {
  color: #ffd98f;
  background: rgba(131, 82, 11, 0.3);
}

.aar-warning,
.aar-omissions {
  color: #ffd070;
}

.aar-coverage-ok {
  color: #83e69a;
}

.timeline-lifecycle-frozen {
  color: #9fdcff;
  background: rgba(3, 105, 161, 0.3);
}

.timeline-lifecycle-archived {
  color: #c3c7ce;
  background: rgba(107, 114, 128, 0.28);
}

.audit-time-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.audit-time-filters .field,
.audit-time-filters .action-row,
.audit-time-filters p {
  margin: 0;
}

.audit-time-filters p {
  grid-column: 1 / -1;
}

.audit-time-filters .action-row {
  display: flex;
  flex-wrap: wrap;
}

.audit-time-filters .action-button {
  white-space: nowrap;
}

#managementAuditTimeStatus[data-tone="error"] {
  color: var(--red);
}

@media (max-width: 1000px) {
  .audit-time-filters {
    grid-template-columns: 1fr;
  }
}

.audit-management-grid {
  align-items: start;
}

.audit-list,
.operational-log-list {
  max-height: min(62vh, 720px);
  overflow: auto;
}

.operational-log-module > .tiny-note {
  margin: -2px 0 12px;
}

.operational-log-row {
  border-left: 4px solid var(--red);
}

.operational-log-row.warning {
  border-left-color: var(--amber);
}

.operational-log-row.error {
  border-left-color: var(--red);
}

.operational-log-row p {
  overflow-wrap: anywhere;
}

.count-pill,
.tag-pill {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  background-clip: padding-box;
}

@media (max-width: 720px) {
  .topography-control {
    grid-template-columns: 42px repeat(3, minmax(0, 1fr)) 40px;
    width: calc(100vw - 24px);
  }

  .topography-brand {
    padding: 0 5px 0 2px;
  }

  .topography-brand img {
    width: 36px;
    height: 18px;
  }

  .audit-management-grid {
    grid-template-columns: 1fr;
  }
}


/* Dark contrast completion */
.collapsible-filter-block,
.filter-option-row,
.freshness-filter,
.cesium-performance-filter,
.saved-view-main,
.management-info,
.management-room-status,
.management-room-row,
.room-editor-panel,
.management-plan,
.room-item,
.entity-card,
.media-draft-item,
.metric,
.entity-row,
.logistics-gauge-card,
.media-card,
.dispatch-target,
.operation-button,
.context-data-button,
.entity-summary-row,
.creation-section,
.creation-symbol-accordion,
.geo-layer-settings-summary span,
.geo-layer-field-list,
.entity-characterization-summary span,
.characterization-repeat-row,
.timeline-row-shell,
.aar-event,
.app-session-logout,
.leaflet-bar a,
.leaflet-control-attribution {
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: #141414;
}

.collapsible-filter-block summary,
.collapsible-filter-block summary b,
.filter-option-row,
.toggle-line,
.saved-view-main,
.management-room-main strong,
.management-room-row,
.room-editor-panel,
.management-plan,
.room-item,
.entity-card,
.media-draft-item,
.metric,
.entity-row,
.logistics-gauge-card,
.media-card,
.dispatch-target,
.operation-button,
.context-data-button,
.entity-summary-row,
.creation-section > summary,
.creation-symbol-accordion > summary,
.geo-layer-settings-summary span,
.geo-layer-field-list,
.entity-characterization-summary span,
.characterization-repeat-row,
.timeline-row-shell {
  color: #ffffff;
}

.entity-summary-card,
.entity-summary-card::after {
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  background: #141414;
}

.entity-summary-card > strong,
.entity-summary-card .entity-summary-row b {
  color: #ffffff;
}

.entity-summary-card > em,
.entity-summary-card .entity-summary-row span {
  color: #c9cdd4;
}

.entity-summary-card .entity-summary-row i {
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  background: #000000;
}
.collapsible-filter-block summary b,
.count-pill,
.tag-pill {
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  background: #242424;
}

.collapsible-filter-block[open] summary {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.filter-chip,
.filter-option-row {
  color: #ffffff;
  background: #1a1a1a;
}

.mode-button.active,
.management-tab.active,
.topography-control button.active,
.action-button.primary,
.filter-chip.active,
.iam-row.active,
.timeline-row.active,
.management-room-row.active,
.management-plan.active,
.room-item.active,
.entity-row.active,
.entity-wizard-nav button.active,
.entity-symbol-card.selected,
.creation-symbol-card.selected,
.aar-event.selected {
  border-color: #ffffff;
  color: #ffffff;
  background: #000000;
  box-shadow: none;
}

.mode-button.active svg,
.mode-button.active span,
.management-tab.active svg,
.management-tab.active span,
.topography-control button.active svg,
.topography-control button.active span,
.action-button.primary svg,
.action-button.primary span,
.filter-chip.active,
.timeline-row.active,
.management-room-row.active,
.management-room-row.active svg,
.management-plan.active,
.room-item.active,
.entity-row.active,
.entity-wizard-nav button.active,
.entity-symbol-card.selected,
.creation-symbol-card.selected,
.aar-event.selected {
  color: #ffffff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}


/* Monochrome interactive emphasis */
.freshness-range span,
.entity-wizard-nav button.active span,
.creation-section > summary > span {
  border-color: #ffffff;
  color: #ffffff;
  background: #000000;
}

.management-screen input[type="checkbox"],
.management-screen input[type="radio"],
.management-screen input[type="range"],
.left-rail input[type="checkbox"],
.left-rail input[type="radio"],
.left-rail input[type="range"],
.right-rail input[type="checkbox"],
.right-rail input[type="radio"],
.right-rail input[type="range"] {
  accent-color: #000000;
}

.timeline-row svg,
.management-room-main svg,
.operation-button svg,
.context-menu-actions svg,
.entity-summary-row i,
.eyebrow,
.aar-eyebrow,
.creation-tool > .creation-section > summary::after,
.creation-symbol-accordion > summary::before {
  color: #ffffff;
}

.creation-status {
  border-left-color: #ffffff;
}

.entity-review-visual {
  background: #141414;
}

#managementMediaGatewayStatus[data-tone="success"],
#selectedMediaStatus[data-tone="pending"] {
  color: var(--green);
}

.operational-log-module {
  grid-column: 1 / -1;
}

.operational-log-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 0.8fr)) minmax(220px, 1.4fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.operational-log-filters select,
.operational-log-filters input {
  min-width: 0;
}

.operational-log-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
  min-height: 280px;
}

.operational-log-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.operational-log-row {
  width: 100%;
  color: var(--ink);
  background: #000;
  text-align: left;
  cursor: pointer;
}

.operational-log-row:hover,
.operational-log-row.selected {
  border-color: #fff;
  outline: 1px solid #fff;
}

.operational-log-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.operational-log-detail {
  min-width: 0;
  max-height: min(62vh, 720px);
  padding: 16px;
  overflow: auto;
  color: #fff;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
}

.operational-log-detail h3,
.operational-log-detail h4 {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.operational-log-detail h4 {
  margin-top: 18px;
}

.operational-log-detail-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.35fr) minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
}

.operational-log-detail-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.operational-log-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.operational-log-detail .mini-json {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .operational-log-filters,
  .operational-log-layout {
    grid-template-columns: 1fr;
  }
}

/* Filtro geografico compartido de salas */
.filter-geometry-control {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(230, 239, 239, 0.18);
  border-radius: var(--radius);
  color: #eef4f3;
  background: rgba(9, 17, 20, 0.42);
}

.room-editor-grid .filter-geometry-control {
  grid-column: 1 / -1;
}

.filter-geometry-heading,
.filter-geometry-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.filter-geometry-heading .field-label {
  color: #eef4f3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-geometry-heading .compact-toggle {
  margin: 0;
  color: #f5f8f8;
}

.filter-geometry-summary {
  margin: 0;
  color: #c4cfce;
  overflow-wrap: anywhere;
}

.filter-geometry-summary[data-tone="ok"] {
  color: #86dfc2;
}

.filter-geometry-summary[data-tone="error"] {
  color: #ff9e9e;
}

@media (max-width: 640px) {
  .filter-geometry-heading,
  .filter-geometry-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Structured APP-6D point-symbol selection and editing */
.creation-search-row {
  grid-template-columns: minmax(120px, 0.65fr) minmax(0, 1.35fr) minmax(150px, 0.9fr);
}

.creation-app6-modifiers {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.selected-entity-app6-launcher {
  margin-top: 10px;
}

.app6-symbol-editor-modal {
  width: min(980px, calc(100vw - 28px));
  max-width: 980px;
  max-height: min(92vh, 920px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.95);
  box-shadow: var(--shadow);
}

.app6-symbol-editor-modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.app6-symbol-editor-shell {
  display: grid;
  gap: 14px;
  max-height: min(92vh, 920px);
  padding: 20px;
  overflow: auto;
}

.app6-symbol-editor-header,
.app6-symbol-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app6-symbol-editor-header h2 {
  margin: 3px 0 0;
}

.app6-symbol-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.7fr);
  gap: 14px;
}

.app6-symbol-editor-fields {
  display: grid;
  gap: 10px;
}

.app6-symbol-editor-fields select[size] {
  min-height: 260px;
}

.app6-symbol-editor-preview {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.app6-symbol-editor-preview img {
  width: min(180px, 100%);
  height: 180px;
  object-fit: contain;
}

.app6-symbol-editor-preview code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.app6-symbol-editor-preview dl {
  width: 100%;
  margin: 0;
  text-align: left;
}

.app6-symbol-editor-preview dl div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
}

.app6-symbol-editor-notice {
  margin: 0;
  color: var(--muted);
}

.app6-symbol-editor-actions {
  justify-content: flex-end;
}

.app6-symbol-editor-actions .primary {
  min-width: 160px;
}

@media (max-width: 760px) {
  .creation-search-row,
  .app6-symbol-editor-layout {
    grid-template-columns: 1fr;
  }

  .app6-symbol-editor-preview img {
    width: 132px;
    height: 132px;
  }
}

.entity-marker.app6-neutral-fallback {
  border-style: dashed;
  background: #56616d;
}

.app6-neutral-fallback-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  max-width: 220px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 5px;
  color: #ffffff;
  background: rgba(8, 8, 8, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.cesium-summary-overlay.neutral-fallback.compact {
  gap: 3px;
  width: auto;
  min-width: 150px;
  max-width: min(260px, calc(100vw - 36px));
  padding: 6px 8px;
  border-color: rgba(255, 255, 255, 0.48);
  border-style: dashed;
  color: #ffffff;
  background: rgba(8, 8, 8, 0.95);
  transform: translate(-50%, calc(-100% - 18px));
}

.cesium-summary-overlay.neutral-fallback.compact::after {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(8, 8, 8, 0.95);
}

.cesium-summary-overlay.neutral-fallback .app6-fallback-note {
  color: #d9e0e6;
  font-size: 10px;
  font-weight: 700;
}

.iam-entity-link {
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line, #334155);
}
.iam-entity-link h3 { margin: 0 0 10px; font-size: 14px; }
.iam-selected-entity { display: grid; gap: 4px; margin-bottom: 12px; }
.iam-selected-entity code, #managementIamEntityLinkResult { overflow-wrap: anywhere; white-space: pre-wrap; }

/* Trazas de entidades (buffer local) */
.trails-content { display: grid; gap: 10px; padding: 10px 12px 12px; }
.trail-legend { display: grid; gap: 4px; }
.trail-legend:empty { display: none; }
.trail-legend-bar { height: 10px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.35); }
.trail-legend-labels { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.8; }
.map-trail-label { width: max-content !important; height: auto !important; margin: 0 !important; border: 0 !important; background: transparent !important; }
.map-trail-label span { display: block; padding: 2px 5px; border-radius: 5px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.45); white-space: nowrap; }
.map-trail-label.is-start span { opacity: 0.75; }
.map-trail-tooltip { font-size: 11px; }

/* Nombre de entidad junto al tag APP-6 (Admin -> Representacion) */
.app6-marker-name {
  position: absolute;
  left: calc(100% + 3px);
  bottom: 0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 11px/1.15 "Segoe UI", system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 0 3px #000, 0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* Incidentes (Event): rojos, mas grandes, con halo que late y por encima del resto.
   Demo de video 2026-10-05: el "!" gris se confundia con las personas de al lado.
   El color se repite en EVENT_MARKER_STYLE (map-entity-markers.js) para los circleMarker. */
:root {
  --entity-event-color: #e11d48;
  /* Halo: --entity-event-accent llega inline desde el divIcon (rojo o color canonico). */
  --entity-event-accent: #56616d;
  --entity-event-size: 44px; /* por defecto; el divIcon lo fija desde EVENT_MARKER_STYLE.iconPx */
}

.entity-marker.entity-event {
  width: var(--entity-event-size);
  height: var(--entity-event-size);
  font-size: 18px;
  border-color: #ffffff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--entity-event-accent) 35%, transparent), 0 0 18px color-mix(in srgb, var(--entity-event-accent) 85%, transparent);
  animation: entity-event-pulse 1.6s ease-out infinite;
  z-index: 3;
}

/* Rojo solo si el Event no trae afiliacion ni dano canonicos (ver eventUsesDefaultColor). */
.entity-marker.entity-event.entity-event-default {
  background: var(--entity-event-color);
}

.app6-entity-marker.entity-event {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--entity-event-accent) 95%, transparent)) drop-shadow(0 0 2px #ffffff);
  animation: entity-event-pulse 1.6s ease-out infinite;
}

@keyframes entity-event-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--entity-event-accent) 70%, transparent), 0 0 18px color-mix(in srgb, var(--entity-event-accent) 85%, transparent); }
  70% { box-shadow: 0 0 0 16px transparent, 0 0 18px color-mix(in srgb, var(--entity-event-accent) 85%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 18px color-mix(in srgb, var(--entity-event-accent) 85%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .entity-marker.entity-event,
  .app6-entity-marker.entity-event {
    animation: none;
  }
}

.leaflet-tooltip.entity-tooltip-event {
  background: var(--entity-event-color);
  border-color: var(--entity-event-color);
  color: #ffffff;
  font-weight: 700;
}

.leaflet-tooltip-top.entity-tooltip-event::before {
  border-top-color: var(--entity-event-color);
}

/* ---------------------------------------------------------------------------
   Ordenes por texto o voz (docs/NATURAL_LANGUAGE_COMMANDS_PLAN.md). El unico
   boton de hablar vive en el buscador superior; mientras escucha, el texto de
   ayuda del buscador muestra lo que se oye. El detalle solo aparece cuando una
   orden no se entiende o no se resuelve, en la ventana flotante compartida
   (.floating-window-commands), como multimedia y el localizador.
   --------------------------------------------------------------------------- */

.map-geocoder {
  grid-template-columns: 28px minmax(0, 1fr) 30px 30px;
}

.topography-control .map-geocoder-clear {
  grid-column: 3;
}

.topography-control .map-geocoder-command {
  grid-column: 4;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 5px;
  color: var(--muted);
}

.topography-control .map-geocoder-command:hover,
.topography-control .map-geocoder-command:focus-visible,
.topography-control .map-geocoder-command[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.topography-control .map-geocoder-command.listening {
  color: #fff;
  background: var(--red);
  animation: map-command-pulse 0.9s ease-in-out infinite alternate;
}

.topography-control .map-geocoder-command.busy {
  color: #fff;
  background: rgba(20, 184, 166, 0.35);
}

.map-geocoder input.voice-status::placeholder {
  color: #fff;
  font-style: italic;
  opacity: 1;
}

.topography-control .map-geocoder-command[hidden],
.map-command-panel[hidden] {
  display: none;
}

.floating-window-commands .floating-window-content {
  background: #0a1014;
}

.map-command-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 12px;
  color: var(--ink);
  background: #0a1014;
}

.map-command-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.map-command-panel button svg {
  width: 16px;
  height: 16px;
}

.map-command-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-columns: 34px;
  grid-auto-flow: column;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.map-command-form:focus-within {
  border-color: rgba(20, 184, 166, 0.78);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.map-command-form input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.map-command-form input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.map-command-panel .map-command-submit {
  width: 34px;
  height: 32px;
  padding: 0;
  color: var(--muted);
}

.map-command-panel .map-command-submit:hover,
.map-command-panel .map-command-submit:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.map-command-panel.busy .map-command-form {
  opacity: 0.7;
}

.map-command-feedback {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  font-size: 12px;
}

.map-command-feedback:empty {
  display: none;
}

.map-command-status,
.map-command-message,
.map-command-transcript,
.map-command-hint,
.map-command-voice-notice {
  margin: 0;
}

.map-command-status,
.map-command-message {
  color: #fff;
}

.map-command-status {
  font-weight: 750;
}

.map-command-voice-notice {
  padding: 6px 8px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  background: rgba(246, 185, 77, 0.08);
  font-size: 11px;
}

.map-command-transcript {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-style: italic;
}

.map-command-transcript svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.map-command-report {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.map-command-report.error {
  border-left-color: var(--red);
}

.map-command-report.choice {
  border-left-color: var(--amber);
}

.map-command-report.error .map-command-message {
  color: #ff9ca5;
}

.map-command-report-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.map-command-report-header strong {
  margin-right: 2px;
  font-size: 12px;
}

.map-command-chip {
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.map-command-notes {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 11px;
}

.map-command-candidates,
.map-command-examples {
  display: grid;
  gap: 4px;
}

.map-command-group-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.map-command-panel .map-command-candidate,
.map-command-panel .map-command-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  justify-items: start;
  gap: 2px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  text-align: left;
}

.map-command-panel .map-command-candidate span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.map-command-panel .map-command-candidate:hover,
.map-command-panel .map-command-candidate:focus-visible,
.map-command-panel .map-command-example:hover,
.map-command-panel .map-command-example:focus-visible {
  color: #fff;
  background: rgba(20, 184, 166, 0.2);
}

.map-command-hint {
  color: var(--muted);
  font-size: 11px;
}

.map-command-panel .map-command-undo {
  justify-self: start;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

@keyframes map-command-pulse {
  from { box-shadow: 0 0 0 0 rgba(255, 92, 108, 0.55); }
  to { box-shadow: 0 0 0 6px rgba(255, 92, 108, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .topography-control .map-geocoder-command.listening {
    animation: none;
  }
}
.geometry-altitude-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(85vh, 900px);
  overflow: auto;
}

.geometry-altitude-form {
  display: grid;
  gap: 14px;
}

.geometry-altitude-vertices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  max-height: 45vh;
  overflow: auto;
}

.geometry-altitude-uniform {
  align-items: end;
}

#newAltitudeField[hidden] {
  display: none;
}

#newAltitudeControl[hidden] {
  display: none;
}

#geometryAltitudeError[hidden] {
  display: none;
}
.dispatch-drafts fieldset { border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.dispatch-drafts pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 26rem; overflow: auto; font-size: .8rem; }
.dispatch-drafts textarea { width: 100%; box-sizing: border-box; }
.dispatch-drafts .alert-section-body > button { margin: 4px 4px 4px 0; }
