/* ════════════════════════════════════════════════════════
   Finbase Scan — estilo Portrait / Cinematic Light
   Privacy-first, mobile-first, tono amigo, CNMV/BdE.
   ════════════════════════════════════════════════════════ */

:root {
  --text-primary: #08304C;
  --text-secondary: #797979;
  --text-muted: rgba(8, 48, 76, 0.5);

  --accent-indigo: #6366F1;
  --accent-cyan:   #06B6D4;
  --accent-green:  #10B981;
  --accent-amber:  #F59E0B;
  --accent-red:    #EF4444;

  --bg-color: #F7F7F7;
  --bg-card:  rgba(255, 255, 255, 0.82);
  --bg-card-solid: #FFFFFF;
  --bg-app:   #F7F7F7;

  --border-subtle: rgba(8, 48, 76, 0.08);
  --shadow-cloud:  0 10px 40px -10px rgba(8, 48, 76, 0.08);
  --shadow-hover:  0 12px 32px -8px rgba(8, 48, 76, 0.12);

  --success: var(--accent-green);
  --warning: var(--accent-amber);
  --danger:  var(--accent-red);

  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Iconos SVG (institucionales, reemplazan emojis) ─── */
.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: currentColor;
  flex-shrink: 0;
}
.ic svg { width: 22px; height: 22px; display: block; }
.ic.ic-xs svg { width: 14px; height: 14px; }
.ic.ic-sm svg { width: 18px; height: 18px; }
.ic.ic-lg svg { width: 40px; height: 40px; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ─── Mesh background cinemático ─── */
.bg-mesh {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  background: var(--bg-app);
}
.bg-mesh .orb, .bg-mesh::before, .bg-mesh::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 800px; max-height: 800px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  animation: float 22s infinite alternate ease-in-out;
}
.bg-mesh::before {
  background: radial-gradient(circle, var(--accent-indigo), transparent 70%);
  top: -15%; left: -15%;
}
.bg-mesh::after {
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  bottom: -15%; right: -15%;
  animation-duration: 28s;
}
.bg-mesh .orb {
  background: radial-gradient(circle, var(--accent-green), transparent 70%);
  top: 30%; left: 30%;
  opacity: 0.05;
  animation-delay: -12s;
}
@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3vw, -3vw) scale(1.05); }
  100% { transform: translate(-3vw, 3vw) scale(0.95); }
}

/* ─── Header app (top bar) ─── */
#triage-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 4px 24px;
}
.back-btn {
  flex-shrink: 0;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.back-btn:hover { background: #fff; color: var(--text-primary); transform: translateX(-2px); }

.progress-container {
  flex: 1;
  height: 6px;
  background: rgba(8, 48, 76, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 999px;
  width: 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-spacer { width: 40px; }

#step-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 0;
}

/* ─── Tipografía base ─── */
h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 16px;
}
h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 12px;
}
h3 { font-size: 18px; font-weight: 600; }

p.sub, .slider-hint, .slider-why p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}

.accent {
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chip {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}

/* ─── Botones ─── */
.btn-primary, .btn-ghost {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  border: none;
  text-align: center;
}
.btn-primary {
  background: var(--text-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(8, 48, 76, 0.15);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(8, 48, 76, 0.2); }
.btn-primary.btn-lg { padding: 18px 36px; font-size: 17px; }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { background: var(--bg-card-solid); border-color: var(--text-primary); }

.btn-mini-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  margin-top: 16px;
  padding: 8px 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}
.btn-mini-link:hover { color: var(--text-secondary); }

/* ─── Welcome (primera vez / regreso) ─── */
.welcome-first, .welcome-back, .icebreaker, .vibe-response,
.slider-screen, .computing, .result-screen, .history-screen, .history-empty {
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-first, .welcome-back { text-align: center; padding: 32px 8px; }
.welcome-first h1, .welcome-back h1 { margin-bottom: 20px; }
.welcome-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.legal-soft {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
  max-width: 440px;
  margin-left: auto; margin-right: auto;
  line-height: 1.5;
}

/* ─── Icebreaker ─── */
.icebreaker { text-align: center; padding: 32px 8px; }
.vibe-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 32px 0 20px;
}
.vibe-card {
  background: var(--bg-card-solid);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  text-align: center;
}
.vibe-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-indigo);
  box-shadow: 0 12px 28px -8px rgba(99, 102, 241, 0.25);
}
.vibe-emoji { font-size: 40px; margin-bottom: 8px; }
.vibe-label { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.vibe-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.vibe-response { text-align: center; padding: 32px 8px; }
.big-emoji { font-size: 72px; margin-bottom: 20px; }

/* ─── Sliders ─── */
.slider-screen { padding: 16px 8px; }
.slider-top { text-align: center; margin-bottom: 32px; }
.slider-icon {
  width: 72px; height: 72px; margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.05));
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 20px;
  display: grid; place-items: center;
  color: var(--accent-indigo);
}
.slider-icon.ic svg { width: 32px; height: 32px; stroke-width: 1.6; }

