:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-alt: #0b1224;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --accent: #a5b4fc;
  --card: #1f2937;
  --border: #243244;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

.nav { position: sticky; top: 0; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); z-index: 10; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
.logo { font-weight: 700; letter-spacing: 0.2px; }
.logo span { color: var(--primary); }
.nav__links a { color: var(--text); text-decoration: none; margin-left: 1rem; font-size: 0.95rem; }
.nav__links a:hover { color: var(--primary); }

.hero { padding: 80px 0 64px; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 16px 0; color: var(--primary); font-weight: 700; line-height: 1.2; }
.hero__subtitle { color: var(--muted); max-width: 720px; font-size: clamp(16px, 2vw, 18px); line-height: 1.6; }
.hero__cta { margin-top: 32px; display: flex; gap: 16px; flex-wrap: wrap; }
/* ✅ Hero features (quick preview) */
.hero__features { display: flex; gap: 24px; margin-top: 48px; flex-wrap: wrap; justify-content: center; }
.hero__feature { display: flex; align-items: center; gap: 8px; padding: 12px 20px; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.2); border-radius: 999px; }
.hero__feature-icon { font-size: 20px; }
.hero__feature-text { color: var(--text); font-size: 14px; font-weight: 500; opacity: 0.95; }
@media (max-width: 768px) {
  .hero__features { gap: 12px; }
  .hero__feature { padding: 10px 16px; font-size: 13px; }
}

