/* ==========================================================================
   Transecto Urbano · presentation
   Palette & type echoes the reference design board: dark satellite map,
   white line-work, and a terracotta cross-section foreground band.
   ========================================================================== */

:root {
  /* terracotta / rust (the section band) */
  --rust-1: #c65a2c;
  --rust-2: #a8451f;
  --rust-3: #7d2f14;
  --rust-4: #5c210f;

  /* neutrals */
  --cream: #f6efe4;
  --cream-soft: rgba(246, 239, 228, 0.72);
  --cream-dim: rgba(246, 239, 228, 0.42);
  --ink: #1a110b;
  --ink-2: #241610;

  /* accents */
  --route: #e2542a;
  --pin: #ffd23f;
  --pin-edge: #b8860b;
  --teal: #5fb0c4;

  --track-h: 420vh;
  --band-h: clamp(380px, 48vh, 540px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: #0b0908;
  color: var(--cream);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Scene track + pinned stage (whole-page scroll disabled; nav-driven sections)
   -------------------------------------------------------------------------- */
#scene {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hud-scrollcue {
  display: none !important;
}

#stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #0b0908;
}

.layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* L0 · atmosphere ------------------------------------------------------- */
.layer-atmos {
  background:
    radial-gradient(120% 80% at 78% 6%, rgba(95, 176, 196, 0.20), transparent 60%),
    radial-gradient(90% 70% at 12% 100%, rgba(198, 90, 44, 0.22), transparent 62%),
    linear-gradient(180deg, #10131a 0%, #0b0908 60%, #150c08 100%);
  z-index: 1;
}

/* L1 · map -------------------------------------------------------------- */
.layer-map {
  z-index: 2;
  bottom: 0;
  overflow: hidden;
}
#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  min-height: 100vh;
  background: #0c0f12;
  will-change: transform;
}
.maplibregl-map,
.leaflet-container {
  background: #0c0f12;
  font-family: var(--font-ui);
}
.maplibregl-ctrl-attrib,
.leaflet-control-attribution {
  background: rgba(10, 8, 6, 0.62) !important;
  color: var(--cream-dim) !important;
  backdrop-filter: blur(4px);
  font-size: 10px;
}
.maplibregl-ctrl-attrib a,
.leaflet-control-attribution a { color: var(--cream-soft) !important; }
.leaflet-bar a {
  background: rgba(20, 14, 10, 0.86) !important;
  color: var(--cream) !important;
  border-color: rgba(246, 239, 228, 0.16) !important;
}
.leaflet-bar a:hover { background: var(--rust-2) !important; }

/* MapLibre 3D Terrain & Canvas */
.maplibregl-canvas {
  outline: none;
}

/* L2 · grade ------------------------------------------------------------ */
.layer-grade {
  z-index: 3;
  pointer-events: none;
  bottom: 0;
  background:
    linear-gradient(180deg, rgba(9, 7, 6, 0.60) 0%, rgba(9, 7, 6, 0) 16%),
    linear-gradient(90deg, rgba(9, 7, 6, 0.52) 0%, rgba(9, 7, 6, 0) 34%),
    linear-gradient(0deg, rgba(9, 7, 6, 0.56) 0%, rgba(9, 7, 6, 0) 30%),
    radial-gradient(165% 140% at 52% 40%, transparent 74%, rgba(9, 7, 6, 0.26) 100%);
  mix-blend-mode: multiply;
}
#map .leaflet-tile-pane { filter: saturate(1.07) contrast(1.05) brightness(1.06); }

/* L3 · statement -------------------------------------------------------- */
.layer-statement {
  z-index: 4;
  display: grid;
  place-items: center;
  padding-bottom: calc(var(--band-h) + 3rem);
  pointer-events: none;
}
.statement {
  position: relative;
  width: min(580px, 82vw);
  text-align: center;
  opacity: 0;
}
.statement {
  padding: 1.6rem 1.9rem 1.7rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(22, 14, 9, 0.72) 42%,
    rgba(12, 7, 4, 0.88) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.48);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5);
}
.statement-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--rust-1);
  font-weight: 600;
}
.statement-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.statement-text {
  margin: 0;
  font-size: clamp(0.95rem, 1.35vw, 1.12rem);
  line-height: 1.62;
  color: var(--cream-soft);
  font-weight: 300;
}

/* L4 · cross-section ---------------------------------------------------- */
.layer-section {
  inset: auto 0 0 0;
  height: var(--band-h);
  z-index: 6;
  transform-origin: 50% 100%;
  transform: translate3d(0, 105%, 0);
  pointer-events: none;
  will-change: transform, height;
}

.layer-section.is-expanded-60,
#stage.is-expanded-60 .layer-section {
  height: 60vh;
}

#stage.is-expanded-60 .hud-pointnav {
  bottom: calc(60vh + 1.2rem);
}
#stage.is-expanded-60 .layer-statement {
  padding-bottom: calc(60vh + 3rem);
}
#stage.is-expanded-60 .hud-step2-context {
  top: clamp(0.8rem, 1.8vh, 1.4rem);
  max-height: calc(40vh - clamp(0.8rem, 1.8vh, 1.4rem) - 1.4rem);
}
.is-tab-sliding .layer-statement,
.is-tab-sliding .hud-step2-context {
  transition: padding-bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1), top 0.45s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smooth slide animation during tab dimension switch */
.is-tab-sliding .layer-section {
  transition: height 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.is-tab-sliding .layer-map,
.is-tab-sliding .layer-grade {
  transition: bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.is-tab-sliding #map {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.is-tab-sliding .hud-pointnav,
.is-tab-sliding .hud-map-controls {
  transition: bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.section-frame {
  position: relative;
  height: 100%;
  padding: clamp(0.9rem, 1.6vh, 1.4rem) clamp(1.1rem, 3vw, 3.2rem) clamp(0.6rem, 1.2vh, 1rem);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(20, 11, 6, 0.30) 0%, rgba(20, 11, 6, 0) 26%),
    linear-gradient(178deg, var(--rust-1) 0%, var(--rust-2) 46%, var(--rust-3) 100%);
  box-shadow:
    0 -30px 60px -30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(246, 239, 228, 0.35);
  border-top: 1px solid rgba(246, 239, 228, 0.55);
}
/* --------------------------------------------------------------------------
   Per-point transversal section panel
   -------------------------------------------------------------------------- */
.hud-detail {
  display: none !important;
}
.hud-detail.is-open { opacity: 1; transform: translateX(0); }
.detail-header-row {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-flip-btn {
  padding: 2px 7px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(226, 84, 42, 0.25);
  border: 1px solid rgba(226, 84, 42, 0.6);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.detail-flip-btn:hover {
  background: rgba(226, 84, 42, 0.5);
  border-color: var(--cream);
}
.detail-close {
  position: relative;
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: var(--cream-soft);
  font: 400 20px/1 var(--font-ui);
  cursor: pointer;
}
.detail-close:hover { color: #fff; }
.detail-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust-1);
  font-weight: 600;
}
.detail-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.detail-meta {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--cream-soft);
  font-variant-numeric: tabular-nums;
}
#detail-svg { display: block; width: 100%; height: 180px; overflow: visible; }
.detail-foot {
  display: flex;
  justify-content: space-between;
  margin: 0.35rem 0 0;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.5);
}
/* transversal chart internals */
.dt-fill { fill: url(#dtGrad); }
.dt-line { fill: none; stroke: var(--cream); stroke-width: 2; stroke-linejoin: round; }
.dt-grid { stroke: rgba(246, 239, 228, 0.14); stroke-width: 1; }
.dt-axis { stroke: rgba(246, 239, 228, 0.85); stroke-width: 1.4; stroke-dasharray: 4 4; }
.dt-label { fill: rgba(246, 239, 228, 0.6); font-size: 10px; font-family: var(--font-ui); }
.dt-axis-label { fill: var(--cream); font-size: 10px; font-weight: 600; font-family: var(--font-ui); }

.section-frame::before {   /* subtle paper grain */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(246, 239, 228, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.section-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(246, 239, 228, 0.92);
}
.section-scale {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(246, 239, 228, 0.7);
  font-variant-numeric: tabular-nums;
}
.section-tools { display: flex; align-items: center; gap: 0.9rem; }
.zoom-btns { display: flex; gap: 4px; pointer-events: auto; }
.zoom-btns button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 239, 228, 0.4);
  background: rgba(20, 11, 6, 0.28);
  color: var(--cream);
  font: 600 15px/1 var(--font-ui);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.zoom-btns button:hover { background: rgba(20, 11, 6, 0.6); border-color: var(--cream); }
.zoom-btns button:active { transform: translateY(1px); }

.profile-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}
#profile { display: block; width: 100%; height: 100%; overflow: visible; }

.section-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.3rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.72);
}
.section-hint {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: none;
  color: rgba(246, 239, 228, 0.55);
  transition: opacity 0.4s var(--ease);
}
.layer-section.is-engaged .section-hint { opacity: 0; }
.layer-section.is-engaged .profile-wrap { cursor: grab; }
.layer-section.is-engaged.is-panning .profile-wrap { cursor: grabbing; }

/* profile internals (built in app.js) */
.grid-line { stroke: rgba(246, 239, 228, 0.16); stroke-width: 1; }
.grid-line.major { stroke: rgba(246, 239, 228, 0.3); }
.grid-label { fill: rgba(246, 239, 228, 0.62); font-size: 11px; font-family: var(--font-ui); }
.terrain-fill { fill: url(#terrainGrad); }
.terrain-line { fill: none; stroke: var(--cream); stroke-width: 2; stroke-linejoin: round; }
.punto-tick { stroke: rgba(26, 17, 11, 0.55); stroke-width: 1.4; }
.punto-stem { stroke: rgba(246, 239, 228, 0.85); stroke-width: 1.2; }
.punto-dot { fill: var(--cream); stroke: var(--rust-3); stroke-width: 1.5; }
.punto-label { fill: var(--cream); font-size: 10.5px; font-weight: 600; font-family: var(--font-ui); text-anchor: middle; }
.punto-hit { fill: transparent; cursor: pointer; }

.punto.mark-active .punto-dot { fill: var(--pin); stroke: var(--pin-edge); r: 5.5; }
.punto.mark-active .punto-label { fill: #fff; }

/* --------------------------------------------------------------------------
   HUD
   -------------------------------------------------------------------------- */
.hud { position: absolute; z-index: 8; pointer-events: none; }
.hud > * { pointer-events: auto; }

.hud-title {
  top: clamp(7rem, 15vh, 11rem);
  left: clamp(1.1rem, 3.4vw, 3.4rem);
  max-width: min(560px, 74vw);
}
.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cream-soft);
  font-weight: 500;
}
.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 6.6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.6);
}
.title em { font-style: italic; color: var(--rust-1); }
.subtitle {
  margin: 1rem 0 0;
  font-size: clamp(0.82rem, 1.15vw, 1rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-soft);
  font-weight: 400;
}

.hud-credits {
  bottom: clamp(1.4rem, 3.6vh, 2.6rem);
  left: clamp(1.1rem, 3.4vw, 3.4rem);
  max-width: min(1140px, 90vw);
  padding: 0.95rem 2.2rem 1.05rem 1.45rem;
  border-left: 3.5px solid var(--rust-1);
  background: linear-gradient(90deg, rgba(14, 9, 6, 0.62) 0%, rgba(14, 9, 6, 0.32) 78%, rgba(14, 9, 6, 0) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 0 10px 10px 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
}
.credits-logo-row {
  margin: 0 0 0.65rem;
  display: flex;
  align-items: center;
}
.credits-uip-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.8rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}
.credits-uip-logo {
  display: block;
  height: clamp(32px, 3.8vw, 48px);
  width: auto;
}
.credits-kicker {
  margin: 0 0 0.38rem;
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust-1);
}
.credits-authors {
  margin: 0 0 0.28rem;
  font-size: clamp(1.35rem, 1.9vw, 1.78rem);
  line-height: 1.3;
  color: var(--cream);
  font-weight: 400;
}
.credits-authors strong {
  font-weight: 600;
  color: #ffffff;
}
.credits-inst {
  margin: 0;
  font-size: clamp(1.15rem, 1.55vw, 1.52rem);
  line-height: 1.35;
  color: var(--cream-soft);
  font-weight: 300;
}
.credits-inst strong {
  font-weight: 500;
  color: var(--cream);
}