.slider-value {
  text-align: center;
  font-size: clamp(40px, 8vw, 60px);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.slider-unit {
  font-size: 0.5em;
  color: var(--text-secondary);
  margin-left: 8px;
  font-weight: 400;
}

input[type=range] {
  width: 100%;
  height: 48px;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  margin: 16px 0 8px;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 3px;
}
input[type=range]::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  background: #fff;
  border: 3px solid var(--accent-indigo);
  border-radius: 50%;
  margin-top: -11px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  cursor: grab;
  transition: transform 0.15s ease;
}
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
input[type=range]::-moz-range-thumb {
  width: 28px; height: 28px;
  background: #fff;
  border: 3px solid var(--accent-indigo);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  cursor: grab;
}

.slider-minmax {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.slider-why {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0 16px;
  margin-bottom: 24px;
  transition: background 0.2s ease;
}
.slider-why summary {
  padding: 12px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  list-style: none;
  font-weight: 500;
}
.slider-why summary::marker { display: none; }
.slider-why summary::-webkit-details-marker { display: none; }
.slider-why summary::before {
  content: '💡 ';
  margin-right: 4px;
}
.slider-why[open] { background: var(--bg-card-solid); }
.slider-why[open] summary { padding-bottom: 0; }
.slider-why p {
  margin: 0; padding: 8px 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.slider-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

/* ─── Computing ─── */
.computing { text-align: center; padding: 80px 16px; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--accent-indigo);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tiny-legal { font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* ─── Resultado — anillos Apple Fitness ─── */
.result-screen { padding: 8px 0 24px; }
.result-top { text-align: center; margin-bottom: 32px; }

.perfil-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.perfil-apuros        { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.perfil-estabilizando { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.perfil-creciendo     { background: rgba(16, 185, 129, 0.12); color: var(--success); }

.result-sub {
  max-width: 480px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Anillos */
.rings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .rings-grid { grid-template-columns: repeat(4, 1fr); }
}

.ring-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ring-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.ring-svg-wrap { position: relative; width: 110px; height: 110px; margin: 0 auto 12px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track {
  fill: none;
  stroke: rgba(8, 48, 76, 0.08);
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring-fill.ring-success { stroke: var(--success); }
.ring-fill.ring-warning { stroke: var(--warning); }
.ring-fill.ring-danger  { stroke: var(--danger); }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-icon { margin-bottom: 2px; color: var(--text-secondary); }
.ring-icon svg { width: 18px; height: 18px; }
.ring-ic-success { color: var(--success); }
.ring-ic-warning { color: var(--warning); }
.ring-ic-danger  { color: var(--danger); }
.ring-pct   {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.ring-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ring-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  min-height: 32px;
}

.ring-delta {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.ring-delta.good { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.ring-delta.bad  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Streaks */
.streaks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.streak {
  background: linear-gradient(135deg, #FEF3C7, #FED7AA);
  color: #92400E;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* Proyección */
.projection {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-cloud);
}
.projection-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.projection-lines { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.line:last-child { border-bottom: none; }
.line-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.line-now .line-dot  { background: var(--text-muted); }
.line-plan .line-dot { background: var(--success); box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }

.line-title { font-size: 14px; color: var(--text-secondary); }
.line-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.line-plan .line-value { color: var(--success); }

.projection-diff {
  text-align: center;
  padding: 12px 0 4px;
  font-size: 16px;
  color: var(--text-primary);
  border-top: 1px dashed var(--border-subtle);
}
.projection-diff strong { color: var(--success); font-weight: 600; font-size: 20px; }

/* Prescripción */
.prescription {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 28px;
}
.presc-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-indigo);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.prescription h2 { margin-bottom: 8px; }
.prescription > p { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.55; }

.presc-actions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.presc-actions li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.presc-ic {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: rgba(99,102,241,0.08);
  color: var(--accent-indigo);
  border-radius: 10px;
  display: grid; place-items: center;
}
.presc-ic.ic svg { width: 18px; height: 18px; }

/* Footer resultado */
.result-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.legal-finprint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
  max-width: 560px;
  margin: 16px auto 0;
  padding: 16px;
  background: rgba(8, 48, 76, 0.03);
  border-radius: 12px;
}

/* ─── Historia ─── */
.history-screen { padding: 8px 0; }
.history-screen h1, .history-screen p.sub { text-align: center; }
.history-empty  { text-align: center; padding: 60px 16px; }

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
}
.history-row {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
}
.history-date {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}
.history-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  padding: 4px 12px;
  border-radius: 999px;
}
.history-score.perfil-apuros        { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.history-score.perfil-estabilizando { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.history-score.perfil-creciendo     { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.history-mini {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.mini-pair { display: inline-flex; align-items: center; gap: 4px; }
.mini-pair .ic { color: var(--text-secondary); }

/* ─── Utilidades ─── */
.loading-state {
  text-align: center;
  padding: 80px 16px;
  color: var(--text-secondary);
}

/* Móvil: respiro extra */
@media (max-width: 480px) {
  #triage-app { padding: 16px 16px 48px; }
  .vibe-options { grid-template-columns: 1fr; }
  .vibe-card { display: grid; grid-template-columns: auto 1fr; align-items: center; text-align: left; gap: 16px; padding: 16px; }
  .vibe-emoji { font-size: 32px; margin: 0; }
  .rings-grid { grid-template-columns: repeat(2, 1fr); }
  .result-footer { flex-direction: column; }
  .result-footer button { width: 100%; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions button { width: 100%; }
}

/* ════════════════════════════════════════════════════════
   F0 — Strip institucional fijo abajo (CNMV/BdE)
   Recordatorio visible siempre durante el flujo del vistazo.
   ════════════════════════════════════════════════════════ */
/* Strip institucional colapsable: 22-26px en estado cerrado;
   click expande con disclaimer completo. Mantiene la cita siempre visible
   sin invadir el viewport en mobile. */
.institutional-strip {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(8, 48, 76, 0.94);
  color: rgba(255,255,255,0.88);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.institutional-strip-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  user-select: none;
}
.institutional-strip-summary::-webkit-details-marker { display: none; }
.institutional-strip-summary::marker { display: none; }
.institutional-strip-summary:hover { background: rgba(255,255,255,0.04); }
.institutional-strip-short strong {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.institutional-strip-chevron {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  transition: transform 0.25s ease;
}
.institutional-strip[open] .institutional-strip-chevron {
  transform: rotate(180deg);
}
.institutional-strip-full {
  padding: 4px 18px 12px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
  animation: stripFadeIn 0.3s ease both;
  max-width: 760px;
  margin: 0 auto;
}
@keyframes stripFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.institutional-strip-full strong { color: #fff; font-weight: 600; }
.institutional-strip a {
  color: rgba(255,255,255,0.94);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-style 0.2s ease;
}
.institutional-strip a:hover {
  color: #fff;
  text-decoration-style: solid;
}
body { padding-bottom: 26px; }
@media (max-width: 480px) {
  .institutional-strip-summary { font-size: 9.5px; padding: 4px 10px; }
  body { padding-bottom: 22px; }
}


/* Disclaimer inline bajo recetas */
.legal-inline {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(8, 48, 76, 0.04);
  border-radius: 10px;
  border-left: 3px solid var(--accent-indigo);
}
.tiny-legal--inline {
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(8, 48, 76, 0.03);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════
   F1 — Bloques A/B/C del resultado + hero score 0-100
   ════════════════════════════════════════════════════════ */
.result-block {
  margin-bottom: 36px;
  position: relative;
}
.result-block:last-of-type { margin-bottom: 24px; }
.block-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-indigo);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 3px 9px;
  background: rgba(99,102,241,0.08);
  border-radius: 999px;
}
.block-title {
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.block-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
  max-width: 540px;
}

/* ─── Grid del bloque A: hero (izq) + anillos 2x2 (der) ─── */
.block-a-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
}
.block-a-hero { min-width: 0; }
.block-a-rings { min-width: 0; }

/* En esta vista los 4 anillos son SIEMPRE 2x2, no 1x4 */
.block-a-rings .rings-grid--secondary {
  grid-template-columns: repeat(2, 1fr) !important;
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .block-a-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ─── HERO SCORE (anillo grande central) ─── */
.hero-score {
  text-align: center;
  margin: 4px auto 0;
  max-width: 560px;
}
.hero-score-svg-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
}
.hero-score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 4px 24px rgba(8, 48, 76, 0.08));
}
.hero-score-track {
  fill: none;
  stroke: rgba(8, 48, 76, 0.07);
  stroke-width: 14;
}
/* El anillo del hero usa SIEMPRE el gradient de marca (indigo→cyan).
   El semáforo (apuros/estabilizando/creciendo) lo informa el chip de
   debajo, no el color del anillo. Esto mantiene coherencia con la home. */
.hero-score-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  stroke: url(#hero-score-gradient);
}

.hero-score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-score-num {
  font-size: 60px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-score-of {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.hero-score-label {
  display: inline-block;
  margin-top: 2px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-score-headline {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 440px;
  margin: 8px auto 0;
}

/* Anillos secundarios (4 indicadores) — más pequeños debajo del hero */
.rings-grid--secondary { gap: 12px; margin-bottom: 12px; }
.rings-grid--secondary .ring-card {
  padding: 12px 10px;
}
.rings-grid--secondary .ring-svg-wrap {
  width: 72px; height: 72px;
  margin-bottom: 8px;
}
.rings-grid--secondary .ring-pct { font-size: 14px; }
.rings-grid--secondary .ring-icon svg { width: 14px; height: 14px; }
.rings-grid--secondary .ring-label { font-size: 10px; margin-bottom: 2px; }
.rings-grid--secondary .ring-sub { font-size: 11px; min-height: 24px; line-height: 1.35; }

/* ════════════════════════════════════════════════════════
   F2 — Gráfico SVG de proyección 10 años
   ════════════════════════════════════════════════════════ */
.projection-chart {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 18px 20px;
  box-shadow: var(--shadow-cloud);
  margin-bottom: 20px;
}
.proj-svg {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
}
.proj-grid {
  stroke: rgba(8, 48, 76, 0.06);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.proj-axis-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
}
.proj-axis-y { text-anchor: end; }
.proj-axis-x { text-anchor: middle; }
.proj-line { vector-effect: non-scaling-stroke; }

.projection-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-item strong {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.legend-now .legend-dot { background: #94A3B8; }
.legend-plan .legend-dot { background: linear-gradient(135deg, #4F46E5, #06B6D4); box-shadow: 0 0 8px rgba(79,70,229,0.4); }

.projection-diff-pill {
  text-align: center;
  font-size: 14px;
  color: var(--text-primary);
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(6,182,212,0.05));
  border: 1px solid rgba(79,70,229,0.18);
  border-radius: 12px;
  margin: 6px auto;
  max-width: 360px;
  font-variant-numeric: tabular-nums;
}
.projection-diff-pill strong {
  color: var(--accent-indigo);
  font-weight: 700;
  font-size: 16px;
}

/* ════════════════════════════════════════════════════════
   F3 — Ruta de aprendizaje (3 momentos curados)
   ════════════════════════════════════════════════════════ */
.learning-path {
  margin-top: 32px;
}
.path-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}
.path-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.path-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .path-grid { grid-template-columns: repeat(3, 1fr); }
}

.path-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}
.path-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px -10px rgba(8, 48, 76, 0.16);
  border-color: rgba(99,102,241,0.25);
}
.path-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: rgba(8,48,76,0.06);
}
.path-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.path-card-num {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.path-num {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  background: var(--text-primary);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.path-card--urgente .path-num { background: linear-gradient(135deg, #4F46E5, #06B6D4); }
.path-card--despues .path-num { background: var(--text-primary); }
.path-card--adelante .path-num { background: rgba(8,48,76,0.55); }

.path-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.path-card--urgente .path-tag { color: var(--accent-indigo); }

.path-card-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.path-card-why {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.path-card-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-indigo);
  margin-top: 4px;
  transition: transform 0.25s ease;
}
.path-card:hover .path-card-cta {
  transform: translateX(4px);
}

/* ════════════════════════════════════════════════════════
   PASOS PARA MEJORAR (lista numerada, sin checks live)
   El usuario los cumple en el mundo real. La revisión
   ocurre en el welcome-back del siguiente vistazo.
   ════════════════════════════════════════════════════════ */
.presc-actions--steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: presc;
}
.presc-step {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border-subtle);
}
.presc-step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.presc-text { font-size: 14px; line-height: 1.5; }

.presc-comeback-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: rgba(99,102,241,0.05);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-style: italic;
}
.presc-comeback-hint .ic { color: var(--accent-indigo); }

/* ════════════════════════════════════════════════════════
   WELCOME-BACK: review de pasos del vistazo anterior
   Aquí SÍ hay checks (es el momento natural de marcar).
   ════════════════════════════════════════════════════════ */
.last-steps-review {
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(6,182,212,0.03));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 22px auto;
  max-width: 520px;
  text-align: left;
  box-shadow: var(--shadow-cloud);
}
.last-steps-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.last-steps-head .ic { color: var(--accent-indigo); }
.last-steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.last-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  transition: opacity 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.last-step.is-done {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16,185,129,0.30);
}
.last-step.is-done .last-step-text {
  color: var(--text-muted);
  text-decoration: line-through;
}
.last-step-check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(8,48,76,0.20);
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  margin-top: 1px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.last-step-check svg {
  width: 12px; height: 12px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.last-step.is-done .last-step-check {
  background: var(--success);
  border-color: var(--success);
}
.last-step.is-done .last-step-check svg {
  opacity: 1;
  transform: scale(1);
}
.last-step-check:hover {
  border-color: var(--accent-indigo);
  transform: scale(1.08);
}
.last-step-text {
  font-size: 13px;
  color: var(--text-primary);
}
.last-steps-foot {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 4px 0 0;
  font-style: italic;
}

/* ════════════════════════════════════════════════════════
   Chip celebrador al principio del nuevo resultado
   ════════════════════════════════════════════════════════ */
.steps-completed-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(16,185,129,0.14), rgba(99,102,241,0.08));
  border: 1px solid rgba(16,185,129,0.30);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(16,185,129,0.10);
  animation: chipBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
.steps-completed-chip strong { color: var(--success); font-weight: 700; }
.steps-completed-emoji { font-size: 18px; line-height: 1; }
@keyframes chipBounce {
  0%   { opacity: 0; transform: scale(0.8) translateY(-6px); }
  60%  { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Confeti grande, formas y tamaños variados — el size/shape lo fija el JS */
.confetti-bit {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

/* Onda de pulso desde el botón al marcar */
.confetti-ring {
  position: fixed;
  pointer-events: none;
  z-index: 8999;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent-indigo);
  transform: translate(-50%, -50%);
}

/* Banner central cuando se completan TODOS los pasos */
.big-celebration-banner {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9100;
  background: linear-gradient(135deg, rgba(16,185,129,0.96), rgba(99,102,241,0.96));
  color: #fff;
  padding: 24px 44px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: 0 20px 60px rgba(8,48,76,0.30), 0 0 0 6px rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  white-space: nowrap;
}
.big-celebration-emoji {
  font-size: 32px;
  display: inline-block;
  animation: bigEmojiSpin 0.8s ease-out;
}
@keyframes bigEmojiSpin {
  from { transform: rotate(-30deg) scale(0.5); }
  to   { transform: rotate(0) scale(1); }
}
@media (max-width: 480px) {
  .big-celebration-banner { font-size: 17px; padding: 18px 28px; }
  .big-celebration-emoji { font-size: 26px; }
}

/* ════════════════════════════════════════════════════════
   F5 — MODO "AJUSTA Y VE" (what-if)
   ════════════════════════════════════════════════════════ */
.whatif-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(6,182,212,0.04));
  border: 1px dashed rgba(99,102,241,0.30);
  color: var(--text-primary);
  padding: 11px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  margin: 14px 0 0;
  transition: all 0.25s ease;
}
.whatif-toggle:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(6,182,212,0.08));
  border-color: var(--accent-indigo);
  border-style: solid;
}
.whatif-toggle .ic { color: var(--accent-indigo); }
.whatif-toggle-label { flex: 1; text-align: left; }
.whatif-chevron {
  transition: transform 0.3s ease;
  color: var(--text-secondary);
  font-size: 14px;
}
.whatif-toggle.is-open .whatif-chevron { transform: rotate(180deg); }

.whatif-panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 12px;
  box-shadow: var(--shadow-cloud);
  animation: whatifSlide 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes whatifSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.whatif-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.whatif-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(8,48,76,0.05);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease;
}
.whatif-pill.is-sim {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(239,68,68,0.10));
  color: #92400E;
  font-weight: 600;
}
.whatif-reset {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.whatif-reset:hover:not(:disabled) {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}
.whatif-reset:disabled { opacity: 0.45; cursor: not-allowed; }

.whatif-sliders-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgba(99,102,241,0.30);
}
.whatif-sliders-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent-indigo);
  margin-bottom: 12px;
}
.whatif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
@media (max-width: 540px) {
  .whatif-grid { grid-template-columns: 1fr; }
}
.whatif-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.whatif-field:last-child,
.whatif-field:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.whatif-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.whatif-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-indigo);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-align: right;
}
.whatif-value small {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
  letter-spacing: 0;
}
.whatif-field input[type=range] {
  grid-column: 1 / -1;
  height: 32px;
  margin: 4px 0 0;
}

/* ════════════════════════════════════════════════════════
   Comparativa interactiva dentro del panel what-if:
   reutiliza los MISMOS gráficos que el resultado, con valores
   simulados, para que el usuario pueda comparar visualmente.
   ════════════════════════════════════════════════════════ */
.whatif-compare {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(99,102,241,0.30);
  animation: whatifSlide 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
.wf-compare-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-indigo);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 10px;
}
.wf-headline-delta {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-size: 13px;
}
.wf-mount {
  padding: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(6,182,212,0.02));
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: 16px;
  position: relative;
}
.wf-mount::before {
  content: "Simulado";
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent-indigo);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.30);
}
.wf-mount-proj { margin-bottom: 16px; }

