.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 570px;
  background: var(--c-brand);
}
.rho-map {
  position: relative;
  /* As camadas e marcadores do mapa têm z-index próprios; isolar mantém tudo abaixo do cabeçalho fixo. */
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 25%, rgba(206, 46, 55, 0.16), transparent 22%),
    linear-gradient(135deg, #172f3d, #071421 70%);
}
.map-node {
  position: absolute;
  z-index: 3;
  border: 0;
  background: none;
  color: #fff;
  transform: translate(-50%, -50%);
  font: 700 11px var(--font-label);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-node i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #75a8ba;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(117, 168, 186, 0.2);
}
.map-node.warning i {
  background: #d58e3c;
}
.map-node.critical i {
  background: var(--c-accent);
  animation: pulse 2s infinite;
}
.map-node.border i {
  background: #756e9b;
}
.map-node span {
  background: rgba(7, 20, 33, 0.85);
  padding: 6px 8px;
  white-space: nowrap;
}
.map-detail {
  background: #102535;
  color: #fff;
  padding: 40px 30px;
}
.map-disclaimer {
  color: var(--c-muted);
  font: italic 12px var(--font-serif);
}
@media (max-width: 840px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
  .map-layout {
    min-height: 760px;
  }
  .rho-map {
    min-height: 470px;
  }
}
@media (max-width: 520px) {
  .map-layout {
    min-height: 680px;
  }
  .rho-map {
    min-height: 430px;
  }
  .map-node span {
    font-size: 9px;
  }
}
.map-node:focus-visible {
  outline: 3px solid #d71932;
  outline-offset: 4px;
}
@media (max-width: 520px) {
  .map-node span {
    max-width: 85px;
    white-space: normal;
  }
}
.map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}
.map-svg [data-action] {
  pointer-events: stroke;
}
.map-zone {
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 0.25s,
    stroke-width 0.25s;
}
.map-zone.critical {
  fill: rgba(215, 25, 50, 0.36);
  stroke: rgba(255, 119, 122, 0.75);
  animation: map-breathe 3.6s ease-in-out infinite;
}
.map-zone.warning {
  fill: rgba(213, 142, 60, 0.28);
  stroke: rgba(245, 182, 87, 0.7);
}
.map-zone.residual {
  fill: rgba(117, 168, 186, 0.2);
  stroke: rgba(144, 203, 219, 0.65);
}
.map-zone:hover,
.map-zone:focus {
  stroke: #fff;
  stroke-width: 1;
  outline: none;
}
.map-nodes,
.map-operations {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.map-node,
.map-operation {
  pointer-events: auto;
}
.map-operation {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  background: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 10px var(--font-label);
  letter-spacing: 0.04em;
}
.map-operation i {
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #6fc2a5;
  box-shadow: 0 0 0 5px rgba(111, 194, 165, 0.17);
}
.map-operation.unknown i {
  background: #ed5961;
  box-shadow: 0 0 0 5px rgba(237, 89, 97, 0.2);
  animation: map-pulse 1.8s infinite;
}
.map-operation.paused i {
  background: #8c9aa0;
}
.map-operation span {
  background: rgba(7, 20, 33, 0.88);
  padding: 5px 6px;
  white-space: nowrap;
}
.map-operation:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
.map-detail-note {
  display: block;
  color: #8fa4ad;
  font: 400 12px/1.45 var(--font-serif);
  margin-top: 20px;
}
.layer-fog-off #mapZones {
  opacity: 0;
}
.layer-routes-off #mapRoutes {
  opacity: 0;
}
.layer-operations-off .map-operations {
  opacity: 0;
}
.map-motion-paused .map-zone,
.map-motion-paused .map-operation i {
  animation-play-state: paused !important;
}
@keyframes map-breathe {
  50% {
    opacity: 0.64;
    transform: scale(1.04);
  }
}
@keyframes map-dash {
  to {
    stroke-dashoffset: -12;
  }
}
@keyframes map-pulse {
  50% {
    box-shadow: 0 0 0 10px rgba(237, 89, 97, 0.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  .map-zone,
  .map-operation i {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 520px) {
  .map-operation span {
    font-size: 9px;
    max-width: 100px;
    white-space: normal;
    text-align: left;
  }
}
.real-map-ready .map-svg,
.real-map-ready .map-operations,
.real-map-ready .map-nodes {
  display: none;
}
.map-area:focus {
  outline: none;
  stroke: #fff;
  stroke-width: 1;
}
.layer-areas-off #mapAreas {
  opacity: 0;
}
.map-catalog-wrap {
  margin-top: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  padding: 20px;
}
.map-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-line);
  font: 600 11px var(--font-label);
  color: var(--c-muted);
  text-transform: uppercase;
}
.map-legend strong {
  color: var(--c-ink);
  letter-spacing: 0.09em;
  margin-right: 5px;
}
.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  background: #6b9cac;
}
.legend-swatch.phenomenon {
  background: #ff3b4e;
}
.legend-swatch.security {
  background: #f2a33a;
}
.legend-swatch.infrastructure {
  background: #8fd3e6;
}
.legend-swatch.community {
  background: #6f97a8;
}
.legend-swatch.investigation {
  background: #d6e4ea;
}
.legend-swatch.impact,
.legend-impact {
  background: #d71932;
}
.legend-impact {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  margin-right: 4px;
}
.map-catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 20px 0 12px;
}
.map-catalog-head h2 {
  font: 700 26px var(--font-label);
  margin: 4px 0 0;
}
.map-catalog-head p {
  margin: 0;
  color: var(--c-muted);
  font: 400 14px var(--font-serif);
}
.map-catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.map-catalog-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--c-line);
  background: var(--c-bg);
  color: var(--c-ink);
  text-align: left;
  padding: 11px;
  min-width: 0;
}
.map-catalog-item:hover,
.map-catalog-item[data-map-selected='true'] {
  border-color: var(--c-accent);
  background: #fff;
}
.map-catalog-item span {
  min-width: 0;
  flex: 1;
}
.map-catalog-item strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 700 14px var(--font-label);
}
.map-catalog-item small {
  display: block;
  margin-top: 3px;
  color: var(--c-muted);
  font: 500 10px var(--font-label);
  text-transform: uppercase;
}
.map-catalog-item > b {
  color: var(--c-accent-text);
}
.map-related {
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 15px;
}
.map-related > strong {
  display: block;
  color: #f25a63;
  font: 700 10px var(--font-label);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.map-related button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  background: none;
  color: #fff;
  text-align: left;
  padding: 9px 0;
  font: 600 15px var(--font-label);
}
.map-related button:hover {
  color: #ff8b91;
}
.map-related button span {
  display: block;
  color: #8fa4ad;
  font-size: 9px;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
@media (max-width: 840px) {
  .map-catalog {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-catalog-head {
    display: block;
  }
  .map-catalog-head p {
    margin-top: 7px;
  }
}
@media (max-width: 520px) {
  .map-catalog {
    grid-template-columns: 1fr;
  }
}
.map-catalog-item[data-map-selected='true'] {
  border-color: var(--c-accent);
  background: #fff;
}
.map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.map-tools .btn {
  min-height: 36px;
}

.btn-plain {
  border-color: transparent;
  background: none;
  color: var(--c-ink-2);
}

.btn-plain:hover {
  border-color: var(--c-line);
  color: var(--c-ink);
}

.map-tools-secondary .btn[aria-pressed] {
  background: none;
  border-color: transparent;
  color: var(--c-ink-2);
}

.map-tools-secondary .btn[aria-pressed]:hover {
  border-color: var(--c-line);
}

.map-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  color: var(--c-muted);
  font-size: var(--fs-sm);
}

.map-filter-row label {
  color: var(--c-ink);
  font: 700 var(--fs-xs) / 1 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-filter-row select {
  min-height: 36px;
  padding: 0 var(--s-6) 0 var(--s-3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366717b' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  appearance: none;
  font: 600 var(--fs-sm) / 1 var(--font-sans);
}

#mapFilterSummary {
  margin-left: auto;
}

.map-catalog-head h2 {
  font: 600 var(--fs-2xl) / 1.15 var(--font-serif);
}

.map-catalog-item strong {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 640px) {
  #mapFilterSummary {
    flex-basis: 100%;
    margin-left: 0;
  }
}

/* Camadas: ligada tem borda e bolinha acesa; desligada fica apagada. */
.map-tools[role='toolbar'] .btn {
  gap: var(--s-2);
  background: var(--c-surface);
  border-color: var(--c-ink);
  color: var(--c-ink);
}

.map-tools[role='toolbar'] .btn::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
}