.btn { display: inline-block; padding: 10px 16px; background: var(--primary); color: #0b1224; text-decoration: none; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }

.section { padding: 56px 0; }
.section--alt { background: var(--panel-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.card h3 { margin: 0 0 6px 0; color: var(--accent); }
.card p { margin: 0; color: var(--text); opacity: 0.9; }

.simu { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-top: 12px; max-width: 680px; }
.simu__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.simu__row label { color: var(--muted); }
.simu__row input { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: #0c162b; color: var(--text); }

.simu__result { margin-top: 12px; background: #0c162b; border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.muted { color: var(--muted); margin-bottom: 8px; }

.note { margin-top: 16px; color: var(--muted); }

.footer { padding: 40px 0; border-top: 1px solid var(--border); background: var(--panel); margin-top: 48px; }
.footer__inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer a { color: var(--accent); text-decoration: none; font-size: 14px; }
.footer a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 768px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

.badges { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.badge { background:#0c162b; border:1px solid var(--border); padding:6px 10px; border-radius:999px; font-size:.9rem; color:var(--muted); }
/* ===== Asistente IA ===== */
.ai { display:grid; grid-template-columns: 2fr 1.4fr; gap:16px; }
@media (max-width: 1024px){ .ai { grid-template-columns:1fr; } }

.ai__chat { background: var(--card); border:1px solid var(--border); border-radius:16px; padding:12px; height: 420px; overflow: auto; }
.ai__canvas { background: var(--card); border:1px solid var(--border); border-radius:16px; padding:12px; }

.bubble { background:#0c162b; border:1px solid var(--border); border-radius:14px; padding:10px 12px; margin:8px 0; max-width: 92%; position: relative; }
.bubble--ai { border-left:3px solid var(--primary); }
.bubble--me { margin-left:auto; border-right:3px solid var(--accent); background:#0f1a31; }
.bubble__label { font-size:.75rem; color:var(--muted); margin-bottom:4px; }
.bubble__content { line-height:1.5; }

.composer { display:flex; gap:8px; margin-top:12px; }
.composer input { flex:1; padding:12px; border-radius:12px; border:1px solid var(--border); background:#0c162b; color:var(--text); }

.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.chip { background:#0c162b; border:1px solid var(--border); color:var(--text); padding:8px 10px; border-radius:999px; cursor:pointer; }
.chip:hover { border-color: var(--primary); }

.cog__title { font-weight:700; margin-bottom:8px; }
.cog__grid { display:grid; grid-template-columns:1fr; gap:10px; }
.cog__card { background:#0f172a; border:1px solid var(--border); border-radius:12px; padding:10px; }
.cog__card__title { color:var(--muted); margin-bottom:6px; }
.cog__tags { display:flex; flex-wrap:wrap; gap:6px; }
.tag { background:#0c162b; border:1px solid var(--border); border-radius:999px; padding:4px 8px; font-size:.85rem; color:var(--text); }

.trace__row { display:flex; align-items:center; gap:8px; padding:4px 0; color:var(--text); opacity:.9; }
.dot { width:8px; height:8px; border-radius:50%; background:var(--primary); box-shadow: 0 0 10px var(--primary); }

.tools { display:flex; flex-wrap:wrap; gap:6px; }
.tool { background:#071025; border:1px solid var(--border); color:var(--text); padding:8px 10px; border-radius:10px; cursor:pointer; font-size:.9rem; }
.tool:hover { border-color: var(--primary); }
.tools__out { margin-top:8px; color:var(--muted); font-size:.95rem; white-space:pre-wrap; }

.thinking { display:inline-block; }
.thinking .dot1, .thinking .dot2, .thinking .dot3 { display:inline-block; width:6px; height:6px; margin:0 1px; border-radius:50%; background:var(--muted); animation: blink 1s infinite; }
.thinking .dot2 { animation-delay: .2s; }
.thinking .dot3 { animation-delay: .4s; }
@keyframes blink { 0%, 80% {opacity:.2;} 40% {opacity:1;} }
/* Comparador IA */
.formgrid { display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; }
@media (max-width: 900px){ .formgrid { grid-template-columns:1fr; } }
.formgrid label { color: var(--muted); display:block; margin-bottom:4px; }
.formgrid input, .formgrid select {
  width:100%; padding:10px; border-radius:10px; border:1px solid var(--border); background:#0c162b; color:var(--text);
}

.tablewrap { overflow:auto; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { border:1px solid var(--border); padding:8px; text-align:left; }
.table input, .table select { width:100%; box-sizing:border-box; }

.badge2 { display:inline-block; padding:6px 10px; border-radius:999px; border:1px solid var(--border); background:#0c162b; margin:3px; color:var(--text); }
.spark { width:100%; max-width:520px; height:70px; border:1px solid var(--border); border-radius:8px; background:#0c162b; }
.table input, .table select { background:#0c162b; color:var(--text); border:1px solid var(--border); border-radius:8px; padding:8px; }
#cmpOut table { margin-top: 6px; }
#cmpOut .muted { color: var(--muted); }
/* ---- Mercado (swipe) ---- */
.market__filters{display:flex;gap:12px;align-items:center;margin:8px 0 16px}
.market__filters label{display:flex;gap:6px;align-items:center}
.market__actions{display:flex;gap:12px;justify-content:center;margin-top:12px}
.market__summary{margin-top:10px;color:var(--muted)}

.stack{position:relative;width:min(680px,100%);height:420px;margin:0 auto}
.cardx{
  position:absolute;inset:0;border-radius:16px;overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.12);background:#111;
  transform:translate(0,0) rotate(0deg);transition:transform .25s ease, opacity .25s ease;
  touch-action:none;user-select:none;
}
.cardx__img{width:100%;height:100%;object-fit:cover;filter:brightness(.9)}
.cardx__overlay{
  position:absolute;left:0;right:0;bottom:0;padding:12px 14px;
  background:linear-gradient(180deg,transparent,rgba(0,0,0,.8));
  color:#fff;
}
.cardx__title{font-weight:700;font-size:18px}
.cardx__meta{display:flex;gap:10px;flex-wrap:wrap;font-size:13px;opacity:.9}
.badge{display:inline-block;background:rgba(255,255,255,.15);padding:4px 8px;border-radius:999px;font-size:12px}
.ribbon{
  position:absolute;top:12px;left:12px;background:#22c55e;color:#fff;padding:6px 10px;border-radius:999px;font-weight:600;font-size:12px
}
.ribbon--land{background:#0ea5e9}
.hint{
  position:absolute;top:50%;transform:translateY(-50%);padding:8px 12px;border:2px solid #fff;border-radius:8px;
  font-weight:800;font-size:18px;opacity:0;transition:opacity .15s;letter-spacing:1px;color:#fff
}
.hint--like{right:16px;border-color:#22c55e;color:#22c55e}
.hint--nope{left:16px;border-color:#ef4444;color:#ef4444}

.toast{
  position:fixed;left:50%;bottom:24px;transform:translateX(-50%);
  background:#111;color:#fff;padding:10px 14px;border-radius:10px;box-shadow:0 6px 20px rgba(0,0,0,.2);
  z-index:50
}
.favlist{display:grid;gap:10px;margin-top:8px}
.favitem{display:flex;gap:10px;align-items:center}
.favitem img{width:56px;height:56px;border-radius:8px;object-fit:cover}
.favitem .muted{font-size:12px}
.cardx__spark {
  position:absolute; right:12px; top:12px;
  width:120px; height:40px; border-radius:10px;
  background:rgba(0,0,0,.25); backdrop-filter: blur(4px);
  display:flex; align-items:center; justify-content:center;
  padding:4px 6px; overflow:hidden;
}
.cardx__spark svg { width:100%; height:100%; }
.cardx__spark__label{
  position:absolute; left:10px; bottom:4px; font-size:10px; color:#fff; opacity:.85
}
/* --- Match Score flotante --- */
.score-badge{
  position:absolute; left:12px; top:12px; width:78px; height:78px;
  background:rgba(0,0,0,.35); backdrop-filter: blur(6px);
  border-radius:14px; display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 24px rgba(0,0,0,.25);
}
.score-badge__wrap{ position:relative; width:62px; height:62px; }
.score-badge__svg{ transform:rotate(-90deg); width:62px; height:62px; }
.score-badge__track{ stroke:rgba(255,255,255,.2); stroke-width:8; fill:none; }
.score-badge__prog{ stroke:#22c55e; stroke-width:8; stroke-linecap:round; fill:none; transition:stroke .2s ease;
}
.score-badge__num{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:16px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4);
}
.score-badge__meta{
  position:absolute; left:50%; transform:translateX(-50%); bottom:-18px;
  font-size:10px; color:#fff; opacity:.9; letter-spacing:.3px;
}
.leaflet-popup-content { font-size: 14px; }
.mapbadge { display:inline-block; padding:4px 8px; border-radius:999px; background:#111; color:#fff; font-size:11px; margin-right:6px }
/* --- Swipe 3D flip --- */
.cardx { perspective: 1200px; }
.cardx__inner{
  position:absolute; inset:0;
  transform-style: preserve-3d;
  transition: transform .5s ease;
}
.cardx.is-flipped .cardx__inner{ transform: rotateY(180deg); }
.cardx__face{
  position:absolute; inset:0; backface-visibility: hidden;
}
.cardx__face--back{
  transform: rotateY(180deg);
  background: linear-gradient(180deg,#0b0b0b,#111);
  display:flex; flex-direction:column; justify-content:flex-end;
}
.flipbtn{
  position:absolute; top:12px; right:54px; z-index:6;
  background:rgba(0,0,0,.35); color:#fff; border:none; border-radius:8px;
  padding:6px 8px; font-size:12px; backdrop-filter: blur(4px);
}
.flipbtn:hover{ background:rgba(0,0,0,.55); }
.back__content{ padding:14px; color:#fff; }
.back__title{ font-weight:700; font-size:18px; margin-bottom:6px }
.back__grid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; font-size:14px }
.back__metric{ background:rgba(255,255,255,.06); padding:8px 10px; border-radius:10px }
/* ===============================
   Flechas de galería (funcionales)
   =============================== */
.img-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px;
  height:44px;
  border-radius:50%;
  background:rgba(0,0,0,0.4);
  border:1px solid rgba(255,255,255,0.25);
  color:#fff;
  font-size:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:80;
  backdrop-filter: blur(6px);
  box-shadow:0 8px 20px rgba(0,0,0,0.3);
}

.img-prev{ left:12px; }
.img-next{ right:12px; }

.img-nav:hover{
  background:rgba(0,0,0,0.55);
  transform:translateY(-50%) scale(1.05);
}

/* El contenedor debe ser relativo */


/* ===============================
   Ocultar flechas/hints que NO sirven
   =============================== */
/* Flechas de foto (seguras: NO tocan el layout del card) */
button.img-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:46px;
  height:46px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(10,14,25,0.35);
  color: rgba(255,255,255,0.95);
  font-size: 28px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:90;
  user-select:none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.10);
  opacity: 0.85;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}

button.img-nav:hover{
  opacity: 1;
  transform:translateY(-50%) scale(1.06);
  background: rgba(10,14,25,0.50);
}

button.img-nav:active{
  transform:translateY(-50%) scale(0.98);
}

button.img-nav.img-prev{ left: 14px; }
button.img-nav.img-next{ right: 14px; }


button.img-nav.img-prev{ left: 12px; }
button.img-nav.img-next{ right: 12px; }
/* Ocultar el widget/score que aparece arriba a la izquierda */
.score,
.score-badge,
.cardx__score,
.cardx .score,
.cardx__overlay .score {
  display: none !important;
}
/* ===============================
   RESTAURAR INFO DE PRECIO / RENTA
   =============================== */

.cardx__overlay{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(
    to top,
    rgba(5,10,20,0.85),
    rgba(5,10,20,0.45),
    rgba(5,10,20,0.0)
  );
  color: #fff;
  z-index: 40;
  pointer-events: none;
}

.cardx__title{
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.cardx__meta{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cardx__meta .badge{
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(6px);
}
/* ===== Overlay inferior: título + datos ===== */
.cardx__overlay{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.70), rgba(0,0,0,.25), rgba(0,0,0,0));
  color: #fff;
  z-index: 60;
  pointer-events: none;
}

.cardx__title{
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  text-shadow: 0 6px 18px rgba(0,0,0,.45);
}

.cardx__meta{
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 1 !important;
  visibility: visible !important;
}

.cardx__meta .badge{
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.95);
  font-size: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
button.img-nav{
  opacity: .75;
}
.cardx__face:hover button.img-nav{
  opacity: 1;
}
/* Overlay inferior pro + visible */
.cardx__overlay{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.70), rgba(0,0,0,.20), rgba(0,0,0,0));
  z-index:60;
  pointer-events:none;
}

.cardx__title{
  font-size:18px;
  font-weight:700;
  margin:0 0 8px 0;
  color:#fff;
  text-shadow: 0 6px 18px rgba(0,0,0,.45);
}

.cardx__meta{
  display:flex !important;
  flex-wrap:wrap;
  gap:8px;
  opacity:1 !important;
  visibility:visible !important;
}

.cardx__meta .badge{
  display:inline-flex !important;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.95);
  font-size:12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* ===== FIX: overlay estaba demasiado abajo ===== */
/* ✅ Overlay limpio SIN cuadro negro */
.cardx__overlay{
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 58px;        /* posición final */
  padding: 0;          /* sin caja negra */
  background: none !important;
  z-index: 60;
  pointer-events: none;
}

/* Asegurar que el área de la foto tenga espacio */
.cardx__face{
  padding-bottom: 0px;      /* 🔴 reserva espacio para precio/renta */
}

/* Seguridad: que NO se oculte */
.cardx__overlay,
.cardx__meta,
.cardx__meta .badge{
  opacity: 1 !important;
  visibility: visible !important;
}
/* ✅ Overlay siempre visible dentro de la foto */
/* Modal favoritos - animación */
#favModal[hidden] { display:none; }

#favModal .modal-card {
  transform: translateY(10px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

#favModal.show .modal-card {
  transform: translateY(0);
  opacity: 1;
}
/* ===== Modal Favoritos animación ===== */

#favModal {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

#favModal.show {
  opacity: 1;
  pointer-events: auto;
}

#favModal .modal-card {
  transform: translateY(12px);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}

#favModal.show .modal-card {
  transform: translateY(0);
  opacity: 1;
}
.match-badge{
  position:absolute;
  top:14px;
  right:14px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  backdrop-filter: blur(6px);
  z-index: 5;
}
.taste-why{
  margin-top: 6px;
  font-size: 12px;
  opacity: .85;
  line-height: 1.3;
}
.ai-reasons{
  margin-top: 6px;
  font-size: 12px;
  opacity: .85;
  line-height: 1.25;
}
.whybtn{
  position:absolute;
  right:12px;
  bottom:12px;
  padding:6px 10px;
  font-size:12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.35);
  color:rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  cursor:pointer;
}
.whybtn:hover{
  background:rgba(0,0,0,.5);
}
/* ===== Layout base app ===== */
:root{
  --bg:#0b1220;
  --panel:#0f1b33;
  --panel2:#111f3b;
  --stroke:rgba(255,255,255,.10);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.70);
  --radius:18px;
}

body{
  background: radial-gradient(1200px 600px at 20% 0%, rgba(56,189,248,.10), transparent 50%),
              radial-gradient(1000px 500px at 90% 10%, rgba(167,139,250,.10), transparent 45%),
              var(--bg);
  color: var(--text);
}

.app-shell{
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 12px 18px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.55);
  border-bottom: 1px solid var(--stroke);
  padding: 10px 0;
}

.topbar__row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:800; letter-spacing:.2px;
}
.brand .dot{
  width:10px; height:10px; border-radius:99px;
  background: #38bdf8;
  box-shadow: 0 0 0 6px rgba(56,189,248,.12);
}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 10px;
}

.main{
  padding-top: 12px;
}

.stack-wrap{
  position: relative;
  height: min(74vh, 720px);
  min-height: 520px;
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.03);
}

.actionsbar{
  margin-top: 12px;
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
}

.actionbtn{
  width:56px; height:56px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--text);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .10s ease, background .15s ease;
}
.actionbtn:active{ transform: scale(.96); }
.actionbtn:hover{ background: rgba(255,255,255,.08); }
.actionbtn--like{ outline: 1px solid rgba(34,197,94,.25); }
.actionbtn--nope{ outline: 1px solid rgba(239,68,68,.25); }

.small{
  font-size: 12px;
  color: var(--muted);
}
.whybox{
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 10px;

  /* más sutil */
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.18),
    rgba(0,0,0,.22)
  );

  backdrop-filter: blur(8px) saturate(115%);
  -webkit-backdrop-filter: blur(8px) saturate(115%);

  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* IA explicable - micro header */
.whybox__ai{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  opacity: .85;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cardx .whybox{
  animation-delay: .05s;
}

.whybox__t{
  font-size: 11.5px;
  font-weight: 600;
  opacity: .85;
  margin-bottom: 3px;
}
.whybox__sum{
  font-size: 11px;
  line-height: 1.2;
  opacity: .8;
  margin: 2px 0 5px;
}



.whybox__li{
  font-size: 11.5px;
  opacity: .85;
  line-height: 1.3;
}
/* ==============================
   Animación IA explicable
   ============================== */

@keyframes iaExplainFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Evita double-tap zoom / gestures nativos */
#propStack, #propStack * {
  touch-action: manipulation;
}

/* La tarjeta debe manejar el drag, no el navegador */
.cardx {
  touch-action: none;           /* clave para swipe */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Botones flechas: que no disparen gestos/drag */
.galleryBtn, .favnav, #btnLike, #btnNope {
  touch-action: manipulation;
}

/* ===============================
   🎨 PANEL IA PREMIUM (Glassmorphism)
   =============================== */

/* ✅ Badge flotante IA (parte superior, más llamativo y limpio) */
.ai-badge {
  position: absolute !important;
  top: 60px !important; /* ✅ Debajo del spark (40px altura + 12px top + 8px gap) */
  right: 16px !important;
  width: 56px !important; /* ✅ Más grande y llamativo */
  height: 56px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(167, 139, 250, 0.35)) !important;
  backdrop-filter: blur(16px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(200%) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 0 30px rgba(56, 189, 248, 0.4),
    0 0 60px rgba(56, 189, 248, 0.2) !important; /* ✅ Glow más intenso */
  cursor: pointer !important;
  z-index: 75 !important; /* ✅ Encima del overlay (50) pero debajo del panel (90) */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  pointer-events: auto !important;
  overflow: visible !important;
}

.ai-badge:hover {
  transform: scale(1.15) translateY(-2px) !important; /* ✅ Se eleva ligeramente */
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.5), rgba(167, 139, 250, 0.5)) !important;
  box-shadow: 
    0 16px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset,
    0 0 40px rgba(56, 189, 248, 0.6),
    0 0 80px rgba(56, 189, 248, 0.3) !important; /* ✅ Glow más intenso al hover */
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.ai-badge:active {
  transform: scale(1.05) translateY(0) !important;
}

.ai-badge__icon {
  font-size: 26px !important; /* ✅ Icono más grande */
  line-height: 1 !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)) !important;
  z-index: 2 !important;
  position: relative !important;
  animation: aiIconFloat 3s ease-in-out infinite !important; /* ✅ Animación flotante sutil */
}

@keyframes aiIconFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* ✅ Pulso más llamativo cuando el análisis está listo */
.ai-badge__pulse {
  position: absolute !important;
  inset: -6px !important; /* ✅ Pulso más amplio */
  border-radius: 50% !important;
  background: rgba(56, 189, 248, 0.5) !important; /* ✅ Más visible */
  animation: aiPulse 2s ease-in-out infinite !important;
  z-index: 1 !important;
}

@keyframes aiPulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.25); /* ✅ Pulso más amplio */
  }
}

