/* ================================================================== */
/* Atlas Studio V6.9 — Superpoderes GIS Pro, Astronomía y STEM        */
/* ================================================================== */

/* Graticula astronómica enriquecida */
.graticule-special {
  fill: none;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.graticule-equator {
  stroke: rgba(251, 191, 36, 0.52);
  stroke-width: 1.25px;
  stroke-dasharray: 6 3;
}
.graticule-tropic {
  stroke: rgba(245, 158, 11, 0.36);
  stroke-width: 0.95px;
  stroke-dasharray: 4 4;
}
.graticule-polar {
  stroke: rgba(56, 189, 248, 0.38);
  stroke-width: 0.95px;
  stroke-dasharray: 3 4;
}
.graticule-label {
  fill: rgba(253, 230, 138, 0.78);
  font: 700 8.5px "Manrope", "DM Sans", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  paint-order: stroke;
  stroke: rgba(4, 13, 21, 0.88);
  stroke-width: 2.6px;
  pointer-events: none;
}
svg[data-tone="light"] .graticule-equator { stroke: rgba(180, 83, 9, 0.55); }
svg[data-tone="light"] .graticule-tropic { stroke: rgba(180, 83, 9, 0.38); }
svg[data-tone="light"] .graticule-polar { stroke: rgba(3, 105, 161, 0.42); }
svg[data-tone="light"] .graticule-label {
  fill: rgba(120, 53, 15, 0.85);
  stroke: rgba(255, 255, 255, 0.92);
}

/* Botones de superpoderes en topbar y toolbar */
.sp-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(73, 214, 197, 0.32) !important;
  background: rgba(13, 38, 56, 0.65) !important;
}
.sp-top-btn kbd {
  font: 700 9.5px "Manrope", monospace;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #9fdcff;
}
.tool-btn.sp-active {
  color: #04131d !important;
  background: linear-gradient(135deg, #ffd15d, #f59e0b) !important;
  border-color: rgba(255, 209, 93, 0.9) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

/* Terminador Solar Día/Noche sobre el SVG */
.sp-solar-layer {
  pointer-events: none;
}
.sp-night-shade {
  fill: rgba(2, 8, 23, 0.44);
  stroke: none;
}
.sp-twilight-civil {
  fill: rgba(4, 12, 32, 0.22);
  stroke: none;
}
.sp-terminator-line {
  fill: none;
  stroke: rgba(251, 191, 36, 0.78);
  stroke-width: 1.5px;
  stroke-dasharray: 5 3;
  vector-effect: non-scaling-stroke;
}
.sp-subsolar-marker {
  pointer-events: all;
  cursor: pointer;
}
.sp-subsolar-halo {
  fill: rgba(251, 191, 36, 0.26);
  stroke: rgba(251, 191, 36, 0.65);
  stroke-width: 1px;
}
.sp-subsolar-core {
  fill: #fde047;
  stroke: #b45309;
  stroke-width: 1.4px;
}

/* Barra flotante de control astronómico solar */
.sp-solar-bar {
  position: absolute;
  top: 10px;
  left: 14px;
  z-index: 16;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 11px;
  border-radius: 11px;
  background: rgba(5, 18, 29, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.38);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  color: #eef6fa;
  font-size: 11px;
  max-width: min(460px, calc(100% - 28px));
}
.sp-solar-bar[hidden] { display: none !important; }
.sp-solar-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: #fde047;
  white-space: nowrap;
}
.sp-solar-slider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sp-solar-slider-wrap input[type="range"] {
  width: 92px;
  accent-color: #fbbf24;
}
.sp-solar-presets {
  display: inline-flex;
  gap: 4px;
}
.sp-solar-presets button {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #cfe2ea;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.sp-solar-presets button:hover,
.sp-solar-presets button.active {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fff;
}
.sp-solar-meta {
  font-size: 10px;
  color: #9fb6c3;
  white-space: nowrap;
}

/* Mini-Mapa Localizador Interactivo (Overview Radar) */
.sp-minimap {
  position: absolute;
  left: 14px;
  bottom: 10px;
  width: 136px;
  height: 84px;
  z-index: 13;
  border-radius: 10px;
  background: rgba(5, 17, 28, 0.88);
  border: 1px solid rgba(73, 214, 197, 0.34);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  overflow: hidden;
  cursor: crosshair;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sp-minimap[hidden] { display: none !important; }
.sp-minimap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sp-minimap-land {
  fill: rgba(73, 214, 197, 0.24);
  stroke: rgba(73, 214, 197, 0.62);
  stroke-width: 0.6px;
}
.sp-minimap-box {
  fill: rgba(251, 191, 36, 0.18);
  stroke: #fbbf24;
  stroke-width: 1.3px;
}
.sp-minimap-label {
  position: absolute;
  left: 7px;
  bottom: 4px;
  font: 700 8.5px "Manrope", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(207, 226, 234, 0.78);
  pointer-events: none;
}

/* Paleta de Comandos Universal (Ctrl+K) */
.sp-cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(2, 9, 16, 0.68);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: start center;
  padding: 9vh 16px 24px;
}
.sp-cmd-backdrop[hidden] { display: none !important; }
.sp-cmd-dialog {
  width: min(620px, 100%);
  border-radius: 16px;
  background: linear-gradient(180deg, #0b2133 0%, #071624 100%);
  border: 1px solid rgba(73, 214, 197, 0.38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  color: #eef6fa;
}
.sp-cmd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sp-cmd-head svg {
  width: 18px;
  height: 18px;
  color: #49d6c5;
  flex-shrink: 0;
}
.sp-cmd-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff !important;
  font: 600 14.5px "DM Sans", sans-serif !important;
  padding: 2px 0 !important;
}
.sp-cmd-close {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #9fb6c3;
  font-size: 11px;
  cursor: pointer;
}
.sp-cmd-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 3px;
}
.sp-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #d8e8ef;
  cursor: pointer;
  font: 500 13px "DM Sans", sans-serif;
}
.sp-cmd-item:hover,
.sp-cmd-item.active {
  background: rgba(73, 214, 197, 0.14);
  border-color: rgba(73, 214, 197, 0.35);
  color: #fff;
}
.sp-cmd-item-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.sp-cmd-badge {
  font: 700 9.5px "Manrope", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  white-space: nowrap;
}
.sp-cmd-sub {
  font-size: 11.5px;
  color: #8fa8b5;
  white-space: nowrap;
}
.sp-cmd-foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #8fa8b5;
  background: rgba(3, 11, 18, 0.45);
}