/* Hero + anillos 2x2 lado a lado — misma estructura que el bloque A real */
.wf-block-a-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.wf-block-a-grid .wf-mount { margin-bottom: 0; }

@media (max-width: 720px) {
  .wf-block-a-grid {
    grid-template-columns: 1fr;
  }
}

/* Hero simulado un poco más pequeño para encajar en la columna izquierda */
.wf-mount-hero .hero-score { margin: 4px auto 0; }
.wf-mount-hero .hero-score-svg-wrap { width: 150px; height: 150px; }
.wf-mount-hero .hero-score-num { font-size: 52px; }
.wf-mount-hero .hero-score-of { font-size: 12px; margin-top: 2px; }
.wf-mount-hero .hero-score-headline { font-size: 13px; margin-top: 6px; }

/* Anillos simulados forzados a 2x2 también */
.wf-mount-rings .rings-grid {
  margin-bottom: 0;
  grid-template-columns: repeat(2, 1fr) !important;
}

/* Gráfico SVG — quitamos el background-card para que respire dentro del wf-mount */
.wf-mount-proj .projection-chart {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Pill verde/rojo para el delta de score en el header */
.wf-delta {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.wf-delta.good { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.wf-delta.bad  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Resumen final con la diferencia a 10 años */
.wf-proj-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(99,102,241,0.04));
  border: 1px solid rgba(16,185,129,0.20);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.wf-proj-summary strong {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.wf-proj-summary strong.pos { color: var(--success); }
.wf-proj-summary strong.neg { color: var(--danger); }

/* Impacto en tus objetivos dentro del modo Ajusta y ve */
.wf-goals-block {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(99,102,241,0.03));
  border: 1px solid rgba(16,185,129,0.20);
  border-radius: 14px;
  padding: 14px 18px;
}
.wf-goals-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 10px;
}
.wf-goal-row {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(8,48,76,0.06);
}
.wf-goal-row:last-child { border-bottom: none; }
.wf-goal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.wf-goal-head .goal-row-ic {
  width: 26px; height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
}
.wf-goal-head .goal-row-ic svg { width: 14px; height: 14px; }
.wf-goal-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.wf-goal-delta {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.wf-goal-delta.good { background: rgba(16, 185, 129, 0.18); color: var(--success); }
.wf-goal-delta.bad  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.wf-goal-delta--equal { background: rgba(8,48,76,0.06); color: var(--text-muted); }

.wf-goal-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.wf-goal-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wf-goal-time span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wf-goal-time strong {
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 600;
}
.wf-goal-time--sim { text-align: right; }
.wf-goal-time--sim strong { color: var(--accent-indigo); }
.wf-goal-arrow {
  color: var(--accent-indigo);
  font-size: 18px;
  font-weight: 700;
}

/* Las cards-anillo simuladas no son clicables (no tienen ringid) — sin bordes ni cursor */
.wf-mount-rings .ring-card {
  cursor: default;
}
.wf-mount-rings .ring-card:hover {
  transform: none;
  box-shadow: none;
}

/* ════════════════════════════════════════════════════════
   F6 — ANILLOS CLICABLES + DETALLE EXPANDIBLE
   ════════════════════════════════════════════════════════ */
.ring-card--interactive {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ring-card--interactive::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  border-radius: 2px;
  background: rgba(8,48,76,0.18);
  transition: background 0.2s ease, width 0.25s ease;
}
.ring-card--interactive { position: relative; }
.ring-card--interactive:hover::after,
.ring-card--interactive.is-active::after {
  background: var(--accent-indigo);
  width: 28px;
}
.ring-card--interactive.is-active {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.ring-detail {
  margin: 12px 0 4px;
}
.ring-detail-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(6,182,212,0.03));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  animation: ringDetailSlide 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes ringDetailSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ring-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ring-detail-head h3 {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ring-detail-ic {
  width: 36px; height: 36px;
  background: rgba(99,102,241,0.10);
  color: var(--accent-indigo);
  border-radius: 10px;
  display: grid; place-items: center;
}
.ring-detail-ic svg { width: 18px; height: 18px; }
.ring-detail-close {
  flex-shrink: 0;
  background: rgba(8,48,76,0.06);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.ring-detail-close:hover { background: var(--text-primary); color: #fff; }

.ring-detail-explain {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.ring-detail-healthy {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(8,48,76,0.04);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.ring-detail-healthy strong {
  color: var(--text-primary);
  font-weight: 600;
}
.ring-detail-actions {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ring-detail-actions li {
  font-size: 13px;
  color: var(--text-primary);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.ring-detail-actions li::before {
  content: "";
  position: absolute;
  left: 6px; top: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
}
.ring-detail-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-indigo);
  text-decoration: none;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 999px;
  transition: all 0.2s ease;
}
.ring-detail-link:hover {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

/* ════════════════════════════════════════════════════════
   F7 — GOALS (objetivos personales)
   ════════════════════════════════════════════════════════ */
.goals-progress {
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(99,102,241,0.04));
  border: 1px solid rgba(16,185,129,0.20);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 24px 0 8px;
  box-shadow: var(--shadow-cloud);
}
.goals-progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.goals-progress-ic { color: var(--success); }
.goals-progress-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.goal-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(8,48,76,0.05);
}
.goal-row:last-child { border-bottom: none; padding-bottom: 4px; }
.goal-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.goal-row-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex: 1;
}
.goal-row-ic {
  width: 30px; height: 30px;
  background: rgba(99,102,241,0.10);
  color: var(--accent-indigo);
  border-radius: 9px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.goal-row-ic svg { width: 16px; height: 16px; }
.goal-row.is-reached .goal-row-ic {
  background: rgba(16,185,129,0.18);
  color: var(--success);
}

.goal-row-remove {
  flex-shrink: 0;
  background: rgba(8,48,76,0.04);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.goal-row-remove svg { width: 14px; height: 14px; }
.goal-row-remove:hover {
  background: var(--danger);
  color: #fff;
  transform: scale(1.08);
}

.goal-bar {
  height: 10px;
  background: rgba(8,48,76,0.07);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 2px rgba(8,48,76,0.06);
}
.goal-bar-fill {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 0 0 8px rgba(99,102,241,0.35);
}
.goal-row.is-reached .goal-bar-fill {
  background: linear-gradient(90deg, var(--success), #34D399);
  box-shadow: 0 0 8px rgba(16,185,129,0.35);
}
.goal-row-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.goal-row-pct strong { color: var(--text-primary); font-weight: 700; }
.goal-row-target { font-variant-numeric: tabular-nums; font-weight: 500; }

.goal-row-estimate {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-indigo);
  font-weight: 500;
  background: rgba(99,102,241,0.06);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--accent-indigo);
}
.goal-row.is-reached .goal-row-estimate {
  color: var(--success);
  background: rgba(16,185,129,0.08);
  border-left-color: var(--success);
}

/* Step de objetivos durante el scan (antes del cómputo) */
.goals-step {
  text-align: center;
  padding: 24px 8px;
  animation: fadeUp 0.5s ease both;
}
.goals-step h1 { margin-bottom: 12px; }
.goals-step .sub { margin-bottom: 28px; }
.goals-step-grid {
  text-align: left;
  margin-bottom: 24px;
}
.goals-step-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

/* Acordeón "gestionar objetivos" en el bloque C del resultado (sustituye al picker) */
.goals-manager {
  margin-top: 24px;
  padding: 0;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}
.goals-manager-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  transition: background 0.2s ease;
}
.goals-manager-summary::-webkit-details-marker { display: none; }
.goals-manager-summary:hover { background: rgba(99,102,241,0.04); }
.goals-manager-summary > span:nth-child(2) { flex: 1; }
.goals-manager-summary .ic { color: var(--accent-indigo); }
.goals-manager-chevron {
  color: var(--text-secondary);
  font-size: 12px;
  transition: transform 0.3s ease;
}
.goals-manager[open] .goals-manager-chevron { transform: rotate(180deg); }
.goals-manager-grid {
  padding: 4px 16px 18px;
}

/* Picker compartido: usado en goals-step y dentro del manager */
.goals-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 540px) {
  .goals-picker-grid { grid-template-columns: 1fr; }
}
.goals-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 540px) {
  .goals-picker-grid { grid-template-columns: 1fr; }
}
.goal-pick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
}
.goal-pick:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(99,102,241,0.30);
}
.goal-pick-ic {
  width: 32px; height: 32px;
  background: rgba(99,102,241,0.10);
  color: var(--accent-indigo);
  border-radius: 9px;
  display: grid; place-items: center;
}
.goal-pick-ic svg { width: 16px; height: 16px; }
.goal-pick-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}
.goal-pick-state {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.goal-pick.is-active {
  background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(99,102,241,0.06));
  border-color: rgba(16,185,129,0.35);
}
.goal-pick.is-active .goal-pick-ic {
  background: rgba(16,185,129,0.18);
  color: var(--success);
}
.goal-pick.is-active .goal-pick-state { color: var(--success); }