.ai-badge--loading .ai-badge__icon {
  animation: aiSpin 1.5s linear infinite !important;
}

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

.ai-badge--ready {
  animation: aiReady 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important; /* ✅ Bounce más pronunciado */
}

@keyframes aiReady {
  0% { 
    transform: scale(1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(56, 189, 248, 0.4);
  }
  50% { 
    transform: scale(1.2); /* ✅ Más grande al estar listo */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 50px rgba(56, 189, 248, 0.7);
  }
  100% { 
    transform: scale(1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(56, 189, 248, 0.4);
  }
}

/* ✅ Panel lateral premium (glassmorphism) */
.ai-panel {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 0 !important;
  max-width: 380px !important;
  height: 100% !important;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.85) 0%,
    rgba(30, 41, 59, 0.9) 100%
  ) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 
    -8px 0 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
  z-index: 90 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transform: translateX(100%) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  pointer-events: none !important;
  display: flex !important;
  flex-direction: column !important;
}

.ai-panel--open {
  width: min(380px, 85vw) !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

/* ✅ Header del panel */
.ai-panel__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 20px 24px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  ) !important;
  flex-shrink: 0 !important;
}

.ai-panel__title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #fff !important;
  letter-spacing: 0.3px !important;
}

.ai-panel__icon {
  font-size: 18px !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) !important;
}