.hud-legend {
  display: none !important;
}
.hud-legend h3 {
  margin: 0 0 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream-soft);
  font-weight: 600;
}
.hud-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.hud-legend li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--cream);
  font-weight: 300;
}
.sw { width: 22px; height: 0; flex: none; }
.sw-route { border-top: 3px solid var(--route); }
.sw-point { width: 12px; height: 12px; border-radius: 50%; background: var(--pin); border: 2px solid var(--pin-edge); }
.sw-edge { width: 12px; height: 12px; border-radius: 50%; background: var(--route); border: 2px solid var(--cream); }
.sw-profile { border-top: 2px solid var(--cream); }
.legend-note {
  margin: 0.9rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(246, 239, 228, 0.12);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--cream-dim);
  font-weight: 300;
}

/* Glassmorphic Context Card for Step 2 */
.hud-step2-context {
  position: absolute;
  left: clamp(1.2rem, 3.4vw, 3.2rem);
  top: clamp(2.5rem, 6vh, 4.5rem);
  width: min(580px, 88vw);
  max-height: calc(100vh - var(--band-h) - 4rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 239, 228, 0.2) transparent;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(22, 14, 9, 0.72) 42%,
    rgba(12, 7, 4, 0.88) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.48);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  padding: 1.25rem 1.45rem;
  box-shadow: 
    0 24px 50px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.context-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.context-badge {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--pin);
  background: rgba(255, 210, 63, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 210, 63, 0.25);
  text-transform: uppercase;
}

.context-pill {
  font-size: 0.64rem;
  color: var(--cream-soft);
  background: rgba(246, 239, 228, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

.context-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
}

.context-lead {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cream-soft);
}
.context-lead strong {
  color: var(--cream);
}

.context-sub {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cream-soft);
  opacity: 0.95;
}

.context-zones-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.zone-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(246, 239, 228, 0.1);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  transition: all 0.2s ease;
}
.zone-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.zone-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--rust-1);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 50%;
  margin-top: 1px;
}

.zone-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zone-title {
  font-size: 0.88rem;
  color: var(--cream);
  font-weight: 600;
}

.zone-pts {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--pin);
}

.zone-desc {
  font-size: 0.71rem;
  color: var(--cream-dim);
  line-height: 1.35;
}

/* Glassmorphic Scene Navigation dock centered on the right edge */
.hud-dots {
  position: fixed;
  right: clamp(1rem, 2.6vw, 2.4rem);
  top: 52%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.55rem 0.65rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(24, 15, 10, 0.68) 45%,
    rgba(12, 7, 4, 0.84) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5);
  z-index: 90;
  transition: all 0.3s ease;
}
.dot {
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  cursor: pointer;
  color: var(--cream-soft);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  transition: all 0.25s var(--ease);
  padding: 0;
}
.dot span {
  opacity: 0.85;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  transform: none;
}
.dot:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: scale(1.08);
}
.dot.is-active {
  background: var(--rust-1);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
  box-shadow: 0 0 14px rgba(226, 84, 42, 0.65);
  transform: scale(1.1);
}
.dot:hover span, .dot.is-active span {
  opacity: 1;
}
.dot::after {
  display: none;
}
.dots-hint {
  margin: 0.2rem 0 0;
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-soft);
  opacity: 0.65;
  text-align: center;
  writing-mode: horizontal-tb;
}

.hud-scrollcue {
  position: fixed;
  left: 50%;
  bottom: clamp(1.4rem, 3.2vh, 2.6rem);
  transform: translateX(-50%);
  width: 24px;
  height: 38px;
  border: 1.5px solid rgba(246, 239, 228, 0.45);
  background: rgba(16, 11, 8, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  display: grid;
  justify-items: center;
  padding-top: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  z-index: 60;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.hud-scrollcue span {
  width: 3.5px;
  height: 8px;
  border-radius: 2px;
  background: var(--cream);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: cue 1.9s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  70% { transform: translateY(11px); opacity: 0; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Point sequence navigator
   -------------------------------------------------------------------------- */
.hud-pointnav {
  right: clamp(1.1rem, 3.4vw, 3.4rem);
  bottom: calc(var(--band-h) + 1.2rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 30px, 0);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 70;
}
.hud-pointnav button {
  pointer-events: auto;
  height: 30px;
  min-width: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 239, 228, 0.22);
  background: rgba(16, 11, 8, 0.6);
  backdrop-filter: blur(8px);
  color: var(--cream);
  font: 600 15px/1 var(--font-ui);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.hud-pointnav button:hover { background: rgba(198, 90, 44, 0.55); border-color: var(--cream); }
.hud-pointnav button:disabled { opacity: 0.3; cursor: default; }
#pn-home { font-size: 14px; }
.pn-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem;
  background: rgba(16, 11, 8, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(246, 239, 228, 0.16);
  border-radius: 5px;
}
.pn-step button { border: 0; background: none; backdrop-filter: none; height: 24px; min-width: 24px; }
.pn-step button:hover { background: rgba(198, 90, 44, 0.4); }
.pn-label {
  min-width: 8.5em;
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Google Earth 3D markers & MapLibre placemarks
   -------------------------------------------------------------------------- */
.pin-wrap, .place-wrap { background: none !important; border: 0 !important; }

/* Placemark Pin Marker */
.ge-pin-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transform: translate3d(0, 0, 0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ge-pin-label {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.95),
    0 0 2px rgba(0, 0, 0, 0.9),
    0 0 6px rgba(0, 0, 0, 0.85);
  margin-bottom: 2px;
  pointer-events: none;
  transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}
.ge-pin-icon {
  position: relative;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}
.ge-pin-icon svg {
  display: block;
}
.ge-pin-marker:hover .ge-pin-label {
  color: #ffd23f;
  transform: scale(1.08);
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.85), 0 1px 3px #000;
}
.ge-pin-marker:hover .ge-pin-icon {
  transform: scale(1.18);
}
.ge-pin-marker.is-active .ge-pin-label {
  color: #ffd23f;
  font-weight: 700;
  transform: scale(1.18);
  text-shadow: 0 0 12px rgba(255, 210, 63, 0.95), 0 2px 4px #000;
}
.ge-pin-marker.is-active .ge-pin-icon {
  transform: scale(1.32);
  filter: drop-shadow(0 0 14px rgba(226, 84, 42, 0.9)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.75));
}
.ge-pin-marker.mark-edge .ge-pin-label {
  color: #ff9e7a;
}

.place {
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
.place.place-bold {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #ffffff;
}
.place.place-park {
  color: #8ed081;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.95);
}
.place.place-sm { font-size: 9.5px; letter-spacing: 0.16em; color: rgba(246, 239, 228, 0.7); }
.place.place-water { color: rgba(130, 205, 230, 0.9); font-style: italic; letter-spacing: 0.08em; text-transform: none; font-size: 11.5px; font-weight: 600; }

/* --------------------------------------------------------------------------
   Floating Map Controls (+, −, 3D Reset)
   -------------------------------------------------------------------------- */
.hud-map-controls {
  position: fixed;
  right: clamp(1.1rem, 3.4vw, 3.4rem);
  bottom: 4.6rem; /* JS keeps it just above .hud-pointnav as the panel slides */
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(24, 15, 10, 0.72) 45%,
    rgba(12, 7, 4, 0.88) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  z-index: 85;
}
.map-ctrl-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--cream);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}
.map-ctrl-btn:hover {
  background: var(--rust-1);
  border-color: var(--cream);
  color: #fff;
  transform: scale(1.1);
}
.ctrl-icon-3d {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold);
}

/* leaflet tooltip */
.leaflet-tooltip.pin-tip {
  background: rgba(16, 11, 8, 0.9);
  border: 1px solid rgba(246, 239, 228, 0.22);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.leaflet-tooltip.pin-tip::before { display: none; }

/* --------------------------------------------------------------------------
   Split View Inspector: Per-Point Checklist & Image Gallery Carousel
   -------------------------------------------------------------------------- */
.layer-split-view {
  pointer-events: auto;
}

.split-frame {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem 0.65rem;
  background:
    linear-gradient(180deg, rgba(16, 10, 6, 0.72) 0%, rgba(24, 13, 8, 0.88) 100%),
    linear-gradient(178deg, var(--rust-2) 0%, var(--rust-3) 50%, var(--rust-4) 100%);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(246, 239, 228, 0.35);
  box-shadow: 0 -25px 50px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

/* Split Head */
.split-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(246, 239, 228, 0.14);
  flex-shrink: 0;
  min-height: 42px;
}

.split-head-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.point-badge-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.point-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--rust-1);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Dimension Navigation Tabs next to point pill */
.split-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(8, 5, 3, 0.55);
  padding: 3px 4px;
  border-radius: 7px;
  border: 1px solid rgba(246, 239, 228, 0.18);
}

.split-tab {
  padding: 5px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--cream-soft);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.split-tab:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.08);
}

.split-tab.is-active {
  background: var(--rust-1);
  color: #fff;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.point-meta-text {
  font-size: 0.72rem;
  color: var(--cream-soft);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.split-point-dropdown {
  background: rgba(16, 11, 8, 0.85);
  color: var(--cream);
  border: 1px solid rgba(246, 239, 228, 0.28);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-family: var(--font-ui);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}
.split-point-dropdown:hover,
.split-point-dropdown:focus {
  border-color: var(--pin);
}

.split-head-center {
  position: absolute;
  left: 50%;
  top: calc((100% - 0.6rem) / 2);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

.split-section-title {
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cream);
}

.split-stats-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  background: rgba(246, 239, 228, 0.12);
  border-radius: 10px;
  color: var(--cream-soft);
  letter-spacing: 0.06em;
}

.split-head-right {
  display: flex;
  align-items: center;
}

.split-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.split-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(246, 239, 228, 0.25);
  background: rgba(20, 11, 6, 0.5);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-ui);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.split-btn:hover {
  background: rgba(20, 11, 6, 0.8);
  border-color: var(--cream);
}
.split-btn-highlight {
  background: rgba(226, 84, 42, 0.35);
  border-color: rgba(226, 84, 42, 0.7);
  color: #fff;
}
.split-btn-highlight:hover {
  background: var(--rust-1);
  border-color: #fff;
}

/* Split Body (Left: Checklist | Right: Gallery) */
.split-body {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  margin-top: 0.6rem;
}

.split-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 5px;
  background: rgba(11, 7, 5, 0.42);
  border: 1px solid rgba(246, 239, 228, 0.12);
  overflow: hidden;
}

.split-pane-checklist {
  flex: 1.15 1 0%;
  position: relative;
  transition: flex-grow 0.55s var(--ease);
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
}
.split-pane-gallery {
  transition: flex-grow 0.55s var(--ease);
}

/* Steps 03 & 04: left panel 3/4 · gallery 1/4 */
.layer-section[data-view="walk"] .split-pane-checklist,
.layer-section[data-view="norms"] .split-pane-checklist { flex: 3 1 0%; }
.layer-section[data-view="walk"] .split-pane-gallery,
.layer-section[data-view="norms"] .split-pane-gallery { flex: 1 1 0%; }

/* Swappable views inside the left panel: fade + slide left/right */
.view-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(2.5rem, 0, 0);
  transition:
    opacity 0.32s ease,
    transform 0.5s var(--ease),
    visibility 0s linear 0.5s;
}
.view-layer > .analysis-tab-pane { flex: 1; min-height: 0; }

.layer-section[data-view="analysis"] #view-analysis,
.layer-section[data-view="walk"] #view-walk,
.layer-section[data-view="norms"] #view-norms {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 0.42s ease 0.14s,
    transform 0.55s var(--ease) 0.14s,
    visibility 0s;
}
/* views already passed slide out to the left */
.layer-section[data-view="walk"] #view-analysis,
.layer-section[data-view="norms"] #view-analysis,
.layer-section[data-view="norms"] #view-walk {
  transform: translate3d(-2.5rem, 0, 0);
}

/* Dimension tabs fade out whenever a table view is showing */
.split-nav-tabs {
  transition: opacity 0.35s ease, transform 0.45s var(--ease), visibility 0s;
}
.layer-section:not([data-view="analysis"]) .split-nav-tabs {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-14px, 0, 0);
  transition: opacity 0.3s ease, transform 0.4s var(--ease), visibility 0s linear 0.3s;
}