.map-tools[role='toolbar'] .btn[aria-pressed='false'] {
  border-color: var(--c-line);
  color: var(--c-muted);
}

.map-tools[role='toolbar'] .btn[aria-pressed='false']::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

/* ===== Mapa 3D ===== */
.map-layout {
  min-height: 640px;
}

.map-canvas {
  position: absolute;
  inset: 0;
}

/* O desenho esquemático só aparece quando o 3D não pode ser aberto. */
.rho-map:not(.map-fallback) :is(.map-svg, .map-operations, .map-nodes),
.map-fallback .map-canvas,
.map-fallback .map3d-controls {
  display: none;
}

.map-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  color: rgb(214 232 240 / 0.85);
  font:
    500 11px / 1.3 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid rgb(214 232 240 / 0.55);
}

.hud-corner.tl {
  top: 10px;
  left: 10px;
  border-width: 2px 0 0 2px;
}

.hud-corner.tr {
  top: 10px;
  right: 10px;
  border-width: 2px 2px 0 0;
}

.hud-corner.bl {
  bottom: 10px;
  left: 10px;
  border-width: 0 0 2px 2px;
}

.hud-corner.br {
  bottom: 10px;
  right: 10px;
  border-width: 0 2px 2px 0;
}

.hud-top,
.hud-bottom {
  position: absolute;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.8);
}