.ai-panel__close {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  backdrop-filter: blur(8px) !important;
}

.ai-panel__close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: rotate(90deg) !important;
}

.ai-panel__close:active {
  transform: rotate(90deg) scale(0.9) !important;
}

/* ✅ Pill del confidence badge cuando el panel ocupa casi todo (evita encimarse) */
.ai-panel__confidence-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  background: rgba(16, 185, 129, 0.16) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  white-space: nowrap !important;
  margin-left: 10px !important;
  cursor: pointer !important;
}

/* ✅ Contenido del panel */
.ai-panel__content {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 24px !important;
  padding-bottom: 60px !important; /* ✅ Espacio extra al final para ver todo el texto */
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1) !important;
  /* ✅ Asegurar que el scroll funcione suavemente */
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

.ai-panel__content::-webkit-scrollbar {
  width: 8px !important; /* ✅ Scrollbar un poco más visible */
}

.ai-panel__content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05) !important; /* ✅ Track más visible */
  border-radius: 4px !important;
}

.ai-panel__content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3) !important; /* ✅ Thumb más visible */
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.ai-panel__content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5) !important; /* ✅ Más visible al hover */
}

/* ✅ Texto del análisis */
.ai-panel__content .ai-explain-text {
  font-size: 14px !important;
  line-height: 1.8 !important; /* ✅ Más espacio entre líneas para legibilidad */
  color: rgba(255, 255, 255, 0.95) !important; /* ✅ Texto más visible */
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  margin: 0 !important;
  padding-bottom: 20px !important; /* ✅ Espacio extra al final del texto */
}

