/**
 * Traducción de la RESULTS VIEW del artifact. Dos adaptaciones deliberadas
 * a datos reales (no es una reinterpretación libre del diseño):
 *
 * 1. La columna "similitud" (alta/media/baja, inventada por el LLM en la
 *    demo) se reemplaza por "precisión" (real/aproximada) — el dato real
 *    que sí existe (Fase 3, punto 2). Mismo lenguaje visual (punto de
 *    color + leyenda), dos estados en vez de tres.
 * 2. El mapa por distancia queda con un overlay "no disponible todavía"
 *    mientras no haya geocoding de la dirección del sujeto — hoy
 *    radioRealAplicado siempre es false en el flujo real, así que no hay
 *    distancias que graficar. Se activa solo cuando la haya, sin tocar
 *    el CSS/SVG que ya está listo.
 */

.results-view {
  max-width: 768px;
  margin-inline: auto;
  padding: 40px 24px;
}

.results-view__address {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--color-subtle);
  margin-bottom: 4px;
}

.results-view__chips {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin-bottom: 32px;
  font-size: 11.5px; color: #B0AB9C;
}
.results-view__chips span:not(:last-child)::after { content: "·"; margin-left: 12px; }

/* ---------- Loading / error ---------- */
.results-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 112px 0; gap: 16px;
}
.breathing-line-track { width: 80px; height: 1px; background: var(--color-hairline); position: relative; overflow: hidden; }
.breathing-line { position: absolute; inset: 0; background: var(--color-gold-line); animation: breathe 1.4s ease-in-out infinite; transform-origin: left center; }
@keyframes breathe { 0%, 100% { transform: scaleX(0.3); opacity: .4; } 50% { transform: scaleX(1); opacity: 1; } }
.results-loading__label { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--color-subtle); }

.results-error { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 96px 0; text-align: center; }
.results-error p { font-size: 13px; color: var(--color-subtle); margin: 0; }
.link-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--color-navy);
  border-bottom: 1px solid var(--color-gold-line);
  padding-bottom: 2px;
}

.results-content { display: flex; flex-direction: column; gap: 40px; }

/* ---------- Value blocks ---------- */
.value-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 64px;
}
.value-block { position: relative; padding-left: 16px; border-left: 1px solid var(--color-hairline); }
.value-block__num { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.375rem); margin-top: 8px; color: var(--color-navy); }

.range-bar { margin-top: 20px; }
.range-bar__track { position: relative; height: 1px; background: var(--color-hairline); }
.range-bar__gradient { position: absolute; inset: 0; background: linear-gradient(90deg, var(--color-hairline), var(--color-gold-line), var(--color-hairline)); }
.range-bar__dot { position: absolute; top: 50%; border-radius: 999px; transform: translate(-50%, -50%); }
.range-bar__dot--end { left: 0; width: 5px; height: 5px; background: var(--color-subtle); }
.range-bar__dot--end.is-right { left: 100%; }
.range-bar__dot--mid { width: 9px; height: 9px; background: var(--color-navy); border: 1.5px solid var(--color-gold-line); }
.range-bar__labels { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--color-subtle); }

/* ---------- Map ---------- */
.map-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.map-legend { display: flex; align-items: center; gap: 16px; font-size: 10.5px; color: var(--color-subtle); }
.map-legend__item { display: flex; align-items: center; gap: 6px; }
.sim-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; display: inline-block; }

.map-box {
  position: relative;
  height: 220px;
  background: #F7F4EB;
  border: 1px solid var(--color-hairline);
  border-radius: 14px;
  overflow: hidden;
}
.map-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-compass { position: absolute; top: 10px; right: 12px; display: flex; flex-direction: column; align-items: center; }
.map-compass span { font-size: 9px; font-weight: 700; color: var(--color-subtle); letter-spacing: 1px; }
.map-compass i { width: 1px; height: 10px; background: #C7C0AC; margin-top: 1px; display: block; }
.map-scale { position: absolute; bottom: 10px; left: 12px; display: flex; align-items: center; gap: 6px; }
.map-scale__bar { width: 28px; height: 1px; background: var(--color-subtle); }
.map-scale span { font-size: 9px; color: var(--color-subtle); }
.map-center-pulse {
  position: absolute; top: 50%; left: 50%; width: 34px; height: 34px;
  transform: translate(-50%, -50%); border-radius: 999px;
  background: rgba(0, 32, 62, 0.12);
  animation: mapPulse 2.2s ease-out infinite;
}
@keyframes mapPulse { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: .7; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.map-center-marker {
  position: absolute; top: 50%; left: 50%; width: 18px; height: 18px;
  transform: translate(-50%, -50%); border-radius: 999px;
  background: var(--color-navy); border: 1.5px solid var(--color-gold-line);
  box-shadow: 0 2px 6px rgba(0,32,62,0.35);
  display: flex; align-items: center; justify-content: center; color: white;
  z-index: 2;
}
.map-dot { position: absolute; border-radius: 999px; transform: translate(-50%, -50%); width: 9px; height: 9px; border: 1.5px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2); z-index: 2; }
.map-disabled {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(253, 252, 250, 0.85);
  backdrop-filter: blur(2px);
  padding: 24px;
}
.map-disabled p { font-size: 11.5px; color: var(--color-subtle); max-width: 320px; margin: 0; line-height: 1.5; }

/* ---------- Table ---------- */
.table-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.table-section__actions { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--color-subtle); }
.table-section__actions button { background: none; border: none; cursor: pointer; color: inherit; font: inherit; padding: 0; }
.table-section__actions button:hover { text-decoration: underline; text-underline-offset: 2px; }

.table-scroll { overflow-x: auto; }
.comparables-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 640px; }
.comparables-table thead tr { color: var(--color-subtle); border-bottom: 1px solid var(--color-gold-line); }
.comparables-table th { text-align: left; font-weight: 500; padding-bottom: 8px; white-space: nowrap; }
.comparables-table th.is-right, .comparables-table td.is-right { text-align: right; }
.comparables-table tbody tr { border-top: 1px solid var(--color-hairline); transition: background .15s; }
.comparables-table tbody tr:hover { background: var(--color-hairline-hover); }
.comparables-table td { padding: 10px 4px; color: var(--color-ink); white-space: nowrap; }
.comparables-table td.is-muted { color: var(--color-subtle); }
.comparables-table td.is-strong { font-weight: 600; color: var(--color-navy); }
.comparables-table td.is-checkbox { width: 24px; }
.comparables-table td.is-dot { width: 16px; }
.comparables-table tr.is-excluded { opacity: .4; }
.badge-precision {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10px;
  text-transform: uppercase; letter-spacing: .04em;
}

@media (max-width: 767px) {
  .results-view { padding: 24px 20px; }
  .value-grid { grid-template-columns: 1fr; gap: 24px; }
}