/* Table views (Step 03 / Step 04) */
.table-view { padding: 0.7rem 0.85rem 1rem; }
.tv-intro {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--cream-soft);
}
.tv-intro u { text-decoration-color: rgba(246, 239, 228, 0.45); text-underline-offset: 2px; }
.tv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.74rem;
  line-height: 1.42;
  color: var(--cream-soft);
  border: 1px solid rgba(246, 239, 228, 0.16);
  border-radius: 6px;
  overflow: hidden;
}
.tv-table-walk { min-width: 860px; }
.tv-table-norms { min-width: 560px; }
.tv-table th,
.tv-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(246, 239, 228, 0.1);
  border-right: 1px solid rgba(246, 239, 228, 0.08);
}
.tv-table tr > *:last-child { border-right: 0; }
.tv-table tbody tr:last-child > * { border-bottom: 0; }
.tv-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(30, 17, 10, 0.97);
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.65rem 0.7rem;
}
.tv-table tbody tr[hidden] {
  display: none;
}
.walk-filter-pills {
  flex-wrap: wrap;
}
.walk-filter-pills .cl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.walk-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.walk-swatch-deficiente { background: #dc2626; }
.walk-swatch-poco       { background: #ea580c; }
.walk-swatch-caminable  { background: #65a30d; }
.tv-table tbody th {
  min-width: 8.5rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}
.tv-table tbody th em { display: block; margin-top: 2px; font-weight: 400; color: var(--cream-soft); }
.tv-table tbody tr:hover > * { background: rgba(246, 239, 228, 0.045); }
.tv-table u { text-decoration-color: rgba(246, 239, 228, 0.4); text-underline-offset: 2px; }
.tv-table strong { color: #fff; }
.tv-cond { color: var(--cream); font-size: 0.78rem; }
.tv-level { white-space: normal; }
.tv-level em { display: block; margin-top: 2px; color: var(--cream-soft); }
.tv-level.lvl-ef { box-shadow: inset 3px 0 0 #dc2626; }
.tv-level.lvl-f  { box-shadow: inset 3px 0 0 #991b1b; }
.tv-level.lvl-d  { box-shadow: inset 3px 0 0 #ea580c; }
.tv-level.lvl-cd { box-shadow: inset 3px 0 0 #d97706; }
.tv-level.lvl-c  { box-shadow: inset 3px 0 0 #ca8a04; }
.tv-level.lvl-bc { box-shadow: inset 3px 0 0 #65a30d; }

/* Dynamic Analysis Tab Panes */
.analysis-tab-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
}
.analysis-tab-pane[hidden] {
  display: none !important;
}

.analysis-tab-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.95rem;
  background: rgba(16, 11, 8, 0.65);
  border-bottom: 1px solid rgba(246, 239, 228, 0.12);
  flex-shrink: 0;
}

.analysis-meta-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.analysis-badge {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--pin);
  background: rgba(255, 210, 63, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 210, 63, 0.25);
}

.analysis-point-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.03em;
}

.analysis-status-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  background: rgba(246, 239, 228, 0.08);
  border: 1px dashed rgba(246, 239, 228, 0.25);
  border-radius: 10px;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
}

.analysis-tab-scrollable {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 239, 228, 0.2) transparent;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
}

/* General Analysis Documents (Observación, Interpretación, Diagnóstico) */
.general-doc {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1.5rem;
}

.doc-header {
  padding: 0.65rem 0.85rem;
  background: rgba(22, 14, 9, 0.55);
  border: 1px solid rgba(246, 239, 228, 0.12);
  border-left: 3px solid var(--pin);
  border-radius: 6px;
}

.doc-kicker {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust-1);
  margin-bottom: 0.2rem;
}

.doc-title {
  margin: 0 0 0.35rem 0;
  font-family: var(--font-display, serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.3;
}

.doc-lead {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--cream-soft);
}

.doc-card {
  background: rgba(18, 12, 8, 0.6);
  border: 1px solid rgba(246, 239, 228, 0.1);
  border-radius: 6px;
  padding: 0.8rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.doc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(246, 239, 228, 0.08);
  padding-bottom: 0.35rem;
}

.doc-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.doc-badge {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(198, 90, 44, 0.18);
  color: #ffaa7a;
  border: 1px solid rgba(198, 90, 44, 0.35);
  white-space: nowrap;
}

.doc-badge.green {
  background: rgba(46, 133, 94, 0.2);
  color: #6ee7b7;
  border-color: rgba(46, 133, 94, 0.4);
}

.doc-badge.amber {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
  border-color: rgba(217, 119, 6, 0.4);
}

.doc-badge.red {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
}

.doc-text {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.58;
  color: var(--cream-soft);
}

.doc-text strong {
  color: #fff;
  font-weight: 600;
}

.doc-callout {
  background: rgba(246, 239, 228, 0.04);
  border-left: 2px solid var(--rust-2);
  padding: 0.45rem 0.7rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--cream-soft);
}

.doc-callout strong {
  color: var(--cream);
}

.doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.doc-list li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.82rem;
  line-height: 1.52;
  color: var(--cream-soft);
}

.doc-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--pin);
  font-size: 0.95rem;
}

.doc-list li strong {
  color: #ffffff;
}

.doc-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.doc-action-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(246, 239, 228, 0.08);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
}

.doc-action-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffc29b;
  margin-bottom: 0.2rem;
}

.doc-action-item-desc {
  font-size: 0.8rem;
  line-height: 1.48;
  color: var(--cream-soft);
  margin: 0;
}

.analysis-notes-block {
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(246, 239, 228, 0.08);
}

.split-pane-gallery {
  flex: 1;
}

/* Checklist Topbar */
.checklist-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.95rem;
  background: rgba(16, 11, 8, 0.65);
  border-bottom: 1px solid rgba(246, 239, 228, 0.12);
  gap: 0.75rem;
  flex-shrink: 0;
}

.checklist-meta-group {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.checklist-subtitle {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
}

.checklist-counter {
  font-size: 0.76rem;
  color: var(--pin);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.checklist-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checklist-search-input {
  background: rgba(10, 6, 4, 0.65);
  border: 1px solid rgba(246, 239, 228, 0.2);
  border-radius: 4px;
  color: var(--cream);
  font-size: 0.78rem;
  padding: 4px 9px;
  width: 120px;
  outline: none;
  transition: width 0.2s ease, border-color 0.2s ease;
}
.checklist-search-input:focus {
  width: 155px;
  border-color: var(--pin);
}

.checklist-pills {
  display: flex;
  gap: 3px;
}

.cl-pill {
  padding: 4px 9px;
  background: rgba(246, 239, 228, 0.08);
  border: 1px solid transparent;
  color: var(--cream-soft);
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.cl-pill:hover {
  background: rgba(246, 239, 228, 0.16);
  color: var(--cream);
}
.cl-pill.is-active {
  background: var(--rust-1);
  color: #fff;
  border-color: rgba(246, 239, 228, 0.3);
}

/* Checklist Scrollable Table */
.checklist-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
}
.checklist-scrollable::-webkit-scrollbar {
  width: 5px;
}
.checklist-scrollable::-webkit-scrollbar-thumb {
  background: rgba(246, 239, 228, 0.2);
  border-radius: 3px;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.checklist-table th {
  display: none;
}

.checklist-row {
  border-bottom: 1px solid rgba(246, 239, 228, 0.08);
  transition: background 0.15s ease;
}
.checklist-row:hover {
  background: rgba(246, 239, 228, 0.05);
}

.td-desc {
  padding: 8px 12px;
  color: var(--cream);
  line-height: 1.42;
  vertical-align: middle;
  font-size: 0.88rem;
}

.item-num {
  font-weight: 700;
  color: var(--pin);
  margin-right: 6px;
  font-size: 0.92rem;
}

.item-text {
  font-weight: 500;
  color: var(--cream);
}

.td-choice {
  width: 48px;
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
}

/* Sí / No Interactive Buttons */
.choice-btn {
  width: 42px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(246, 239, 228, 0.25);
  background: rgba(20, 11, 6, 0.55);
  color: var(--cream-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:hover {
  border-color: var(--cream);
  color: #fff;
  transform: translateY(-1px);
}

.choice-btn.yes.is-selected {
  background: #1b6a48;
  border-color: #38a169;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 161, 105, 0.55);
}

.choice-btn.no.is-selected {
  background: #8b2b1a;
  border-color: #e53e3e;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(229, 62, 62, 0.55);
}

/* Inline note row for criteria with blanks */
.checklist-note-row {
  padding: 4px 0 2px;
}
.checklist-inline-note {
  width: 100%;
  box-sizing: border-box;
  background: rgba(14, 9, 6, 0.75);
  border: 1px solid rgba(246, 239, 228, 0.2);
  border-radius: 4px;
  color: var(--cream);
  font-size: 0.8rem;
  padding: 5px 9px;
  outline: none;
}
.checklist-inline-note:focus {
  border-color: var(--pin);
}

/* Read-only view for criteria with content */
.checklist-note-view {
  padding: 3px 0 1px;
}
.checklist-note-text {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--cream-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(246, 239, 228, 0.12);
  border-left: 2px solid var(--pin);
  border-radius: 3px;
  padding: 3px 8px;
}

/* Otras Observaciones */
.checklist-obs-block {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(246, 239, 228, 0.12);
  background: rgba(14, 9, 6, 0.4);
}
.checklist-obs-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rust-1);
  margin-bottom: 6px;
}
.checklist-obs-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(10, 6, 4, 0.75);
  border: 1px solid rgba(246, 239, 228, 0.2);
  border-radius: 4px;
  color: var(--cream);
  font-size: 0.84rem;
  font-family: var(--font-ui);
  padding: 8px 10px;
  resize: vertical;
  min-height: 52px;
  outline: none;
}
.checklist-obs-textarea:focus {
  border-color: var(--pin);
}

/* --------------------------------------------------------------------------
   Right Split: Image Gallery & Carousel
   -------------------------------------------------------------------------- */
.gallery-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.gallery-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.95rem;
  background: rgba(16, 11, 8, 0.65);
  border-bottom: 1px solid rgba(246, 239, 228, 0.12);
  flex-shrink: 0;
}

.gallery-info {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.gallery-section-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
}

.gallery-counter-pill {
  font-size: 0.76rem;
  color: var(--pin);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gallery-btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(246, 239, 228, 0.08);
  border: 1px solid rgba(246, 239, 228, 0.2);
  color: var(--cream);
  font-size: 0.65rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gallery-btn-upload:hover {
  background: rgba(246, 239, 228, 0.18);
  border-color: var(--cream);
}

.gallery-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: rgba(246, 239, 228, 0.08);
  border: 1px solid rgba(246, 239, 228, 0.2);
  color: var(--cream);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gallery-icon-btn:hover {
  background: var(--rust-1);
  border-color: #fff;
}

/* Carousel Container */
.carousel-container {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: #000;
  overflow: hidden;
}

.carousel-slide-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.carousel-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.carousel-slide-viewport:hover .carousel-main-img {
  transform: scale(1.02);
}

.carousel-gradient-overlay {
  display: none !important;
}

.carousel-text-overlay {
  display: none !important;
}

.carousel-img-title {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.carousel-img-desc {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--cream-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Carousel Nav Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(16, 11, 8, 0.65);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(246, 239, 228, 0.3);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}
.carousel-arrow:hover {
  background: var(--rust-1);
  border-color: #fff;
  transform: translateY(-50%) scale(1.1);
}
.carousel-arrow.prev { left: 8px; }
.carousel-arrow.next { right: 8px; }

.carousel-nav-dots {
  position: absolute;
  bottom: 6px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 4px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(246, 239, 228, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}
.carousel-dot.is-active {
  background: var(--pin);
  transform: scale(1.3);
}

/* Thumbnails Strip */
.carousel-thumbnails-strip {
  display: flex;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(14, 9, 6, 0.85);
  border-top: 1px solid rgba(246, 239, 228, 0.1);
  overflow-x: auto;
  flex-shrink: 0;
}
.carousel-thumbnails-strip::-webkit-scrollbar {
  height: 4px;
}
.carousel-thumbnails-strip::-webkit-scrollbar-thumb {
  background: rgba(246, 239, 228, 0.2);
  border-radius: 2px;
}

.carousel-thumb-item {
  width: 48px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(246, 239, 228, 0.2);
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.2s ease;
}
.carousel-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-thumb-item:hover {
  opacity: 1;
  border-color: var(--cream);
}
.carousel-thumb-item.is-active {
  opacity: 1;
  border-color: var(--pin);
  box-shadow: 0 0 6px rgba(255, 210, 63, 0.4);
}

/* --------------------------------------------------------------------------
   Longitudinal Profile Drawer (toggled from split view)
   -------------------------------------------------------------------------- */
.profile-drawer {
  position: absolute;
  inset: 0;
  z-index: 10;
  background:
    linear-gradient(180deg, rgba(20, 11, 6, 0.95) 0%, rgba(20, 11, 6, 0.98) 100%),
    linear-gradient(178deg, var(--rust-1) 0%, var(--rust-2) 46%, var(--rust-3) 100%);
  padding: 0.9rem 1.4rem;
  display: flex;
  flex-direction: column;
}
.profile-drawer[hidden] {
  display: none !important;
}
.profile-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   Fullscreen Lightbox Modal for Gallery
   -------------------------------------------------------------------------- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}
.gallery-lightbox[hidden] {
  display: none;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 3, 0.88);
  backdrop-filter: blur(16px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  width: min(1380px, 95vw);
  height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  background: rgba(18, 12, 8, 0.95);
  border: 1px solid rgba(246, 239, 228, 0.24);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.lightbox-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(12, 8, 5, 0.9);
  border-bottom: 1px solid rgba(246, 239, 228, 0.12);
  flex-shrink: 0;
}

.lightbox-title-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-point-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--cream);
}

.lightbox-counter-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: rgba(226, 84, 42, 0.25);
  border: 1px solid rgba(226, 84, 42, 0.5);
  border-radius: 12px;
  color: var(--cream);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-nav-btn {
  padding: 4px 12px;
  background: rgba(246, 239, 228, 0.1);
  border: 1px solid rgba(246, 239, 228, 0.25);
  border-radius: 4px;
  color: var(--cream);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lightbox-nav-btn:hover {
  background: var(--rust-1);
  border-color: #fff;
  color: #fff;
}

.lightbox-close-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(246, 239, 228, 0.12);
  border: 1px solid rgba(246, 239, 228, 0.25);
  border-radius: 50%;
  color: var(--cream);
  font-size: 1rem;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s ease;
}
.lightbox-close-btn:hover {
  background: #e53e3e;
  border-color: #fff;
  color: #fff;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #000;
  overflow: hidden;
}

.lightbox-img-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: block;
}