.ai-panel__content .ai-explain-text strong {
  color: #fff !important;
  font-weight: 600 !important;
}

/* ✅ Balas premium (lista) */
.ai-bullets {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid !important;
  row-gap: 6px !important;
}

.ai-bullets li {
  font-size: 13px !important;
  line-height: 1.25 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 8px 12px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px !important;
  border-left: 2px solid rgba(56, 189, 248, 0.4) !important;
  backdrop-filter: blur(4px) !important;
  transition: all 0.2s ease !important;
  overflow: hidden !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}

.ai-bullets li:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-left-color: rgba(56, 189, 248, 0.7) !important;
  transform: translateX(2px) !important;
}

/* ✅ Responsive: en móvil, panel ocupa más espacio */
@media (max-width: 640px) {
  .ai-panel--open {
    width: 90vw !important;
    max-width: 90vw !important;
  }
  
  .ai-badge {
    width: 52px !important; /* ✅ Mantener tamaño llamativo en móvil */
    height: 52px !important;
    bottom: 90px !important; /* ✅ Ajustar posición en móvil */
    right: 16px !important;
  }
  
  .ai-badge__icon {
    font-size: 24px !important; /* ✅ Icono grande en móvil también */
  }
}

/* ✅ Asegurar que el panel no interfiera con el swipe */
.ai-panel,
.ai-panel *,
.ai-badge {
  touch-action: manipulation !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* =========================
   🤖 BOTÓN FLOTANTE COPILOTO IA
   ========================= */

   .ai-copilot-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    text-decoration: none;
  }
  
  .ai-copilot-inner {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(
      circle at top left,
      #4fd1ff,
      #1e40af
    );
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
      0 0 0 rgba(79, 209, 255, 0.6);
    animation: ai-pulse 2.8s infinite;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
  }
  
  /* Glow animado */
  @keyframes ai-pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(79, 209, 255, 0.45);
    }
    70% {
      box-shadow: 0 0 0 18px rgba(79, 209, 255, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(79, 209, 255, 0);
    }
  }
  
  /* Icono */
  .ai-icon {
    font-size: 30px;
    color: #ffffff;
    z-index: 2;
  }
  
  /* Texto oculto */
  .ai-label {
    position: absolute;
    right: 80px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: all 0.25s ease;
  }
  
  /* Hover */
  .ai-copilot-btn:hover .ai-copilot-inner {
    transform: scale(1.08);
  }
  
  .ai-copilot-btn:hover .ai-label {
    opacity: 1;
    transform: translateX(0);
  }
  
  /* Mobile: sin texto */
  @media (max-width: 768px) {
    .ai-label {
      display: none;
    }
  }
  .ai-copilot-btn:hover {
    transform: scale(1.05);
  }
  
  .ai-copilot-btn:hover .ai-icon {
    filter: drop-shadow(0 0 8px rgba(0, 180, 255, 0.8));
  }

/* =========================
   🔮 BOTÓN FLOTANTE PANEL IA (Futuros)
   ========================= */

.ai-panel-btn {
  position: fixed;
  bottom: 24px;
  right: 110px; /* ✅ A la izquierda del botón azul (72px + 24px gap + 14px) */
  z-index: 9998; /* ✅ Debajo del botón azul (9999) */
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(
    circle at top left,
    rgba(167, 139, 250, 0.9), /* Morado/violeta */
    rgba(99, 102, 241, 0.9)   /* Indigo */
  );
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 0 0 0 rgba(167, 139, 250, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(167, 139, 250, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  animation: panel-btn-pulse 2.8s infinite;
}

.ai-panel-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow:
    0 0 0 8px rgba(167, 139, 250, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(167, 139, 250, 0.6);
}

.ai-panel-btn-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ai-panel-btn-label {
  font-size: 10px;
  line-height: 1;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes panel-btn-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(167, 139, 250, 0.45),
      0 8px 24px rgba(0, 0, 0, 0.3),
      0 0 40px rgba(167, 139, 250, 0.4);
  }
  70% {
    box-shadow:
      0 0 0 12px rgba(167, 139, 250, 0),
      0 8px 24px rgba(0, 0, 0, 0.3),
      0 0 40px rgba(167, 139, 250, 0.4);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(167, 139, 250, 0),
      0 8px 24px rgba(0, 0, 0, 0.3),
      0 0 40px rgba(167, 139, 250, 0.4);
  }
}

/* Responsive: en móvil, ajustar posición */
@media (max-width: 768px) {
  .ai-panel-btn {
    bottom: 100px; /* ✅ Encima del botón azul en móvil */
    right: 24px;
    width: 64px;
    height: 64px;
  }
  
  .ai-panel-btn-icon {
    font-size: 24px;
  }
  
  .ai-panel-btn-label {
    font-size: 9px;
  }
}
  /* ==========================
   FIX: Botón "Cerrar" en Favoritos no visible
   (texto blanco sobre fondo blanco / opacity)
   Solo CSS, no rompe nada.
========================== */

#favModal a,
#favModal button {
  /* evita heredar blanco si el modal es blanco */
  color: #111;
}