.hud-top {
  top: 18px;
  padding-right: 64px;
}

.hud-bottom {
  bottom: 18px;
  right: auto;
  justify-content: flex-start;
  gap: var(--s-5);
}

.hud-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.hud-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b4e;
  animation: pulse 2s infinite;
}

.hud-compass {
  position: absolute;
  top: 44px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgb(214 232 240 / 0.45);
  border-radius: 50%;
  background: rgb(5 14 21 / 0.55);
}

#hudCompass {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transition: transform 0.1s linear;
}

#hudCompass::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  border: 5px solid transparent;
  border-bottom: 9px solid #ff3b4e;
  border-top: 0;
  transform: translateX(-50%);
}

#hudCompass b {
  margin-top: 8px;
  color: #fff;
  font-size: 11px;
}

/* Linhas de varredura e escurecimento nas bordas, como num monitor de sala de controle. */
.hud-scan {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.022) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgb(2 8 12 / 0.55) 100%);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Marcadores: losango para setores, ponto pulsante para operações, mira para o impacto. */
/* Sem position aqui: o MapLibre posiciona o marcador com position absolute. */
.map3d-pin {
  --pin: #9fb7c4;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.map3d-pin i {
  width: 12px;
  height: 12px;
  border: 2px solid var(--pin);
  background: #06111a;
  box-shadow: 0 0 12px color-mix(in srgb, var(--pin) 60%, transparent);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
}

.map3d-pin.operation i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pin);
  transform: none;
  animation: pin-ring 2.4s infinite;
}

.map3d-pin.impact {
  --pin: #ff3b4e;
  width: 34px;
  height: 34px;
}

.map3d-pin.impact i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 2px, #ff3b4e 3px 100%);
  transform: none;
}

.map3d-pin.impact::before,
.map3d-pin.impact::after {
  content: '';
  position: absolute;
  background: #ff3b4e;
}

.map3d-pin.impact::before {
  width: 34px;
  height: 1px;
}

.map3d-pin.impact::after {
  width: 1px;
  height: 34px;
}

.map3d-pin.support,
.map3d-pin.controlled {
  --pin: #8fd3e6;
}

.map3d-pin.warning {
  --pin: #f2a33a;
}

.map3d-pin.critical,
.map3d-pin.active {
  --pin: #ff3b4e;
}

.map3d-pin.border,
.map3d-pin.unknown {
  --pin: #f2a33a;
}

.map3d-pin.paused {
  --pin: #7c8f9a;
}

.map3d-pin span {
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  padding: 4px 7px;
  border-left: 2px solid var(--pin);
  background: rgb(5 14 21 / 0.9);
  color: #e7f1f5;
  font:
    600 11px / 1 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.map3d-pin:hover span,
.map3d-pin:focus-visible span,
.map3d-pin.is-selected span,
.map3d-pin.impact span {
  opacity: 1;
  transform: translate(0, -50%);
}

.map3d-pin:hover i,
.map3d-pin.is-selected i {
  transform: rotate(45deg) scale(1.35);
}

.map3d-pin.operation:hover i,
.map3d-pin.operation.is-selected i,
.map3d-pin.impact:hover i,
.map3d-pin.impact.is-selected i {
  transform: scale(1.35);
}

@keyframes pin-ring {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--pin) 70%, transparent);
  }
  80%,
  100% {
    box-shadow: 0 0 0 12px transparent;
  }
}

.map-motion-paused .map3d-pin i,
.map-motion-paused .hud-live i {
  animation: none;
}

.hide-operations .map3d-pin.operation,
.hide-impact .map3d-pin.impact {
  display: none;
}