.lightbox-info-drawer {
  display: none !important;
}

.lightbox-img-title {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--cream);
}

.lightbox-img-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cream-soft);
  line-height: 1.4;
}

.lightbox-thumbs-container {
  display: flex;
  gap: 8px;
  padding: 8px 1.4rem;
  background: rgba(10, 6, 4, 0.95);
  border-top: 1px solid rgba(246, 239, 228, 0.08);
  overflow-x: auto;
  flex-shrink: 0;
}
.lightbox-thumb {
  width: 64px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(246, 239, 228, 0.2);
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}
.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox-thumb:hover {
  opacity: 1;
  border-color: var(--cream);
}
.lightbox-thumb.is-active {
  opacity: 1;
  border-color: var(--pin);
  box-shadow: 0 0 8px rgba(255, 210, 63, 0.5);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  :root { --band-h: clamp(340px, 50vh, 560px); --track-h: 340vh; }
  .split-body { flex-direction: column; }
  .split-pane-checklist { flex: 1; max-height: 50%; }
  .split-pane-gallery { flex: 1; max-height: 50%; }
  .split-head-center { display: none; }
  .hud-legend { display: none; }
  .hud-title { top: auto; bottom: calc(var(--band-h) + 3.4rem); left: 1.2rem; right: 1.2rem; max-width: none; }
  .hud-title::before {
    content: "";
    position: absolute;
    inset: -1.6rem -1.4rem -1.2rem -1.4rem;
    background: linear-gradient(0deg, rgba(9, 7, 6, 0.86), rgba(9, 7, 6, 0.35) 60%, rgba(9, 7, 6, 0));
    z-index: -1;
  }
  .title { font-size: clamp(2.2rem, 12vw, 3.4rem); }
  .hud-dots { top: auto; bottom: calc(var(--band-h) + 1rem); right: 1rem; flex-direction: row; transform: none; gap: 0.4rem; }
  .hud-pointnav { left: 1rem; right: auto; bottom: calc(var(--band-h) + 0.9rem); }
  #stage.is-expanded-60 .hud-dots { bottom: calc(60vh + 1rem); }
  #stage.is-expanded-60 .hud-pointnav { bottom: calc(60vh + 0.9rem); }
  .pn-label { min-width: 6.5em; font-size: 0.68rem; }
  .dots-hint { display: none; }
  .hud-scrollcue { display: none; }
  .section-scale { display: none; }
  .section-eyebrow { display: none; }
  .section-hint { display: none; }
  .section-head { justify-content: flex-end; }
  .hud-detail {
    left: 1.2rem;
    right: 1.2rem;
    top: 12vh;
    width: auto;
    transform: translateY(0) translateX(0);
  }
  .hud-detail.is-open { transform: translateY(0); }
  #detail-svg { height: 150px; }
}

@media (max-width: 560px) {
  .subtitle { letter-spacing: 0.14em; }
  .section-eyebrow { font-size: 0.62rem; letter-spacing: 0.18em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hud-scrollcue span { animation: none; }
}

/* ==========================================================================
   Server Storage & Exclusive Edit Mode
   ========================================================================== */
.split-btn-auth {
  background: rgba(20, 11, 6, 0.6);
  border-color: rgba(255, 210, 63, 0.35);
  color: var(--cream-soft);
}
.split-btn-auth.is-unlocked {
  background: rgba(27, 106, 72, 0.55);
  border-color: #38a169;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 161, 105, 0.4);
}
.auth-icon {
  font-size: 0.85rem;
}

.save-indicator {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(246, 239, 228, 0.08);
  color: var(--cream-soft);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.save-indicator.is-locked {
  color: var(--cream-dim);
  background: rgba(246, 239, 228, 0.05);
}
.save-indicator.is-saving {
  color: var(--pin);
  background: rgba(255, 210, 63, 0.12);
  border: 1px solid rgba(255, 210, 63, 0.25);
  animation: pulse-saving 1.2s infinite;
}
.save-indicator.is-synced {
  color: #68d391;
  background: rgba(56, 161, 105, 0.12);
  border: 1px solid rgba(56, 161, 105, 0.25);
}
.save-indicator.is-error {
  color: #fc8181;
  background: rgba(229, 62, 62, 0.12);
  border: 1px solid rgba(229, 62, 62, 0.25);
}

@keyframes pulse-saving {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.checklist-inline-note[readonly],
.checklist-obs-textarea[readonly],
.analysis-notes-textarea[readonly] {
  cursor: pointer;
  background: rgba(10, 6, 4, 0.45);
  border-style: dashed;
}
.checklist-inline-note[readonly]:hover,
.checklist-obs-textarea[readonly]:hover,
.analysis-notes-textarea[readonly]:hover {
  border-color: rgba(255, 210, 63, 0.4);
}

/* Auth Modal (Glassmorphic) */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-modal[hidden] {
  display: none !important;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(450px, 94vw);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(26, 16, 11, 0.88) 40%,
    rgba(14, 8, 5, 0.96) 100%
  );
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.4);
  animation: auth-modal-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-modal-appear {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.auth-modal-badge {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--pin);
  background: rgba(255, 210, 63, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 210, 63, 0.25);
  text-transform: uppercase;
}

.auth-modal-title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
}

.auth-modal-close {
  background: transparent;
  border: none;
  color: var(--cream-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
  transition: color 0.2s ease;
}
.auth-modal-close:hover {
  color: #fff;
}

.auth-modal-desc {
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--cream-soft);
  margin: 0 0 1.15rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.auth-input-group {
  display: flex;
  gap: 8px;
}

.auth-password-input {
  flex: 1;
  background: rgba(10, 6, 4, 0.75);
  border: 1px solid rgba(246, 239, 228, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-password-input:focus {
  border-color: var(--pin);
  box-shadow: 0 0 10px rgba(255, 210, 63, 0.25);
}

.auth-submit-btn {
  background: var(--rust-1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.auth-submit-btn:hover {
  background: #d44720;
  border-color: #fff;
}

.auth-error-msg {
  font-size: 0.8rem;
  color: #fc8181;
  background: rgba(229, 62, 62, 0.12);
  border: 1px solid rgba(229, 62, 62, 0.25);
  padding: 6px 10px;
  border-radius: 5px;
}

/* ==========================================================================
   Section 05 · Thematic map viewer (Kevin Lynch · Zonificación · Diagnóstico)
   Bare map fills the viewport; a floating selector sits at the top and a
   dynamic legend card anchors to the bottom-left corner.
   ========================================================================== */
.hud-section5-maps {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.hud-section5-maps > * { pointer-events: none; }
#stage.is-section5-active .hud-section5-maps { opacity: 1; }
#stage.is-section5-active .hud-section5-maps > * { pointer-events: auto; }

/* ---- Selector de vistas (tabs) ---------------------------------------- */
.map-mode-tabs {
  position: absolute;
  top: clamp(1rem, 2.4vh, 1.9rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  max-width: calc(100vw - 2.4rem);
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(24, 15, 10, 0.68) 45%,
    rgba(12, 7, 4, 0.86) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.map-mode-tabs::-webkit-scrollbar { display: none; }

.map-mode-tab {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--cream-soft);
  font-family: var(--font-ui);
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.map-mode-tab:hover { color: var(--cream); background: rgba(255, 255, 255, 0.08); }
.map-mode-tab.is-active {
  background: var(--rust-1);
  color: #fff;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 14px rgba(226, 84, 42, 0.5);
}

.map-mode-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: rgba(246, 239, 228, 0.18);
}

.map-dim-btn {
  width: 38px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--cream-soft);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.map-dim-btn:hover { color: #fff; border-color: var(--cream); }
.map-dim-btn.is-active {
  background: var(--pin);
  color: #1a110b;
  border-color: rgba(255, 255, 255, 0.6);
}

/* ---- Recuadro de leyenda dinámica ------------------------------------- */
.map-legend-card {
  position: absolute;
  left: clamp(1.1rem, 3.4vw, 3.4rem);
  bottom: clamp(1.2rem, 3vh, 2.4rem);
  width: min(320px, 84vw);
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding: 1rem 1.15rem 1.1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 239, 228, 0.2) transparent;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(22, 14, 9, 0.74) 42%,
    rgba(12, 7, 4, 0.9) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-left: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 18px;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.legend-head { margin-bottom: 0.35rem; }
.legend-kicker {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rust-1);
}
.legend-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.legend-desc {
  margin: 0.5rem 0 0.8rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--cream-dim);
  font-weight: 300;
}
.legend-items {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid rgba(246, 239, 228, 0.12);
  display: grid;
  gap: 0.5rem;
}
.legend-items li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--cream);
  font-weight: 300;
}
.lg-swatch {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.lg-sw { display: inline-block; }
.lg-sw.lg-line { width: 24px; height: 0; border-top: var(--w, 3px) solid var(--c); border-radius: 2px; }
.legend-items li.lg-heading {
  padding-top: 0.48rem;
  margin-top: 0.2rem;
  border-top: 1px solid rgba(246, 239, 228, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
}
.lg-protected-svg {
  width: 22px;
  height: 15px;
  display: block;
}
.lg-lynch-svg {
  width: 24px;
  height: 18px;
  display: block;
  overflow: visible;
}
.map-legend-card.is-lynch-matrix {
  width: min(356px, calc(100vw - 2rem));
}
.legend-items li.lg-lynch-matrix-wrap {
  display: block;
  padding: 0.25rem 0 0.45rem;
}
.lg-lynch-matrix {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
}
.lg-lynch-matrix th,
.lg-lynch-matrix td {
  text-align: center;
  vertical-align: middle;
  padding: 5px 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lg-lynch-matrix thead th {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(246, 239, 228, 0.78);
  padding: 6px 2px 5px;
  background: rgba(255, 255, 255, 0.05);
}
.lg-lynch-matrix tbody th {
  width: 52px;
  text-align: left;
  padding-left: 7px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(246, 239, 228, 0.88);
  white-space: nowrap;
}
.lg-lynch-matrix tbody tr:last-child th,
.lg-lynch-matrix tbody tr:last-child td {
  border-bottom: none;
}
.lg-lynch-matrix td svg {
  width: 30px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  overflow: visible;
}
.legend-items li.lg-lynch-toggle-row {
  display: block;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.lg-lynch-toggle-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 63, 0.36);
  background: rgba(255, 255, 255, 0.06);
  color: #f6efe4;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.lg-lynch-toggle-btn:hover {
  background: rgba(255, 210, 63, 0.16);
  border-color: rgba(255, 210, 63, 0.7);
}
.lg-lynch-toggle-btn.is-active {
  background: #ffd23f;
  border-color: #ffd23f;
  color: #1a120a;
}
.lg-lynch-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd23f;
  border: 1.5px solid rgba(20, 11, 6, 0.65);
}
.lg-lynch-toggle-btn.is-active .lg-lynch-toggle-dot {
  background: #1a120a;
  border-color: #1a120a;
}
.lg-sw.lg-fill {
  width: 18px;
  height: 13px;
  border-radius: 3px;
  background: var(--c);
  opacity: 0.88;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
}
.lg-sw.lg-mixed {
  width: 18px;
  height: 13px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--c, #FFD23F) 0% 49%, var(--c2, #EF4444) 51% 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.82);
}
.lg-sw.lg-outline {
  width: 18px;
  height: 13px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border: 1.8px dashed var(--c);
}
.lg-sw.lg-node { width: 13px; height: 13px; border-radius: 50%; background: var(--c); border: 2px solid #fff; }
.lg-sw.lg-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); border: 2px solid rgba(20, 11, 6, 0.85); }
.lg-sw.lg-star { font-size: 0.95rem; line-height: 1; color: var(--c); text-shadow: 0 0 6px rgba(0, 0, 0, 0.85); }

/* ---- Section 05 responsive -------------------------------------------- */
@media (max-width: 900px) {
  #stage.is-section5-active .hud-dots { bottom: 0.9rem; }
  #stage.is-section5-active .hud-pointnav { display: none; }
  .map-mode-tabs { top: clamp(0.8rem, 2vh, 1.3rem); max-width: calc(100vw - 1.4rem); padding: 5px; }
  .map-mode-tab { padding: 6px 11px; font-size: 0.76rem; }
  .map-legend-card {
    top: clamp(4.6rem, 9vh, 5.6rem);
    bottom: auto;
    left: 0.9rem;
    width: min(250px, 74vw);
    max-height: 42vh;
    padding: 0.85rem 0.95rem 0.95rem;
  }
  .legend-title { font-size: 1rem; }
  .legend-desc { display: none; }
}

/* ---- Private Compendium Access Controls (Authenticated Only) ---------- */
.split-btn-compendium {
  text-decoration: none;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(198, 90, 44, 0.28)) !important;
  border-color: rgba(0, 229, 255, 0.55) !important;
  color: #e0fbff !important;
  font-weight: 600;
}
.split-btn-compendium:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.32), rgba(198, 90, 44, 0.45)) !important;
  border-color: #00e5ff !important;
  color: #ffffff !important;
}

.hud-compendium-pill {
  position: absolute;
  top: clamp(1rem, 2.2vh, 1.6rem);
  left: clamp(1.1rem, 3.4vw, 3.4rem);
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 0.95rem;
  border-radius: 999px;
  background: rgba(9, 13, 20, 0.88);
  border: 1px solid rgba(0, 229, 255, 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 229, 255, 0.14);
  backdrop-filter: blur(12px);
  color: #f0fdff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.hud-compendium-pill:hover {
  transform: translateY(-1px);
  border-color: #00e5ff;
  background: rgba(12, 20, 32, 0.96);
}
.comp-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f5d4;
  box-shadow: 0 0 8px #00f5d4;
}