/* Modal / Inspector de Fórmulas STEM en Vivo */
.sp-stem-dialog {
  width: min(740px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.sp-stem-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}
.sp-stem-card {
  padding: 12px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 6px;
}
.sp-stem-card h4 {
  margin: 0;
  font: 800 12.5px "Manrope", sans-serif;
  color: #49d6c5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sp-stem-formula {
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 13.5px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(2, 10, 18, 0.65);
  border: 1px solid rgba(73, 214, 197, 0.18);
  color: #fde68a;
  overflow-x: auto;
}
.sp-stem-vals {
  font-size: 11.5px;
  color: #cfe2ea;
  display: grid;
  gap: 3px;
}
.sp-stem-vals div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.sp-stem-vals strong {
  color: #fff;
}

/* Ajustes responsivos móviles 360px - 1120px sin desbordamiento horizontal */
html, body, .app-shell {
  max-width: 100%;
  overflow-x: clip;
}
@media (max-width: 1120px) {
  .right-panel:not(.visible) {
    visibility: hidden;
    pointer-events: none;
  }
}
@media (max-width: 760px) {
  .left-panel:not(.visible),
  .right-panel:not(.visible) {
    visibility: hidden;
    pointer-events: none;
  }
  .topbar {
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  .brand .version {
    display: none;
  }
  .top-actions {
    gap: 4px !important;
  }
  .top-actions .sp-top-btn {
    display: inline-flex !important;
  }
  .top-actions .btn span,
  .sp-top-btn kbd {
    display: none !important;
  }
  .top-actions .btn {
    padding: 6px 7px !important;
    min-width: 32px !important;
  }
  .canvas-toolbar {
    overflow-x: auto;
    max-width: 100%;
    padding: 0 4px !important;
    gap: 2px !important;
  }
  .canvas-toolbar .tool-group {
    gap: 2px !important;
    padding-right: 3px !important;
  }
  .canvas-toolbar .tool-btn {
    width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
  }
  .sp-minimap {
    width: 96px;
    height: 60px;
    left: auto;
    right: 8px;
    bottom: 92px;
  }
  .sp-solar-bar {
    bottom: 52px;
    left: 8px;
    right: 8px;
    padding: 5px 8px;
    font-size: 10px;
    max-width: calc(100% - 16px);
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    height: auto !important;
    max-height: 76px !important;
  }
  /* Evitar que .pz-tabs tape el HUD de coordenadas en móvil */
  .mm-hud {
    bottom: 52px !important;
    max-width: calc(100% - 16px) !important;
    font-size: 10.5px !important;
  }
}

/* ====================================================================== */
/* Cartografía completa de Colombia: Vías, Cordilleras, Recuadro Insular   */
/* ====================================================================== */
.physical-road-casing {
  fill: none;
  stroke: rgba(15, 23, 42, 0.72);
  stroke-width: 2.5px;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.physical-road-casing.transversal {
  stroke-width: 2.1px;
}
.physical-road {
  fill: none;
  stroke: #f97316;
  stroke-width: 1.45px;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  transition: stroke-width 0.15s ease, stroke 0.15s ease;
}
.physical-road.transversal {
  stroke: #facc15;
  stroke-width: 1.2px;
  stroke-dasharray: 5 2.5;
}
.physical-road:hover {
  stroke: #fff;
  stroke-width: 2.4px;
}
.road-shield-label {
  font-family: "Manrope", "DM Sans", sans-serif !important;
  font-weight: 800 !important;
  fill: #fef08a !important;
  stroke: rgba(15, 23, 42, 0.92) !important;
  paint-order: stroke;
  letter-spacing: 0.03em;
  text-anchor: middle;
  pointer-events: none;
}

/* Trazos de las 3 Cordilleras y 6 Serranías de Colombia */
.local-line.range {
  fill: none;
  stroke: rgba(124, 45, 18, 0.82);
  stroke-width: 2.2px;
  stroke-dasharray: 6 3.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
svg[data-tone="dark"] .local-line.range {
  stroke: rgba(253, 186, 116, 0.82);
}

/* Recuadro ampliado del Archipiélago de San Andrés, Providencia y Santa Catalina */
.co-inset-card {
  fill: rgba(7, 22, 35, 0.88);
  stroke: rgba(73, 214, 197, 0.48);
  stroke-width: 1.2px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.42));
}
.co-inset-group.selected .co-inset-card {
  stroke: #fbbf24;
  stroke-width: 2px;
}
.co-inset-sea {
  fill: #0d3b5c;
  stroke: rgba(125, 211, 252, 0.35);
  stroke-width: 0.8px;
}
.co-inset-title {
  font: 800 8.2px "Manrope", "DM Sans", sans-serif;
  fill: #e2f1f8;
  letter-spacing: 0.06em;
}
.co-inset-subtitle {
  font: 600 7.4px "DM Sans", sans-serif;
  fill: #93c5fd;
}
.co-inset-label {
  font: 700 8px "DM Sans", sans-serif;
  fill: #f8fafc;
}
.co-inset-island {
  transition: filter 0.15s ease, stroke-width 0.15s ease;
}
.co-inset-group:hover .co-inset-island {
  filter: brightness(1.14);
  stroke-width: 1.8px;
}

/* Barra rápida de mapas y capas de Colombia en #mapBoard */
.sp-co-bar {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(6, 19, 31, 0.88);
  border: 1px solid rgba(73, 214, 197, 0.32);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  max-width: calc(100% - 20px);
  overflow-x: auto;
}
#mapBoard:has(.sp-co-bar:not([hidden])) .active-layers {
  display: none !important;
}
.sp-co-bar[hidden] { display: none !important; }
.sp-co-group {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
}
.sp-co-sep {
  width: 1px;
  height: 15px;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}
.sp-co-pill,
.sp-co-chip {
  padding: 2.5px 5.5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font: 700 9.8px "DM Sans", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.sp-co-pill:hover,
.sp-co-chip:hover {
  background: rgba(73, 214, 197, 0.16);
  color: #fff;
}
.sp-co-pill.active {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  border-color: rgba(125, 211, 252, 0.75);
  color: #04131e;
}
.sp-co-chip.active {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fef08a;
}
@media (max-width: 760px) {
  .sp-co-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    padding: 4px 6px;
    gap: 4px;
  }
  .sp-co-pill,
  .sp-co-chip {
    padding: 2px 5px;
    font-size: 9.5px;
  }
}

/* ====================================================================== */
/* Capas Temáticas de Colombia: Parques PNN, Cuencas, Transporte, Biogeo  */
/* ====================================================================== */
.co-watershed {
  fill-opacity: 0.22;
  stroke-width: 2.1px;
  stroke-dasharray: 7 4;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill-opacity 0.15s ease, stroke-width 0.15s ease;
}
.co-watershed:hover {
  fill-opacity: 0.42;
  stroke-width: 2.8px;
}

.co-biogeo {
  fill: rgba(217, 119, 6, 0.26);
  stroke: #fbbf24;
  stroke-width: 1.65px;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}
.co-biogeo:hover {
  fill: rgba(245, 158, 11, 0.44);
  stroke-width: 2.4px;
}

.co-park {
  fill: rgba(16, 185, 129, 0.34);
  stroke: #34d399;
  stroke-width: 1.6px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}
.co-park:hover {
  fill: rgba(52, 211, 153, 0.56);
  stroke: #a7f3d0;
  stroke-width: 2.3px;
}

.co-transport {
  cursor: pointer;
}
.co-transport-bg {
  fill: #0f172a;
  stroke: #38bdf8;
  stroke-width: 1.4px;
  transition: transform 0.15s ease, fill 0.15s ease;
}
.co-transport.seaport .co-transport-bg,
.co-transport.riverport .co-transport-bg {
  fill: #082f49;
  stroke: #2dd4bf;
}
.co-transport:hover .co-transport-bg {
  fill: #0284c7;
  stroke: #fff;
}
.co-transport-icon {
  fill: #e0f2fe;
  stroke: #e0f2fe;
  stroke-width: 0.6px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.co-transport.seaport .co-transport-icon,
.co-transport.riverport .co-transport-icon {
  fill: none;
  stroke: #5eead4;
  stroke-width: 1.25px;
}
.co-transport-label {
  font: 800 9.2px "Manrope", "DM Sans", sans-serif;
  fill: #e0f2fe;
  stroke: rgba(7, 18, 30, 0.92);
  stroke-width: 2.8px;
  paint-order: stroke;
  pointer-events: none;
}
.watershed-label {
  font-family: "Manrope", "DM Sans", sans-serif !important;
  font-weight: 800 !important;
  fill: #7dd3fc !important;
  stroke: rgba(7, 19, 31, 0.92) !important;
  paint-order: stroke;
  text-anchor: middle;
  pointer-events: none;
}
.park-label {
  font-family: "DM Sans", sans-serif !important;
  font-weight: 700 !important;
  fill: #a7f3d0 !important;
  stroke: rgba(6, 24, 18, 0.92) !important;
  paint-order: stroke;
  text-anchor: middle;
  pointer-events: none;
}
.biogeo-label {
  font-family: "DM Sans", sans-serif !important;
  font-weight: 700 !important;
  fill: #fde68a !important;
  stroke: rgba(24, 16, 6, 0.92) !important;
  paint-order: stroke;
  text-anchor: middle;
  pointer-events: none;
}