#favModal .close,
#favModal .btn-close,
#favModal .modal-close,
#favModal [data-action="close"],
#favModal [aria-label="Cerrar"],
#favModal [aria-label="Close"],
#favModal #closeFavBtn,
#favModal .closeFavBtn {
  color: #111 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-decoration: none;
}

/* si el botón es un link y le aplicaron "muted" muy agresivo */
#favModal .muted,
#favModal .muted a,
#favModal .muted button {
  color: #111 !important;
  opacity: 1 !important;
}

/* ============================================
   MÓDULO FUTUROS PROBABLES (Panel IA)
   ============================================ */

.fut-module {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fut-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fut-card {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fut-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fut-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.fut-prob {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.9;
}

.fut-desc {
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.75;
}

.fut-band {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.fut-band-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 8px;
}

.fut-label {
  opacity: 0.8;
  font-size: 11px;
}

.fut-values {
  font-weight: 500;
  font-size: 12px;
  color: #e8eef7;
  text-align: right;
}

.fut-drivers,
.fut-breakpoints {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fut-label-small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 6px;
}

.fut-ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fut-ul li {
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.72;
  padding-left: 0;
  position: relative;
}

.fut-ul li::before {
  content: "•";
  margin-right: 6px;
  opacity: 0.6;
}

/* Responsive: ajustar en pantallas pequeñas */
@media (max-width: 480px) {
  .fut-card {
    padding: 10px;
  }
  
  .fut-band-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .fut-values {
    text-align: left;
  }
}

/* ===== ONBOARDING ===== */

/* Overlay del modal de bienvenida */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.onboarding-overlay--active {
  opacity: 1;
}

/* Modal de bienvenida */
.onboarding-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.onboarding-modal--active {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.onboarding-modal__content {
  padding: 2rem;
}

.onboarding-modal__header {
  text-align: center;
  margin-bottom: 2rem;
}

.onboarding-modal__header h2 {
  font-size: clamp(24px, 4vw, 32px);
  margin: 0 0 0.5rem 0;
  color: var(--primary);
  font-weight: 700;
}

.onboarding-modal__subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

.onboarding-modal__body {
  margin-bottom: 2rem;
}

/* Preview de funcionalidades */
.onboarding-features-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.onboarding-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.1);
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.onboarding-feature-item:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.2);
}

.onboarding-feature-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.onboarding-feature-item strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.onboarding-feature-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.onboarding-modal__footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .onboarding-modal__footer {
    flex-direction: column;
  }
}

.btn--onboarding-primary {
  background: var(--primary);
  color: #0b1224;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.btn--onboarding-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn--onboarding-primary:active {
  transform: translateY(0);
}

.btn--onboarding-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn--onboarding-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--muted);
}

/* Overlay del tour */
.onboarding-tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.onboarding-tour-overlay--active {
  opacity: 1;
  pointer-events: auto;
}

/* Tooltip del tour */
.onboarding-tooltip {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  max-width: 380px;
  width: calc(100vw - 2rem);
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.onboarding-tooltip--active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.onboarding-tooltip__content {
  padding: 1.5rem;
}

.onboarding-tooltip__header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.onboarding-tooltip__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.onboarding-tooltip__title {
  margin: 0 0 0.5rem 0;
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 700;
}

.onboarding-tooltip__description {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.onboarding-tooltip__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.onboarding-tooltip__progress {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.onboarding-tooltip__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn--tooltip-primary {
  background: var(--primary);
  color: #0b1224;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.btn--tooltip-primary:hover {
  filter: brightness(1.1);
}

.btn--tooltip-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn--tooltip-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Highlight para elementos del tour */
.onboarding-highlight {
  position: relative;
  z-index: 10000 !important;
  outline: 3px solid var(--primary);
  outline-offset: 4px;
  border-radius: 8px;
  transition: outline-color 0.2s ease;
}

/* Toast de finalización */
.onboarding-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: calc(100vw - 2rem);
}

.onboarding-toast--active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.onboarding-toast__content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.onboarding-toast__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.onboarding-toast__content span:last-child {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
}

@media (max-width: 480px) {
  .onboarding-modal__content {
    padding: 1.5rem;
  }
  
  .onboarding-tooltip {
    max-width: calc(100vw - 2rem);
  }
  
  .onboarding-tooltip__footer {
    flex-direction: column;
    align-items: stretch;
  }
  
  .onboarding-tooltip__actions {
    width: 100%;
  }
  
  .onboarding-tooltip__actions button {
    flex: 1;
  }
}

/* ===== LOADING STATES ===== */

/* Button loading state */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: 0.7;
}

.btn--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Spinner component */
.loading-spinner {
  display: inline-block;
  position: relative;
}

.loading-spinner__ring {
  display: inline-block;
  position: relative;
  width: 40px;
  height: 40px;
}

.loading-spinner--small .loading-spinner__ring {
  width: 20px;
  height: 20px;
}

.loading-spinner--large .loading-spinner__ring {
  width: 60px;
  height: 60px;
}

.loading-spinner__ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid var(--primary);
  border-radius: 50%;
  animation: spinner-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: var(--primary) transparent transparent transparent;
}