/* ==========================================================================
   Top-Right Live North Compass + Dynamic Scale Bar Below + 90° Horizontal Btn
   ========================================================================== */
.hud-compass-dock {
  position: fixed;
  top: clamp(0.9rem, 2vh, 1.5rem);
  right: clamp(1rem, 2.6vw, 2.4rem);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.42rem;
  padding: 0.55rem 0.62rem 0.6rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.17) 0%,
    rgba(24, 15, 10, 0.74) 45%,
    rgba(12, 7, 4, 0.9) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.38);
}

.compass-dial-btn {
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}
.compass-dial-btn:hover {
  transform: scale(1.06);
}
.compass-svg {
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
}

.compass-scale-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 78px;
  padding: 3px 6px 2px;
  border-top: 1px solid rgba(246, 239, 228, 0.14);
}
.compass-scale-bar {
  height: 5px;
  border-bottom: 2px solid var(--cream);
  border-left: 2px solid var(--cream);
  border-right: 2px solid var(--cream);
  transition: width 0.16s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.compass-scale-lbl {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compass-horiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(246, 239, 228, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.compass-horiz-btn:hover {
  background: rgba(226, 84, 42, 0.45);
  border-color: #ffffff;
  color: #ffffff;
}
.compass-horiz-btn.is-active {
  background: var(--rust-1);
  border-color: var(--pin);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(226, 84, 42, 0.6);
}

/* ==========================================================================
   Section 05 · Glassmorphic Visor Multicapa CAD / GIS Overlay
   ========================================================================== */
#stage.is-cad-mode .layer-grade {
  opacity: 0;
  transition: opacity 0.3s ease;
}
#stage.is-light-canvas .map-mode-tabs,
#stage.is-light-canvas .s5-cad-panel,
#stage.is-light-canvas .hud-compass-dock,
#stage.is-light-canvas .hud-dots,
#stage.is-light-canvas .hud-map-controls {
  background: rgba(14, 10, 7, 0.92);
  border-color: rgba(20, 14, 10, 0.45);
}
#stage.is-section5-active .hud-compendium-pill {
  top: auto;
  bottom: 1.1rem;
  left: auto;
  right: 5.5rem;
}

.s5-cad-overlay,
#stage.is-section5-active .s5-cad-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.s5-cad-overlay > *,
#stage.is-section5-active .s5-cad-overlay > * {
  pointer-events: auto;
}

.s5-cad-panel {
  --s5-panel-open-w: min(368px, 88vw);
  --s5-panel-open-h: calc(100vh - clamp(4.7rem, 8.8vh, 5.6rem) - clamp(1rem, 2.4vh, 1.8rem));
  --s5-panel-closed-w: min(334px, 88vw);
  --s5-panel-closed-h: 64px;
  position: absolute;
  left: clamp(1rem, 2.6vw, 2.4rem);
  top: clamp(4.7rem, 8.8vh, 5.6rem);
  width: var(--s5-panel-open-w);
  height: var(--s5-panel-open-h);
  display: flex;
  flex-direction: column;
  padding: 0.95rem 1.05rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(22, 14, 9, 0.82) 38%,
    rgba(10, 7, 5, 0.94) 100%
  );
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.68),
    0 4px 16px rgba(0, 0, 0, 0.42),
    inset 0 1px 1px rgba(255, 255, 255, 0.38);
  overflow: hidden;
  transform-origin: top left;
  will-change: height, width;
  transition:
    height 0.56s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.56s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (height: 100svh) {
  .s5-cad-panel {
    --s5-panel-open-h: calc(100svh - clamp(4.7rem, 8.8vh, 5.6rem) - clamp(1rem, 2.4vh, 1.8rem));
  }
}

/* Subtle diagonal specular glass sheen across the panel header edge */
.s5-cad-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 240, 222, 0.11) 46%,
    rgba(226, 84, 42, 0.12) 54%,
    transparent 76%
  );
  transform: translate3d(-125%, 0, 0);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 2;
}
.s5-cad-panel.is-collapsed::before {
  transform: translate3d(125%, 0, 0);
}

.s5-cad-panel.is-collapsed {
  width: var(--s5-panel-closed-w);
  height: var(--s5-panel-closed-h);
  padding: 0.7rem 0.92rem;
  border-radius: 15px;
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.58),
    0 3px 10px rgba(0, 0, 0, 0.36),
    inset 0 1px 1px rgba(255, 255, 255, 0.44);
}
.s5-cad-panel.is-collapsed:hover {
  border-color: rgba(255, 210, 63, 0.52);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.64),
    0 0 18px rgba(226, 84, 42, 0.24),
    inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.s5-cad-head {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(246, 239, 228, 0.14);
  transition:
    padding-bottom 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-bottom-color 0.32s ease;
}
.s5-cad-panel.is-collapsed .s5-cad-head {
  padding-bottom: 0;
  border-bottom-color: rgba(246, 239, 228, 0);
  cursor: pointer;
}
.s5-cad-head-titles {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.s5-cad-head-titles .legend-kicker,
.s5-cad-head-titles .legend-title {
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s5-cad-collapse-btn {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(246, 239, 228, 0.28);
  background: rgba(255, 255, 255, 0.09);
  color: var(--cream);
  cursor: pointer;
  transition:
    background 0.24s ease,
    border-color 0.24s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
}
.s5-cad-collapse-btn:hover {
  background: rgba(226, 84, 42, 0.38);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 12px rgba(226, 84, 42, 0.45);
  transform: scale(1.06);
}
.s5-cad-collapse-btn:active {
  transform: scale(0.92);
}
.s5-cad-panel.is-collapsed .s5-cad-collapse-btn {
  background: rgba(226, 84, 42, 0.26);
  border-color: rgba(255, 210, 63, 0.58);
  box-shadow: 0 0 10px rgba(226, 84, 42, 0.32);
}

/* Morphing two-bar minus <-> plus glyph */
.s5-collapse-glyph {
  position: relative;
  width: 12px;
  height: 12px;
  display: inline-block;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}
.s5-collapse-glyph .bar-h,
.s5-collapse-glyph .bar-v {
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}
.s5-collapse-glyph .bar-h {
  width: 11px;
  height: 1.8px;
  transform: translate(-50%, -50%) rotate(0deg);
}
.s5-collapse-glyph .bar-v {
  width: 1.8px;
  height: 11px;
  transform: translate(-50%, -50%) rotate(-90deg) scaleY(0);
  opacity: 0;
}
.s5-cad-panel.is-collapsed .s5-collapse-glyph {
  transform: rotate(90deg);
}
.s5-cad-panel.is-collapsed .s5-collapse-glyph .bar-v {
  transform: translate(-50%, -50%) rotate(0deg) scaleY(1);
  opacity: 1;
}

.s5-cad-body {
  flex: 1;
  min-height: 0;
  min-width: calc(var(--s5-panel-open-w) - 2.1rem);
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  padding-top: 0.58rem;
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: top left;
  transition:
    opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
    transform 0.46s cubic-bezier(0.22, 1, 0.36, 1) 0.05s,
    visibility 0s linear 0s;
}
.s5-cad-panel.is-collapsed .s5-cad-body {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, -14px, 0) scale(0.975);
  transition:
    opacity 0.2s ease 0s,
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0s,
    visibility 0s linear 0.26s;
}

/* Staggered presentation cascade on inner blocks when unfurling */
.s5-cad-body > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}
.s5-cad-body > *:nth-child(1) { transition-delay: 0.06s; }
.s5-cad-body > *:nth-child(2) { transition-delay: 0.10s; }
.s5-cad-body > *:nth-child(3) { transition-delay: 0.14s; }
.s5-cad-body > *:nth-child(4) { transition-delay: 0.18s; }
.s5-cad-body > *:nth-child(5) { transition-delay: 0.22s; }

.s5-cad-panel.is-collapsed .s5-cad-body > * {
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  transition:
    opacity 0.16s ease 0s,
    transform 0.22s ease 0s;
}

.s5-cad-block {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding-bottom: 0.52rem;
  border-bottom: 1px solid rgba(246, 239, 228, 0.11);
}

.s5-cad-row-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-soft);
}

.s5-cad-seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.s5-seg-btn {
  padding: 5px 4px;
  border-radius: 7px;
  border: 1px solid rgba(246, 239, 228, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-soft);
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.s5-seg-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.14); }
.s5-seg-btn.is-active {
  background: var(--rust-1);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-weight: 700;
}