.map3d-controls {
  position: absolute;
  right: 18px;
  bottom: 52px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map3d-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid rgb(214 232 240 / 0.2);
  background: rgb(6 16 24 / 0.85);
  color: #e7f1f5;
  font:
    600 14px / 1 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  backdrop-filter: blur(4px);
  transition: border-color 0.15s;
}

.map3d-controls button:hover {
  border-color: #ff3b4e;
}

.maplibregl-ctrl-attrib {
  background: rgb(5 14 21 / 0.75) !important;
  color: #8aa3b2;
  font-size: 10px;
}

.maplibregl-ctrl-attrib a {
  color: #b9cbd5;
}

.maplibregl-ctrl-attrib-button {
  filter: invert(1);
}

.map-detail {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  background: #0a1822;
  border-left: 1px solid rgb(214 232 240 / 0.08);
  padding: var(--s-6) var(--s-5);
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  color: #ff6b7a;
  font:
    600 11px / 1.3 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-head code {
  padding: 3px 6px;
  border: 1px solid rgb(214 232 240 / 0.2);
  color: #9fb7c4;
  font: inherit;
}

.map-detail h2 {
  min-height: 1.1em;
  font: 600 var(--fs-3xl) / 1.1 var(--font-serif);
  color: #fff;
}

.detail-typed::after {
  content: '▍';
  margin-left: 2px;
  color: #ff3b4e;
  animation: blink 0.9s steps(1) infinite;
}

.detail-coords {
  color: #7fc8dd;
  font:
    500 12px / 1.3 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
}

.detail-text {
  color: #b5c5cc;
  font: 400 var(--fs-md) / 1.6 var(--font-serif);
}

.map-detail .map-detail-note {
  color: #7c8f9a;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

@media (max-width: 840px) {
  .map-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rho-map {
    height: min(70vh, 560px);
    min-height: 420px;
  }

  .map-detail {
    border-left: 0;
  }

  #hudPitch {
    display: none;
  }
}

.pin-beam {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 3px;
  height: 240px;
  background: linear-gradient(to top, #ff3b4e, rgb(255 59 78 / 0.35) 60%, transparent);
  box-shadow: 0 0 14px 3px rgb(255 59 78 / 0.45);
  pointer-events: none;
  transform: translateX(-50%);
}

.is-flat .pin-beam {
  display: none;
}

@media (max-width: 640px) {
  #hudClock {
    display: none;
  }

  .hud-top {
    padding-right: 0;
  }
}

/* ===== Tela de conexão ===== */
.map-boot {
  --boot-ice: #9fd8e8;
  --boot-dim: rgb(159 216 232 / 0.45);
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  padding: 18px;
  cursor: pointer;
  color: var(--boot-ice);
  font:
    500 12px / 1.4 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Planta técnica: grade fina, grade grossa, anéis de radar e brilho central. */
  background:
    radial-gradient(circle at 30% 45%, rgb(255 59 78 / 0.1), transparent 34%),
    repeating-radial-gradient(circle at 30% 45%, transparent 0 58px, rgb(159 216 232 / 0.06) 58px 59px),
    linear-gradient(rgb(159 216 232 / 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgb(159 216 232 / 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgb(159 216 232 / 0.09) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgb(159 216 232 / 0.09) 1px, transparent 1px) 0 0 / 120px 120px,
    #050c12;
  transition: opacity 0.7s var(--ease);
}

.map-boot::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.03) 0 1px, transparent 1px 3px),
    linear-gradient(transparent 0, rgb(159 216 232 / 0.08) 50%, transparent 100%) 0 -100% / 100% 30% no-repeat;
  animation: boot-sweep 3.2s linear infinite;
}

@keyframes boot-sweep {
  to {
    background-position:
      0 0,
      0 260%;
  }
}

.map-boot.is-leaving {
  opacity: 0;
}

.boot-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 14px;
  border: 1px solid var(--boot-dim);
  padding: 16px 20px;
  overflow: hidden;
}

.boot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--boot-dim);
  color: var(--boot-dim);
  font-size: 11px;
}

.boot-head b {
  color: #fff;
}

.boot-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 36px;
}

.boot-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 170px;
  aspect-ratio: 1;
}

.boot-emblem b {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 3px solid #fff;
  color: #fff;
  font: 700 38px / 1 var(--font-label);
  letter-spacing: -0.04em;
}

.boot-ring {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 2px dashed rgb(255 59 78 / 0.7);
  animation: spin 9s linear infinite;
}