/* ════════════════════════════════════════════════════════
   F9 — POLISH (scroll-reveal + streak con flama animada)
   ════════════════════════════════════════════════════════ */
.result-block {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.result-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.result-block--photo { transition-delay: 0s; }
.result-block--evolution { transition-delay: 0.05s; }
.result-block--next { transition-delay: 0.1s; }

/* Streak con flama animada */
.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.streak::before {
  content: "";
  position: absolute;
  left: 12px; top: 50%;
  width: 14px; height: 14px;
  background: radial-gradient(circle, rgba(245,158,11,0.5), transparent 70%);
  transform: translateY(-50%) scale(1);
  filter: blur(2px);
  animation: streakGlow 1.6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes streakGlow {
  from { opacity: 0.4; transform: translateY(-50%) scale(0.9); }
  to   { opacity: 0.85; transform: translateY(-50%) scale(1.25); }
}

/* ════════════════════════════════════════════════════════
   F8 — IMPRIMIR / EXPORTAR PDF (white-label ready)
   ════════════════════════════════════════════════════════ */
@media print {
  /* Limpiar navegación, demo bar, footer institucional fijo */
  .institutional-strip,
  .app-header,
  .whatif-toggle,
  .whatif-panel,
  .ring-detail,
  .result-footer,
  .goals-picker,
  .finbase-demobar,
  .bg-mesh {
    display: none !important;
  }
  body {
    background: #fff !important;
    padding: 0 !important;
    color: #08304C !important;
  }
  body.finbase-demobar-on { padding-top: 0 !important; }
  #triage-app {
    max-width: 100% !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  .result-screen {
    padding: 0 !important;
  }
  .result-block {
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 24px !important;
  }
  .hero-score-svg-wrap { width: 160px !important; height: 160px !important; }
  .hero-score-num { font-size: 56px !important; }
  .ring-svg-wrap { width: 70px !important; height: 70px !important; }
  .rings-grid--secondary { grid-template-columns: repeat(4, 1fr) !important; }
  .path-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .path-card-img { aspect-ratio: 16 / 8 !important; }
  .legal-finprint, .legal-inline, .tiny-legal--inline {
    font-size: 9.5px !important;
    color: #555 !important;
  }

  /* Cabecera de impresión white-label */
  .result-screen::before {
    content: "Finbase · Tu vistazo financiero  ·  Plataforma educativa basada en el Plan de Educación Financiera del Banco de España y la CNMV";
    display: block;
    font-size: 10px;
    color: #444;
    border-bottom: 2px solid #08304C;
    padding-bottom: 6px;
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: 0.04em;
  }
  /* Pie de impresión con disclaimer reforzado */
  .result-screen::after {
    content: "Este documento contiene información educativa, no asesoramiento financiero personalizado. Consulta con tu entidad antes de tomar decisiones. Las rentabilidades pasadas no garantizan rentabilidades futuras. Tus datos no han salido de tu navegador.";
    display: block;
    font-size: 8.5px;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    margin-top: 24px;
    line-height: 1.5;
    text-align: center;
  }

  @page { margin: 14mm 12mm; size: A4 portrait; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .path-card, .path-card-cta, .ring-fill, .hero-score-fill, .proj-line, .proj-area, .proj-end-dot,
  .whatif-panel, .ring-detail-card, .last-step-check, .last-step,
  .result-block, .goal-bar-fill, .streak::before, .steps-completed-chip {
    transition: none !important;
    animation: none !important;
  }
  .hero-score-fill { stroke-dashoffset: 0 !important; }
  .result-block { opacity: 1 !important; transform: none !important; }
}