.s5-cad-subtools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.s5-mini-pill {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(246, 239, 228, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-soft);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.s5-mini-pill.is-active {
  background: rgba(95, 176, 196, 0.28);
  border-color: var(--teal);
  color: #ffffff;
}
.s5-punto-select {
  flex: 1;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid rgba(246, 239, 228, 0.22);
  background: rgba(12, 8, 5, 0.85);
  color: var(--cream);
  font-size: 0.7rem;
}

.s5-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.s5-preset-btn {
  padding: 5px 5px;
  border-radius: 7px;
  border: 1px solid rgba(246, 239, 228, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream-soft);
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.s5-preset-btn:hover { color: #ffffff; border-color: var(--cream); }
.s5-preset-btn.is-active {
  background: var(--pin);
  border-color: #ffffff;
  color: #1a110b;
  font-weight: 700;
}

.s5-db-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.s5-db-status {
  flex: 1;
  text-align: left;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(246, 239, 228, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-soft);
}
.s5-db-status.is-synced {
  border-color: rgba(61, 220, 151, 0.5);
  background: rgba(61, 220, 151, 0.15);
  color: #86efac;
}
.s5-db-status.is-saving {
  border-color: rgba(255, 210, 63, 0.55);
  background: rgba(255, 210, 63, 0.16);
  color: var(--pin);
}
.s5-db-status.is-error {
  border-color: rgba(255, 89, 94, 0.55);
  background: rgba(255, 89, 94, 0.16);
  color: #fca5a5;
}

.s5-layer-search {
  width: 100%;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid rgba(246, 239, 228, 0.24);
  background: rgba(10, 7, 5, 0.72);
  color: #ffffff;
  font-size: 0.75rem;
  outline: none;
}
.s5-layer-search:focus { border-color: var(--pin); }

.s5-opacity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.69rem;
  color: var(--cream-soft);
}
.s5-opacity-row input[type="range"] {
  flex: 1;
  accent-color: var(--rust-1);
}

.s5-layer-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 239, 228, 0.25) transparent;
}

.s5-cat-group { margin-bottom: 0.65rem; }
.s5-cat-head {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pin);
  padding: 0.2rem 0.25rem;
  border-bottom: 1px solid rgba(255, 210, 63, 0.22);
  margin-bottom: 0.28rem;
}

.s5-lyr-row {
  display: grid;
  grid-template-columns: auto 22px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  margin-bottom: 2px;
  transition: background 0.14s ease;
}
.s5-lyr-row:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}
.s5-lyr-row.is-isolated {
  background: rgba(226, 84, 42, 0.22);
  border-color: var(--rust-1);
}
.s5-lyr-row.is-off { opacity: 0.56; }
.s5-lyr-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--rust-1);
  cursor: pointer;
}

.s5-sw-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.s5-color-in {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.s5-sw {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--sw-fill, #00e5ff);
  border: 2px solid var(--sw-stroke, #ffffff);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 0 7px var(--sw-glow, transparent);
  pointer-events: none;
}
.s5-sw.is-line { height: 5px; border-radius: 3px; border-width: 1px; }
.s5-sw.is-point { width: 13px; height: 13px; border-radius: 50%; }
.s5-sw.is-outline { background: transparent; border-style: dashed; }
.s5-sw.is-mixed {
  background: linear-gradient(135deg, #FFD23F 0% 49%, #EF4444 51% 100%);
  border-color: #ffffff;
}

.s5-uso-key {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px 8px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(246, 239, 228, 0.14);
}
.s5-uso-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
}
.s5-uso-box {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1.4px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}
.s5-uso-box.is-viv { background: #FFD23F; }
.s5-uso-box.is-com { background: #EF4444; }
.s5-uso-box.is-ins { background: #00E5D4; }
.s5-uso-box.is-mix { background: linear-gradient(135deg, #FFD23F 0% 49%, #EF4444 51% 100%); }

.s5-lyr-info {
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.s5-lyr-title {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.22;
  color: #ffffff;
}
.s5-vis-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.s5-vis-badge.is-on {
  background: rgba(0, 245, 212, 0.15);
  border: 1px solid rgba(0, 245, 212, 0.45);
  color: #5eead4;
}
.s5-vis-badge.is-hidden {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cream-dim);
}

.s5-lyr-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.s5-cnt-pill {
  font-size: 0.64rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
}
.s5-act-btn {
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid rgba(246, 239, 228, 0.22);
  background: rgba(12, 8, 5, 0.72);
  color: var(--cream-soft);
  font-size: 0.61rem;
  font-weight: 700;
  cursor: pointer;
}
.s5-act-btn:hover { border-color: #ffffff; color: #ffffff; }
.s5-act-btn.is-active {
  background: var(--rust-1);
  border-color: #ffffff;
  color: #ffffff;
}

/* Section 05 Clicked Entity Inspector */
.s5-cad-inspector {
  position: absolute;
  right: clamp(4.8rem, 7vw, 6.2rem);
  bottom: clamp(1rem, 2.4vh, 1.8rem);
  width: min(330px, 84vw);
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(22, 14, 9, 0.86) 40%,
    rgba(10, 7, 5, 0.96) 100%
  );
  backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.s5-insp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(246, 239, 228, 0.14);
  font-size: 0.8rem;
  color: #ffffff;
}
.s5-insp-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.s5-insp-swatch {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1.5px solid #ffffff;
  flex-shrink: 0;
}
.s5-insp-head button {
  background: none;
  border: 0;
  color: var(--cream-soft);
  cursor: pointer;
  font-size: 0.9rem;
}
.s5-insp-sub {
  padding: 0.3rem 0.8rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pin);
  background: rgba(255, 210, 63, 0.08);
  border-bottom: 1px solid rgba(246, 239, 228, 0.1);
}
.s5-insp-scroll {
  overflow-y: auto;
  max-height: 34vh;
}
.s5-insp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}
.s5-insp-table tr { border-bottom: 1px solid rgba(246, 239, 228, 0.09); }
.s5-insp-table th {
  text-align: left;
  padding: 0.34rem 0.5rem 0.34rem 0.8rem;
  color: var(--cream-dim);
  width: 42%;
  font-weight: 500;
}
.s5-insp-table td {
  padding: 0.34rem 0.8rem 0.34rem 0.3rem;
  color: #ffffff;
  word-break: break-word;
}

/* ==========================================================================
   Section 02 · Inline Editable Synthesis Tabs (Observación, Interpretación, Diagnóstico)
   ========================================================================== */
.analysis-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.doc-edit-hint-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 63, 0.42);
  background: rgba(255, 210, 63, 0.11);
  color: var(--pin);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.doc-edit-hint-btn:hover {
  background: rgba(255, 210, 63, 0.24);
  border-color: #ffffff;
  color: #ffffff;
}
.doc-edit-hint-btn.is-editing {
  border-color: rgba(0, 245, 212, 0.55);
  background: rgba(0, 245, 212, 0.16);
  color: #5eead4;
}
[data-doc-edit][contenteditable="true"] {
  outline: 1px dashed rgba(255, 210, 63, 0.38);
  outline-offset: 2px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color 0.15s ease, background 0.15s ease;
}
[data-doc-edit][contenteditable="true"]:hover {
  outline-color: rgba(255, 210, 63, 0.8);
  background: rgba(255, 210, 63, 0.06);
}
[data-doc-edit][contenteditable="true"]:focus {
  outline: 1.5px solid var(--pin);
  background: rgba(255, 210, 63, 0.1);
}
.doc-extra-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.doc-extra-cards:empty {
  display: none;
}
.doc-add-block-btn {
  margin-top: 0.2rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 210, 63, 0.52);
  background: rgba(255, 210, 63, 0.08);
  color: var(--pin);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.doc-add-block-btn:hover {
  background: rgba(255, 210, 63, 0.18);
  border-color: #ffffff;
  color: #ffffff;
}
.doc-del-card-btn {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}
.doc-del-card-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

@media (max-width: 900px) {
  .s5-cad-panel {
    --s5-panel-open-w: min(330px, 84vw);
    --s5-panel-open-h: 55vh;
    --s5-panel-closed-w: min(312px, 84vw);
  }
  .hud-compass-dock {
    padding: 0.4rem 0.45rem;
  }
  .compass-dial-btn { width: 44px; height: 44px; }
  .compass-svg { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .s5-cad-panel,
  .s5-cad-panel::before,
  .s5-cad-head,
  .s5-cad-head-titles,
  .s5-cad-head-titles .legend-title,
  .s5-cad-collapse-btn,
  .s5-collapse-glyph,
  .s5-collapse-glyph .bar-h,
  .s5-collapse-glyph .bar-v,
  .s5-cad-body,
  .s5-cad-body > * {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ==========================================================================
   Section 05 · Vista Base Parallel Elevation Profile Tooltip
   ========================================================================== */
.s5-elev-tooltip,
#stage.is-section5-active .hud-section5-maps > .s5-elev-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 92;
  pointer-events: none !important;
  user-select: none;
  min-width: 158px;
  padding: 0.45rem 0.68rem 0.48rem;
  border-radius: 11px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(22, 13, 8, 0.88) 42%,
    rgba(10, 6, 4, 0.95) 100%
  );
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 210, 63, 0.45);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: var(--font-ui);
  color: var(--cream);
  will-change: transform;
}
.s5-elev-tooltip[hidden] {
  display: none !important;
}
.s5-et-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.16rem;
}
.s5-et-loc {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream-soft);
}
.s5-et-rel {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffd23f;
  font-variant-numeric: tabular-nums;
}
.s5-et-rel.is-base {
  color: #ff9e7a;
}
.s5-et-sub {
  font-size: 0.66rem;
  color: var(--cream-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ==========================================================================
   Section 05 · Tab 06: Plano Arquitectónico (POLYFORM Masterplan Presentation)
   ========================================================================== */
@media (min-width: 901px) and (max-width: 1420px) {
  .map-mode-tabs {
    left: clamp(1rem, 2.2vw, 2rem);
    transform: none;
    max-width: calc(100vw - 9.8rem);
  }
}

#stage.is-masterplan-mode .layer-grade {
  background: radial-gradient(
    ellipse at 50% 52%,
    rgba(249, 249, 244, 0) 58%,
    rgba(243, 242, 234, 0.42) 85%,
    rgba(236, 234, 224, 0.78) 100%
  );
  opacity: 1;
  transition: opacity 0.35s ease, background 0.35s ease;
}

.s5-masterplan-bar {
  position: absolute;
  left: clamp(1.1rem, 3.2vw, 3rem);
  bottom: clamp(1.1rem, 2.8vh, 2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.44rem 0.55rem 0.44rem 0.9rem;
  background: rgba(251, 250, 246, 0.9);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(110, 108, 96, 0.28);
  border-radius: 999px;
  box-shadow:
    0 10px 26px rgba(45, 44, 36, 0.12),
    0 2px 6px rgba(45, 44, 36, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: var(--font-ui);
  color: #3f3e37;
}
.s5-masterplan-bar[hidden] {
  display: none !important;
}

.s5-mp-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #656a56;
  white-space: nowrap;
}

.s5-mp-sep {
  width: 1px;
  height: 15px;
  background: rgba(110, 108, 96, 0.24);
}

.s5-mp-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 108, 96, 0.28);
  background: rgba(240, 239, 232, 0.85);
  color: #3a3932;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.s5-mp-toggle-btn:hover {
  background: #e5e8dc;
  border-color: #7d845e;
  color: #262820;
}
.s5-mp-toggle-btn.is-active {
  background: #7d845e;
  border-color: #5f6645;
  color: #fdfcf9;
}

.s5-mp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8c5843;
  border: 1px solid rgba(58, 57, 50, 0.45);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.s5-mp-toggle-btn.is-active .s5-mp-dot {
  background: #fdfcf9;
  border-color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 900px) {
  .s5-masterplan-bar {
    left: 0.85rem;
    bottom: 3.4rem;
    padding: 0.36rem 0.48rem 0.36rem 0.72rem;
    gap: 0.48rem;
  }
  .s5-mp-kicker {
    font-size: 0.56rem;
    letter-spacing: 0.11em;
  }
}

/* ==========================================================================
   Section 05 · 7th Tab: Propuesta de Intervención (DWG) Floating Pill
   ========================================================================== */
.s5-intervencion-bar {
  flex-wrap: wrap;
  max-width: calc(100vw - 11rem);
  row-gap: 0.4rem;
}
.s5-int-chips {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.58rem;
}
.s5-int-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-weight: 600;
  color: #3a3932;
  white-space: nowrap;
}
.s5-int-chip i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1px solid rgba(40, 42, 36, 0.28);
  flex: none;
}
@media (max-width: 900px) {
  .s5-intervencion-bar {
    max-width: calc(100vw - 1.7rem);
  }
  .s5-int-chips {
    gap: 0.42rem;
  }
  .s5-int-chip {
    font-size: 0.61rem;
  }
}