.boot-ring.outer {
  inset: 0;
  border: 1px solid transparent;
  background: conic-gradient(from 0deg, rgb(159 216 232 / 0.55), transparent 25%) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 2.4s linear infinite;
}

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

.boot-title {
  margin-bottom: 14px;
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.18em;
}

.boot-title::after {
  content: '_';
  animation: blink 0.8s steps(1) infinite;
}

.boot-steps {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
}

.boot-steps li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--boot-dim);
}

.boot-dots {
  flex: 1;
  border-bottom: 1px dotted rgb(159 216 232 / 0.3);
  transform: translateY(-3px);
}

.boot-state {
  min-width: 112px;
  text-align: right;
  animation: blink 1s steps(1) infinite;
}

.boot-steps li.is-done {
  color: var(--boot-ice);
  animation: step-in 0.35s var(--ease);
}

.boot-steps li.is-done .boot-state {
  color: #57e0b5;
  animation: none;
}

.boot-steps li.is-failed .boot-state {
  color: #ff5b6b;
  animation: none;
}

@keyframes step-in {
  from {
    opacity: 0.2;
    transform: translateX(-6px);
  }
}

.boot-bar {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
}

.boot-bar i {
  height: 10px;
  background: rgb(159 216 232 / 0.12);
  transition: background 0.25s;
}

.boot-bar i.on {
  background: var(--boot-ice);
  box-shadow: 0 0 8px rgb(159 216 232 / 0.5);
}

.boot-memo {
  max-width: 640px;
  padding: 10px 14px;
  border-left: 3px solid #ff3b4e;
  background: rgb(159 216 232 / 0.05);
}

.boot-memo span {
  color: #ff6b7a;
  font-size: 11px;
}

.boot-memo p {
  margin-block: 6px;
  color: #dcecf2;
  text-transform: none;
  letter-spacing: 0.02em;
}

.boot-memo small {
  color: var(--boot-dim);
  font-size: 10px;
}

.boot-ticker {
  overflow: hidden;
  border-top: 1px solid var(--boot-dim);
  padding-top: 8px;
  white-space: nowrap;
  color: var(--boot-dim);
  font-size: 11px;
}

.boot-ticker div {
  display: inline-flex;
  gap: 18px;
  animation: ticker 40s linear infinite;
}

.boot-ticker i {
  color: #ff3b4e;
  font-style: normal;
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

.boot-granted {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 12px 26px;
  border: 2px solid #57e0b5;
  background: rgb(5 12 18 / 0.92);
  color: #57e0b5;
  font-size: 22px;
  letter-spacing: 0.4em;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.3);
}

.map-boot.is-granted .boot-granted {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity 0.25s,
    transform 0.35s var(--ease);
}

.boot-quick {
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  letter-spacing: 0.3em;
}

.boot-quick span::after {
  content: '_';
  animation: blink 0.8s steps(1) infinite;
}

.boot-quick strong {
  color: #57e0b5;
  opacity: 0;
}

.map-boot.is-granted .boot-quick strong {
  opacity: 1;
}

.map-boot.is-granted .boot-quick span {
  display: none;
}

/* ===== Trava de alvo ===== */
/* Sem position nem transform aqui: o MapLibre posiciona o marcador por eles. */
.map3d-reticle {
  width: 64px;
  height: 64px;
  pointer-events: none;
}

.reticle-box {
  position: absolute;
  inset: 0;
  animation: lock-in 0.9s var(--ease) both;
}

.reticle-box i {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid #fff;
}

.reticle-box i:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.reticle-box i:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 2px 2px 0 0;
}

.reticle-box i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-width: 0 0 2px 2px;
}

.reticle-box i:nth-child(4) {
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0;
}

.map3d-reticle span {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  padding: 3px 7px;
  background: rgb(5 14 21 / 0.88);
  color: #fff;
  font:
    600 10px / 1 ui-monospace,
    'Cascadia Mono',
    Consolas,
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

@keyframes lock-in {
  0% {
    opacity: 0;
    transform: scale(2.6) rotate(45deg);
  }
  60% {
    opacity: 1;
    transform: scale(0.9) rotate(0deg);
  }
  100% {
    transform: scale(1);
  }
}

.is-satellite .hud-scan {
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.035) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 50%, rgb(2 8 12 / 0.6) 100%);
}

@media (max-width: 720px) {
  .boot-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .boot-emblem {
    width: 110px;
  }

  .boot-emblem b {
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  .boot-head span:last-child,
  .boot-memo {
    display: none;
  }

  .boot-state {
    min-width: 0;
  }

  .boot-granted {
    font-size: 15px;
    letter-spacing: 0.25em;
  }
}