.loading-spinner--small .loading-spinner__ring div {
  border-width: 2px;
}

.loading-spinner--large .loading-spinner__ring div {
  border-width: 4px;
}

.loading-spinner__ring div:nth-child(1) {
  animation-delay: -0.45s;
}

.loading-spinner__ring div:nth-child(2) {
  animation-delay: -0.3s;
}

.loading-spinner__ring div:nth-child(3) {
  animation-delay: -0.15s;
}

@keyframes spinner-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-overlay--active {
  opacity: 1;
}

.loading-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-overlay__message {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--panel) 0%,
    var(--card) 50%,
    var(--panel) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton--text {
  height: 1rem;
  border-radius: 4px;
}

.skeleton--card {
  border-radius: 12px;
  min-height: 200px;
}

.skeleton--image {
  border-radius: 8px;
  background-color: var(--panel);
}

.skeleton--button {
  border-radius: 8px;
  height: 40px;
}

/* Skeleton grid para listas */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading state para secciones completas */
.section-loading {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
}

.section-loading__message {
  color: var(--muted);
  font-size: 1rem;
}

/* Loading inline (para elementos pequeños) */
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.loading-inline .loading-spinner {
  width: 14px;
  height: 14px;
}

/* Mejoras para badge de IA (ya existente pero mejoramos) */
.ai-badge--loading {
  opacity: 0.7;
  pointer-events: none;
}

.ai-badge--loading .ai-badge__icon {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* === Comparador: Recomendaciones IA (FASE 5) === */
#comparador .cmp-rec-wrap {
  margin-top: 16px;
}

#comparador .cmp-rec {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.25);
  padding: 12px;
}

#comparador .cmp-rec__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

#comparador .cmp-rec__title {
  font-weight: 650;
  letter-spacing: 0.2px;
}

#comparador .cmp-rec__sub {
  font-size: 11px;
  opacity: 0.9;
}

#comparador .cmp-rec__winner {
  border: 1px solid rgba(96, 165, 250, 0.20);
  background: rgba(59, 130, 246, 0.10);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

#comparador .cmp-rec__section {
  margin-top: 8px;
}

#comparador .cmp-rec__k {
  font-weight: 650;
  font-size: 12px;
  margin-bottom: 4px;
}

#comparador .cmp-rec__list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.92);
}

#comparador .cmp-rec__foot {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.8;
}

@media (max-width: 900px) {
  #comparador .cmp-rec__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Comparador: Radar Chart Multi-dimensional (FASE 5) === */
#comparador .cmp-radar-wrap {
  margin-top: 16px;
}

#comparador .cmp-radar-out {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.25);
  padding: 16px;
}

#comparador .cmp-radar-out h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

@media (max-width: 768px) {
  #comparador .cmp-radar-out {
    padding: 12px;
  }
}

/* === Comparador: Risk/Reward Matrix (APP REAL) === */
#comparador .cmp-risk-reward-wrap {
  margin-top: 16px;
}

#comparador .cmp-risk-reward-out {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.25);
  padding: 16px;
}

#comparador .cmp-risk-reward-out h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

/* Puntos interactivos del scatter plot */
.risk-reward-point {
  cursor: pointer;
  transition: all 0.2s ease;
}

.risk-reward-point:hover {
  filter: brightness(1.2);
  stroke-width: 3;
}

@media (max-width: 768px) {
  #comparador .cmp-risk-reward-out {
    padding: 12px;
  }
}

/* ==========================================
   WALK SCORE - BADGES COMPACTOS PARA DECK
   ========================================== */

/* Contenedor de Walk Score en la card */
.cardx__walkscore {
  margin: 8px 0 6px 0;
  pointer-events: none;
}

/* Loading compacto para deck */
.walkscore-loading-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.walkscore-loading-compact__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Contenedor de badges compactos */
.walkscore-badges-compact {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* Badge individual compacto */
.walkscore-badge-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.walkscore-badge-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Walk Score - Verde Esmeralda translúcido */
.walkscore-badge-compact--walk {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.15) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

/* Transit Score - Azul Zafiro translúcido */
.walkscore-badge-compact--transit {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: rgba(59, 130, 246, 0.4);
  color: #3b82f6;
}

/* Bike Score - Púrpura Amatista translúcido */
.walkscore-badge-compact--bike {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-color: rgba(139, 92, 246, 0.4);
  color: #8b5cf6;
}

.walkscore-badge-compact__icon {
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.walkscore-badge-compact__score {
  font-size: 12px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Animación sutil de entrada */
@keyframes fadeInWalk {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.walkscore-badges-compact {
  animation: fadeInWalk 0.4s ease-out;
}

.walkscore-badge-compact:nth-child(1) {
  animation-delay: 0.1s;
}

.walkscore-badge-compact:nth-child(2) {
  animation-delay: 0.2s;
}

.walkscore-badge-compact:nth-child(3) {
  animation-delay: 0.3s;
}

/* Responsive - Aún más compactos en móvil */
@media (max-width: 768px) {
  .walkscore-badge-compact {
    padding: 3px 6px;
    gap: 3px;
    font-size: 10px;
  }
  
  .walkscore-badge-compact__icon {
    font-size: 11px;
  }
  
  .walkscore-badge-compact__score {
    font-size: 11px;
  }
  
  .walkscore-badges-compact {
    gap: 4px;
  }
  
  .cardx__walkscore {
    margin: 6px 0 4px 0;
  }
}

/* ==========================================
   INVESTMENT METRICS BADGES (DECK PRINCIPAL)
   Demographics, Weather, Safety
   ========================================== */

.cardx__investment-metrics {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  position: relative;
  opacity: 0;
  animation: fadeInSlideUp 0.4s ease-out 0.2s forwards;
}

.investment-badges-compact {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.investment-badge-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.investment-badge-compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.investment-badge-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.8s ease-in-out;
}

.investment-badge-compact:hover::before {
  left: 100%;
}

.investment-badge-compact__icon {
  font-size: 12px;
  line-height: 1;
}

.investment-badge-compact__label {
  font-size: 9px;
  opacity: 0.7;
}

.investment-badge-compact__value {
  font-weight: 700;
  font-size: 11px;
}

/* Demographics Badge - Investment Grade */
.investment-badge-compact--demographics.grade-a-plus {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.15);
}

.investment-badge-compact--demographics.grade-a {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.15);
}

.investment-badge-compact--demographics.grade-b {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.15);
}

/* Weather Badge - Habitability */
.investment-badge-compact--weather.habit-excellent {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.15);
}