/* ---- Section 05 · 7th Tab: Callout Bubble — Intervención 1 (Propuesta) ---- */
.s5-int1-bubble {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: min(524px, calc(100vw - 2.4rem));
  padding: 0.56rem 0.78rem 0.64rem;
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid rgba(47, 122, 68, 0.34);
  border-top: 2.5px solid #2f7a44;
  border-radius: 14px;
  box-shadow:
    0 12px 28px rgba(32, 42, 30, 0.14),
    0 2px 8px rgba(32, 42, 30, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-family: var(--font-ui);
  color: #2f2e28;
  will-change: transform;
}
.s5-int1-bubble[hidden] {
  display: none !important;
}
.s5-int1-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.42rem;
  padding-bottom: 0.34rem;
  border-bottom: 1px solid rgba(110, 108, 96, 0.18);
}
.s5-int1-bubble.is-collapsed .s5-int1-head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.s5-int1-bubble.is-collapsed {
  width: auto;
  padding: 0.42rem 0.66rem;
}
.s5-int1-bubble.is-collapsed .s5-int1-list {
  display: none;
}
.s5-int1-head-left {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-width: 0;
}
.s5-int1-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  background: #2f7a44;
  color: #fdfcf9;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.s5-int1-title {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #262520;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.s5-int1-toggle {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(110, 108, 96, 0.28);
  background: rgba(240, 239, 232, 0.85);
  color: #3a3932;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.s5-int1-toggle:hover {
  background: #2f7a44;
  border-color: #2f7a44;
  color: #fdfcf9;
}
.s5-int1-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem 0.72rem;
}
.s5-int1-item {
  display: flex;
  align-items: flex-start;
  gap: 0.38rem;
  font-size: 0.65rem;
  line-height: 1.32;
  color: #414038;
}
.s5-int1-item strong {
  color: #22251e;
  font-weight: 700;
}
.s5-int1-item em {
  font-style: italic;
  color: #2f6c40;
  font-weight: 600;
}
.s5-int1-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.24rem;
  border-radius: 3px;
  border: 1px solid rgba(40, 42, 36, 0.28);
}
.s5-int1-tail {
  position: absolute;
  bottom: -6px;
  left: 26px;
  width: 11px;
  height: 11px;
  background: rgba(251, 250, 246, 0.96);
  border-right: 1px solid rgba(47, 122, 68, 0.34);
  border-bottom: 1px solid rgba(47, 122, 68, 0.34);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ---- Section 05 · 7th Tab: Callout Bubble — Intervención 2 (Estacionamientos) ---- */
.s5-int2-bubble {
  width: min(278px, calc(100vw - 2.4rem));
}
.s5-int2-subtitle {
  margin: 0 0 0.38rem;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.28;
  color: #2f5e3b;
}
.s5-int2-bubble.is-collapsed .s5-int2-subtitle {
  display: none;
}
.s5-int2-list {
  grid-template-columns: 1fr;
  gap: 0.3rem;
}
.s5-int2-tail {
  position: absolute;
  right: -6px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  background: rgba(251, 250, 246, 0.96);
  border-top: 1px solid rgba(47, 122, 68, 0.34);
  border-right: 1px solid rgba(47, 122, 68, 0.34);
  transform: rotate(45deg);
  pointer-events: none;
}
@media (max-width: 900px) {
  .s5-int1-bubble {
    width: min(310px, calc(100vw - 1.7rem));
    padding: 0.46rem 0.6rem 0.52rem;
  }
  .s5-int2-bubble {
    width: min(250px, calc(100vw - 1.7rem));
  }
  .s5-int1-list {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }
  .s5-int1-item {
    font-size: 0.61rem;
    line-height: 1.28;
  }
}

/* ==========================================================================
   Section 05 · 6th Tab: Interactive Magnifying Glass Loupe over Intervención
   ========================================================================== */
.mp-loupe-btn,
#stage.is-section5-active .hud-section5-maps > .mp-loupe-btn {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: -26px;
  margin-top: -26px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
  outline: none;
}
.mp-loupe-btn[hidden] {
  display: none !important;
}

.mp-loupe-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(47, 122, 68, 0.55);
  background: rgba(118, 173, 102, 0.14);
  pointer-events: none;
  animation: mpLoupePulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes mpLoupePulse {
  0%   { transform: scale(0.95); opacity: 0.85; }
  75%  { transform: scale(1.62); opacity: 0; }
  100% { transform: scale(1.62); opacity: 0; }
}

.mp-loupe-lens {
  position: relative;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #255c35;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.92), rgba(242, 245, 236, 0.78));
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  border: 2.2px solid #2f7a44;
  box-shadow:
    0 10px 26px rgba(32, 48, 34, 0.24),
    0 2px 8px rgba(32, 48, 34, 0.14),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, box-shadow 0.2s ease;
}
.mp-loupe-btn:hover .mp-loupe-lens {
  transform: scale(1.1);
  background: #2f7a44;
  color: #f9f9f4;
  box-shadow:
    0 14px 32px rgba(32, 68, 42, 0.34),
    0 0 0 5px rgba(118, 173, 102, 0.28);
}

.mp-loupe-tag {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
  padding: 0.42rem 0.78rem 0.44rem;
  border-radius: 12px;
  background: rgba(249, 249, 244, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(47, 122, 68, 0.34);
  box-shadow: 0 10px 24px rgba(30, 38, 30, 0.16);
  text-align: left;
  transition: transform 0.22s ease, border-color 0.2s ease, background 0.2s ease;
}
.mp-loupe-btn:hover .mp-loupe-tag {
  transform: translateX(3px);
  border-color: #2f7a44;
  background: #ffffff;
}
.mp-loupe-kicker {
  font-family: var(--font-ui);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3d7a4a;
  line-height: 1.1;
}
.mp-loupe-title {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  color: #262520;
  white-space: nowrap;
  line-height: 1.2;
}
@media (max-width: 900px) {
  .mp-loupe-tag {
    display: none;
  }
}


/* ==========================================================================
   Section 05 · 8th Tab: Interactive 3D Twinmotion Walkthrough Stage
   ========================================================================== */
.map-mode-tab-3d {
  color: #7dd3fc !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}
.map-mode-tab-3d.is-active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.92), rgba(16, 185, 129, 0.92)) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}
.s5-mp-btn-3d {
  background: linear-gradient(135deg, #0284c7, #059669) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  font-weight: 700 !important;
}
.s5-mp-btn-3d:hover {
  filter: brightness(1.1);
}

.s5-viewer3d-stage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  background: #0b1220;
  padding-top: 66px;
  pointer-events: auto;
}
.s5-viewer3d-stage[hidden] {
  display: none !important;
}
.s5-viewer3d-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0b1220;
}

#stage.is-viewer3d-mode .map-mode-tabs {
  z-index: 20;
  background: rgba(11, 18, 32, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
}
#stage.is-viewer3d-mode .hud-compass-dock,
#stage.is-viewer3d-mode .hud-map-controls,
#stage.is-viewer3d-mode .hud-pointnav,
#stage.is-viewer3d-mode .hud-scrollcue,
#stage.is-viewer3d-mode .map-mode-sep,
#stage.is-viewer3d-mode .map-dim-btn,
#stage.is-viewer3d-mode .mp-loupe-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Section 05 · Corte Transversal Interactivo (Avenida Central · Bajo Boquete)
   ========================================================================== */
.s5-corte-stage {
  position: fixed;
  inset: 0;
  z-index: 6;
  background: linear-gradient(165deg, #f3efe7 0%, #eae4d9 100%);
  color: #1e1a15;
  padding: 74px clamp(14px, 2vw, 28px) 22px;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: auto;
}
.s5-corte-stage[hidden] {
  display: none !important;
}

#stage.is-corte-mode .map-mode-tabs {
  z-index: 20;
  background: rgba(24, 21, 18, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
}
#stage.is-corte-mode .hud-compass-dock,
#stage.is-corte-mode .hud-map-controls,
#stage.is-corte-mode .hud-pointnav,
#stage.is-corte-mode .hud-scrollcue,
#stage.is-corte-mode .map-mode-sep,
#stage.is-corte-mode .map-dim-btn,
#stage.is-corte-mode .mp-loupe-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}
#stage.is-intervencion-mode .map-mode-sep,
#stage.is-intervencion-mode .map-dim-btn,
#stage.is-intervencion-mode #btn-map-reset-view {
  display: none !important;
}

.corte-shell {
  max-width: 1560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

/* --- Left / Primary Architectural Drafting Board --- */
.corte-board-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.corte-board-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(42, 34, 26, 0.12);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(26, 20, 14, 0.06);
}

.corte-board-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.corte-code-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--rust-1);
  color: #fff;
}
.corte-row-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(30, 26, 21, 0.08);
  color: #3b332a;
}
.corte-speed-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid #c8372d;
  color: #a7251c;
  background: #fff;
}

.corte-board-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 700;
  color: #1c1712;
  line-height: 1.15;
}
.corte-board-sub {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: #5e5449;
}

.corte-board-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.corte-seg-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(30, 26, 21, 0.07);
  border: 1px solid rgba(30, 26, 21, 0.1);
}
.corte-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #4f463c;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.corte-seg-btn:hover { color: #1c1712; }
.corte-seg-btn.is-active {
  background: #1e1a15;
  color: #faf6ee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.corte-tool-btn {
  appearance: none;
  border: 1px solid rgba(30, 26, 21, 0.18);
  background: #fff;
  color: #2e2720;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.corte-tool-btn:hover {
  border-color: var(--rust-1);
  color: var(--rust-1);
}
.corte-tool-btn.is-active {
  background: rgba(198, 90, 44, 0.12);
  border-color: var(--rust-1);
  color: var(--rust-2);
}

/* Unified Architectural Sheet (Render directly stacked over CAD Cross-Section) */
.corte-sheet {
  background: #faf8f4;
  border: 1px solid rgba(42, 34, 26, 0.16);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(28, 22, 16, 0.12);
}

.corte-render-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2000 / 844;
  overflow: hidden;
  background: #1a211d;
  border-bottom: 2px solid #2c2620;
  transition: aspect-ratio 0.25s ease;
}
.s5-corte-stage.is-parking-variant .corte-render-frame {
  aspect-ratio: 2000 / 861;
}
.corte-render-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.corte-antes-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}
.s5-corte-stage.is-showing-antes .corte-antes-img {
  opacity: 1;
}
.corte-state-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #faf6ee;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.s5-corte-stage.is-showing-antes .corte-state-badge {
  background: rgba(168, 69, 31, 0.9);
  border-color: rgba(255, 255, 255, 0.34);
}

.corte-render-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.corte-lateral-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(12, 11, 10, 0.56);
  backdrop-filter: saturate(0.75);
  -webkit-backdrop-filter: saturate(0.75);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.25s ease;
}
.corte-lateral-mask.is-left {
  left: 0;
  border-right: 1.5px solid rgba(255, 255, 255, 0.72);
}
.corte-lateral-mask.is-right {
  right: 0;
  border-left: 1.5px solid rgba(255, 255, 255, 0.72);
}
.s5-corte-stage.is-guides-hidden .corte-lateral-mask {
  opacity: 0.22;
}

.corte-render-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 0;
  border-right: 1px dashed rgba(255, 255, 255, 0.34);
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.corte-render-band.is-narrow .corte-band-pill {
  padding: 3px 5px;
  font-size: 0.56rem;
  gap: 3px;
  bottom: 34px;
}
.corte-render-band.is-narrow:hover,
.corte-render-band.is-narrow.is-active {
  z-index: 5;
}
.corte-render-band:last-child { border-right: 0; }
.corte-render-band:hover,
.corte-render-band.is-active {
  background: color-mix(in srgb, var(--zone-accent) 22%, transparent);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.corte-band-pill {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #faf6ee;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  white-space: nowrap;
  pointer-events: none;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.corte-band-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--zone-accent);
  flex-shrink: 0;
}
.corte-band-pill span:last-child {
  display: none;
  font-weight: 500;
  opacity: 0.88;
}
.corte-render-band:hover .corte-band-pill,
.corte-render-band.is-active .corte-band-pill {
  transform: translateX(-50%) translateY(-4px) scale(1.04);
  background: rgba(20, 18, 16, 0.94);
  border-color: var(--zone-accent);
}
.corte-render-band.is-active .corte-band-pill span:last-child {
  display: inline;
}

.s5-corte-stage.is-guides-hidden .corte-render-band {
  border-right-color: transparent;
}
.s5-corte-stage.is-guides-hidden .corte-band-pill {
  opacity: 0;
}
.s5-corte-stage.is-guides-hidden .corte-render-band:hover .corte-band-pill,
.s5-corte-stage.is-guides-hidden .corte-render-band.is-active .corte-band-pill {
  opacity: 1;
}

/* Vector CAD Cross-Section Frame */
.corte-cad-frame {
  background: #faf8f4;
  padding: 6px 0 4px;
}
.corte-cad-wrap {
  width: 100%;
}
.corte-cad-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}
.cad-zone-group {
  cursor: pointer;
  outline: none;
}
.cad-zone-group .cad-zone-hit {
  transition: fill-opacity 0.18s ease;
}
.cad-zone-group:hover .cad-zone-hit,
.cad-zone-group.is-active .cad-zone-hit {
  fill-opacity: 0.16;
}

/* --- Right Sidebar: Plan Locator + Allocation + Technical Inspector --- */
.corte-side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.corte-card {
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(42, 34, 26, 0.13);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: 0 6px 20px rgba(26, 20, 14, 0.06);
}
.corte-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.corte-card-kicker {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #6b5e50;
}
.corte-card-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--rust-1);
}

/* Mini Plan Locator with Animated Cut Line */
.corte-plan-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(42, 34, 26, 0.15);
  background: #f5f3ed;
}
.corte-plan-img {
  width: 100%;
  height: auto;
  display: block;
}
.corte-plan-cutline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rust-1);
  box-shadow: 0 0 0 2px rgba(198, 90, 44, 0.24);
  transition: left 0.35s var(--ease);
  pointer-events: none;
}
.corte-plan-cutlbl {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--rust-1);
  color: #fff;
  white-space: nowrap;
}
.corte-plan-parking-tag {
  position: absolute;
  top: 23%;
  left: 44%;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: #d92626;
  color: #fff;
  box-shadow: 0 3px 10px rgba(217, 38, 38, 0.35);
  pointer-events: none;
  white-space: nowrap;
}

/* Parking Lot Capacity Highlight Card (48 Plazas) */
.corte-capacity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(45, 122, 88, 0.1) 0%, rgba(198, 90, 44, 0.08) 100%);
  border-color: rgba(45, 122, 88, 0.3);
}
.corte-cap-num {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #1e1a15;
  color: #faf6ee;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(24, 20, 15, 0.18);
}
.corte-cap-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.corte-cap-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #2d7a58;
}
.corte-cap-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1c1712;
  line-height: 1.2;
}
.corte-cap-sub {
  font-size: 0.71rem;
  color: #5b5146;
  line-height: 1.3;
}

/* Space Allocation Bar */
.corte-alloc-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(30, 26, 21, 0.08);
  margin-bottom: 10px;
}
.corte-alloc-seg {
  height: 100%;
  transition: width 0.3s var(--ease);
}
.corte-alloc-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.corte-alloc-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
}
.corte-alloc-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}
.corte-alloc-name { color: #3a322a; font-weight: 500; }
.corte-alloc-val { font-weight: 700; color: #1c1712; }
.corte-alloc-val em { font-style: normal; font-weight: 500; color: #75695b; }

/* Technical Zone Inspector */
.corte-insp-intro {
  margin-bottom: 10px;
}
.corte-insp-kicker {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--rust-2);
  margin-bottom: 4px;
}
.corte-insp-intro p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #5a5045;
}

.corte-zone-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.corte-zone-row {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(42, 34, 26, 0.11);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.corte-zone-row:hover {
  border-color: var(--rust-1);
  background: #fdf9f4;
  transform: translateX(2px);
}
.corte-zone-swatch {
  width: 10px;
  height: 28px;
  border-radius: 4px;
}
.corte-zone-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.corte-zone-meta strong {
  font-size: 0.8rem;
  color: #1c1712;
}
.corte-zone-meta small {
  font-size: 0.7rem;
  color: #6b6053;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.corte-zone-dim {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.corte-zone-dim strong {
  font-size: 0.8rem;
  color: #1c1712;
}
.corte-zone-dim small {
  font-size: 0.68rem;
  color: #776c5e;
}

/* Detailed Single-Zone Card */
.corte-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.corte-detail-kicker {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--zone-accent, var(--rust-1));
}
.corte-detail-title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #1c1712;
}
.corte-detail-sub {
  margin: 2px 0 0;
  font-size: 0.73rem;
  color: #645a4e;
}
.corte-detail-clear {
  appearance: none;
  border: 1px solid rgba(42, 34, 26, 0.16);
  background: #fff;
  color: #4f463c;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
}
.corte-detail-clear:hover {
  border-color: var(--rust-1);
  color: var(--rust-1);
}

.corte-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 11px;
}
.corte-metric-box {
  background: #f5f0e7;
  border: 1px solid rgba(42, 34, 26, 0.09);
  border-radius: 9px;
  padding: 7px 8px;
  text-align: center;
}
.corte-metric-box span {
  display: block;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6e6357;
}
.corte-metric-box strong {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  color: #1c1712;
}

.corte-spec-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.corte-spec-list dt {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6f6356;
  margin-bottom: 2px;
}
.corte-spec-list dd {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.42;
  color: #2c251d;
}

@media (max-width: 1140px) {
  .corte-shell {
    grid-template-columns: 1fr;
  }
  .corte-side-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}
@media (max-width: 720px) {
  .s5-corte-stage {
    padding: 64px 10px 18px;
  }
  .corte-render-frame {
    aspect-ratio: 16 / 9;
  }
  .corte-band-pill {
    font-size: 0.58rem;
    padding: 3px 6px;
  }
}

/* ==========================================================================
   Public Comments Floating Pill & Slide-Over Drawer
   ========================================================================== */
.hud-comments-btn {
  position: absolute;
  right: clamp(1rem, 2.8vw, 2.4rem);
  left: auto;
  bottom: 1.15rem;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 0.92rem;
  border-radius: 999px;
  background: rgba(16, 12, 9, 0.88);
  border: 1px solid rgba(246, 239, 228, 0.26);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
  color: #f6efe4;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.hud-comments-btn:hover {
  transform: translateY(-2px);
  background: rgba(198, 90, 44, 0.92);
  border-color: rgba(255, 210, 63, 0.65);
}
.comments-pill-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.2);
  border: 1px solid rgba(255, 210, 63, 0.45);
  color: #ffd23f;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.comments-drawer {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}
.comments-drawer[hidden] {
  display: none;
}
.comments-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 5, 4, 0.58);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.comments-drawer.is-open .comments-drawer-backdrop {
  opacity: 1;
}
.comments-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 96vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(18, 13, 10, 0.96);
  border-left: 1px solid rgba(246, 239, 228, 0.16);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.55);
  color: #f6efe4;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.comments-drawer.is-open .comments-drawer-panel {
  transform: translateX(0);
}
.comments-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(246, 239, 228, 0.12);
}
.comments-kicker {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ffd23f;
  margin-bottom: 0.25rem;
}
.comments-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.32rem;
  font-weight: 600;
  color: #f6efe4;
}
.comments-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(246, 239, 228, 0.68);
}
.comments-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 228, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #f6efe4;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.comments-close-btn:hover {
  background: rgba(198, 90, 44, 0.5);
  border-color: #f6efe4;
}

.comments-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.35rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.comments-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(246, 239, 228, 0.12);
}
.comments-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.comments-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.comments-field > span,
.comments-field-label-row > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(246, 239, 228, 0.85);
}
.comments-field em {
  color: #ff8c61;
  font-style: normal;
}
.comments-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.comments-char-count {
  font-size: 0.68rem;
  color: rgba(246, 239, 228, 0.5);
}
.comments-field input,
.comments-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.56rem 0.7rem;
  border-radius: 9px;
  border: 1px solid rgba(246, 239, 228, 0.18);
  background: rgba(10, 7, 5, 0.75);
  color: #f6efe4;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.comments-field input:focus,
.comments-field textarea:focus {
  border-color: #ffd23f;
  box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.18);
}
.comments-field textarea {
  resize: vertical;
  min-height: 76px;
}
.comments-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.15rem;
}
.comments-privacy-note {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(246, 239, 228, 0.56);
}
.comments-submit-btn {
  flex-shrink: 0;
  padding: 0.56rem 1.05rem;
  border-radius: 999px;
  border: none;
  background: #c65a2c;
  color: #fffaf3;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.comments-submit-btn:hover:not(:disabled) {
  background: #dd6b39;
  transform: translateY(-1px);
}
.comments-submit-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.comments-feedback {
  padding: 0.52rem 0.75rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 500;
}
.comments-feedback.is-error {
  background: rgba(230, 57, 70, 0.18);
  border: 1px solid rgba(230, 57, 70, 0.5);
  color: #ffb3b8;
}
.comments-feedback.is-success {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.comments-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.2rem;
}
.comments-feed-head h4 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.78);
}
.comments-count-pill {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(246, 239, 228, 0.08);
  color: rgba(246, 239, 228, 0.72);
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.comments-empty {
  padding: 1.4rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(246, 239, 228, 0.55);
  border-radius: 12px;
  border: 1px dashed rgba(246, 239, 228, 0.16);
}
.comment-card {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(246, 239, 228, 0.1);
}
.comment-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.comment-author-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(198, 90, 44, 0.28);
  border: 1px solid rgba(255, 210, 63, 0.4);
  color: #ffd23f;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.comment-meta {
  display: flex;
  flex-direction: column;
}
.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f6efe4;
}
.comment-date {
  font-size: 0.68rem;
  color: rgba(246, 239, 228, 0.5);
}
.comment-body {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(246, 239, 228, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-admin-contact {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(246, 239, 228, 0.12);
  font-size: 0.7rem;
  color: #ffd23f;
}
.comment-del-btn {
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(230, 57, 70, 0.45);
  background: rgba(230, 57, 70, 0.14);
  color: #ffb3b8;
  font-size: 0.68rem;
  cursor: pointer;
}
.comment-del-btn:hover {
  background: rgba(230, 57, 70, 0.35);
}

.comments-mod-bar {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(246, 239, 228, 0.1);
}
.comments-mod-row {
  display: flex;
  justify-content: flex-end;
}
.comments-mod-toggle {
  background: none;
  border: none;
  padding: 0.2rem 0.35rem;
  color: rgba(246, 239, 228, 0.42);
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.comments-mod-toggle:hover {
  color: rgba(246, 239, 228, 0.8);
}
.comments-mod-form {
  margin-top: 0.6rem;
  padding: 0.8rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(246, 239, 228, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.comments-mod-form[hidden],
.comments-mod-active[hidden],
.comments-mod-row[hidden] {
  display: none;
}
.comments-mod-actions {
  display: flex;
  gap: 0.5rem;
}
.comments-mod-submit {
  padding: 0.42rem 0.9rem;
  border-radius: 8px;
  border: none;
  background: #c65a2c;
  color: #fffaf3;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.comments-mod-cancel,
.comments-mod-logout {
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(246, 239, 228, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(246, 239, 228, 0.82);
  font-size: 0.72rem;
  cursor: pointer;
}
.comments-mod-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #ffd23f;
}

@media (max-width: 560px) {
  .comments-form-grid {
    grid-template-columns: 1fr;
  }
  .comments-form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .hud-comments-btn {
    right: 0.85rem;
    left: auto;
    bottom: 0.85rem;
    padding: 0.46rem 0.78rem;
  }
}