.investment-badge-compact--weather.habit-good {
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.15);
}

.investment-badge-compact--weather.habit-fair {
  background: rgba(234, 179, 8, 0.25);
  border-color: rgba(234, 179, 8, 0.15);
}

/* Safety Badge - Safety Score */
.investment-badge-compact--safety.safety-high {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.15);
}

.investment-badge-compact--safety.safety-medium {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.15);
}

.investment-badge-compact--safety.safety-low {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.15);
}

/* Loading State */
.investment-loading-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.investment-loading-compact__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

  /* ==========================================
     BOTÓN "VER AMBIENTE" (DECK PRINCIPAL)
     ========================================== */

  .cardx__ambiente-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    margin: 12px 0 8px 0;
    pointer-events: auto;
    position: relative;
    z-index: 5;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }

  .cardx__ambiente-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
  }

  .cardx__ambiente-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  }

  .cardx__ambiente-btn:hover::before {
    left: 100%;
  }

  .cardx__ambiente-btn:active {
    transform: translateY(0);
  }

  .cardx__ambiente-btn-icon {
    font-size: 16px;
    line-height: 1;
  }

  .cardx__ambiente-btn-text {
    letter-spacing: 0.5px;
  }

  /* Responsive */
  @media (max-width: 480px) {
    .cardx__ambiente-btn {
      padding: 8px 16px;
      font-size: 12px;
      gap: 6px;
    }
    .cardx__ambiente-btn-icon {
      font-size: 14px;
    }
  }

  /* ==========================================
     AMBIENTE DATA PANEL (SECCIÓN AMBIENTE)
     ========================================== */

  .ambiente-data-panel {
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.95) 0%, rgba(15, 31, 58, 0.95) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
  }

  .ambiente-data-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
    opacity: 0.6;
  }

  .ambiente-data-panel__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
  }

  .ambiente-data-panel__loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  .ambiente-data-panel__title {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: 0.5px;
  }

  .ambiente-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
  }

  /* ==========================================
     AMBIENTE METRIC CARDS
     ========================================== */

  .ambiente-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .ambiente-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color, #3b82f6);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .ambiente-metric-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  .ambiente-metric-card:hover::before {
    opacity: 1;
  }

  .ambiente-metric-card--demographics {
    --card-color: #10b981;
  }

  .ambiente-metric-card--weather {
    --card-color: #f59e0b;
  }

  .ambiente-metric-card--safety {
    --card-color: #8b5cf6;
  }

  .ambiente-metric-card--walkscore {
    --card-color: #3b82f6;
  }

  .ambiente-metric-card__icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 12px;
    display: block;
    text-align: center;
  }

  .ambiente-metric-card__title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
  }

  .ambiente-metric-card__value {
    font-size: 36px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 4px;
    text-align: center;
    line-height: 1;
  }

  .ambiente-metric-card__label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 16px;
  }

  .ambiente-metric-card__details {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ambiente-metric-card__details > div {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    line-height: 1.5;
  }

  .ambiente-metric-card__details > div:last-child {
    margin-bottom: 0;
  }

  /* Responsive */
  @media (max-width: 768px) {
    .ambiente-data-panel {
      padding: 16px;
    }
    
    .ambiente-data-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }
    
    .ambiente-metric-card {
      padding: 16px;
    }
    
    .ambiente-metric-card__icon {
      font-size: 28px;
    }
    
    .ambiente-metric-card__value {
      font-size: 28px;
    }
  }

  @media (max-width: 480px) {
    .ambiente-data-grid {
      grid-template-columns: 1fr;
    }
  }

  /* ==========================================
     AMBIENTE SECTION DIVIDERS (SEPARADORES)
     ========================================== */

  .ambiente-section-divider {
    margin: 24px 0 16px 0;
  }

  .ambiente-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  .ambiente-section-icon {
    font-size: 24px;
    line-height: 1;
  }

  .ambiente-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color, #3b82f6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
  }

  .ambiente-section-description {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 0 34px;
    font-style: italic;
  }

  .ambiente-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    margin: 32px 0;
    border-radius: 2px;
  }

  /* ==========================================
     AMBIENTE PLACEHOLDER (CUANDO NO HAY ANÁLISIS)
     ========================================== */

  .ambiente-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    text-align: center;
    min-height: 200px;
  }

  .ambiente-placeholder-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.6;
  }

  .ambiente-placeholder-text {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 24px 0;
    max-width: 400px;
    line-height: 1.5;
  }

  .ambiente-placeholder-text strong {
    color: #3b82f6;
    font-weight: 600;
  }

  .ambiente-placeholder-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .ambiente-placeholder-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
  }

  /* Responsive */
  @media (max-width: 768px) {
    .ambiente-section-description {
      margin-left: 0;
      text-align: center;
    }

    .ambiente-section-header {
      flex-direction: column;
      text-align: center;
    }

    .ambiente-placeholder {
      padding: 32px 16px;
    }

    .ambiente-placeholder-icon {
      font-size: 36px;
    }
  }